plugmcp 0.0.0-stage → 0.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.
Files changed (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +232 -2
  3. package/dist/agent.d.ts +20 -0
  4. package/dist/agent.js +35 -0
  5. package/dist/build.d.ts +13 -0
  6. package/dist/build.js +83 -0
  7. package/dist/cli/cloud.d.ts +20 -0
  8. package/dist/cli/cloud.js +56 -0
  9. package/dist/cli/index.d.ts +2 -0
  10. package/dist/cli/index.js +326 -0
  11. package/dist/dev/api.d.ts +37 -0
  12. package/dist/dev/api.js +788 -0
  13. package/dist/dev/chat.d.ts +63 -0
  14. package/dist/dev/chat.js +159 -0
  15. package/dist/dev/dev.d.ts +22 -0
  16. package/dist/dev/dev.js +188 -0
  17. package/dist/dev/edit.d.ts +22 -0
  18. package/dist/dev/edit.js +147 -0
  19. package/dist/dev/generate.d.ts +21 -0
  20. package/dist/dev/generate.js +97 -0
  21. package/dist/dev/keys.d.ts +61 -0
  22. package/dist/dev/keys.js +55 -0
  23. package/dist/dev/project.d.ts +26 -0
  24. package/dist/dev/project.js +68 -0
  25. package/dist/dev/store.d.ts +61 -0
  26. package/dist/dev/store.js +113 -0
  27. package/dist/dev/views.d.ts +9 -0
  28. package/dist/dev/views.js +54 -0
  29. package/dist/http.d.ts +33 -0
  30. package/dist/http.js +79 -0
  31. package/dist/index.d.ts +77 -0
  32. package/dist/index.js +118 -0
  33. package/dist/install.d.ts +13 -0
  34. package/dist/install.js +54 -0
  35. package/dist/landing.d.ts +3 -0
  36. package/dist/landing.js +62 -0
  37. package/dist/stdio.d.ts +3 -0
  38. package/dist/stdio.js +5 -0
  39. package/dist/view/index.d.ts +34 -0
  40. package/dist/view/index.js +90 -0
  41. package/package.json +114 -4
  42. package/studio-dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  43. package/studio-dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  44. package/studio-dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  45. package/studio-dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  46. package/studio-dist/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  47. package/studio-dist/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  48. package/studio-dist/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  49. package/studio-dist/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  50. package/studio-dist/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  51. package/studio-dist/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  52. package/studio-dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  53. package/studio-dist/assets/index-BSR7LH_V.css +1 -0
  54. package/studio-dist/assets/index-D_yIYje_.js +137 -0
  55. package/studio-dist/index.html +15 -0
@@ -0,0 +1,137 @@
1
+ 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,t.exports),e=null),t.exports),s=(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},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=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.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(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 P(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,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(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 F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function te(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ne(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else te(ne.bind(null,e))}var L={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ne,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=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.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 D(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)E.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 D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=te,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();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`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(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.browser=function(e){return{$$typeof:o,_reason:e}},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 c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.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=d(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=d(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,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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=d(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=d(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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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 l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),m=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=p()})),h=o((e=>{var t=f(),n=u(),r=m();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){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e: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 d(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 p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),ee=Symbol.for(`react.forward_ref`),I=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),L=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),R=Symbol.for(`react.legacy_hidden`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.for(`react.view_transition`),z=Symbol.for(`react.recoverable`),oe=Symbol.iterator;function se(e){return typeof e!=`object`||!e?null:(e=oe&&e[oe]||e[`@@iterator`],typeof e==`function`?e:null)}var ce=Symbol.for(`react.client.reference`);function le(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case I:return`Suspense`;case te:return`SuspenseList`;case re:return`Activity`;case ae:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case ee:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case L:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var ue=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},pe=[],me=-1;function he(e){return{current:e}}function ge(e){0>me||(e.current=pe[me],pe[me]=null,me--)}function _e(e,t){me++,pe[me]=e.current,e.current=t}var ve=he(null),ye=he(null),be=he(null),xe=he(null);function Se(e,t){switch(_e(be,t),_e(ye,e),_e(ve,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xp(t),e=Sp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ge(ve),_e(ve,e)}function Ce(){ge(ve),ge(ye),ge(be)}function we(e){var t=e.memoizedState;t!==null&&(vh._currentValue=t.memoizedState,_e(xe,e)),t=ve.current;var n=Sp(t,e.type);t!==n&&(_e(ye,e),_e(ve,n))}function V(e){ye.current===e&&(ge(ve),ge(ye)),xe.current===e&&(ge(xe),vh._currentValue=fe)}var Te,Ee;function De(e){if(Te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Te=t&&t[1]||``,Ee=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+Te+e+Ee}var Oe=!1;function ke(e,t){if(!e||Oe)return``;Oe=!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}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}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(`
4
+ `),l=s.split(`
5
+ `);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=`
6
+ `+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{Oe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?De(n):``}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return De(e.type);case 16:return De(`Lazy`);case 13:return e.child!==t&&t!==null?De(`Suspense Fallback`):De(`Suspense`);case 19:return De(`SuspenseList`);case 0:case 15:return ke(e.type,!1);case 11:return ke(e.type.render,!1);case 1:return ke(e.type,!0);case 31:return De(`Activity`);case 30:return De(`ViewTransition`);default:return``}}function je(e){try{var t=``,n=null;do t+=Ae(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Me=Object.prototype.hasOwnProperty,Ne=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,Fe=t.unstable_shouldYield,Ie=t.unstable_requestPaint,Le=t.unstable_now,Re=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,We=t.log,Ge=t.unstable_setDisableYieldValue,Ke=null,qe=null;function Je(e){if(typeof We==`function`&&Ge(e),qe&&typeof qe.setStrictMode==`function`)try{qe.setStrictMode(Ke,e)}catch{}}var Ye=Math.clz32?Math.clz32:Qe,Xe=Math.log,Ze=Math.LN2;function Qe(e){return e>>>=0,e===0?32:31-(Xe(e)/Ze|0)|0}var $e=256,et=262144,tt=4194304;function H(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&-e;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 nt(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=H(n))):i=H(o):i=H(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=H(n))):i=H(o)):i=H(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 rt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function it(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ye(n),i=1<<r;t|=e[r],n&=~i}return t}function at(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 ot(){var e=tt;return tt<<=1,!(tt&62914560)&&(tt=4194304),e}function st(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ct(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function lt(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-Ye(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&&ut(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ut(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ye(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function dt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ye(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ft(e,t){var n=t&-t;return n=n&42?1:pt(n),(n&(e.suspendedLanes|t))===0?n:0}function pt(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 mt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ht(){var e=de.p;return e===0?(e=window.event,e===void 0?32:Ph(e.type)):e}function gt(e,t){var n=de.p;try{return de.p=e,t()}finally{de.p=n}}var _t=Math.random().toString(36).slice(2),vt=`__reactFiber$`+_t,yt=`__reactProps$`+_t,bt=`__reactContainer$`+_t,xt=`__reactEvents$`+_t,St=`__reactListeners$`+_t,Ct=`__reactHandles$`+_t,wt=`__reactResources$`+_t,Tt=`__reactMarker$`+_t,Et=`__reactLoad$`+_t;function Dt(e){delete e[vt],delete e[yt],delete e[St],delete e[Ct]}function Ot(e){var t;if(t=e[vt])return t;for(var n=e.parentNode;n;){if(t=n[bt]||n[vt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cm(e);e!==null;){if(n=e[vt])return n;e=Cm(e)}return t}e=n,n=e.parentNode}return null}function kt(e){if(e=e[vt]||e[bt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function At(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function jt(e){var t=e[wt];return t||=e[wt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Mt(e){e[Tt]=!0}function Nt(e){e[Et]=void 0}var Pt=new Set,Ft={};function It(e,t){Lt(e,t),Lt(e+`Capture`,t)}function Lt(e,t){for(Ft[e]=t,e=0;e<t.length;e++)Pt.add(t[e])}var Rt=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]*$`),zt={},Bt={};function Vt(e){return Me.call(Bt,e)?!0:Me.call(zt,e)?!1:Rt.test(e)?Bt[e]=!0:(zt[e]=!0,!1)}var Ht=!1;function Ut(){var e=Ht;return Ht=!1,e}function Wt(e,t,n){if(Vt(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 Gt(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 Kt(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 qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Yt(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 Xt(e){if(!e._valueTracker){var t=Jt(e)?`checked`:`value`;e._valueTracker=Yt(e,t,``+e[t])}}function Zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Jt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Qt=/[\n"\\]/g;function $t(e){return e.replace(Qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function en(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=``+qt(t)):e.value!==``+qt(t)&&(e.value=``+qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):nn(e,qt(n)):o===`number`&&e.value==t?nn(e,qt(e.value)):nn(e,qt(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=``+qt(s):e.removeAttribute(`name`)}function tn(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)){Xt(e);return}n=n==null?``:``+qt(n),t=t==null?n:``+qt(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),Xt(e)}function nn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function rn(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=``+qt(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 an(e,t,n){t!=null&&(t=``+qt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+qt(n)}function on(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ue(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Xt(e)}function sn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cn=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 ln(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||cn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function un(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]=``,Ht=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(ln(e,a,r),Ht=!0)}else for(var o in t)t.hasOwnProperty(o)&&ln(e,o,t[o])}function dn(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 fn=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`],[`maskType`,`mask-type`],[`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`]]),pn=/^[\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 mn(e){return pn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function hn(){}var gn=null;function _n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vn=null,yn=null;function bn(e){var t=kt(e);if(t&&(e=t.stateNode)){var n=e[yt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(en(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="`+$t(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[yt]||null;if(!a)throw Error(i(90));en(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&&Zt(r)}break a;case`textarea`:an(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&rn(e,!!n.multiple,t,!1)}}}var xn=!1;function Sn(e,t,n){if(xn)return e(t,n);xn=!0;try{return e(t)}finally{if(xn=!1,(vn!==null||yn!==null)&&(qd(),vn&&(t=vn,e=yn,yn=vn=null,bn(t),e)))for(t=0;t<e.length;t++)bn(e[t])}}function Cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[yt]||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 wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Tn=!1;if(wn)try{var En={};Object.defineProperty(En,"passive",{get:function(){Tn=!0}}),window.addEventListener(`test`,En,En),window.removeEventListener(`test`,En,En)}catch{Tn=!1}var Dn=null,On=null,kn=null;function An(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.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 kn=i.slice(e,1<r?1-r:void 0)}function jn(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 Mn(){return!0}function Nn(){return!1}function Pn(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)?Mn:Nn,this.isPropagationStopped=Nn,this}return D(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=Mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Mn)},persist:function(){},isPersistent:Mn}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},In=Pn(Fn),Ln=D({},Fn,{view:0,detail:0}),Rn=Pn(Ln),zn,Bn,Vn,Hn=D({},Ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$n,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!==Vn&&(Vn&&e.type===`mousemove`?(zn=e.screenX-Vn.screenX,Bn=e.screenY-Vn.screenY):Bn=zn=0,Vn=e),zn)},movementY:function(e){return`movementY`in e?e.movementY:Bn}}),Un=Pn(Hn),Wn=Pn(D({},Hn,{dataTransfer:0})),Gn=Pn(D({},Ln,{relatedTarget:0})),Kn=Pn(D({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0})),qn=Pn(D({},Fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Jn=Pn(D({},Fn,{data:0})),Yn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Xn={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`},Zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zn[e])?!!t[e]:!1}function $n(){return Qn}var er=Pn(D({},Ln,{key:function(e){if(e.key){var t=Yn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=jn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Xn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$n,charCode:function(e){return e.type===`keypress`?jn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?jn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),tr=Pn(D({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nr=Pn(D({},Fn,{submitter:0})),rr=Pn(D({},Ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$n})),ir=Pn(D({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ar=Pn(D({},Hn,{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})),or=Pn(D({},Fn,{newState:0,oldState:0,source:0})),sr=[9,13,27,32],cr=wn&&`CompositionEvent`in window,lr=null;wn&&`documentMode`in document&&(lr=document.documentMode);var ur=wn&&`TextEvent`in window&&!lr,dr=wn&&(!cr||lr&&8<lr&&11>=lr),fr=` `,pr=!1;function mr(e,t){switch(e){case`keyup`:return sr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function hr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var gr=!1;function _r(e,t){switch(e){case`compositionend`:return hr(t);case`keypress`:return t.which===32?(pr=!0,fr):null;case`textInput`:return e=t.data,e===fr&&pr?null:e;default:return null}}function vr(e,t){if(gr)return e===`compositionend`||!cr&&mr(e,t)?(e=An(),kn=On=Dn=null,gr=!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 dr&&t.locale!==`ko`?null:t.data;default:return null}}var yr={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 br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!yr[e.type]:t===`textarea`}function xr(e,t,n,r){vn?yn?yn.push(r):yn=[r]:vn=r,t=ip(t,`onChange`),0<t.length&&(n=new In(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Sr=null,Cr=null;function wr(e){Xf(e,0)}function Tr(e){if(Zt(At(e)))return e}function Er(e,t){if(e===`change`)return t}var Dr=!1;if(wn){var Or;if(wn){var kr=`oninput`in document;if(!kr){var Ar=document.createElement(`div`);Ar.setAttribute(`oninput`,`return;`),kr=typeof Ar.oninput==`function`}Or=kr}else Or=!1;Dr=Or&&(!document.documentMode||9<document.documentMode)}function jr(){Sr&&(Sr.detachEvent(`onpropertychange`,Mr),Cr=Sr=null)}function Mr(e){if(e.propertyName===`value`&&Tr(Cr)){var t=[];xr(t,Cr,e,_n(e)),Sn(wr,t)}}function Nr(e,t,n){e===`focusin`?(jr(),Sr=t,Cr=n,Sr.attachEvent(`onpropertychange`,Mr)):e===`focusout`&&jr()}function Pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Tr(Cr)}function Fr(e,t){if(e===`click`)return Tr(t)}function Ir(e,t){if(e===`input`||e===`change`)return Tr(t)}function Lr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Rr=typeof Object.is==`function`?Object.is:Lr;function zr(e,t){if(Rr(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(!Me.call(t,i)||!Rr(e[i],t[i]))return!1}return!0}function Br(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hr(e,t){var n=Vr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Vr(n)}}function Ur(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ur(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Br(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=Br(e.document)}return t}function Gr(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=wn&&`documentMode`in document&&11>=document.documentMode,qr=null,Jr=null,Yr=null,Xr=!1;function Zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xr||qr==null||qr!==Br(r)||(r=qr,`selectionStart`in r&&Gr(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}),Yr&&zr(Yr,r)||(Yr=r,r=ip(Jr,`onSelect`),0<r.length&&(t=new In(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=qr)))}function Qr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var $r={animationend:Qr(`Animation`,`AnimationEnd`),animationiteration:Qr(`Animation`,`AnimationIteration`),animationstart:Qr(`Animation`,`AnimationStart`),transitionrun:Qr(`Transition`,`TransitionRun`),transitionstart:Qr(`Transition`,`TransitionStart`),transitioncancel:Qr(`Transition`,`TransitionCancel`),transitionend:Qr(`Transition`,`TransitionEnd`)},ei={},ti={};wn&&(ti=document.createElement(`div`).style,`AnimationEvent`in window||(delete $r.animationend.animation,delete $r.animationiteration.animation,delete $r.animationstart.animation),`TransitionEvent`in window||delete $r.transitionend.transition);function ni(e){if(ei[e])return ei[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ti)return ei[e]=t[n];return e}var ri=ni(`animationend`),ii=ni(`animationiteration`),ai=ni(`animationstart`),oi=ni(`transitionrun`),si=ni(`transitionstart`),ci=ni(`transitioncancel`),li=ni(`transitionend`),ui=new Map,di=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);di.push(`scrollEnd`);function fi(e,t){ui.set(e,t),It(t,[e])}var pi=0;function mi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Od.identifierPrefix;var n=pi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function hi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Id;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function gi(e,t){return e=hi(e),t=hi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var _i=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},vi=[],yi=0,bi=0;function xi(){for(var e=yi,t=bi=yi=0;t<e;){var n=vi[t];vi[t++]=null;var r=vi[t];vi[t++]=null;var i=vi[t];vi[t++]=null;var a=vi[t];if(vi[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&&Ti(n,i,a)}}function Si(e,t,n,r){vi[yi++]=e,vi[yi++]=t,vi[yi++]=n,vi[yi++]=r,bi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ci(e,t,n,r){return Si(e,t,n,r),Ei(e)}function wi(e,t){return Si(e,null,null,t),Ei(e)}function Ti(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-Ye(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ei(e){if(50<Ld)throw Ld=0,Rd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Di={};function Oi(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 ki(e,t,n,r){return new Oi(e,t,n,r)}function Ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ji(e,t){var n=e.alternate;return n===null?(n=ki(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&1206910976,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 Mi(e,t){e.flags&=1206910978;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 Ni(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ai(r)&&(s=1);else if(typeof r==`string`)s=ih(e,n,ve.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case re:return e=ki(31,n,t,a),e.elementType=re,e.lanes=o,e;case j:return Pi(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=ki(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case I:return e=ki(13,n,t,a),e.elementType=I,e.lanes=o,e;case te:return e=ki(19,n,t,a),e.elementType=te,e.lanes=o,e;case R:case ae:return e=a|32,e=ki(30,n,t,e),e.elementType=ae,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case ee:s=11;break a;case ne:s=14;break a;case L:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ki(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Pi(e,t,n,r){return e=ki(7,e,r,t),e.lanes=n,e}function Fi(e,t,n){return e=ki(6,e,null,t),e.lanes=n,e}function Ii(e){var t=ki(18,null,null,0);return t.stateNode=e,t}function Li(e,t,n){return t=ki(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ri=new WeakMap;function zi(e,t){if(typeof e==`object`&&e){var n=Ri.get(e);return n===void 0?(t={value:e,source:t,stack:je(t)},Ri.set(e,t),t):n}return{value:e,source:t,stack:je(t)}}var Bi=[],Vi=0,Hi=null,Ui=0,Wi=[],Gi=0,Ki=null,qi=1,Ji=``;function Yi(e,t){Bi[Vi++]=Ui,Bi[Vi++]=Hi,Hi=e,Ui=t}function Xi(e,t,n){Wi[Gi++]=qi,Wi[Gi++]=Ji,Wi[Gi++]=Ki,Ki=e;var r=qi;e=Ji;var i=32-Ye(r)-1;r&=~(1<<i),n+=1;var a=32-Ye(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,qi=1<<32-Ye(t)+i|n<<i|r,Ji=a+e}else qi=1<<a|n<<i|r,Ji=e}function Zi(e){e.return!==null&&(Yi(e,1),Xi(e,1,0))}function Qi(e){for(;e===Hi;)Hi=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null;for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,Ji=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null}function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ji,Wi[Gi++]=Ki,qi=t.id,Ji=t.overflow,Ki=e}var ea=null,ta=null,na=!1,ra=null,ia=!1,aa=Error(i(519));function oa(e){throw fa(zi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),aa}function sa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[vt]=e,t[yt]=r,n){case`dialog`:Zf(`cancel`,t),Zf(`close`,t);break;case`iframe`:case`object`:case`embed`:Zf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Jf.length;n++)Zf(Jf[n],t);break;case`source`:Zf(`error`,t);break;case`img`:case`image`:case`link`:Zf(`error`,t),Zf(`load`,t);break;case`details`:Zf(`toggle`,t);break;case`input`:Zf(`invalid`,t),tn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Zf(`invalid`,t);break;case`textarea`:Zf(`invalid`,t),on(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||up(t.textContent,n)?(r.popover!=null&&(Zf(`beforetoggle`,t),Zf(`toggle`,t)),r.onScroll!=null&&Zf(`scroll`,t),r.onScrollEnd!=null&&Zf(`scrollend`,t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||oa(e,!0)}function ca(e){for(ea=e.return;ea;)switch(ea.tag){case 5:case 31:case 13:ia=!1;return;case 27:case 3:ia=!0;return;default:ea=ea.return}}function la(e){if(e!==ea)return!1;if(!na)return ca(e),na=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||wp(e.type,e.memoizedProps)),n=!n),n&&ta&&oa(e),ca(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ta=Sm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ta=Sm(e)}else t===27?(t=ta,Np(e.type)?(e=xm,xm=null,ta=e):ta=t):ta=ea?bm(e.stateNode.nextSibling):null;return!0}function ua(){ta=ea=null,na=!1}function da(){var e=ra;return e!==null&&(bd===null?bd=e:bd.push.apply(bd,e),ra=null),e}function fa(e){ra===null?ra=[e]:ra.push(e)}var pa=he(null),ma=null,ha=null;function ga(e,t,n){_e(pa,t._currentValue),t._currentValue=n}function _a(e){e._currentValue=pa.current,ge(pa)}function va(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 ya(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),va(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),va(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),va(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 ba(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;Rr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===xe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[vh]:e.push(vh))}a=a.return}return e!==null&&ya(t,e,n,r),t.flags|=262144,e!==null}function xa(e){for(e=e.firstContext;e!==null;){if(!Rr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Sa(e){ma=e,ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ca(e){return Ta(ma,e)}function wa(e,t){return ma===null&&Sa(e),Ta(e,t)}function Ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ha===null){if(e===null)throw Error(i(308));ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ha=ha.next=t;return n}var Ea=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()})}},Da=t.unstable_scheduleCallback,Oa=t.unstable_NormalPriority,ka={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Aa(){return{controller:new Ea,data:new Map,refCount:0}}function ja(e){e.refCount--,e.refCount===0&&Da(Oa,function(){e.controller.abort()})}function Ma(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Na=null;function Pa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Fa=null,Ia=0,La=0,Ra=null;function za(e,t){if(Fa===null){var n=Fa=[];Ia=0,La=Uf(),Ra={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ia++,t.then(Ba,Ba),t}function Ba(){if(--Ia===0&&(Na=null,Fa!==null)){Ra!==null&&(Ra.status=`fulfilled`);var e=Fa;Fa=null,La=0,Ra=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Va(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 Ha=B.S;B.S=function(e,t){if(Cd=Le(),typeof t==`object`&&t&&typeof t.then==`function`&&za(e,t),Na!==null)for(var n=kf;n!==null;)Ma(n,Na),n=n.next;if(n=e.types,n!==null){for(var r=kf;r!==null;)Ma(r,n),r=r.next;if(La!==0){r=Na,r===null&&(r=Na=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ha!==null&&Ha(e,t)};var Ua=he(null);function Wa(){var e=Ua.current;return e===null?id.pooledCache:e}function Ga(e,t){t===null?_e(Ua,Ua.current):_e(Ua,t.pool)}function Ka(){var e=Wa();return e===null?null:{parent:ka._currentValue,pool:e}}var qa=Error(i(460)),Ja=Error(i(474)),Ya=Error(i(542)),Xa={then:function(){}};function Za(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Qa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(hn,hn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,no(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(hn,hn);else{if(e=id,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,no(e),e}throw eo=t,qa}}function $a(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(eo=e,qa):e}}var eo=null;function to(){if(eo===null)throw Error(i(459));var e=eo;return eo=null,e}function no(e){if(e===qa||e===Ya)throw Error(i(483))}var ro=null,io=0;function ao(e){var t=io;return io+=1,ro===null&&(ro=[]),Qa(ro,e,t)}function oo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function so(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function co(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=ji(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Fi(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===j?(e=d(e,t,n.props.children,r,n.key),oo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===L&&$a(i)===t.type)?(t=a(t,n.props),oo(t,n),t.return=e,t):(t=Ni(n.type,n.key,n.props,null,e.mode,r),oo(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=Li(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=Pi(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=Fi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ni(t.type,t.key,t.props,null,e.mode,n),oo(n,t),n.return=e,n;case A:return t=Li(t,e.mode,n),t.return=e,t;case L:return t=$a(t),f(e,t,n)}if(ue(t)||se(t))return t=Pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ao(t),n);if(t.$$typeof===F)return f(e,wa(e,t),n);so(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 k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case L:return n=$a(n),p(e,t,n,r)}if(ue(n)||se(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ao(n),r);if(n.$$typeof===F)return p(e,t,wa(e,n),r);so(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case L:return r=$a(r),m(e,t,n,r,i)}if(ue(r)||se(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ao(r),i);if(r.$$typeof===F)return m(e,t,n,wa(t,r),i);so(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),na&&Yi(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 na&&Yi(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(_.key===null?h:_.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)}),na&&Yi(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),na&&Yi(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 na&&Yi(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(_.key===null?g:_.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)}),na&&Yi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),oo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===L&&$a(l)===r.type){n(e,r.sibling),c=a(r,o.props),oo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Pi(o.props.children,e.mode,c,o.key),oo(c,o),c.return=e,e=c):(c=Ni(o.type,o.key,o.props,null,e.mode,c),oo(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Li(o,e.mode,c),c.return=e,e=c}return s(e);case L:return o=$a(o),_(e,r,o,c)}if(ue(o))return h(e,r,o,c);if(se(o)){if(l=se(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,ao(o),c);if(o.$$typeof===F)return _(e,r,wa(e,o),c);so(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=Fi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{io=0;var i=_(e,t,n,r);return ro=null,i}catch(t){if(t===qa||t===Ya)throw t;var a=ki(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var lo=co(!0),uo=co(!1),fo=!1;function po(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mo(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 ho(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function go(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,rd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ei(e),Ti(e,null,n),t}return Si(e,r,t,n),Ei(e)}function _o(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,dt(e,n)}}function vo(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var yo=!1;function bo(){if(yo){var e=Ra;if(e!==null)throw e}}function xo(e,t,n,r){yo=!1;var i=e.updateQueue;fo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(od&f)===f:(r&f)===f){f!==0&&f===La&&(yo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:fo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),md|=o,e.lanes=o,e.memoizedState=d}}function So(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Co(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)So(n[e],t)}var wo=he(null),To=he(0);function Eo(e,t){e=fd,_e(To,e),_e(wo,t),fd=e|t.baseLanes}function Do(){_e(To,fd),_e(wo,wo.current)}function Oo(){fd=To.current,ge(wo),ge(To)}var ko=he(null),Ao=null;function jo(e){var t=e.alternate;_e(Io,Io.current&1),_e(ko,e),Ao===null&&(t===null||wo.current!==null||t.memoizedState!==null)&&(Ao=e)}function Mo(e){_e(Io,Io.current),_e(ko,e),Ao===null&&(Ao=e)}function No(e){e.tag===22?(_e(Io,Io.current),_e(ko,e),Ao===null&&(Ao=e)):Po()}function Po(){_e(Io,Io.current),_e(ko,ko.current)}function Fo(e){ge(ko),Ao===e&&(Ao=null),ge(Io)}var Io=he(0);function Lo(e,t){_e(ko,ko.current),_e(Io,t)}function Ro(e){ge(Io),ge(ko),Ao===e&&(Ao=null)}function zo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_m(n)||vm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Bo=0,Vo=null,Ho=null,Uo=null,Wo=!1,Go=!1,Ko=!1,qo=0,Jo=0,Yo=null,Xo=0;function Zo(){throw Error(i(321))}function Qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Rr(e[n],t[n]))return!1;return!0}function $o(e,t,n,r,i,a){return Bo=a,Vo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?gc:_c,Ko=!1,a=n(r,i),Ko=!1,Go&&(a=ts(t,n,r,i)),es(e),a}function es(e){B.H=hc;var t=Ho!==null&&Ho.next!==null;if(Bo=0,Uo=Ho=Vo=null,Wo=!1,Jo=0,Yo=null,t)throw Error(i(300));e===null||Pc||(e=e.dependencies,e!==null&&xa(e)&&(Pc=!0))}function ts(e,t,n,r){Vo=e;var a=0;do{if(Go&&(Yo=null),Jo=0,Go=!1,25<=a)throw Error(i(301));if(a+=1,Uo=Ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}B.H=vc,o=t(n,r)}while(Go);return o}function ns(){var e=B.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(Ho===null?null:Ho.memoizedState)!==e&&(Vo.flags|=1024),t}function rs(){var e=qo!==0;return qo=0,e}function is(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function as(e){if(Wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wo=!1}Bo=0,Uo=Ho=Vo=null,Go=!1,Jo=qo=0,Yo=null}function os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Uo===null?Vo.memoizedState=Uo=e:Uo=Uo.next=e,Uo}function ss(){if(Ho===null){var e=Vo.alternate;e=e===null?null:e.memoizedState}else e=Ho.next;var t=Uo===null?Vo.memoizedState:Uo.next;if(t!==null)Uo=t,Ho=e;else{if(e===null)throw Vo.alternate===null?Error(i(467)):Error(i(310));Ho=e,e={memoizedState:Ho.memoizedState,baseState:Ho.baseState,baseQueue:Ho.baseQueue,queue:Ho.queue,next:null},Uo===null?Vo.memoizedState=Uo=e:Uo=Uo.next=e}return Uo}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Jo;return Jo+=1,Yo===null&&(Yo=[]),e=Qa(Yo,e,t),t=Vo,(Uo===null?t.memoizedState:Uo.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?gc:_c),e}function us(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ls(e);if(e.$$typeof===z)return;if(e.$$typeof===F)return Ca(e)}throw Error(i(438,String(e)))}function ds(e){var t=null,n=Vo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Vo.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=cs(),Vo.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]=ie;return t.index++,n}function fs(e,t){return typeof t==`function`?t(e):t}function ps(e){return ms(ss(),Ho,e)}function ms(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?(Bo&f)===f:(od&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===La&&(d=!0);else if((Bo&p)===p){u=u.next,p===La&&(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,Vo.lanes|=p,md|=p;f=u.action,Ko&&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,Vo.lanes|=f,md|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Rr(o,e.memoizedState)&&(Pc=!0,d&&(n=Ra,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 hs(e){var t=ss(),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);Rr(o,t.memoizedState)||(Pc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function gs(e,t,n){var r=Vo,a=ss(),o=na;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Rr((Ho||a).memoizedState,n);if(s&&(a.memoizedState=n,Pc=!0),a=a.queue,Vs(ys.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Uo!==null&&!!(Uo.memoizedState.tag&1),Is(e?9:8,{destroy:void 0},vs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,id===null)throw Error(i(349));o||Bo&127||_s(r,t,n)}return n}function _s(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Vo.updateQueue,t===null?(t=cs(),Vo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vs(e,t,n,r){t.value=n,t.getSnapshot=r,bs(t)&&xs(e)}function ys(e,t,n){return n(function(){bs(t)&&xs(e)})}function bs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Rr(e,n)}catch{return!0}}function xs(e){var t=wi(e,2);t!==null&&Hd(t,e,2)}function Ss(e){var t=os();if(typeof e==`function`){var n=e;if(e=n(),Ko){Je(!0);try{n()}finally{Je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:e},t}function Cs(e,t,n,r){return e.baseState=n,ms(e,Ho,typeof r==`function`?r:fs)}function ws(e,t,n,r,a){if(fc(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)}};B.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ts(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ts(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=B.T,o={};o.types=a===null?null:a.types,B.T=o;try{var s=n(i,r),c=B.S;c!==null&&c(o,s),Es(e,t,s)}catch(n){Os(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),B.T=a}}else try{a=n(i,r),Es(e,t,a)}catch(n){Os(e,t,n)}}function Es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ds(e,t,n)},function(n){return Os(e,t,n)}):Ds(e,t,n)}function Ds(e,t,n){t.status=`fulfilled`,t.value=n,ks(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ts(e,n)))}function Os(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ks(t),t=t.next;while(t!==r)}e.action=null}function ks(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function As(e,t){return t}function js(e,t){if(na){var n=id.formState;if(n!==null){a:{var r=Vo;if(na){if(ta){b:{for(var i=ta,a=ia;i.nodeType!==8;)if(!a||(i=bm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ta=bm(i.nextSibling),r=i.data===`F!`;break a}}oa(r)}r=!1}r&&(t=n[0])}}return n=os(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:As,lastRenderedState:t},n.queue=r,n=lc.bind(null,Vo,r),r.dispatch=n,r=Ss(!1),a=dc.bind(null,Vo,!1,r.queue),r=os(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ws.bind(null,Vo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ms(e){return Ns(ss(),Ho,e)}function Ns(e,t,n){if(t=ms(e,t,As)[0],e=ps(fs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ls(t)}catch(e){throw e===qa?Ya:e}else r=t;t=ss();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Vo.flags|=2048,Is(9,{destroy:void 0},Ps.bind(null,i,n),null)),[r,a,e]}function Ps(e,t){e.action=t}function Fs(e){var t=ss(),n=Ho;if(n!==null)return Ns(t,n,e);ss(),t=t.memoizedState,n=ss();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Vo.updateQueue,t===null&&(t=cs(),Vo.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 ss().memoizedState}function Rs(e,t,n,r){var i=os();Vo.flags|=e,i.memoizedState=Is(1|t,{destroy:void 0},n,r===void 0?null:r)}function zs(e,t,n,r){var i=ss();r=r===void 0?null:r;var a=i.memoizedState.inst;Ho!==null&&r!==null&&Qo(r,Ho.memoizedState.deps)?i.memoizedState=Is(t,a,n,r):(Vo.flags|=e,i.memoizedState=Is(1|t,a,n,r))}function Bs(e,t){Rs(8390656,8,e,t)}function Vs(e,t){zs(2048,8,e,t)}function Hs(e){Vo.flags|=4;var t=Vo.updateQueue;if(t===null)t=cs(),Vo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Us(e){var t=ss().memoizedState;return Hs({ref:t,nextImpl:e}),function(){if(rd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ws(e,t){return zs(4,2,e,t)}function Gs(e,t){return zs(4,4,e,t)}function Ks(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 qs(e,t,n){n=n==null?null:n.concat([e]),zs(4,4,Ks.bind(null,t,e),n)}function Js(){}function Ys(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qo(t,r[1]))return r[0];if(r=e(),Ko){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r}function Zs(e,t,n){return n===void 0||Bo&1073741824&&!(od&261930)?e.memoizedState=t:(e.memoizedState=n,e=Bd(),Vo.lanes|=e,md|=e,n)}function Qs(e,t,n,r){return Rr(n,t)?n:wo.current===null?!(Bo&106)||Bo&1073741824&&!(od&261930)?(Pc=!0,e.memoizedState=n):(e=Bd(),Vo.lanes|=e,md|=e,t):(e=Zs(e,n,r),Rr(e,t)||(Pc=!0),e)}function $s(e,t,n,r,i){var a=de.p;de.p=a!==0&&8>a?a:8;var o=B.T,s={};s.types=o===null?null:o.types,B.T=s,dc(e,!1,t,n);try{var c=i(),l=B.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?uc(e,t,Va(c,r),zd(e)):uc(e,t,r,zd(e))}catch(n){uc(e,t,{then:function(){},status:`rejected`,reason:n},zd())}finally{de.p=a,o!==null&&s.types!==null&&(o.types=s.types),B.T=o}}function ec(){}function tc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=nc(e).queue;$s(e,a,t,fe,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:fe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rc(e){var t=nc(e);t.next===null&&(t=e.alternate.memoizedState),uc(e,t.next.queue,{},zd())}function ic(){return Ca(vh)}function ac(){return ss().memoizedState}function oc(){return ss().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=zd();e=ho(n);var r=go(t,e,n);r!==null&&(Hd(r,t,n),_o(r,t,n)),t={cache:Aa()},e.payload=t;return}t=t.return}}function cc(e,t,n){var r=zd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)?pc(t,n):(n=Ci(e,t,n,r),n!==null&&(Hd(n,e,r),mc(n,t,r)))}function lc(e,t,n){uc(e,t,n,zd())}function uc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(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,Rr(s,o))return Si(e,t,i,0),id===null&&xi(),!1}catch{}if(n=Ci(e,t,i,r),n!==null)return Hd(n,e,r),mc(n,t,r),!0}return!1}function dc(e,t,n,r){if(r={lane:2,revertLane:Uf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(i(479))}else t=Ci(e,n,r,2),t!==null&&Hd(t,e,2)}function fc(e){var t=e.alternate;return e===Vo||t!==null&&t===Vo}function pc(e,t){Go=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,dt(e,n)}}var hc={readContext:Ca,use:us,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},gc={readContext:Ca,use:us,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:Ca,useEffect:Bs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Rs(4194308,4,Ks.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){Rs(4,2,e,t)},useMemo:function(e,t){var n=os();t=t===void 0?null:t;var r=e();if(Ko){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){Je(!0);try{n(t)}finally{Je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=cc.bind(null,Vo,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=Ss(e);var t=e.queue,n=lc.bind(null,Vo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){return Zs(os(),e,t)},useTransition:function(){var e=Ss(!1);return e=$s.bind(null,Vo,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Vo,a=os();if(na){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),id===null)throw Error(i(349));od&127||_s(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Bs(ys.bind(null,r,o,e),[e]),r.flags|=2048,Is(9,{destroy:void 0},vs.bind(null,r,o,n,t),null),n},useId:function(){var e=os(),t=id.identifierPrefix;if(na){var n=Ji,r=qi;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:js,useActionState:js,useOptimistic:function(e){var t=os();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dc.bind(null,Vo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ds,useCacheRefresh:function(){return os().memoizedState=sc.bind(null,Vo)},useEffectEvent:function(e){var t=os(),n={impl:e};return t.memoizedState=n,function(){if(rd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},_c={readContext:Ca,use:us,useCallback:Ys,useContext:Ca,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:ps,useRef:Ls,useState:function(){return ps(fs)},useDebugValue:Js,useDeferredValue:function(e,t){return Qs(ss(),Ho.memoizedState,e,t)},useTransition:function(){var e=ps(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){return Cs(ss(),Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us},vc={readContext:Ca,use:us,useCallback:Ys,useContext:Ca,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:hs,useRef:Ls,useState:function(){return hs(fs)},useDebugValue:Js,useDeferredValue:function(e,t){var n=ss();return Ho===null?Zs(n,e,t):Qs(n,Ho.memoizedState,e,t)},useTransition:function(){var e=hs(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){var n=ss();return Ho===null?(n.baseState=e,[e,n.queue.dispatch]):Cs(n,Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us};function yc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=zd(),i=ho(r);i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(Hd(t,e,r),_o(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=zd(),i=ho(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(Hd(t,e,r),_o(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=zd(),r=ho(n);r.tag=2,t!=null&&(r.callback=t),t=go(e,r,n),t!==null&&(Hd(t,e,n),_o(t,e,n))}};function xc(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?!zr(n,r)||!zr(i,a):!0}function Sc(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&&bc.enqueueReplaceState(t,t.state,null)}function Cc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function wc(e){_i(e)}function Tc(e){console.error(e)}function Ec(e){_i(e)}function Dc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Oc(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 kc(e,t,n){return n=ho(n),n.tag=3,n.payload={element:null},n.callback=function(){Dc(e,t)},n}function Ac(e){return e=ho(e),e.tag=3,e}function jc(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(){Oc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Oc(t,n,r),typeof i!=`function`&&(Ed===null?Ed=new Set([this]):Ed.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Mc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ba(t,n,a,!0),n=ko.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Ao===null?ef():n.alternate===null&&pd===0&&(pd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Cf(e,r,a)),!1;case 22:return n.flags|=65536,r===Xa?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)),Cf(e,r,a)),!1}throw Error(i(435,n.tag))}return Cf(e,r,a),ef(),!1}if(na)return t=ko.current,t===null?(r!==aa&&(t=Error(i(423),{cause:r}),fa(zi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=zi(r,n),a=kc(e.stateNode,r,a),vo(e,a),pd!==4&&(pd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==aa&&(e=Error(i(422),{cause:r}),fa(zi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=zi(o,n),yd===null?yd=[o]:yd.push(o),pd!==4&&(pd=2),t===null)return!0;r=zi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=kc(n.stateNode,r,e),vo(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`&&(Ed===null||!Ed.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ac(a),jc(a,e,n,r),vo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Nc=Error(i(461)),Pc=!1;function Fc(e,t,n,r){t.child=e===null?uo(t,null,n,r):lo(t,e.child,n,r)}function Ic(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 Sa(t),r=$o(e,t,n,o,a,i),s=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(na&&s&&Zi(t),t.flags|=1,Fc(e,t,r,i),t.child)}function Lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Rc(e,t,a,r,i)):(e=Ni(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!dl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?zr:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=ji(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(zr(a,r)&&e.ref===t.ref){if(Pc=!1,t.pendingProps=r=a,dl(e,i))e.flags&131072&&(Pc=!0);else return t.lanes=e.lanes,ul(e,t,i)}}return Kc(e,t,n,r,i)}function zc(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 Vc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ga(t,a===null?null:a.cachePool),a===null?Do():Eo(t,a),No(t);else return r=t.lanes=536870912,Vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ga(t,null),Do(),Po()):(Ga(t,a.cachePool),Eo(t,a),Po(),t.memoizedState=null);return Fc(e,t,i,n),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vc(e,t,n,r,i){var a=Wa();return a=a===null?null:{parent:ka._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ga(t,null),Do(),No(t),e!==null&&ba(e,t,r,!0),t.childLanes=i,null}function Hc(e,t){return t=tl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uc(e,t,n){return lo(t,e.child,null,n),e=Hc(t,t.pendingProps),e.flags|=2,Fo(t),t.memoizedState=null,e}function Wc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(na){if(r.mode===`hidden`)return e=Hc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(Mo(t),(e=ta)?(e=gm(e,ia),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:qi,overflow:Ji},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,ea=t,ta=null)):e=null,e===null)throw oa(t);return t.lanes=536870912,null}return Hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Mo(t),a){if(t.flags&256)t.flags&=-257,t=Uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Pc||ba(e,t,n,!1),a=(n&e.childLanes)!==0,Pc||a){if(wo.current===null){if(r=id,r!==null&&(s=ft(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,wi(e,s),Hd(r,e,s),Nc;ef()}t=Uc(e,t,n)}else e=o.treeContext,ta=bm(s.nextSibling),ea=t,na=!0,ra=null,ia=!1,e!==null&&$i(t,e),t=Hc(t,r),t.flags|=134221824;return t}return e=ji(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(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 Kc(e,t,n,r,i){return Sa(t),n=$o(e,t,n,r,void 0,i),r=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(na&&r&&Zi(t),t.flags|=1,Fc(e,t,n,i),t.child)}function qc(e,t,n,r,i,a){return Sa(t),t.updateQueue=null,n=ts(t,r,n,i),es(e),r=rs(),e!==null&&!Pc?(is(e,t,a),ul(e,t,a)):(na&&r&&Zi(t),t.flags|=1,Fc(e,t,n,a),t.child)}function Jc(e,t,n,r,i){if(Sa(t),t.stateNode===null){var a=Di,o=n.contextType;typeof o==`object`&&o&&(a=Ca(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},po(t),o=n.contextType,a.context=typeof o==`object`&&o?Ca(o):Di,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(yc(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&&bc.enqueueReplaceState(a,a.state,null),xo(t,r,a,i),bo(),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=Cc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Di,typeof u==`object`&&u&&(o=Ca(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)&&Sc(t,a,r,o),fo=!1;var f=t.memoizedState;a.state=f,xo(t,r,a,i),bo(),l=t.memoizedState,s||f!==l||fo?(typeof d==`function`&&(yc(t,n,d,r),l=t.memoizedState),(c=fo||xc(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,mo(e,t),o=t.memoizedProps,u=Cc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Di,typeof l==`object`&&l&&(c=Ca(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)&&Sc(t,a,r,c),fo=!1,f=t.memoizedState,a.state=f,xo(t,r,a,i),bo();var p=t.memoizedState;o!==d||f!==p||fo||e!==null&&e.dependencies!==null&&xa(e.dependencies)?(typeof s==`function`&&(yc(t,n,s,r),p=t.memoizedState),(u=fo||xc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&xa(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,Gc(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=lo(t,e.child,null,i),t.child=lo(t,null,n,i)):Fc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ul(e,t,i),e}function Yc(e,t,n,r){return ua(),t.flags|=256,Fc(e,t,n,r),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:Ka()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=_d),e}function $c(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Io.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(na){if(i?jo(t):Po(),(e=ta)?(e=gm(e,ia),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:qi,overflow:Ji},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,ea=t,ta=null)):e=null,e===null)throw oa(t);return t.lanes=vm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Po(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=Pi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Zc(n),r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(null,r)):(jo(t),el(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return rl(e,t,a,o,r,c,s,n)}return i?(Po(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ji(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Pi(i,a,n,null),i.flags|=2):i=ji(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Bc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Zc(n):(a=i.cachePool,a===null?a=Ka():(s=ka._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(e.child,r)):(jo(t),n=e.child,e=n.sibling,n=ji(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function el(e,t){return t=tl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function tl(e,t){return e=ki(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return lo(t,e.child,null,n),e=el(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(jo(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Po(),o=a.fallback,s=t.mode,a=tl({mode:`visible`,children:a.children},s),o=Pi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,lo(t,e.child,null,c),a=t.child,a.memoizedState=Zc(c),a.childLanes=Qc(e,r,c),t.memoizedState=Xc,Bc(null,a)):(Po(),t.child=e.child,t.flags|=128,null);if(jo(t),vm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,fa({value:a,source:null,stack:null})),nl(e,t,c)}if(Pc||ba(e,t,c,!1),r=(c&e.childLanes)!==0,Pc||r){if(wo.current!==null)return nl(e,t,c);if(r=id,r!==null&&(a=ft(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,wi(e,a),Hd(r,e,a),Nc;return _m(o)||ef(),nl(e,t,c)}return _m(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ta=bm(o.nextSibling),ea=t,na=!0,ra=null,ia=!1,e!==null&&$i(t,e),t=el(t,a.children),t.flags|=134221824,t)}function il(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),va(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&zo(n)===null&&(t=e),e=e.sibling}return t}function ol(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 sl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Io.current;if(t.flags&128)return Lo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Lo(t,o),i===`backwards`&&e!==null?(sl(e),Fc(e,t,r,n),sl(e)):Fc(e,t,r,n),r=na?Ui:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&il(e,n,t);else if(e.tag===19)il(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`backwards`:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,sl(t)),ol(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&zo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,a,r);break;case`together`:ol(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,a,r)}return t.child}function ll(e,t,n){var r=t.pendingProps;return ga(t,t.type,r.value),Fc(e,t,r.children,n),t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),md|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ba(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=ji(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ji(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&xa(e)))}function fl(e,t,n){switch(t.tag){case 3:Se(t,t.stateNode.containerInfo),ga(t,ka,e.memoizedState.cache),ua();break;case 27:case 5:we(t);break;case 4:Se(t,t.stateNode.containerInfo);break;case 10:ga(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Mo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return jo(t),t.flags|=128,null;r=ba(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(jo(t),e=ul(e,t,n),e===null?null:e.sibling)}jo(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ba(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return cl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Lo(t,Io.current),r)break;return null;case 22:return t.lanes=0,zc(e,t,n,t.pendingProps);case 24:ga(t,ka,e.memoizedState.cache)}return ul(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Pc=!0;else{if(!dl(e,n)&&!(t.flags&128))return Pc=!1,fl(e,t,n);Pc=!!(e.flags&131072)}}else Pc=!1,na&&t.flags&1048576&&Xi(t,Ui,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=$a(t.elementType),t.type=e,typeof e==`function`)Ai(e)?(r=Cc(e,r),t.tag=1,t=Jc(null,t,e,r,n)):(t.tag=0,t=Kc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ee){t.tag=11,t=Ic(null,t,e,r,n);break a}if(a===ne){t.tag=14,t=Lc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=ll(null,t,n);break a}}throw t=le(e)||e,Error(i(306,t,``))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Cc(r,t.pendingProps),Jc(e,t,r,a,n);case 3:a:{if(Se(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,mo(e,t),xo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ga(t,ka,r),r!==o.cache&&ya(t,[ka],n,!0),bo(),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=Yc(e,t,r,n);break a}if(r!==a){a=zi(Error(i(424)),t),fa(a),t=Yc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ta=bm(e.firstChild),ea=t,na=!0,ra=null,ia=!0,n=uo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ua(),r===a){t=ul(e,t,n);break a}Fc(e,t,r,n)}t=t.child}return t;case 26:return Gc(e,t),e===null?(n=Wm(t.type,null,t.pendingProps,null))?t.memoizedState=n:na||(t.stateNode=Cp(t.type,t.pendingProps,be.current,t)):t.memoizedState=Wm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return we(t),e===null&&na&&(r=t.stateNode=Em(t.type,t.pendingProps,be.current),ea=t,ia=!0,a=ta,Np(t.type)?(xm=a,ta=bm(r.firstChild)):ta=a),Fc(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&na&&((a=r=ta)&&(r=mm(r,t.type,t.pendingProps,ia),r===null?a=!1:(t.stateNode=r,ea=t,ta=bm(r.firstChild),ia=!1,a=!0)),a||oa(t)),we(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,wp(a,o)?r=null:s!==null&&wp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=$o(e,t,ns,null,null,n),vh._currentValue=a),Gc(e,t),Fc(e,t,r,n),t.child;case 6:return e===null&&na&&((e=n=ta)&&(n=hm(n,t.pendingProps,ia),n===null?e=!1:(t.stateNode=n,ea=t,ta=null,e=!0)),e||oa(t)),null;case 13:return $c(e,t,n);case 4:return Se(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=lo(t,null,r,n):Fc(e,t,r,n),t.child;case 11:return Ic(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Gc(e,t),Fc(e,t,r,n),t.child;case 8:return Fc(e,t,t.pendingProps.children,n),t.child;case 12:return Fc(e,t,t.pendingProps.children,n),t.child;case 10:return ll(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Sa(t),a=Ca(a),r=r(a),t.flags|=1,Fc(e,t,r,n),t.child;case 14:return Lc(e,t,t.type,t.pendingProps,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 31:return Wc(e,t,n);case 22:return zc(e,t,n,t.pendingProps);case 24:return Sa(t),r=Ca(ka),e===null?(a=Wa(),a===null&&(a=id,o=Aa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},po(t),ga(t,ka,a)):((e.lanes&n)!==0&&(mo(e,t),xo(t,null,null,n),bo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ga(t,ka,r),r!==a.cache&&ya(t,[ka],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ga(t,ka,r))),Fc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:na&&Zi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Gc(e,t),Fc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ml(e){e.flags|=4}function hl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?ah(t,r):ah(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Zd())e.flags|=8192;else throw eo=Xa,Ja}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!oh(t)){if(Zd())e.flags|=8192;else throw eo=Xa,Ja}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ot(),e.lanes|=t,vd|=t)}function vl(e,t){if(!na)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function yl(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&1206910976,r|=i.flags&1206910976,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 bl(e,t,n){var r=t.pendingProps;switch(Qi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yl(t),null;case 1:return yl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),_a(ka),Ce(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(la(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,da())),yl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(yl(t),hl(t,a,null,r,n)):(yl(t),gl(t,o))):o?o===e.memoizedState?(yl(t),t.flags&=-16777217):(ml(t),yl(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),yl(t),hl(t,a,e,r,n)),null;case 27:if(V(t),n=be.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}e=ve.current,la(t)?sa(t,e):(e=Em(a,r,n),t.stateNode=e,ml(t))}return yl(t),t.subtreeFlags&=-33554433,null;case 5:if(V(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}if(o=ve.current,la(t))sa(t,o);else{var s=bp(be.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[vt]=t,o[yt]=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(pp(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&&ml(t)}}return yl(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=be.current,la(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ea,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[vt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||up(e.nodeValue,n)),e||oa(t,!0)}else e=bp(e).createTextNode(r),e[vt]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=la(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[vt]=t}else ua(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=da(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Fo(t),t):(Fo(t),null);if(t.flags&128)throw Error(i(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=la(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[vt]=t}else ua(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),a=!1}else a=da(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Fo(t),t):(Fo(t),null)}return Fo(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),_l(t,t.updateQueue),yl(t),null);case 4:return Ce(),e===null&&ep(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return _a(t.type),yl(t),null;case 19:if(Ro(t),r=t.memoizedState,r===null)return yl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)vl(r,!1);else{if(pd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=zo(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Mi(n,e),n=n.sibling;return Lo(t,Io.current&1|2),na&&Yi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Le()>wd&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=zo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!na)return yl(t),null}else 2*Le()-r.renderingStartTime>wd&&n!==536870912&&(t.flags|=128,a=!0,vl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Le(),e.sibling=null,o=Io.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||na?Lo(t,o):(n=o,_e(ko,t),_e(Io,n),Ao===null&&(Ao=t)),na&&Yi(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Fo(t),Oo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(t),n=t.updateQueue,n!==null&&_l(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&&ge(Ua),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),_a(ka),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(i(156,t.tag))}function xl(e,t){switch(Qi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _a(ka),Ce(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return V(t),null;case 31:if(t.memoizedState!==null){if(Fo(t),t.alternate===null)throw Error(i(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Fo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ro(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ce(),null;case 10:return _a(t.type),null;case 22:case 23:return Fo(t),Oo(),e!==null&&ge(Ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _a(ka),null;case 25:return null;default:return null}}function Sl(e,t){switch(Qi(t),t.tag){case 3:_a(ka),Ce();break;case 26:case 27:case 5:V(t);break;case 4:Ce();break;case 31:t.memoizedState!==null&&Fo(t);break;case 13:Fo(t);break;case 19:Ro(t);break;case 10:_a(t.type);break;case 22:case 23:Fo(t),Oo(),e!==null&&ge(Ua);break;case 24:_a(ka)}}function Cl(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){Sf(t,t.return,e)}}function wl(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){Sf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Sf(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Co(t,n)}catch(t){Sf(e,e.return,t)}}}function El(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Sf(e,t,n)}}function Dl(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:var i=e.stateNode,a=mi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Gp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Kp(e);h(e.child,!1,lm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Sf(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Sf(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){Sf(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)dm(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&dm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&fm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(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){Sf(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;hp(r,e.type,n,t),r[yt]=t}catch(t){Sf(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Np(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(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&&Np(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 Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hn)),kl(e,r),Ht=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Np(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),Ht=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Np(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);pp(t,r,n),t[vt]=e,t[yt]=n}catch(t){Sf(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=zp(o);r.push(s),s.view&&(a=!0)}else a||zp(o).view&&(a=!0);Vl=!0,Ip(o,Kl===0?t:t+`_`+Kl,n),Kl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?Lp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Yl(e.child,t),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=gi(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=mi(r,n),a=gi(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||Vd(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=gi(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Vd(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=gi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?Vd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),Vd(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode);t=gi(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=zp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Ip(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=mi(n,r),a=gi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Bp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Vd(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,su=!1,cu=!1,lu=!1,uu=typeof WeakSet==`function`?WeakSet:Set,du=null,fu=!1,pu=!1,mu=!1,hu=!1;function gu(e,t,n){if(e=e.containerInfo,vp=Dh,e=Wr(e),Gr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(yp={focusedElem:e,selectionRange:r},Dh=!1,n=(n&335544064)===n,du=t,t=n?9270:1024;du!==null;){if(e=du,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),_u(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),_u(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),_u(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,du=r):(n&&eu(e),_u(n))}}Hl=null}function _u(e){for(;du!==null;){var t=du,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Cc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Sf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)pm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:pm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=mi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=gi(a.default,a.update),a!==`none`&&ql(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,du=r;break}du=t.return}}function vu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ru(e,n),r&4&&Cl(5,n);break;case 1:if(Ru(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Sf(n,n.return,e)}else{var i=Cc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Sf(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Ru(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{Co(e,t)}catch(e){Sf(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Ru(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Ru(e,n);break;case 31:Ru(e,n),r&4&&Du(e,n);break;case 13:Ru(e,n),r&4&&Ou(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ef.bind(null,n),ym(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||su;t=ou,i=su,ou=r,(su=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Bu(e,n,r)):Ru(e,n),ou=t,su=i}break;case 30:Ru(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Ru(e,n)}}function yu(e,t){for(e=e.child;e!==null;)bu(e,t),e=e.sibling}function bu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Sf(e,e.return,t)}xu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Ht=!0}catch(t){Sf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Fp(s,!0):Fp(e.stateNode,!1)}catch(t){Sf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&yu(e,t);break;default:yu(e,t)}}function xu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:bu(n,r);break a;case 22:n.memoizedState===null&&xu(n,r);break a;default:xu(n,r)}}e=e.sibling}}function Su(e){var t=e.alternate;t!==null&&(e.alternate=null,Su(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Dt(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 Cu=null,wu=!1;function Tu(e,t,n){for(n=n.child;n!==null;)Eu(e,t,n),n=n.sibling}function Eu(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount==`function`)try{qe.onCommitFiberUnmount(Ke,n)}catch{}switch(n.tag){case 26:su||Ol(n,t),Tu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!su&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:su||Ol(n,t),jl(n);var r=Cu,i=wu;Np(n.type)&&(Cu=n.stateNode,wu=!1),Tu(e,t,n),Dm(n.stateNode,n.type,n.memoizedProps),Cu=r,wu=i;break;case 5:su||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=Cu,i=wu,Cu=null,Tu(e,t,n),Cu=r,wu=i,Cu!==null){if(wu)try{(Cu.nodeType===9?Cu.body:Cu.nodeName===`HTML`?Cu.ownerDocument.body:Cu).removeChild(n.stateNode),Ht=!0}catch(e){Sf(n,t,e)}else try{Cu.removeChild(n.stateNode),Ht=!0}catch(e){Sf(n,t,e)}}break;case 18:Cu!==null&&(wu?(e=Cu,Pp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),$h(e)):Pp(Cu,n.stateNode));break;case 4:r=Cu,i=wu,Cu=n.stateNode.containerInfo,wu=!0,Tu(e,t,n),Cu=r,wu=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),su||wl(4,n,t),Tu(e,t,n);break;case 1:su||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),Tu(e,t,n);break;case 21:Tu(e,t,n);break;case 22:su=(r=su)||n.memoizedState!==null,Tu(e,t,n),su=r;break;case 30:Ol(n,t),Tu(e,t,n);break;case 7:su||Ol(n,t),Tu(e,t,n);break;default:Tu(e,t,n)}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{$h(e)}catch(e){Sf(t,t.return,e)}}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{$h(e)}catch(e){Sf(t,t.return,e)}}function ku(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new uu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new uu),t;default:throw Error(i(435,e.tag))}}function Au(e,t){var n=ku(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Df.bind(null,e,t);t.then(r,r)}})}function ju(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Np(l.type)){Cu=l.stateNode,wu=!1;break a}break;case 5:Cu=l.stateNode,wu=!1;break a;case 3:case 4:Cu=l.stateNode.containerInfo,wu=!0;break a}l=l.return}if(Cu===null)throw Error(i(160));Eu(s,c,o),Cu=null,wu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nu(t,e,n),t=t.sibling}var Mu=null;function Nu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}ju(t,e,n),Pu(e),a&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),a&64&&ou&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Mu,ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ou)e.stateNode=Cp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Tt]||r[vt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),pp(r,t,n),r[vt]=e,Mt(r),t=r;break a;case`link`:if(o=nh(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),pp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=nh(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),pp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[vt]=e,Mt(r),t=r}e.stateNode=t}}else ou||rh(o,e.type,e.stateNode)}else e.stateNode=Zm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||su||t.parentNode.removeChild(t)):a.count--,n===null?ou||rh(o,e.type,e.stateNode):Zm(o,n,e.memoizedProps))}break;case 27:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),r!==null&&a&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=cu,cu=!1,ju(t,e,n),cu=o,Pu(e),a&512&&(su||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{sn(t,``),Ht=!0}catch(t){Sf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),a&1024&&(lu=!0);break;case 6:if(ju(t,e,n),Pu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Ht=!0}catch(t){Sf(e,e.return,t)}}break;case 3:if(Ht=!1,th=null,o=Mu,Mu=jm(t.containerInfo),ju(t,e,n),Mu=o,Pu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{$h(t.containerInfo)}catch(t){Sf(e,e.return,t)}lu&&(lu=!1,Fu(e)),Ht=!1;break;case 4:a=cu,cu=ou,r=Ut(),o=Mu,Mu=jm(e.stateNode.containerInfo),ju(t,e,n),Pu(e),Mu=o,Ht&&pu&&(mu=!0),Ht=r,cu=a;break;case 12:ju(t,e,n),Pu(e);break;case 31:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 13:ju(t,e,n),Pu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Sd=Le()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=su,u=cu;ou=c||o,cu=u||o,su=l||s,ju(t,e,n),su=l,cu=u,ou=c,Pu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||su||(t=s||su,n=ou,r=su,ou=o||ou,su=t,zu(e,2),ou=n,su=r),!o&&cu||yu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Au(e,n))));break;case 19:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 30:a&512&&(su||r===null||Ol(r,r.return)),a=Ut(),o=pu,s=(n&335544064)===n,c=e.memoizedProps,pu=s&&gi(c.default,c.update)!==`none`,ju(t,e,n),Pu(e),s&&r!==null&&Ht&&(e.flags|=4),pu=o,Ht=a;break;case 21:break;case 7:a&512&&(su||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ju(t,e,n),Pu(e)}}function Pu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Nl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ml(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(sn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(i(161))}}catch(t){Sf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Dh=!0,t.reset(),Dh=!1),e=e.sibling}}function Iu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Lu(t,e),t=t.sibling;else au(t,!1)}function Lu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(hu=fu=!1,Gl(),Iu(t,e),!fu&&!mu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Lp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),hu=!0}Wl=null;break;case 5:Iu(t,e);break;case 4:r=fu,fu=!1,Iu(t,e),fu&&(mu=!0),fu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Iu(t,e):Zl(e,!1));break;case 30:r=fu,i=Gl(),fu=!1,Iu(t,e),fu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=mi(a,o),o=mi(n.memoizedProps,o);var s=gi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Vd(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),fu=e.flags&32?!0:r;break;default:Iu(t,e)}}function Ru(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vu(e,t.alternate,t),t=t.sibling}function zu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),zu(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),zu(n,r);break;case 27:r&2&&Dm(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),zu(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||su||i.parentNode.removeChild(i),zu(n,r);break;case 22:n.memoizedState===null&&zu(n,r);break;case 30:Ol(n,n.return),zu(n,r);break;case 7:Ol(n,n.return);default:zu(n,r)}e=e.sibling}}function Bu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Bu(i,a,n),Cl(4,a);break;case 1:if(Bu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Sf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)So(l[i],c)}catch(e){Sf(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||rh(jm(c.ownerDocument),a.type,c),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:Bu(i,a,n);break;case 31:Bu(i,a,n),s&&o&4&&Du(i,a);break;case 13:Bu(i,a,n),s&&o&4&&Ou(i,a);break;case 22:a.memoizedState===null&&Bu(i,a,n),Dl(a,a.return);break;case 30:Bu(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:Bu(i,a,n)}t=t.sibling}}function Vu(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&&ja(n))}function Hu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ja(e))}function Uu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Wu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Wu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Uu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Uu(e,t,n,r);break;case 3:Uu(e,t,n,r),i&&hu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ja(a)));break;case 12:if(a&2048){Uu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Sf(t,t.return,e)}}else Uu(e,t,n,r);break;case 31:Uu(e,t,n,r);break;case 13:Uu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&nu(t),o._visibility&2?Uu(e,t,n,r):(o._visibility|=2,Gu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Uu(e,t,n,r):Ku(e,t)),a&2048&&Vu(s,t);break;case 24:Uu(e,t,n,r),a&2048&&Hu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Uu(e,t,n,r);break;default:Uu(e,t,n,r)}}function Gu(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:Gu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Gu(a,o,s,c,i)):u._visibility&2?Gu(a,o,s,c,i):Ku(a,o),i&&l&2048&&Vu(o.alternate,o);break;case 24:Gu(a,o,s,c,i),i&&l&2048&&Hu(o.alternate,o);break;default:Gu(a,o,s,c,i)}t=t.sibling}}function Ku(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:Ku(n,r),i&2048&&Vu(r.alternate,r);break;case 24:Ku(n,r),i&2048&&Hu(r.alternate,r);break;default:Ku(n,r)}t=t.sibling}}var qu=8192;function Ju(e,t,n){if(e.subtreeFlags&qu)for(e=e.child;e!==null;)Yu(e,t,n),e=e.sibling}function Yu(e,t,n){switch(e.tag){case 26:Ju(e,t,n),e.flags&qu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ch(n,e)):lh(n,Mu,e.memoizedState,e.memoizedProps));break;case 5:Ju(e,t,n),e.flags&qu&&(e=e.stateNode,(t&335544128)===t&&ch(n,e));break;case 3:case 4:var r=Mu;Mu=jm(e.stateNode.containerInfo),Ju(e,t,n),Mu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=qu,qu=16777216,Ju(e,t,n),qu=r):Ju(e,t,n));break;case 30:if((e.flags&qu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}Ju(e,t,n);break;default:Ju(e,t,n)}}function Xu(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 Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qu(e),e=e.sibling}function Qu(e){switch(e.tag){case 0:case 11:case 15:Zu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Zu(e);break;case 12:Zu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):Zu(e);break;default:Zu(e)}}function $u(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function ed(e,t){for(;du!==null;){var n=du;switch(n.tag){case 0:case 11:case 15:wl(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:ja(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,du=r;else a:for(n=e;du!==null;){r=du;var i=r.sibling,a=r.return;if(Su(r),r===n){du=null;break a}if(i!==null){i.return=a,du=i;break a}du=a}}}var td={getCacheForType:function(e){var t=Ca(ka),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ca(ka).controller.signal}},nd=typeof WeakMap==`function`?WeakMap:Map,rd=0,id=null,ad=null,od=0,sd=0,cd=null,ld=!1,ud=!1,dd=!1,fd=0,pd=0,md=0,hd=0,gd=0,_d=0,vd=0,yd=null,bd=null,xd=!1,Sd=0,Cd=0,wd=1/0,Td=null,Ed=null,Dd=0,Od=null,kd=null,Ad=0,jd=0,Md=null,Nd=null,Pd=null,Fd=null,Id=null,Ld=0,Rd=null;function zd(){return rd&2&&od!==0?od&-od:B.T===null?ht():Uf()}function Bd(){if(_d===0){if(!(od&536870912)||na){var e=et;et<<=1,!(et&3932160)&&(et=262144),_d=e}else _d=536870912}return e=ko.current,e!==null&&(e.flags|=32),_d}function Vd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Gp(mi(e.memoizedProps,n))),Fd===null&&(Fd=[]),Fd.push(t.bind(null,r))}}function Hd(e,t,n){(e===id&&(sd===2||sd===9)||e.cancelPendingCommit!==null)&&(Yd(e,0),Kd(e,od,_d,!1)),ct(e,n),rd&2&&e===id||(e===id&&(!(rd&2)&&(hd|=n),pd===4&&Kd(e,od,_d,!1)),Ff(e))}function Ud(e,t,n){if(rd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||rt(e,t),a=r?rf(e,t):tf(e,t,!0),o=r;do{if(a===0){ud&&!r&&Kd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Gd(n))a=tf(e,t,!1),o=!1;else{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=yd;var l=c.current.memoizedState.isDehydrated;if(l&&(Yd(c,s).flags|=256),s=tf(c,s,!1),s!==2&&s!==6){if(dd&&!l){c.errorRecoveryDisabledLanes|=o,hd|=o,a=4;break a}o=bd,bd=a,o!==null&&(bd===null?bd=o:bd.push.apply(bd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Yd(e,0),Kd(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&&(t&62914560)!==t)break;case 6:Kd(r,t,_d,!ld);break a;case 2:bd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Sd+300-Le(),10<a)){if(Kd(r,t,_d,!ld),nt(r,0,!0)!==0)break a;Ad=t,r.timeoutHandle=Dp(Wd.bind(null,r,n,bd,Td,xd,t,_d,hd,vd,ld,o,`Throttled`,-0,0),a);break a}Wd(r,n,bd,Td,xd,t,_d,hd,vd,ld,o,null,-0,0)}break}}while(1);Ff(e)}function Wd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},Hl=null,Yu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ph.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Sd-Le():(a&4194048)===a?Cd-Le():0,m=dh(d,m),m!==null)?(Ad=a,e.cancelPendingCommit=m(df.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Kd(e,a,o,!l)):df(e,t,a,n,r,i,o,s,c,l,u,d)}function Gd(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(!Rr(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 Kd(e,t,n,r){t=it(e,t),t&=~gd,t&=~hd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ye(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ut(e,n,t)}function qd(){return rd&6?!0:(If(0,!1),!1)}function Jd(){if(ad!==null){if(sd===0)var e=ad.return;else e=ad,ha=ma=null,as(e),ro=null,io=0,e=ad;for(;e!==null;)Sl(e.alternate,e),e=e.return;ad=null}}function Yd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Op(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ad=0,Jd(),id=e,ad=n=ji(e.current,null),od=t,sd=0,cd=null,ld=!1,ud=rt(e,t),dd=!1,vd=_d=gd=hd=md=pd=0,bd=yd=null,xd=!1,fd=it(e,t),xi(),n}function Xd(e,t){Vo=null,B.H=hc,t===qa||t===Ya?(t=to(),sd=3):t===Ja?(t=to(),sd=4):sd=t===Nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,cd=t,ad===null&&(pd=1,Dc(e,zi(t,e.current)))}function Zd(){var e=ko.current;return e===null?!0:(od&4194048)===od?Ao===null:(od&62914560)===od||od&536870912?e===Ao:!1}function Qd(){var e=B.H;return B.H=hc,e===null?hc:e}function $d(){var e=B.A;return B.A=td,e}function ef(){pd=4,ld||(od&4194048)!==od&&ko.current!==null||(ud=!0),!(md&134217727)&&!(hd&134217727)||id===null||Kd(id,od,_d,!1)}function tf(e,t,n){var r=rd;rd|=2;var i=Qd(),a=$d();(id!==e||od!==t)&&(Td=null,Yd(e,t)),t=!1;var o=pd;a:do try{if(sd!==0&&ad!==null){var s=ad,c=cd;switch(sd){case 8:Jd(),o=6;break a;case 3:case 2:case 9:case 6:ko.current===null&&(t=!0);var l=sd;if(sd=0,cd=null,cf(e,s,c,l),n&&ud){o=0;break a}break;default:l=sd,sd=0,cd=null,cf(e,s,c,l)}}nf(),o=pd;break}catch(t){Xd(e,t)}while(1);return t&&e.shellSuspendCounter++,ha=ma=null,rd=r,B.H=i,B.A=a,ad===null&&(id=null,od=0,xi()),o}function nf(){for(;ad!==null;)of(ad)}function rf(e,t){var n=rd;rd|=2;var r=Qd(),a=$d();id!==e||od!==t?(Td=null,wd=Le()+500,Yd(e,t)):ud=rt(e,t);a:do try{if(sd!==0&&ad!==null){t=ad;var o=cd;b:switch(sd){case 1:sd=0,cd=null,cf(e,t,o,1);break;case 2:case 9:if(Za(o)){sd=0,cd=null,sf(t);break}t=function(){sd!==2&&sd!==9||id!==e||(sd=7),Ff(e)},o.then(t,t);break a;case 3:sd=7;break a;case 4:sd=5;break a;case 7:Za(o)?(sd=0,cd=null,sf(t)):(sd=0,cd=null,cf(e,t,o,7));break;case 5:var s=null;switch(ad.tag){case 26:s=ad.memoizedState;case 5:case 27:var c=ad;if(s?oh(s):c.stateNode.complete){sd=0,cd=null;var l=c.sibling;if(l!==null)ad=l;else{var u=c.return;u===null?ad=null:(ad=u,lf(u))}break b}}sd=0,cd=null,cf(e,t,o,5);break;case 6:sd=0,cd=null,cf(e,t,o,6);break;case 8:Jd(),pd=6;break a;default:throw Error(i(462))}}af();break}catch(t){Xd(e,t)}while(1);return ha=ma=null,B.H=r,B.A=a,rd=n,ad===null?(id=null,od=0,xi(),pd):0}function af(){for(;ad!==null&&!Fe();)of(ad)}function of(e){var t=pl(e.alternate,e,fd);e.memoizedProps=e.pendingProps,t===null?lf(e):ad=t}function sf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qc(n,t,t.pendingProps,t.type,void 0,od);break;case 11:t=qc(n,t,t.pendingProps,t.type.render,t.ref,od);break;case 5:as(t);var r=t;r===ea&&(na?(ca(r),r.tag===5&&r.stateNode!=null&&(ta=r.stateNode)):(ca(r),na=!0));default:Sl(n,t),t=ad=Mi(t,fd),t=pl(n,t,fd)}e.memoizedProps=e.pendingProps,t===null?lf(e):ad=t}function cf(e,t,n,r){ha=ma=null,as(t),ro=null,io=0;var i=t.return;try{if(Mc(e,i,t,n,od)){pd=1,Dc(e,zi(n,e.current)),ad=null;return}}catch(t){if(i!==null)throw ad=i,t;pd=1,Dc(e,zi(n,e.current)),ad=null;return}t.flags&32768?(na||r===1?e=!0:ud||od&536870912?e=!1:(ld=e=!0,(r===2||r===9||r===3||r===6)&&(r=ko.current,r!==null&&r.tag===13&&(r.flags|=16384))),uf(t,e)):lf(t)}function lf(e){var t=e;do{if(t.flags&32768){uf(t,ld);return}e=t.return;var n=bl(t.alternate,t,fd);if(n!==null){ad=n;return}if(t=t.sibling,t!==null){ad=t;return}ad=t=e}while(t!==null);pd===0&&(pd=5)}function uf(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,ad=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ad=e;return}ad=e=n}while(e!==null);pd=6,ad=null}function df(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do yf();while(Dd!==0);if(rd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===id&&(ad=id=null,od=0),kd=t,Od=e,Ad=n,Md=a,Nd=r,ff(e,t,n,s,c,l,f)}}function ff(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(jd=s,s|=bi,lt(e,n,s,r,i,a),Fd=null,(n&335544064)===n?(Id=Pa(e),r=10262):(Id=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Of(Ve,function(){return bf(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=B.T,B.T=null,i=de.p,de.p=2,a=rd,rd|=4;try{gu(e,t,n)}finally{rd=a,de.p=i,B.T=r}}Dd=1,Vl?Pd=Up(o,e.containerInfo,Id,hf,gf,mf,_f,bf,pf,null,null):(hf(),gf(),_f())}function pf(e){if(Dd!==0){var t=Od.onRecoverableError;t(e,{componentStack:null})}}function mf(){Dd===3&&(Dd=0,Lu(kd,Od),Dd=4)}function hf(){if(Dd===1){Dd=0;var e=Od,t=kd,n=Ad,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=B.T,B.T=null;var i=de.p;de.p=2;var a=rd;rd|=4;try{pu=mu=!1,Nu(t,e,n),n=yp;var o=Wr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Ur(s.ownerDocument.documentElement,s)){if(c!==null&&Gr(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 _=Hr(s,h),v=Hr(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}}Dh=!!vp,yp=vp=null}finally{rd=a,de.p=i,B.T=r}}e.current=t,Dd=2}}function gf(){if(Dd===2){Dd=0;var e=Od,t=kd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=B.T,B.T=null;var r=de.p;de.p=2;var i=rd;rd|=4;try{vu(e,t.alternate,t)}finally{rd=i,de.p=r,B.T=n}}Dd=3}}function _f(){if(Dd===4||Dd===3){Dd=0;var e=Pd;Pd=null,Ie();var t=Od,n=kd,r=Ad,i=Nd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Dd=5:(Dd=0,kd=Od=null,vf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Ed=null),mt(r),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot==`function`)try{qe.onCommitFiberRoot(Ke,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=B.T,a=de.p,de.p=2,B.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{B.T=n,de.p=a}}if(i=Fd,o=Id,Id=null,i!==null&&(Fd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Ad&3&&yf(),Ff(t),a=t.pendingLanes,r&261930&&a&42?t===Rd?Ld++:(Ld=0,Rd=t):(Ld=0,Rd=null),If(0,!1)}}function vf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ja(t)))}function yf(){return Pd!==null&&(Pd.skipTransition(),Pd=null),hf(),gf(),_f(),bf()}function bf(){if(Dd!==5)return!1;var e=Od,t=jd;jd=0;var n=mt(Ad),r=B.T,a=de.p;try{de.p=32>n?32:n,B.T=null,n=Md,Md=null;var o=Od,s=Ad;if(Dd=0,kd=Od=null,Ad=0,rd&6)throw Error(i(331));var c=rd;if(rd|=4,Qu(o.current),Wu(o,o.current,s,n),rd=c,If(0,!1),qe&&typeof qe.onPostCommitFiberRoot==`function`)try{qe.onPostCommitFiberRoot(Ke,o)}catch{}return!0}finally{de.p=a,B.T=r,vf(e,t)}}function xf(e,t,n){t=zi(n,t),t=kc(e.stateNode,t,2),e=go(e,t,2),e!==null&&(ct(e,2),Ff(e))}function Sf(e,t,n){if(e.tag===3)xf(e,e,n);else for(;t!==null;){if(t.tag===3){xf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Ed===null||!Ed.has(r))){e=zi(n,e),n=Ac(2),r=go(t,n,2),r!==null&&(jc(n,r,t,e),ct(r,2),Ff(r));break}}t=t.return}}function Cf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nd;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)||(dd=!0,i.add(n),e=wf.bind(null,e,t,n),t.then(e,e))}function wf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,id===e&&(od&n)===n&&(pd===4||pd===3&&(od&62914560)===od&&300>Le()-Sd?rd&2?gd|=n:Yd(e,0):gd|=n,vd===od&&(vd=0)),Ff(e)}function Tf(e,t){t===0&&(t=ot()),e=wi(e,t),e!==null&&(ct(e,t),Ff(e))}function Ef(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Tf(e,n)}function Df(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),Tf(e,n)}function Of(e,t){return Ne(e,t)}var kf=null,Af=null,jf=!1,Mf=!1,Nf=!1,Pf=0;function Ff(e){e!==Af&&e.next===null&&(Af===null?kf=Af=e:Af=Af.next=e),Mf=!0,jf||(jf=!0,Hf())}function If(e,t){if(!Nf&&Mf){Nf=!0;do for(var n=!1,r=kf;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-Ye(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Vf(r,a))}else a=od,a=nt(r,r===id?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||rt(r,a)||(n=!0,Vf(r,a))}r=r.next}while(n);Nf=!1}}function Lf(){Rf()}function Rf(){Mf=jf=!1;var e=0;Pf!==0&&Ep()&&(e=Pf);for(var t=Le(),n=null,r=kf;r!==null;){var i=r.next,a=zf(r,t);a===0?(r.next=null,n===null?kf=i:n.next=i,i===null&&(Af=n)):(n=r,(e!==0||a&3)&&(Mf=!0)),r=i}Dd!==0&&Dd!==5||If(e,!1),Pf!==0&&(Pf=0)}function zf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ye(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=at(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=id,n=od,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(sd===2||sd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||rt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Pe(r),mt(n)){case 2:case 8:n=Be;break;case 32:n=Ve;break;case 268435456:n=Ue;break;default:n=Ve}return r=Bf.bind(null,e),n=Ne(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Pe(r),e.callbackPriority=2,e.callbackNode=null,2}function Bf(e,t){if(Dd!==0&&Dd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(yf()&&e.callbackNode!==n)return null;var r=od;return r=nt(e,e===id?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ud(e,r,t),zf(e,Le()),e.callbackNode!=null&&e.callbackNode===n?Bf.bind(null,e):null)}function Vf(e,t){if(yf())return null;Ud(e,t,!0)}function Hf(){jp(function(){rd&6?Ne(ze,Lf):Rf()})}function Uf(){if(Pf===0){var e=La;e===0&&(e=$e,$e<<=1,!($e&261888)&&($e=256)),Pf=e}return Pf}function Wf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:mn(e)}function Gf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Wf((i[yt]||null).action),o=r.submitter;o&&(t=(t=o[yt]||null)?Wf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new In(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Pf!==0){var e=new FormData(i,o);tc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),tc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Kf=0;Kf<di.length;Kf++){var qf=di[Kf];fi(qf.toLowerCase(),`on`+(qf[0].toUpperCase()+qf.slice(1)))}fi(ri,`onAnimationEnd`),fi(ii,`onAnimationIteration`),fi(ai,`onAnimationStart`),fi(`dblclick`,`onDoubleClick`),fi(`focusin`,`onFocus`),fi(`focusout`,`onBlur`),fi(oi,`onTransitionRun`),fi(si,`onTransitionStart`),fi(ci,`onTransitionCancel`),fi(li,`onTransitionEnd`),Lt(`onMouseEnter`,[`mouseout`,`mouseover`]),Lt(`onMouseLeave`,[`mouseout`,`mouseover`]),Lt(`onPointerEnter`,[`pointerout`,`pointerover`]),Lt(`onPointerLeave`,[`pointerout`,`pointerover`]),It(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),It(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),It(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),It(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),It(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),It(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Jf=`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(` `),Yf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Jf));function Xf(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){_i(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){_i(e)}i.currentTarget=null,a=c}}}}function Zf(e,t){var n=t[xt];n===void 0&&(n=t[xt]=new Set);var r=e+`__bubble`;n.has(r)||(tp(t,e,2,!1),n.add(r))}function Qf(e,t,n){var r=0;t&&(r|=4),tp(n,e,r,t)}var $f=`_reactListening`+Math.random().toString(36).slice(2);function ep(e){if(!e[$f]){e[$f]=!0,Pt.forEach(function(t){t!==`selectionchange`&&(Yf.has(t)||Qf(t,!1,e),Qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$f]||(t[$f]=!0,Qf(`selectionchange`,!1,t))}}function tp(e,t,n,r){switch(Ph(t)){case 2:var i=Oh;break;case 8:i=kh;break;default:i=Ah}n=i.bind(null,t,n,e),i=void 0,!Tn||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 np(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=Ot(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=_n(n),s=[];a:{var c=ui.get(e);if(c!==void 0){var l=In,u=e;switch(e){case`keypress`:if(jn(n)===0)break a;case`keydown`:case`keyup`:l=er;break;case`focusin`:u=`focus`,l=Gn;break;case`focusout`:u=`blur`,l=Gn;break;case`beforeblur`:case`afterblur`:l=Gn;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=Un;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=rr;break;case ri:case ii:case ai:l=Kn;break;case li:l=ir;break;case`scroll`:case`scrollend`:l=Rn;break;case`wheel`:l=ar;break;case`copy`:case`cut`:case`paste`:l=qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=tr;break;case`submit`:l=nr;break;case`toggle`:case`beforetoggle`:l=or}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(rp(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==gn&&(u=n.relatedTarget||n.fromElement)&&(Ot(u)||u[bt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ot(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Un,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=tr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:At(c),h=l==null?u:At(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ot(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,ap):null,c!==null&&op(s,u,c,d,!1),l!==null&&f!==null&&op(s,f,l,d,!0)))}a:{if(c=r?At(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Er;else if(br(c)){if(Dr)_=Ir;else{_=Pr;var v=Nr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&dn(r.elementType)&&(_=Er):_=Fr;if(_&&=_(e,r)){xr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?At(r):window,e){case`focusin`:(br(v)||v.contentEditable===`true`)&&(qr=v,Jr=r,Yr=null);break;case`focusout`:Yr=Jr=qr=null;break;case`mousedown`:Xr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Xr=!1,Zr(s,n,i);break;case`selectionchange`:if(Kr)break;case`keydown`:case`keyup`:Zr(s,n,i)}var y;if(cr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else gr?mr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(dr&&n.locale!==`ko`&&(gr||b!==`onCompositionStart`?b===`onCompositionEnd`&&gr&&(y=An()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,gr=!0)),v=ip(r,b),0<v.length&&(b=new Jn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=hr(n),y!==null&&(b.data=y)))),(y=ur?_r(e,n):vr(e,n))&&(b=ip(r,`onBeforeInput`),0<b.length&&(v=new Jn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Gf(s,e,r,n,i)}Xf(s,t)})}function rp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ip(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(rp(e,i,a)),i=Cn(e,t),i!=null&&r.push(rp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ap(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function op(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(rp(n,l,c))):i||(l=Cn(n,a),l!=null&&o.push(rp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var sp=/\r\n?/g,cp=/\u0000|\uFFFD/g;function lp(e){return(typeof e==`string`?e:``+e).replace(sp,`
9
+ `).replace(cp,``)}function up(e,t){return t=lp(t),lp(e)===t}function dp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&sn(e,``+r);else return;break;case`className`:Gt(e,`class`,r);break;case`tabIndex`:Gt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Gt(e,n,r);break;case`style`:un(e,r,o);return;case`data`:if(t!==`object`){Gt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(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`&&dp(e,t,`name`,a.name,a,null),dp(e,t,`formEncType`,a.formEncType,a,null),dp(e,t,`formMethod`,a.formMethod,a,null),dp(e,t,`formTarget`,a.formTarget,a,null)):(dp(e,t,`encType`,a.encType,a,null),dp(e,t,`method`,a.method,a,null),dp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=hn);return;case`onScroll`:r!=null&&Zf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Zf(`scrollend`,e);return;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));o?.__html!==n&&(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=mn(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`credentialless`: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`:Zf(`beforetoggle`,e),Zf(`toggle`,e),Wt(e,`popover`,r);break;case`xlinkActuate`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Wt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=fn.get(n)||n,Wt(e,n,r);else return}Ht=!0}function fp(e,t,n,r,a,o){switch(n){case`style`:un(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)sn(e,``+r);else return;break;case`onScroll`:r!=null&&Zf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Zf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=hn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ft.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[yt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Ht=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Wt(e,n,r)}return}Ht=!0}function pp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Zf(`error`,e),Zf(`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:dp(e,t,o,s,n,null)}}a&&dp(e,t,`srcSet`,n.srcSet,n,null),r&&dp(e,t,`src`,n.src,n,null);return;case`input`:Zf(`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:dp(e,t,r,d,n,null)}}tn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Zf(`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:dp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&rn(e,!!r,n,!0):rn(e,!!r,t,!1);return;case`textarea`:for(s in Zf(`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:dp(e,t,s,c,n,null)}on(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:dp(e,t,l,r,n,null)}return;case`dialog`:Zf(`beforetoggle`,e),Zf(`toggle`,e),Zf(`cancel`,e),Zf(`close`,e);break;case`iframe`:case`object`:Zf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Jf.length;r++)Zf(Jf[r],e);break;case`image`:Zf(`error`,e),Zf(`load`,e);break;case`details`:Zf(`toggle`,e);break;case`embed`:case`source`:case`link`:Zf(`error`,e),Zf(`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:dp(e,t,u,r,n,null)}return;default:if(dn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&fp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&dp(e,t,c,r,n,null))}var mp={};function hp(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)||dp(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`:m!==f&&(Ht=!0),o=m;break;case`name`:m!==f&&(Ht=!0),a=m;break;case`checked`:m!==f&&(Ht=!0),u=m;break;case`defaultChecked`:m!==f&&(Ht=!0),d=m;break;case`value`:m!==f&&(Ht=!0),s=m;break;case`defaultValue`:m!==f&&(Ht=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&dp(e,t,p,m,r,f)}}en(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)||dp(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`:o!==l&&(Ht=!0),p=o;break;case`defaultValue`:o!==l&&(Ht=!0),c=o;break;case`multiple`:o!==l&&(Ht=!0),s=o;default:o!==l&&dp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?rn(e,!!n,n?[]:``,!1):rn(e,!!n,t,!0)):rn(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:dp(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`:a!==o&&(Ht=!0),p=a;break;case`defaultValue`:a!==o&&(Ht=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&dp(e,t,s,a,r,o)}an(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:dp(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`:p!==m&&(Ht=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:dp(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)&&dp(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:dp(e,t,u,p,r,m)}return;default:if(dn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&fp(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||fp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&dp(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||dp(e,t,f,p,r,m)}function gp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function _p(){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&&gp(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&&gp(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 vp=null,yp=null;function bp(e){return e.nodeType===9?e:e.ownerDocument}function xp(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 Sp(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 Cp(e,t,n,r){return n=bp(n).createElement(e),n[vt]=r,n[yt]=t,pp(n,e,t),Mt(n),n}function wp(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 Tp=null;function Ep(){var e=window.event;return e&&e.type===`popstate`?e!==Tp&&(Tp=e,!0):(Tp=null,!1)}var Dp=typeof setTimeout==`function`?setTimeout:void 0,Op=typeof clearTimeout==`function`?clearTimeout:void 0,kp=typeof Promise==`function`?Promise:void 0,Ap=typeof requestAnimationFrame==`function`?requestAnimationFrame:Dp,jp=typeof queueMicrotask==`function`?queueMicrotask:kp===void 0?Dp:function(e){return kp.resolve(null).then(e).catch(Mp)};function Mp(e){setTimeout(function(){throw e})}function Np(e){return e===`head`}function Pp(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),$h(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Om(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Om(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Tt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Om(e.ownerDocument.body)}n=i}while(n);$h(t)}function Fp(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 Ip(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Lp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Rp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function zp(e){return Rp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Bp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Rp(t,n,e)}function Vp(e){return e.documentElement.clientHeight}function Hp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Up(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Vp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=sh(f),u>uh){s.length=o;break}f=new Promise(Hp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Wp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Wp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Wp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Wp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Gp(e){return{name:e,group:new Wp(`group`,e),imagePair:new Wp(`image-pair`,e),old:new Wp(`old`,e),new:new Wp(`new`,e)}}function Kp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Kp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Zp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Yp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,qp,e,s,r)}this._eventListeners=a}};function qp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Kp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Zp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Yp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Jp,e,n,i),r.splice(t,1),a!==null&&a()}};function Jp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Yp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Xp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Zp(e,t,n,r){if(e.length===0)return-1;r=Xp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Xp(a.optionsOrUseCapture)===r)return i}return-1}Kp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Yp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Yp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Kp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag!==6&&(e=b(e),wm(e,t))}Kp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,$p,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Qp(t[n],e);n--);};function $p(e,t){return t.push(e),!1}Kp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=bp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,em,e,void 0,void 0))};function em(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Kp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,tm,e,void 0,void 0)};function tm(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Kp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,nm,e,void 0,void 0);for(var n=t=0;n<rm.length;n++){var r=rm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):rm[t++]=r}rm.length=t}};function nm(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var rm=[],im=!1;function am(e,t,n){rm.push({fragmentInstance:e,observer:t,instance:n}),im||(im=!0,Tm(function(){im=!1;var e=rm;rm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Kp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,om,e,void 0,void 0),e};function om(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Kp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Kp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,$p,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||sm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function sm(e,t,n,r,i){var a=Ot(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function cm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Kp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,$p,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),cm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),cm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function lm(e,t){return e=b(e),um(e,t),!1}function um(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function dm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Yp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<rm.length;i++){var a=rm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(rm[r++]=a)}rm.length=r,n.observe(e)}),um(e,t))}function fm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Yp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?am(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function pm(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`:pm(n),Dt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mm(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[Tt])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=bm(e.nextSibling),e===null)break}return null}function hm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=bm(e.nextSibling),e===null))return null;return e}function gm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=bm(e.nextSibling),e===null))return null;return e}function _m(e){return e.data===`$?`||e.data===`$~`}function vm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ym(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 bm(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 xm=null;function Sm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return bm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Cm(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 wm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Tm(e){Ap(function(){Ap(function(t){return e(t)})})}function Em(e,t,n){switch(t=bp(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 Dm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&dp(e,t,r,null,mp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===hn&&(e.onclick=null),Dt(e)}function Om(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Dt(e)}var km=new Map,Am=new Set;function jm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Mm=de.d;de.d={f:Nm,r:Pm,D:Lm,C:Rm,L:zm,m:Bm,X:Hm,S:Vm,M:Um};function Nm(){var e=Mm.f(),t=qd();return e||t}function Pm(e){var t=kt(e);t!==null&&t.tag===5&&t.type===`form`?rc(t):Mm.r(e)}var Fm=typeof document>`u`?null:document;function Im(e,t,n){var r=Fm;if(r&&typeof t==`string`&&t){var i=$t(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Am.has(i)||(Am.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),pp(t,`link`,e),Mt(t),r.head.appendChild(t)))}}function Lm(e){Mm.D(e),Im(`dns-prefetch`,e,null)}function Rm(e,t){Mm.C(e,t),Im(`preconnect`,e,t)}function zm(e,t,n){Mm.L(e,t,n);var r=Fm;if(r&&e&&t){var i=`link[rel="preload"][as="`+$t(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+$t(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+$t(n.imageSizes)+`"]`)):i+=`[href="`+$t(e)+`"]`;var a=i;switch(t){case`style`:a=Gm(e);break;case`script`:a=Ym(e)}if(!(km.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),km.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Km(a))||t===`script`&&r.querySelector(Xm(a))))){var o=r.createElement(`link`);pp(o,`link`,e),t===`style`&&(o[Et]=!0,o.onload=o.onerror=function(){Nt(o)}),Mt(o),r.head.appendChild(o)}}}function Bm(e,t){Mm.m(e,t);var n=Fm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+$t(r)+`"][href="`+$t(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ym(e)}if(!km.has(a)&&(e=D({rel:`modulepreload`,href:e},t),km.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Xm(a)))return}r=n.createElement(`link`),pp(r,`link`,e),Mt(r),n.head.appendChild(r)}}}function Vm(e,t,n){Mm.S(e,t,n);var r=Fm;if(r&&e){var i=jt(r).hoistableStyles,a=Gm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Km(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=km.get(a))&&$m(e,n);var c=o=r.createElement(`link`);Mt(c),pp(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,Qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Hm(e,t){Mm.X(e,t);var n=Fm;if(n&&e){var r=jt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=D({src:e,async:!0},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Mt(a),pp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t){Mm.M(e,t);var n=Fm;if(n&&e){var r=jt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Mt(a),pp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Wm(e,t,n,r){var a=(a=be.current)?jm(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`?(n=Gm(n.href),t=jt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Gm(n.href);var o=jt(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(Km(e)))?o._p||(s.instance=o,s.state.loading=5):(o=km.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},km.set(e,o)),Jm(a,e,o,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`?(n=Ym(n),t=jt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Gm(e){return`href="`+$t(e)+`"`}function Km(e){return`link[rel="stylesheet"][`+e+`]`}function qm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Jm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Et]){r.loading=1;return}}else t=e.createElement(`link`),t[Et]=!0,t.onload=t.onerror=Nt.bind(null,t),pp(t,`link`,n),Mt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Ym(e){return`[src="`+$t(e)+`"]`}function Xm(e){return`script[async]`+e}function Zm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+$t(n.href)+`"]`);if(r)return t.instance=r,Mt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Mt(r),pp(r,`style`,a),Qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Gm(n.href);var o=e.querySelector(Km(a));if(o)return t.state.loading|=4,t.instance=o,Mt(o),o;r=qm(n),(a=km.get(a))&&$m(r,a),o=(e.ownerDocument||e).createElement(`link`),Mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),pp(o,`link`,r),t.state.loading|=4,Qm(o,n.precedence,e),t.instance=o;case`script`:return o=Ym(n.src),(a=e.querySelector(Xm(o)))?(t.instance=a,Mt(a),a):(r=n,(a=km.get(o))&&(r=D({},n),eh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Mt(a),pp(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,Qm(r,n.precedence,e));return t.instance}function Qm(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 $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function eh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var th=null;function nh(e,t,n){if(th===null){var r=new Map,i=th=new Map;i.set(n,r)}else i=th,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[Tt]||a[vt]||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 rh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function ih(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 ah(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function oh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function sh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ch(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=sh(t),e.suspenseyImages.push(t)),e=mh.bind(e),t.decode().then(e,e))}function lh(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=Gm(r.href),a=t.querySelector(Km(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ph.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Mt(a);return}a=t.ownerDocument||t,r=qm(r),(i=km.get(i))&&$m(r,i),a=a.createElement(`link`),Mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),pp(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=ph.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var uh=0;function dh(e,t){return e.stylesheets&&e.count===0&&gh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&gh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&uh===0&&(uh=62500*_p());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>uh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function fh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)gh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ph(){this.count--,fh(this)}function mh(){this.imgCount--,fh(this)}var hh=null;function gh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hh=new Map,t.forEach(_h,e),hh=null,ph.call(e))}function _h(e,t){if(!(t.state.loading&4)){var n=hh.get(e);if(n)var r=n.get(null);else{n=new Map,hh.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=ph.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 vh={$$typeof:F,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function yh(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=st(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=st(0),this.hiddenUpdates=st(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function bh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new yh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ki(3,null,null,t),e.current=a,a.stateNode=e,t=Aa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},po(a),e}function xh(e){return e?(e=Di,e):Di}function Sh(e,t,n,r,i,a){i=xh(i),r.context===null?r.context=i:r.pendingContext=i,r=ho(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=go(e,r,t),n!==null&&(Hd(n,e,t),_o(n,e,t))}function Ch(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function wh(e,t){Ch(e,t),(e=e.alternate)&&Ch(e,t)}function Th(e){if(e.tag===13||e.tag===31){var t=wi(e,67108864);t!==null&&Hd(t,e,67108864),wh(e,67108864)}}function Eh(e){if(e.tag===13||e.tag===31){var t=zd();t=pt(t);var n=wi(e,t);n!==null&&Hd(n,e,t),wh(e,t)}}var Dh=!0;function Oh(e,t,n,r){var i=B.T;B.T=null;var a=de.p;try{de.p=2,Ah(e,t,n,r)}finally{de.p=a,B.T=i}}function kh(e,t,n,r){var i=B.T;B.T=null;var a=de.p;try{de.p=8,Ah(e,t,n,r)}finally{de.p=a,B.T=i}}function Ah(e,t,n,r){if(Dh){var i=jh(r);if(i===null)np(e,t,r,Mh,n),Uh(e,r);else if(Gh(i,e,t,n,r))r.stopPropagation();else if(Uh(e,r),t&4&&-1<Hh.indexOf(e)){for(;i!==null;){var a=kt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=H(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ye(o);s.entanglements[1]|=c,o&=~c}Ff(a),!(rd&6)&&(wd=Le()+500,If(0,!1))}}break;case 31:case 13:s=wi(a,2),s!==null&&Hd(s,a,2),qd(),wh(a,2)}if(a=jh(r),a===null&&np(e,t,r,Mh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else np(e,t,r,null,n)}}function jh(e){return e=_n(e),Nh(e)}var Mh=null;function Nh(e){if(Mh=null,e=Ot(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 Mh=e,null}function Ph(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Re()){case ze:return 2;case Be:return 8;case Ve:case He:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var Fh=!1,Ih=null,Lh=null,Rh=null,zh=new Map,Bh=new Map,Vh=[],Hh=`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 Uh(e,t){switch(e){case`focusin`:case`focusout`:Ih=null;break;case`dragenter`:case`dragleave`:Lh=null;break;case`mouseover`:case`mouseout`:Rh=null;break;case`pointerover`:case`pointerout`:zh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Bh.delete(t.pointerId)}}function Wh(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=kt(t),t!==null&&Th(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Gh(e,t,n,r,i){switch(t){case`focusin`:return Ih=Wh(Ih,e,t,n,r,i),!0;case`dragenter`:return Lh=Wh(Lh,e,t,n,r,i),!0;case`mouseover`:return Rh=Wh(Rh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return zh.set(a,Wh(zh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Bh.set(a,Wh(Bh.get(a)||null,e,t,n,r,i)),!0}return!1}function Kh(e){var t=Ot(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,gt(e.priority,function(){Eh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,gt(e.priority,function(){Eh(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 qh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=jh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);gn=r,n.target.dispatchEvent(r),gn=null}else return t=kt(n),t!==null&&Th(t),e.blockedOn=n,!1;t.shift()}return!0}function Jh(e,t,n){qh(e)&&n.delete(t)}function Yh(){Fh=!1,Ih!==null&&qh(Ih)&&(Ih=null),Lh!==null&&qh(Lh)&&(Lh=null),Rh!==null&&qh(Rh)&&(Rh=null),zh.forEach(Jh),Bh.forEach(Jh)}function Xh(e,n){e.blockedOn===n&&(e.blockedOn=null,Fh||(Fh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Yh)))}var Zh=null;function Qh(e){Zh!==e&&(Zh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Zh===e&&(Zh=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(Nh(r||n)===null)continue;break}var a=kt(n);a!==null&&(e.splice(t,3),t-=3,tc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function $h(e){function t(t){return Xh(t,e)}Ih!==null&&Xh(Ih,e),Lh!==null&&Xh(Lh,e),Rh!==null&&Xh(Rh,e),zh.forEach(t),Bh.forEach(t);for(var n=0;n<Vh.length;n++){var r=Vh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Vh.length&&(n=Vh[0],n.blockedOn===null);)Kh(n),n.blockedOn===null&&Vh.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[yt]||null;if(typeof a==`function`)o||Qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[yt]||null)s=o.formAction;else if(Nh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Qh(n)}}}function eg(){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 tg(e){this._internalRoot=e}ng.prototype.render=tg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Sh(n,zd(),e,t,null,null)},ng.prototype.unmount=tg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sh(e.current,2,null,e,null,null),qd(),t[bt]=null}};function ng(e){this._internalRoot=e}ng.prototype.unstable_scheduleHydration=function(e){if(e){var t=ht();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vh.length&&t!==0&&t<Vh[n].priority;n++);Vh.splice(n,0,e),n===0&&Kh(e)}};var rg=n.version;if(rg!==`19.3.1`)throw Error(i(527,rg,`19.3.1`));de.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=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var ig={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:B,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ag=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ag.isDisabled&&ag.supportsFiber)try{Ke=ag.inject(ig),qe=ag}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=wc,s=Tc,c=Ec;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=bh(e,1,!1,null,null,n,r,null,o,s,c,eg),e[bt]=t.current,ep(e),new tg(t)}})),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()})),_={outline:{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},filled:{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`currentColor`,stroke:`none`}},v=c(u(),1),y=(e,t,n,r)=>{let i=(0,v.forwardRef)(({color:n=`currentColor`,size:i=24,stroke:a=2,title:o,className:s,children:c,...l},u)=>(0,v.createElement)(`svg`,{ref:u,..._[e],width:i,height:i,className:[`tabler-icon`,`tabler-icon-${t}`,s].filter(Boolean).join(` `),...e===`filled`?{fill:n}:{strokeWidth:a,stroke:n},...l},[o&&(0,v.createElement)(`title`,{key:`svg-title`},o),...r.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(c)?c:[c]]));return i.displayName=`${n}`,i},b=y(`outline`,`adjustments-horizontal`,`AdjustmentsHorizontal`,[[`path`,{d:`M12 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-0`}],[`path`,{d:`M4 6l8 0`,key:`svg-1`}],[`path`,{d:`M16 6l4 0`,key:`svg-2`}],[`path`,{d:`M6 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-3`}],[`path`,{d:`M4 12l2 0`,key:`svg-4`}],[`path`,{d:`M10 12l10 0`,key:`svg-5`}],[`path`,{d:`M15 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-6`}],[`path`,{d:`M4 18l11 0`,key:`svg-7`}],[`path`,{d:`M19 18l1 0`,key:`svg-8`}]]),x=y(`outline`,`alert-triangle`,`AlertTriangle`,[[`path`,{d:`M12 9v4`,key:`svg-0`}],[`path`,{d:`M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0`,key:`svg-1`}],[`path`,{d:`M12 16h.01`,key:`svg-2`}]]),S=y(`outline`,`arrow-left`,`ArrowLeft`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}],[`path`,{d:`M5 12l6 6`,key:`svg-1`}],[`path`,{d:`M5 12l6 -6`,key:`svg-2`}]]),C=y(`outline`,`arrow-up`,`ArrowUp`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 11l-6 -6`,key:`svg-1`}],[`path`,{d:`M6 11l6 -6`,key:`svg-2`}]]),w=y(`outline`,`book-2`,`Book2`,[[`path`,{d:`M19 4v16h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12`,key:`svg-0`}],[`path`,{d:`M19 16h-12a2 2 0 0 0 -2 2`,key:`svg-1`}],[`path`,{d:`M9 8h6`,key:`svg-2`}]]),T=y(`outline`,`browser`,`Browser`,[[`path`,{d:`M4 8h16`,key:`svg-0`}],[`path`,{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`,key:`svg-1`}],[`path`,{d:`M8 4v4`,key:`svg-2`}]]),E=y(`outline`,`check`,`Check`,[[`path`,{d:`M5 12l5 5l10 -10`,key:`svg-0`}]]),D=y(`outline`,`chevron-down`,`ChevronDown`,[[`path`,{d:`M6 9l6 6l6 -6`,key:`svg-0`}]]),O=y(`outline`,`chevron-right`,`ChevronRight`,[[`path`,{d:`M9 6l6 6l-6 6`,key:`svg-0`}]]),k=y(`outline`,`code`,`Code`,[[`path`,{d:`M7 8l-4 4l4 4`,key:`svg-0`}],[`path`,{d:`M17 8l4 4l-4 4`,key:`svg-1`}],[`path`,{d:`M14 4l-4 16`,key:`svg-2`}]]),A=y(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),j=y(`outline`,`device-floppy`,`DeviceFloppy`,[[`path`,{d:`M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2`,key:`svg-0`}],[`path`,{d:`M10 14a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M14 4l0 4l-6 0l0 -4`,key:`svg-2`}]]),M=y(`outline`,`external-link`,`ExternalLink`,[[`path`,{d:`M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6`,key:`svg-0`}],[`path`,{d:`M11 13l9 -9`,key:`svg-1`}],[`path`,{d:`M15 4h5v5`,key:`svg-2`}]]),N=y(`outline`,`home`,`Home`,[[`path`,{d:`M5 12l-2 0l9 -9l9 9l-2 0`,key:`svg-0`}],[`path`,{d:`M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7`,key:`svg-1`}],[`path`,{d:`M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6`,key:`svg-2`}]]),P=y(`outline`,`key`,`Key`,[[`path`,{d:`M16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1 -4.069 0l-.301 -.301l-6.558 6.558a2 2 0 0 1 -1.239 .578l-.175 .008h-1.172a1 1 0 0 1 -.993 -.883l-.007 -.117v-1.172a2 2 0 0 1 .467 -1.284l.119 -.13l.414 -.414h2v-2h2v-2l2.144 -2.144l-.301 -.301a2.877 2.877 0 0 1 0 -4.069l2.643 -2.643a2.877 2.877 0 0 1 4.069 0`,key:`svg-0`}],[`path`,{d:`M15 9h.01`,key:`svg-1`}]]),F=y(`outline`,`layout-grid`,`LayoutGrid`,[[`path`,{d:`M4 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-0`}],[`path`,{d:`M14 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-1`}],[`path`,{d:`M4 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-2`}],[`path`,{d:`M14 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-3`}]]),ee=y(`outline`,`list-details`,`ListDetails`,[[`path`,{d:`M13 5h8`,key:`svg-0`}],[`path`,{d:`M13 9h5`,key:`svg-1`}],[`path`,{d:`M13 15h8`,key:`svg-2`}],[`path`,{d:`M13 19h5`,key:`svg-3`}],[`path`,{d:`M3 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-4`}],[`path`,{d:`M3 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-5`}]]),I=y(`outline`,`list`,`List`,[[`path`,{d:`M9 6l11 0`,key:`svg-0`}],[`path`,{d:`M9 12l11 0`,key:`svg-1`}],[`path`,{d:`M9 18l11 0`,key:`svg-2`}],[`path`,{d:`M5 6l0 .01`,key:`svg-3`}],[`path`,{d:`M5 12l0 .01`,key:`svg-4`}],[`path`,{d:`M5 18l0 .01`,key:`svg-5`}]]),te=y(`outline`,`lock`,`Lock`,[[`path`,{d:`M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6`,key:`svg-0`}],[`path`,{d:`M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 11v-4a4 4 0 1 1 8 0v4`,key:`svg-2`}]]),ne=y(`outline`,`menu-2`,`Menu2`,[[`path`,{d:`M4 6l16 0`,key:`svg-0`}],[`path`,{d:`M4 12l16 0`,key:`svg-1`}],[`path`,{d:`M4 18l16 0`,key:`svg-2`}]]),L=y(`outline`,`message`,`Message`,[[`path`,{d:`M8 9h8`,key:`svg-0`}],[`path`,{d:`M8 13h6`,key:`svg-1`}],[`path`,{d:`M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12`,key:`svg-2`}]]),re=y(`outline`,`pencil`,`Pencil`,[[`path`,{d:`M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4`,key:`svg-0`}],[`path`,{d:`M13.5 6.5l4 4`,key:`svg-1`}]]),R=y(`outline`,`player-play`,`PlayerPlay`,[[`path`,{d:`M7 4v16l13 -8l-13 -8`,key:`svg-0`}]]),ie=y(`outline`,`player-stop`,`PlayerStop`,[[`path`,{d:`M5 7a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -10`,key:`svg-0`}]]),ae=y(`outline`,`plug-connected`,`PlugConnected`,[[`path`,{d:`M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5`,key:`svg-0`}],[`path`,{d:`M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5`,key:`svg-1`}],[`path`,{d:`M3 21l2.5 -2.5`,key:`svg-2`}],[`path`,{d:`M18.5 5.5l2.5 -2.5`,key:`svg-3`}],[`path`,{d:`M10 11l-2 2`,key:`svg-4`}],[`path`,{d:`M13 14l-2 2`,key:`svg-5`}]]),z=y(`outline`,`plus`,`Plus`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M5 12l14 0`,key:`svg-1`}]]),oe=y(`outline`,`search`,`Search`,[[`path`,{d:`M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0`,key:`svg-0`}],[`path`,{d:`M21 21l-6 -6`,key:`svg-1`}]]),se=y(`outline`,`selector`,`Selector`,[[`path`,{d:`M8 9l4 -4l4 4`,key:`svg-0`}],[`path`,{d:`M16 15l-4 4l-4 -4`,key:`svg-1`}]]),ce=y(`outline`,`server-2`,`Server2`,[[`path`,{d:`M3 7a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-2`,key:`svg-0`}],[`path`,{d:`M3 15a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3l0 -2`,key:`svg-1`}],[`path`,{d:`M7 8l0 .01`,key:`svg-2`}],[`path`,{d:`M7 16l0 .01`,key:`svg-3`}],[`path`,{d:`M11 8h6`,key:`svg-4`}],[`path`,{d:`M11 16h6`,key:`svg-5`}]]),le=y(`outline`,`sitemap`,`Sitemap`,[[`path`,{d:`M3 17a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -2`,key:`svg-0`}],[`path`,{d:`M15 17a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -2`,key:`svg-1`}],[`path`,{d:`M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -2`,key:`svg-2`}],[`path`,{d:`M6 15v-1a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v1`,key:`svg-3`}],[`path`,{d:`M12 9l0 3`,key:`svg-4`}]]),ue=y(`outline`,`sparkles`,`Sparkles`,[[`path`,{d:`M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6`,key:`svg-0`}]]),B=y(`outline`,`stack-2`,`Stack2`,[[`path`,{d:`M12 4l-8 4l8 4l8 -4l-8 -4`,key:`svg-0`}],[`path`,{d:`M4 12l8 4l8 -4`,key:`svg-1`}],[`path`,{d:`M4 16l8 4l8 -4`,key:`svg-2`}]]),de=y(`outline`,`star`,`Star`,[[`path`,{d:`M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245`,key:`svg-0`}]]),fe=y(`outline`,`test-pipe`,`TestPipe`,[[`path`,{d:`M20 8.04l-12.122 12.124a2.857 2.857 0 1 1 -4.041 -4.04l12.122 -12.124`,key:`svg-0`}],[`path`,{d:`M7 13h8`,key:`svg-1`}],[`path`,{d:`M19 15l1.5 1.6a2 2 0 1 1 -3 0l1.5 -1.6`,key:`svg-2`}],[`path`,{d:`M15 3l6 6`,key:`svg-3`}]]),pe=y(`outline`,`tool`,`Tool`,[[`path`,{d:`M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5`,key:`svg-0`}]]),me=y(`outline`,`trash`,`Trash`,[[`path`,{d:`M4 7l16 0`,key:`svg-0`}],[`path`,{d:`M10 11l0 6`,key:`svg-1`}],[`path`,{d:`M14 11l0 6`,key:`svg-2`}],[`path`,{d:`M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12`,key:`svg-3`}],[`path`,{d:`M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3`,key:`svg-4`}]]),he=y(`outline`,`x`,`X`,[[`path`,{d:`M18 6l-12 12`,key:`svg-0`}],[`path`,{d:`M6 6l12 12`,key:`svg-1`}]]),ge=g(),_e=`/__studio/api`,ve=``,ye=e=>{ve=e},be=e=>`${_e}${e}${ve?`${e.includes(`?`)?`&`:`?`}mcp=${encodeURIComponent(ve)}`:``}`;async function xe(e,t){let n=await fetch(be(e),t),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error??`Request failed (${n.status}).`);return r}var Se=(e,t)=>xe(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),Ce={get chatUrl(){return be(`/chat`)},workspace:()=>xe(`/workspace`),createMcp:e=>Se(`/workspace/servers`,e),info:()=>xe(`/info`),call:(e,t,n)=>Se(`/call`,{server:e,name:t,arguments:n}),view:(e,t)=>xe(`/view?server=${encodeURIComponent(e)}&uri=${encodeURIComponent(t)}`),settings:()=>xe(`/settings`),saveSettings:e=>Se(`/settings`,e),models:e=>xe(`/models?provider=${encodeURIComponent(e)}`),servers:()=>xe(`/servers`),addServer:e=>Se(`/servers`,e),removeServer:e=>xe(`/servers?name=${encodeURIComponent(e)}`,{method:`DELETE`}),directory:(e,t)=>xe(`/directory?q=${encodeURIComponent(e)}${t?`&remote=1`:``}`),addTool:e=>Se(`/tools`,e),describeTool:(e,t)=>Se(`/tools/describe`,{name:e,description:t}),describeInput:(e,t,n)=>Se(`/tools/describe-input`,{tool:e,field:t,description:n}),describeServer:e=>Se(`/workspace/describe`,e),tests:()=>xe(`/tests`),saveTest:e=>Se(`/tests`,e),removeTest:e=>xe(`/tests?id=${encodeURIComponent(e)}`,{method:`DELETE`}),runTests:e=>Se(`/tests/run`,e?{ids:e}:{}),ship:()=>xe(`/ship`),generate:e=>Se(`/generate`,e),file:e=>xe(`/file?path=${encodeURIComponent(e)}`),saveFile:(e,t)=>Se(`/file`,{path:e,content:t}),logs:()=>xe(`/logs`),clearLogs:()=>xe(`/logs`,{method:`DELETE`}),agents:()=>xe(`/agents`),saveAgent:e=>Se(`/agents`,e),removeAgent:e=>xe(`/agents?id=${encodeURIComponent(e)}`,{method:`DELETE`}),agentCode:(e,t=!1)=>xe(`/agents/code?id=${encodeURIComponent(e)}`,t?{method:`POST`}:void 0)},we=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})),V=o(((e,t)=>{t.exports=we()}))(),Te=(0,v.createContext)(null);function Ee(){let e=(0,v.useContext)(Te);if(!e)throw Error(`useWorkspace needs WorkspaceProvider.`);return e}var De=()=>{try{return localStorage.getItem(`plugmcp.mcp`)??``}catch{return``}};function Oe({children:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(De),s=(0,v.useCallback)(()=>Ce.workspace().then(e=>{n(e.name),i(t=>JSON.stringify(t)===JSON.stringify(e.servers)?t:e.servers)}),[]);(0,v.useEffect)(()=>{s().catch(()=>void 0);let e=setInterval(()=>document.visibilityState===`visible`&&void s().catch(()=>void 0),3e3);return()=>clearInterval(e)},[s]);let c=(0,v.useCallback)(e=>{try{localStorage.setItem(`plugmcp.mcp`,e)}catch{}o(e)},[]),l=r.length&&!r.some(e=>e.id===a)?r[0]?.id??``:a;ye(l);let u=(0,v.useMemo)(()=>({name:t,servers:r,current:l,switchTo:c,reload:s}),[t,r,l,c,s]);return(0,V.jsx)(Te.Provider,{value:u,children:(0,V.jsx)(je,{initial:r.find(e=>e.id===l),children:e},l)})}var ke=(0,v.createContext)(null);function Ae(){let e=(0,v.useContext)(ke);if(!e)throw Error(`useStudio needs StudioProvider.`);return e}function je({children:e,initial:t}){let[n,r]=(0,v.useState)(t??null),[i,a]=(0,v.useState)(t?.ok?t:null),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)([]),[m,h]=(0,v.useState)(!1),g=(0,v.useCallback)(()=>{Ce.info().then(e=>{s(!1),r(t=>JSON.stringify(t)===JSON.stringify(e)?t:e),e.ok&&a(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)}).catch(()=>s(!0))},[]),_=(0,v.useCallback)(()=>Ce.servers().then(e=>d(e.servers)),[]),y=(0,v.useCallback)(()=>Ce.agents().then(e=>{p(e.agents),h(!0)}),[]);(0,v.useEffect)(()=>{g();let e=setInterval(()=>document.visibilityState===`visible`&&g(),1500);return()=>clearInterval(e)},[g]),(0,v.useEffect)(()=>{Ce.settings().then(l).catch(()=>void 0),_().catch(()=>void 0),y().catch(()=>void 0)},[_,y]);let b=(0,v.useMemo)(()=>[...i?.tools??[],...u.flatMap(e=>e.tools)],[i,u]),x=(0,v.useMemo)(()=>{let e=c?.providers.find(e=>e.id===c.provider),t=e?c?.models[e.id]:void 0;return!e||!t||e.needsKey&&!e.hasKey?null:{provider:e.id,model:t,label:e.label}},[c]),S=(0,v.useMemo)(()=>({info:n,server:i,offline:o,settings:c,remote:u,agents:f,agentsReady:m,tools:b,model:x,refresh:g,setSettings:l,reloadRemote:_,reloadAgents:y}),[n,i,o,c,u,f,m,b,x,g,_,y]);return(0,V.jsx)(ke.Provider,{value:S,children:e})}var Me=e=>e instanceof Error?e.message:String(e);function Ne({size:e=24}){let t=(0,v.useId)().replace(/[^a-zA-Z0-9]/g,``);return(0,V.jsxs)(`svg`,{viewBox:`290 105 860 860`,width:e,height:e,"aria-hidden":`true`,style:{flexShrink:0},children:[(0,V.jsxs)(`defs`,{children:[(0,V.jsxs)(`linearGradient`,{id:`p${t}`,x1:`0`,y1:`0`,x2:`0.35`,y2:`1`,children:[(0,V.jsx)(`stop`,{offset:`0`,stopColor:`#0b6bff`}),(0,V.jsx)(`stop`,{offset:`0.55`,stopColor:`#1c86ff`}),(0,V.jsx)(`stop`,{offset:`1`,stopColor:`#47b8ff`})]}),(0,V.jsxs)(`linearGradient`,{id:`b${t}`,x1:`0`,y1:`0`,x2:`1`,y2:`0`,children:[(0,V.jsx)(`stop`,{offset:`0`,stopColor:`#1696ff`}),(0,V.jsx)(`stop`,{offset:`1`,stopColor:`#0f74ff`})]}),(0,V.jsxs)(`linearGradient`,{id:`d${t}`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,V.jsx)(`stop`,{offset:`0`,stopColor:`#9aa6ff`}),(0,V.jsx)(`stop`,{offset:`1`,stopColor:`#6c88ff`})]})]}),(0,V.jsx)(`rect`,{x:`316`,y:`420`,width:`154`,height:`132`,rx:`34`,fill:`url(#d${t})`}),(0,V.jsx)(`rect`,{x:`508`,y:`420`,width:`334`,height:`132`,rx:`66`,fill:`url(#b${t})`}),(0,V.jsx)(`path`,{d:`M637 266H860A207 207 0 0 1 860 680H800A86 86 0 0 0 714 766V808`,fill:`none`,stroke:`url(#p${t})`,strokeWidth:`126`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Pe({name:e,large:t=!1}){return(0,V.jsx)(`span`,{className:`glyph${t?` glyph-lg`:``}`,"aria-hidden":`true`,children:e.trim().slice(0,1).toUpperCase()||`?`})}function Fe({title:e,lede:t,children:n}){return(0,V.jsxs)(`div`,{className:`page-head`,children:[(0,V.jsxs)(`div`,{className:`grow`,children:[(0,V.jsx)(`h1`,{children:e}),t?(0,V.jsx)(`p`,{className:`lede`,children:t}):null]}),n?(0,V.jsx)(`div`,{className:`row-wrap`,children:n}):null]})}function Ie({icon:e,children:t,action:n}){return(0,V.jsxs)(`div`,{className:`section-head`,children:[(0,V.jsxs)(`h2`,{className:`section-title`,children:[(0,V.jsx)(e,{size:16,stroke:1.75,"aria-hidden":`true`}),t]}),n]})}function Le({icon:e,title:t,children:n,actions:r}){return(0,V.jsxs)(`div`,{className:`empty`,children:[(0,V.jsx)(`span`,{className:`empty-icon`,children:(0,V.jsx)(e,{size:20,stroke:1.75,"aria-hidden":`true`})}),(0,V.jsx)(`h2`,{children:t}),(0,V.jsx)(`p`,{children:n}),r?(0,V.jsx)(`div`,{className:`row-wrap`,children:r}):null]})}function Re(){let[e,t]=(0,v.useState)(!1);return[e,e=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)})}]}function ze({value:e,label:t=`Copy`}){let[n,r]=Re();return(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm btn-icon`,"aria-label":t,title:t,onClick:()=>r(e),children:n?(0,V.jsx)(E,{size:15,stroke:2}):(0,V.jsx)(A,{size:15,stroke:1.75})})}function Be({value:e,label:t}){return(0,V.jsxs)(`div`,{className:`copybox`,children:[(0,V.jsx)(`pre`,{className:`code`,children:e}),(0,V.jsx)(ze,{value:e,label:`Copy ${t??`to clipboard`}`})]})}function Ve({value:e,options:t,onChange:n}){return(0,V.jsx)(`div`,{className:`seg`,role:`tablist`,children:t.map(t=>(0,V.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e===t.id,className:e===t.id?`is-active`:``,onClick:()=>n(t.id),children:t.label},t.id))})}function He({title:e,lede:t,onClose:n,children:r,wide:i=!1}){return(0,v.useEffect)(()=>{let e=e=>e.key===`Escape`&&n();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]),(0,V.jsx)(`div`,{className:`overlay`,onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,V.jsxs)(`div`,{className:`modal`,role:`dialog`,"aria-modal":`true`,"aria-label":e,style:i?{maxWidth:640}:void 0,children:[(0,V.jsxs)(`div`,{className:`modal-head`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{children:e}),t?(0,V.jsx)(`p`,{className:`muted small`,style:{marginTop:4},children:t}):null]}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm btn-icon`,onClick:n,"aria-label":`Close`,children:(0,V.jsx)(he,{size:16,stroke:1.75})})]}),r]})})}function Ue(){let e=()=>window.location.hash.replace(/^#\/?/,``).split(`/`).filter(Boolean).map(decodeURIComponent),[t,n]=(0,v.useState)(e);return(0,v.useEffect)(()=>{let t=()=>n(e());return window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[]),t}var We=e=>{window.location.hash=e},Ge=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function Ke(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<5?`now`:t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}function qe({onClose:e}){let{server:t,refresh:n}=Ae(),r=Ee(),[i,a]=(0,v.useState)(t?.title??``),[o,s]=(0,v.useState)(t?.description??``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null);async function f(){l(!0),d(null);try{await Ce.describeServer({title:i,description:o}),n(),await r.reload(),e()}catch(e){d(Me(e))}finally{l(!1)}}return(0,V.jsx)(He,{title:`Edit this MCP server`,lede:`Written to ${t?.file??`the server file`}. Clients and models see both when they connect.`,onClose:e,children:(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f()},children:[(0,V.jsxs)(`div`,{className:`modal-body`,children:[(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsxs)(`label`,{htmlFor:`mcp-title`,children:[`Display name `,(0,V.jsxs)(`span`,{className:`optional`,children:[`shown in clients; the address keeps using `,t?.name]})]}),(0,V.jsx)(`input`,{id:`mcp-title`,value:i,onChange:e=>a(e.target.value),placeholder:t?.name,autoFocus:!0})]}),(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsx)(`label`,{htmlFor:`mcp-about`,children:`Description`}),(0,V.jsx)(`textarea`,{id:`mcp-about`,rows:3,value:o,onChange:e=>s(e.target.value),placeholder:`What this server is for, in one or two sentences.`})]}),u?(0,V.jsx)(`p`,{className:`small fault`,children:u}):null]}),(0,V.jsxs)(`div`,{className:`modal-foot`,children:[(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:e,children:`Cancel`}),(0,V.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:c||!i.trim()&&!o.trim(),children:c?`Saving`:`Save`})]})]})})}function Je({onClose:e}){let t=Ee(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),u=n.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``);async function d(){s(!0),l(null);try{let r=await Ce.createMcp({name:n,description:i});await t.reload(),t.switchTo(r.id),e(),We(`/canvas`)}catch(e){l(Me(e))}finally{s(!1)}}return(0,V.jsx)(He,{title:`New MCP server`,lede:`An MCP server is a set of tools behind one address. Make one for each product or job, then add tools under it.`,onClose:e,children:(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),d()},children:[(0,V.jsxs)(`div`,{className:`modal-body`,children:[(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsx)(`label`,{htmlFor:`mcp-name`,children:`Name`}),(0,V.jsx)(`input`,{id:`mcp-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Billing`,autoFocus:!0}),(0,V.jsx)(`p`,{className:`hint`,children:u?(0,V.jsxs)(V.Fragment,{children:[`Written to `,(0,V.jsxs)(`span`,{className:`mono`,children:[`servers/`,u,`/server.ts`]}),` and served at `,(0,V.jsxs)(`span`,{className:`mono`,children:[`/mcp/`,u]}),`.`]}):`For example Billing, Support desk or Diagrams.`})]}),(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsxs)(`label`,{htmlFor:`mcp-what`,children:[`What it is for `,(0,V.jsx)(`span`,{className:`optional`,children:`shown to people and models that connect`})]}),(0,V.jsx)(`textarea`,{id:`mcp-what`,rows:3,value:i,onChange:e=>a(e.target.value),placeholder:`Look up invoices, payments and refunds for a customer.`})]}),c?(0,V.jsx)(`p`,{className:`small fault`,children:c}):null]}),(0,V.jsxs)(`div`,{className:`modal-foot`,children:[(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:e,children:`Cancel`}),(0,V.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:o||!u,children:o?`Creating`:`Create MCP server`})]})]})})}function Ye(e){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)({}),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),l=(0,v.useCallback)(()=>Ce.tests().then(e=>n(e.tests)),[]);return(0,v.useEffect)(()=>{l().catch(()=>void 0)},[l]),{tests:e?t.filter(t=>t.tool===e):t,results:r,busy:a,error:s,run:(0,v.useCallback)(async n=>{o(!0),c(null);try{let{results:r}=await Ce.runTests(n??(e?t.filter(t=>t.tool===e).map(e=>e.id):void 0));i(e=>({...e,...Object.fromEntries(r.map(e=>[e.id,e]))}))}catch(e){c(Me(e))}finally{o(!1)}},[t,e]),save:(0,v.useCallback)(async e=>{let{test:t}=await Ce.saveTest(e);return await l(),t},[l]),remove:(0,v.useCallback)(async e=>{await Ce.removeTest(e),await l()},[l])}}function Xe({result:e}){return e?e.ok?(0,V.jsx)(E,{size:14,stroke:2.5,style:{color:`var(--cable)`},"aria-label":`Passed`}):(0,V.jsx)(he,{size:14,stroke:2.5,style:{color:`var(--fault)`},"aria-label":`Failed`}):(0,V.jsx)(`span`,{className:`dot`,title:`Not run yet`})}function Ze({state:e}){let{tests:t,results:n,busy:r,error:i,run:a,remove:o}=e;return t.length===0?null:(0,V.jsxs)(`div`,{className:`panel`,children:[(0,V.jsxs)(`div`,{className:`panel-head`,children:[(0,V.jsxs)(`h2`,{className:`section-title`,children:[`Saved tests `,(0,V.jsx)(`span`,{className:`muted small`,children:t.length})]}),(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-outline btn-sm`,disabled:r,onClick:()=>void a(),children:[(0,V.jsx)(R,{size:13,stroke:2}),` `,r?`Running`:`Run all`]})]}),i?(0,V.jsx)(`p`,{className:`panel-pad small fault`,children:i}):null,t.map(e=>(0,V.jsxs)(`div`,{className:`test-row`,children:[(0,V.jsx)(Xe,{result:n[e.id]}),(0,V.jsxs)(`span`,{className:`grow`,children:[(0,V.jsx)(`span`,{className:`truncate`,style:{display:`block`,fontSize:13},children:e.name}),n[e.id]&&!n[e.id]?.ok?(0,V.jsx)(`span`,{className:`small fault`,children:n[e.id]?.reason}):null]}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm btn-icon`,"aria-label":`Run ${e.name}`,disabled:r,onClick:()=>void a([e.id]),children:(0,V.jsx)(R,{size:13,stroke:2})}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm btn-icon`,"aria-label":`Delete ${e.name}`,onClick:()=>void o(e.id),children:(0,V.jsx)(me,{size:13,stroke:1.75})})]},e.id))]})}function Qe({test:e,result:t,state:n}){let[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(e.contains??``),s=a.trim()!==(e.contains??``);return(0,V.jsxs)(`div`,{className:`test-block`,children:[(0,V.jsxs)(`div`,{className:`test-row`,children:[(0,V.jsx)(Xe,{result:t}),(0,V.jsxs)(`button`,{type:`button`,className:`grow test-open`,onClick:()=>i(e=>!e),"aria-expanded":r,children:[(0,V.jsx)(`span`,{className:`truncate`,style:{display:`block`,fontSize:13.5},children:e.name}),(0,V.jsx)(`span`,{className:`small muted mono truncate`,style:{display:`block`},children:JSON.stringify(e.arguments)})]}),t?(0,V.jsxs)(`span`,{className:`num`,children:[t.ms,` ms`]}):null,(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm btn-icon`,"aria-label":`Run ${e.name}`,disabled:n.busy,onClick:()=>void n.run([e.id]),children:(0,V.jsx)(R,{size:13,stroke:2})}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm btn-icon`,"aria-label":`Delete ${e.name}`,onClick:()=>void n.remove(e.id),children:(0,V.jsx)(me,{size:13,stroke:1.75})})]}),t&&!t.ok?(0,V.jsx)(`p`,{className:`small fault`,style:{padding:`0 16px 10px 40px`},children:t.reason}):null,r?(0,V.jsxs)(`div`,{className:`test-detail`,children:[(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsxs)(`label`,{htmlFor:`contains-${e.id}`,children:[`The result must contain `,(0,V.jsx)(`span`,{className:`optional`,children:`leave empty to only check it does not fail`})]}),(0,V.jsxs)(`div`,{className:`row`,children:[(0,V.jsx)(`input`,{id:`contains-${e.id}`,className:`input grow`,value:a,onChange:e=>o(e.target.value),placeholder:`For example Lisbon`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-outline btn-sm`,disabled:!s,onClick:()=>void n.save({...e,contains:a}),children:`Save`})]})]}),(0,V.jsxs)(`label`,{className:`check`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e.expectError===!0,onChange:t=>void n.save({...e,expectError:t.target.checked})}),`This call should fail (for example a missing or wrong input)`]}),t?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`muted small`,children:`Last result`}),(0,V.jsx)(`pre`,{className:`code`,children:t.output})]}):null]}):null]})}function $e(){let e=Ye(),{tests:t,results:n,busy:r,error:i,run:a}=e,o=t.filter(e=>n[e.id]),s=o.filter(e=>n[e.id]?.ok).length,c=[...new Set(t.map(e=>e.tool))];return(0,V.jsxs)(`div`,{className:`page`,children:[(0,V.jsxs)(Fe,{title:`Tests`,lede:`Saved calls of your tools and what they should give back. Run them after every change, here or with plugmcp test in a terminal or in CI.`,children:[o.length?(0,V.jsxs)(`span`,{className:`pill ${s===o.length?`pill-ok`:`pill-fault`}`,children:[s,` of `,o.length,` passed`]}):null,(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,disabled:r||t.length===0,onClick:()=>void a(),children:[(0,V.jsx)(R,{size:15,stroke:2}),` `,r?`Running`:`Run ${Ge(t.length,`test`)}`]})]}),i?(0,V.jsx)(`p`,{className:`small fault`,children:i}):null,t.length===0?(0,V.jsx)(Le,{icon:fe,title:`No tests yet`,actions:(0,V.jsx)(`a`,{className:`btn btn-primary`,href:`#/tools`,children:`Open a tool`}),children:`Run a tool with real input, then press Save as test. The call is kept with its input, and you can say what the result must contain.`}):c.map(r=>(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`section-head`,children:[(0,V.jsx)(`h2`,{className:`section-title mono`,children:r}),(0,V.jsx)(`a`,{className:`link small`,href:`#/tools/${r}`,children:`Open the tool`})]}),(0,V.jsx)(`div`,{className:`panel`,children:t.filter(e=>e.tool===r).map(t=>(0,V.jsx)(Qe,{test:t,result:n[t.id],state:e},`${t.id}:${t.contains??``}`))})]},r))]})}var et=[`Convert an amount between two currencies using live rates, with a card showing the result`,`Look up a GitHub repository and show its stars, language and latest release`,`Search Wikipedia and show the top three results as a list the user can open`];function tt({onClose:e}){let{server:t,model:n,refresh:r}=Ae(),[i,a]=(0,v.useState)(n?`describe`:`blank`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!0),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(null);async function g(){p(!0),h(null);try{let t;if(i===`describe`){if(!n)throw Error(`Connect a model first.`);t=(await Ce.generate({description:o,view:u,provider:n.provider,model:n.model})).name}else await Ce.addTool({name:c,description:o,view:u}),t=c;r(),e(),We(`/tools/${t}`)}catch(e){h(Me(e))}finally{p(!1)}}return(0,V.jsx)(He,{title:`New tool`,lede:`Adds the tool to the ${t?.title??t?.name??`current`} MCP server, in ${t?.file??`its server file`}. It is live as soon as it is written.`,onClose:e,children:(0,V.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),g()},children:[(0,V.jsxs)(`div`,{className:`modal-body`,children:[(0,V.jsx)(Ve,{value:i,onChange:a,options:[{id:`describe`,label:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ue,{size:14,stroke:1.75}),` Describe it`]})},{id:`blank`,label:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(re,{size:14,stroke:1.75}),` Start blank`]})}]}),i===`describe`?n?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsx)(`label`,{htmlFor:`tool-ask`,children:`What should the tool do?`}),(0,V.jsx)(`textarea`,{id:`tool-ask`,rows:4,value:o,onChange:e=>s(e.target.value),placeholder:et[0],autoFocus:!0}),(0,V.jsxs)(`p`,{className:`hint`,children:[`Written by `,n.label,` `,(0,V.jsx)(`span`,{className:`mono`,children:n.model}),` with your key. It is sent your description and your server file. You can read and edit the code afterwards.`]})]}),(0,V.jsx)(`div`,{className:`row-wrap`,children:et.slice(1).map(e=>(0,V.jsx)(`button`,{type:`button`,className:`chip`,onClick:()=>s(e),children:e},e))})]}):(0,V.jsxs)(`p`,{className:`muted`,children:[`This uses your own model. `,(0,V.jsx)(`a`,{className:`link`,href:`#/settings`,onClick:e,children:`Add a model key`}),` first, or start blank.`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsx)(`label`,{htmlFor:`tool-name`,children:`Name`}),(0,V.jsx)(`input`,{id:`tool-name`,className:`mono`,value:c,onChange:e=>l(e.target.value),placeholder:`search_orders`,autoFocus:!0}),(0,V.jsx)(`p`,{className:`hint`,children:`Lowercase letters, numbers and underscores.`})]}),(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsxs)(`label`,{htmlFor:`tool-what`,children:[`What it does `,(0,V.jsx)(`span`,{className:`optional`,children:`the model reads this to decide when to call it`})]}),(0,V.jsx)(`textarea`,{id:`tool-what`,rows:3,value:o,onChange:e=>s(e.target.value),placeholder:`Find a customer's orders by email. Use it when the user asks about an order.`})]})]}),(0,V.jsxs)(`label`,{className:`check`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked)}),`Give it a view the user sees in the chat`]}),m?(0,V.jsx)(`p`,{className:`small fault`,children:m}):null]}),(0,V.jsxs)(`div`,{className:`modal-foot`,children:[(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:e,children:`Cancel`}),(0,V.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:f||(i===`describe`?!n||!o.trim():!c.trim()),children:f?i===`describe`?`Writing the tool`:`Adding`:i===`describe`?`Write the tool`:`Add tool`})]})]})})}var H=o(((e,t)=>{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},d=(e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),f=e=>l(r({},`__esModule`,{value:!0}),e),p={};c(p,{$dispatcherGuard:()=>T,$makeReadOnly:()=>D,$reset:()=>E,$structuralCheck:()=>P,c:()=>b,clearRenderCounterRegistry:()=>k,renderCounterRegistry:()=>O,useRenderCounter:()=>M}),t.exports=f(p);var m=d(u()),{useRef:h,useEffect:g,isValidElement:_}=m,v=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE??m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,y=Symbol.for(`react.memo_cache_sentinel`),b=typeof m.__COMPILER_RUNTIME?.c==`function`?m.__COMPILER_RUNTIME.c:function(e){return m.useMemo(()=>{let t=Array(e);for(let n=0;n<e;n++)t[n]=y;return t[y]=!0,t},[])},x={};[`readContext`,`useCallback`,`useContext`,`useEffect`,`useImperativeHandle`,`useInsertionEffect`,`useLayoutEffect`,`useMemo`,`useReducer`,`useRef`,`useState`,`useDebugValue`,`useDeferredValue`,`useTransition`,`useMutableSource`,`useSyncExternalStore`,`useId`,`unstable_isNewReconciler`,`getCacheSignal`,`getCacheForType`,`useCacheRefresh`].forEach(e=>{x[e]=()=>{throw Error(`[React] Unexpected React hook call (${e}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var S=null;x.useMemoCache=e=>{if(S==null)throw Error(`React Compiler internal invariant violation: unexpected null dispatcher`);return S.useMemoCache(e)};function C(e){return v.ReactCurrentDispatcher.current=e,v.ReactCurrentDispatcher.current}var w=[];function T(e){let t=v.ReactCurrentDispatcher.current;if(e===0){if(w.push(t),w.length===1&&(S=t),t===x)throw Error(`[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.`);C(x)}else if(e===1){let e=w.pop();if(e==null)throw Error(`React Compiler internal error: unexpected null in guard stack`);w.length===0&&(S=null),C(e)}else if(e===2)w.push(t),C(S);else if(e===3){let e=w.pop();if(e==null)throw Error(`React Compiler internal error: unexpected null in guard stack`);C(e)}else throw Error(`React Compiler internal error: unreachable block`+e)}function E(e){for(let t=0;t<e.length;t++)e[t]=y}function D(){throw Error(`TODO: implement $makeReadOnly in react-compiler-runtime`)}var O=new Map;function k(){for(let e of O.values())e.forEach(e=>{e.count=0})}function A(e,t){let n=O.get(e);n??(n=new Set,O.set(e,n)),n.add(t)}function j(e,t){O.get(e)?.delete(t)}function M(e){let t=h(null);t.current!=null&&(t.current.count+=1),g(()=>{if(t.current==null){let n={count:0};A(e,n),t.current=n}return()=>{t.current!==null&&j(e,t.current)}})}var N=new Set;function P(e,t,n,r,i,a){function o(e,t,o,s){let c=`${r}:${a} [${i}] ${n}${o} changed from ${e} to ${t} at depth ${s}`;N.has(c)||(N.add(c),console.error(c))}function s(e,t,n,r){if(!(r>2)&&e!==t){if(typeof e!=typeof t)o(`type ${typeof e}`,`type ${typeof t}`,n,r);else if(typeof e==`object`){let i=Array.isArray(e),a=Array.isArray(t);if(e===null&&t!==null)o(`null`,`type ${typeof t}`,n,r);else if(t===null)o(`type ${typeof e}`,`null`,n,r);else if(e instanceof Map){if(!(t instanceof Map))o(`Map instance`,`other value`,n,r);else if(e.size!==t.size)o(`Map instance with size ${e.size}`,`Map instance with size ${t.size}`,n,r);else for(let[i,a]of e)t.has(i)?s(a,t.get(i),`${n}.get(${i})`,r+1):o(`Map instance with key ${i}`,`Map instance without key ${i}`,n,r)}else if(t instanceof Map)o(`other value`,`Map instance`,n,r);else if(e instanceof Set){if(!(t instanceof Set))o(`Set instance`,`other value`,n,r);else if(e.size!==t.size)o(`Set instance with size ${e.size}`,`Set instance with size ${t.size}`,n,r);else for(let i of t)e.has(i)||o(`Set instance without element ${i}`,`Set instance with element ${i}`,n,r)}else if(t instanceof Set)o(`other value`,`Set instance`,n,r);else if(i||a){if(i!==a)o(`type ${i?`array`:`object`}`,`type ${a?`array`:`object`}`,n,r);else if(e.length!==t.length)o(`array with length ${e.length}`,`array with length ${t.length}`,n,r);else for(let i=0;i<e.length;i++)s(e[i],t[i],`${n}[${i}]`,r+1)}else if(_(e)||_(t))_(e)===_(t)?e.type===t.type?s(e.props,t.props,`[props of ${n}]`,r+1):o(`React element of type ${e.type}`,`React element of type ${t.type}`,n,r):o(`type ${_(e)?`React element`:`object`}`,`type ${_(t)?`React element`:`object`}`,n,r);else{for(let i in t)i in e||o(`object without key ${i}`,`object with key ${i}`,n,r);for(let i in e)i in t?s(e[i],t[i],`${n}.${i}`,r+1):o(`object with key ${i}`,`object without key ${i}`,n,r)}}else if(typeof e==`function`)return;else isNaN(e)||isNaN(t)?isNaN(e)!==isNaN(t)&&o(`${isNaN(e)?`NaN`:`non-NaN value`}`,`${isNaN(t)?`NaN`:`non-NaN value`}`,n,r):e!==t&&o(e,t,n,r)}}s(e,t,``,0)}0&&(t.exports={$dispatcherGuard:T,$makeReadOnly:D,$reset:E,$structuralCheck:P,c:b,clearRenderCounterRegistry:k,renderCounterRegistry:O,useRenderCounter:M})}))();function nt(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=nt(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var rt={value:()=>{}};function it(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new at(n)}function at(e){this._=e}function ot(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}at.prototype=it.prototype={constructor:at,on:function(e,t){var n=this._,r=ot(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=st(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=ct(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ct(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new at(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function st(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ct(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=rt,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var lt=`http://www.w3.org/1999/xhtml`,ut={svg:`http://www.w3.org/2000/svg`,xhtml:lt,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function dt(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),ut.hasOwnProperty(t)?{space:ut[t],local:e}:e}function ft(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===lt&&t.documentElement.namespaceURI===lt?t.createElement(e):t.createElementNS(n,e)}}function pt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mt(e){var t=dt(e);return(t.local?pt:ft)(t)}function ht(){}function gt(e){return e==null?ht:function(){return this.querySelector(e)}}function _t(e){typeof e!=`function`&&(e=gt(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new or(r,this._parents)}function vt(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function yt(){return[]}function bt(e){return e==null?yt:function(){return this.querySelectorAll(e)}}function xt(e){return function(){return vt(e.apply(this,arguments))}}function St(e){e=typeof e==`function`?xt(e):bt(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new or(r,i)}function Ct(e){return function(){return this.matches(e)}}function wt(e){return function(t){return t.matches(e)}}var Tt=Array.prototype.find;function Et(e){return function(){return Tt.call(this.children,e)}}function Dt(){return this.firstElementChild}function Ot(e){return this.select(e==null?Dt:Et(typeof e==`function`?e:wt(e)))}var kt=Array.prototype.filter;function At(){return Array.from(this.children)}function jt(e){return function(){return kt.call(this.children,e)}}function Mt(e){return this.selectAll(e==null?At:jt(typeof e==`function`?e:wt(e)))}function Nt(e){typeof e!=`function`&&(e=Ct(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new or(r,this._parents)}function Pt(e){return Array(e.length)}function Ft(){return new or(this._enter||this._groups.map(Pt),this._parents)}function It(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}It.prototype={constructor:It,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Lt(e){return function(){return e}}function Rt(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new It(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function zt(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new It(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Bt(e){return e.__data__}function Vt(e,t){if(!arguments.length)return Array.from(this,Bt);var n=t?zt:Rt,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Lt(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Ht(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new or(o,r),o._enter=s,o._exit=c,o}function Ht(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Ut(){return new or(this._exit||this._groups.map(Pt),this._parents)}function Wt(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Gt(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new or(s,this._parents)}function Kt(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function qt(e){e||=Jt;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new or(i,this._parents).order()}function Jt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Yt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xt(){return Array.from(this)}function Zt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Qt(){let e=0;for(let t of this)++e;return e}function $t(){return!this.node()}function en(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function tn(e){return function(){this.removeAttribute(e)}}function nn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rn(e,t){return function(){this.setAttribute(e,t)}}function an(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function on(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function sn(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function cn(e,t){var n=dt(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?nn:tn:typeof t==`function`?n.local?sn:on:n.local?an:rn)(n,t))}function ln(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function un(e){return function(){this.style.removeProperty(e)}}function dn(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fn(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function pn(e,t,n){return arguments.length>1?this.each((t==null?un:typeof t==`function`?fn:dn)(e,t,n??``)):mn(this.node(),e)}function mn(e,t){return e.style.getPropertyValue(t)||ln(e).getComputedStyle(e,null).getPropertyValue(t)}function hn(e){return function(){delete this[e]}}function gn(e,t){return function(){this[e]=t}}function _n(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function vn(e,t){return arguments.length>1?this.each((t==null?hn:typeof t==`function`?_n:gn)(e,t)):this.node()[e]}function yn(e){return e.trim().split(/^|\s+/)}function bn(e){return e.classList||new xn(e)}function xn(e){this._node=e,this._names=yn(e.getAttribute(`class`)||``)}xn.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Sn(e,t){for(var n=bn(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Cn(e,t){for(var n=bn(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function wn(e){return function(){Sn(this,e)}}function Tn(e){return function(){Cn(this,e)}}function En(e,t){return function(){(t.apply(this,arguments)?Sn:Cn)(this,e)}}function Dn(e,t){var n=yn(e+``);if(arguments.length<2){for(var r=bn(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?En:t?wn:Tn)(n,t))}function On(){this.textContent=``}function kn(e){return function(){this.textContent=e}}function An(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function jn(e){return arguments.length?this.each(e==null?On:(typeof e==`function`?An:kn)(e)):this.node().textContent}function Mn(){this.innerHTML=``}function Nn(e){return function(){this.innerHTML=e}}function Pn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Fn(e){return arguments.length?this.each(e==null?Mn:(typeof e==`function`?Pn:Nn)(e)):this.node().innerHTML}function In(){this.nextSibling&&this.parentNode.appendChild(this)}function Ln(){return this.each(In)}function Rn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zn(){return this.each(Rn)}function Bn(e){var t=typeof e==`function`?e:mt(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Vn(){return null}function Hn(e,t){var n=typeof e==`function`?e:mt(e),r=t==null?Vn:typeof t==`function`?t:gt(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Un(){var e=this.parentNode;e&&e.removeChild(this)}function Wn(){return this.each(Un)}function Gn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Kn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qn(e){return this.select(e?Kn:Gn)}function Jn(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Yn(e){return function(t){e.call(this,t,this.__data__)}}function Xn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Zn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Qn(e,t,n){return function(){var r=this.__on,i,a=Yn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function $n(e,t,n){var r=Xn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?Qn:Zn,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function er(e,t,n){var r=ln(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function tr(e,t){return function(){return er(this,e,t)}}function nr(e,t){return function(){return er(this,e,t.apply(this,arguments))}}function rr(e,t){return this.each((typeof t==`function`?nr:tr)(e,t))}function*ir(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var ar=[null];function or(e,t){this._groups=e,this._parents=t}function sr(){return new or([[document.documentElement]],ar)}function cr(){return this}or.prototype=sr.prototype={constructor:or,select:_t,selectAll:St,selectChild:Ot,selectChildren:Mt,filter:Nt,data:Vt,enter:Ft,exit:Ut,join:Wt,merge:Gt,selection:cr,order:Kt,sort:qt,call:Yt,nodes:Xt,node:Zt,size:Qt,empty:$t,each:en,attr:cn,style:pn,property:vn,classed:Dn,text:jn,html:Fn,raise:Ln,lower:zn,append:Bn,insert:Hn,remove:Wn,clone:qn,datum:Jn,on:$n,dispatch:rr,[Symbol.iterator]:ir};function lr(e){return typeof e==`string`?new or([[document.querySelector(e)]],[document.documentElement]):new or([[e]],ar)}var ur=0;function dr(){return new fr}function fr(){this._=`@`+(++ur).toString(36)}fr.prototype=dr.prototype={constructor:fr,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function pr(e){let t;for(;t=e.sourceEvent;)e=t;return e}function mr(e,t){if(e=pr(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var hr={passive:!1},gr={capture:!0,passive:!1};function _r(e){e.stopImmediatePropagation()}function vr(e){e.preventDefault(),e.stopImmediatePropagation()}function yr(e){var t=e.document.documentElement,n=lr(e).on(`dragstart.drag`,vr,gr);`onselectstart`in t?n.on(`selectstart.drag`,vr,gr):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function br(e,t){var n=e.document.documentElement,r=lr(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,vr,gr),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var xr=e=>()=>e;function Sr(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Sr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Cr(e){return!e.ctrlKey&&!e.button}function wr(){return this.parentNode}function Tr(e,t){return t??{x:e.x,y:e.y}}function Er(){return navigator.maxTouchPoints||`ontouchstart`in this}function Dr(){var e=Cr,t=wr,n=Tr,r=Er,i={},a=it(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,hr).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(lr(n.view).on(`mousemove.drag`,m,gr).on(`mouseup.drag`,h,gr),yr(n.view),_r(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(vr(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){lr(e.view).on(`mousemove.drag mouseup.drag`,null),br(e.view,l),vr(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(_r(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(vr(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(_r(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=mr(l||r,t),p,m,h;if((h=n.call(e,new Sr(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=mr(l||a,t),_=o}u.call(r,e,new Sr(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:xr(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:xr(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:xr(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:xr(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Or(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function kr(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ar(){}var jr=.7,Mr=1/jr,Nr=`\\s*([+-]?\\d+)\\s*`,Pr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Fr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Ir=/^#([0-9a-f]{3,8})$/,Lr=RegExp(`^rgb\\(${Nr},${Nr},${Nr}\\)$`),Rr=RegExp(`^rgb\\(${Fr},${Fr},${Fr}\\)$`),zr=RegExp(`^rgba\\(${Nr},${Nr},${Nr},${Pr}\\)$`),Br=RegExp(`^rgba\\(${Fr},${Fr},${Fr},${Pr}\\)$`),Vr=RegExp(`^hsl\\(${Pr},${Fr},${Fr}\\)$`),Hr=RegExp(`^hsla\\(${Pr},${Fr},${Fr},${Pr}\\)$`),Ur={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Or(Ar,Jr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Wr,formatHex:Wr,formatHex8:Gr,formatHsl:Kr,formatRgb:qr,toString:qr});function Wr(){return this.rgb().formatHex()}function Gr(){return this.rgb().formatHex8()}function Kr(){return si(this).formatHsl()}function qr(){return this.rgb().formatRgb()}function Jr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Ir.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Yr(t):n===3?new $r(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Xr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Xr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Lr.exec(e))?new $r(t[1],t[2],t[3],1):(t=Rr.exec(e))?new $r(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=zr.exec(e))?Xr(t[1],t[2],t[3],t[4]):(t=Br.exec(e))?Xr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Vr.exec(e))?oi(t[1],t[2]/100,t[3]/100,1):(t=Hr.exec(e))?oi(t[1],t[2]/100,t[3]/100,t[4]):Ur.hasOwnProperty(e)?Yr(Ur[e]):e===`transparent`?new $r(NaN,NaN,NaN,0):null}function Yr(e){return new $r(e>>16&255,e>>8&255,e&255,1)}function Xr(e,t,n,r){return r<=0&&(e=t=n=NaN),new $r(e,t,n,r)}function Zr(e){return e instanceof Ar||(e=Jr(e)),e?(e=e.rgb(),new $r(e.r,e.g,e.b,e.opacity)):new $r}function Qr(e,t,n,r){return arguments.length===1?Zr(e):new $r(e,t,n,r??1)}function $r(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Or($r,Qr,kr(Ar,{brighter(e){return e=e==null?Mr:Mr**+e,new $r(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?jr:jr**+e,new $r(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $r(ii(this.r),ii(this.g),ii(this.b),ri(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ei,formatHex:ei,formatHex8:ti,formatRgb:ni,toString:ni}));function ei(){return`#${ai(this.r)}${ai(this.g)}${ai(this.b)}`}function ti(){return`#${ai(this.r)}${ai(this.g)}${ai(this.b)}${ai((isNaN(this.opacity)?1:this.opacity)*255)}`}function ni(){let e=ri(this.opacity);return`${e===1?`rgb(`:`rgba(`}${ii(this.r)}, ${ii(this.g)}, ${ii(this.b)}${e===1?`)`:`, ${e})`}`}function ri(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ii(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ai(e){return e=ii(e),(e<16?`0`:``)+e.toString(16)}function oi(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new li(e,t,n,r)}function si(e){if(e instanceof li)return new li(e.h,e.s,e.l,e.opacity);if(e instanceof Ar||(e=Jr(e)),!e)return new li;if(e instanceof li)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new li(o,s,c,e.opacity)}function ci(e,t,n,r){return arguments.length===1?si(e):new li(e,t,n,r??1)}function li(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Or(li,ci,kr(Ar,{brighter(e){return e=e==null?Mr:Mr**+e,new li(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jr:jr**+e,new li(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new $r(fi(e>=240?e-240:e+120,i,r),fi(e,i,r),fi(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new li(ui(this.h),di(this.s),di(this.l),ri(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=ri(this.opacity);return`${e===1?`hsl(`:`hsla(`}${ui(this.h)}, ${di(this.s)*100}%, ${di(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function ui(e){return e=(e||0)%360,e<0?e+360:e}function di(e){return Math.max(0,Math.min(1,e||0))}function fi(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var pi=Math.PI/180,mi=180/Math.PI,hi=18,gi=.96422,_i=1,vi=.82521,yi=4/29,bi=6/29,xi=3*bi*bi,Si=bi*bi*bi;function Ci(e){if(e instanceof Ti)return new Ti(e.l,e.a,e.b,e.opacity);if(e instanceof Mi)return Ni(e);e instanceof $r||(e=Zr(e));var t=ki(e.r),n=ki(e.g),r=ki(e.b),i=Ei((.2225045*t+.7168786*n+.0606169*r)/_i),a,o;return t===n&&n===r?a=o=i:(a=Ei((.4360747*t+.3850649*n+.1430804*r)/gi),o=Ei((.0139322*t+.0971045*n+.7141733*r)/vi)),new Ti(116*i-16,500*(a-i),200*(i-o),e.opacity)}function wi(e,t,n,r){return arguments.length===1?Ci(e):new Ti(e,t,n,r??1)}function Ti(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Or(Ti,wi,kr(Ar,{brighter(e){return new Ti(this.l+hi*(e??1),this.a,this.b,this.opacity)},darker(e){return new Ti(this.l-hi*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=gi*Di(t),e=_i*Di(e),n=vi*Di(n),new $r(Oi(3.1338561*t-1.6168667*e-.4906146*n),Oi(-.9787684*t+1.9161415*e+.033454*n),Oi(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Ei(e){return e>Si?e**(1/3):e/xi+yi}function Di(e){return e>bi?e*e*e:xi*(e-yi)}function Oi(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function ki(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Ai(e){if(e instanceof Mi)return new Mi(e.h,e.c,e.l,e.opacity);if(e instanceof Ti||(e=Ci(e)),e.a===0&&e.b===0)return new Mi(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*mi;return new Mi(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function ji(e,t,n,r){return arguments.length===1?Ai(e):new Mi(e,t,n,r??1)}function Mi(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Ni(e){if(isNaN(e.h))return new Ti(e.l,0,0,e.opacity);var t=e.h*pi;return new Ti(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Or(Mi,ji,kr(Ar,{brighter(e){return new Mi(this.h,this.c,this.l+hi*(e??1),this.opacity)},darker(e){return new Mi(this.h,this.c,this.l-hi*(e??1),this.opacity)},rgb(){return Ni(this).rgb()}}));var Pi=-.14861,Fi=1.78277,Ii=-.29227,Li=-.90649,Ri=1.97294,zi=Ri*Li,Bi=Ri*Fi,Vi=Fi*Ii-Li*Pi;function Hi(e){if(e instanceof Wi)return new Wi(e.h,e.s,e.l,e.opacity);e instanceof $r||(e=Zr(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Vi*r+zi*t-Bi*n)/(Vi+zi-Bi),a=r-i,o=(Ri*(n-i)-Ii*a)/Li,s=Math.sqrt(o*o+a*a)/(Ri*i*(1-i)),c=s?Math.atan2(o,a)*mi-120:NaN;return new Wi(c<0?c+360:c,s,i,e.opacity)}function Ui(e,t,n,r){return arguments.length===1?Hi(e):new Wi(e,t,n,r??1)}function Wi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Or(Wi,Ui,kr(Ar,{brighter(e){return e=e==null?Mr:Mr**+e,new Wi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jr:jr**+e,new Wi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*pi,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new $r(255*(t+n*(Pi*r+Fi*i)),255*(t+n*(Ii*r+Li*i)),255*(t+Ri*r*n),this.opacity)}}));var Gi=e=>()=>e;function Ki(e,t){return function(n){return e+n*t}}function qi(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Ji(e,t){var n=t-e;return n?Ki(e,n>180||n<-180?n-360*Math.round(n/360):n):Gi(isNaN(e)?t:e)}function Yi(e){return(e=+e)==1?Xi:function(t,n){return n-t?qi(t,n,e):Gi(isNaN(t)?n:t)}}function Xi(e,t){var n=t-e;return n?Ki(e,n):Gi(isNaN(e)?t:e)}var Zi=(function e(t){var n=Yi(t);function r(e,t){var r=n((e=Qr(e)).r,(t=Qr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Xi(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Qi(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function $i(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ea(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=la(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function ta(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function na(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ra(e,t){var n={},r={},i;for(i in typeof e==`object`&&e||(e={}),typeof t==`object`&&t||(t={}),t)i in e?n[i]=la(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var ia=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,aa=new RegExp(ia.source,`g`);function oa(e){return function(){return e}}function sa(e){return function(t){return e(t)+``}}function ca(e,t){var n=ia.lastIndex=aa.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=ia.exec(e))&&(i=aa.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:na(r,i)})),n=aa.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?sa(c[0].x):oa(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function la(e,t){var n=typeof t,r;return t==null||n===`boolean`?Gi(t):(n===`number`?na:n===`string`?(r=Jr(t))?(t=r,Zi):ca:t instanceof Jr?Zi:t instanceof Date?ta:$i(t)?Qi:Array.isArray(t)?ea:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?ra:na)(e,t)}var ua=180/Math.PI,da={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function fa(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*ua,skewX:Math.atan(c)*ua,scaleX:o,scaleY:s}}var pa;function ma(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?da:fa(t.a,t.b,t.c,t.d,t.e,t.f)}function ha(e){return e==null||(pa||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),pa.setAttribute(`transform`,e),!(e=pa.transform.baseVal.consolidate()))?da:(e=e.matrix,fa(e.a,e.b,e.c,e.d,e.e,e.f))}function ga(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:na(e,i)},{i:c-2,x:na(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:na(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:na(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:na(e,n)},{i:s-2,x:na(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var _a=ga(ma,`px, `,`px)`,`deg)`),va=ga(ha,`, `,`)`,`)`),ya=1e-12;function ba(e){return((e=Math.exp(e))+1/e)/2}function xa(e){return((e=Math.exp(e))-1/e)/2}function Sa(e){return((e=Math.exp(2*e))-1)/(e+1)}var Ca=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<ya)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=ba(y),c=s/(n*g)*(i*Sa(t*r+y)-xa(y));return[a+c*d,o+c*f,s*i/ba(t*r+y)]}}return m.duration=Math.abs(h)*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4);function wa(e){return(function t(n){n=+n;function r(t,r){var i=e((t=Ui(t)).h,(r=Ui(r)).h),a=Xi(t.s,r.s),o=Xi(t.l,r.l),s=Xi(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}wa(Ji),wa(Xi);var Ta=0,Ea=0,Da=0,Oa=1e3,ka,Aa,ja=0,Ma=0,Na=0,Pa=typeof performance==`object`&&performance.now?performance:Date,Fa=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ia(){return Ma||=(Fa(La),Pa.now()+Na)}function La(){Ma=0}function Ra(){this._call=this._time=this._next=null}Ra.prototype=za.prototype={constructor:Ra,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Ia():+n)+(t==null?0:+t),!this._next&&Aa!==this&&(Aa?Aa._next=this:ka=this,Aa=this),this._call=e,this._time=n,Wa()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wa())}};function za(e,t,n){var r=new Ra;return r.restart(e,t,n),r}function Ba(){Ia(),++Ta;for(var e=ka,t;e;)(t=Ma-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ta}function Va(){Ma=(ja=Pa.now())+Na,Ta=Ea=0;try{Ba()}finally{Ta=0,Ua(),Ma=0}}function Ha(){var e=Pa.now(),t=e-ja;t>Oa&&(Na-=t,ja=e)}function Ua(){for(var e,t=ka,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ka=n);Aa=e,Wa(r)}function Wa(e){Ta||(Ea&&=clearTimeout(Ea),e-Ma>24?(e<1/0&&(Ea=setTimeout(Va,Math.ceil(e-Pa.now()-Na)+1)),Da&&=clearInterval(Da)):(Da||=(ja=Pa.now(),setInterval(Ha,Oa)),Ta=1,Fa(Va)))}function Ga(e,t,n){var r=new Ra;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}function Ka(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var qa=3;(function e(t){t=+t;function n(e){return e**+t}return n.exponent=e,n})(qa),(function e(t){t=+t;function n(e){return 1-(1-e)**t}return n.exponent=e,n})(qa),(function e(t){t=+t;function n(e){return((e*=2)<=1?e**+t:2-(2-e)**t)/2}return n.exponent=e,n})(qa);function Ja(e){return(2**(-10*e)-.0009765625)*1.0009775171065494}var Ya=4/11;1/Ya/Ya;var Xa=1.70158;(function e(t){t=+t;function n(e){return(e=+e)*e*(t*(e-1)+e)}return n.overshoot=e,n})(Xa),(function e(t){t=+t;function n(e){return--e*e*((e+1)*t+e)+1}return n.overshoot=e,n})(Xa),(function e(t){t=+t;function n(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return n.overshoot=e,n})(Xa);var Za=2*Math.PI,Qa=1,$a=.3;(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Za);function i(e){return t*Ja(- --e)*Math.sin((r-e)/n)}return i.amplitude=function(t){return e(t,n*Za)},i.period=function(n){return e(t,n)},i})(Qa,$a),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Za);function i(e){return 1-t*Ja(e=+e)*Math.sin((e+r)/n)}return i.amplitude=function(t){return e(t,n*Za)},i.period=function(n){return e(t,n)},i})(Qa,$a),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Za);function i(e){return((e=e*2-1)<0?t*Ja(-e)*Math.sin((r-e)/n):2-t*Ja(e)*Math.sin((r+e)/n))/2}return i.amplitude=function(t){return e(t,n*Za)},i.period=function(n){return e(t,n)},i})(Qa,$a);var eo=it(`start`,`end`,`cancel`,`interrupt`),to=[],no=0,ro=1,io=2,ao=3,oo=4,so=5,co=6;function lo(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;mo(e,n,{name:t,index:r,group:i,on:eo,tween:to,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:no})}function uo(e,t){var n=po(e,t);if(n.state>no)throw Error(`too late; already scheduled`);return n}function fo(e,t){var n=po(e,t);if(n.state>ao)throw Error(`too late; already running`);return n}function po(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function mo(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=za(a,0,n.time);function a(e){n.state=ro,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==ro)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===ao)return Ga(o);f.state===oo?(f.state=co,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=co,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Ga(function(){n.state===ao&&(n.state=oo,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=io,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===io){for(n.state=ao,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=so,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===so&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=co,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function ho(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>io&&r.state<so,r.state=co,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function go(e){return this.each(function(){ho(this,e)})}function _o(e,t){var n,r;return function(){var i=fo(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function vo(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=fo(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function yo(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=po(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?_o:vo)(n,e,t))}function bo(e,t,n){var r=e._id;return e.each(function(){var e=fo(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return po(e,r).value[t]}}function xo(e,t){var n;return(typeof t==`number`?na:t instanceof Jr?Zi:(n=Jr(t))?(t=n,Zi):ca)(e,t)}function So(e){return function(){this.removeAttribute(e)}}function Co(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wo(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function To(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Eo(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Do(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Oo(e,t){var n=dt(e),r=n===`transform`?va:xo;return this.attrTween(e,typeof t==`function`?(n.local?Do:Eo)(n,r,bo(this,`attr.`+e,t)):t==null?(n.local?Co:So)(n):(n.local?To:wo)(n,r,t))}function ko(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ao(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function jo(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ao(e,i)),n}return i._value=t,i}function Mo(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ko(e,i)),n}return i._value=t,i}function No(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=dt(e);return this.tween(n,(r.local?jo:Mo)(r,t))}function Po(e,t){return function(){uo(this,e).delay=+t.apply(this,arguments)}}function Fo(e,t){return t=+t,function(){uo(this,e).delay=t}}function Io(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Po:Fo)(t,e)):po(this.node(),t).delay}function Lo(e,t){return function(){fo(this,e).duration=+t.apply(this,arguments)}}function Ro(e,t){return t=+t,function(){fo(this,e).duration=t}}function zo(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Lo:Ro)(t,e)):po(this.node(),t).duration}function Bo(e,t){if(typeof t!=`function`)throw Error();return function(){fo(this,e).ease=t}}function Vo(e){var t=this._id;return arguments.length?this.each(Bo(t,e)):po(this.node(),t).ease}function Ho(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();fo(this,e).ease=n}}function Uo(e){if(typeof e!=`function`)throw Error();return this.each(Ho(this._id,e))}function Wo(e){typeof e!=`function`&&(e=Ct(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new ys(r,this._parents,this._name,this._id)}function Go(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new ys(o,this._parents,this._name,this._id)}function Ko(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function qo(e,t,n){var r,i,a=Ko(t)?uo:fo;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Jo(e,t){var n=this._id;return arguments.length<2?po(this.node(),n).on.on(e):this.each(qo(n,e,t))}function Yo(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Xo(){return this.on(`end.remove`,Yo(this._id))}function Zo(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=gt(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,lo(l[f],t,n,f,l,po(u,n)));return new ys(a,this._parents,t,n)}function Qo(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=bt(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=po(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&lo(p,t,n,h,f,m);a.push(f),o.push(u)}return new ys(a,o,t,n)}var $o=sr.prototype.constructor;function es(){return new $o(this._groups,this._parents)}function ts(e,t){var n,r,i;return function(){var a=mn(this,e),o=(this.style.removeProperty(e),mn(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function ns(e){return function(){this.style.removeProperty(e)}}function rs(e,t,n){var r,i=n+``,a;return function(){var o=mn(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function is(e,t,n){var r,i,a;return function(){var o=mn(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),mn(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function as(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=fo(this,e),l=c.on,u=c.value[a]==null?s||=ns(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function os(e,t,n){var r=(e+=``)==`transform`?_a:xo;return t==null?this.styleTween(e,ts(e,r)).on(`end.style.`+e,ns(e)):typeof t==`function`?this.styleTween(e,is(e,r,bo(this,`style.`+e,t))).each(as(this._id,e)):this.styleTween(e,rs(e,r,t),n).on(`end.style.`+e,null)}function ss(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function cs(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&ss(e,a,n)),r}return a._value=t,a}function ls(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,cs(e,t,n??``))}function us(e){return function(){this.textContent=e}}function ds(e){return function(){var t=e(this);this.textContent=t??``}}function fs(e){return this.tween(`text`,typeof e==`function`?ds(bo(this,`text`,e)):us(e==null?``:e+``))}function ps(e){return function(t){this.textContent=e.call(this,t)}}function ms(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&ps(r)),t}return r._value=e,r}function hs(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,ms(e))}function gs(){for(var e=this._name,t=this._id,n=bs(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=po(c,t);lo(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ys(r,this._parents,e,n)}function _s(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=fo(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var vs=0;function ys(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function bs(){return++vs}var xs=sr.prototype;ys.prototype={constructor:ys,select:Zo,selectAll:Qo,selectChild:xs.selectChild,selectChildren:xs.selectChildren,filter:Wo,merge:Go,selection:es,transition:gs,call:xs.call,nodes:xs.nodes,node:xs.node,size:xs.size,empty:xs.empty,each:xs.each,on:Jo,attr:Oo,attrTween:No,style:os,styleTween:ls,text:fs,textTween:hs,remove:Xo,tween:yo,delay:Io,duration:zo,ease:Vo,easeVarying:Uo,end:_s,[Symbol.iterator]:xs[Symbol.iterator]};var Ss={time:null,delay:0,duration:250,ease:Ka};function Cs(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function ws(e){var t,n;e instanceof ys?(t=e._id,e=e._name):(t=bs(),(n=Ss).time=Ia(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&lo(c,e,t,l,o,n||Cs(c,t));return new ys(r,this._parents,e,t)}sr.prototype.interrupt=go,sr.prototype.transition=ws;var Ts=e=>()=>e;function Es(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Ds(e,t,n){this.k=e,this.x=t,this.y=n}Ds.prototype={constructor:Ds,scale:function(e){return e===1?this:new Ds(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ds(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Os=new Ds(1,0,0);ks.prototype=Ds.prototype;function ks(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Os;return e.__zoom}function As(e){e.stopImmediatePropagation()}function js(e){e.preventDefault(),e.stopImmediatePropagation()}function Ms(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Ns(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Ps(){return this.__zoom||Os}function Fs(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Is(){return navigator.maxTouchPoints||`ontouchstart`in this}function Ls(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Rs(){var e=Ms,t=Ns,n=Ls,r=Fs,i=Is,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Ca,l=it(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Ps).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,Ps),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Os.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Ds(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Ds(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Ds(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=lr(this.that).datum();l.call(e,this.that,new Es(e,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=mr(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],ho(this),s.start();js(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=lr(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=mr(t,i),l=t.clientX,u=t.clientY;yr(t.view),As(t),a.mouse=[c,this.__zoom.invert(c)],ho(this),a.start();function d(e){if(js(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=mr(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),br(e.view,a.moved),js(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=mr(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);js(r),s>0?lr(this).transition().duration(s).call(x,d,c,r):lr(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(As(t),s=0;s<i;++s)c=r[s],l=mr(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),ho(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(js(e),s=0;s<a;++s)c=i[s],l=mr(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(As(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=mr(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=lr(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Ts(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Ts(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Ts(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Ts([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var zs={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Bs=[[-1/0,-1/0],[1/0,1/0]],Vs=[`Enter`,` `,`Escape`],Hs={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},Us=function(e){return e.Strict=`strict`,e.Loose=`loose`,e}({}),Ws=function(e){return e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`,e}({}),Gs=function(e){return e.Partial=`partial`,e.Full=`full`,e}({}),Ks={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},qs=function(e){return e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`,e}({}),Js=function(e){return e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`,e}({}),Ys=function(e){return e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`,e}({}),Xs={left:`right`,right:`left`,top:`bottom`,bottom:`top`},Zs=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,Qs=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),$s=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),ec=(e,t=[0,0])=>{let{width:n,height:r}=Nc(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},tc=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):$s(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,pc(e,_c(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?hc(r):{x:0,y:0,width:0,height:0}},nc=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=pc(n,_c(e)),r=!0)}),r?hc(n):{x:0,y:0,width:0,height:0}},rc=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=yc(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d};function ic(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=Nc(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function ac({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=Ac(nc(ic(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??`5%`);return r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate})}function oc({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,zs.error005());else{let{width:e,height:t}=Nc(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&Mc(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=Mc(d)?lc(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,zs.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function sc({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=new Map,s=new Map;for(let e of n)if(e.deletable!==!1&&(a.has(e.id)&&o.set(e.id,e),e.parentId)){let t=s.get(e.parentId)??[];t.push(e),s.set(e.parentId,t)}let c=[...o.keys()];for(let e=0;e<c.length;e++)for(let t of s.get(c[e])??[])o.has(t.id)||(o.set(t.id,t),c.push(t.id));let l=new Set(t.map(e=>e.id)),u=new Map;for(let e of r)e.deletable!==!1&&(o.has(e.source)||o.has(e.target))&&u.set(e.id,e);for(let e of r)e.deletable!==!1&&l.has(e.id)&&!u.has(e.id)&&u.set(e.id,e);let d=n.filter(e=>o.has(e.id)),f=Array.from(u.values());if(!i)return{edges:f,nodes:d};let p=await i({nodes:d,edges:f});return typeof p==`boolean`?p?{edges:f,nodes:d}:{edges:[],nodes:[]}:p}var cc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),lc=(e={x:0,y:0},t,n)=>({x:cc(e.x,t[0][0],t[1][0]-(n?.width??0)),y:cc(e.y,t[0][1],t[1][1]-(n?.height??0))});function uc(e,t,n){let{width:r,height:i}=Nc(n),{x:a,y:o}=n.internals.positionAbsolute;return lc(e,[[a,o],[a+r,o+i]],t)}var dc=(e,t,n)=>e<t?cc(Math.abs(e-t),1,t)/t:e>n?-cc(Math.abs(e-n),1,t)/t:0,fc=(e,t,n=15,r=40)=>[dc(e.x,r,t.width-r)*n,dc(e.y,r,t.height-r)*n],pc=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),mc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),hc=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),gc=(e,t=[0,0])=>{let{x:n,y:r}=$s(e)?e.internals.positionAbsolute:ec(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},_c=(e,t=[0,0])=>{let{x:n,y:r}=$s(e)?e.internals.positionAbsolute:ec(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},vc=(e,t)=>hc(pc(mc(e),mc(t))),yc=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},bc=(e,t)=>yc(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),xc=e=>{if(typeof e!=`object`||!e)return!1;let t=e;return Sc(t.width)&&Sc(t.height)&&Sc(t.x)&&Sc(t.y)},Sc=e=>typeof e==`number`&&!isNaN(e)&&isFinite(e),Cc=(e,t)=>(e,t)=>{},wc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Tc=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?wc(s,o):s},Ec=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Dc(e,t){if(typeof e==`number`)return Math.floor(e);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Oc(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=Dc(e,n),i=Dc(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=Dc(e.top??e.y??0,n),i=Dc(e.bottom??e.y??0,n),a=Dc(e.left??e.x??0,t),o=Dc(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function kc(e,t,n,r,i,a){let{x:o,y:s}=Ec(e,[t,n,r]),{x:c,y:l}=Ec({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var Ac=(e,t,n,r=0,i=1/0,a=0)=>{let o=Oc(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=cc(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=kc(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},jc=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Mc(e){return e!=null&&e!==`parent`}function Nc(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Pc(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Fc(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function Ic(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Lc(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Rc(e){return{...Hs,...e||{}}}function zc(e,t,n){return t?n?`${e}-${t}-${n}`:`${e}-${t}`:e}function Bc(e,{nodeId:t,type:n,handleId:r}){return Array.from(e.get(zc(t,n,r))?.values()??[])}function Vc(e){return e===null?null:e?`valid`:`invalid`}function Hc(e){return e instanceof MouseEvent||Wc(e)}function Uc(e){return e instanceof WheelEvent}function Wc(e){return typeof TouchEvent<`u`&&e instanceof TouchEvent}function Gc(e){return e instanceof MouseEvent}function Kc(e){if(Wc(e)){let t=e.touches[0]??e.changedTouches[0];return[t?.clientX??0,t?.clientY??0]}return[e.clientX,e.clientY]}function qc(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=Qc(e),s=Tc({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?wc(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var Jc=e=>({width:e.offsetWidth,height:e.offsetHeight}),Yc=e=>e?.getRootNode?.()||window?.document,Xc=[`INPUT`,`SELECT`,`TEXTAREA`];function Zc(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Xc.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var Qc=(e,t)=>{let n=Gc(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},$c=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Jc(t)}})};function el({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function tl(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function nl({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case`left`:return[t-tl(t-r,a),n];case`right`:return[t+tl(r-t,a),n];case`top`:return[t,n-tl(n-i,a)];case`bottom`:return[t,n+tl(i-n,a)]}}function rl({sourceX:e,sourceY:t,sourcePosition:n=`bottom`,targetX:r,targetY:i,targetPosition:a=`top`,curvature:o=.25}){let[s,c]=nl({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=nl({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=el({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function il({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function al({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function ol({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=pc(_c(e),_c(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),bc({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},hc(a))>0}var sl=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,cl=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),ll=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,zs.error006()),t;let r=n.getEdgeId||sl,i;return i=Zs(e)?{...e}:{...e,id:r(e)},cl(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function ul({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=il({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var dl={left:{x:-1,y:0},right:{x:1,y:0},top:{x:0,y:-1},bottom:{x:0,y:1}},fl=({source:e,sourcePosition:t=`bottom`,target:n})=>t===`left`||t===`right`?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},pl=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),ml=(e,t,n)=>e.x===t.x&&t.x===n.x&&(t.y-e.y)*(n.y-t.y)>=0||e.y===t.y&&t.y===n.y&&(t.x-e.x)*(n.x-t.x)>=0;function hl({source:e,sourcePosition:t=`bottom`,target:n,targetPosition:r=`top`,center:i,offset:a,stepPosition:o}){let s=dl[t],c=dl[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=fl({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m,h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=il({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y},C=[];for(let t of[e,x,...m,S,n]){let[e,n]=C.slice(-2);n&&ml(e,n,t)&&C.pop(),C.push(t)}return[C,h,g,y,b]}function gl(e,t,n,r){let i=Math.min(pl(e,t)/2,pl(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function _l({sourceX:e,sourceY:t,sourcePosition:n=`bottom`,targetX:r,targetY:i,targetPosition:a=`top`,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=hl({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=gl(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function vl(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function yl(e){let{sourceNode:t,targetNode:n}=e;if(!vl(t)||!vl(n))return null;let r=t.internals.handleBounds,i=n.internals.handleBounds,a=xl(r?.source??[],e.sourceHandle),o=xl(e.connectionMode===`strict`?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,zs.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||`bottom`,c=o?.position||`top`,l=bl(t,a,s),u=bl(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function bl(e,t,n=`left`,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??Nc(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case`top`:return{x:i+o/2,y:a};case`right`:return{x:i+o,y:a+s/2};case`bottom`:return{x:i+o/2,y:a+s};case`left`:return{x:i,y:a+s/2}}}function xl(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function Sl(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Cl(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=Sl(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var wl=1e3,Tl=10,El={nodeOrigin:[0,0],nodeExtent:Bs,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{},checkEquality:!0};function Dl(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function Ol(e,t,n=Bs){return lc(ec(e,t),Mc(e.extent)?e.extent:n,Nc(e))}function kl(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function Al(e){return e===`manual`}function jl(e,t,n,r={}){let i=Dl(El,r),a={i:0},o=new Map(t),s=!!r.defaults?.parentId||e.some(e=>!!e.parentId),c=i?.elevateNodesOnSelect&&!Al(i.zIndexMode)?wl:0,l=new Set,u=new Map,d=e.length>0,f=!1,p=new Set;function m(e){if(p.has(e.id)){let n=t.get(e.id);n&&Object.assign(n,e)}else p.add(e.id),t.set(e.id,e)}t.clear(),n.clear();let h={nodeLookup:t,parentLookup:n,options:r,rootParentIndex:a,processedNodes:l,deferredChildNodes:u,updateNode:m};for(let n of e){let e=o.get(n.id);i.checkEquality&&n===e?.internals.userNode?t.set(n.id,e):(e={...i.defaults,...n,measured:{width:n.measured?.width,height:n.measured?.height},internals:{positionAbsolute:Ol(n,i.nodeOrigin,i.nodeExtent),handleBounds:kl(n,e),z:Il(n,c,i.zIndexMode),userNode:n,isParent:!1}},m(e)),e.measured!==void 0&&e.measured.width!==void 0&&e.measured.height!==void 0||e.hidden||(d=!1),s&&Ml(e,h),f||=n.selected??!1}for(let e of o.keys()){let r=t.get(e);r?r.internals.isParent&&!n.has(e)&&m({...r,internals:{...r.internals,isParent:!1}}):p.add(e)}return{nodesInitialized:d,hasSelectedNodes:f,updatedNodes:p}}function Ml(e,t){let{nodeLookup:n,parentLookup:r,options:i,rootParentIndex:a,processedNodes:o,deferredChildNodes:s,updateNode:c}=t;if(e.parentId&&!o.has(e.parentId)){let t=s.get(e.parentId)??[];t.push(e),s.set(e.parentId,t);return}e.parentId&&Pl(e,n,r,i,a,c),o.add(e.id);let l=s.get(e.id);l&&(s.delete(e.id),l.forEach(e=>Ml(e,t)))}function Nl(e,t,n,r){if(!e.parentId)return;let i=t.get(e.parentId);i?i.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]])),n.internals.isParent||r({...n,internals:{...n.internals,isParent:!0}})}function Pl(e,t,n,r,i,a=e=>{t.set(e.id,e)}){let o=Dl(El,r),{zIndexMode:s}=o,c=e.parentId,l=t.get(c);l?(i&&!l.parentId&&l.internals.rootParentIndex===void 0&&s===`auto`&&(l.internals.rootParentIndex=++i.i,l.internals.z=l.internals.z+i.i*Tl),i&&l.internals.rootParentIndex!==void 0&&(i.i=l.internals.rootParentIndex),Nl(Fl(e,l,{nodeLookup:t,options:o,updateNode:a}),n,l,a)):console.warn(`Parent node ${c} not found.`)}function Fl(e,t,n){let{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:a,zIndexMode:o}=n.options,{x:s,y:c,z:l}=Ll(e,t,i,a,r&&!Al(o)?wl:0,o),{positionAbsolute:u}=e.internals,d=s!==u.x||c!==u.y;if(d||l!==e.internals.z){let t={...e,internals:{...e.internals,positionAbsolute:d?{x:s,y:c}:u,z:l}};return n.updateNode(t),t}return e}function Il(e,t,n){let r=Sc(e.zIndex)?e.zIndex:0;return Al(n)?r:r+(e.selected?t:0)}function Ll(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=Nc(e),l=ec(e,n),u=Mc(e.extent)?lc(l,e.extent,c):l,d=lc({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=uc(d,c,t));let f=Il(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Rl(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=vc(a.get(n.parentId)?.expandedRect??gc(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=Nc(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push(Ku(o,{x:a.position.x-u+m,y:a.position.y-d+h})),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push(Ku(t.id,{x:t.position.x+u,y:t.position.y+d}))})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function zl(e,t,n,r,i,a,o){let s=new Set,c=e=>{t.set(e.id,e),s.add(e.id)},l=r?.querySelector(`.xyflow__viewport`),u=!1;if(!l)return{changes:[],updatedInternals:u,updatedNodes:s};let d=[],f=window.getComputedStyle(l),{m22:p}=new window.DOMMatrixReadOnly(f.transform),m=[],h=[];for(let n of e.values()){let e=t.get(n.id);if(!e)continue;if(e.hidden){c({...e,internals:{...e.internals,handleBounds:void 0}}),u=!0;continue}let r=Jc(n.nodeElement),o=e.measured.width!==r.width||e.measured.height!==r.height;if(r.width&&r.height&&(o||!e.internals.handleBounds||n.force)){let t=n.nodeElement.getBoundingClientRect(),s={...e,measured:r};c({...s,internals:{...e.internals,positionAbsolute:e.parentId?e.internals.positionAbsolute:Ol(s,i,a),handleBounds:{source:$c(`source`,n.nodeElement,t,p,e.id),target:$c(`target`,n.nodeElement,t,p,e.id)}}}),u=!0,o&&(d.push(qu(e.id,r)),e.expandParent&&e.parentId&&h.push(e.id))}}if(u){let e={nodeOrigin:i,nodeExtent:a,zIndexMode:o};for(let r of n.values())for(let i of r.keys()){let r=t.get(i);r&&Pl(r,t,n,e,void 0,e=>c(e))}}for(let e of h){let n=t.get(e);m.push({id:e,parentId:n.parentId,rect:gc(n,i)})}if(m.length>0){let e=Rl(m,t,n,i);d.push(...e)}return{changes:d,updatedInternals:u,updatedNodes:s}}async function Bl({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function Vl(e,t,n,r,i,a,o){let s=i,c=r.get(s);c&&o.has(s)||(c=new Map(c),o.add(s),r.set(s,c)),c.set(n,t),s=`${i}-${e}`;let l=r.get(s);if(l&&o.has(s)||(l=new Map(l),o.add(s),r.set(s,l)),l.set(n,t),a){s=`${i}-${e}-${a}`;let c=r.get(s);c&&o.has(s)||(c=new Map(c),o.add(s),r.set(s,c)),c.set(n,t)}}function Hl(e,t,n,r,i,a){let o=[r,`${r}-${e}`];i&&o.push(`${r}-${e}-${i}`);for(let e of o){let r=n.get(e);r&&(a.has(e)||(r=new Map(r),n.set(e,r),a.add(e)),r.delete(t),r.size===0&&n.delete(e))}}function Ul(e,t,n,r){let{source:i,target:a,sourceHandle:o=null,targetHandle:s=null}=t,c={edgeId:t.id,source:i,target:a,sourceHandle:o,targetHandle:s},l=`${i}-${o}--${a}-${s}`,u=`${a}-${s}--${i}-${o}`;n===`add`?(Vl(`source`,c,u,e,i,o,r),Vl(`target`,c,l,e,a,s,r)):(Hl(`source`,u,e,i,o,r),Hl(`target`,l,e,a,s,r))}function Wl(e,t,n){let r=new Map(t),i=new Set,a=new Set,o=[];t.clear();for(let s of n){let n=r.get(s.id);n===s?t.set(s.id,s):(n&&n.source===s.source&&n.target===s.target&&n.sourceHandle==s.sourceHandle&&n.targetHandle==s.targetHandle||(n&&Ul(e,n,`remove`,a),o.push(s)),t.set(s.id,s),i.add(s.id))}for(let n of r.values())t.has(n.id)||(Ul(e,n,`remove`,a),i.add(n.id));for(let t of o)Ul(e,t,`add`,a);return{updatedEdges:i}}function Gl(e,t,n,r,i){let a=t.get(e);if(!a){console.warn(`changeParent: Node "${e}" does not exists`);return}if(n===e)return;let o=a.internals.positionAbsolute,s=a.origin??r,c=Nc(a),l={x:s[0]*c.width,y:s[1]*c.height};if(n===null){i({nodeId:e,parentId:n,x:o.x+l.x,y:o.y+l.y});return}let u=t.get(n);if(!u){console.warn(`changeParent: Parent node "${n}" does not exists`);return}let d=u.internals.positionAbsolute;i({nodeId:e,parentId:n,x:o.x+l.x-d.x,y:o.y+l.y-d.y})}function Kl(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Kl(n,t):!1}function ql(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function Jl(e,t,n,r,i){let a=new Map;for(let[o,s]of e)if((i?s.id===r:s.selected||s.id===r)&&(i||!s.parentId||!Kl(s,e))&&(s.draggable||t&&s.draggable===void 0)){let t=e.get(o);t&&a.set(o,{id:o,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return a}function Yl({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function Xl({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=wc(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Zl({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u={x:0,y:0},d=null,f=!1,p=null,m=!1,h=!1,g=null;function _(e){let t=e.view??window,n=e=>{e.preventDefault(),e.stopImmediatePropagation()};t.addEventListener(`click`,n,{capture:!0}),setTimeout(()=>t.removeEventListener(`click`,n,{capture:!0}),0)}function v({noDragClassName:v,handleSelector:y,domNode:b,isSelectable:x,nodeId:S}){p=lr(b);function C({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:m}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?mc(nc(s)):null,b=v&&l?Xl({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=b?{x:Math.round(a.x+b.x),y:Math.round(a.y+b.y)}:wc(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=oc({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(h||=_,_&&(m(s,!0),g&&(r||d||!S&&f))){let[e,t]=Yl({nodeId:S,dragItems:s,nodeLookup:i});r?.(g,s,e,t),d?.(g,e,t),S||f?.(g,t)}}async function w(){if(!d)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,u]=fc(l,d,r);(s!==0||u!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-u/e[2],await n({x:s,y:u})&&C(a)),o=requestAnimationFrame(()=>{w()})}function T(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:u,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();f=!0;let v=!!S&&!o&&!i.get(S)?.selected;m&&x||o||!S||i.get(S)?.selected||_(),x&&m&&S&&e?.(S);let y=qc(r.sourceEvent,{transform:l,snapGrid:u,snapToGrid:p,containerBounds:d});if(a=y,s=Jl(i,c,y,S,v),s.size>0&&(n||h||!S&&g)){let[e,t]=Yl({nodeId:S,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),S||g?.(r.sourceEvent,t)}}let E=Dr().clickDistance(1/0).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();d=n?.getBoundingClientRect()||null,f=!1,c=!1,m=!1,h=!1,g=e.sourceEvent,r===0&&T(e),a=qc(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:d}),l=Qc(e.sourceEvent,d),u=l}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:p,nodeLookup:h}=t();g=e.sourceEvent;let _=qc(g,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:d});if((Wc(g)&&g.type===`touchmove`&&g.touches.length>1||S&&!h.has(S))&&(m=!0),!m){if(!c&&n&&f&&(c=!0,w()),!f){let t=Qc(e.sourceEvent,d),n=t.x-u.x,r=t.y-u.y;Math.hypot(n,r)>p&&T(e)}(a.x!==_.xSnapped||a.y!==_.ySnapped)&&s&&f&&(l=Qc(g,d),C(_))}}).on(`end`,e=>{if((!b.contains(e.sourceEvent.target)||h)&&_(e.sourceEvent),!f||m)m&&s.size>0&&t().updateNodePositions(s,!1);else if(cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(h&&=(r(s,!1),!1),i||a||!S&&o){let[t,r]=Yl({nodeId:S,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),S||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!v||!ql(t,`.${v}`,b))&&(!y||ql(t,y,b))});p.call(E)}function y(){p?.on(`.drag`,null)}return{update:v,destroy:y}}function Ql(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())bc(i,gc(e))>0&&r.push(e);return r}var $l=250;function eu(e,t,n,r){let i=[],a=1/0,o=Ql(e,n,t+$l);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=bl(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function tu(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...bl(o,c,c.position,!0)}:c}function nu(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function ru(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var iu=()=>!0;function au(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=iu,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=Yc(e.target),E=0,D,{x:O,y:k}=Qc(e),A=nu(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=tu(i,A,r,c,t);if(!N)return;let P=Qc(e,j),F=!1,ee=null,I=!1,te=null;function ne(){if(!u||!j)return;let[e,t]=fc(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(ne)}let L={...N,nodeId:i,type:A,position:N.position},re=c.get(i),R={inProgress:!0,isValid:null,from:bl(re,L,`left`,!0),fromHandle:L,fromPosition:L.position,fromNode:re,to:P,toHandle:null,toPosition:Xs[L.position],toNode:null,pointer:P};function ie(){M=!0,y(R),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&ie();function ae(e){if(!M){let{x:t,y:n}=Qc(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;ie()}if(!x()||!L){z(e);return}let a=b();P=Qc(e,j),D=eu(Tc(P,a,!1,[1,1]),n,c,L),F||=(ne(),!0);let s=ou(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});te=s.handleDomNode,ee=s.connection,I=ru(!!D,s.isValid);let u=c.get(i),f=u?bl(u,L,`left`,!0):R.from,p={...R,from:f,isValid:I,to:s.toHandle&&I?Ec({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:I&&s.toHandle?s.toHandle.position:Xs[L.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),R=p}function z(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||te)&&ee&&I&&h?.(ee);let{inProgress:t,...n}=R,r={...n,to:Tc(R.to,b()),toPosition:R.toHandle?R.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,I=!1,ee=null,te=null,T.removeEventListener(`mousemove`,ae),T.removeEventListener(`mouseup`,z),T.removeEventListener(`touchmove`,ae),T.removeEventListener(`touchend`,z)}}T.addEventListener(`mousemove`,ae),T.addEventListener(`mouseup`,z),T.addEventListener(`touchmove`,ae),T.addEventListener(`touchend`,z)}function ou(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=iu,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=Qc(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=nu(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===`strict`?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=tu(t,e,a,u,n,!0)}return _}var su={onPointerDown:au,isValid:ou};function cu({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=lr(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{let r=e.sourceEvent;if(!Uc(r)||!t)return;let i=n(),a=r.ctrlKey&&jc()?10:1,o=-r.deltaY*(r.deltaMode===1?.05:r.deltaMode?1:.002)*s,c=i[2]*2**(o*a);t.scaleTo(c)},f=[0,0],p=Rs().on(`start`,e=>{let t=e.sourceEvent;Hc(t)&&(t.type===`mousedown`||t.type===`touchstart`)&&(f=Kc(t))}).on(`zoom`,c?i=>{let s=n(),c=i.sourceEvent;if(!Hc(c)||Uc(c)||!t)return;let l=Kc(c),d=[l[0]-f[0],l[1]-f[1]];f=l;let p=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),m={x:s[0]-d[0]*p,y:s[1]-d[1]*p},h=[[0,0],[a,o]];t.setViewportConstrained({x:m.x,y:m.y,zoom:s[2]},h,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:mr}}var lu=e=>({x:e.x,y:e.y,zoom:e.k}),uu=({x:e,y:t,zoom:n})=>Os.translate(e,t).scale(n),du=(e,t)=>{if(!t)return!1;let n=e.target;return n instanceof Element&&!!n.closest(`.${t}`)},fu=e=>e===!0||Array.isArray(e)&&e.includes(0),pu=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),mu=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,hu=(e,t=0,n=mu,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(!0),i?e.transition().duration(t).ease(n).on(`end`,()=>r(!0)).on(`interrupt cancel`,()=>r(!1)):e},gu=e=>{let t=e.ctrlKey&&jc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function _u({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(du(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=mr(u),t=d*2**gu(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===`vertical`?0:u.deltaX*f,m=i===`horizontal`?0:u.deltaY*f;!jc()&&u.shiftKey&&i!==`vertical`&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=lu(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function vu({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=du(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function yu(e,t,n){let r=e.pointerDrag;r&&!r.moveStarted&&(r.moveStarted=!0,n?.(t,e.prevViewport))}function bu(e,t,n,r){let i=e.pointerDrag;i&&(yu(e,t,r),i.dragging=!0,i.isTouch||n(!0))}function xu(e){return e?.type===`mousemove`||e?.type===`touchmove`}function Su(e,t){return`touches`in e?Array.from(e.touches).find(e=>e.identifier===t)??null:e}function Cu({zoomPanValues:e,paneDragThreshold:t,onDraggingChange:n,onPanZoomStart:r}){return i=>{let a=i.sourceEvent;if(!a||a.internal)return;let o=lu(i.transform);e.mouseButton=`button`in a?a.button:0,e.isZoomingOrPanning=!0,e.prevViewport=o,e.pointerDrag=null;let s=a.type===`touchstart`;if(a.type===`mousedown`||s){let o=s?a.touches[0]:null,{clientX:c,clientY:l}=o??a;e.pointerDrag={isTouch:s,touchId:o?.identifier??null,startX:c,startY:l,startTransform:i.transform,thresholdCrossed:!1,lastMove:null,moveStarted:!1,dragging:!1},t===0&&bu(e,a,n,r)}else r?.(a,o)}}function wu({zoomPanValues:e,d3Selection:t,paneDragThreshold:n,onDraggingChange:r,onTransformChange:i,onPanZoomStart:a,onPanZoom:o}){return s=>{let c=s.sourceEvent,l=e.pointerDrag;if(l){let i=xu(c)&&c!==l.lastMove;if(i&&(l.lastMove=c),i&&!l.thresholdCrossed){let e=Su(c,l.touchId),t=`touches`in c&&c.touches.length>1;if(!e||t)l.thresholdCrossed=!0;else{let t=e.clientX-l.startX,r=e.clientY-l.startY;l.thresholdCrossed=t*t+r*r>n*n}}if(!l.dragging){if(!i)l.startTransform=s.transform,c?.internal||yu(e,c,a);else if(l.thresholdCrossed)bu(e,c,r,a);else{t.property(`__zoom`,l.startTransform);return}}}c?.sync||i([s.transform.x,s.transform.y,s.transform.k]),o&&!c?.internal&&(!l||l.moveStarted)&&o?.(s.sourceEvent,lu(s.transform))}}function Tu({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(o.sourceEvent?.internal)return;e.isZoomingOrPanning=!1;let s=e.pointerDrag;if(e.pointerDrag=null,a&&pu(t,e.mouseButton??0)&&!s?.thresholdCrossed&&o.sourceEvent&&a(o.sourceEvent),(!s||s.moveStarted)&&(r(!1),i)){let t=lu(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function Eu({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if((i===!0||Array.isArray(i)&&i.includes(1))&&Gc(f)&&f.button===1&&f.type===`mousedown`&&(du(f,`${u}-flow__node`)||du(f,`${u}-flow__edge`)||du(f,`${u}-flow__selection`)||du(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||du(f,c)&&h||du(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&Wc(f)&&f.type===`touchstart`&&f.touches.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&Gc(f)&&f.type===`mousedown`&&!i.includes(f.button))return!1;let g=Gc(f)?f.button:0,_=Array.isArray(i)&&i.includes(g)||g<=1;return(!f.ctrlKey||h||e)&&_}}function Du({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1,pointerDrag:null},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]],f=typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t?.contentRect&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null;f?.observe(e);let p=Rs().extent(()=>d).scaleExtent([t,n]).translateExtent(r),m=lr(e).call(p);b({x:i.x,y:i.y,zoom:cc(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let h=m.on(`wheel.zoom`),g=m.on(`dblclick.zoom`);p.wheelDelta(gu);async function _(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?la:Ca).transform(hu(m,t?.duration,t?.ease,n),e)}):!1}function v({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:f,preventScrolling:_,zoomOnPinch:v,zoomOnScroll:y,zoomOnDoubleClick:b,panActivationKeyPressed:x=!1,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneDragThreshold:E}){r&&!l.isZoomingOrPanning&&p.on(`zoom`,null);let D=i&&!S&&!r,O=Sc(E)&&E>0?E:0;p.clickDistance(O);let k=D?_u({zoomPanValues:l,noWheelClassName:e,d3Selection:m,d3Zoom:p,panOnScrollMode:d,panOnScrollSpeed:f,zoomOnPinch:v,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):vu({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:h});m.on(`wheel.zoom`,k,{passive:!1});let A=Cu({zoomPanValues:l,paneDragThreshold:O,onDraggingChange:c,onPanZoomStart:o});p.on(`start`,A);let j=wu({zoomPanValues:l,d3Selection:m,paneDragThreshold:O,onPanZoomStart:o,onPanZoom:a,onDraggingChange:c,onTransformChange:w});p.on(`zoom`,j);let M=Tu({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});p.on(`end`,M);let N=Eu({panActivationKeyPressed:x,zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:y,panOnScroll:i,zoomOnDoubleClick:b,zoomOnPinch:v,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});p.filter(N),b?m.on(`dblclick.zoom`,g):m.on(`dblclick.zoom`,null)}function y(){p.on(`zoom`,null),f?.disconnect()}async function b(e,t,n){let r=uu(e),i=p?.constrain()(r,t,n);return i&&await _(i),i}async function x(e,t){return _(uu(e),t)}function S(e){if(m){let t=uu(e),n=m.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&p?.transform(m,t,null,{sync:!0})}}function C(){let e=m?ks(m.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function w(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?la:Ca).scaleTo(hu(m,t?.duration,t?.ease,n),e)}):!1}async function T(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?la:Ca).scaleBy(hu(m,t?.duration,t?.ease,n),e)}):!1}function E(e){p?.scaleExtent(e)}function D(e){p?.translateExtent(e)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:C,scaleTo:w,scaleBy:T,setScaleExtent:E,setTranslateExtent:D,syncViewport:S}}var Ou=function(e){return e.Line=`line`,e.Handle=`handle`,e}({});function ku({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function Au(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function ju(e,t){return Math.max(0,t-e)}function Mu(e,t){return Math.max(0,e-t)}function Nu(e,t,n){return Math.max(0,t-e,e-n)}function Pu(e,t){return e?!t:t}function Fu(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=Nu(E,h,g),j=Nu(D,_,v);if(o){let e=0,t=0;c&&w<0?e=ju(y+w+O,o[0][0]):!c&&w>0&&(e=Mu(y+E+O,o[1][0])),l&&T<0?t=ju(b+T+k,o[0][1]):!l&&T>0&&(t=Mu(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=Mu(y+w,s[0][0]):!c&&w<0&&(e=ju(y+E,s[1][0])),l&&T>0?t=Mu(b+T,s[0][1]):!l&&T<0&&(t=ju(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=Nu(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=!c&&!l||c&&!l&&f?Mu(b+k+E/C,o[1][1])*C:ju(b+k+(c?w:-w)/C,o[0][1])*C;A=Math.max(A,e)}if(s){let e=!c&&!l||c&&!l&&f?ju(b+E/C,s[1][1])*C:Mu(b+(c?w:-w)/C,s[0][1])*C;A=Math.max(A,e)}}if(d){let e=Nu(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=!c&&!l||l&&!c&&f?Mu(y+D*C+O,o[1][0])/C:ju(y+(l?T:-T)*C+O,o[0][0])/C;j=Math.max(j,e)}if(s){let e=!c&&!l||l&&!c&&f?ju(y+D*C,s[1][0])/C:Mu(y+(l?T:-T)*C,s[0][0])/C;j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(Pu(c,l)?-w:w)/C:w=(Pu(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var Iu={width:0,height:0,x:0,y:0},Lu={...Iu,pointerX:0,pointerY:0,aspectRatio:1};function Ru(e,t,n){let r=n.x+e.internals.positionAbsolute.x-t.internals.positionAbsolute.x,i=n.y+e.internals.positionAbsolute.y-t.internals.positionAbsolute.y,a=e.measured.width??0,o=e.measured.height??0;return[[r,i],[r+a,i+o]]}function zu({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=lr(e),o={controlDirection:Au(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...Iu},h={...Lu};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:Au(e)};let g,_=null,v=[],y,b,x,S=Dr().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=qc(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_}),f=g.measured.width??0,p=g.measured.height??0,S=g.origin??s,C=g.parentId?r.get(g.parentId)?.internals.positionAbsolute:void 0;m={width:f,height:p,x:g.internals.positionAbsolute.x-(C?.x??0)+S[0]*f,y:g.internals.positionAbsolute.y-(C?.y??0)+S[1]*p},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=Mc(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=Ru(n,g,m);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=qc(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:S,height:C}=m,w={},T=g.origin??s,{width:E,height:D,x:O,y:k}=Fu(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,T,b,x),A=E!==S,j=D!==C,M=O!==u&&A,N=k!==f&&j;if(!M&&!N&&!A&&!j)return;let P={prevValues:{...m},startX:h.x,startY:h.y,childNodes:v.map(e=>({...e,position:{...e.position}}))};if((M||N||T[0]===1||T[1]===1)&&(w.x=M?O:m.x,w.y=N?k:m.y,m.x=w.x,m.y=w.y,v.length>0)){let e=O-u,t=k-f;for(let n of v)n.position={x:n.position.x-e+T[0]*(E-S),y:n.position.y-t+T[1]*(D-C)},l.push(n)}if((A||j)&&(w.width=A&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?E:m.width,w.height=j&&(!o.resizeDirection||o.resizeDirection===`vertical`)?D:m.height,m.width=w.width,m.height=w.height),y&&g.expandParent){let e=T[0]*(w.width??0);w.x&&w.x<e&&(m.x=e,h.x-=w.x-e);let t=T[1]*(w.height??0);w.y&&w.y<t&&(m.y=t,h.y-=w.y-t)}let F=ku({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),ee={...m,direction:F};p?.(e,ee)===!1?(m=P.prevValues,h.x=P.startX,h.y=P.startY,v.forEach((e,t)=>{e.position=P.childNodes[t].position})):(d?.(e,ee),r(w,l))}).on(`end`,e=>{f?.(e,{...m}),i?.({...m})});a.call(S)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}function Bu(e,t){return Hu(e,t,Uu)}function Vu(e,t){return Hu(e,t,Wu)}function Hu(e,t,n){let r=[],i=t.getNewElements(),a=new Set(i.map(e=>e.id)),o;for(let s of[e,i]){o=!o;elementsLoop:for(let e of s){if(!o&&!a.has(e.id))continue;let i=t.getForElement(e.id);if(!i.length){r.push(e),a.delete(e.id);continue}let s={...e};for(let t of i)switch(t.type){case`remove`:a.delete(e.id);continue elementsLoop;case`replace`:s={...t.item};continue;default:n(s,t)}r.push(s),a.delete(e.id)}}return r}function Uu(e,t){switch(t.type){case`select`:e.selected=t.selected;break;case`position`:t.position!==void 0&&(e.position=t.position),t.dragging!==void 0&&(e.dragging=t.dragging);break;case`dimensions`:t.dimensions!==void 0&&(e.measured={...t.dimensions},(t.setAttributes===!0||t.setAttributes===`width`)&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes===`height`)&&(e.height=t.dimensions.height)),typeof t.resizing==`boolean`&&(e.resizing=t.resizing);break;case`update`:Object.assign(e,t.item);break;case`data`:e.data=t.replace?t.data:{...e.data,...t.data};break;default:return}}function Wu(e,t){switch(t.type){case`select`:e.selected=t.selected;break;case`update`:Object.assign(e,t.item);break;case`data`:e.data=t.replace?t.data:{...e.data,...t.data};break;default:return}}function Gu(e,t){return{id:e,type:`select`,selected:t}}function Ku(e,t){return{id:e,type:`position`,position:t}}function qu(e,t){return{id:e,type:`dimensions`,dimensions:t}}function Ju(e){return{id:e,type:`remove`}}function Yu(e){return{id:e.id,item:e,type:`add`}}function Xu(e){return{id:e.id,item:e,type:`replace`}}function Zu(e){"@babel/helpers - typeof";return Zu=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Zu(e)}function Qu(e,t){if(Zu(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(Zu(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function $u(e){var t=Qu(e,`string`);return Zu(t)==`symbol`?t:t+``}function ed(e,t,n){return(t=$u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var td=Symbol.iterator,nd=class{constructor(e){this.applyChanges=e,ed(this,`changeTypes`,{}),ed(this,`changeMap`,new Map),ed(this,`addChanges`,new Map)}add(e){let t=Array.isArray(e)?e:[e];for(let e of t){if(this.changeTypes[e.type]=!0,e.type===`add`){this.addChanges.set(e.id,e);continue}let t=this.changeMap.get(e.id);t?t.push(e):this.changeMap.set(e.id,[e])}}remove(e){if(e.type===`add`){this.addChanges.get(e.id)===e&&this.addChanges.delete(e.id);return}let t=this.changeMap.get(e.id);if(!t)return;let n=t.indexOf(e);n<0||(t.length===1?this.changeMap.delete(e.id):t.splice(n,1))}getForElement(e){return this.changeMap.get(e)||[]}removeForElement(e){this.changeMap.delete(e),this.addChanges.delete(e)}clear(){this.changeTypes={},this.changeMap.clear(),this.addChanges.clear()}isEmpty(){return this.changeMap.size===0&&this.addChanges.size===0}*[td](){yield*this.addChanges.values();for(let e of this.changeMap.values())yield*e}getNewElements(){let e=[];for(let t of this.addChanges.values())e.push(t.item);return e}toArray(){let e=[];for(let t of this.addChanges.values())e.push(t);for(let t of this.changeMap.values())for(let n of t)e.push(n);return e}getByType(e){if(this.changeTypes[e]){if(e===`add`)return Array.from(this.addChanges.values());let t=[];for(let n of this.changeMap.values())for(let r of n)r.type===e&&t.push(r);return t}return[]}applyTo(e){return this.applyChanges(e,this)}},rd=class extends nd{constructor(e){super(Bu),e&&this.add(e)}getForNode(e){return this.getForElement(e)}removeForNode(e){this.removeForElement(e)}getNewNodes(){return this.getNewElements()}},id=class extends nd{constructor(e){super(Vu),e&&this.add(e)}getForEdge(e){return this.getForElement(e)}removeForEdge(e){this.removeForElement(e)}getNewEdges(){return this.getNewElements()}};function ad(e,t=new Set){let n=[];for(let[,r]of e){let e=t.has(r.id);(r.selected!==void 0||e)&&r.selected!==e&&n.push(Gu(r.id,e))}return n}var od=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},sd=(e=>e?od(e):od),cd=e=>e;function ld(e,t=cd){let n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return v.useDebugValue(n),n}var ud=e=>Symbol.iterator in e,dd=e=>`entries`in e,fd=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},pd=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function md(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:ud(e)&&ud(t)?dd(e)&&dd(t)?fd(e,t):pd(e,t):fd({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}m();var hd=(0,v.createContext)(null),gd=hd.Provider;function _d(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}function vd(e){let t=(0,H.c)(2),n=(0,v.useRef)(void 0),r;return t[0]===e?r=t[1]:(r=t=>{let r=e(t);return _d(n.current,r)?n.current:n.current=r},t[0]=e,t[1]=r),r}var yd=e=>e,bd=zs.error001(`react`);function xd(e){let t=e===void 0?yd:e,{optionsStore:n}=Sd();return ld(n,t)}function Sd(){let e=(0,v.useContext)(hd);if(e===null)throw Error(bd);return e}function Cd(e){let t=e===void 0?yd:e;return ld(Sd().viewportStore,t)}function wd(e){let t=e===void 0?yd:e;return ld(Sd().connectionStore,t)}function Td(e){let t=e===void 0?yd:e;return ld(Sd().nodesStore,t)}function Ed(e){let t=e===void 0?yd:e;return ld(Sd().edgesStore,t)}function Dd(e){let t=e===void 0?yd:e;return ld(Sd().selectionStore,t)}function Od(e,t){let n=(0,H.c)(3),r=(0,v.useRef)(),i;return n[0]!==t||n[1]!==e?(i=n=>{let i=e(n);return r.current!==void 0&&t(r.current,i)?r.current:(r.current=i,i)},n[0]=t,n[1]=e,n[2]=i):i=n[2],i}var kd={display:`none`},Ad={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},jd=`react-flow__node-desc`,Md=`react-flow__edge-desc`;function Nd(e){let t=(0,H.c)(3),{rfId:n}=e,r=xd(Pd),i=`react-flow__aria-live-${n}`,a;return t[0]!==r||t[1]!==i?(a=(0,V.jsx)(`div`,{id:i,"aria-live":`assertive`,"aria-atomic":`true`,style:Ad,children:r}),t[0]=r,t[1]=i,t[2]=a):a=t[2],a}function Pd(e){return e.ariaLiveMessage}function Fd(e){let t=(0,H.c)(13),{rfId:n,disableKeyboardA11y:r}=e,i=xd(Id),a=`${jd}-${n}`,o=r?i[`node.a11yDescription.default`]:i[`node.a11yDescription.keyboardDisabled`],s;t[0]!==a||t[1]!==o?(s=(0,V.jsx)(`div`,{id:a,style:kd,children:o}),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c=`${Md}-${n}`,l=i[`edge.a11yDescription.default`],u;t[3]!==c||t[4]!==l?(u=(0,V.jsx)(`div`,{id:c,style:kd,children:l}),t[3]=c,t[4]=l,t[5]=u):u=t[5];let d;t[6]!==r||t[7]!==n?(d=!r&&(0,V.jsx)(Nd,{rfId:n}),t[6]=r,t[7]=n,t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u||t[11]!==d?(f=(0,V.jsxs)(V.Fragment,{children:[s,u,d]}),t[9]=s,t[10]=u,t[11]=d,t[12]=f):f=t[12],f}function Id(e){return e.ariaLabelConfig}var Ld=(0,v.forwardRef)((e,t)=>{let n=(0,H.c)(15),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({position:s,children:r,className:i,style:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let c=s===void 0?`top-left`:s,l;if(n[6]!==i||n[7]!==c){let e=`${c}`.split(`-`);l=nt([`react-flow__panel`,i,...e]),n[6]=i,n[7]=c,n[8]=l}else l=n[8];let u;return n[9]!==r||n[10]!==t||n[11]!==a||n[12]!==o||n[13]!==l?(u=(0,V.jsx)(`div`,{className:l,style:o,ref:t,...a,children:r}),n[9]=r,n[10]=t,n[11]=a,n[12]=o,n[13]=l,n[14]=u):u=n[14],u});Ld.displayName=`Panel`;var Rd=`https://reactflow.dev?utm_source=attribution`;function zd(e){let t=(0,H.c)(4),{proOptions:n,position:r}=e,i=r===void 0?`bottom-right`:r,a;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],t[0]=a):a=t[0],(0,v.useEffect)(Bd,a),n?.hideAttribution)return null;let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(`a`,{href:Rd,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`}),t[1]=o):o=t[1];let s;return t[2]===i?s=t[3]:(s=(0,V.jsx)(Ld,{position:i,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Rd}`,children:o}),t[2]=i,t[3]=s),s}function Bd(){}var Vd=e=>{let t=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);return t},Hd=e=>{let t=[];for(let[,n]of e.edgeLookup)n.selected&&t.push(n);return t},Ud=e=>e.id;function Wd(e,t){return md(e.map(Ud),t.map(Ud))}function Gd(e){let t=(0,H.c)(12),{onSelectionChange:n}=e,{optionsStore:r,nodesStore:i,edgesStore:a}=Sd(),o=Td(Od(Vd,Wd)),s=Ed(Od(Hd,Wd)),c;t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==r?(c=()=>{let e={nodes:Vd(i.getState()),edges:Hd(a.getState())};n?.(e),r.getState().onSelectionChangeHandlers.forEach(t=>t(e))},t[0]=a,t[1]=i,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;return t[5]!==a||t[6]!==i||t[7]!==n||t[8]!==r||t[9]!==s||t[10]!==o?(l=[o,s,n,r,i,a],t[5]=a,t[6]=i,t[7]=n,t[8]=r,t[9]=s,t[10]=o,t[11]=l):l=t[11],(0,v.useEffect)(c,l),null}var Kd=e=>e.onSelectionChangeHandlers.length>0;function qd(e){let t=(0,H.c)(2),{onSelectionChange:n}=e,r=xd(Kd);if(n||r){let e;return t[0]===n?e=t[1]:(e=(0,V.jsx)(Gd,{onSelectionChange:n}),t[0]=n,t[1]=e),e}return null}var Jd=[0,0],Yd={x:0,y:0,zoom:1},Xd=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],Zd={translateExtent:Bs,nodeOrigin:Jd,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function Qd(e){let{optionsStore:t}=Sd(),n=(0,v.useRef)(Zd);return(0,v.useEffect)(()=>{let{setDefaultNodesAndEdges:r,reset:i}=t.getState();return r(e.defaultNodes,e.defaultEdges),()=>{n.current=Zd,i()}},[]),(0,v.useEffect)(()=>{let{setNodes:r,setEdges:i,setMinZoom:a,setMaxZoom:o,setTranslateExtent:s,setNodeExtent:c}=t.getState();for(let l of Xd){let u=e[l];u!==n.current[l]&&e[l]!==void 0&&(l===`nodes`?r(u):l===`edges`?i(u):l===`minZoom`?a(u):l===`maxZoom`?o(u):l===`translateExtent`?s(u):l===`nodeExtent`?c(u):l===`ariaLabelConfig`?t.setState({ariaLabelConfig:Rc(u)}):l===`fitView`?t.setState({fitViewQueued:u}):l===`fitViewOptions`?t.setState({fitViewOptions:u}):t.setState({[l]:u}))}n.current=e},Xd.map(t=>e[t])),null}var $d=typeof document<`u`?document:null;function ef(e,t){let n=(0,H.c)(12),r=e===void 0?null:e,i;n[0]===t?i=n[1]:(i=t===void 0?{target:$d,actInsideInputWithModifier:!0}:t,n[0]=t,n[1]=i);let a=i,[o,s]=(0,v.useState)(!1),c=(0,v.useRef)(!1),l;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Set([]),n[2]=l):l=n[2];let u=(0,v.useRef)(l),d;n[3]===r?d=n[4]:(d=tf(r),n[3]=r,n[4]=d);let[f,p]=d,m;n[5]!==r||n[6]!==f||n[7]!==p||n[8]!==a?(m=()=>{let e=a?.target??$d,t=a?.actInsideInputWithModifier??!0;if(r!==null){let n=e=>{if(c.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!c.current||c.current&&!t)&&Zc(e))return!1;let n=rf(e.code,p);if(u.current.add(e[n]),nf(f,u.current,!1)){let t=e.composedPath?.()?.[0]||e.target,n=t?.nodeName===`BUTTON`||t?.nodeName===`A`;a.preventDefault!==!1&&(c.current||!n)&&e.preventDefault(),s(!0)}},r=e=>{let t=rf(e.code,p);nf(f,u.current,!0)?(s(!1),u.current.clear()):u.current.delete(e[t]),e.key===`Meta`&&u.current.clear(),c.current=!1},i=()=>{u.current.clear(),s(!1)};return e?.addEventListener(`keydown`,n),e?.addEventListener(`keyup`,r),window.addEventListener(`blur`,i),window.addEventListener(`contextmenu`,i),()=>{e?.removeEventListener(`keydown`,n),e?.removeEventListener(`keyup`,r),window.removeEventListener(`blur`,i),window.removeEventListener(`contextmenu`,i)}}},n[5]=r,n[6]=f,n[7]=p,n[8]=a,n[9]=m):m=n[9];let h;return n[10]===r?h=n[11]:(h=[r,s],n[10]=r,n[11]=h),(0,v.useEffect)(m,h),o}function tf(e){if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
10
+ `).replace(`
11
+
12
+ `,`
13
+ +`).split(`
14
+ `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]}function nf(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function rf(e,t){return t.includes(e)?`code`:`key`}var af=()=>{let e=(0,H.c)(29),{optionsStore:t,viewportStore:n}=Sd(),r,i,a;e[0]===t?(r=e[1],i=e[2],a=e[3]):(r=async e=>{let{panZoom:n}=t.getState();return n?n.scaleBy(1.2,e):!1},i=async e=>{let{panZoom:n}=t.getState();return n?n.scaleBy(.8333333333333334,e):!1},a=async(e,n)=>{let{panZoom:r}=t.getState();return r?r.scaleTo(e,n):!1},e[0]=t,e[1]=r,e[2]=i,e[3]=a);let o;e[4]===n?o=e[5]:(o=()=>n.getState().transform[2],e[4]=n,e[5]=o);let s;e[6]!==t||e[7]!==n?(s=async(e,r)=>{let{transform:i}=n.getState(),[a,o,s]=i,{panZoom:c}=t.getState();return c?c.setViewport({x:e.x??a,y:e.y??o,zoom:e.zoom??s},r):!1},e[6]=t,e[7]=n,e[8]=s):s=e[8];let c;e[9]===n?c=e[10]:(c=()=>{let[e,t,r]=n.getState().transform;return{x:e,y:t,zoom:r}},e[9]=n,e[10]=c);let l;e[11]===t?l=e[12]:(l=async(e,n,r)=>t.getState().setCenter(e,n,r),e[11]=t,e[12]=l);let u,d,f;e[13]!==t||e[14]!==n?(u=async(e,r)=>{let{width:i,height:a}=n.getState(),{minZoom:o,maxZoom:s,panZoom:c}=t.getState(),l=Ac(e,i,a,o,s,r?.padding??`5%`);return c?c.setViewport(l,r):!1},d=(e,r)=>{let i=r===void 0?{}:r,{transform:a}=n.getState(),{snapGrid:o,snapToGrid:s,domNode:c}=t.getState();if(!c)return e;let{x:l,y:u}=c.getBoundingClientRect(),d={x:e.x-l,y:e.y-u},f=i.snapGrid??o;return Tc(d,a,i.snapToGrid??s,f)},f=e=>{let{transform:r}=n.getState(),{domNode:i}=t.getState();if(!i)return e;let{x:a,y:o}=i.getBoundingClientRect(),s=Ec(e,r);return{x:s.x+a,y:s.y+o}},e[13]=t,e[14]=n,e[15]=u,e[16]=d,e[17]=f):(u=e[15],d=e[16],f=e[17]);let p;return e[18]!==r||e[19]!==i||e[20]!==a||e[21]!==o||e[22]!==s||e[23]!==c||e[24]!==l||e[25]!==u||e[26]!==d||e[27]!==f?(p={zoomIn:r,zoomOut:i,zoomTo:a,getZoom:o,setViewport:s,getViewport:c,setCenter:l,fitBounds:u,screenToFlowPosition:d,flowToScreenPosition:f},e[18]=r,e[19]=i,e[20]=a,e[21]=o,e[22]=s,e[23]=c,e[24]=l,e[25]=u,e[26]=d,e[27]=f,e[28]=p):p=e[28],p};function of({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[,r]of e.entries()){let e=t.get(r.id),i=e?.internals?.userNode??e;i!==void 0&&i!==r&&n.push(Xu({...r})),i===void 0&&n.push(Yu({...r}))}for(let[e]of t)r.get(e)===void 0&&n.push(Ju(e));return n}var sf=Cc(`React Flow`,`https://reactflow.dev/`);function cf(e,t,n={}){return ll(e,t,{...n,onError:n.onError??sf})}var lf=e=>Qs(e),uf=e=>Zs(e);function df(e){return(0,v.forwardRef)(e)}var ff=typeof window<`u`?v.useLayoutEffect:v.useEffect;function pf(e){let t=(0,H.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=BigInt(0),t[0]=n):n=t[0];let[r,i]=(0,v.useState)(n),a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>hf(()=>i(mf)),t[1]=a):a=t[1];let[o]=(0,v.useState)(a),s;t[2]!==o||t[3]!==e?(s=()=>{let t=o.get();t.length&&(e(t),o.reset())},t[2]=o,t[3]=e,t[4]=s):s=t[4];let c;return t[5]===r?c=t[6]:(c=[r],t[5]=r,t[6]=c),ff(s,c),o}function mf(e){return e+BigInt(1)}function hf(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var gf=(0,v.createContext)(null);function _f(e){let t=(0,H.c)(12),{children:n}=e,{optionsStore:r,nodesStore:i,edgesStore:a}=Sd(),o;t[0]!==i||t[1]!==r?(o=e=>{let{nodes:t,nodeLookup:n}=i.getState(),a=t===void 0?[]:t,{onNodesChange:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c,setNodes:l,hasDefaultNodes:u}=r.getState(),d=a;for(let t of e)d=typeof t==`function`?t(d):t;let f=of({items:d,lookup:n});for(let e of c.values())f=e(f);u&&l(d),f.length>0?o?.(new rd(f)):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,setNodes:t}=r.getState(),{nodes:n}=i.getState();e&&t(n)})},t[0]=i,t[1]=r,t[2]=o):o=t[2];let s=pf(o),c;t[3]!==a||t[4]!==r?(c=e=>{let{edges:t,edgeLookup:n}=a.getState(),i=t===void 0?[]:t,{setEdges:o,hasDefaultEdges:s,onEdgesChange:c}=r.getState(),l=i;for(let t of e)l=typeof t==`function`?t(l):t;if(s)o(l);else if(c){let e=of({items:l,lookup:n});c?.(new id(e))}},t[3]=a,t[4]=r,t[5]=c):c=t[5];let l=pf(c),u;t[6]!==l||t[7]!==s?(u={nodeQueue:s,edgeQueue:l},t[6]=l,t[7]=s,t[8]=u):u=t[8];let d=u,f;return t[9]!==n||t[10]!==d?(f=(0,V.jsx)(gf.Provider,{value:d,children:n}),t[9]=n,t[10]=d,t[11]=f):f=t[11],f}function vf(){let e=(0,v.useContext)(gf);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var yf=e=>!!e.panZoom;function bf(){let e=(0,H.c)(79),t=af(),{optionsStore:n,viewportStore:r,nodesStore:i,edgesStore:a}=Sd(),o=vf(),s=xd(yf),c;e[0]===i?c=e[1]:(c=e=>i.getState().nodeLookup.get(e),e[0]=i,e[1]=c);let l=c,u;e[2]===o?u=e[3]:(u=e=>{o.nodeQueue.push(e)},e[2]=o,e[3]=u);let d=u,f;e[4]===o?f=e[5]:(f=e=>{o.edgeQueue.push(e)},e[4]=o,e[5]=f);let p=f,m;e[6]!==i||e[7]!==n?(m=e=>{let{nodeLookup:t}=i.getState(),{nodeOrigin:r}=n.getState(),a=lf(e)?e:t.get(e.id),o=a.parentId?Fc(a.position,a.measured,a.parentId,t,r):a.position;return gc({...a,position:o,width:a.measured?.width??a.width,height:a.measured?.height??a.height},a.parentId?void 0:r)},e[6]=i,e[7]=n,e[8]=m):m=e[8];let h=m,g;e[9]===d?g=e[10]:(g=(e,t,n)=>{let r=n===void 0?{replace:!1}:n;d(n=>n.map(n=>{if(n.id===e){let e=typeof t==`function`?t(n):t;return r.replace&&lf(e)?e:{...n,...e}}return n}))},e[9]=d,e[10]=g);let _=g,v;e[11]===p?v=e[12]:(v=(e,t,n)=>{let r=n===void 0?{replace:!1}:n;p(n=>n.map(n=>{if(n.id===e){let e=typeof t==`function`?t(n):t;return r.replace&&uf(e)?e:{...n,...e}}return n}))},e[11]=p,e[12]=v);let y=v,b;e[13]===i?b=e[14]:(b=()=>i.getState().nodes.map(Df),e[13]=i,e[14]=b);let x;e[15]===l?x=e[16]:(x=e=>l(e)?.internals.userNode,e[15]=l,e[16]=x);let S,C;e[17]===a?(S=e[18],C=e[19]):(S=()=>{let{edges:e}=a.getState();return(e===void 0?[]:e).map(Ef)},C=e=>a.getState().edgeLookup.get(e),e[17]=a,e[18]=S,e[19]=C);let w,T;e[20]===o?(w=e[21],T=e[22]):(w=e=>{let t=Array.isArray(e)?e:[e];o.nodeQueue.push(e=>[...e,...t])},T=e=>{let t=Array.isArray(e)?e:[e];o.edgeQueue.push(e=>[...e,...t])},e[20]=o,e[21]=w,e[22]=T);let E;e[23]!==a||e[24]!==i||e[25]!==r?(E=()=>{let{nodes:e}=i.getState(),t=e===void 0?[]:e,{edges:n}=a.getState(),o=n===void 0?[]:n,{transform:s}=r.getState(),[c,l,u]=s;return{nodes:t.map(Tf),edges:o.map(wf),viewport:{x:c,y:l,zoom:u}}},e[23]=a,e[24]=i,e[25]=r,e[26]=E):E=e[26];let D;e[27]!==a||e[28]!==i||e[29]!==n?(D=async e=>{let{nodes:t,edges:r}=e,o=t===void 0?[]:t,s=r===void 0?[]:r,{nodes:c}=i.getState(),{edges:l}=a.getState(),{onNodesDelete:u,onEdgesDelete:d,emitNodeChanges:f,emitEdgeChanges:p,onDelete:m,onBeforeDelete:h}=n.getState(),{nodes:g,edges:_}=await sc({nodesToRemove:o,edgesToRemove:s,nodes:c,edges:l,onBeforeDelete:h}),v=_.length>0,y=g.length>0;if(v){let e=_.map(Cf);d?.(_),p(e)}if(y){let e=g.map(Sf);u?.(g),f(e)}return(y||v)&&m?.({nodes:g,edges:_}),{deletedNodes:g,deletedEdges:_}},e[27]=a,e[28]=i,e[29]=n,e[30]=D):D=e[30];let O;e[31]!==h||e[32]!==i||e[33]!==n?(O=(e,t,r)=>{let a=t===void 0||t,o=xc(e),s=o?e:h(e),c=r!==void 0;if(!s)return[];let{nodeOrigin:l}=n.getState();return(r||i.getState().nodes).filter(t=>{let n=i.getState().nodeLookup.get(t.id);if(n&&!o&&(t.id===e.id||!n.internals.positionAbsolute))return!1;let r=gc(c?t:n,l),u=bc(r,s);return a&&u>0||u>=r.width*r.height||u>=s.width*s.height})},e[31]=h,e[32]=i,e[33]=n,e[34]=O):O=e[34];let k;e[35]===h?k=e[36]:(k=(e,t,n)=>{let r=n===void 0||n,i=xc(e)?e:h(e);if(!i)return!1;let a=bc(i,t);return r&&a>0||a>=t.width*t.height||a>=i.width*i.height},e[35]=h,e[36]=k);let A;e[37]===_?A=e[38]:(A=(e,t,n)=>{let r=n===void 0?{replace:!1}:n;_(e,e=>{let n=typeof t==`function`?t(e):t;return r.replace?{...e,data:n}:{...e,data:{...e.data,...n}}},r)},e[37]=_,e[38]=A);let j;e[39]!==i||e[40]!==n||e[41]!==_?(j=(e,t)=>{Gl(e,i.getState().nodeLookup,t,n.getState().nodeOrigin,e=>{let{nodeId:t,parentId:n,x:r,y:i}=e;_(t,{parentId:n??void 0,position:{x:r,y:i}})})},e[39]=i,e[40]=n,e[41]=_,e[42]=j):j=e[42];let M;e[43]===y?M=e[44]:(M=(e,t,n)=>{let r=n===void 0?{replace:!1}:n;y(e,e=>{let n=typeof t==`function`?t(e):t;return r.replace?{...e,data:n}:{...e,data:{...e.data,...n}}},r)},e[43]=y,e[44]=M);let N;e[45]!==i||e[46]!==n?(N=e=>{let{nodeLookup:t}=i.getState(),{nodeOrigin:r}=n.getState();return tc(e,{nodeLookup:t,nodeOrigin:r})},e[45]=i,e[46]=n,e[47]=N):N=e[47];let P;e[48]===a?P=e[49]:(P=e=>{let{type:t,handleId:n,nodeId:r}=e;return Bc(a.getState().connectionLookup,{nodeId:r,type:t,handleId:n})},e[48]=a,e[49]=P);let F;e[50]!==o||e[51]!==n?(F=async e=>{let t=n.getState().fitViewResolver??Lc();return n.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:t}),o.nodeQueue.push(xf),t.promise},e[50]=o,e[51]=n,e[52]=F):F=e[52];let ee;e[53]!==l||e[54]!==p||e[55]!==d||e[56]!==w||e[57]!==T||e[58]!==E||e[59]!==D||e[60]!==O||e[61]!==k||e[62]!==A||e[63]!==j||e[64]!==M||e[65]!==N||e[66]!==P||e[67]!==F||e[68]!==b||e[69]!==x||e[70]!==S||e[71]!==C||e[72]!==y||e[73]!==_?(ee={getNodes:b,getNode:x,getInternalNode:l,getEdges:S,getEdge:C,setNodes:d,setEdges:p,addNodes:w,addEdges:T,toObject:E,deleteElements:D,getIntersectingNodes:O,isNodeIntersecting:k,updateNode:_,updateNodeData:A,changeParent:j,updateEdge:y,updateEdgeData:M,getNodesBounds:N,getNodeConnections:P,fitView:F},e[53]=l,e[54]=p,e[55]=d,e[56]=w,e[57]=T,e[58]=E,e[59]=D,e[60]=O,e[61]=k,e[62]=A,e[63]=j,e[64]=M,e[65]=N,e[66]=P,e[67]=F,e[68]=b,e[69]=x,e[70]=S,e[71]=C,e[72]=y,e[73]=_,e[74]=ee):ee=e[74];let I=ee,te;return e[75]!==I||e[76]!==t||e[77]!==s?(te={...I,...t,viewportInitialized:s},e[75]=I,e[76]=t,e[77]=s,e[78]=te):te=e[78],te}function xf(e){return[...e]}function Sf(e){return Ju(e.id)}function Cf(e){return Ju(e.id)}function wf(e){return{...e}}function Tf(e){return{...e}}function Ef(e){return{...e}}function Df(e){return{...e}}var Of=e=>e.selected,kf=typeof window<`u`?window:void 0;function Af(e){let t=(0,H.c)(15),{deleteKeyCode:n,multiSelectionKeyCode:r}=e,{optionsStore:i,nodesStore:a,edgesStore:o}=Sd(),{deleteElements:s}=bf(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={actInsideInputWithModifier:!1},t[0]=c):c=t[0];let l=ef(n,c),u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={target:kf},t[1]=u):u=t[1];let d=ef(r,u),f;t[2]!==s||t[3]!==l||t[4]!==o||t[5]!==a||t[6]!==i?(f=()=>{if(l){let{edges:e}=o.getState(),{nodes:t}=a.getState();s({nodes:t.filter(Of),edges:e.filter(Of)}),i.getState().nodesSelectionActive&&i.setState({nodesSelectionActive:!1})}},t[2]=s,t[3]=l,t[4]=o,t[5]=a,t[6]=i,t[7]=f):f=t[7];let p;t[8]===l?p=t[9]:(p=[l],t[8]=l,t[9]=p),(0,v.useEffect)(f,p);let m;t[10]!==d||t[11]!==i?(m=()=>{i.setState({multiSelectionActive:d})},t[10]=d,t[11]=i,t[12]=m):m=t[12];let h;t[13]===d?h=t[14]:(h=[d],t[13]=d,t[14]=h),(0,v.useEffect)(m,h)}function jf(e){let t=(0,H.c)(5),{optionsStore:n,viewportStore:r}=Sd(),i;t[0]!==e.current||t[1]!==n||t[2]!==r?(i=()=>{let t=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let t=Jc(e.current);(t.height===0||t.width===0)&&n.getState().onError?.(`004`,zs.error004()),r.setState({width:t.width||500,height:t.height||500})};if(e.current){t(),window.addEventListener(`resize`,t);let n=new ResizeObserver(()=>t());return n.observe(e.current),()=>{window.removeEventListener(`resize`,t),n.disconnect()}}},t[0]=e.current,t[1]=n,t[2]=r,t[3]=i):i=t[3];let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],t[4]=a):a=t[4],(0,v.useEffect)(i,a)}var Mf={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0};function Nf(e){let t=(0,H.c)(35),{onPaneContextMenu:n,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:a,panActivationKeyPressed:o,panOnScrollSpeed:s,panOnScrollMode:c,zoomOnDoubleClick:l,panOnDrag:u,defaultViewport:d,translateExtent:f,minZoom:p,maxZoom:m,zoomActivationKeyCode:h,preventScrolling:g,children:_,noWheelClassName:y,noPanClassName:b,onViewportChange:x,isControlledViewport:S,paneDragThreshold:C}=e,w=r===void 0||r,T=i===void 0||i,E=a!==void 0&&a,D=s===void 0?.5:s,O=c===void 0?Ws.Free:c,k=l===void 0||l,A=u===void 0||u,j=g===void 0||g,{optionsStore:M,viewportStore:N}=Sd(),P=xd(Ff),F=wd(Pf),ee=ef(h),I=(0,v.useRef)(null),te=(0,v.useRef)(),ne;t[0]!==d||t[1]!==m||t[2]!==p||t[3]!==f?(ne=()=>({minZoom:p,maxZoom:m,translateExtent:f,defaultViewport:d}),t[0]=d,t[1]=m,t[2]=p,t[3]=f,t[4]=ne):ne=t[4];let[L]=(0,v.useState)(ne);jf(I);let re;t[5]!==S||t[6]!==x||t[7]!==N?(re=e=>{x?.({x:e[0],y:e[1],zoom:e[2]}),S||N.setState({transform:e})},t[5]=S,t[6]=x,t[7]=N,t[8]=re):re=t[8];let R=re,ie,ae;t[9]!==M||t[10]!==L||t[11]!==N?(ie=()=>{if(I.current){te.current=Du({domNode:I.current,minZoom:L.minZoom,maxZoom:L.maxZoom,translateExtent:L.translateExtent,viewport:L.defaultViewport,onDraggingChange:e=>N.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=M.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=M.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=M.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=te.current.getViewport();return M.setState({panZoom:te.current,domNode:I.current.closest(`.react-flow`)}),N.setState({transform:[e,t,n]}),()=>{te.current?.destroy()}}},ae=[L,M,N],t[9]=M,t[10]=L,t[11]=N,t[12]=ie,t[13]=ae):(ie=t[12],ae=t[13]),(0,v.useEffect)(ie,ae);let z,oe;t[14]!==F||t[15]!==b||t[16]!==y||t[17]!==n||t[18]!==R||t[19]!==o||t[20]!==A||t[21]!==E||t[22]!==O||t[23]!==D||t[24]!==C||t[25]!==j||t[26]!==P||t[27]!==ee||t[28]!==k||t[29]!==T||t[30]!==w?(z=()=>{te.current?.update({onPaneContextMenu:n,zoomOnScroll:w,zoomOnPinch:T,panOnScroll:E,panActivationKeyPressed:o,panOnScrollSpeed:D,panOnScrollMode:O,zoomOnDoubleClick:k,panOnDrag:A,zoomActivationKeyPressed:ee,preventScrolling:j,noPanClassName:b,userSelectionActive:P,noWheelClassName:y,lib:`react`,onTransformChange:R,connectionInProgress:F,paneDragThreshold:C})},oe=[n,w,T,E,o,D,O,k,A,ee,j,b,P,y,R,F,C],t[14]=F,t[15]=b,t[16]=y,t[17]=n,t[18]=R,t[19]=o,t[20]=A,t[21]=E,t[22]=O,t[23]=D,t[24]=C,t[25]=j,t[26]=P,t[27]=ee,t[28]=k,t[29]=T,t[30]=w,t[31]=z,t[32]=oe):(z=t[31],oe=t[32]),(0,v.useEffect)(z,oe);let se;return t[33]===_?se=t[34]:(se=(0,V.jsx)(`div`,{className:`react-flow__renderer`,ref:I,style:Mf,children:_}),t[33]=_,t[34]=se),se}function Pf(e){return e.connection.inProgress}function Ff(e){return e.userSelectionActive}function If(){let e=(0,H.c)(4),t=xd(Rf),n=Dd(vd(Lf));if(!(t&&n))return null;let r=`translate(${n.x}px, ${n.y}px)`,i;return e[0]!==r||e[1]!==n.height||e[2]!==n.width?(i=(0,V.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:n.width,height:n.height,transform:r}}),e[0]=r,e[1]=n.height,e[2]=n.width,e[3]=i):i=e[3],i}function Lf(e){return e.userSelectionRect}function Rf(e){return e.userSelectionActive}var zf=(e,t,n)=>{e.target===n.current&&t?.(e)};function Bf(e){let t=(0,H.c)(79),{isSelecting:n,selectionKeyPressed:r,selectionMode:i,panOnDrag:a,autoPanOnSelection:o,paneDragThreshold:s,selectionOnDrag:c,onSelectionStart:l,onSelectionEnd:u,onPaneClick:d,onPaneContextMenu:f,onPaneScroll:p,onPaneMouseEnter:m,onPaneMouseMove:h,onPaneMouseLeave:g,children:_}=e,y=i===void 0?Gs.Full:i,b=(0,v.useRef)(0),{optionsStore:x,viewportStore:S,connectionStore:C,nodesStore:w,edgesStore:T,selectionStore:E}=Sd(),D=xd(qf),O=xd(Kf),k=xd(Gf),A=xd(Wf),j=Cd(Uf),M=O&&(n||D),N=(0,v.useRef)(null),P=(0,v.useRef)(),F;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(F=new Set,t[0]=F):F=t[0];let ee=(0,v.useRef)(F),I;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(I=new Set,t[1]=I):I=t[1];let te=(0,v.useRef)(I),ne=(0,v.useRef)(!1),L=(0,v.useRef)(!1),re;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(re={x:0,y:0},t[2]=re):re=t[2];let R=(0,v.useRef)(re),ie=(0,v.useRef)(!1),ae;t[3]!==C||t[4]!==d||t[5]!==x?(ae=e=>{if(L.current||ne.current||C.getState().connection.inProgress){L.current=!1,ne.current=!1;return}let{nodesSelectionActive:t,onClickConnectEnd:n,resetSelectedElements:r}=x.getState(),{connectionClickStartHandle:i,connection:a}=C.getState();if(i){let t=structuredClone(a);delete t.inProgress,t.toPosition=t.toHandle?t.toHandle.position:null,n?.(e.nativeEvent,t),x.getState().updateConnectionClickStart(null)}d?.(e),r(),t&&x.setState({nodesSelectionActive:!1})},t[3]=C,t[4]=d,t[5]=x,t[6]=ae):ae=t[6];let z=ae,oe;t[7]!==f||t[8]!==a?(oe=e=>{Array.isArray(a)&&a?.includes(2)?e.preventDefault():f?.(e)},t[7]=f,t[8]=a,t[9]=oe):oe=t[9];let se=oe,ce;t[10]===p?ce=t[11]:(ce=p?e=>p(e):void 0,t[10]=p,t[11]=ce);let le=ce,ue;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>{L.current&&=(e.stopPropagation(),!1)},t[12]=ue):ue=t[12];let B=ue,de;t[13]!==n||t[14]!==x||t[15]!==a||t[16]!==r||t[17]!==c||t[18]!==E||t[19]!==S?(de=e=>{if(e.pointerType===`touch`&&a!==!1&&!r)return;let{domNode:t}=x.getState(),{transform:i}=S.getState();if(P.current=t?.getBoundingClientRect(),!P.current)return;let o=e.target===N.current;if(!o&&e.target.closest(`.nokey`)||!n||!(c&&o||r)||e.button!==0||!e.isPrimary)return;e.target?.setPointerCapture?.(e.pointerId),L.current=!1;let{x:s,y:l}=Qc(e.nativeEvent,P.current),u=Tc({x:s,y:l},i);E.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:s,y:l}}),o||(e.stopPropagation(),e.preventDefault())},t[13]=n,t[14]=x,t[15]=a,t[16]=r,t[17]=c,t[18]=E,t[19]=S,t[20]=de):de=t[20];let fe=de,pe;t[21]!==T||t[22]!==w||t[23]!==x||t[24]!==y||t[25]!==E||t[26]!==S?(pe=function(e,t){let{userSelectionRect:n}=E.getState();if(!n)return;let{transform:r}=S.getState(),{nodeLookup:i}=w.getState(),{edgeLookup:a,connectionLookup:o}=T.getState(),{emitNodeChanges:s,emitEdgeChanges:c,defaultEdgeOptions:l}=x.getState(),u={x:n.startX,y:n.startY},{x:d,y:f}=Ec(u,r),p={startX:u.x,startY:u.y,x:e<d?e:d,y:t<f?t:f,width:Math.abs(e-d),height:Math.abs(t-f)},m=ee.current,h=te.current;ee.current=new Set(rc(i,p,r,y===Gs.Partial,!0).map(Hf)),te.current=new Set;let g=l?.selectable??!0;for(let e of ee.current){let t=o.get(e);if(t)for(let{edgeId:e}of t.values()){let t=a.get(e);t&&(t.selectable??g)&&te.current.add(e)}}Ic(m,ee.current)||s(ad(i,ee.current)),Ic(h,te.current)||c(ad(a,te.current)),E.setState({userSelectionRect:p}),x.setState(Vf)},t[21]=T,t[22]=w,t[23]=x,t[24]=y,t[25]=E,t[26]=S,t[27]=pe):pe=t[27];let me=pe,he;t[28]!==o||t[29]!==A||t[30]!==me||t[31]!==k?(he=()=>{if(!o||!P.current)return;let[e,t]=fc(R.current,P.current,A);k({x:e,y:t}).then(e=>{if(!L.current||!e){b.current=requestAnimationFrame(he);return}let{x:t,y:n}=R.current;me(t,n),b.current=requestAnimationFrame(he)})},t[28]=o,t[29]=A,t[30]=me,t[31]=k,t[32]=he):he=t[32];let ge;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>{cancelAnimationFrame(b.current),b.current=0,ie.current=!1},t[33]=ge):ge=t[33];let _e=ge,ve,ye;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ve=()=>()=>_e(),ye=[],t[34]=ve,t[35]=ye):(ve=t[34],ye=t[35]),(0,v.useEffect)(ve,ye);let be;t[36]!==he||t[37]!==me||t[38]!==l||t[39]!==x||t[40]!==s||t[41]!==r||t[42]!==E||t[43]!==S?(be=e=>{let{userSelectionRect:t}=E.getState(),{transform:n}=S.getState(),{resetSelectedElements:i}=x.getState();if(!P.current||!t)return;let{x:a,y:o}=Qc(e.nativeEvent,P.current);R.current={x:a,y:o};let c=Ec({x:t.startX,y:t.startY},n);if(!L.current){let t=r?0:s;if(Math.hypot(a-c.x,o-c.y)<=t)return;i(),l?.(e)}L.current=!0,ie.current||=(he(),!0),me(a,o)},t[36]=he,t[37]=me,t[38]=l,t[39]=x,t[40]=s,t[41]=r,t[42]=E,t[43]=S,t[44]=be):be=t[44];let xe=be,Se;t[45]!==C||t[46]!==M||t[47]!==z||t[48]!==u||t[49]!==x||t[50]!==E||t[51]!==D?(Se=e=>{if(!M)e.target===N.current&&C.getState().connection.inProgress&&(ne.current=!0);else if(e.button===0){if(e.target?.releasePointerCapture?.(e.pointerId),!D&&e.target===N.current&&E.getState().userSelectionRect&&z?.(e),x.setState({userSelectionActive:!1}),E.setState({userSelectionRect:null}),L.current){u?.(e);let t=ee.current.size>0;x.getState().nodesSelectionActive!==t&&x.setState({nodesSelectionActive:t})}_e()}},t[45]=C,t[46]=M,t[47]=z,t[48]=u,t[49]=x,t[50]=E,t[51]=D,t[52]=Se):Se=t[52];let Ce=Se,we;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>{e.target?.releasePointerCapture?.(e.pointerId),_e()},t[53]=we):we=t[53];let Te=we,Ee;t[54]!==j||t[55]!==n||t[56]!==a?(Ee=nt([`react-flow__pane`,{draggable:a===!0||Array.isArray(a)&&a.includes(0),dragging:j,selection:n}]),t[54]=j,t[55]=n,t[56]=a,t[57]=Ee):Ee=t[57];let De;t[58]!==M||t[59]!==z?(De=M?void 0:e=>zf(e,z,N),t[58]=M,t[59]=z,t[60]=De):De=t[60];let Oe;t[61]===se?Oe=t[62]:(Oe=e=>zf(e,se,N),t[61]=se,t[62]=Oe);let ke;t[63]===le?ke=t[64]:(ke=e=>zf(e,le,N),t[63]=le,t[64]=ke);let Ae=M?void 0:m,je=M?xe:h,Me=M?Te:void 0,Ne=M?fe:void 0,Pe=M?B:void 0,Fe;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,V.jsx)(If,{}),t[65]=Fe):Fe=t[65];let Ie;return t[66]!==_||t[67]!==g||t[68]!==Ce||t[69]!==Ee||t[70]!==De||t[71]!==Oe||t[72]!==ke||t[73]!==Ae||t[74]!==je||t[75]!==Me||t[76]!==Ne||t[77]!==Pe?(Ie=(0,V.jsxs)(`div`,{className:Ee,onClick:De,onContextMenu:Oe,onWheel:ke,onPointerEnter:Ae,onPointerMove:je,onPointerUp:Ce,onPointerCancel:Me,onPointerDownCapture:Ne,onClickCapture:Pe,onPointerLeave:g,ref:N,style:Mf,children:[_,Fe]}),t[66]=_,t[67]=g,t[68]=Ce,t[69]=Ee,t[70]=De,t[71]=Oe,t[72]=ke,t[73]=Ae,t[74]=je,t[75]=Me,t[76]=Ne,t[77]=Pe,t[78]=Ie):Ie=t[78],Ie}function Vf(e){return e.userSelectionActive&&!e.nodesSelectionActive?e:{userSelectionActive:!0,nodesSelectionActive:!1}}function Hf(e){return e.id}function Uf(e){return e.paneDragging}function Wf(e){return e.autoPanSpeed}function Gf(e){return e.panBy}function Kf(e){return e.elementsSelectable}function qf(e){return e.userSelectionActive}function Jf({id:e,optionsStore:t,nodesStore:n,unselect:r=!1,nodeRef:i}){let{addSelectedNodes:a,unselectNodesAndEdges:o,multiSelectionActive:s,onError:c,nodesSelectionActive:l}=t.getState(),{nodeLookup:u}=n.getState(),d=u.get(e);d?(l&&t.setState({nodesSelectionActive:!1}),d.selected?(r||d.selected&&s)&&(o({nodes:[d],edges:[]}),requestAnimationFrame(()=>i?.current?.blur())):a([e])):c?.(`012`,zs.error012(e))}function Yf(e){let t=(0,H.c)(16),{nodeRef:n,disabled:r,noDragClassName:i,handleSelector:a,nodeId:o,isSelectable:s}=e,c=r!==void 0&&r,{optionsStore:l,viewportStore:u,nodesStore:d,edgesStore:f}=Sd(),[p,m]=(0,v.useState)(!1),h=(0,v.useRef)(),g,_;t[0]!==c||t[1]!==f||t[2]!==n||t[3]!==d||t[4]!==l||t[5]!==u?(g=()=>{if(!c)return h.current=Zl({getStoreItems:()=>{let{nodes:e,nodeLookup:t}=d.getState(),{edges:n}=f.getState(),{transform:r}=u.getState();return{...l.getState(),nodes:e,nodeLookup:t,edges:n,transform:r}},onNodeMouseDown:e=>{Jf({id:e,optionsStore:l,nodesStore:d,nodeRef:n})},onDragStart:()=>{m(!0)},onDragStop:()=>{m(!1)}}),()=>{h.current?.destroy(),h.current=void 0}},_=[c,l,u,d,f,n],t[0]=c,t[1]=f,t[2]=n,t[3]=d,t[4]=l,t[5]=u,t[6]=g,t[7]=_):(g=t[6],_=t[7]),(0,v.useEffect)(g,_);let y,b;return t[8]!==c||t[9]!==a||t[10]!==s||t[11]!==i||t[12]!==o||t[13]!==n?(y=()=>{!c&&n.current&&h.current&&h.current.update({noDragClassName:i,handleSelector:a,domNode:n.current,isSelectable:s,nodeId:o})},b=[i,a,c,s,n,o],t[8]=c,t[9]=a,t[10]=s,t[11]=i,t[12]=o,t[13]=n,t[14]=y,t[15]=b):(y=t[14],b=t[15]),(0,v.useEffect)(y,b),p}var Xf=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function Zf(){let e=(0,H.c)(3),{optionsStore:t,nodesStore:n}=Sd(),r;return e[0]!==n||e[1]!==t?(r=e=>{let{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:s,updateNodePositions:c,nodeOrigin:l}=t.getState(),{nodeLookup:u}=n.getState(),d=new Map,f=Xf(o),p=i?a[0]:5,m=i?a[1]:5,h=e.direction.x*p*e.factor,g=e.direction.y*m*e.factor;for(let[,e]of u){if(!f(e))continue;let t={x:e.internals.positionAbsolute.x+h,y:e.internals.positionAbsolute.y+g};i&&(t=wc(t,a));let{position:n,positionAbsolute:o}=oc({nodeId:e.id,nextPosition:t,nodeLookup:u,nodeExtent:r,nodeOrigin:l,onError:s});e.position=n,e.internals.positionAbsolute=o,d.set(e.id,e)}c(d)},e[0]=n,e[1]=t,e[2]=r):r=e[2],r}var Qf=(0,v.createContext)(null),$f=Qf.Provider;Qf.Consumer;var ep=()=>(0,v.useContext)(Qf),tp=(0,v.createContext)(null);function np(e){let t=(0,H.c)(3),{children:n}=e,r=xd(vd(rp)),i;return t[0]!==n||t[1]!==r?(i=(0,V.jsx)(tp.Provider,{value:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function rp(e){return{connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId,connectionMode:e.connectionMode}}function ip(){let e=(0,v.useContext)(tp);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}function ap(e){let t=(0,H.c)(2),n;return t[0]===e?n=t[1]:(n=t=>{let{connection:n}=t;return e?e(n):n},t[0]=e,t[1]=n),wd(vd(n))}function op(e){let t=(0,H.c)(5),{optionsStore:n,connectionStore:r}=Sd(),i;t[0]!==e||t[1]!==n?(i=t=>n.getState().pubSub.subscribeToConnectionForHandle(e,t),t[0]=e,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===r?o=t[4]:(o=()=>r.getState(),t[3]=r,t[4]=o);let s=o;return(0,v.useSyncExternalStore)(a,s,s)}var sp={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProgress:!1,clickConnectionInProgress:!1,valid:!1},cp=(e,t,n,r,i)=>{let{connectionClickStartHandle:a,connection:o}=e,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!a)return sp;let u=c?.nodeId===t&&c?.id===n&&c?.type===r;return{connectingFrom:s?.nodeId===t&&s?.id===n&&s?.type===r,connectingTo:u,clickConnecting:a?.nodeId===t&&a?.id===n&&a?.type===r,isPossibleEndHandle:i===Us.Strict?s?.type!==r:t!==s?.nodeId||n!==s?.id,connectionInProgress:o.inProgress,clickConnectionInProgress:!!a,valid:u&&l}};function lp(e,t){let n=(0,H.c)(85),r,i,a,o,s,c,l,u,d,f,p,m,h;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7],u=n[8],d=n[9],f=n[10],p=n[11],m=n[12],h=n[13]):({type:d,position:f,isValidConnection:o,isConnectable:p,isConnectableStart:m,isConnectableEnd:h,id:a,onConnect:s,children:r,className:i,onMouseDown:c,onTouchStart:l,...u}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c,n[7]=l,n[8]=u,n[9]=d,n[10]=f,n[11]=p,n[12]=m,n[13]=h);let g=d===void 0?`source`:d,_=f===void 0?Ys.Top:f,v=p===void 0||p,y=m===void 0||m,b=h===void 0||h,x=a||null,S=g===`target`,{optionsStore:C,viewportStore:w,connectionStore:T,nodesStore:E,edgesStore:D}=Sd(),{connectOnClick:O,noPanClassName:k,rfId:A,connectionMode:j}=ip(),M=ep();M||C.getState().onError?.(`010`,zs.error010());let N=M||``,P;n[14]!==x||n[15]!==N||n[16]!==g?(P={nodeId:N,type:g,id:x},n[14]=x,n[15]=N,n[16]=g,n[17]=P):P=n[17];let F=op(P),ee,I,te,ne,L,re,R;if(n[18]!==i||n[19]!==F||n[20]!==j||n[21]!==T||n[22]!==D||n[23]!==x||n[24]!==v||n[25]!==b||n[26]!==y||n[27]!==S||n[28]!==o||n[29]!==k||n[30]!==M||n[31]!==E||n[32]!==s||n[33]!==c||n[34]!==l||n[35]!==C||n[36]!==_||n[37]!==A||n[38]!==g||n[39]!==w){let e=cp(F,M,x,g,j),t;n[47]!==D||n[48]!==s||n[49]!==C?(t=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=C.getState(),i={...t,...e};if(r){let{edges:e}=D.getState(),{setEdges:t,onError:n}=C.getState();t(cf(i,e,{onError:n}))}n?.(i),s?.(i)},n[47]=D,n[48]=s,n[49]=C,n[50]=t):t=n[50];let r=t,a;n[51]!==T||n[52]!==x||n[53]!==y||n[54]!==S||n[55]!==o||n[56]!==M||n[57]!==E||n[58]!==r||n[59]!==c||n[60]!==l||n[61]!==C||n[62]!==w?(a=e=>{if(!M)return;let t=Gc(e.nativeEvent);if(y&&(t&&e.button===0||!t)){let t=C.getState();su.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:E.getState().nodeLookup,lib:`react`,isTarget:S,handleId:x,nodeId:M,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>{let t=e;return C.getState().onConnectEnd?.(...t)},updateConnection:t.updateConnection,onConnect:r,isValidConnection:o||((...e)=>{let t=e;return C.getState().isValidConnection?.(...t)??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?c?.(e):l?.(e)},n[51]=T,n[52]=x,n[53]=y,n[54]=S,n[55]=o,n[56]=M,n[57]=E,n[58]=r,n[59]=c,n[60]=l,n[61]=C,n[62]=w,n[63]=a):a=n[63],I=a;let u;n[64]!==T||n[65]!==x||n[66]!==y||n[67]!==o||n[68]!==M||n[69]!==E||n[70]!==r||n[71]!==C||n[72]!==g?(u=e=>{let{onClickConnectStart:t,onClickConnectEnd:n,updateConnectionClickStart:i,connectionMode:a,isValidConnection:s,rfId:c}=C.getState(),{connectionClickStartHandle:l,connection:u}=T.getState(),{nodeLookup:d}=E.getState();if(!M||!l&&!y)return;if(!l){t?.(e.nativeEvent,{nodeId:M,handleId:x,handleType:g}),i({nodeId:M,type:g,id:x});return}let f=Yc(e.target),p=o||s,{connection:m,isValid:h}=su.isValid(e.nativeEvent,{handle:{nodeId:M,id:x,type:g},connectionMode:a,fromNodeId:l.nodeId,fromHandleId:l.id||null,fromType:l.type,isValidConnection:p,flowId:c,doc:f,lib:`react`,nodeLookup:d});h&&m&&r(m);let _=structuredClone(u);delete _.inProgress,_.toPosition=_.toHandle?_.toHandle.position:null,n?.(e,_),i(null)},n[64]=T,n[65]=x,n[66]=y,n[67]=o,n[68]=M,n[69]=E,n[70]=r,n[71]=C,n[72]=g,n[73]=u):u=n[73],ee=u,re=x,R=M,te=_,ne=`${A}-${M}-${x}-${g}`,L=nt([`react-flow__handle`,`react-flow__handle-${_}`,`nodrag`,k,i,{source:!S,target:S,connectable:v,connectablestart:y,connectableend:b,clickconnecting:e.clickConnecting,connectingfrom:e.connectingFrom,connectingto:e.connectingTo,valid:e.valid,connectionindicator:v&&(!e.connectionInProgress||e.isPossibleEndHandle)&&(e.connectionInProgress||e.clickConnecting?b:y)}]),n[18]=i,n[19]=F,n[20]=j,n[21]=T,n[22]=D,n[23]=x,n[24]=v,n[25]=b,n[26]=y,n[27]=S,n[28]=o,n[29]=k,n[30]=M,n[31]=E,n[32]=s,n[33]=c,n[34]=l,n[35]=C,n[36]=_,n[37]=A,n[38]=g,n[39]=w,n[40]=ee,n[41]=I,n[42]=te,n[43]=ne,n[44]=L,n[45]=re,n[46]=R}else ee=n[40],I=n[41],te=n[42],ne=n[43],L=n[44],re=n[45],R=n[46];let ie=O?ee:void 0,ae;return n[74]!==r||n[75]!==I||n[76]!==t||n[77]!==u||n[78]!==te||n[79]!==ne||n[80]!==L||n[81]!==ie||n[82]!==re||n[83]!==R?(ae=(0,V.jsx)(`div`,{"data-handleid":re,"data-nodeid":R,"data-handlepos":te,"data-id":ne,className:L,onMouseDown:I,onTouchStart:I,onClick:ie,ref:t,...u,children:r}),n[74]=r,n[75]=I,n[76]=t,n[77]=u,n[78]=te,n[79]=ne,n[80]=L,n[81]=ie,n[82]=re,n[83]=R,n[84]=ae):ae=n[84],ae}var up=(0,v.memo)(df(lp));function dp(e){let t=(0,H.c)(6),{data:n,isConnectable:r,sourcePosition:i}=e,a=i===void 0?Ys.Bottom:i,o=n?.label,s;t[0]!==r||t[1]!==a?(s=(0,V.jsx)(up,{type:`source`,position:a,isConnectable:r}),t[0]=r,t[1]=a,t[2]=s):s=t[2];let c;return t[3]!==o||t[4]!==s?(c=(0,V.jsxs)(V.Fragment,{children:[o,s]}),t[3]=o,t[4]=s,t[5]=c):c=t[5],c}function fp(e){let t=(0,H.c)(10),{data:n,isConnectable:r,targetPosition:i,sourcePosition:a}=e,o=i===void 0?Ys.Top:i,s=a===void 0?Ys.Bottom:a,c;t[0]!==r||t[1]!==o?(c=(0,V.jsx)(up,{type:`target`,position:o,isConnectable:r}),t[0]=r,t[1]=o,t[2]=c):c=t[2];let l=n?.label,u;t[3]!==r||t[4]!==s?(u=(0,V.jsx)(up,{type:`source`,position:s,isConnectable:r}),t[3]=r,t[4]=s,t[5]=u):u=t[5];let d;return t[6]!==c||t[7]!==l||t[8]!==u?(d=(0,V.jsxs)(V.Fragment,{children:[c,l,u]}),t[6]=c,t[7]=l,t[8]=u,t[9]=d):d=t[9],d}function pp(){return null}function mp(e){let t=(0,H.c)(6),{data:n,isConnectable:r,targetPosition:i}=e,a=i===void 0?Ys.Top:i,o;t[0]!==r||t[1]!==a?(o=(0,V.jsx)(up,{type:`target`,position:a,isConnectable:r}),t[0]=r,t[1]=a,t[2]=o):o=t[2];let s=n?.label,c;return t[3]!==o||t[4]!==s?(c=(0,V.jsxs)(V.Fragment,{children:[o,s]}),t[3]=o,t[4]=s,t[5]=c):c=t[5],c}var hp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},gp={input:dp,default:fp,output:mp,group:pp};function _p(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var vp=e=>{let{width:t,height:n,x:r,y:i}=nc(e.nodeLookup,{filter:e=>!!e.selected});return{width:Sc(t)?t:null,height:Sc(n)?n:null,x:r,y:i}};function yp(e){let t=(0,H.c)(26),{onSelectionContextMenu:n,noPanClassName:r,disableKeyboardA11y:i}=e,{nodesStore:a}=Sd(),{width:o,height:s,x:c,y:l}=Td(vd(vp)),u=xd(xp),{transform:d}=Cd(),f=`translate(${d[0]}px,${d[1]}px) scale(${d[2]}) translate(${c}px,${l}px)`,p=Zf(),m=(0,v.useRef)(null),h,g;t[0]===i?(h=t[1],g=t[2]):(h=()=>{i||m.current?.focus({preventScroll:!0})},g=[i],t[0]=i,t[1]=h,t[2]=g),(0,v.useEffect)(h,g);let _=!u&&o!==null&&s!==null,y=!_,b;if(t[3]===y?b=t[4]:(b={nodeRef:m,disabled:y},t[3]=y,t[4]=b),Yf(b),!_)return null;let x;t[5]!==a||t[6]!==n?(x=n?e=>{let t=a.getState().nodes.filter(bp);n(e,t)}:void 0,t[5]=a,t[6]=n,t[7]=x):x=t[7];let S=x,C;t[8]===p?C=t[9]:(C=e=>{Object.prototype.hasOwnProperty.call(hp,e.key)&&(e.preventDefault(),p({direction:hp[e.key],factor:e.shiftKey?4:1}))},t[8]=p,t[9]=C);let w=C,T;t[10]===r?T=t[11]:(T=nt([`react-flow__nodesselection`,`react-flow__container`,r]),t[10]=r,t[11]=T);let E;t[12]===f?E=t[13]:(E={transform:f},t[12]=f,t[13]=E);let D=i?void 0:-1,O=i?void 0:w,k;t[14]!==s||t[15]!==o?(k={width:o,height:s},t[14]=s,t[15]=o,t[16]=k):k=t[16];let A;t[17]!==S||t[18]!==O||t[19]!==k||t[20]!==D?(A=(0,V.jsx)(`div`,{ref:m,className:`react-flow__nodesselection-rect`,onContextMenu:S,tabIndex:D,onKeyDown:O,style:k}),t[17]=S,t[18]=O,t[19]=k,t[20]=D,t[21]=A):A=t[21];let j;return t[22]!==A||t[23]!==T||t[24]!==E?(j=(0,V.jsx)(`div`,{className:T,style:E,children:A}),t[22]=A,t[23]=T,t[24]=E,t[25]=j):j=t[25],j}function bp(e){return e.selected}function xp(e){return e.userSelectionActive}var Sp=typeof window<`u`?window:void 0;function Cp(e){let t=(0,H.c)(54),{children:n,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:c,paneDragThreshold:l,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:f,selectionMode:p,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:_,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:S,panOnScrollSpeed:C,panOnScrollMode:w,zoomOnDoubleClick:T,panOnDrag:E,autoPanOnSelection:D,defaultViewport:O,translateExtent:k,minZoom:A,maxZoom:j,preventScrolling:M,onSelectionContextMenu:N,noWheelClassName:P,noPanClassName:F,disableKeyboardA11y:ee,onViewportChange:I,isControlledViewport:te}=e,ne=xd(Tp),L=xd(wp),re;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(re={target:Sp},t[0]=re):re=t[0];let R=ef(d,re),ie;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(ie={target:Sp},t[1]=ie):ie=t[1];let ae=ef(_,ie),z=ae||E,oe=ae||S,se;t[2]!==z||t[3]!==f?(se=f&&!fu(z??!0),t[2]=z,t[3]=f,t[4]=se):se=t[4];let ce=se,le=R||L||ce,ue;t[5]!==u||t[6]!==g?(ue={deleteKeyCode:u,multiSelectionKeyCode:g},t[5]=u,t[6]=g,t[7]=ue):ue=t[7],Af(ue);let B=!R&&z,de=!!le,fe;t[8]!==ee||t[9]!==F||t[10]!==ne||t[11]!==N?(fe=ne&&(0,V.jsx)(yp,{onSelectionContextMenu:N,noPanClassName:F,disableKeyboardA11y:ee}),t[8]=ee,t[9]=F,t[10]=ne,t[11]=N,t[12]=fe):fe=t[12];let pe;t[13]!==ce||t[14]!==D||t[15]!==n||t[16]!==r||t[17]!==s||t[18]!==i||t[19]!==o||t[20]!==a||t[21]!==c||t[22]!==h||t[23]!==m||t[24]!==z||t[25]!==l||t[26]!==R||t[27]!==p||t[28]!==de||t[29]!==fe?(pe=(0,V.jsxs)(Bf,{onSelectionStart:m,onSelectionEnd:h,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:c,panOnDrag:z,autoPanOnSelection:D,isSelecting:de,selectionMode:p,selectionKeyPressed:R,paneDragThreshold:l,selectionOnDrag:ce,children:[n,fe]}),t[13]=ce,t[14]=D,t[15]=n,t[16]=r,t[17]=s,t[18]=i,t[19]=o,t[20]=a,t[21]=c,t[22]=h,t[23]=m,t[24]=z,t[25]=l,t[26]=R,t[27]=p,t[28]=de,t[29]=fe,t[30]=pe):pe=t[30];let me;return t[31]!==O||t[32]!==y||t[33]!==te||t[34]!==j||t[35]!==A||t[36]!==F||t[37]!==P||t[38]!==s||t[39]!==I||t[40]!==ae||t[41]!==oe||t[42]!==w||t[43]!==C||t[44]!==l||t[45]!==M||t[46]!==B||t[47]!==pe||t[48]!==k||t[49]!==v||t[50]!==T||t[51]!==x||t[52]!==b?(me=(0,V.jsx)(Nf,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:oe,panActivationKeyPressed:ae,panOnScrollSpeed:C,panOnScrollMode:w,zoomOnDoubleClick:T,panOnDrag:B,defaultViewport:O,translateExtent:k,minZoom:A,maxZoom:j,zoomActivationKeyCode:v,preventScrolling:M,noWheelClassName:P,noPanClassName:F,onViewportChange:I,isControlledViewport:te,paneDragThreshold:l,children:pe}),t[31]=O,t[32]=y,t[33]=te,t[34]=j,t[35]=A,t[36]=F,t[37]=P,t[38]=s,t[39]=I,t[40]=ae,t[41]=oe,t[42]=w,t[43]=C,t[44]=l,t[45]=M,t[46]=B,t[47]=pe,t[48]=k,t[49]=v,t[50]=T,t[51]=x,t[52]=b,t[53]=me):me=t[53],me}function wp(e){return e.userSelectionActive}function Tp(e){return e.nodesSelectionActive}Cp.displayName=`FlowRenderer`;var Ep=Cp,Dp=(e,t)=>n=>e?rc(n.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(n.nodeLookup.keys());function Op(e){let t=(0,H.c)(5),n;t[0]===e?n=t[1]:(n=t=>e?t:void 0,t[0]=e,t[1]=n);let r=Cd(n),i;return t[2]!==e||t[3]!==r?(i=Dp(e,r),t[2]=e,t[3]=r,t[4]=i):i=t[4],Td(vd(i))}function kp(){let e=(0,H.c)(5),{optionsStore:t}=Sd(),n;e[0]===t?n=e[1]:(n=()=>typeof ResizeObserver>`u`?null:new ResizeObserver(e=>{let n=new Map;e.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),t.getState().updateNodeInternals(n)}),e[0]=t,e[1]=n);let[r]=(0,v.useState)(n),i,a;return e[2]===r?(i=e[3],a=e[4]):(i=()=>()=>{r?.disconnect()},a=[r],e[2]=r,e[3]=i,e[4]=a),(0,v.useEffect)(i,a),r}function Ap(e){let t=(0,H.c)(6),{optionsStore:n,nodesStore:r}=Sd(),i;t[0]!==e||t[1]!==n?(i=t=>n.getState().pubSub.subscribeToNode(e,t),t[0]=e,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]!==e||t[4]!==r?(o=()=>r.getState().nodeLookup.get(e),t[3]=e,t[4]=r,t[5]=o):o=t[5];let s=o;return(0,v.useSyncExternalStore)(a,s,s)}function jp(e){let t=(0,H.c)(23),{node:n,nodeType:r,hasDimensions:i,resizeObserver:a}=e,{optionsStore:o}=Sd(),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(n.sourcePosition),u=(0,v.useRef)(n.targetPosition),d=(0,v.useRef)(r),f=i&&!!n.internals.handleBounds,p;t[0]!==f||t[1]!==n.hidden||t[2]!==a?(p=()=>{!s.current||n.hidden||f&&c.current===s.current||(c.current&&a?.unobserve(c.current),a?.observe(s.current),c.current=s.current)},t[0]=f,t[1]=n.hidden,t[2]=a,t[3]=p):p=t[3];let m;t[4]!==f||t[5]!==n.hidden||t[6]!==n.measured.height||t[7]!==n.measured.width?(m=[f,n.hidden,n.measured.width,n.measured.height],t[4]=f,t[5]=n.hidden,t[6]=n.measured.height,t[7]=n.measured.width,t[8]=m):m=t[8],(0,v.useEffect)(p,m);let h;t[9]===a?h=t[10]:(h=()=>()=>{c.current&&=(a?.unobserve(c.current),null)},t[9]=a,t[10]=h);let g;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(g=[],t[11]=g):g=t[11],(0,v.useEffect)(h,g);let _;t[12]!==n.id||t[13]!==n.sourcePosition||t[14]!==n.targetPosition||t[15]!==r||t[16]!==o?(_=()=>{if(s.current){let e=d.current!==r,t=l.current!==n.sourcePosition,i=u.current!==n.targetPosition;(e||t||i)&&(d.current=r,l.current=n.sourcePosition,u.current=n.targetPosition,o.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:s.current,force:!0}]])))}},t[12]=n.id,t[13]=n.sourcePosition,t[14]=n.targetPosition,t[15]=r,t[16]=o,t[17]=_):_=t[17];let y;return t[18]!==n.id||t[19]!==n.sourcePosition||t[20]!==n.targetPosition||t[21]!==r?(y=[n.id,r,n.sourcePosition,n.targetPosition],t[18]=n.id,t[19]=n.sourcePosition,t[20]=n.targetPosition,t[21]=r,t[22]=y):y=t[22],(0,v.useEffect)(_,y),s}function Mp(e){let t=(0,H.c)(119),{id:n,onClick:r,onMouseEnter:i,onMouseMove:a,onMouseLeave:o,onContextMenu:s,onDoubleClick:c,nodesDraggable:l,elementsSelectable:u,nodesConnectable:d,nodesFocusable:f,resizeObserver:p,noDragClassName:m,noPanClassName:h,disableKeyboardA11y:g,rfId:_,nodeTypes:v,onError:y}=e,b=Ap(n),{internals:x}=b,S=b.type||`default`,C=v?.[S]||gp[S];C===void 0&&(y?.(`003`,zs.error003(S)),S=`default`,C=v?.default||gp.default);let w=!!(b.draggable||l&&b.draggable===void 0),T=!!(b.selectable||u&&b.selectable===void 0),E=!!(b.connectable||d&&b.connectable===void 0),D=!!(b.focusable||f&&b.focusable===void 0),{optionsStore:O,viewportStore:k,nodesStore:A}=Sd(),j;t[0]===b?j=t[1]:(j=Pc(b),t[0]=b,t[1]=j);let M=j,N;t[2]!==M||t[3]!==b||t[4]!==S||t[5]!==p?(N={node:b,nodeType:S,hasDimensions:M,resizeObserver:p},t[2]=M,t[3]=b,t[4]=S,t[5]=p,t[6]=N):N=t[6];let P=jp(N),F=b.hidden||!w,ee;t[7]!==n||t[8]!==T||t[9]!==m||t[10]!==b.dragHandle||t[11]!==P||t[12]!==F?(ee={nodeRef:P,disabled:F,noDragClassName:m,handleSelector:b.dragHandle,nodeId:n,isSelectable:T},t[7]=n,t[8]=T,t[9]=m,t[10]=b.dragHandle,t[11]=P,t[12]=F,t[13]=ee):ee=t[13];let I=Yf(ee),te=Zf();if(b.hidden)return null;let ne;t[14]===b?ne=t[15]:(ne=Nc(b),t[14]=b,t[15]=ne);let L=ne,re;t[16]===b?re=t[17]:(re=_p(b),t[16]=b,t[17]=re);let R=re,ie=T||w||r||i||a||o,ae;t[18]!==x.userNode||t[19]!==i?(ae=i?e=>i(e,{...x.userNode}):void 0,t[18]=x.userNode,t[19]=i,t[20]=ae):ae=t[20];let z=ae,oe;t[21]!==x.userNode||t[22]!==a?(oe=a?e=>a(e,{...x.userNode}):void 0,t[21]=x.userNode,t[22]=a,t[23]=oe):oe=t[23];let se=oe,ce;t[24]!==x.userNode||t[25]!==o?(ce=o?e=>o(e,{...x.userNode}):void 0,t[24]=x.userNode,t[25]=o,t[26]=ce):ce=t[26];let le=ce,ue;t[27]!==x.userNode||t[28]!==s?(ue=s?e=>s(e,{...x.userNode}):void 0,t[27]=x.userNode,t[28]=s,t[29]=ue):ue=t[29];let B=ue,de;t[30]!==x.userNode||t[31]!==c?(de=c?e=>c(e,{...x.userNode}):void 0,t[30]=x.userNode,t[31]=c,t[32]=de):de=t[32];let fe=de,pe;t[33]!==n||t[34]!==x.userNode||t[35]!==w||t[36]!==T||t[37]!==P||t[38]!==A||t[39]!==r||t[40]!==O?(pe=e=>{let{selectNodesOnDrag:t,nodeDragThreshold:i}=O.getState();T&&(!t||!w||i>0)&&Jf({id:n,optionsStore:O,nodesStore:A,nodeRef:P}),r&&r(e,{...x.userNode})},t[33]=n,t[34]=x.userNode,t[35]=w,t[36]=T,t[37]=P,t[38]=A,t[39]=r,t[40]=O,t[41]=pe):pe=t[41];let me=pe,he;t[42]!==g||t[43]!==n||t[44]!==x.positionAbsolute||t[45]!==w||t[46]!==T||t[47]!==te||t[48]!==b.selected||t[49]!==P||t[50]!==A||t[51]!==O?(he=e=>{if(!(Zc(e.nativeEvent)||g)){if(Vs.includes(e.key)&&T){let t=e.key===`Escape`;Jf({id:n,optionsStore:O,nodesStore:A,unselect:t,nodeRef:P})}else if(w&&b.selected&&Object.prototype.hasOwnProperty.call(hp,e.key)){e.preventDefault(),te({direction:hp[e.key],factor:e.shiftKey?4:1});let{ariaLabelConfig:t}=O.getState(),{nodeLookup:r}=A.getState(),i=r.get(n)?.internals.positionAbsolute??x.positionAbsolute;O.setState({ariaLiveMessage:t[`node.a11yDescription.ariaLiveMessage`]({direction:e.key.replace(`Arrow`,``).toLowerCase(),x:~~i.x,y:~~i.y})})}}},t[42]=g,t[43]=n,t[44]=x.positionAbsolute,t[45]=w,t[46]=T,t[47]=te,t[48]=b.selected,t[49]=P,t[50]=A,t[51]=O,t[52]=he):he=t[52];let ge=he,_e;t[53]!==g||t[54]!==n||t[55]!==b||t[56]!==L||t[57]!==P||t[58]!==O||t[59]!==k?(_e=()=>{if(g||!P.current?.matches(`:focus-visible`))return;let{transform:e,width:t,height:r}=k.getState(),{autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(rc(new Map([[n,b]]),{x:0,y:0,width:t,height:r},e,!0).length>0||a(b.position.x+L.width/2,b.position.y+L.height/2,{zoom:e[2]}))},t[53]=g,t[54]=n,t[55]=b,t[56]=L,t[57]=P,t[58]=O,t[59]=k,t[60]=_e):_e=t[60];let ve=_e,ye=`react-flow__node-${S}`,be;t[61]!==I||t[62]!==x.isParent||t[63]!==w||t[64]!==T||t[65]!==h||t[66]!==b.className||t[67]!==b.selected||t[68]!==ye?(be=nt([`react-flow__node`,ye,{[h]:w},b.className,{selected:b.selected,selectable:T,parent:x.isParent,draggable:w,dragging:I}]),t[61]=I,t[62]=x.isParent,t[63]=w,t[64]=T,t[65]=h,t[66]=b.className,t[67]=b.selected,t[68]=ye,t[69]=be):be=t[69];let xe=`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,Se=ie?`all`:`none`,Ce=M?`visible`:`hidden`,we;t[70]!==R||t[71]!==x.z||t[72]!==b.style||t[73]!==xe||t[74]!==Se||t[75]!==Ce?(we={zIndex:x.z,transform:xe,pointerEvents:Se,visibility:Ce,...b.style,...R},t[70]=R,t[71]=x.z,t[72]=b.style,t[73]=xe,t[74]=Se,t[75]=Ce,t[76]=we):we=t[76];let Te=`rf__node-${n}`,Ee=D?ge:void 0,De=D?0:void 0,Oe=D?ve:void 0,ke=b.ariaRole??(D?`group`:void 0),Ae=g?void 0:`${jd}-${_}`,je=b.selected??!1,Me=b.deletable??!0,Ne;t[77]!==C||t[78]!==I||t[79]!==n||t[80]!==x.positionAbsolute.x||t[81]!==x.positionAbsolute.y||t[82]!==x.z||t[83]!==E||t[84]!==w||t[85]!==T||t[86]!==b.data||t[87]!==b.dragHandle||t[88]!==b.parentId||t[89]!==b.sourcePosition||t[90]!==b.targetPosition||t[91]!==L||t[92]!==S||t[93]!==je||t[94]!==Me?(Ne=(0,V.jsx)(C,{id:n,data:b.data,type:S,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:je,selectable:T,draggable:w,deletable:Me,isConnectable:E,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:I,dragHandle:b.dragHandle,zIndex:x.z,parentId:b.parentId,...L}),t[77]=C,t[78]=I,t[79]=n,t[80]=x.positionAbsolute.x,t[81]=x.positionAbsolute.y,t[82]=x.z,t[83]=E,t[84]=w,t[85]=T,t[86]=b.data,t[87]=b.dragHandle,t[88]=b.parentId,t[89]=b.sourcePosition,t[90]=b.targetPosition,t[91]=L,t[92]=S,t[93]=je,t[94]=Me,t[95]=Ne):Ne=t[95];let Pe;t[96]!==n||t[97]!==Ne?(Pe=(0,V.jsx)($f,{value:n,children:Ne}),t[96]=n,t[97]=Ne,t[98]=Pe):Pe=t[98];let Fe;return t[99]!==n||t[100]!==b.ariaLabel||t[101]!==b.domAttributes||t[102]!==P||t[103]!==B||t[104]!==fe||t[105]!==z||t[106]!==le||t[107]!==se||t[108]!==me||t[109]!==be||t[110]!==we||t[111]!==Te||t[112]!==Ee||t[113]!==De||t[114]!==Oe||t[115]!==ke||t[116]!==Ae||t[117]!==Pe?(Fe=(0,V.jsx)(`div`,{className:be,ref:P,style:we,"data-id":n,"data-testid":Te,onMouseEnter:z,onMouseMove:se,onMouseLeave:le,onContextMenu:B,onClick:me,onDoubleClick:fe,onKeyDown:Ee,tabIndex:De,onFocus:Oe,role:ke,"aria-roledescription":`node`,"aria-describedby":Ae,"aria-label":b.ariaLabel,...b.domAttributes,children:Pe}),t[99]=n,t[100]=b.ariaLabel,t[101]=b.domAttributes,t[102]=P,t[103]=B,t[104]=fe,t[105]=z,t[106]=le,t[107]=se,t[108]=me,t[109]=be,t[110]=we,t[111]=Te,t[112]=Ee,t[113]=De,t[114]=Oe,t[115]=ke,t[116]=Ae,t[117]=Pe,t[118]=Fe):Fe=t[118],Fe}var Np=(0,v.memo)(Mp);function Pp(e){let t=(0,H.c)(41),n=xd(Rp),r=xd(Lp),i=xd(Ip),a=xd(Fp),o=Op(e.onlyRenderVisibleElements),s=kp(),c;if(t[0]!==i||t[1]!==o||t[2]!==n||t[3]!==r||t[4]!==a||t[5]!==e.disableKeyboardA11y||t[6]!==e.noDragClassName||t[7]!==e.noPanClassName||t[8]!==e.nodeExtent||t[9]!==e.nodeTypes||t[10]!==e.nodesDraggable||t[11]!==e.onNodeClick||t[12]!==e.onNodeContextMenu||t[13]!==e.onNodeDoubleClick||t[14]!==e.onNodeMouseEnter||t[15]!==e.onNodeMouseLeave||t[16]!==e.onNodeMouseMove||t[17]!==e.rfId||t[18]!==s){let l;t[20]!==i||t[21]!==n||t[22]!==r||t[23]!==a||t[24]!==e.disableKeyboardA11y||t[25]!==e.noDragClassName||t[26]!==e.noPanClassName||t[27]!==e.nodeExtent||t[28]!==e.nodeTypes||t[29]!==e.nodesDraggable||t[30]!==e.onNodeClick||t[31]!==e.onNodeContextMenu||t[32]!==e.onNodeDoubleClick||t[33]!==e.onNodeMouseEnter||t[34]!==e.onNodeMouseLeave||t[35]!==e.onNodeMouseMove||t[36]!==e.rfId||t[37]!==s?(l=t=>(0,V.jsx)(Np,{id:t,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a},t),t[20]=i,t[21]=n,t[22]=r,t[23]=a,t[24]=e.disableKeyboardA11y,t[25]=e.noDragClassName,t[26]=e.noPanClassName,t[27]=e.nodeExtent,t[28]=e.nodeTypes,t[29]=e.nodesDraggable,t[30]=e.onNodeClick,t[31]=e.onNodeContextMenu,t[32]=e.onNodeDoubleClick,t[33]=e.onNodeMouseEnter,t[34]=e.onNodeMouseLeave,t[35]=e.onNodeMouseMove,t[36]=e.rfId,t[37]=s,t[38]=l):l=t[38],c=o.map(l),t[0]=i,t[1]=o,t[2]=n,t[3]=r,t[4]=a,t[5]=e.disableKeyboardA11y,t[6]=e.noDragClassName,t[7]=e.noPanClassName,t[8]=e.nodeExtent,t[9]=e.nodeTypes,t[10]=e.nodesDraggable,t[11]=e.onNodeClick,t[12]=e.onNodeContextMenu,t[13]=e.onNodeDoubleClick,t[14]=e.onNodeMouseEnter,t[15]=e.onNodeMouseLeave,t[16]=e.onNodeMouseMove,t[17]=e.rfId,t[18]=s,t[19]=c}else c=t[19];let l;return t[39]===c?l=t[40]:(l=(0,V.jsx)(`div`,{className:`react-flow__nodes`,style:Mf,children:c}),t[39]=c,t[40]=l),l}function Fp(e){return e.onError}function Ip(e){return e.elementsSelectable}function Lp(e){return e.nodesFocusable}function Rp(e){return e.nodesConnectable}Pp.displayName=`NodeRenderer`;var zp=(0,v.memo)(Pp);function Bp(e){let t=(0,H.c)(8),n;t[0]===e?n=t[1]:(n=t=>e?t:void 0,t[0]=e,t[1]=n);let r=Cd(n),i;t[2]===e?i=t[3]:(i=t=>e?t:void 0,t[2]=e,t[3]=i);let a=Td(i),o;return t[4]!==a||t[5]!==e||t[6]!==r?(o=t=>{if(!e)return t.edges.map(Vp);let n=[];if(r.width&&r.height)for(let e of t.edges){let t=a.nodeLookup.get(e.source),i=a.nodeLookup.get(e.target);t&&i&&ol({sourceNode:t,targetNode:i,width:r.width,height:r.height,transform:r.transform})&&n.push(e.id)}return n},t[4]=a,t[5]=e,t[6]=r,t[7]=o):o=t[7],Ed(vd(o))}function Vp(e){return e.id}var Hp=e=>{let t=(0,H.c)(5),{color:n,strokeWidth:r}=e,i=n===void 0?`none`:n,a=r===void 0?1:r,o;t[0]===i?o=t[1]:(o=i&&{stroke:i},t[0]=i,t[1]=o);let s;if(t[2]!==a||t[3]!==o){let e={strokeWidth:a,...o};s=(0,V.jsx)(`polyline`,{className:`arrow`,style:e,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),t[2]=a,t[3]=o,t[4]=s}else s=t[4];return s},Up=e=>{let t=(0,H.c)(5),{color:n,strokeWidth:r}=e,i=n===void 0?`none`:n,a=r===void 0?1:r,o;t[0]===i?o=t[1]:(o=i&&{stroke:i,fill:i},t[0]=i,t[1]=o);let s;if(t[2]!==a||t[3]!==o){let e={strokeWidth:a,...o};s=(0,V.jsx)(`polyline`,{className:`arrowclosed`,style:e,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),t[2]=a,t[3]=o,t[4]=s}else s=t[4];return s},Wp={[Js.Arrow]:Hp,[Js.ArrowClosed]:Up},Gp=e=>{let t=(0,H.c)(11),{id:n,type:r,color:i,width:a,height:o,markerUnits:s,strokeWidth:c,orient:l,onError:u}=e,d=a===void 0?12.5:a,f=o===void 0?12.5:o,p=s===void 0?`strokeWidth`:s,m=l===void 0?`auto-start-reverse`:l;if(!Object.hasOwn(Wp,r))return u?.(`009`,zs.error009(r)),null;let h=Wp[r],g=`${d}`,_=`${f}`,v;t[0]!==h||t[1]!==i||t[2]!==c?(v=(0,V.jsx)(h,{color:i,strokeWidth:c}),t[0]=h,t[1]=i,t[2]=c,t[3]=v):v=t[3];let y;return t[4]!==n||t[5]!==p||t[6]!==m||t[7]!==g||t[8]!==_||t[9]!==v?(y=(0,V.jsx)(`marker`,{className:`react-flow__arrowhead`,id:n,markerWidth:g,markerHeight:_,viewBox:`-10 -10 20 20`,markerUnits:p,orient:m,refX:`0`,refY:`0`,children:v}),t[4]=n,t[5]=p,t[6]=m,t[7]=g,t[8]=_,t[9]=v,t[10]=y):y=t[10],y},Kp=e=>{let t=(0,H.c)(18),{defaultColor:n,rfId:r,onError:i}=e,a=xd(Jp),{edges:o}=Ed(),s,c,l,u;if(t[0]!==n||t[1]!==a?.markerEnd||t[2]!==a?.markerStart||t[3]!==o||t[4]!==i||t[5]!==r){u=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Cl(o,{id:r,defaultColor:n,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd});if(!e.length){u=null;break bb0}c=`react-flow__marker`,l=`true`;let d;t[10]===i?d=t[11]:(d=e=>(0,V.jsx)(Gp,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient,onError:i},e.id),t[10]=i,t[11]=d),s=e.map(d)}t[0]=n,t[1]=a?.markerEnd,t[2]=a?.markerStart,t[3]=o,t[4]=i,t[5]=r,t[6]=s,t[7]=c,t[8]=l,t[9]=u}else s=t[6],c=t[7],l=t[8],u=t[9];if(u!==Symbol.for(`react.early_return_sentinel`))return u;let d;t[12]===s?d=t[13]:(d=(0,V.jsx)(`defs`,{children:s}),t[12]=s,t[13]=d);let f;return t[14]!==c||t[15]!==l||t[16]!==d?(f=(0,V.jsx)(`svg`,{className:c,"aria-hidden":l,children:d}),t[14]=c,t[15]=l,t[16]=d,t[17]=f):f=t[17],f};Kp.displayName=`MarkerDefinitions`;var qp=(0,v.memo)(Kp);function Jp(e){return e.defaultEdgeOptions}function Yp(e){let t=(0,H.c)(6),{optionsStore:n,edgesStore:r}=Sd(),i;t[0]!==e||t[1]!==n?(i=t=>n.getState().pubSub.subscribeToEdge(e,t),t[0]=e,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==e?(o=()=>r.getState().edgeLookup.get(e),t[3]=r,t[4]=e,t[5]=o):o=t[5];let s=o;return(0,v.useSyncExternalStore)(a,s,s)}var Xp=[2,4];function Zp(e){let t=(0,H.c)(37),n,r,i,a,o,s,c,l,u,d,f;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11]):({x:d,y:f,label:i,labelStyle:o,labelShowBg:c,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,children:n,className:r,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f);let p=c===void 0||c,m=l===void 0?Xp:l,h=u===void 0?2:u,g;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(g={x:1,y:0,width:0,height:0},t[12]=g):g=t[12];let[_,y]=(0,v.useState)(g),b;t[13]===r?b=t[14]:(b=nt([`react-flow__edge-textwrapper`,r]),t[13]=r,t[14]=b);let x=b,S=(0,v.useRef)(null),C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{if(S.current){let e=S.current.getBBox();y({x:e.x,y:e.y,width:e.width,height:e.height})}},t[15]=C):C=t[15];let w;if(t[16]===i?w=t[17]:(w=[i],t[16]=i,t[17]=w),(0,v.useEffect)(C,w),!i)return null;let T=`translate(${d-_.width/2} ${f-_.height/2})`,E=_.width?`visible`:`hidden`,D;t[18]!==_.height||t[19]!==_.width||t[20]!==h||t[21]!==m||t[22]!==a||t[23]!==p?(D=p&&(0,V.jsx)(`rect`,{width:_.width+2*m[0],x:-m[0],y:-m[1],height:_.height+2*m[1],className:`react-flow__edge-textbg`,style:a,rx:h,ry:h}),t[18]=_.height,t[19]=_.width,t[20]=h,t[21]=m,t[22]=a,t[23]=p,t[24]=D):D=t[24];let O=_.height/2,k;t[25]!==i||t[26]!==o||t[27]!==O?(k=(0,V.jsx)(`text`,{className:`react-flow__edge-text`,y:O,dy:`0.3em`,ref:S,style:o,children:i}),t[25]=i,t[26]=o,t[27]=O,t[28]=k):k=t[28];let A;return t[29]!==n||t[30]!==x||t[31]!==s||t[32]!==D||t[33]!==k||t[34]!==T||t[35]!==E?(A=(0,V.jsxs)(`g`,{transform:T,className:x,visibility:E,...s,children:[D,k,n]}),t[29]=n,t[30]=x,t[31]=s,t[32]=D,t[33]=k,t[34]=T,t[35]=E,t[36]=A):A=t[36],A}Zp.displayName=`EdgeText`;var Qp=(0,v.memo)(Zp);function $p(e){let t=(0,H.c)(36),n,r,i,a,o,s,c,l,u,d,f,p,m,h;if(t[0]!==e){let{path:g,labelX:_,labelY:v,label:y,labelStyle:b,labelShowBg:x,labelBgStyle:S,labelBgPadding:C,labelBgBorderRadius:w,interactionWidth:T,...E}=e;d=g,l=_,u=v,r=y,c=b,s=x,o=S,a=C,i=w,n=T===void 0?20:T,f=E,p=d,m=`none`,h=nt([`react-flow__edge-path`,E.className]),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h}else n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],h=t[14];let g;t[15]!==f||t[16]!==p||t[17]!==m||t[18]!==h?(g=(0,V.jsx)(`path`,{...f,d:p,fill:m,className:h}),t[15]=f,t[16]=p,t[17]=m,t[18]=h,t[19]=g):g=t[19];let _;t[20]!==n||t[21]!==d?(_=n?(0,V.jsx)(`path`,{d,fill:`none`,strokeOpacity:0,strokeWidth:n,className:`react-flow__edge-interaction`}):null,t[20]=n,t[21]=d,t[22]=_):_=t[22];let v;t[23]!==r||t[24]!==i||t[25]!==a||t[26]!==o||t[27]!==s||t[28]!==c||t[29]!==l||t[30]!==u?(v=r&&Sc(l)&&Sc(u)?(0,V.jsx)(Qp,{x:l,y:u,label:r,labelStyle:c,labelShowBg:s,labelBgStyle:o,labelBgPadding:a,labelBgBorderRadius:i}):null,t[23]=r,t[24]=i,t[25]=a,t[26]=o,t[27]=s,t[28]=c,t[29]=l,t[30]=u,t[31]=v):v=t[31];let y;return t[32]!==g||t[33]!==_||t[34]!==v?(y=(0,V.jsxs)(V.Fragment,{children:[g,_,v]}),t[32]=g,t[33]=_,t[34]=v,t[35]=y):y=t[35],y}function em({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Ys.Left||e===Ys.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function tm({sourceX:e,sourceY:t,sourcePosition:n=Ys.Bottom,targetX:r,targetY:i,targetPosition:a=Ys.Top}){let[o,s]=em({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=em({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=el({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function nm(e){function t(t){let n=(0,H.c)(22),{id:r,sourceX:i,sourceY:a,targetX:o,targetY:s,sourcePosition:c,targetPosition:l,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:_,markerStart:v,interactionWidth:y}=t,b;n[0]!==c||n[1]!==i||n[2]!==a||n[3]!==l||n[4]!==o||n[5]!==s?(b=tm({sourceX:i,sourceY:a,sourcePosition:c,targetX:o,targetY:s,targetPosition:l}),n[0]=c,n[1]=i,n[2]=a,n[3]=l,n[4]=o,n[5]=s,n[6]=b):b=n[6];let[x,S,C]=b,w=e.isInternal?void 0:r,T;return n[7]!==w||n[8]!==y||n[9]!==u||n[10]!==h||n[11]!==m||n[12]!==p||n[13]!==f||n[14]!==d||n[15]!==S||n[16]!==C||n[17]!==_||n[18]!==v||n[19]!==x||n[20]!==g?(T=(0,V.jsx)($p,{id:w,path:x,labelX:S,labelY:C,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:_,markerStart:v,interactionWidth:y}),n[7]=w,n[8]=y,n[9]=u,n[10]=h,n[11]=m,n[12]=p,n[13]=f,n[14]=d,n[15]=S,n[16]=C,n[17]=_,n[18]=v,n[19]=x,n[20]=g,n[21]=T):T=n[21],T}return t.displayName=e.isInternal?`SimpleBezierEdgeInternal`:`SimpleBezierEdge`,(0,v.memo)(t)}nm({isInternal:!1});var rm=nm({isInternal:!0});function im(e){function t(t){let n=(0,H.c)(25),{id:r,sourceX:i,sourceY:a,targetX:o,targetY:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,sourcePosition:h,targetPosition:g,markerEnd:_,markerStart:v,pathOptions:y,interactionWidth:b}=t,x=h===void 0?Ys.Bottom:h,S=g===void 0?Ys.Top:g,C=y?.borderRadius,w=y?.offset,T=y?.stepPosition,E;n[0]!==x||n[1]!==i||n[2]!==a||n[3]!==C||n[4]!==w||n[5]!==T||n[6]!==S||n[7]!==o||n[8]!==s?(E=_l({sourceX:i,sourceY:a,sourcePosition:x,targetX:o,targetY:s,targetPosition:S,borderRadius:C,offset:w,stepPosition:T}),n[0]=x,n[1]=i,n[2]=a,n[3]=C,n[4]=w,n[5]=T,n[6]=S,n[7]=o,n[8]=s,n[9]=E):E=n[9];let[D,O,k]=E,A=e.isInternal?void 0:r,j;return n[10]!==A||n[11]!==b||n[12]!==c||n[13]!==p||n[14]!==f||n[15]!==d||n[16]!==u||n[17]!==l||n[18]!==O||n[19]!==k||n[20]!==_||n[21]!==v||n[22]!==D||n[23]!==m?(j=(0,V.jsx)($p,{id:A,path:D,labelX:O,labelY:k,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:_,markerStart:v,interactionWidth:b}),n[10]=A,n[11]=b,n[12]=c,n[13]=p,n[14]=f,n[15]=d,n[16]=u,n[17]=l,n[18]=O,n[19]=k,n[20]=_,n[21]=v,n[22]=D,n[23]=m,n[24]=j):j=n[24],j}return t.displayName=e.isInternal?`SmoothStepEdgeInternal`:`SmoothStepEdge`,(0,v.memo)(t)}var am=im({isInternal:!1}),om=im({isInternal:!0});function sm(e){function t(t){let n=(0,H.c)(9),r,i;n[0]===t?(r=n[1],i=n[2]):({id:r,...i}=t,n[0]=t,n[1]=r,n[2]=i);let a=e.isInternal?void 0:r,o=i.pathOptions?.offset,s;n[3]===o?s=n[4]:(s={borderRadius:0,offset:o},n[3]=o,n[4]=s);let c;return n[5]!==a||n[6]!==i||n[7]!==s?(c=(0,V.jsx)(am,{...i,id:a,pathOptions:s}),n[5]=a,n[6]=i,n[7]=s,n[8]=c):c=n[8],c}return t.displayName=e.isInternal?`StepEdgeInternal`:`StepEdge`,(0,v.memo)(t)}sm({isInternal:!1});var cm=sm({isInternal:!0});function lm(e){function t(t){let n=(0,H.c)(20),{id:r,sourceX:i,sourceY:a,targetX:o,targetY:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_}=t,v;n[0]!==i||n[1]!==a||n[2]!==o||n[3]!==s?(v=ul({sourceX:i,sourceY:a,targetX:o,targetY:s}),n[0]=i,n[1]=a,n[2]=o,n[3]=s,n[4]=v):v=n[4];let[y,b,x]=v,S=e.isInternal?void 0:r,C;return n[5]!==S||n[6]!==_||n[7]!==c||n[8]!==p||n[9]!==f||n[10]!==d||n[11]!==u||n[12]!==l||n[13]!==b||n[14]!==x||n[15]!==h||n[16]!==g||n[17]!==y||n[18]!==m?(C=(0,V.jsx)($p,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_}),n[5]=S,n[6]=_,n[7]=c,n[8]=p,n[9]=f,n[10]=d,n[11]=u,n[12]=l,n[13]=b,n[14]=x,n[15]=h,n[16]=g,n[17]=y,n[18]=m,n[19]=C):C=n[19],C}return t.displayName=e.isInternal?`StraightEdgeInternal`:`StraightEdge`,(0,v.memo)(t)}lm({isInternal:!1});var um=lm({isInternal:!0});function dm(e){function t(t){let n=(0,H.c)(23),{id:r,sourceX:i,sourceY:a,targetX:o,targetY:s,sourcePosition:c,targetPosition:l,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:_,markerStart:v,pathOptions:y,interactionWidth:b}=t,x=c===void 0?Ys.Bottom:c,S=l===void 0?Ys.Top:l,C=y?.curvature,w;n[0]!==x||n[1]!==i||n[2]!==a||n[3]!==C||n[4]!==S||n[5]!==o||n[6]!==s?(w=rl({sourceX:i,sourceY:a,sourcePosition:x,targetX:o,targetY:s,targetPosition:S,curvature:C}),n[0]=x,n[1]=i,n[2]=a,n[3]=C,n[4]=S,n[5]=o,n[6]=s,n[7]=w):w=n[7];let[T,E,D]=w,O=e.isInternal?void 0:r,k;return n[8]!==O||n[9]!==b||n[10]!==u||n[11]!==h||n[12]!==m||n[13]!==p||n[14]!==f||n[15]!==d||n[16]!==E||n[17]!==D||n[18]!==_||n[19]!==v||n[20]!==T||n[21]!==g?(k=(0,V.jsx)($p,{id:O,path:T,labelX:E,labelY:D,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:_,markerStart:v,interactionWidth:b}),n[8]=O,n[9]=b,n[10]=u,n[11]=h,n[12]=m,n[13]=p,n[14]=f,n[15]=d,n[16]=E,n[17]=D,n[18]=_,n[19]=v,n[20]=T,n[21]=g,n[22]=k):k=n[22],k}return t.displayName=e.isInternal?`BezierEdgeInternal`:`BezierEdge`,(0,v.memo)(t)}dm({isInternal:!1});var fm={default:dm({isInternal:!0}),straight:um,step:cm,smoothstep:om,simplebezier:rm},pm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},mm=(e,t,n)=>n===Ys.Left?e-t:n===Ys.Right?e+t:e,hm=(e,t,n)=>n===Ys.Top?e-t:n===Ys.Bottom?e+t:e,gm=`react-flow__edgeupdater`;function _m(e){let t=(0,H.c)(18),{position:n,centerX:r,centerY:i,radius:a,onMouseDown:o,onMouseEnter:s,onMouseOut:c,type:l}=e,u=a===void 0?10:a,d=`${gm}-${l}`,f;t[0]===d?f=t[1]:(f=nt([gm,d]),t[0]=d,t[1]=f);let p;t[2]!==r||t[3]!==n||t[4]!==u?(p=mm(r,u,n),t[2]=r,t[3]=n,t[4]=u,t[5]=p):p=t[5];let m;t[6]!==i||t[7]!==n||t[8]!==u?(m=hm(i,u,n),t[6]=i,t[7]=n,t[8]=u,t[9]=m):m=t[9];let h;return t[10]!==o||t[11]!==s||t[12]!==c||t[13]!==u||t[14]!==f||t[15]!==p||t[16]!==m?(h=(0,V.jsx)(`circle`,{onMouseDown:o,onMouseEnter:s,onMouseOut:c,className:f,cx:p,cy:m,r:u,stroke:`transparent`,fill:`transparent`}),t[10]=o,t[11]=s,t[12]=c,t[13]=u,t[14]=f,t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function vm(e){let t=(0,H.c)(43),{isReconnectable:n,reconnectRadius:r,edge:i,sourceX:a,sourceY:o,targetX:s,targetY:c,sourcePosition:l,targetPosition:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,setReconnecting:m,setUpdateHover:h}=e,{optionsStore:g,viewportStore:_,connectionStore:v,nodesStore:y}=Sd(),b;t[0]!==v||t[1]!==i||t[2]!==y||t[3]!==d||t[4]!==p||t[5]!==f||t[6]!==g||t[7]!==m||t[8]!==_?(b=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:n,domNode:r,connectionMode:a,connectionRadius:o,onConnectStart:s,cancelConnection:c,rfId:l,panBy:u,updateConnection:h}=g.getState(),{nodeLookup:b}=y.getState(),x=t.type===`target`;su.onPointerDown(e.nativeEvent,{autoPanOnConnect:n,connectionMode:a,connectionRadius:o,domNode:r,handleId:t.id,nodeId:t.nodeId,nodeLookup:b,isTarget:x,edgeUpdaterType:t.type,lib:`react`,flowId:l,cancelConnection:c,panBy:u,isValidConnection:(...e)=>{let t=e;return g.getState().isValidConnection?.(...t)??!0},onConnect:e=>d?.(i,e),onConnectStart:(n,r)=>{m(!0),f?.(e,i,t.type),s?.(n,r)},onConnectEnd:(...e)=>{let t=e;return g.getState().onConnectEnd?.(...t)},onReconnectEnd:(e,n)=>{m(!1),p?.(e,i,t.type,n)},updateConnection:h,getTransform:()=>_.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},t[0]=v,t[1]=i,t[2]=y,t[3]=d,t[4]=p,t[5]=f,t[6]=g,t[7]=m,t[8]=_,t[9]=b):b=t[9];let x=b,S;t[10]!==i.target||t[11]!==i.targetHandle||t[12]!==x?(S=e=>x(e,{nodeId:i.target,id:i.targetHandle??null,type:`target`}),t[10]=i.target,t[11]=i.targetHandle,t[12]=x,t[13]=S):S=t[13];let C=S,w;t[14]!==i.source||t[15]!==i.sourceHandle||t[16]!==x?(w=e=>x(e,{nodeId:i.source,id:i.sourceHandle??null,type:`source`}),t[14]=i.source,t[15]=i.sourceHandle,t[16]=x,t[17]=w):w=t[17];let T=w,E;t[18]===h?E=t[19]:(E=()=>h(!0),t[18]=h,t[19]=E);let D=E,O;t[20]===h?O=t[21]:(O=()=>h(!1),t[20]=h,t[21]=O);let k=O,A;t[22]!==n||t[23]!==D||t[24]!==k||t[25]!==C||t[26]!==r||t[27]!==l||t[28]!==a||t[29]!==o?(A=(n===!0||n===`source`)&&(0,V.jsx)(_m,{position:l,centerX:a,centerY:o,radius:r,onMouseDown:C,onMouseEnter:D,onMouseOut:k,type:`source`}),t[22]=n,t[23]=D,t[24]=k,t[25]=C,t[26]=r,t[27]=l,t[28]=a,t[29]=o,t[30]=A):A=t[30];let j;t[31]!==n||t[32]!==D||t[33]!==k||t[34]!==T||t[35]!==r||t[36]!==u||t[37]!==s||t[38]!==c?(j=(n===!0||n===`target`)&&(0,V.jsx)(_m,{position:u,centerX:s,centerY:c,radius:r,onMouseDown:T,onMouseEnter:D,onMouseOut:k,type:`target`}),t[31]=n,t[32]=D,t[33]=k,t[34]=T,t[35]=r,t[36]=u,t[37]=s,t[38]=c,t[39]=j):j=t[39];let M;return t[40]!==A||t[41]!==j?(M=(0,V.jsxs)(V.Fragment,{children:[A,j]}),t[40]=A,t[41]=j,t[42]=M):M=t[42],M}function ym(e){let t=(0,H.c)(110),{id:n,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:a,onClick:o,onDoubleClick:s,onContextMenu:c,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,reconnectRadius:f,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,rfId:g,edgeTypes:_,noPanClassName:y,onError:b,disableKeyboardA11y:x,connectionMode:S,elevateEdgesOnSelect:C,zIndexMode:w,defaultEdgeOptions:T}=e,E=Yp(n);E=T?{...T,...E}:E;let D=E.type||`default`,O=_?.[D]||fm[D];O===void 0&&(b?.(`011`,zs.error011(D)),D=`default`,O=_?.default||fm.default);let k=!!(E.focusable||r&&E.focusable===void 0),A=p!==void 0&&(E.reconnectable||i&&E.reconnectable===void 0),j=!!(E.selectable||a&&E.selectable===void 0),M=(0,v.useRef)(null),[N,P]=(0,v.useState)(!1),[F,ee]=(0,v.useState)(!1),{optionsStore:I}=Sd(),te=Ap(E.source),ne=Ap(E.target),L=E.zIndex,re;bb0:{if(!te||!ne){re=pm;break bb0}let e=E.sourceHandle||null,r=E.targetHandle||null,i;t[0]!==S||t[1]!==n||t[2]!==b||t[3]!==te||t[4]!==e||t[5]!==r||t[6]!==ne?(i=yl({id:n,sourceNode:te,targetNode:ne,sourceHandle:e,targetHandle:r,connectionMode:S,onError:b}),t[0]=S,t[1]=n,t[2]=b,t[3]=te,t[4]=e,t[5]=r,t[6]=ne,t[7]=i):i=t[7];let a=i,o;t[8]!==E.selected||t[9]!==E.zIndex||t[10]!==C||t[11]!==te||t[12]!==ne||t[13]!==w?(o=al({selected:E.selected,zIndex:E.zIndex,sourceNode:te,targetNode:ne,elevateOnSelect:C,zIndexMode:w}),t[8]=E.selected,t[9]=E.zIndex,t[10]=C,t[11]=te,t[12]=ne,t[13]=w,t[14]=o):o=t[14];let s=o,c=a||pm,l;t[15]!==c||t[16]!==s?(l={...c,zIndex:s},t[15]=c,t[16]=s,t[17]=l):l=t[17],re=l}let{zIndex:R,sourceX:ie,sourceY:ae,targetX:z,targetY:oe,sourcePosition:se,targetPosition:ce}=re,le=R===void 0?L:R,ue;t[18]!==E.markerStart||t[19]!==g?(ue=E.markerStart?`url('#${Sl(E.markerStart,g)}')`:void 0,t[18]=E.markerStart,t[19]=g,t[20]=ue):ue=t[20];let B=ue,de;t[21]!==E.markerEnd||t[22]!==g?(de=E.markerEnd?`url('#${Sl(E.markerEnd,g)}')`:void 0,t[21]=E.markerEnd,t[22]=g,t[23]=de):de=t[23];let fe=de;if(E.hidden||ie===null||ae===null||z===null||oe===null)return null;let pe;t[24]!==E||t[25]!==n||t[26]!==j||t[27]!==o||t[28]!==I?(pe=e=>{let{addSelectedEdges:t,unselectNodesAndEdges:r,multiSelectionActive:i,nodesSelectionActive:a}=I.getState();j&&(a&&I.setState({nodesSelectionActive:!1}),E.selected&&i?(r({nodes:[],edges:[E]}),M.current?.blur()):t([n])),o&&o(e,E)},t[24]=E,t[25]=n,t[26]=j,t[27]=o,t[28]=I,t[29]=pe):pe=t[29];let me=pe,he;t[30]!==E||t[31]!==s?(he=s?e=>{s(e,{...E})}:void 0,t[30]=E,t[31]=s,t[32]=he):he=t[32];let ge=he,_e;t[33]!==E||t[34]!==c?(_e=c?e=>{c(e,{...E})}:void 0,t[33]=E,t[34]=c,t[35]=_e):_e=t[35];let ve=_e,ye;t[36]!==E||t[37]!==l?(ye=l?e=>{l(e,{...E})}:void 0,t[36]=E,t[37]=l,t[38]=ye):ye=t[38];let be=ye,xe;t[39]!==E||t[40]!==u?(xe=u?e=>{u(e,{...E})}:void 0,t[39]=E,t[40]=u,t[41]=xe):xe=t[41];let Se=xe,Ce;t[42]!==E||t[43]!==d?(Ce=d?e=>{d(e,{...E})}:void 0,t[42]=E,t[43]=d,t[44]=Ce):Ce=t[44];let we=Ce,Te;t[45]!==x||t[46]!==E||t[47]!==n||t[48]!==j||t[49]!==I?(Te=e=>{if(!x&&Vs.includes(e.key)&&j){let{unselectNodesAndEdges:t,addSelectedEdges:r}=I.getState();e.key===`Escape`?(M.current?.blur(),t({edges:[E]})):r([n])}},t[45]=x,t[46]=E,t[47]=n,t[48]=j,t[49]=I,t[50]=Te):Te=t[50];let Ee=Te,De;t[51]===le?De=t[52]:(De={zIndex:le},t[51]=le,t[52]=De);let Oe=`react-flow__edge-${D}`,ke=!j&&!o,Ae;t[53]!==E.animated||t[54]!==E.className||t[55]!==E.selected||t[56]!==j||t[57]!==y||t[58]!==Oe||t[59]!==ke||t[60]!==N?(Ae=nt([`react-flow__edge`,Oe,E.className,y,{selected:E.selected,animated:E.animated,inactive:ke,updating:N,selectable:j}]),t[53]=E.animated,t[54]=E.className,t[55]=E.selected,t[56]=j,t[57]=y,t[58]=Oe,t[59]=ke,t[60]=N,t[61]=Ae):Ae=t[61];let je=k?Ee:void 0,Me=k?0:void 0,Ne=E.ariaRole??(k?`group`:`img`),Pe=`rf__edge-${n}`,Fe=E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,Ie=k?`${Md}-${g}`:void 0,Le;t[62]!==O||t[63]!==E||t[64]!==n||t[65]!==j||t[66]!==fe||t[67]!==B||t[68]!==F||t[69]!==se||t[70]!==ie||t[71]!==ae||t[72]!==ce||t[73]!==z||t[74]!==oe?(Le=!F&&(0,V.jsx)(O,{id:n,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:j,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:ie,sourceY:ae,targetX:z,targetY:oe,sourcePosition:se,targetPosition:ce,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:B,markerEnd:fe,pathOptions:`pathOptions`in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),t[62]=O,t[63]=E,t[64]=n,t[65]=j,t[66]=fe,t[67]=B,t[68]=F,t[69]=se,t[70]=ie,t[71]=ae,t[72]=ce,t[73]=z,t[74]=oe,t[75]=Le):Le=t[75];let Re;t[76]!==E||t[77]!==A||t[78]!==p||t[79]!==h||t[80]!==m||t[81]!==f||t[82]!==se||t[83]!==ie||t[84]!==ae||t[85]!==ce||t[86]!==z||t[87]!==oe?(Re=A&&(0,V.jsx)(vm,{edge:E,isReconnectable:A,reconnectRadius:f,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,sourceX:ie,sourceY:ae,targetX:z,targetY:oe,sourcePosition:se,targetPosition:ce,setUpdateHover:P,setReconnecting:ee}),t[76]=E,t[77]=A,t[78]=p,t[79]=h,t[80]=m,t[81]=f,t[82]=se,t[83]=ie,t[84]=ae,t[85]=ce,t[86]=z,t[87]=oe,t[88]=Re):Re=t[88];let ze;t[89]!==E.domAttributes||t[90]!==n||t[91]!==me||t[92]!==ve||t[93]!==ge||t[94]!==be||t[95]!==we||t[96]!==Se||t[97]!==Ae||t[98]!==je||t[99]!==Me||t[100]!==Ne||t[101]!==Pe||t[102]!==Fe||t[103]!==Ie||t[104]!==Le||t[105]!==Re?(ze=(0,V.jsxs)(`g`,{className:Ae,onClick:me,onDoubleClick:ge,onContextMenu:ve,onMouseEnter:be,onMouseMove:Se,onMouseLeave:we,onKeyDown:je,tabIndex:Me,role:Ne,"aria-roledescription":`edge`,"data-id":n,"data-testid":Pe,"aria-label":Fe,"aria-describedby":Ie,ref:M,...E.domAttributes,children:[Le,Re]}),t[89]=E.domAttributes,t[90]=n,t[91]=me,t[92]=ve,t[93]=ge,t[94]=be,t[95]=we,t[96]=Se,t[97]=Ae,t[98]=je,t[99]=Me,t[100]=Ne,t[101]=Pe,t[102]=Fe,t[103]=Ie,t[104]=Le,t[105]=Re,t[106]=ze):ze=t[106];let Be;return t[107]!==De||t[108]!==ze?(Be=(0,V.jsx)(`svg`,{style:De,children:ze}),t[107]=De,t[108]=ze,t[109]=Be):Be=t[109],Be}var bm=(0,v.memo)(ym);function xm(e){let t=(0,H.c)(54),{defaultMarkerColor:n,onlyRenderVisibleElements:r,rfId:i,edgeTypes:a,noPanClassName:o,onReconnect:s,onEdgeContextMenu:c,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:f,reconnectRadius:p,onEdgeDoubleClick:m,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:_}=e,v=xd(km),y=xd(Om),b=xd(Dm),x=xd(Em),S=xd(Tm),C=xd(wm),w=xd(Cm),T=xd(Sm),E=Bp(r),D;t[0]!==n||t[1]!==x||t[2]!==i?(D=(0,V.jsx)(qp,{defaultColor:n,rfId:i,onError:x}),t[0]=n,t[1]=x,t[2]=i,t[3]=D):D=t[3];let O;if(t[4]!==S||t[5]!==T||t[6]!==_||t[7]!==E||t[8]!==a||t[9]!==v||t[10]!==y||t[11]!==b||t[12]!==C||t[13]!==o||t[14]!==f||t[15]!==c||t[16]!==m||t[17]!==l||t[18]!==d||t[19]!==u||t[20]!==x||t[21]!==s||t[22]!==g||t[23]!==h||t[24]!==p||t[25]!==i||t[26]!==w){let e;t[28]!==S||t[29]!==T||t[30]!==_||t[31]!==a||t[32]!==v||t[33]!==y||t[34]!==b||t[35]!==C||t[36]!==o||t[37]!==f||t[38]!==c||t[39]!==m||t[40]!==l||t[41]!==d||t[42]!==u||t[43]!==x||t[44]!==s||t[45]!==g||t[46]!==h||t[47]!==p||t[48]!==i||t[49]!==w?(e=e=>(0,V.jsx)(bm,{id:e,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:b,noPanClassName:o,onReconnect:s,onContextMenu:c,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,onClick:f,reconnectRadius:p,onDoubleClick:m,onReconnectStart:h,onReconnectEnd:g,rfId:i,onError:x,edgeTypes:a,disableKeyboardA11y:_,connectionMode:S,elevateEdgesOnSelect:C,zIndexMode:w,defaultEdgeOptions:T},e),t[28]=S,t[29]=T,t[30]=_,t[31]=a,t[32]=v,t[33]=y,t[34]=b,t[35]=C,t[36]=o,t[37]=f,t[38]=c,t[39]=m,t[40]=l,t[41]=d,t[42]=u,t[43]=x,t[44]=s,t[45]=g,t[46]=h,t[47]=p,t[48]=i,t[49]=w,t[50]=e):e=t[50],O=E.map(e),t[4]=S,t[5]=T,t[6]=_,t[7]=E,t[8]=a,t[9]=v,t[10]=y,t[11]=b,t[12]=C,t[13]=o,t[14]=f,t[15]=c,t[16]=m,t[17]=l,t[18]=d,t[19]=u,t[20]=x,t[21]=s,t[22]=g,t[23]=h,t[24]=p,t[25]=i,t[26]=w,t[27]=O}else O=t[27];let k;return t[51]!==D||t[52]!==O?(k=(0,V.jsxs)(`div`,{className:`react-flow__edges`,children:[D,O]}),t[51]=D,t[52]=O,t[53]=k):k=t[53],k}function Sm(e){return e.defaultEdgeOptions}function Cm(e){return e.zIndexMode}function wm(e){return e.elevateEdgesOnSelect}function Tm(e){return e.connectionMode}function Em(e){return e.onError}function Dm(e){return e.elementsSelectable}function Om(e){return e.edgesReconnectable}function km(e){return e.edgesFocusable}xm.displayName=`EdgeRenderer`;var Am=(0,v.memo)(xm),jm=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function Mm(e){let t=(0,H.c)(12),{children:n}=e,{viewportStore:r}=Sd(),i=(0,v.useRef)(null),a;t[0]===r?a=t[1]:(a=()=>r.getState().transform,t[0]=r,t[1]=a);let[o]=(0,v.useState)(a),s,c;t[2]===r?(s=t[3],c=t[4]):(s=()=>{let e=null,t=()=>{let t=r.getState().transform;e&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]||(e=t,i.current&&(i.current.style.transform=jm(t)))};return t(),r.subscribe(t)},c=[r],t[2]=r,t[3]=s,t[4]=c),ff(s,c);let l;t[5]===o?l=t[6]:(l=jm(o),t[5]=o,t[6]=l);let u;t[7]===l?u=t[8]:(u={transform:l},t[7]=l,t[8]=u);let d;return t[9]!==n||t[10]!==u?(d=(0,V.jsx)(`div`,{ref:i,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:u,children:n}),t[9]=n,t[10]=u,t[11]=d):d=t[11],d}function Nm(e){let t=(0,H.c)(6),n=bf(),r=(0,v.useRef)(!1),i;t[0]!==e||t[1]!==n?(i=()=>{!r.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),r.current=!0)},t[0]=e,t[1]=n,t[2]=i):i=t[2];let a;t[3]!==e||t[4]!==n.viewportInitialized?(a=[e,n.viewportInitialized],t[3]=e,t[4]=n.viewportInitialized,t[5]=a):a=t[5],(0,v.useEffect)(i,a)}function Pm(e){let t=(0,H.c)(5),n=xd(Fm)?.syncViewport,{viewportStore:r}=Sd(),i,a;return t[0]!==n||t[1]!==e||t[2]!==r?(i=()=>{e&&(n?.(e),r.setState({transform:[e.x,e.y,e.zoom]}))},a=[e,n,r],t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=a):(i=t[3],a=t[4]),(0,v.useEffect)(i,a),null}function Fm(e){return e.panZoom}function Im(e){let t=(0,H.c)(15),{containerStyle:n,style:r,type:i,component:a}=e,o=xd(zm),s=Cd(Rm),c=Cd(Lm),{connection:l}=wd(),{isValid:u,inProgress:d}=l;if(!(s&&o&&d))return null;let f;t[0]===u?f=t[1]:(f=nt([`react-flow__connection`,Vc(u)]),t[0]=u,t[1]=f);let p;t[2]!==a||t[3]!==u||t[4]!==r||t[5]!==i?(p=(0,V.jsx)(Bm,{style:r,type:i,CustomComponent:a,isValid:u}),t[2]=a,t[3]=u,t[4]=r,t[5]=i,t[6]=p):p=t[6];let m;t[7]!==f||t[8]!==p?(m=(0,V.jsx)(`g`,{className:f,children:p}),t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;return t[10]!==n||t[11]!==c||t[12]!==m||t[13]!==s?(h=(0,V.jsx)(`svg`,{style:n,width:s,height:c,className:`react-flow__connectionline react-flow__container`,children:m}),t[10]=n,t[11]=c,t[12]=m,t[13]=s,t[14]=h):h=t[14],h}function Lm(e){return e.height}function Rm(e){return e.width}function zm(e){return e.nodesConnectable}var Bm=e=>{let t=(0,H.c)(29),{style:n,type:r,CustomComponent:i,isValid:a}=e,o=r===void 0?qs.Bezier:r,{inProgress:s,from:c,fromNode:l,fromHandle:u,fromPosition:d,to:f,toNode:p,toHandle:m,toPosition:h,pointer:g}=ap();if(!s)return;if(i){let e=c.x,r=c.y,s=f.x,_=f.y,v;t[0]===a?v=t[1]:(v=Vc(a),t[0]=a,t[1]=v);let y;return t[2]!==i||t[3]!==c.x||t[4]!==c.y||t[5]!==u||t[6]!==l||t[7]!==d||t[8]!==g||t[9]!==n||t[10]!==v||t[11]!==f.x||t[12]!==f.y||t[13]!==m||t[14]!==p||t[15]!==h||t[16]!==o?(y=(0,V.jsx)(i,{connectionLineType:o,connectionLineStyle:n,fromNode:l,fromHandle:u,fromX:e,fromY:r,toX:s,toY:_,fromPosition:d,toPosition:h,connectionStatus:v,toNode:p,toHandle:m,pointer:g}),t[2]=i,t[3]=c.x,t[4]=c.y,t[5]=u,t[6]=l,t[7]=d,t[8]=g,t[9]=n,t[10]=v,t[11]=f.x,t[12]=f.y,t[13]=m,t[14]=p,t[15]=h,t[16]=o,t[17]=y):y=t[17],y}let _;if(t[18]!==c.x||t[19]!==c.y||t[20]!==d||t[21]!==f.x||t[22]!==f.y||t[23]!==h||t[24]!==o){let e={sourceX:c.x,sourceY:c.y,sourcePosition:d,targetX:f.x,targetY:f.y,targetPosition:h};bb0:switch(o){case qs.Bezier:[_]=rl(e);break bb0;case qs.SimpleBezier:[_]=tm(e);break bb0;case qs.Step:[_]=_l({...e,borderRadius:0});break bb0;case qs.SmoothStep:[_]=_l(e);break bb0;default:[_]=ul(e)}t[18]=c.x,t[19]=c.y,t[20]=d,t[21]=f.x,t[22]=f.y,t[23]=h,t[24]=o,t[25]=_}else _=t[25];let v;return t[26]!==_||t[27]!==n?(v=(0,V.jsx)(`path`,{d:_,fill:`none`,className:`react-flow__connection-path`,style:n}),t[26]=_,t[27]=n,t[28]=v):v=t[28],v};Bm.displayName=`ConnectionLine`;var Vm={};function Hm(e){let t=(0,H.c)(5),n=e===void 0?Vm:e;(0,v.useRef)(n);let{optionsStore:r}=Sd(),i;t[0]!==n||t[1]!==r?(i=()=>{},t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===n?a=t[4]:(a=[n],t[3]=n,t[4]=a),(0,v.useEffect)(i,a)}function Um(){let e=(0,H.c)(3),{optionsStore:t}=Sd();(0,v.useRef)(!1);let n;e[0]===t?n=e[1]:(n=()=>{},e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[2]=r):r=e[2],(0,v.useEffect)(n,r)}function Wm(e){let t=(0,H.c)(82),{nodeTypes:n,edgeTypes:r,onInit:i,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:s,onEdgeDoubleClick:c,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:f,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:_,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:x,selectionMode:S,multiSelectionKeyCode:C,panActivationKeyCode:w,zoomActivationKeyCode:T,deleteKeyCode:E,onlyRenderVisibleElements:D,elementsSelectable:O,defaultViewport:k,translateExtent:A,minZoom:j,maxZoom:M,preventScrolling:N,defaultMarkerColor:P,zoomOnScroll:F,zoomOnPinch:ee,panOnScroll:I,panOnScrollSpeed:te,panOnScrollMode:ne,zoomOnDoubleClick:L,panOnDrag:re,autoPanOnSelection:R,onPaneClick:ie,onPaneMouseEnter:ae,onPaneMouseMove:z,onPaneMouseLeave:oe,onPaneScroll:se,onPaneContextMenu:ce,paneDragThreshold:le,onEdgeContextMenu:ue,onEdgeMouseEnter:B,onEdgeMouseMove:de,onEdgeMouseLeave:fe,reconnectRadius:pe,onReconnect:me,onReconnectStart:he,onReconnectEnd:ge,noDragClassName:_e,noWheelClassName:ve,noPanClassName:ye,disableKeyboardA11y:be,nodeExtent:xe,rfId:Se,viewport:Ce,onViewportChange:we,nodesDraggable:Te}=e;Hm(n),Hm(r),Um(),Nm(i),Pm(Ce);let Ee=!!Ce,De;t[0]!==P||t[1]!==be||t[2]!==r||t[3]!==ye||t[4]!==o||t[5]!==ue||t[6]!==c||t[7]!==B||t[8]!==fe||t[9]!==de||t[10]!==me||t[11]!==ge||t[12]!==he||t[13]!==D||t[14]!==pe||t[15]!==Se?(De=(0,V.jsx)(Am,{edgeTypes:r,onEdgeClick:o,onEdgeDoubleClick:c,onReconnect:me,onReconnectStart:he,onReconnectEnd:ge,onlyRenderVisibleElements:D,onEdgeContextMenu:ue,onEdgeMouseEnter:B,onEdgeMouseMove:de,onEdgeMouseLeave:fe,reconnectRadius:pe,defaultMarkerColor:P,noPanClassName:ye,disableKeyboardA11y:be,rfId:Se}),t[0]=P,t[1]=be,t[2]=r,t[3]=ye,t[4]=o,t[5]=ue,t[6]=c,t[7]=B,t[8]=fe,t[9]=de,t[10]=me,t[11]=ge,t[12]=he,t[13]=D,t[14]=pe,t[15]=Se,t[16]=De):De=t[16];let Oe;t[17]!==v||t[18]!==y||t[19]!==_||t[20]!==g?(Oe=(0,V.jsx)(Im,{style:_,type:g,component:v,containerStyle:y}),t[17]=v,t[18]=y,t[19]=_,t[20]=g,t[21]=Oe):Oe=t[21];let ke;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,V.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),t[22]=ke):ke=t[22];let Ae;t[23]!==be||t[24]!==_e||t[25]!==ye||t[26]!==xe||t[27]!==n||t[28]!==Te||t[29]!==a||t[30]!==f||t[31]!==s||t[32]!==l||t[33]!==d||t[34]!==u||t[35]!==D||t[36]!==Se?(Ae=(0,V.jsx)(zp,{nodeTypes:n,onNodeClick:a,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:f,onlyRenderVisibleElements:D,noPanClassName:ye,noDragClassName:_e,disableKeyboardA11y:be,nodeExtent:xe,rfId:Se,nodesDraggable:Te}),t[23]=be,t[24]=_e,t[25]=ye,t[26]=xe,t[27]=n,t[28]=Te,t[29]=a,t[30]=f,t[31]=s,t[32]=l,t[33]=d,t[34]=u,t[35]=D,t[36]=Se,t[37]=Ae):Ae=t[37];let je;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,V.jsx)(`div`,{className:`react-flow__viewport-portal`}),t[38]=je):je=t[38];let Me;t[39]!==De||t[40]!==Oe||t[41]!==Ae?(Me=(0,V.jsxs)(Mm,{children:[De,Oe,ke,Ae,je]}),t[39]=De,t[40]=Oe,t[41]=Ae,t[42]=Me):Me=t[42];let Ne;return t[43]!==R||t[44]!==k||t[45]!==E||t[46]!==be||t[47]!==O||t[48]!==M||t[49]!==j||t[50]!==C||t[51]!==_e||t[52]!==ye||t[53]!==ve||t[54]!==ie||t[55]!==ce||t[56]!==ae||t[57]!==oe||t[58]!==z||t[59]!==se||t[60]!==p||t[61]!==h||t[62]!==m||t[63]!==we||t[64]!==w||t[65]!==re||t[66]!==I||t[67]!==ne||t[68]!==te||t[69]!==le||t[70]!==N||t[71]!==b||t[72]!==S||t[73]!==x||t[74]!==Ee||t[75]!==Me||t[76]!==A||t[77]!==T||t[78]!==L||t[79]!==ee||t[80]!==F?(Ne=(0,V.jsx)(Ep,{onPaneClick:ie,onPaneMouseEnter:ae,onPaneMouseMove:z,onPaneMouseLeave:oe,onPaneContextMenu:ce,onPaneScroll:se,paneDragThreshold:le,deleteKeyCode:E,selectionKeyCode:b,selectionOnDrag:x,selectionMode:S,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:C,panActivationKeyCode:w,zoomActivationKeyCode:T,elementsSelectable:O,zoomOnScroll:F,zoomOnPinch:ee,zoomOnDoubleClick:L,panOnScroll:I,panOnScrollSpeed:te,panOnScrollMode:ne,panOnDrag:re,autoPanOnSelection:R,defaultViewport:k,translateExtent:A,minZoom:j,maxZoom:M,onSelectionContextMenu:p,preventScrolling:N,noDragClassName:_e,noWheelClassName:ve,noPanClassName:ye,disableKeyboardA11y:be,onViewportChange:we,isControlledViewport:Ee,children:Me}),t[43]=R,t[44]=k,t[45]=E,t[46]=be,t[47]=O,t[48]=M,t[49]=j,t[50]=C,t[51]=_e,t[52]=ye,t[53]=ve,t[54]=ie,t[55]=ce,t[56]=ae,t[57]=oe,t[58]=z,t[59]=se,t[60]=p,t[61]=h,t[62]=m,t[63]=we,t[64]=w,t[65]=re,t[66]=I,t[67]=ne,t[68]=te,t[69]=le,t[70]=N,t[71]=b,t[72]=S,t[73]=x,t[74]=Ee,t[75]=Me,t[76]=A,t[77]=T,t[78]=L,t[79]=ee,t[80]=F,t[81]=Ne):Ne=t[81],Ne}Wm.displayName=`GraphView`;var Gm=(0,v.memo)(Wm);function Km(e){"@babel/helpers - typeof";return Km=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Km(e)}function qm(e,t){if(Km(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(Km(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Jm(e){var t=qm(e,`string`);return Km(t)==`symbol`?t:t+``}function Ym(e,t,n){return(t=Jm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xm(e){return e?`${e.nodeId}-${e.id}-${e.type}`:``}function Zm(e,t){return e===t||e&&t&&e.nodeId===t.nodeId&&e.id===t.id&&e.type===t.type}var Qm=class{constructor(){Ym(this,`nodeListeners`,new Map),Ym(this,`edgeListeners`,new Map),Ym(this,`handleListeners`,new Map)}subscribeToNode(e,t){return this.subscribe(this.nodeListeners,e,t)}subscribeToNodes(e,t){let n=Array.from(new Set(e),e=>this.subscribeToNode(e,t));return()=>n.forEach(e=>e())}publishNodes(e){this.notify(this.nodeListeners,e)}subscribeToEdge(e,t){return this.subscribe(this.edgeListeners,e,t)}subscribeToEdges(e,t){let n=Array.from(new Set(e),e=>this.subscribeToEdge(e,t));return()=>n.forEach(e=>e())}publishEdges(e){this.notify(this.edgeListeners,e)}subscribeToConnectionForHandle(e,t){return this.subscribe(this.handleListeners,Xm(e),t)}publishConnectionClickStart(){this.notifyAll(this.handleListeners)}publishConnection(e,t){let n=new Set;Zm(e.fromHandle,t.fromHandle)?(n.add(Xm(e.fromHandle)),n.add(Xm(e.toHandle)),n.add(Xm(t.fromHandle)),n.add(Xm(t.toHandle)),n.delete(Xm(null)),this.notify(this.handleListeners,n)):this.notifyAll(this.handleListeners)}reset(){this.notifyAll(this.nodeListeners),this.notifyAll(this.edgeListeners),this.notifyAll(this.handleListeners)}subscribe(e,t,n){let r=e.get(t);return r||(r=new Set,e.set(t,r)),r.add(n),()=>{r.delete(n),r.size===0&&e.delete(t)}}notify(e,t){for(let n of t){let t=e.get(n);if(t)for(let e of t)e()}}notifyAll(e){for(let t of e.values())for(let e of t)e()}},$m=Cc(`React Flow`,`https://reactflow.dev/`),eh=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??Bs;Wl(h,g,_);let{nodesInitialized:x}=jl(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=Ac(nc(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??`5%`);S=[e,t,n]}return{optionsStore:{rfId:`1`,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:Bs,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,connectionMode:Us.Strict,domNode:null,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:$m,isValidConnection:void 0,onSelectionChangeHandlers:[],debug:!1,ariaLabelConfig:Hs,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,pubSub:new Qm,defaultEdgeOptions:void 0,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0},viewportStore:{paneDragging:!1,width:i??0,height:a??0,transform:S},connectionStore:{connection:{...Ks},connectionClickStartHandle:null},nodesStore:{nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m},edgesStore:{edges:_,edgeLookup:g,connectionLookup:h},selectionStore:{userSelectionRect:null}}},th=e=>{let t=eh(e),n=sd(()=>t.viewportStore),r=sd(()=>t.connectionStore),i=sd(()=>t.nodesStore),a=sd(()=>t.edgesStore),o=sd(()=>t.selectionStore),s=Ks;function c(e){return s.inProgress?{...s,to:Tc(s.to,e)}:s}function l(e){let{connection:t}=r.getState();s=e;let i=c(n.getState().transform);r.setState({connection:i}),u.getState().pubSub.publishConnection(t,i)}n.subscribe(({transform:e},t)=>{e!==t.transform&&s.inProgress&&r.setState({connection:c(e)})});let u=sd((e,c)=>{let u=0;async function d(){let{nodeLookup:t}=i.getState(),{panZoom:r,fitViewOptions:a,fitViewResolver:o,minZoom:s,maxZoom:l}=c(),{width:d,height:f}=n.getState();if(!r)return;let p=++u,m=await ac({nodes:t,width:d,height:f,panZoom:r,minZoom:s,maxZoom:l},a);p===u&&(o?.resolve(m),c().fitViewResolver===o&&e({fitViewResolver:null}))}return{...t.optionsStore,setNodes:t=>{let{nodeLookup:n,parentLookup:r}=i.getState(),{nodeOrigin:a,nodeExtent:o,elevateNodesOnSelect:s,fitViewQueued:l,zIndexMode:u,nodesSelectionActive:f,pubSub:p}=c(),{nodesInitialized:m,hasSelectedNodes:h,updatedNodes:g}=jl(t,n,r,{nodeOrigin:a,nodeExtent:o,elevateNodesOnSelect:s,checkEquality:!0,zIndexMode:u}),_=f&&h;l&&m?(d(),e({fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:_})):f!==_&&e({nodesSelectionActive:_}),i.setState({nodes:t,nodesInitialized:m}),p.publishNodes(g)},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=a.getState(),{updatedEdges:r}=Wl(t,n,e);a.setState({edges:e}),c().pubSub.publishEdges(r)},setDefaultNodesAndEdges:(t,n)=>{if(t){let{setNodes:n}=c();n(t),e({hasDefaultNodes:!0})}if(n){let{setEdges:t}=c();t(n),e({hasDefaultEdges:!0})}},updateNodeInternals:t=>{let{emitNodeChanges:n,domNode:r,nodeOrigin:a,nodeExtent:o,fitViewQueued:s,zIndexMode:l,pubSub:u}=c(),{nodeLookup:f,parentLookup:p}=i.getState(),{changes:m,updatedInternals:h,updatedNodes:g}=zl(t,f,p,r,a,o,l);h&&(s&&(d(),e({fitViewQueued:!1,fitViewOptions:void 0})),i.setState({}),u.publishNodes(g),n(m))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:a}=i.getState(),{emitNodeChanges:o,onNodesChangeMiddlewareMap:u}=c();for(let[i,o]of e){let e=a.get(i),c=!!(e?.expandParent&&e?.parentId&&o?.position),u={id:i,type:`position`,position:c?{x:Math.max(0,o.position.x),y:Math.max(0,o.position.y)}:o.position,dragging:t};if(e&&s.inProgress&&s.fromNode.id===e.id){let t=bl(e,s.fromHandle,Ys.Left,!0);l({...s,from:t})}c&&e.parentId&&n.push({id:i,parentId:e.parentId,rect:{...o.internals.positionAbsolute,width:o.measured.width??0,height:o.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e}=i.getState(),{nodeOrigin:t}=c(),o=Rl(n,a,e,t);r.push(...o)}for(let e of u.values())r=e(r);o(r)},emitNodeChanges:e=>{if(e.length===0)return;let{debug:t,onNodesChange:n,hasDefaultNodes:r}=c(),a=new rd(e);if(t&&console.log(`React Flow: queue node changes`,e),r){let{nodes:e}=i.getState(),{setNodes:t}=c();t(a.applyTo(e))}n?.(a)},emitEdgeChanges:e=>{if(e.length===0)return;let{debug:t,hasDefaultEdges:n,onEdgesChange:r}=c(),i=new id(e);if(t&&console.log(`React Flow: queue edge changes`,e),n){let{setEdges:e}=c(),{edges:t}=a.getState();e(i.applyTo(t))}r?.(i)},addSelectedNodes:e=>{let{multiSelectionActive:t,emitNodeChanges:n,emitEdgeChanges:r}=c(),{edgeLookup:o}=a.getState(),{nodeLookup:s}=i.getState();t?n(e.map(e=>Gu(e,!0))):(n(ad(s,new Set([...e]))),r(ad(o)))},addSelectedEdges:e=>{let{multiSelectionActive:t,emitNodeChanges:n,emitEdgeChanges:r}=c(),{edgeLookup:o}=a.getState(),{nodeLookup:s}=i.getState();t?r(e.map(e=>Gu(e,!0))):(r(ad(o,new Set([...e]))),n(ad(s,new Set)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n}=a.getState(),{nodes:r}=i.getState(),{emitNodeChanges:o,emitEdgeChanges:s}=c(),l=e||r,u=t||n,d=[];for(let e of l)e.selected&&d.push(Gu(e.id,!1));let f=[];for(let e of u)e.selected&&f.push(Gu(e.id,!1));o(d),s(f)},setMinZoom:t=>{let{panZoom:n,maxZoom:r}=c();n?.setScaleExtent([t,r]),e({minZoom:t})},setMaxZoom:t=>{let{panZoom:n,minZoom:r}=c();n?.setScaleExtent([r,t]),e({maxZoom:t})},setTranslateExtent:t=>{c().panZoom?.setTranslateExtent(t),e({translateExtent:t})},resetSelectedElements:()=>{let{edges:e}=a.getState(),{nodes:t}=i.getState(),{emitNodeChanges:n,emitEdgeChanges:r,elementsSelectable:o}=c();if(!o)return;let s=t.reduce((e,t)=>t.selected?[...e,Gu(t.id,!1)]:e,[]),l=e.reduce((e,t)=>t.selected?[...e,Gu(t.id,!1)]:e,[]);n(s),r(l)},setNodeExtent:t=>{let{nodes:n,nodeLookup:r,parentLookup:a}=i.getState(),{nodeOrigin:o,elevateNodesOnSelect:s,nodeExtent:l,zIndexMode:u,pubSub:d}=c();if(t[0][0]===l[0][0]&&t[0][1]===l[0][1]&&t[1][0]===l[1][0]&&t[1][1]===l[1][1])return;let{updatedNodes:f}=jl(n,r,a,{nodeOrigin:o,nodeExtent:t,elevateNodesOnSelect:s,checkEquality:!1,zIndexMode:u});e({nodeExtent:t}),i.setState({}),d.publishNodes(f)},panBy:e=>{let{transform:t,width:r,height:i}=n.getState(),{panZoom:a,translateExtent:o}=c();return Bl({delta:e,panZoom:a,transform:t,translateExtent:o,width:r,height:i})},setCenter:async(e,t,r)=>{let{width:i,height:a}=n.getState(),{maxZoom:o,panZoom:s}=c();if(!s)return!1;let l=r?.zoom===void 0?o:r.zoom;return s.setViewport({x:i/2-e*l,y:a/2-t*l,zoom:l},{duration:r?.duration,ease:r?.ease,interpolate:r?.interpolate})},cancelConnection:()=>l(Ks),updateConnection:e=>l(e),updateConnectionClickStart:e=>{r.setState({connectionClickStartHandle:e}),c().pubSub.publishConnectionClickStart()},reset:()=>{let t=eh();n.setState(t.viewportStore),s=Ks,r.setState(t.connectionStore),i.setState(t.nodesStore),a.setState(t.edgesStore),o.setState(t.selectionStore);let{pubSub:l}=c();e({...t.optionsStore,pubSub:l}),l.reset()}}});return{optionsStore:u,viewportStore:n,connectionStore:r,nodesStore:i,edgesStore:a,selectionStore:o}};function nh(e){let t=(0,H.c)(19),{initialNodes:n,initialEdges:r,defaultNodes:i,defaultEdges:a,initialWidth:o,initialHeight:s,initialMinZoom:c,initialMaxZoom:l,initialFitViewOptions:u,fitView:d,nodeOrigin:f,nodeExtent:p,zIndexMode:m,children:h}=e,g;t[0]!==a||t[1]!==i||t[2]!==r||t[3]!==d||t[4]!==u||t[5]!==s||t[6]!==l||t[7]!==c||t[8]!==p||t[9]!==f||t[10]!==n||t[11]!==o||t[12]!==m?(g=()=>th({nodes:n,edges:r,defaultNodes:i,defaultEdges:a,width:o,height:s,fitView:d,minZoom:c,maxZoom:l,fitViewOptions:u,nodeOrigin:f,nodeExtent:p,zIndexMode:m}),t[0]=a,t[1]=i,t[2]=r,t[3]=d,t[4]=u,t[5]=s,t[6]=l,t[7]=c,t[8]=p,t[9]=f,t[10]=n,t[11]=o,t[12]=m,t[13]=g):g=t[13];let[_]=(0,v.useState)(g),y;t[14]===h?y=t[15]:(y=(0,V.jsx)(_f,{children:(0,V.jsx)(np,{children:h})}),t[14]=h,t[15]=y);let b;return t[16]!==_||t[17]!==y?(b=(0,V.jsx)(gd,{value:_,children:y}),t[16]=_,t[17]=y,t[18]=b):b=t[18],b}function rh(e){let t=(0,H.c)(17),{children:n,nodes:r,edges:i,defaultNodes:a,defaultEdges:o,width:s,height:c,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:f,nodeOrigin:p,nodeExtent:m,zIndexMode:h}=e;if((0,v.useContext)(hd)){let e;return t[0]===n?e=t[1]:(e=(0,V.jsx)(V.Fragment,{children:n}),t[0]=n,t[1]=e),e}let g;return t[2]!==n||t[3]!==o||t[4]!==a||t[5]!==i||t[6]!==l||t[7]!==u||t[8]!==c||t[9]!==f||t[10]!==d||t[11]!==m||t[12]!==p||t[13]!==r||t[14]!==s||t[15]!==h?(g=(0,V.jsx)(nh,{initialNodes:r,initialEdges:i,defaultNodes:a,defaultEdges:o,initialWidth:s,initialHeight:c,fitView:l,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:f,nodeOrigin:p,nodeExtent:m,zIndexMode:h,children:n}),t[2]=n,t[3]=o,t[4]=a,t[5]=i,t[6]=l,t[7]=u,t[8]=c,t[9]=f,t[10]=d,t[11]=m,t[12]=p,t[13]=r,t[14]=s,t[15]=h,t[16]=g):g=t[16],g}var ih={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function ah(e,t){let n=(0,H.c)(294),r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,ee,I,te,ne,L,re,R,ie,ae,z,oe,se,ce,le,ue,B,de,fe,pe,me,he,ge,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7],u=n[8],d=n[9],f=n[10],p=n[11],m=n[12],h=n[13],g=n[14],_=n[15],v=n[16],y=n[17],b=n[18],x=n[19],S=n[20],C=n[21],w=n[22],T=n[23],E=n[24],D=n[25],O=n[26],k=n[27],A=n[28],j=n[29],M=n[30],N=n[31],P=n[32],F=n[33],ee=n[34],I=n[35],te=n[36],ne=n[37],L=n[38],re=n[39],R=n[40],ie=n[41],ae=n[42],z=n[43],oe=n[44],se=n[45],ce=n[46],le=n[47],ue=n[48],B=n[49],de=n[50],fe=n[51],pe=n[52],me=n[53],he=n[54],ge=n[55],_e=n[56],ve=n[57],ye=n[58],be=n[59],xe=n[60],Se=n[61],Ce=n[62],we=n[63],Te=n[64],Ee=n[65],De=n[66],Oe=n[67],ke=n[68],Ae=n[69],je=n[70],Me=n[71],Ne=n[72],Pe=n[73],Fe=n[74],Ie=n[75],Le=n[76],Re=n[77],ze=n[78],Be=n[79],Ve=n[80],He=n[81],Ue=n[82],We=n[83],Ge=n[84],Ke=n[85],qe=n[86],Je=n[87],Ye=n[88],Xe=n[89],Ze=n[90],Qe=n[91],$e=n[92],et=n[93],tt=n[94],rt=n[95],it=n[96],at=n[97],ot=n[98],st=n[99],ct=n[100],lt=n[101],ut=n[102],dt=n[103],ft=n[104],pt=n[105],mt=n[106],ht=n[107],gt=n[108],_t=n[109],vt=n[110],yt=n[111],bt=n[112],xt=n[113],St=n[114],Ct=n[115],wt=n[116],Tt=n[117],Et=n[118],Dt=n[119],Ot=n[120],kt=n[121],At=n[122],jt=n[123],Mt=n[124],Nt=n[125],Pt=n[126],Ft=n[127]):({nodes:F,edges:C,defaultNodes:x,defaultEdges:b,className:u,nodeTypes:P,edgeTypes:S,onNodeClick:ve,onEdgeClick:oe,onInit:me,onMove:he,onMoveStart:_e,onMoveEnd:ge,onConnect:R,onConnectStart:ae,onConnectEnd:ie,onClickConnectStart:re,onClickConnectEnd:L,onNodeMouseEnter:we,onNodeMouseMove:Ee,onNodeMouseLeave:Te,onNodeContextMenu:ye,onNodeDoubleClick:be,onNodeDragStart:Se,onNodeDrag:xe,onNodeDragStop:Ce,onNodesDelete:Oe,onEdgesDelete:fe,onDelete:z,onSelectionChange:ze,onSelectionDragStart:He,onSelectionDrag:Ve,onSelectionDragStop:Ue,onSelectionContextMenu:Be,onSelectionStart:Ge,onSelectionEnd:We,onBeforeDelete:ne,connectionMode:g,connectionLineType:$e,connectionLineStyle:h,connectionLineComponent:p,connectionLineContainerStyle:m,deleteKeyCode:dt,selectionKeyCode:St,selectionOnDrag:Ot,selectionMode:kt,panActivationKeyCode:At,multiSelectionKeyCode:jt,zoomActivationKeyCode:Mt,snapToGrid:Ze,snapGrid:Xe,onlyRenderVisibleElements:Nt,selectNodesOnDrag:Ye,nodesDraggable:I,autoPanOnNodeFocus:s,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:et,edgesFocusable:w,edgesReconnectable:T,elementsSelectable:tt,defaultViewport:rt,minZoom:it,maxZoom:at,translateExtent:ot,preventScrolling:st,nodeExtent:N,defaultMarkerColor:ct,zoomOnScroll:lt,zoomOnPinch:ut,panOnScroll:ft,panOnScrollSpeed:pt,panOnScrollMode:mt,zoomOnDoubleClick:ht,panOnDrag:gt,onPaneClick:ke,onPaneMouseEnter:je,onPaneMouseMove:Ne,onPaneMouseLeave:Me,onPaneScroll:Pe,onPaneContextMenu:Ae,paneDragThreshold:_t,children:l,onReconnect:Fe,onReconnectStart:Le,onReconnectEnd:Ie,onEdgeContextMenu:se,onEdgeDoubleClick:ce,onEdgeMouseEnter:le,onEdgeMouseMove:B,onEdgeMouseLeave:ue,reconnectRadius:vt,onNodesChange:De,onEdgesChange:de,noDragClassName:yt,noWheelClassName:bt,noPanClassName:xt,fitView:E,fitViewOptions:D,connectOnClick:d,attributionPosition:i,proOptions:qe,defaultEdgeOptions:y,elevateNodesOnSelect:Ct,elevateEdgesOnSelect:wt,disableKeyboardA11y:Tt,autoPanOnConnect:a,autoPanOnNodeDrag:o,autoPanOnSelection:Et,autoPanSpeed:c,connectionRadius:_,isValidConnection:j,onError:pe,style:Qe,id:A,nodeDragThreshold:M,connectionDragThreshold:f,viewport:Pt,onViewportChange:Ke,width:Ft,height:k,forceColorMode:O,debug:v,onScroll:Re,ariaLabelConfig:r,zIndexMode:Dt,...Je}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c,n[7]=l,n[8]=u,n[9]=d,n[10]=f,n[11]=p,n[12]=m,n[13]=h,n[14]=g,n[15]=_,n[16]=v,n[17]=y,n[18]=b,n[19]=x,n[20]=S,n[21]=C,n[22]=w,n[23]=T,n[24]=E,n[25]=D,n[26]=O,n[27]=k,n[28]=A,n[29]=j,n[30]=M,n[31]=N,n[32]=P,n[33]=F,n[34]=ee,n[35]=I,n[36]=te,n[37]=ne,n[38]=L,n[39]=re,n[40]=R,n[41]=ie,n[42]=ae,n[43]=z,n[44]=oe,n[45]=se,n[46]=ce,n[47]=le,n[48]=ue,n[49]=B,n[50]=de,n[51]=fe,n[52]=pe,n[53]=me,n[54]=he,n[55]=ge,n[56]=_e,n[57]=ve,n[58]=ye,n[59]=be,n[60]=xe,n[61]=Se,n[62]=Ce,n[63]=we,n[64]=Te,n[65]=Ee,n[66]=De,n[67]=Oe,n[68]=ke,n[69]=Ae,n[70]=je,n[71]=Me,n[72]=Ne,n[73]=Pe,n[74]=Fe,n[75]=Ie,n[76]=Le,n[77]=Re,n[78]=ze,n[79]=Be,n[80]=Ve,n[81]=He,n[82]=Ue,n[83]=We,n[84]=Ge,n[85]=Ke,n[86]=qe,n[87]=Je,n[88]=Ye,n[89]=Xe,n[90]=Ze,n[91]=Qe,n[92]=$e,n[93]=et,n[94]=tt,n[95]=rt,n[96]=it,n[97]=at,n[98]=ot,n[99]=st,n[100]=ct,n[101]=lt,n[102]=ut,n[103]=dt,n[104]=ft,n[105]=pt,n[106]=mt,n[107]=ht,n[108]=gt,n[109]=_t,n[110]=vt,n[111]=yt,n[112]=bt,n[113]=xt,n[114]=St,n[115]=Ct,n[116]=wt,n[117]=Tt,n[118]=Et,n[119]=Dt,n[120]=Ot,n[121]=kt,n[122]=At,n[123]=jt,n[124]=Mt,n[125]=Nt,n[126]=Pt,n[127]=Ft);let It=$e===void 0?qs.Bezier:$e,Lt=dt===void 0?`Backspace`:dt,Rt=St===void 0?`Shift`:St,zt=Ot!==void 0&&Ot,Bt=kt===void 0?Gs.Full:kt,Vt=At===void 0?`Space`:At,Ht=jt===void 0?jc()?`Meta`:`Control`:jt,Ut=Mt===void 0?jc()?`Meta`:`Control`:Mt,Wt=Nt!==void 0&&Nt,Gt=et===void 0?Jd:et,Kt=tt===void 0||tt,qt=rt===void 0?Yd:rt,Jt=it===void 0?.5:it,Yt=at===void 0?2:at,Xt=ot===void 0?Bs:ot,Zt=st===void 0||st,Qt=ct===void 0?`#b1b1b7`:ct,$t=lt===void 0||lt,en=ut===void 0||ut,tn=ft!==void 0&&ft,nn=pt===void 0?.5:pt,rn=mt===void 0?Ws.Free:mt,an=ht===void 0||ht,on=gt===void 0||gt,sn=_t===void 0?1:_t,cn=vt===void 0?10:vt,ln=yt===void 0?`nodrag`:yt,un=bt===void 0?`nowheel`:bt,dn=xt===void 0?`nopan`:xt,fn=Ct===void 0||Ct,pn=wt===void 0||wt,mn=Tt!==void 0&&Tt,hn=Et===void 0||Et,gn=Dt===void 0?`basic`:Dt,_n=A||`1`,vn;n[128]===Re?vn=n[129]:(vn=e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Re?.(e)},n[128]=Re,n[129]=vn);let yn=vn,bn;n[130]===Qe?bn=n[131]:(bn={...Qe,...ih},n[130]=Qe,n[131]=bn);let xn;n[132]!==u||n[133]!==O?(xn=nt([`react-flow`,O,u]),n[132]=u,n[133]=O,n[134]=xn):xn=n[134];let Sn;n[135]!==r||n[136]!==a||n[137]!==o||n[138]!==s||n[139]!==c||n[140]!==d||n[141]!==f||n[142]!==g||n[143]!==_||n[144]!==v||n[145]!==y||n[146]!==b||n[147]!==x||n[148]!==C||n[149]!==w||n[150]!==T||n[151]!==Kt||n[152]!==pn||n[153]!==fn||n[154]!==E||n[155]!==D||n[156]!==j||n[157]!==Yt||n[158]!==Jt||n[159]!==dn||n[160]!==M||n[161]!==N||n[162]!==Gt||n[163]!==F||n[164]!==ee||n[165]!==I||n[166]!==te||n[167]!==ne||n[168]!==L||n[169]!==re||n[170]!==R||n[171]!==ie||n[172]!==ae||n[173]!==z||n[174]!==de||n[175]!==fe||n[176]!==pe||n[177]!==he||n[178]!==ge||n[179]!==_e||n[180]!==xe||n[181]!==Se||n[182]!==Ce||n[183]!==De||n[184]!==Oe||n[185]!==Ve||n[186]!==He||n[187]!==Ue||n[188]!==_n||n[189]!==Ye||n[190]!==Xe||n[191]!==Ze||n[192]!==Xt||n[193]!==gn?(Sn=(0,V.jsx)(Qd,{nodes:F,edges:C,defaultNodes:x,defaultEdges:b,onConnect:R,onConnectStart:ae,onConnectEnd:ie,onClickConnectStart:re,onClickConnectEnd:L,nodesDraggable:I,autoPanOnNodeFocus:s,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:w,edgesReconnectable:T,elementsSelectable:Kt,elevateNodesOnSelect:fn,elevateEdgesOnSelect:pn,minZoom:Jt,maxZoom:Yt,nodeExtent:N,onNodesChange:De,onEdgesChange:de,snapToGrid:Ze,snapGrid:Xe,connectionMode:g,translateExtent:Xt,connectOnClick:d,defaultEdgeOptions:y,fitView:E,fitViewOptions:D,onNodesDelete:Oe,onEdgesDelete:fe,onDelete:z,onNodeDragStart:Se,onNodeDrag:xe,onNodeDragStop:Ce,onSelectionDrag:Ve,onSelectionDragStart:He,onSelectionDragStop:Ue,onMove:he,onMoveStart:_e,onMoveEnd:ge,noPanClassName:dn,nodeOrigin:Gt,rfId:_n,autoPanOnConnect:a,autoPanOnNodeDrag:o,autoPanSpeed:c,onError:pe,connectionRadius:_,isValidConnection:j,selectNodesOnDrag:Ye,nodeDragThreshold:M,connectionDragThreshold:f,onBeforeDelete:ne,debug:v,ariaLabelConfig:r,zIndexMode:gn}),n[135]=r,n[136]=a,n[137]=o,n[138]=s,n[139]=c,n[140]=d,n[141]=f,n[142]=g,n[143]=_,n[144]=v,n[145]=y,n[146]=b,n[147]=x,n[148]=C,n[149]=w,n[150]=T,n[151]=Kt,n[152]=pn,n[153]=fn,n[154]=E,n[155]=D,n[156]=j,n[157]=Yt,n[158]=Jt,n[159]=dn,n[160]=M,n[161]=N,n[162]=Gt,n[163]=F,n[164]=ee,n[165]=I,n[166]=te,n[167]=ne,n[168]=L,n[169]=re,n[170]=R,n[171]=ie,n[172]=ae,n[173]=z,n[174]=de,n[175]=fe,n[176]=pe,n[177]=he,n[178]=ge,n[179]=_e,n[180]=xe,n[181]=Se,n[182]=Ce,n[183]=De,n[184]=Oe,n[185]=Ve,n[186]=He,n[187]=Ue,n[188]=_n,n[189]=Ye,n[190]=Xe,n[191]=Ze,n[192]=Xt,n[193]=gn,n[194]=Sn):Sn=n[194];let Cn;n[195]!==hn||n[196]!==p||n[197]!==m||n[198]!==h||n[199]!==It||n[200]!==Qt||n[201]!==qt||n[202]!==Lt||n[203]!==mn||n[204]!==S||n[205]!==Yt||n[206]!==Jt||n[207]!==Ht||n[208]!==ln||n[209]!==dn||n[210]!==un||n[211]!==N||n[212]!==P||n[213]!==I||n[214]!==oe||n[215]!==se||n[216]!==ce||n[217]!==le||n[218]!==ue||n[219]!==B||n[220]!==me||n[221]!==ve||n[222]!==ye||n[223]!==be||n[224]!==we||n[225]!==Te||n[226]!==Ee||n[227]!==ke||n[228]!==Ae||n[229]!==je||n[230]!==Me||n[231]!==Ne||n[232]!==Pe||n[233]!==Fe||n[234]!==Ie||n[235]!==Le||n[236]!==Be||n[237]!==We||n[238]!==Ge||n[239]!==Ke||n[240]!==Wt||n[241]!==Vt||n[242]!==on||n[243]!==tn||n[244]!==rn||n[245]!==nn||n[246]!==sn||n[247]!==Zt||n[248]!==cn||n[249]!==_n||n[250]!==Rt||n[251]!==Bt||n[252]!==zt||n[253]!==Xt||n[254]!==Pt||n[255]!==Ut||n[256]!==an||n[257]!==en||n[258]!==$t?(Cn=(0,V.jsx)(Gm,{onInit:me,onNodeClick:ve,onEdgeClick:oe,onNodeMouseEnter:we,onNodeMouseMove:Ee,onNodeMouseLeave:Te,onNodeContextMenu:ye,onNodeDoubleClick:be,nodeTypes:P,edgeTypes:S,connectionLineType:It,connectionLineStyle:h,connectionLineComponent:p,connectionLineContainerStyle:m,selectionKeyCode:Rt,selectionOnDrag:zt,selectionMode:Bt,deleteKeyCode:Lt,multiSelectionKeyCode:Ht,panActivationKeyCode:Vt,zoomActivationKeyCode:Ut,onlyRenderVisibleElements:Wt,defaultViewport:qt,translateExtent:Xt,minZoom:Jt,maxZoom:Yt,preventScrolling:Zt,zoomOnScroll:$t,zoomOnPinch:en,zoomOnDoubleClick:an,panOnScroll:tn,panOnScrollSpeed:nn,panOnScrollMode:rn,panOnDrag:on,autoPanOnSelection:hn,onPaneClick:ke,onPaneMouseEnter:je,onPaneMouseMove:Ne,onPaneMouseLeave:Me,onPaneScroll:Pe,onPaneContextMenu:Ae,paneDragThreshold:sn,onSelectionContextMenu:Be,onSelectionStart:Ge,onSelectionEnd:We,onReconnect:Fe,onReconnectStart:Le,onReconnectEnd:Ie,onEdgeContextMenu:se,onEdgeDoubleClick:ce,onEdgeMouseEnter:le,onEdgeMouseMove:B,onEdgeMouseLeave:ue,reconnectRadius:cn,defaultMarkerColor:Qt,noDragClassName:ln,noWheelClassName:un,noPanClassName:dn,rfId:_n,disableKeyboardA11y:mn,nodeExtent:N,viewport:Pt,onViewportChange:Ke,nodesDraggable:I}),n[195]=hn,n[196]=p,n[197]=m,n[198]=h,n[199]=It,n[200]=Qt,n[201]=qt,n[202]=Lt,n[203]=mn,n[204]=S,n[205]=Yt,n[206]=Jt,n[207]=Ht,n[208]=ln,n[209]=dn,n[210]=un,n[211]=N,n[212]=P,n[213]=I,n[214]=oe,n[215]=se,n[216]=ce,n[217]=le,n[218]=ue,n[219]=B,n[220]=me,n[221]=ve,n[222]=ye,n[223]=be,n[224]=we,n[225]=Te,n[226]=Ee,n[227]=ke,n[228]=Ae,n[229]=je,n[230]=Me,n[231]=Ne,n[232]=Pe,n[233]=Fe,n[234]=Ie,n[235]=Le,n[236]=Be,n[237]=We,n[238]=Ge,n[239]=Ke,n[240]=Wt,n[241]=Vt,n[242]=on,n[243]=tn,n[244]=rn,n[245]=nn,n[246]=sn,n[247]=Zt,n[248]=cn,n[249]=_n,n[250]=Rt,n[251]=Bt,n[252]=zt,n[253]=Xt,n[254]=Pt,n[255]=Ut,n[256]=an,n[257]=en,n[258]=$t,n[259]=Cn):Cn=n[259];let wn;n[260]===ze?wn=n[261]:(wn=(0,V.jsx)(qd,{onSelectionChange:ze}),n[260]=ze,n[261]=wn);let Tn;n[262]!==i||n[263]!==qe?(Tn=(0,V.jsx)(zd,{proOptions:qe,position:i}),n[262]=i,n[263]=qe,n[264]=Tn):Tn=n[264];let En;n[265]!==mn||n[266]!==_n?(En=(0,V.jsx)(Fd,{rfId:_n,disableKeyboardA11y:mn}),n[265]=mn,n[266]=_n,n[267]=En):En=n[267];let Dn;n[268]!==l||n[269]!==C||n[270]!==E||n[271]!==D||n[272]!==k||n[273]!==Yt||n[274]!==Jt||n[275]!==N||n[276]!==Gt||n[277]!==F||n[278]!==Sn||n[279]!==Cn||n[280]!==wn||n[281]!==Tn||n[282]!==En||n[283]!==Ft||n[284]!==gn?(Dn=(0,V.jsxs)(rh,{nodes:F,edges:C,width:Ft,height:k,fitView:E,fitViewOptions:D,minZoom:Jt,maxZoom:Yt,nodeOrigin:Gt,nodeExtent:N,zIndexMode:gn,children:[Sn,Cn,wn,l,Tn,En]}),n[268]=l,n[269]=C,n[270]=E,n[271]=D,n[272]=k,n[273]=Yt,n[274]=Jt,n[275]=N,n[276]=Gt,n[277]=F,n[278]=Sn,n[279]=Cn,n[280]=wn,n[281]=Tn,n[282]=En,n[283]=Ft,n[284]=gn,n[285]=Dn):Dn=n[285];let On;return n[286]!==A||n[287]!==t||n[288]!==Je||n[289]!==bn||n[290]!==xn||n[291]!==Dn||n[292]!==yn?(On=(0,V.jsx)(`div`,{"data-testid":`rf__wrapper`,...Je,onScroll:yn,style:bn,ref:t,className:xn,id:A,role:`application`,children:Dn}),n[286]=A,n[287]=t,n[288]=Je,n[289]=bn,n[290]=xn,n[291]=Dn,n[292]=yn,n[293]=On):On=n[293],On}var oh=df(ah);function sh(e){let t=(0,H.c)(3),[n,r]=(0,v.useState)(e),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=e=>r(t=>e.applyTo(t)),t[0]=i):i=t[0];let a=i,o;return t[1]===n?o=t[2]:(o=[n,r,a],t[1]=n,t[2]=o),o}zs.error014();function ch(e){let t=(0,H.c)(7),{dimensions:n,lineWidth:r,variant:i,className:a}=e,o=`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,s;t[0]!==a||t[1]!==i?(s=nt([`react-flow__background-pattern`,i,a]),t[0]=a,t[1]=i,t[2]=s):s=t[2];let c;return t[3]!==r||t[4]!==o||t[5]!==s?(c=(0,V.jsx)(`path`,{strokeWidth:r,d:o,className:s}),t[3]=r,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function lh(e){let t=(0,H.c)(5),{radius:n,className:r}=e,i;t[0]===r?i=t[1]:(i=nt([`react-flow__background-pattern`,`dots`,r]),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,V.jsx)(`circle`,{cx:n,cy:n,r:n,className:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}var uh=function(e){return e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`,e}({}),dh={dots:1,lines:1,cross:6};function fh(e){let t=(0,H.c)(42),{id:n,variant:r,gap:i,size:a,lineWidth:o,offset:s,color:c,bgColor:l,style:u,className:d,patternClassName:f}=e,p=r===void 0?`dots`:r,m=i===void 0?20:i,h=o===void 0?1:o,g=s===void 0?0:s,_=(0,v.useRef)(null),y=`pattern-${xd(mh)}`,b=Cd(ph),x=a||dh[p],S=p===`dots`,C=p===`cross`,w;t[0]===m?w=t[1]:(w=Array.isArray(m)?m:[m,m],t[0]=m,t[1]=w);let T=w,E=T[0]*b[2]||1,D=T[1]*b[2]||1,O;t[2]!==E||t[3]!==D?(O=[E,D],t[2]=E,t[3]=D,t[4]=O):O=t[4];let k=O,A=x*b[2],j;t[5]===g?j=t[6]:(j=Array.isArray(g)?g:[g,g],t[5]=g,t[6]=j);let M=j,N;t[7]!==C||t[8]!==k||t[9]!==A?(N=C?[A,A]:k,t[7]=C,t[8]=k,t[9]=A,t[10]=N):N=t[10];let P=N,F=M[0]*b[2]+P[0]/2,ee=M[1]*b[2]+P[1]/2,I;t[11]!==F||t[12]!==ee?(I=[F,ee],t[11]=F,t[12]=ee,t[13]=I):I=t[13];let te=I,ne=`${y}${n||``}`,L;t[14]===d?L=t[15]:(L=nt([`react-flow__background`,d]),t[14]=d,t[15]=L);let re;t[16]!==l||t[17]!==c||t[18]!==u?(re={...u,...Mf,"--xy-background-color-props":l,"--xy-background-pattern-color-props":c},t[16]=l,t[17]=c,t[18]=u,t[19]=re):re=t[19];let R=re,ie=b[0]%k[0],ae=b[1]%k[1],z=`translate(-${te[0]},-${te[1]})`,oe;t[20]!==S||t[21]!==h||t[22]!==f||t[23]!==P||t[24]!==A||t[25]!==p?(oe=S?(0,V.jsx)(lh,{radius:A/2,className:f}):(0,V.jsx)(ch,{dimensions:P,lineWidth:h,variant:p,className:f}),t[20]=S,t[21]=h,t[22]=f,t[23]=P,t[24]=A,t[25]=p,t[26]=oe):oe=t[26];let se;t[27]!==ne||t[28]!==k[0]||t[29]!==k[1]||t[30]!==ie||t[31]!==ae||t[32]!==z||t[33]!==oe?(se=(0,V.jsx)(`pattern`,{id:ne,x:ie,y:ae,width:k[0],height:k[1],patternUnits:`userSpaceOnUse`,patternTransform:z,children:oe}),t[27]=ne,t[28]=k[0],t[29]=k[1],t[30]=ie,t[31]=ae,t[32]=z,t[33]=oe,t[34]=se):se=t[34];let ce=`url(#${ne})`,le;t[35]===ce?le=t[36]:(le=(0,V.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:ce}),t[35]=ce,t[36]=le);let ue;return t[37]!==L||t[38]!==R||t[39]!==se||t[40]!==le?(ue=(0,V.jsxs)(`svg`,{className:L,style:R,ref:_,"data-testid":`rf__background`,children:[se,le]}),t[37]=L,t[38]=R,t[39]=se,t[40]=le,t[41]=ue):ue=t[41],ue}function ph(e){return e.transform}function mh(e){return e.rfId}fh.displayName=`Background`;var hh=(0,v.memo)(fh);function gh(){let e=(0,H.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,V.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})}),e[0]=t):t=e[0],t}function _h(){let e=(0,H.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,V.jsx)(`path`,{d:`M0 0h32v4.2H0z`})}),e[0]=t):t=e[0],t}function vh(){let e=(0,H.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,V.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})}),e[0]=t):t=e[0],t}function yh(){let e=(0,H.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,V.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})}),e[0]=t):t=e[0],t}function bh(){let e=(0,H.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,V.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})}),e[0]=t):t=e[0],t}function xh(e){let t=(0,H.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=nt([`react-flow__controls-button`,r]),t[4]=r,t[5]=a);let o;return t[6]!==n||t[7]!==i||t[8]!==a?(o=(0,V.jsx)(`button`,{type:`button`,className:a,...i,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function Sh(e){let t=(0,H.c)(46),{style:n,showZoom:r,showFitView:i,showInteractive:a,fitViewOptions:o,onZoomIn:s,onZoomOut:c,onFitView:l,onInteractiveChange:u,className:d,children:f,position:p,orientation:m,"aria-label":h}=e,g=r===void 0||r,_=i===void 0||i,v=a===void 0||a,y=p===void 0?`bottom-left`:p,b=m===void 0?`vertical`:m,{optionsStore:x}=Sd(),S=xd(Oh),C=xd(Dh),w=xd(Eh),T=xd(Th),E=xd(wh),D=xd(Ch),O=S||C||w,k;t[0]===T?k=t[1]:(k=e=>e.transform[2]<=T,t[0]=T,t[1]=k);let A=Cd(k),j;t[2]===E?j=t[3]:(j=e=>e.transform[2]>=E,t[2]=E,t[3]=j);let M=Cd(j),{zoomIn:N,zoomOut:P,fitView:F}=bf(),ee;t[4]!==s||t[5]!==N?(ee=()=>{N(),s?.()},t[4]=s,t[5]=N,t[6]=ee):ee=t[6];let I=ee,te;t[7]!==c||t[8]!==P?(te=()=>{P(),c?.()},t[7]=c,t[8]=P,t[9]=te):te=t[9];let ne=te,L;t[10]!==F||t[11]!==o||t[12]!==l?(L=()=>{F(o),l?.()},t[10]=F,t[11]=o,t[12]=l,t[13]=L):L=t[13];let re=L,R;t[14]!==O||t[15]!==u||t[16]!==x?(R=()=>{x.setState({nodesDraggable:!O,nodesConnectable:!O,elementsSelectable:!O}),u?.(!O)},t[14]=O,t[15]=u,t[16]=x,t[17]=R):R=t[17];let ie=R,ae=b===`horizontal`?`horizontal`:`vertical`,z;t[18]!==d||t[19]!==ae?(z=nt([`react-flow__controls`,ae,d]),t[18]=d,t[19]=ae,t[20]=z):z=t[20];let oe=h??D[`controls.ariaLabel`],se;t[21]!==D||t[22]!==M||t[23]!==A||t[24]!==I||t[25]!==ne||t[26]!==g?(se=g&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(xh,{onClick:I,className:`react-flow__controls-zoomin`,title:D[`controls.zoomIn.ariaLabel`],"aria-label":D[`controls.zoomIn.ariaLabel`],disabled:M,children:(0,V.jsx)(gh,{})}),(0,V.jsx)(xh,{onClick:ne,className:`react-flow__controls-zoomout`,title:D[`controls.zoomOut.ariaLabel`],"aria-label":D[`controls.zoomOut.ariaLabel`],disabled:A,children:(0,V.jsx)(_h,{})})]}),t[21]=D,t[22]=M,t[23]=A,t[24]=I,t[25]=ne,t[26]=g,t[27]=se):se=t[27];let ce;t[28]!==D||t[29]!==re||t[30]!==_?(ce=_&&(0,V.jsx)(xh,{className:`react-flow__controls-fitview`,onClick:re,title:D[`controls.fitView.ariaLabel`],"aria-label":D[`controls.fitView.ariaLabel`],children:(0,V.jsx)(vh,{})}),t[28]=D,t[29]=re,t[30]=_,t[31]=ce):ce=t[31];let le;t[32]!==D||t[33]!==O||t[34]!==ie||t[35]!==v?(le=v&&(0,V.jsx)(xh,{className:`react-flow__controls-interactive`,onClick:ie,title:D[`controls.interactive.ariaLabel`],"aria-label":D[`controls.interactive.ariaLabel`],children:(0,V.jsx)(O?bh:yh,{})}),t[32]=D,t[33]=O,t[34]=ie,t[35]=v,t[36]=le):le=t[36];let ue;return t[37]!==f||t[38]!==y||t[39]!==n||t[40]!==z||t[41]!==oe||t[42]!==se||t[43]!==ce||t[44]!==le?(ue=(0,V.jsxs)(Ld,{className:z,position:y,style:n,"data-testid":`rf__controls`,"aria-label":oe,children:[se,ce,le,f]}),t[37]=f,t[38]=y,t[39]=n,t[40]=z,t[41]=oe,t[42]=se,t[43]=ce,t[44]=le,t[45]=ue):ue=t[45],ue}function Ch(e){return e.ariaLabelConfig}function wh(e){return e.maxZoom}function Th(e){return e.minZoom}function Eh(e){return e.elementsSelectable}function Dh(e){return e.nodesConnectable}function Oh(e){return e.nodesDraggable}Sh.displayName=`Controls`;var kh=(0,v.memo)(Sh);function Ah(e){let t=(0,H.c)(22),{id:n,x:r,y:i,width:a,height:o,style:s,color:c,strokeColor:l,strokeWidth:u,className:d,borderRadius:f,shapeRendering:p,selected:m,onClick:h}=e,g;t[0]===s?g=t[1]:(g=s||{},t[0]=s,t[1]=g);let{background:_,backgroundColor:v}=g,y=c||_||v,b;t[2]!==d||t[3]!==m?(b=nt([`react-flow__minimap-node`,{selected:m},d]),t[2]=d,t[3]=m,t[4]=b):b=t[4];let x;t[5]!==y||t[6]!==l||t[7]!==u?(x={fill:y,stroke:l,strokeWidth:u},t[5]=y,t[6]=l,t[7]=u,t[8]=x):x=t[8];let S;t[9]!==n||t[10]!==h?(S=h?e=>h(e,n):void 0,t[9]=n,t[10]=h,t[11]=S):S=t[11];let C;return t[12]!==f||t[13]!==o||t[14]!==p||t[15]!==b||t[16]!==x||t[17]!==S||t[18]!==a||t[19]!==r||t[20]!==i?(C=(0,V.jsx)(`rect`,{className:b,x:r,y:i,rx:f,ry:f,width:a,height:o,style:x,shapeRendering:p,onClick:S}),t[12]=f,t[13]=o,t[14]=p,t[15]=b,t[16]=x,t[17]=S,t[18]=a,t[19]=r,t[20]=i,t[21]=C):C=t[21],C}var jh=(0,v.memo)(Ah),Mh=e=>e.nodes.map(e=>e.id),Nh=e=>e instanceof Function?e:()=>e;function Ph(e){let t=(0,H.c)(25),{nodeStrokeColor:n,nodeColor:r,nodeClassName:i,nodeBorderRadius:a,nodeStrokeWidth:o,nodeComponent:s,onClick:c}=e,l=i===void 0?``:i,u=a===void 0?5:a,d=s===void 0?jh:s,f=Td(vd(Mh)),p;t[0]===r?p=t[1]:(p=Nh(r),t[0]=r,t[1]=p);let m=p,h;t[2]===n?h=t[3]:(h=Nh(n),t[2]=n,t[3]=h);let g=h,_;t[4]===l?_=t[5]:(_=Nh(l),t[4]=l,t[5]=_);let v=_,y=typeof window>`u`||`chrome`in window&&window.chrome?`crispEdges`:`geometricPrecision`,b;if(t[6]!==d||t[7]!==u||t[8]!==v||t[9]!==m||t[10]!==f||t[11]!==g||t[12]!==o||t[13]!==c){let e;t[15]!==d||t[16]!==u||t[17]!==v||t[18]!==m||t[19]!==g||t[20]!==o||t[21]!==c?(e=e=>(0,V.jsx)(Ih,{id:e,nodeColorFunc:m,nodeStrokeColorFunc:g,nodeClassNameFunc:v,nodeBorderRadius:u,nodeStrokeWidth:o,NodeComponent:d,onClick:c,shapeRendering:y},e),t[15]=d,t[16]=u,t[17]=v,t[18]=m,t[19]=g,t[20]=o,t[21]=c,t[22]=e):e=t[22],b=f.map(e),t[6]=d,t[7]=u,t[8]=v,t[9]=m,t[10]=f,t[11]=g,t[12]=o,t[13]=c,t[14]=b}else b=t[14];let x;return t[23]===b?x=t[24]:(x=(0,V.jsx)(V.Fragment,{children:b}),t[23]=b,t[24]=x),x}function Fh(e){let t=(0,H.c)(27),{id:n,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:a,nodeBorderRadius:o,nodeStrokeWidth:s,shapeRendering:c,NodeComponent:l,onClick:u}=e,d=Ap(n);if(!d||d.hidden)return null;let f;t[0]===d?f=t[1]:(f=Nc(d),t[0]=d,t[1]=f);let{width:p,height:m}=f;if(p===0||m===0)return null;let h=d.internals.userNode,{x:g,y:_}=d.internals.positionAbsolute,v=h.style,y=!!h.selected,b;t[2]!==h||t[3]!==a?(b=a(h),t[2]=h,t[3]=a,t[4]=b):b=t[4];let x;t[5]!==h||t[6]!==r?(x=r(h),t[5]=h,t[6]=r,t[7]=x):x=t[7];let S;t[8]!==h||t[9]!==i?(S=i(h),t[8]=h,t[9]=i,t[10]=S):S=t[10];let C;return t[11]!==l||t[12]!==m||t[13]!==h.id||t[14]!==h.style||t[15]!==o||t[16]!==s||t[17]!==u||t[18]!==c||t[19]!==y||t[20]!==b||t[21]!==x||t[22]!==S||t[23]!==p||t[24]!==g||t[25]!==_?(C=(0,V.jsx)(l,{x:g,y:_,width:p,height:m,style:v,selected:y,className:b,color:x,borderRadius:o,strokeColor:S,strokeWidth:s,shapeRendering:c,onClick:u,id:h.id}),t[11]=l,t[12]=m,t[13]=h.id,t[14]=h.style,t[15]=o,t[16]=s,t[17]=u,t[18]=c,t[19]=y,t[20]=b,t[21]=x,t[22]=S,t[23]=p,t[24]=g,t[25]=_,t[26]=C):C=t[26],C}var Ih=(0,v.memo)(Fh),Lh=(0,v.memo)(Ph),Rh=e=>!e.hidden,zh=({transform:e,width:t,height:n})=>({transform:e,width:t,height:n}),Bh=(e,t)=>{let n={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]},r=!1;for(let t of e.nodeLookup.values())if(!t.hidden){r=!0;break}return{viewBB:n,boundingRect:r?vc(nc(e.nodeLookup,{filter:Rh}),n):n,flowWidth:t.width,flowHeight:t.height}},Vh=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Hh=(e,t)=>Vh(e.viewBB,t.viewBB)&&Vh(e.boundingRect,t.boundingRect)&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight;function Uh(e){let t=(0,H.c)(64),{style:n,className:r,nodeStrokeColor:i,nodeColor:a,nodeClassName:o,nodeBorderRadius:s,nodeStrokeWidth:c,nodeComponent:l,bgColor:u,maskColor:d,maskStrokeColor:f,maskStrokeWidth:p,position:m,onClick:h,onNodeClick:g,pannable:_,zoomable:y,ariaLabel:b,inversePan:x,zoomStep:S,offsetScale:C}=e,w=o===void 0?``:o,T=s===void 0?5:s,E=m===void 0?`bottom-right`:m,D=_!==void 0&&_,O=y!==void 0&&y,k=S===void 0?1:S,A=C===void 0?5:C,{optionsStore:j,viewportStore:M,nodesStore:N}=Sd(),P=(0,v.useRef)(null),F=xd(qh),ee=xd(Kh),I=xd(Gh),te=xd(Wh),ne=Cd(vd(zh)),L;t[0]===ne?L=t[1]:(L=e=>Bh(e,ne),t[0]=ne,t[1]=L);let{viewBB:re,boundingRect:R,flowWidth:ie,flowHeight:ae}=Td(Od(L,Hh)),z=n?.width??200,oe=n?.height??150,se=R.width/z,ce=R.height/oe,le=Math.max(se,ce),ue=le*z,B=le*oe,de=A*le,fe=R.x-(ue-R.width)/2-de,pe=R.y-(B-R.height)/2-de,me=ue+de*2,he=B+de*2,ge=`react-flow__minimap-desc-${F}`,_e=(0,v.useRef)(),ve=(0,v.useRef)(le),ye,be;t[2]===le?(ye=t[3],be=t[4]):(be=()=>{ve.current=le},ye=[le],t[2]=le,t[3]=ye,t[4]=be),ff(be,ye);let xe;t[5]!==j||t[6]!==M?(xe=()=>{let e=j.getState().panZoom;if(P.current&&e)return _e.current=cu({domNode:P.current,panZoom:e,getTransform:()=>M.getState().transform,getViewScale:()=>ve.current}),()=>{_e.current?.destroy()}},t[5]=j,t[6]=M,t[7]=xe):xe=t[7];let Se;t[8]!==j||t[9]!==ee||t[10]!==M?(Se=[ee,j,M],t[8]=j,t[9]=ee,t[10]=M,t[11]=Se):Se=t[11],(0,v.useEffect)(xe,Se);let Ce,we;t[12]!==ae||t[13]!==ie||t[14]!==x||t[15]!==D||t[16]!==I||t[17]!==k||t[18]!==O?(Ce=()=>{_e.current?.update({translateExtent:I,width:ie,height:ae,inversePan:x,pannable:D,zoomStep:k,zoomable:O})},we=[D,O,x,k,I,ie,ae],t[12]=ae,t[13]=ie,t[14]=x,t[15]=D,t[16]=I,t[17]=k,t[18]=O,t[19]=Ce,t[20]=we):(Ce=t[19],we=t[20]),(0,v.useEffect)(Ce,we);let Te;t[21]===h?Te=t[22]:(Te=h?e=>{let[t,n]=_e.current?.pointer(e)||[0,0];h(e,{x:t,y:n})}:void 0,t[21]=h,t[22]=Te);let Ee=Te,De;t[23]!==N||t[24]!==g?(De=(e,t)=>{let n=N.getState().nodeLookup.get(t);n&&g&&g(e,n.internals.userNode)},t[23]=N,t[24]=g,t[25]=De):De=t[25];let Oe=g?De:void 0,ke=b??te[`minimap.ariaLabel`],Ae=typeof u==`string`?u:void 0,je=typeof d==`string`?d:void 0,Me=typeof f==`string`?f:void 0,Ne=typeof p==`number`?p*le:void 0,Pe=typeof a==`string`?a:void 0,Fe=typeof i==`string`?i:void 0,Ie=typeof c==`number`?c:void 0,Le;t[26]!==n||t[27]!==Ae||t[28]!==je||t[29]!==Me||t[30]!==Ne||t[31]!==Pe||t[32]!==Fe||t[33]!==Ie?(Le={...n,"--xy-minimap-background-color-props":Ae,"--xy-minimap-mask-background-color-props":je,"--xy-minimap-mask-stroke-color-props":Me,"--xy-minimap-mask-stroke-width-props":Ne,"--xy-minimap-node-background-color-props":Pe,"--xy-minimap-node-stroke-color-props":Fe,"--xy-minimap-node-stroke-width-props":Ie},t[26]=n,t[27]=Ae,t[28]=je,t[29]=Me,t[30]=Ne,t[31]=Pe,t[32]=Fe,t[33]=Ie,t[34]=Le):Le=t[34];let Re=Le,ze;t[35]===r?ze=t[36]:(ze=nt([`react-flow__minimap`,r]),t[35]=r,t[36]=ze);let Be=`${fe} ${pe} ${me} ${he}`,Ve;t[37]!==ke||t[38]!==ge?(Ve=ke&&(0,V.jsx)(`title`,{id:ge,children:ke}),t[37]=ke,t[38]=ge,t[39]=Ve):Ve=t[39];let He=g?Oe:void 0,Ue;t[40]!==T||t[41]!==w||t[42]!==a||t[43]!==l||t[44]!==i||t[45]!==c||t[46]!==He?(Ue=(0,V.jsx)(Lh,{onClick:He,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:T,nodeClassName:w,nodeStrokeWidth:c,nodeComponent:l}),t[40]=T,t[41]=w,t[42]=a,t[43]=l,t[44]=i,t[45]=c,t[46]=He,t[47]=Ue):Ue=t[47];let We=`M${fe-de},${pe-de}h${me+de*2}v${he+de*2}h${-me-de*2}z
15
+ M${re.x},${re.y}h${re.width}v${re.height}h${-re.width}z`,Ge;t[48]===We?Ge=t[49]:(Ge=(0,V.jsx)(`path`,{className:`react-flow__minimap-mask`,d:We,fillRule:`evenodd`,pointerEvents:`none`}),t[48]=We,t[49]=Ge);let Ke;t[50]!==oe||t[51]!==z||t[52]!==ge||t[53]!==Ee||t[54]!==Be||t[55]!==Ve||t[56]!==Ue||t[57]!==Ge?(Ke=(0,V.jsxs)(`svg`,{width:z,height:oe,viewBox:Be,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":ge,ref:P,onClick:Ee,children:[Ve,Ue,Ge]}),t[50]=oe,t[51]=z,t[52]=ge,t[53]=Ee,t[54]=Be,t[55]=Ve,t[56]=Ue,t[57]=Ge,t[58]=Ke):Ke=t[58];let qe;return t[59]!==E||t[60]!==Re||t[61]!==ze||t[62]!==Ke?(qe=(0,V.jsx)(Ld,{position:E,style:Re,className:ze,"data-testid":`rf__minimap`,children:Ke}),t[59]=E,t[60]=Re,t[61]=ze,t[62]=Ke,t[63]=qe):qe=t[63],qe}function Wh(e){return e.ariaLabelConfig}function Gh(e){return e.translateExtent}function Kh(e){return e.panZoom}function qh(e){return e.rfId}Uh.displayName=`MiniMap`,(0,v.memo)(Uh);var Jh={[Ou.Line]:`right`,[Ou.Handle]:`bottom-right`};function Yh(e){let t=(0,H.c)(37),{nodeId:n,position:r,variant:i,className:a,style:o,children:s,color:c,minWidth:l,minHeight:u,maxWidth:d,maxHeight:f,keepAspectRatio:p,resizeDirection:m,autoScale:h,shouldResize:g,onResizeStart:_,onResize:y,onResizeEnd:b}=e,x=i===void 0?Ou.Handle:i,S=o===void 0?void 0:o,C=l===void 0?10:l,w=u===void 0?10:u,T=d===void 0?Number.MAX_VALUE:d,E=f===void 0?Number.MAX_VALUE:f,D=p!==void 0&&p,O=h===void 0||h,k=ep(),A=typeof n==`string`?n:k,{optionsStore:j,viewportStore:M,nodesStore:N}=Sd(),P=(0,v.useRef)(null),F=x===Ou.Handle,ee;t[0]!==O||t[1]!==F?(ee=e=>F&&O?`${Math.max(1/e.transform[2],1)}`:void 0,t[0]=O,t[1]=F,t[2]=ee):ee=t[2];let I=Cd(ee),te=(0,v.useRef)(null),ne=r??Jh[x],L,re;t[3]!==ne||t[4]!==A||t[5]!==D||t[6]!==E||t[7]!==T||t[8]!==w||t[9]!==C||t[10]!==N||t[11]!==y||t[12]!==b||t[13]!==_||t[14]!==j||t[15]!==m||t[16]!==g||t[17]!==M?(L=()=>{if(P.current&&A)return te.current||=zu({domNode:P.current,nodeId:A,getStoreItems:()=>{let{nodeLookup:e}=N.getState(),{transform:t}=M.getState(),{snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=j.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{emitNodeChanges:n,nodeOrigin:r}=j.getState(),{nodeLookup:i,parentLookup:a}=N.getState(),o=[],s={x:e.x,y:e.y},c=i.get(A);if(c&&c.expandParent&&c.parentId){let t=c.origin??r,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=Rl([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...Fc({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,i,t)}}],i,a,r);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0&&o.push(Ku(A,s)),e.width!==void 0&&e.height!==void 0){let t={id:A,type:`dimensions`,resizing:!0,setAttributes:m?m===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:e=>{let{width:t,height:n}=e,r={id:A,type:`dimensions`,resizing:!1,dimensions:{width:t,height:n}};j.getState().emitNodeChanges([r])}}),te.current.update({controlPosition:ne,boundaries:{minWidth:C,minHeight:w,maxWidth:T,maxHeight:E},keepAspectRatio:D,resizeDirection:m,onResizeStart:_,onResize:y,onResizeEnd:b,shouldResize:g}),()=>{te.current?.destroy()}},re=[ne,C,w,T,E,D,_,y,b,g,A,m,j,N,M],t[3]=ne,t[4]=A,t[5]=D,t[6]=E,t[7]=T,t[8]=w,t[9]=C,t[10]=N,t[11]=y,t[12]=b,t[13]=_,t[14]=j,t[15]=m,t[16]=g,t[17]=M,t[18]=L,t[19]=re):(L=t[18],re=t[19]),(0,v.useEffect)(L,re);let R,ie;if(t[20]!==a||t[21]!==ne||t[22]!==F||t[23]!==x){let e=ne.split(`-`);R=F?`backgroundColor`:`borderColor`,ie=nt([`react-flow__resize-control`,`nodrag`,...e,x,a]),t[20]=a,t[21]=ne,t[22]=F,t[23]=x,t[24]=R,t[25]=ie}else R=t[24],ie=t[25];let ae;t[26]!==c||t[27]!==R?(ae=c&&{[R]:c},t[26]=c,t[27]=R,t[28]=ae):ae=t[28];let z;t[29]!==I||t[30]!==S||t[31]!==ae?(z={...S,scale:I,...ae},t[29]=I,t[30]=S,t[31]=ae,t[32]=z):z=t[32];let oe;return t[33]!==s||t[34]!==ie||t[35]!==z?(oe=(0,V.jsx)(`div`,{className:ie,ref:P,style:z,children:s}),t[33]=s,t[34]=ie,t[35]=z,t[36]=oe):oe=t[36],oe}(0,v.memo)(Yh);var Xh=/(\/\/[^\n]*|\/\*[\s\S]*?\*\/)|("(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*'|`(?:[^`\\]|\\.)*`)|\b(import|from|export|default|const|let|var|function|return|async|await|if|else|for|while|of|in|new|throw|try|catch|finally|interface|type|extends|typeof|true|false|null|undefined)\b|\b(\d+(?:\.\d+)?)\b/g;function Zh(e){let t=[],n=0,r=0;for(let i of e.matchAll(Xh)){let a=i.index??0;a>n&&t.push(e.slice(n,a));let o=i[1]?`c`:i[2]?`s`:i[3]?`k`:`n`;t.push((0,V.jsx)(`span`,{className:`tok-${o}`,children:i[0]},r++)),n=a+i[0].length}return t.push(e.slice(n)),t}function Qh({path:e,onSaved:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(`idle`),[c,l]=(0,v.useState)(null);(0,v.useEffect)(()=>{r(null),l(null),Ce.file(e).then(e=>{r(e.content),a(e.content)}).catch(e=>l(Me(e)))},[e]);let u=n!==null&&n!==i,d=(0,v.useCallback)(async()=>{if(n!==null){s(`saving`);try{let r=await Ce.saveFile(e,n);a(n),l(r.error),s(`done`),setTimeout(()=>s(`idle`),1500),t?.()}catch(e){l(Me(e)),s(`idle`)}}},[e,n,t]),f=(0,v.useMemo)(()=>Zh(n??``),[n]);return(0,V.jsxs)(`div`,{className:`stack`,children:[(0,V.jsxs)(`div`,{className:`editor-bar`,children:[(0,V.jsxs)(`span`,{className:`row small muted`,children:[(0,V.jsx)(`span`,{className:`mono`,children:e}),u?(0,V.jsx)(`span`,{className:`pill pill-wait`,children:`Not saved`}):null]}),(0,V.jsxs)(`span`,{className:`row`,children:[(0,V.jsx)(`span`,{className:`hint hide-sm`,children:`Ctrl S to save. Your own editor works too.`}),(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-secondary btn-sm`,disabled:!u||o===`saving`,onClick:()=>void d(),children:[o===`done`?(0,V.jsx)(E,{size:14,stroke:2}):(0,V.jsx)(j,{size:14,stroke:1.75}),o===`saving`?`Saving`:o===`done`?`Saved`:`Save`]})]})]}),c?(0,V.jsx)(`pre`,{className:`code fault`,children:c}):null,(0,V.jsx)(`div`,{className:`editor`,children:(0,V.jsxs)(`div`,{className:`editor-inner`,children:[(0,V.jsxs)(`pre`,{"aria-hidden":`true`,children:[f,`
16
+ `]}),(0,V.jsx)(`textarea`,{value:n??``,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-label":`Source of ${e}`,disabled:n===null,onChange:e=>r(e.target.value),onKeyDown:e=>{if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),d()),e.key===`Tab`&&!e.shiftKey){e.preventDefault();let t=e.currentTarget,{selectionStart:n,selectionEnd:i,value:a}=t;r(`${a.slice(0,n)} ${a.slice(i)}`),requestAnimationFrame(()=>t.setSelectionRange(n+2,n+2))}}})]})})]})}var $h=e=>Array.isArray(e.type)?e.type.find(e=>e!==`null`):e.type;function eg({schema:e,value:t,onChange:n}){let r=Object.entries(e.properties??{});if(!r.length)return(0,V.jsx)(`p`,{className:`note`,children:`This tool takes no input.`});let i=(e,r)=>{let i={...t};r===void 0||r===``?delete i[e]:i[e]=r,n(i)};return(0,V.jsx)(`div`,{className:`form`,children:r.map(([n,r])=>{let a=$h(r),o=e.required?.includes(n),s=t[n],c=`field-${n}`;return(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsxs)(`label`,{htmlFor:c,children:[n,o?null:(0,V.jsx)(`span`,{className:`optional`,children:`optional`})]}),r.enum?(0,V.jsxs)(`select`,{id:c,value:String(s??``),onChange:e=>i(n,e.target.value),children:[(0,V.jsx)(`option`,{value:``,children:`Choose`}),r.enum.map(e=>(0,V.jsx)(`option`,{value:String(e),children:String(e)},String(e)))]}):a===`boolean`?(0,V.jsxs)(`label`,{className:`check`,children:[(0,V.jsx)(`input`,{id:c,type:`checkbox`,checked:s===!0,onChange:e=>i(n,e.target.checked)}),`Yes`]}):a===`number`||a===`integer`?(0,V.jsx)(`input`,{id:c,type:`number`,value:s===void 0?``:String(s),onChange:e=>i(n,e.target.value===``?void 0:Number(e.target.value))}):a===`string`||a===void 0?(0,V.jsx)(`input`,{id:c,type:`text`,value:String(s??``),onChange:e=>i(n,e.target.value)}):(0,V.jsx)(`textarea`,{id:c,rows:3,className:`mono`,placeholder:a===`array`?`[ ]`:`{ }`,defaultValue:s===void 0?``:JSON.stringify(s,null,2),onBlur:e=>{try{i(n,e.target.value.trim()?JSON.parse(e.target.value):void 0),e.target.setCustomValidity(``)}catch{e.target.setCustomValidity(`This is not valid JSON.`),e.target.reportValidity()}}}),r.description?(0,V.jsx)(`p`,{className:`hint`,children:r.description}):null]},n)})})}var tg=Object.defineProperty,ng=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),rg=(e,t)=>{let n={};for(var r in e)tg(n,r,{get:e[r],enumerable:!0});return t&&tg(n,Symbol.toStringTag,{value:`Module`}),n},ig=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]);function ag(e){return typeof e==`string`&&ig.has(e.replace(/#$/,``))}function og(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 sg(e,t=`|`){return e.map(e=>Fg(e)).join(t)}function cg(e,t){return typeof t==`bigint`?t.toString():t}var lg=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function ug(e){return new lg(e)}function dg(e){return e==null}function fg(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function pg(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var mg=Symbol(`evaluating`);function hg(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==mg)return r===void 0&&(r=mg,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function gg(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function _g(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function vg(e){return _g(e._zod.def)??e._zod.def.shape}function yg(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return gg(this,t,e),e},enumerable:!0,configurable:!0})}function bg(e,t,n){t in e?gg(e,t,n):e[t]=n}function xg(e,t,n,r){let i=vg(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?yg(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):bg(e,a,r?r(n.value,a):n.value))}}function Sg(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?yg(e,n,()=>t[n]):bg(e,n,r.value))}}function Cg(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function wg(e){return JSON.stringify(e)}function Tg(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Eg=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Dg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Og=ug(()=>{if(E_.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function kg(e){if(Dg(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Dg(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Ag(e){return kg(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var jg=new Set([`string`,`number`,`symbol`]);function Mg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ng(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Pg(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 Fg(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ig(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Lg={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Rg={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function zg(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`);let i={};return xg(i,e,Bg(e,t)),Ng(e,Cg(n,{shape:i,checks:[]}))}function Bg(e,t){let n=vg(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Vg(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`);let i=new Set(Bg(e,t)),a={};return xg(a,e,Reflect.ownKeys(vg(e)).filter(e=>!i.has(e))),Ng(e,Cg(n,{shape:a,checks:[]}))}function Hg(e,t){if(!kg(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=vg(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ng(e,Cg(e._zod.def,{shape:Ug(e,t)}))}function Ug(e,t){let n={};return xg(n,e,Reflect.ownKeys(vg(e))),Sg(n,t),n}function Wg(e,t){if(!kg(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ng(e,Cg(e._zod.def,{shape:Ug(e,t)}))}function Gg(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return xg(n,e,Reflect.ownKeys(vg(e))),xg(n,t,Reflect.ownKeys(vg(t))),Ng(e,Cg(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Kg(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Bg(t,n)):void 0,o={};return xg(o,t,Reflect.ownKeys(vg(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Ng(t,Cg(t._zod.def,{shape:o,checks:[]}))}function qg(e,t,n){let r=n?new Set(Bg(t,n)):void 0,i={};return xg(i,t,Reflect.ownKeys(vg(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Ng(t,Cg(t._zod.def,{shape:i}))}function Jg(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 Yg(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Xg(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Zg(e){return typeof e==`string`?e:e?.message}function Qg(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function $g(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function e_(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Zg(e.inst?._zod.def?.error?.(e))??Zg(a?.(e))??Zg(t?.error?.(e))??Zg(n.customError?.(e))??Zg(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var t_=/[\uD800-\uDBFF]/;function n_(e){let t=e.length;if(!t_.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function r_(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function i_(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function a_(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function o_(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):u_(e,n,r.value)}}function s_(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function c_(e,t,n){return s_(e,t,n,!1)}function l_(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return s_(this,n,r(this))},set(e){s_(this,n,e)}})}return t}function u_(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:s_(this,t,n.bind(this))},set(e){s_(this,t,e)}})}function d_(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var f_,p_=!1,m_={configurable:!0,get(){p_=!0}};function h_(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&f_!==e._zod?f_=void 0:(f_=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,m_);let e=p_;p_=!1;try{let r=n(this);return p_?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),p_||=e,r}catch(n){throw delete this[t],p_||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function g_(e,t,n,r){let i=d_(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var __=`~constantCatch`;function v_(e){let t=()=>e;return t[__]=!0,t}var y_,b_=Object.freeze({status:`aborted`}),x_={value:void 0,enumerable:!1},S_=`captureStackTrace`in Error?Error:null;function C_(e){let t=S_;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return S_=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function U(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){x_.value=new a(r);try{Object.defineProperty(n,"_zod",x_)}finally{x_.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),o_(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?C_(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var w_=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},T_=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(y_=globalThis).__zod_globalConfig??(y_.__zod_globalConfig={});var E_=globalThis.__zod_globalConfig;function D_(e){return e&&Object.assign(E_,e),E_}function O_(){let e=this._zod;return e.message??=JSON.stringify(e.def,cg,2),e.message}function k_(e){this._zod.message=e}var A_={get:O_,set:k_,enumerable:!0,configurable:!0},j_={value:void 0,enumerable:!1},M_=new WeakSet([Object.prototype,Error.prototype]),N_=(e,t)=>{e.name=`$ZodError`,j_.value=t,Object.defineProperty(e,"issues",j_),j_.value=void 0,Object.defineProperty(e,"message",A_);let n=Object.getPrototypeOf(e);M_.has(n)||(M_.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},P_=U(`$ZodError`,N_),F_=U(`$ZodError`,N_,void 0,{Parent:Error});function I_(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function L_(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?I_(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function R_(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function z_(e,t){return{callee:t?.callee??e,Err:t?.Err}}var B_=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new w_;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>e_(e,o,D_())));throw Eg(n,a?.callee??t),n}return s.value};return t},V_=B_(F_),H_=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>e_(e,o,D_())));throw Eg(n,a?.callee??t),n}return s.value};return t},U_=H_(F_),W_=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 w_;return a.issues.length?K_(e,a.issues,i):{success:!0,data:a.value}},G_=W_(F_);function K_(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>e_(e,n,D_()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var q_=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?K_(e,a.issues,i):{success:!0,data:a.value}},J_=q_(F_),Y_=Symbol.for(`zod.compile.invalid`),X_=Symbol.for(`zod.compile.fallback`),Z_=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Y_)return!0;if(r.definite===!0&&n===void 0)return!1}return Q_(e,t,n)});function Q_(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[X_]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new w_;return a.issues.length===0}var $_=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ev=e=>{let t=B_(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,z_(n,a))};return n},tv=e=>{let t=B_(e),n=(e,r,i,a)=>t(e,r,i,z_(n,a));return n},nv=e=>{let t=H_(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,z_(n,a))};return n},rv=e=>{let t=H_(e),n=async(e,r,i,a)=>await t(e,r,i,z_(n,a));return n},iv=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return W_(e)(t,n,i)},av=e=>(t,n,r)=>W_(e)(t,n,r),ov=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return q_(e)(t,n,i)},sv=e=>async(t,n,r)=>q_(e)(t,n,r),cv=/^[cC][0-9a-z]{6,}$/,lv=/^[0-9a-z]+$/,uv=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,dv=/^[0-9a-vA-V]{20}$/,fv=/^[A-Za-z0-9]{27}$/,pv=/^[a-zA-Z0-9_-]{21}$/;function mv(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var hv=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gv=/^([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})$/,_v=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)$/,vv=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yv=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function bv(){return new RegExp(yv,`u`)}var xv=/^(?:(?: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])$/,Sv=/^(([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}|:))$/,Cv=/^((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])$/,wv=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Tv=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ev=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Dv=/^https?$/,Ov=/^\+[1-9]\d{6,14}$/,kv=`(?:(?:\\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])))`;function Av(e){return RegExp(`^${e}$`)}var jv=Av(kv);function Mv(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Nv(e){return RegExp(`^${Mv(e)}$`)}function Pv(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Mv({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Mv({precision:e.precision})}`:n;return RegExp(`^${kv}T(?:${r})$`)}var Fv=/^[\s\S]{0,}$/,Iv=/^-?\d+$/,Lv=/^-?\d+(?:\.\d+)?$/,Rv=/^(?:true|false)$/i,zv=/^null$/i,Bv=/^undefined$/i,Vv=/^[^A-Z]*$/,Hv=/^[^a-z]*$/,Uv=U(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Wv=e=>{let t=e.value;return!dg(t)&&t.length!==void 0},Gv={number:`number`,bigint:`bigint`,object:`date`},Kv=U(`$ZodCheckLessThan`,(e,t)=>{Uv.init(e,t);let n=Gv[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Gv[typeof r.value]??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})}}),qv=U(`$ZodCheckGreaterThan`,(e,t)=>{Uv.init(e,t);let n=Gv[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Gv[typeof r.value]??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})}}),Jv=U(`$ZodCheckMultipleOf`,(e,t)=>{Uv.init(e,t),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`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):pg(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})}}),Yv=U(`$ZodCheckNumberFormat`,(e,t)=>{Uv.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Lg[t.format];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})}}),Xv=U(`$ZodCheckMaxLength`,(e,t)=>{var n;Uv.init(e,t),(n=e._zod.def).when??(n.when=Wv),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?n_(r):i)<=t.maximum)return;let a=r_(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Zv=U(`$ZodCheckMinLength`,(e,t)=>{var n;Uv.init(e,t),(n=e._zod.def).when??(n.when=Wv),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?n_(r):i)>=t.minimum)return;let a=r_(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Qv=U(`$ZodCheckLengthEquals`,(e,t)=>{var n;Uv.init(e,t),(n=e._zod.def).when??(n.when=Wv),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?n_(r):i;if(a===t.length)return;let o=r_(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),$v=U(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Uv.init(e,t),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=()=>{})}),ey=U(`$ZodCheckRegex`,(e,t)=>{$v.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})}}),ty=U(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Vv,$v.init(e,t)}),ny=U(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Hv,$v.init(e,t)}),ry=U(`$ZodCheckIncludes`,(e,t)=>{Uv.init(e,t);let n=Mg(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),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})}}),iy=U(`$ZodCheckStartsWith`,(e,t)=>{Uv.init(e,t);let n=RegExp(`^${Mg(t.prefix)}.*`);t.pattern??=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})}}),ay=U(`$ZodCheckEndsWith`,(e,t)=>{Uv.init(e,t);let n=RegExp(`.*${Mg(t.suffix)}$`);t.pattern??=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})}});function oy(e,t,n){e.issues.length&&t.issues.push(...Xg(n,e.issues))}var sy=U(`$ZodCheckProperties`,(e,t)=>{Uv.init(e,t),c_(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>oy(t,r,e)))):oy(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),cy=U(`$ZodCheckOverwrite`,(e,t)=>{Uv.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),ly=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
17
+ `).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?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
18
+ `)}\n};`)(...Object.values(this.closed))}},uy={major:4,minor:6,patch:7},dy=U(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=uy;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Jg(t),a;for(let o of n){if(o._zod.def.when){if(Yg(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new w_;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&($g(t.issues,n,e),i||=Jg(t,n))});else{if(t.issues.length===n)continue;$g(t.issues,n,e),i||=Jg(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Jg(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new w_;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new w_;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return c_(this,`~standard`,my(this))},set"~standard"(e){s_(this,`~standard`,e)}}),fy=(e,t)=>e.issues.length?{issues:e.issues.map(e=>e_(e,t,D_()))}:{value:e.value};async function py(e,t){let n={async:!0};return fy(await e._zod.run({value:t,issues:[]},n),n)}function my(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return fy(r,n)}catch{}return py(e,t)},vendor:`zod`,version:1}}var hy=U(`$ZodString`,(e,t)=>{dy.init(e,t),e._zod.pattern=t.pattern??Fv,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}}),gy=U(`$ZodStringFormat`,(e,t)=>{$v.init(e,t),hy.init(e,t)}),_y=U(`$ZodGUID`,(e,t)=>{t.pattern??=gv,gy.init(e,t)}),vy=U(`$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??=_v(e)}else t.pattern??=_v();gy.init(e,t)}),yy=U(`$ZodEmail`,(e,t)=>{t.pattern??=vv,gy.init(e,t)});function by(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function xy(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?by(e)||2:Sy(e,t)}function Sy(e,t){if(!t.normalize&&t.protocol?.source===Dv.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Cy=/[\t\n\r]/g;function wy(e){return e.replace(Cy,``)}function Ty(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ey(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Dy=U(`$ZodURL`,(e,t)=>{gy.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=xy(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=wy(r);return}t.hostname&&!Ty(i,t.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&&!Ey(i,t.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:wy(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Oy=U(`$ZodEmoji`,(e,t)=>{t.pattern??=bv(),gy.init(e,t)}),ky=U(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?pv:mv(t.length),gy.init(e,t)}),Ay=U(`$ZodCUID`,(e,t)=>{t.pattern??=cv,gy.init(e,t)}),jy=U(`$ZodCUID2`,(e,t)=>{t.pattern??=lv,gy.init(e,t)}),My=U(`$ZodULID`,(e,t)=>{t.pattern??=uv,gy.init(e,t)}),Ny=U(`$ZodXID`,(e,t)=>{t.pattern??=dv,gy.init(e,t)}),Py=U(`$ZodKSUID`,(e,t)=>{t.pattern??=fv,gy.init(e,t)}),Fy=U(`$ZodISODateTime`,(e,t)=>{t.pattern??=Pv(t),gy.init(e,t)}),Iy=U(`$ZodISODate`,(e,t)=>{t.pattern??=jv,gy.init(e,t)}),Ly=U(`$ZodISOTime`,(e,t)=>{t.pattern??=Nv(t),gy.init(e,t)}),Ry=U(`$ZodISODuration`,(e,t)=>{t.pattern??=hv,gy.init(e,t)}),zy=U(`$ZodIPv4`,(e,t)=>{t.pattern??=xv,gy.init(e,t)}),By=/^[0-9a-fA-F:.]+$/;function Vy(e){return By.test(e)?by(`http://[${e}]`):!1}var Hy=U(`$ZodIPv6`,(e,t)=>{t.pattern??=Sv,gy.init(e,t),e._zod.check=n=>{Vy(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Uy=U(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Cv,gy.init(e,t)});function Wy(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Vy(n)}var Gy=U(`$ZodCIDRv6`,(e,t)=>{t.pattern??=wv,gy.init(e,t),e._zod.check=n=>{Wy(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Ky(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var qy=/^[0-9a-zA-Z+/]*={0,2}$/,Jy=U(`$ZodBase64`,(e,t)=>{t.pattern??=qy,gy.init(e,t),e._zod.check=n=>{Ky(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Yy=/^[A-Za-z0-9_-]*$/;function Xy(e){if(!Yy.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Ky(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Zy=U(`$ZodBase64URL`,(e,t)=>{t.pattern??=Yy,gy.init(e,t),e._zod.check=n=>{Xy(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Qy=U(`$ZodE164`,(e,t)=>{t.pattern??=Ov,gy.init(e,t)});function $y(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 eb=U(`$ZodJWT`,(e,t)=>{gy.init(e,t),e._zod.check=n=>{$y(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),tb=U(`$ZodNumber`,(e,t)=>{dy.init(e,t),e._zod.pattern=Lv,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:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),nb=U(`$ZodNumberFormat`,(e,t)=>{Yv.init(e,t),tb.init(e,t)}),rb=U(`$ZodBoolean`,(e,t)=>{dy.init(e,t),e._zod.pattern=Rv,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}}),ib=U(`$ZodUndefined`,(e,t)=>{dy.init(e,t),e._zod.pattern=Bv,e._zod.values=new Set([void 0]),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}}),ab=U(`$ZodNull`,(e,t)=>{dy.init(e,t),e._zod.pattern=zv,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}}),ob=U(`$ZodAny`,(e,t)=>{dy.init(e,t),e._zod.parse=e=>e}),sb=U(`$ZodUnknown`,(e,t)=>{dy.init(e,t),e._zod.parse=e=>e}),cb=U(`$ZodNever`,(e,t)=>{dy.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function lb(e,t){let n=Qg(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Qg(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,$g(n.issues,t,e),n}}return i(n,a)}}var ub=e=>Array.isArray(e)?e.length:-1;function db(e,t,n){e.issues.length&&t.issues.push(...Xg(n,e.issues)),t.value[n]=e.value}var fb=U(`$ZodArray`,(e,t)=>{dy.init(e,t);let n=E_.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>db(t,r,e)));else if(db(c,r,e),s&&c.issues.length!==0&&Jg(c))break}return o.length?Promise.all(o).then(()=>r):r},lb(e,ub)});function pb(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Xg(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var mb=[];function hb(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:mb,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Ig(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function gb(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Jg(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>pb(e,n,i,t,d,f))):pb(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var _b=U(`$ZodObject`,(e,t)=>{dy.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=ug(()=>hb(t));h_(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||gg(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Dg,o=t.catchall,s,c=E_.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Jg(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>pb(n,t,e,r,a,o))):pb(s,t,e,r,a,o)}return o?gb(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),vb=U(`$ZodObjectJIT`,(e,t)=>{_b.init(e,t);let n=e._zod.parse,r=ug(()=>hb(t)),i=E_.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new ly([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
19
+ let ${e}_ab = false;
20
+ for (let i = 0; i < ${e}.issues.length; i++) {
21
+ const iss = ${e}.issues[i];
22
+ iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
23
+ payload.issues.push(iss);
24
+ if (iss.continue !== true) ${e}_ab = true;
25
+ }
26
+ if (${e}_ab && ctx && ctx.abortEarly) {
27
+ payload.value = newResult;
28
+ return payload;
29
+ }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:wg(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
30
+ const ${n}_present = ${i};
31
+ if (!${n}.issues.length || ${n}_present) {
32
+ if (${n}.issues.length) {${c(n,r)}
33
+ }
34
+
35
+ if (${e}) {
36
+ newResult[${r}] = ${n}.value;
37
+ }
38
+ }
39
+
40
+ `)}else f?(o.write(`
41
+ if (${n}.issues.length) {${c(n,r)}
42
+ }
43
+ `),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
44
+ if (${n}.value !== undefined || ${i}) {
45
+ newResult[${r}] = ${n}.value;
46
+ }
47
+ `)):o.write(`
48
+ const ${n}_present = ${i};
49
+ if (${n}.issues.length) {${c(n,r)}
50
+ }
51
+ if (!${n}_present && !${n}.issues.length) {
52
+ payload.issues.push({
53
+ code: "invalid_type",
54
+ expected: "nonoptional",
55
+ input: undefined,
56
+ path: [${r}]
57
+ });
58
+ if (ctx && ctx.abortEarly) {
59
+ payload.value = newResult;
60
+ return payload;
61
+ }
62
+ }
63
+
64
+ if (${n}_present) {
65
+ newResult[${r}] = ${n}.value;
66
+ }
67
+
68
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Dg,c=!E_.jitless,l=c&&Og.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?gb([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function yb(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=>!Jg(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=>e_(e,r,D_())))}),t)}var bb=U(`$ZodUnion`,(e,t)=>{dy.init(e,t),h_(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),h_(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),h_(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),h_(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>fg(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>yb(t,r,e,i)):yb(o,r,e,i)}});function xb(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Sb=U(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,bb.init(e,t);let n=e._zod.parse;h_(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||gg(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=_g(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=ug(()=>xb(t));e._zod.parse=(i,a)=>{let o=i.value;if(!Dg(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Cb=U(`$ZodIntersection`,(e,t)=>{dy.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])=>Tb(e,t,n)):Tb(e,i,a)}});function wb(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(kg(e)&&kg(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=wb(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=wb(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 Tb(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=wb(t.value,n.value);if(!c.valid){if(Jg(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Eb=U(`$ZodRecord`,(e,t)=>{dy.init(e,t);let n=E_.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!kg(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>e_(e,i,D_())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Xg(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Xg(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Lv.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>e_(e,i,D_())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Xg(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Xg(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Db=U(`$ZodEnum`,(e,t)=>{dy.init(e,t);let n=og(t.entries),r=new Set(n);e._zod.values=r,h_(e,`pattern`,e=>{let t=og(e.def.entries).filter(e=>jg.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Mg(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),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}}),Ob=U(`$ZodLiteral`,(e,t)=>{dy.init(e,t);let n=new Set(t.values);e._zod.values=n,h_(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Mg(e):e?Mg(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),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}}),kb=U(`$ZodTransform`,(e,t)=>{dy.init(e,t),e._zod.optin=`optional`,E_.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new T_(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 w_;return n.value=i,n}});function Ab(e,t){return e.value=t.issues.length?void 0:t.value,e}var jb=U(`$ZodOptional`,(e,t)=>{dy.init(e,t),h_(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,h_(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),h_(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${fg(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Ab(e,t)):Ab(e,r)}return t.innerType._zod.run(e,n)}}),Mb=U(`$ZodExactOptional`,(e,t)=>{jb.init(e,t),h_(e,`values`,e=>e.def.innerType._zod.values),h_(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Nb=U(`$ZodNullable`,(e,t)=>{dy.init(e,t),h_(e,`optin`,e=>e.def.innerType._zod.optin),h_(e,`optout`,e=>e.def.innerType._zod.optout),h_(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${fg(t.source)}|null)$`):void 0}),h_(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Pb=U(`$ZodDefault`,(e,t)=>{dy.init(e,t),e._zod.optin=`defaulted`,h_(e,`values`,e=>e.def.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=>Fb(e,t)):Fb(r,t)}});function Fb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ib=U(`$ZodPrefault`,(e,t)=>{dy.init(e,t),e._zod.optin=`defaulted`,h_(e,`values`,e=>e.def.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))}),Lb=U(`$ZodNonOptional`,(e,t)=>{dy.init(e,t),h_(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].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=>Rb(t,e)):Rb(i,e)}});function Rb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function zb(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>e_(e,r,D_()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Bb=U(`$ZodCatch`,(e,t)=>{dy.init(e,t),h_(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),h_(e,`optout`,e=>e.def.innerType._zod.optout),h_(e,`values`,e=>e.def.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({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>zb(e,r,t,n)):zb(e,r,t,n)}}),Vb=U(`$ZodPipe`,(e,t)=>{dy.init(e,t),h_(e,`values`,e=>e.def.in._zod.values),h_(e,`optin`,e=>e.def.in._zod.optin),h_(e,`optout`,e=>e.def.out._zod.optout),h_(e,`propValues`,e=>e.def.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=>Hb(e,t.in,n)):Hb(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Hb(e,t.out,n)):Hb(r,t.out,n)}});function Hb(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Ub=U(`$ZodPreprocess`,(e,t)=>{Vb.init(e,t)}),Wb=U(`$ZodReadonly`,(e,t)=>{dy.init(e,t),h_(e,`propValues`,e=>e.def.innerType._zod.propValues),h_(e,`values`,e=>e.def.innerType._zod.values),h_(e,`optin`,e=>e.def.innerType?._zod?.optin),h_(e,`optout`,e=>e.def.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(Gb):Gb(r)}});function Gb(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Kb=U(`$ZodLazy`,(e,t)=>{dy.init(e,t),hg(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),h_(e,`pattern`,e=>e.innerType?._zod?.pattern),h_(e,`propValues`,e=>e.innerType?._zod?.propValues),h_(e,`optin`,e=>e.innerType?._zod?.optin??void 0),h_(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),qb=U(`$ZodCustom`,(e,t)=>{Uv.init(e,t),dy.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=>Jb(t,n,r,e));Jb(i,n,r,e)}});function Jb(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(a_(e))}}var Yb=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Xb=`~memo`,Zb=[];function Qb(e){return typeof e==`object`&&!!e}function $b(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var ex=new WeakMap,tx=0,nx=1,rx=2;function ix(e,t,n){let r=ex.get(e);if(r!==void 0)return r?rx:tx;if(t.has(e))return rx;t.add(e);let i=tx,a=e=>{if(i!==rx&&e?._zod){let r=ix(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=tx;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?nx:o.value?._zod?ix(o.value,t,n):tx;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=_g(c);s(e?o(e,!0):nx),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?ix(r,t,!1):nx);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),ax(e,i)}function ax(e,t){return t!==nx&&ex.set(e,t===rx),t}function ox(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var sx,cx=[],lx={alloc(e,t,n){let r=sx;if(!r)return n;sx=void 0;let i={value:n,issues:null};return r.set(t.value,i),cx.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&dx(n,e.value))throw new Yb;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=ix(e,new Set,!1);if(i===tx)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===rx||r?n=!0:r=!0}let l=s.value;if(!Qb(l))return t(s,c);let u=c[Xb];u||(u={buckets:new WeakMap,backEdges:void 0},c[Xb]=u);let d;i===c?d=a:(d=ox(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...$b(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;sx=d;let p=cx.length,m=t(s,c);sx=void 0;let h=cx.length>p?cx.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?$b(e.issues):Zb),e)):(h&&(h.issues=m.issues.length?$b(m.issues):Zb),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ux(){return lx}function dx(e,t){let n=e[Xb]?.backEdges;return n!==void 0&&Qb(t)&&n.has(t)}var fx=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(i_(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Fg(e.values[0])}`:`Invalid option: expected one of ${sg(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${sg(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function px(){return{localeError:fx()}}var mx,hx=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 gx(){return new hx}(mx=globalThis).__zod_globalRegistry??(mx.__zod_globalRegistry=gx());var _x=globalThis.__zod_globalRegistry;function vx(e){return e.checks&&=[...e.checks],e}function yx(e,t){return new e(vx({type:`string`,...Pg(t)}))}function bx(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Pg(t)})}function xx(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Pg(t)})}function Sx(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Pg(t)})}function Cx(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Pg(t)})}function wx(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Pg(t)})}function Tx(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Pg(t)})}function Ex(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Pg(t)})}function Dx(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Pg(t)})}function Ox(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Pg(t)})}function kx(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Pg(t)})}function Ax(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Pg(t)})}function jx(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Pg(t)})}function Mx(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Pg(t)})}function Nx(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Pg(t)})}function Px(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Pg(t)})}function Fx(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Pg(t)})}function Ix(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Pg(t)})}function Lx(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Pg(t)})}function Rx(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Pg(t)})}function zx(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Pg(t)})}function Bx(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Pg(t)})}function Vx(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Pg(t)})}function Hx(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Pg(t)})}function Ux(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Pg(t)})}function Wx(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Pg(t)})}function Gx(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Pg(t)})}function Kx(e,t){return new e(vx({type:`number`,checks:[],...Pg(t)}))}function qx(e,t){return new e(vx({type:`number`,coerce:!0,checks:[],...Pg(t)}))}function Jx(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...Pg(t)})}function Yx(e,t){return new e({type:`boolean`,...Pg(t)})}function Xx(e,t){return new e({type:`undefined`,...Pg(t)})}function Zx(e,t){return new e({type:`null`,...Pg(t)})}function Qx(e){return new e({type:`any`})}function $x(e){return new e({type:`unknown`})}function eS(e,t){return new e({type:`never`,...Pg(t)})}function tS(e,t){return new Kv({check:`less_than`,...Pg(t),value:e,inclusive:!1})}function nS(e,t){return new Kv({check:`less_than`,...Pg(t),value:e,inclusive:!0})}function rS(e,t){return new qv({check:`greater_than`,...Pg(t),value:e,inclusive:!1})}function iS(e,t){return new qv({check:`greater_than`,...Pg(t),value:e,inclusive:!0})}function aS(e){return rS(0,e)}function oS(e){return iS(0,e)}function sS(e,t){return new Jv({check:`multiple_of`,...Pg(t),value:e})}function cS(e,t){return new Xv({check:`max_length`,...Pg(t),maximum:e})}function lS(e,t){return new Zv({check:`min_length`,...Pg(t),minimum:e})}function uS(e,t){return new Qv({check:`length_equals`,...Pg(t),length:e})}function dS(e,t){return new ey({check:`string_format`,format:`regex`,...Pg(t),pattern:e})}function fS(e){return new ty({check:`string_format`,format:`lowercase`,...Pg(e)})}function pS(e){return new ny({check:`string_format`,format:`uppercase`,...Pg(e)})}function mS(e,t){return new ry({check:`string_format`,format:`includes`,...Pg(t),includes:e})}function hS(e,t){return new iy({check:`string_format`,format:`starts_with`,...Pg(t),prefix:e})}function gS(e,t){return new ay({check:`string_format`,format:`ends_with`,...Pg(t),suffix:e})}function _S(e,t){return new sy({check:`properties`,shape:e,...Pg(t)})}function vS(e){return new cy({check:`overwrite`,tx:e})}function yS(e){return vS(t=>t.normalize(e))}function bS(){return vS(e=>e.trim())}function xS(){return vS(e=>e.toLowerCase())}function SS(){return vS(e=>e.toUpperCase())}function CS(){return vS(e=>Tg(e))}function wS(e,t,n){return new e({type:`array`,element:t,...Pg(n)})}function TS(e,t,n){let r=Pg(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function ES(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Pg(n)})}function DS(e,t){let n=OS(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(a_(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(a_(r))}},e(t.value,t)),t);return n}function OS(e,t){let n=new Uv({check:`custom`,...Pg(t)});return n._zod.check=e,n}function kS(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&gg(e,t,n[t]);return e}function AS(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??_x,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function jS(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function MS(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),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;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,MS(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&kS(o.schema,c),t.io===`input`&&HS(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function NS(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function PS(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;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}/${NS(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+NS(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>
69
+
70
+ 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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function FS(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;FS(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var IS=new Set([`type`,`properties`,`required`,`additionalProperties`]),LS=[`oneOf`,`anyOf`];function RS(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function zS(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!IS.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??RS(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}gg(n,r,e.length===1?e[0]:zS(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=RS(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function BS(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of IS)if(t in e)return;let n=t.filter(e=>LS.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=zS(t);else{let e=n[0],i=LS.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>zS([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,kS(e,r))}function VS(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)):kS(i,s),kS(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??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())FS(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])BS(e)}}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)}kS(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,gg(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:WS(t,`input`,e.processors),output:WS(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function HS(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 HS(r.element,n);if(r.type===`set`)return HS(r.valueType,n);if(r.type===`lazy`)return HS(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`||r.type===`catch`)return HS(r.innerType,n);if(r.type===`intersection`)return HS(r.left,n)||HS(r.right,n);if(r.type===`record`||r.type===`map`)return HS(r.keyType,n)||HS(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:HS(r.in,n)||HS(r.out,n);if(r.type===`object`){for(let e in r.shape)if(HS(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(HS(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(HS(e,n))return!0;return!!(r.rest&&HS(r.rest,n))}return!1}var US=(e,t={})=>n=>{let r=AS({...n,processors:t});return MS(e,r),PS(r,e),VS(r,e)},WS=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=AS({...i??{},target:a,io:t,processors:n});return MS(e,o),PS(o,e),VS(o,e)},GS=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},KS=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},qS=(e,t)=>{GS(e,`minimum`,t),KS(e,`maximum`,t)},JS=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},YS=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},XS=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},ZS=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},QS=(e,t)=>GS(e,`minimum`,t.minimum),$S=(e,t)=>KS(e,`maximum`,t.maximum),eC=e=>(t,n)=>{ZS(t,n.format);let[r,i]=e[n.format];GS(t,`minimum`,r),KS(t,`maximum`,i)},tC={greater_than:(e,t)=>GS(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>KS(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>JS(e,t.value),number_format:eC(Lg),bigint_format:eC(Rg),min_length:QS,max_length:$S,length_equals:(e,t)=>qS(e,t.length),min_size:QS,max_size:$S,size_equals:(e,t)=>qS(e,t.size),string_format:(e,t)=>{ZS(e,t.format),t.pattern&&YS(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>XS(e,t.mime)};function nC(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)tC[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&GS(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&GS(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&KS(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&KS(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&JS(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&XS(t,i.mime);for(let e of i.patterns??[])YS(t,e);return t}var rC={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},iC=new Map([[qy,Tv],[Yy,Ev]]),aC=e=>iC.get(e)??e,oC=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=nC(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=rC[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(aC);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}))])}},sC=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=nC(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):jS(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},cC=(e,t,n,r)=>{n.type=`boolean`},lC=(e,t,n,r)=>{jS(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},uC=(e,t,n,r)=>{jS(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},dC=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},fC=(e,t,n,r)=>{jS(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},pC=(e,t,n,r)=>{jS(e,t,n,r,`Void cannot be represented in JSON Schema`)},mC=(e,t,n,r)=>{n.not={}},hC=(e,t,n,r)=>{},gC=(e,t,n,r)=>{},_C=(e,t,n,r)=>{jS(e,t,n,r,`Date cannot be represented in JSON Schema`)},vC=(e,t,n,r)=>{let i=e._zod.def,a=og(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},yC=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(jS(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(jS(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);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}},bC=(e,t,n,r)=>{jS(e,t,n,r,`NaN cannot be represented in JSON Schema`)},xC=(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},SC=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=nC(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},CC=(e,t,n,r)=>{n.type=`boolean`},wC=(e,t,n,r)=>{jS(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},TC=(e,t,n,r)=>{jS(e,t,n,r,`Function types cannot be represented in JSON Schema`)},EC=(e,t,n,r)=>{jS(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},DC=(e,t,n,r)=>{jS(e,t,n,r,`Map cannot be represented in JSON Schema`)},OC=(e,t,n,r)=>{jS(e,t,n,r,`Set cannot be represented in JSON Schema`)},kC=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=nC(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=MS(a.element,t,{...r,path:[...r.path,`items`]})};function AC(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?AC(t.out):t.type===`catch`?AC(t.innerType):e._zod.optin}var jC=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&jS(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)gg(i.properties,e,MS(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?AC(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=MS(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},MC=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>MS(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},NC=(e,t,n,r)=>{let i=e._zod.def,a=MS(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=MS(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},PC=(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)=>MS(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?MS(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?AC(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=nC(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function FC(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=FC(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>FC(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Lv:Iv).source)),p}var IC=new WeakMap;function LC(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of IC.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=FC(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var RC=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=nC(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=MS(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)gg(i.patternProperties,aC(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=MS(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=IC.get(t);n||(n=[],IC.set(t,n),t.deferred.push(()=>LC(t))),n.push(e)}i.additionalProperties=MS(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&AC(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},zC=(e,t,n,r)=>{let i=e._zod.def,a=MS(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`}]},BC=(e,t,n,r)=>{let i=e._zod.def;MS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},VC=Symbol();function HC(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(jS(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),VC):JSON.parse(o)}var UC=(e,t,n,r)=>{let i=e._zod.def;MS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=HC(i.defaultValue,e,t,n,r);o!==VC&&(n.default=o)},WC=(e,t,n,r)=>{let i=e._zod.def;MS(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=HC(i.defaultValue,e,t,n,r);o!==VC&&(n._prefault=o)},GC=(e,t,n,r)=>{let i=e._zod.def;MS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{jS(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},KC=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;MS(o,t,r);let s=t.seen.get(e);s.ref=o},qC=(e,t,n,r)=>{let i=e._zod.def;MS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},JC=(e,t,n,r)=>{let i=e._zod.def;MS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},YC=(e,t,n,r)=>{let i=e._zod.def;MS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},XC=(e,t,n,r)=>{let i=e._zod.innerType;MS(i,t,r);let a=t.seen.get(e);a.ref=i},ZC={string:oC,number:sC,boolean:cC,bigint:lC,symbol:uC,null:dC,undefined:fC,void:pC,never:mC,any:hC,unknown:gC,date:_C,enum:vC,literal:yC,nan:bC,template_literal:xC,file:SC,success:CC,custom:wC,function:TC,transform:EC,map:DC,set:OC,array:kC,object:jC,union:MC,intersection:NC,tuple:PC,record:RC,nullable:zC,nonoptional:BC,default:UC,prefault:WC,catch:GC,pipe:KC,readonly:qC,promise:JC,optional:YC,lazy:XC};function QC(e,t){if(`_idmap`in e){let n=e,r=AS({...t,processors:ZC}),i={};for(let e of n._idmap.entries()){let[t,n]=e;MS(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;PS(r,n),gg(a,t,VS(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=AS({...t,processors:ZC});return MS(e,n),PS(n,e),VS(n,e)}var $C=new WeakSet([Object.prototype,Error.prototype]);function ew(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var tw=U(`ZodError`,(e,t)=>{P_.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);$C.has(n)||($C.add(n),ew(n,`format`,e=>t=>R_(e,t)),ew(n,`flatten`,e=>t=>L_(e,t)),ew(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,cg,2)}),ew(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,cg,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),nw=B_(tw),rw=H_(tw),iw=W_(tw),aw=q_(tw),ow=ev(tw),sw=tv(tw),cw=nv(tw),lw=rv(tw),uw=iv(tw),dw=av(tw),fw=ov(tw),pw=sv(tw);function mw(){E_.localeError||D_(px())}function hw(){E_.memoizer||D_({memoizer:ux()})}var gw=U(`ZodType`,(e,t)=>(mw(),dy.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Cg(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ng(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(HT(e,t))},superRefine(e,t){return this.check(UT(e,t))},overwrite(e){return this.check(vS(e))},optional(){return bT(this)},exactOptional(){return ST(this)},nullable(){return wT(this)},nullish(){return bT(wT(this))},nonoptional(e){return AT(this,e)},array(){return q(this)},or(e){return Y([this,e])},and(e){return fT(this,e)},transform(e){return PT(this,vT(e))},default(e){return ET(this,e)},prefault(e){return OT(this,e)},catch(e){return MT(this,e)},pipe(e){return PT(this,e)},readonly(){return LT(this)},describe(e){let t=this.clone();return _x.add(t,{description:e}),t},meta(...e){if(e.length===0)return _x.get(this);let t=this.clone();return _x.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return c_(this,`~standard`,{...my(this),jsonSchema:{input:WS(this,`input`),output:WS(this,`output`)}})},set"~standard"(e){s_(this,`~standard`,e)},parse:function e(t,n){return nw(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await rw(this,t,n,{callee:e})},safeParse(e,t){return iw(this,e,t)},async safeParseAsync(e,t){return aw(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){s_(this,`spa`,e)},validate(e,t){return Z_(this,e,t)},validateAsync(e,t){return $_(this,e,t)},encode:function e(t,n){return ow(this,t,n,{callee:e})},decode:function e(t,n){return sw(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await cw(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await lw(this,t,n,{callee:e})},safeEncode(e,t){return uw(this,e,t)},safeDecode(e,t){return dw(this,e,t)},async safeEncodeAsync(e,t){return fw(this,e,t)},async safeDecodeAsync(e,t){return pw(this,e,t)},toJSONSchema(e){return US(this,{})(e)},get description(){return _x.get(this)?.description},get _def(){return this._zod.def}}),_w=U(`_ZodString`,(e,t)=>{hy.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oC(e,t,n,r)},l_({format:e=>nC(e).format??null,minLength:e=>nC(e).minimum??null,maxLength:e=>nC(e).maximum??null},{regex(...e){return this.check(dS(...e))},includes(...e){return this.check(mS(...e))},startsWith(...e){return this.check(hS(...e))},endsWith(...e){return this.check(gS(...e))},min(...e){return this.check(lS(...e))},max(...e){return this.check(cS(...e))},length(...e){return this.check(uS(...e))},nonempty(...e){return this.check(lS(1,...e))},lowercase(e){return this.check(fS(e))},uppercase(e){return this.check(pS(e))},trim(){return this.check(bS())},normalize(...e){return this.check(yS(...e))},toLowerCase(){return this.check(xS())},toUpperCase(){return this.check(SS())},slugify(){return this.check(CS())}})),vw=U(`ZodString`,(e,t)=>{hy.init(e,t),_w.init(e,t)},{email(e){return this.check(bx(ww,e))},url(e){return this.check(Ex(Ow,e))},jwt(e){return this.check(Vx(Ww,e))},emoji(e){return this.check(Dx(Aw,e))},guid(e){return this.check(xx(Ew,e))},uuid(e){return this.check(Sx(Dw,e))},uuidv4(e){return this.check(Cx(Dw,e))},uuidv6(e){return this.check(wx(Dw,e))},uuidv7(e){return this.check(Tx(Dw,e))},nanoid(e){return this.check(Ox(jw,e))},cuid(e){return this.check(kx(Mw,e))},cuid2(e){return this.check(Ax(Nw,e))},ulid(e){return this.check(jx(Pw,e))},base64(e){return this.check(Rx(Vw,e))},base64url(e){return this.check(zx(Hw,e))},xid(e){return this.check(Mx(Fw,e))},ksuid(e){return this.check(Nx(Iw,e))},ipv4(e){return this.check(Px(Lw,e))},ipv6(e){return this.check(Fx(Rw,e))},cidrv4(e){return this.check(Ix(zw,e))},cidrv6(e){return this.check(Lx(Bw,e))},e164(e){return this.check(Bx(Uw,e))},datetime(e){return this.check(Hx(bw,e))},date(e){return this.check(Ux(xw,e))},time(e){return this.check(Wx(Sw,e))},duration(e){return this.check(Gx(Cw,e))}});function W(e){return yx(vw,e)}var yw=U(`ZodStringFormat`,(e,t)=>{gy.init(e,t),_w.init(e,t)}),bw=U(`ZodISODateTime`,(e,t)=>{Fy.init(e,t),yw.init(e,t)}),xw=U(`ZodISODate`,(e,t)=>{Iy.init(e,t),yw.init(e,t)}),Sw=U(`ZodISOTime`,(e,t)=>{Ly.init(e,t),yw.init(e,t)}),Cw=U(`ZodISODuration`,(e,t)=>{Ry.init(e,t),yw.init(e,t)}),ww=U(`ZodEmail`,(e,t)=>{yy.init(e,t),yw.init(e,t)});function Tw(e){return bx(ww,e)}var Ew=U(`ZodGUID`,(e,t)=>{_y.init(e,t),yw.init(e,t)}),Dw=U(`ZodUUID`,(e,t)=>{vy.init(e,t),yw.init(e,t)}),Ow=U(`ZodURL`,(e,t)=>{Dy.init(e,t),yw.init(e,t)});function kw(e){return Ex(Ow,e)}var Aw=U(`ZodEmoji`,(e,t)=>{Oy.init(e,t),yw.init(e,t)}),jw=U(`ZodNanoID`,(e,t)=>{ky.init(e,t),yw.init(e,t)}),Mw=U(`ZodCUID`,(e,t)=>{Ay.init(e,t),yw.init(e,t)}),Nw=U(`ZodCUID2`,(e,t)=>{jy.init(e,t),yw.init(e,t)}),Pw=U(`ZodULID`,(e,t)=>{My.init(e,t),yw.init(e,t)}),Fw=U(`ZodXID`,(e,t)=>{Ny.init(e,t),yw.init(e,t)}),Iw=U(`ZodKSUID`,(e,t)=>{Py.init(e,t),yw.init(e,t)}),Lw=U(`ZodIPv4`,(e,t)=>{zy.init(e,t),yw.init(e,t)}),Rw=U(`ZodIPv6`,(e,t)=>{Hy.init(e,t),yw.init(e,t)}),zw=U(`ZodCIDRv4`,(e,t)=>{Uy.init(e,t),yw.init(e,t)}),Bw=U(`ZodCIDRv6`,(e,t)=>{Gy.init(e,t),yw.init(e,t)}),Vw=U(`ZodBase64`,(e,t)=>{Jy.init(e,t),yw.init(e,t)}),Hw=U(`ZodBase64URL`,(e,t)=>{Zy.init(e,t),yw.init(e,t)}),Uw=U(`ZodE164`,(e,t)=>{Qy.init(e,t),yw.init(e,t)}),Ww=U(`ZodJWT`,(e,t)=>{eb.init(e,t),yw.init(e,t)}),Gw=U(`ZodNumber`,(e,t)=>{tb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sC(e,t,n,r),e.isFinite=!0},l_({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=nC(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=nC(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=nC(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>nC(e).format??null},{gt(e,t){return this.check(rS(e,t))},gte(e,t){return this.check(iS(e,t))},min(e,t){return this.check(iS(e,t))},lt(e,t){return this.check(tS(e,t))},lte(e,t){return this.check(nS(e,t))},max(e,t){return this.check(nS(e,t))},int(e){return this.check(qw(e))},safe(e){return this.check(qw(e))},positive(e){return this.check(rS(0,e))},nonnegative(e){return this.check(iS(0,e))},negative(e){return this.check(tS(0,e))},nonpositive(e){return this.check(nS(0,e))},multipleOf(e,t){return this.check(sS(e,t))},step(e,t){return this.check(sS(e,t))},finite(){return this}}));function G(e){return Kx(Gw,e)}var Kw=U(`ZodNumberFormat`,(e,t)=>{nb.init(e,t),Gw.init(e,t)});function qw(e){return Jx(Kw,e)}var Jw=U(`ZodBoolean`,(e,t)=>{rb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cC(e,t,n,r)});function K(e){return Yx(Jw,e)}var Yw=U(`ZodUndefined`,(e,t)=>{ib.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fC(e,t,n,r)});function Xw(e){return Xx(Yw,e)}var Zw=U(`ZodNull`,(e,t)=>{ab.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dC(e,t,n,r)});function Qw(e){return Zx(Zw,e)}var $w=U(`ZodAny`,(e,t)=>{ob.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function eT(){return Qx($w)}var tT=U(`ZodUnknown`,(e,t)=>{sb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function nT(){return $x(tT)}var rT=U(`ZodNever`,(e,t)=>{cb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mC(e,t,n,r)});function iT(e){return eS(rT,e)}var aT=U(`ZodArray`,(e,t)=>{hw(),fb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kC(e,t,n,r),e.element=t.element},{min(e,t){return this.check(lS(e,t))},nonempty(e){return this.check(lS(1,e))},max(e,t){return this.check(cS(e,t))},length(e,t){return this.check(uS(e,t))},unwrap(){return this.element}});function q(e,t){return wS(aT,e,t)}var oT=U(`ZodObject`,(e,t)=>{hw(),vb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jC(e,t,n,r),g_(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return hT(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Cg(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Cg(this._zod.def,{catchall:nT()}))},loose(){return this.clone(Cg(this._zod.def,{catchall:nT()}))},strict(){return this.clone(Cg(this._zod.def,{catchall:iT()}))},strip(){return this.clone(Cg(this._zod.def,{catchall:void 0}))},extend(e){return Hg(this,e)},safeExtend(e){return Wg(this,e)},merge(e){return Gg(this,e)},pick(e){return zg(this,e)},omit(e){return Vg(this,e)},partial(...e){return Kg(yT,this,e[0])},exactPartial(...e){return Kg(xT,this,e[0],`exactPartial`)},required(...e){return qg(kT,this,e[0])}});function J(e,t){return new oT({type:`object`,shape:e??{},...Pg(t)})}function sT(e,t){return new oT({type:`object`,shape:e,catchall:nT(),...Pg(t)})}var cT=U(`ZodUnion`,(e,t)=>{bb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MC(e,t,n,r),e.options=t.options});function Y(e,t){return new cT({type:`union`,options:e,...Pg(t)})}var lT=U(`ZodDiscriminatedUnion`,(e,t)=>{cT.init(e,t),Sb.init(e,t)});function uT(e,t,n){return new lT({type:`union`,options:t,discriminator:e,...Pg(n)})}var dT=U(`ZodIntersection`,(e,t)=>{Cb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NC(e,t,n,r)});function fT(e,t){return new dT({type:`intersection`,left:e,right:t})}var pT=U(`ZodRecord`,(e,t)=>{hw(),Eb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RC(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function X(e,t,n){return!t||!t._zod?new pT({type:`record`,keyType:W(),valueType:e,...Pg(t)}):new pT({type:`record`,keyType:e,valueType:t,...Pg(n)})}var mT=U(`ZodEnum`,(e,t)=>{Db.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vC(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];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 mT({...t,checks:[],...Pg(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 mT({...t,checks:[],...Pg(r),entries:i})}});function hT(e,t){return new mT({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Pg(t)})}var gT=U(`ZodLiteral`,(e,t)=>{Ob.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yC(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 Z(e,t){return new gT({type:`literal`,values:Array.isArray(e)?e:[e],...Pg(t)})}var _T=U(`ZodTransform`,(e,t)=>{hw(),kb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>EC(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new T_(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(a_(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(a_(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function vT(e){return new _T({type:`transform`,transform:e})}var yT=U(`ZodOptional`,(e,t)=>{jb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bT(e){return new yT({type:`optional`,innerType:e})}var xT=U(`ZodExactOptional`,(e,t)=>{Mb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ST(e){return new xT({type:`optional`,innerType:e})}var CT=U(`ZodNullable`,(e,t)=>{Nb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wT(e){return new CT({type:`nullable`,innerType:e})}var TT=U(`ZodDefault`,(e,t)=>{Pb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ET(e,t){return new TT({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ag(t)}})}var DT=U(`ZodPrefault`,(e,t)=>{Ib.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function OT(e,t){return new DT({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ag(t)}})}var kT=U(`ZodNonOptional`,(e,t)=>{Lb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function AT(e,t){return new kT({type:`nonoptional`,innerType:e,...Pg(t)})}var jT=U(`ZodCatch`,(e,t)=>{Bb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function MT(e,t){return new jT({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:v_(t)})}var NT=U(`ZodPipe`,(e,t)=>{Vb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KC(e,t,n,r),e.in=t.in,e.out=t.out});function PT(e,t){return new NT({type:`pipe`,in:e,out:t})}var FT=U(`ZodPreprocess`,(e,t)=>{NT.init(e,t),Ub.init(e,t)}),IT=U(`ZodReadonly`,(e,t)=>{Wb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function LT(e){return new IT({type:`readonly`,innerType:e})}var RT=U(`ZodLazy`,(e,t)=>{Kb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XC(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function zT(e){return new RT({type:`lazy`,getter:e})}var BT=U(`ZodCustom`,(e,t)=>{qb.init(e,t),gw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wC(e,t,n,r)});function VT(e,t){return TS(BT,e??(()=>!0),t)}function HT(e,t={}){return ES(BT,e,t)}function UT(e,t){return DS(e,t)}var WT=U(`ZodInstanceOf`,(e,t)=>{BT.init(e,t)},{properties(e,t){return this.check(_S(e,t))}});function GT(e,t={}){let n=new WT({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...Pg(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function KT(e,t){return new FT({type:`pipe`,in:vT(e),out:t})}var qT={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`},JT;JT||={};function YT(e){return Hx(bw,e)}function XT(e){return Ux(xw,e)}function ZT(e){return qx(Gw,e)}var QT=[`2025-11-25`,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],$T=`io.modelcontextprotocol/related-task`,eE=`io.modelcontextprotocol/protocolVersion`,tE=`io.modelcontextprotocol/clientInfo`,nE=`io.modelcontextprotocol/serverInfo`,rE=`io.modelcontextprotocol/clientCapabilities`,iE=`io.modelcontextprotocol/subscriptionId`,aE=`io.modelcontextprotocol/logLevel`,oE=zT(()=>Y([W(),G(),K(),Qw(),X(W(),oE),q(oE)])),sE=X(W(),oE),cE=q(oE),lE=Y([W(),G().int()]),uE=W(),dE=J({ttl:G().optional()}),fE=J({taskId:W()}),pE=sT({progressToken:lE.optional(),[$T]:fE.optional()}),mE=J({_meta:pE.optional()}),hE=mE.extend({task:dE.optional()}),gE=J({method:W(),params:mE.loose().optional()}),_E=J({_meta:pE.optional()}),vE=J({method:W(),params:_E.loose().optional()}),yE=sT({get[nE](){return PE.optional().catch(void 0)}}),bE=sT({_meta:yE.optional()}),xE=Y([W(),G().int()]),SE=J({jsonrpc:Z(`2.0`),id:xE,...gE.shape}).strict(),CE=J({jsonrpc:Z(`2.0`),...vE.shape}).strict(),wE=J({jsonrpc:Z(`2.0`),id:xE,result:bE}).strict(),TE=J({jsonrpc:Z(`2.0`),id:xE.optional(),error:J({code:G().int(),message:W(),data:nT().optional()})}).strict(),EE=Y([SE,CE,wE,TE]),DE=Y([wE,TE]),OE=bE.strict(),kE=_E.extend({requestId:xE.optional(),reason:W().optional()}),AE=vE.extend({method:Z(`notifications/cancelled`),params:kE}),jE=J({src:W(),mimeType:W().optional(),sizes:q(W()).optional(),theme:hT([`light`,`dark`]).optional()}),ME=J({icons:q(jE).optional()}),NE=J({name:W(),title:W().optional()}),PE=NE.extend({...NE.shape,...ME.shape,version:W(),websiteUrl:W().optional(),description:W().optional()}),FE=KT(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,fT(J({form:fT(J({applyDefaults:K().optional()}),sE).optional(),url:sE.optional()}),sE.optional())),IE=sT({list:sE.optional(),cancel:sE.optional(),requests:sT({sampling:sT({createMessage:sE.optional()}).optional(),elicitation:sT({create:sE.optional()}).optional()}).optional()}),LE=sT({list:sE.optional(),cancel:sE.optional(),requests:sT({tools:sT({call:sE.optional()}).optional()}).optional()}),RE=J({experimental:X(W(),sE).optional(),sampling:J({context:sE.optional(),tools:sE.optional()}).optional(),elicitation:FE.optional(),roots:J({listChanged:K().optional()}).optional(),tasks:IE.optional(),extensions:X(W(),sE).optional()}),zE=mE.extend({protocolVersion:W(),capabilities:RE,clientInfo:PE}),BE=gE.extend({method:Z(`initialize`),params:zE}),VE=J({experimental:X(W(),sE).optional(),logging:sE.optional(),completions:sE.optional(),prompts:J({listChanged:K().optional()}).optional(),resources:J({subscribe:K().optional(),listChanged:K().optional()}).optional(),tools:J({listChanged:K().optional()}).optional(),tasks:LE.optional(),extensions:X(W(),sE).optional()}),HE=bE.extend({protocolVersion:W(),capabilities:VE,serverInfo:PE,instructions:W().optional()}),UE=vE.extend({method:Z(`notifications/initialized`),params:_E.optional()}),WE=gE.extend({method:Z(`server/discover`),params:mE.optional()}),GE=bE.extend({supportedVersions:q(W()),capabilities:VE,instructions:W().optional()}),KE=gE.extend({method:Z(`ping`),params:mE.optional()}),qE=J({progress:G(),total:bT(G()),message:bT(W())}),JE=J({..._E.shape,...qE.shape,progressToken:lE}),YE=vE.extend({method:Z(`notifications/progress`),params:JE}),XE=mE.extend({cursor:uE.optional()}),ZE=gE.extend({params:XE.optional()}),QE=bE.extend({nextCursor:uE.optional()}),$E=J({uri:W(),mimeType:bT(W()),_meta:X(W(),nT()).optional()}),eD=$E.extend({text:W()}),tD=W().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),nD=$E.extend({blob:tD}),rD=hT([`user`,`assistant`]),iD=J({audience:q(rD).optional(),priority:G().min(0).max(1).optional(),lastModified:YT({offset:!0}).optional()}),aD=J({...NE.shape,...ME.shape,uri:W(),description:bT(W()),mimeType:bT(W()),size:bT(G()),annotations:iD.optional(),_meta:bT(sT({}))}),oD=J({...NE.shape,...ME.shape,uriTemplate:W(),description:bT(W()),mimeType:bT(W()),annotations:iD.optional(),_meta:bT(sT({}))}),sD=ZE.extend({method:Z(`resources/list`)}),cD=QE.extend({resources:q(aD)}),lD=ZE.extend({method:Z(`resources/templates/list`)}),uD=QE.extend({resourceTemplates:q(oD)}),dD=mE.extend({uri:W()}),fD=dD,pD=gE.extend({method:Z(`resources/read`),params:fD}),mD=bE.extend({contents:q(Y([eD,nD]))}),hD=vE.extend({method:Z(`notifications/resources/list_changed`),params:_E.optional()}),gD=dD,_D=gE.extend({method:Z(`resources/subscribe`),params:gD}),vD=dD,yD=gE.extend({method:Z(`resources/unsubscribe`),params:vD}),bD=J({toolsListChanged:K().optional(),promptsListChanged:K().optional(),resourcesListChanged:K().optional(),resourceSubscriptions:q(W()).optional()}),xD=mE.extend({notifications:bD}),SD=gE.extend({method:Z(`subscriptions/listen`),params:xD}),CD=_E.extend({notifications:bD}),wD=vE.extend({method:Z(`notifications/subscriptions/acknowledged`),params:CD}),TD=yE.extend({[iE]:xE}),ED=bE.extend({_meta:TD}),DD=_E.extend({uri:W()}),OD=vE.extend({method:Z(`notifications/resources/updated`),params:DD}),kD=J({name:W(),description:bT(W()),required:bT(K())}),AD=J({...NE.shape,...ME.shape,description:bT(W()),arguments:bT(q(kD)),_meta:bT(sT({}))}),jD=ZE.extend({method:Z(`prompts/list`)}),MD=QE.extend({prompts:q(AD)}),ND=mE.extend({name:W(),arguments:X(W(),W()).optional()}),PD=gE.extend({method:Z(`prompts/get`),params:ND}),FD=J({type:Z(`text`),text:W(),annotations:iD.optional(),_meta:X(W(),nT()).optional()}),ID=J({type:Z(`image`),data:tD,mimeType:W(),annotations:iD.optional(),_meta:X(W(),nT()).optional()}),LD=J({type:Z(`audio`),data:tD,mimeType:W(),annotations:iD.optional(),_meta:X(W(),nT()).optional()}),RD=J({type:Z(`tool_use`),name:W(),id:W(),input:X(W(),nT()),_meta:X(W(),nT()).optional()}),zD=J({type:Z(`resource`),resource:Y([eD,nD]),annotations:iD.optional(),_meta:X(W(),nT()).optional()}),BD=aD.extend({type:Z(`resource_link`)}),VD=Y([FD,ID,LD,BD,zD]),HD=J({role:rD,content:VD}),UD=bE.extend({description:W().optional(),messages:q(HD)}),WD=vE.extend({method:Z(`notifications/prompts/list_changed`),params:_E.optional()}),GD=J({title:W().optional(),readOnlyHint:K().optional(),destructiveHint:K().optional(),idempotentHint:K().optional(),openWorldHint:K().optional()}),KD=J({taskSupport:hT([`required`,`optional`,`forbidden`]).optional()}),qD=J({...NE.shape,...ME.shape,description:W().optional(),inputSchema:J({type:Z(`object`),properties:X(W(),oE).optional(),required:q(W()).optional()}).catchall(nT()),outputSchema:sT({$schema:W().optional()}).optional(),annotations:GD.optional(),execution:KD.optional(),_meta:X(W(),nT()).optional()}),JD=ZE.extend({method:Z(`tools/list`)}),YD=QE.extend({tools:q(qD)}),XD=bE.extend({content:q(VD).default([]),structuredContent:nT().optional(),isError:K().optional()}),ZD=XD.or(bE.extend({toolResult:nT()})),QD=hE.extend({name:W(),arguments:X(W(),nT()).optional()}),$D=gE.extend({method:Z(`tools/call`),params:QD}),eO=vE.extend({method:Z(`notifications/tools/list_changed`),params:_E.optional()}),tO=J({autoRefresh:K().default(!0),debounceMs:G().int().nonnegative().default(300)}),nO=hT([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),rO=mE.extend({level:nO}),iO=gE.extend({method:Z(`logging/setLevel`),params:rO}),aO=_E.extend({level:nO,logger:W().optional(),data:nT()}),oO=vE.extend({method:Z(`notifications/message`),params:aO}),sO=J({name:W().optional()}),cO=J({hints:q(sO).optional(),costPriority:G().min(0).max(1).optional(),speedPriority:G().min(0).max(1).optional(),intelligencePriority:G().min(0).max(1).optional()}),lO=J({mode:hT([`auto`,`required`,`none`]).optional()}),uO=J({type:Z(`tool_result`),toolUseId:W().describe(`The unique identifier for the corresponding tool call.`),content:q(VD),structuredContent:nT().optional(),isError:K().optional(),_meta:X(W(),nT()).optional()}),dO=uT(`type`,[FD,ID,LD]),fO=uT(`type`,[FD,ID,LD,RD,uO]),pO=J({role:rD,content:Y([fO,q(fO)]),_meta:X(W(),nT()).optional()}),mO=hE.extend({messages:q(pO),modelPreferences:cO.optional(),systemPrompt:W().optional(),includeContext:hT([`none`,`thisServer`,`allServers`]).optional(),temperature:G().optional(),maxTokens:G().int(),stopSequences:q(W()).optional(),metadata:sE.optional(),tools:q(qD).optional(),toolChoice:lO.optional()}),hO=gE.extend({method:Z(`sampling/createMessage`),params:mO}),gO=bE.extend({model:W(),stopReason:bT(hT([`endTurn`,`stopSequence`,`maxTokens`]).or(W())),role:rD,content:dO}),_O=bE.extend({model:W(),stopReason:bT(hT([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(W())),role:rD,content:Y([fO,q(fO)])}),vO=J({type:Z(`boolean`),title:W().optional(),description:W().optional(),default:K().optional()}),yO=J({type:Z(`string`),title:W().optional(),description:W().optional(),minLength:G().optional(),maxLength:G().optional(),format:hT([`email`,`uri`,`date`,`date-time`]).optional(),default:W().optional()}),bO=J({type:hT([`number`,`integer`]),title:W().optional(),description:W().optional(),minimum:G().optional(),maximum:G().optional(),default:G().optional()}),xO=J({type:Z(`string`),title:W().optional(),description:W().optional(),enum:q(W()),default:W().optional()}),SO=J({type:Z(`string`),title:W().optional(),description:W().optional(),oneOf:q(J({const:W(),title:W()})),default:W().optional()}),CO=J({type:Z(`string`),title:W().optional(),description:W().optional(),enum:q(W()),enumNames:q(W()).optional(),default:W().optional()}),wO=Y([xO,SO]),TO=J({type:Z(`array`),title:W().optional(),description:W().optional(),minItems:G().optional(),maxItems:G().optional(),items:J({type:Z(`string`),enum:q(W())}),default:q(W()).optional()}),EO=J({type:Z(`array`),title:W().optional(),description:W().optional(),minItems:G().optional(),maxItems:G().optional(),items:J({anyOf:q(J({const:W(),title:W()}))}),default:q(W()).optional()}),DO=Y([TO,EO]),OO=Y([CO,wO,DO]),kO=Y([OO,vO,yO,bO]),AO=hE.extend({mode:Z(`form`).optional(),message:W(),requestedSchema:J({type:Z(`object`),properties:X(W(),kO),required:q(W()).optional()}).catchall(nT())}),jO=hE.extend({mode:Z(`url`),message:W(),elicitationId:W(),url:W().url()}),MO=Y([AO,jO]),NO=gE.extend({method:Z(`elicitation/create`),params:MO}),PO=_E.extend({elicitationId:W()}),FO=vE.extend({method:Z(`notifications/elicitation/complete`),params:PO}),IO=bE.extend({action:hT([`accept`,`decline`,`cancel`]),content:KT(e=>e===null?void 0:e,X(W(),Y([W(),G(),K(),q(W())])).optional())}),LO=J({type:Z(`ref/resource`),uri:W()}),RO=J({type:Z(`ref/prompt`),name:W()}),zO=mE.extend({ref:Y([RO,LO]),argument:J({name:W(),value:W()}),context:J({arguments:X(W(),W()).optional()}).optional()}),BO=gE.extend({method:Z(`completion/complete`),params:zO}),VO=bE.extend({completion:sT({values:q(W()).max(100),total:bT(G().int()),hasMore:bT(K())})}),HO=J({uri:W().startsWith(`file://`),name:W().optional(),_meta:X(W(),nT()).optional()}),UO=gE.extend({method:Z(`roots/list`),params:mE.optional()}),WO=bE.extend({roots:q(HO)}),GO=vE.extend({method:Z(`notifications/roots/list_changed`),params:_E.optional()}),KO=sT({ttl:G().optional(),pollInterval:G().optional()}),qO=hT([`working`,`input_required`,`completed`,`failed`,`cancelled`]),JO=J({taskId:W(),status:qO,ttl:Y([G(),Qw()]),createdAt:W(),lastUpdatedAt:W(),pollInterval:bT(G()),statusMessage:bT(W())}),YO=bE.extend({task:JO}),XO=_E.merge(JO),ZO=vE.extend({method:Z(`notifications/tasks/status`),params:XO}),QO=gE.extend({method:Z(`tasks/get`),params:mE.extend({taskId:W()})}),$O=bE.merge(JO),ek=gE.extend({method:Z(`tasks/result`),params:mE.extend({taskId:W()})}),tk=bE.loose(),nk=ZE.extend({method:Z(`tasks/list`)}),rk=QE.extend({tasks:q(JO)}),ik=gE.extend({method:Z(`tasks/cancel`),params:mE.extend({taskId:W()})}),ak=bE.merge(JO),ok=Y([KE,BE,WE,BO,iO,PD,jD,sD,lD,pD,_D,yD,SD,$D,JD]),sk=Y([AE,YE,UE,GO]),ck=Y([OE,gO,_O,IO,WO]),lk=Y([KE,hO,NO,UO]),uk=Y([AE,YE,oO,OD,hD,eO,WD,wD,FO]),dk=Y([OE,HE,GE,VO,UD,MD,cD,uD,mD,XD,YD,ED]),fk=kw().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:qT.custom,message:`URL must be parseable`,fatal:!0}),b_}).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`}),pk=sT({resource:W().url(),authorization_servers:q(fk).optional(),jwks_uri:W().url().optional(),scopes_supported:q(W()).optional(),bearer_methods_supported:q(W()).optional(),resource_signing_alg_values_supported:q(W()).optional(),resource_name:W().optional(),resource_documentation:W().optional(),resource_policy_uri:W().url().optional(),resource_tos_uri:W().url().optional(),tls_client_certificate_bound_access_tokens:K().optional(),authorization_details_types_supported:q(W()).optional(),dpop_signing_alg_values_supported:q(W()).optional(),dpop_bound_access_tokens_required:K().optional()}),mk=sT({issuer:W(),authorization_endpoint:fk,token_endpoint:fk,registration_endpoint:fk.optional(),scopes_supported:q(W()).optional(),response_types_supported:q(W()),response_modes_supported:q(W()).optional(),grant_types_supported:q(W()).optional(),token_endpoint_auth_methods_supported:q(W()).optional(),token_endpoint_auth_signing_alg_values_supported:q(W()).optional(),service_documentation:fk.optional(),revocation_endpoint:fk.optional(),revocation_endpoint_auth_methods_supported:q(W()).optional(),revocation_endpoint_auth_signing_alg_values_supported:q(W()).optional(),introspection_endpoint:W().optional(),introspection_endpoint_auth_methods_supported:q(W()).optional(),introspection_endpoint_auth_signing_alg_values_supported:q(W()).optional(),code_challenge_methods_supported:q(W()).optional(),client_id_metadata_document_supported:K().optional(),authorization_response_iss_parameter_supported:K().optional().catch(void 0),dpop_signing_alg_values_supported:q(W()).optional()}),hk=sT({issuer:W(),authorization_endpoint:fk,token_endpoint:fk,userinfo_endpoint:fk.optional(),jwks_uri:fk,registration_endpoint:fk.optional(),scopes_supported:q(W()).optional(),response_types_supported:q(W()),response_modes_supported:q(W()).optional(),grant_types_supported:q(W()).optional(),acr_values_supported:q(W()).optional(),subject_types_supported:q(W()),id_token_signing_alg_values_supported:q(W()),id_token_encryption_alg_values_supported:q(W()).optional(),id_token_encryption_enc_values_supported:q(W()).optional(),userinfo_signing_alg_values_supported:q(W()).optional(),userinfo_encryption_alg_values_supported:q(W()).optional(),userinfo_encryption_enc_values_supported:q(W()).optional(),request_object_signing_alg_values_supported:q(W()).optional(),request_object_encryption_alg_values_supported:q(W()).optional(),request_object_encryption_enc_values_supported:q(W()).optional(),token_endpoint_auth_methods_supported:q(W()).optional(),token_endpoint_auth_signing_alg_values_supported:q(W()).optional(),display_values_supported:q(W()).optional(),claim_types_supported:q(W()).optional(),claims_supported:q(W()).optional(),service_documentation:W().optional(),claims_locales_supported:q(W()).optional(),ui_locales_supported:q(W()).optional(),claims_parameter_supported:K().optional(),request_parameter_supported:K().optional(),request_uri_parameter_supported:K().optional(),require_request_uri_registration:K().optional(),op_policy_uri:fk.optional(),op_tos_uri:fk.optional(),client_id_metadata_document_supported:K().optional(),authorization_response_iss_parameter_supported:K().optional().catch(void 0)}),gk=J({...hk.shape,...mk.pick({code_challenge_methods_supported:!0}).shape}),_k=J({access_token:W(),id_token:W().optional(),token_type:W(),expires_in:ZT().optional(),scope:W().optional(),refresh_token:W().optional(),issuer:W().optional().catch(void 0)}).strip(),vk=J({issued_token_type:Z(`urn:ietf:params:oauth:token-type:id-jag`),access_token:W(),token_type:W().optional(),expires_in:G().optional(),scope:W().optional()}).strip(),yk=J({error:W(),error_description:W().optional(),error_uri:W().optional()}),bk=fk.optional().or(Z(``).transform(()=>void 0)),xk=J({redirect_uris:q(fk),token_endpoint_auth_method:W().optional(),grant_types:q(W()).optional(),response_types:q(W()).optional(),application_type:W().optional(),client_name:W().optional(),client_uri:fk.optional(),logo_uri:bk,scope:W().optional(),contacts:q(W()).optional(),tos_uri:bk,policy_uri:W().optional(),jwks_uri:fk.optional(),jwks:eT().optional(),software_id:W().optional(),software_version:W().optional(),software_statement:W().optional()}).strip(),Sk=J({client_id:W(),client_secret:W().optional(),client_id_issued_at:G().optional(),client_secret_expires_at:G().optional(),issuer:W().optional().catch(void 0)}).strip(),Ck=xk.merge(Sk),wk=J({error:W(),error_description:W().optional()}).strip(),Tk=J({token:W(),token_type_hint:W().optional()}).strip(),Ek=Symbol.for(`mcp.sdk.errorBrands`);function Dk(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,Ek,{value:n,enumerable:!1,configurable:!0})}function Ok(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Ek)){let n=t[Ek];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}(class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return Ok(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 Ok(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Dk(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)}});var kk=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}({}),Ak=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return Ok(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 Ok(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Dk(this,new.target)}};(class extends Ak{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}});var jk=`2026-07-28`;function Mk(e){return e>=jk}function Nk(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 Pk=[`task`,`inputRequests`,`requestState`];function Fk(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||Pk.some(t=>t in e)?e:{...e,content:[]}}function Ik(){let e=zT(()=>Y([W(),G(),K(),Qw(),X(W(),e),q(e)])),t=X(W(),e),n=Y([W(),G().int()]),r=W(),i=J({ttl:G().optional()}),a=J({taskId:W()}),o=sT({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=J({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=J({method:W(),params:s.loose().optional()}),u=J({_meta:o.optional()}),d=J({method:W(),params:u.loose().optional()}),f=sT({_meta:o.optional()}),p=Y([W(),G().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:W().optional()}),g=d.extend({method:Z(`notifications/cancelled`),params:h}),_=J({src:W(),mimeType:W().optional(),sizes:q(W()).optional(),theme:hT([`light`,`dark`]).optional()}),v=J({icons:q(_).optional()}),y=J({name:W(),title:W().optional()}),b=y.extend({...y.shape,...v.shape,version:W(),websiteUrl:W().optional(),description:W().optional()}),x=KT(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,fT(J({form:fT(J({applyDefaults:K().optional()}),t).optional(),url:t.optional()}),t.optional())),S=sT({list:t.optional(),cancel:t.optional(),requests:sT({sampling:sT({createMessage:t.optional()}).optional(),elicitation:sT({create:t.optional()}).optional()}).optional()}),C=sT({list:t.optional(),cancel:t.optional(),requests:sT({tools:sT({call:t.optional()}).optional()}).optional()}),w=J({experimental:X(W(),t).optional(),sampling:J({context:t.optional(),tools:t.optional()}).optional(),elicitation:x.optional(),roots:J({listChanged:K().optional()}).optional(),tasks:S.optional(),extensions:X(W(),t).optional()}),T=s.extend({protocolVersion:W(),capabilities:w,clientInfo:b}),E=l.extend({method:Z(`initialize`),params:T}),D=J({experimental:X(W(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:J({listChanged:K().optional()}).optional(),resources:J({subscribe:K().optional(),listChanged:K().optional()}).optional(),tools:J({listChanged:K().optional()}).optional(),tasks:C.optional(),extensions:X(W(),t).optional()}),O=f.extend({protocolVersion:W(),capabilities:D,serverInfo:b,instructions:W().optional()}),k=d.extend({method:Z(`notifications/initialized`),params:u.optional()}),A=l.extend({method:Z(`ping`),params:s.optional()}),j=J({progress:G(),total:bT(G()),message:bT(W())}),M=J({...u.shape,...j.shape,progressToken:n}),N=d.extend({method:Z(`notifications/progress`),params:M}),P=s.extend({cursor:r.optional()}),F=l.extend({params:P.optional()}),ee=f.extend({nextCursor:r.optional()}),I=J({uri:W(),mimeType:bT(W()),_meta:X(W(),nT()).optional()}),te=I.extend({text:W()}),ne=W().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),L=I.extend({blob:ne}),re=hT([`user`,`assistant`]),R=J({audience:q(re).optional(),priority:G().min(0).max(1).optional(),lastModified:YT({offset:!0}).optional()}),ie=J({...y.shape,...v.shape,uri:W(),description:bT(W()),mimeType:bT(W()),size:bT(G()),annotations:R.optional(),_meta:bT(sT({}))}),ae=J({...y.shape,...v.shape,uriTemplate:W(),description:bT(W()),mimeType:bT(W()),annotations:R.optional(),_meta:bT(sT({}))}),z=F.extend({method:Z(`resources/list`)}),oe=ee.extend({resources:q(ie)}),se=F.extend({method:Z(`resources/templates/list`)}),ce=ee.extend({resourceTemplates:q(ae)}),le=s.extend({uri:W()}),ue=le,B=l.extend({method:Z(`resources/read`),params:ue}),de=f.extend({contents:q(Y([te,L]))}),fe=d.extend({method:Z(`notifications/resources/list_changed`),params:u.optional()}),pe=le,me=l.extend({method:Z(`resources/subscribe`),params:pe}),he=le,ge=l.extend({method:Z(`resources/unsubscribe`),params:he}),_e=u.extend({uri:W()}),ve=d.extend({method:Z(`notifications/resources/updated`),params:_e}),ye=J({name:W(),description:bT(W()),required:bT(K())}),be=J({...y.shape,...v.shape,description:bT(W()),arguments:bT(q(ye)),_meta:bT(sT({}))}),xe=F.extend({method:Z(`prompts/list`)}),Se=ee.extend({prompts:q(be)}),Ce=s.extend({name:W(),arguments:X(W(),W()).optional()}),we=l.extend({method:Z(`prompts/get`),params:Ce}),V=J({type:Z(`text`),text:W(),annotations:R.optional(),_meta:X(W(),nT()).optional()}),Te=J({type:Z(`image`),data:ne,mimeType:W(),annotations:R.optional(),_meta:X(W(),nT()).optional()}),Ee=J({type:Z(`audio`),data:ne,mimeType:W(),annotations:R.optional(),_meta:X(W(),nT()).optional()}),De=J({type:Z(`tool_use`),name:W(),id:W(),input:X(W(),nT()),_meta:X(W(),nT()).optional()}),Oe=J({type:Z(`resource`),resource:Y([te,L]),annotations:R.optional(),_meta:X(W(),nT()).optional()}),ke=ie.extend({type:Z(`resource_link`)}),Ae=Y([V,Te,Ee,ke,Oe]),je=J({role:re,content:Ae}),Me=f.extend({description:W().optional(),messages:q(je)}),Ne=d.extend({method:Z(`notifications/prompts/list_changed`),params:u.optional()}),Pe=J({title:W().optional(),readOnlyHint:K().optional(),destructiveHint:K().optional(),idempotentHint:K().optional(),openWorldHint:K().optional()}),Fe=J({taskSupport:hT([`required`,`optional`,`forbidden`]).optional()}),Ie=J({...y.shape,...v.shape,description:W().optional(),inputSchema:J({type:Z(`object`),properties:X(W(),e).optional(),required:q(W()).optional()}).catchall(nT()),outputSchema:J({type:Z(`object`),properties:X(W(),e).optional(),required:q(W()).optional()}).catchall(nT()).optional(),annotations:Pe.optional(),execution:Fe.optional(),_meta:X(W(),nT()).optional()}),Le=F.extend({method:Z(`tools/list`)}),Re=ee.extend({tools:q(Ie)}),ze=f.extend({content:q(Ae),structuredContent:X(W(),nT()).optional(),isError:K().optional()}),Be=c.extend({name:W(),arguments:X(W(),nT()).optional()}),Ve=l.extend({method:Z(`tools/call`),params:Be}),He=d.extend({method:Z(`notifications/tools/list_changed`),params:u.optional()}),Ue=hT([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),We=s.extend({level:Ue}),Ge=l.extend({method:Z(`logging/setLevel`),params:We}),Ke=u.extend({level:Ue,logger:W().optional(),data:nT()}),qe=d.extend({method:Z(`notifications/message`),params:Ke}),Je=J({name:W().optional()}),Ye=J({hints:q(Je).optional(),costPriority:G().min(0).max(1).optional(),speedPriority:G().min(0).max(1).optional(),intelligencePriority:G().min(0).max(1).optional()}),Xe=J({mode:hT([`auto`,`required`,`none`]).optional()}),Ze=J({type:Z(`tool_result`),toolUseId:W().describe(`The unique identifier for the corresponding tool call.`),content:q(Ae),structuredContent:J({}).loose().optional(),isError:K().optional(),_meta:X(W(),nT()).optional()}),Qe=uT(`type`,[V,Te,Ee]),$e=uT(`type`,[V,Te,Ee,De,Ze]),et=J({role:re,content:Y([$e,q($e)]),_meta:X(W(),nT()).optional()}),tt=c.extend({messages:q(et),modelPreferences:Ye.optional(),systemPrompt:W().optional(),includeContext:hT([`none`,`thisServer`,`allServers`]).optional(),temperature:G().optional(),maxTokens:G().int(),stopSequences:q(W()).optional(),metadata:t.optional(),tools:q(Ie).optional(),toolChoice:Xe.optional()}),H=l.extend({method:Z(`sampling/createMessage`),params:tt}),nt=f.extend({model:W(),stopReason:bT(hT([`endTurn`,`stopSequence`,`maxTokens`]).or(W())),role:re,content:Qe}),rt=f.extend({model:W(),stopReason:bT(hT([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(W())),role:re,content:Y([$e,q($e)])}),it=J({type:Z(`boolean`),title:W().optional(),description:W().optional(),default:K().optional()}),at=J({type:Z(`string`),title:W().optional(),description:W().optional(),minLength:G().optional(),maxLength:G().optional(),format:hT([`email`,`uri`,`date`,`date-time`]).optional(),default:W().optional()}),ot=J({type:hT([`number`,`integer`]),title:W().optional(),description:W().optional(),minimum:G().optional(),maximum:G().optional(),default:G().optional()}),st=J({type:Z(`string`),title:W().optional(),description:W().optional(),enum:q(W()),default:W().optional()}),ct=J({type:Z(`string`),title:W().optional(),description:W().optional(),oneOf:q(J({const:W(),title:W()})),default:W().optional()}),lt=J({type:Z(`string`),title:W().optional(),description:W().optional(),enum:q(W()),enumNames:q(W()).optional(),default:W().optional()}),ut=Y([st,ct]),dt=J({type:Z(`array`),title:W().optional(),description:W().optional(),minItems:G().optional(),maxItems:G().optional(),items:J({type:Z(`string`),enum:q(W())}),default:q(W()).optional()}),ft=J({type:Z(`array`),title:W().optional(),description:W().optional(),minItems:G().optional(),maxItems:G().optional(),items:J({anyOf:q(J({const:W(),title:W()}))}),default:q(W()).optional()}),pt=Y([dt,ft]),mt=Y([lt,ut,pt]),ht=Y([mt,it,at,ot]),gt=c.extend({mode:Z(`form`).optional(),message:W(),requestedSchema:J({type:Z(`object`),properties:X(W(),ht),required:q(W()).optional()}).catchall(nT())}),_t=c.extend({mode:Z(`url`),message:W(),elicitationId:W(),url:W().url()}),vt=Y([gt,_t]),yt=l.extend({method:Z(`elicitation/create`),params:vt}),bt=u.extend({elicitationId:W()}),xt=d.extend({method:Z(`notifications/elicitation/complete`),params:bt}),St=f.extend({action:hT([`accept`,`decline`,`cancel`]),content:KT(e=>e===null?void 0:e,X(W(),Y([W(),G(),K(),q(W())])).optional())}),Ct=J({type:Z(`ref/resource`),uri:W()}),wt=J({type:Z(`ref/prompt`),name:W()}),Tt=s.extend({ref:Y([wt,Ct]),argument:J({name:W(),value:W()}),context:J({arguments:X(W(),W()).optional()}).optional()}),Et=l.extend({method:Z(`completion/complete`),params:Tt}),Dt=f.extend({completion:sT({values:q(W()).max(100),total:bT(G().int()),hasMore:bT(K())})}),Ot=J({uri:W().startsWith(`file://`),name:W().optional(),_meta:X(W(),nT()).optional()}),kt=l.extend({method:Z(`roots/list`),params:s.optional()}),At=f.extend({roots:q(Ot)}),jt=d.extend({method:Z(`notifications/roots/list_changed`),params:u.optional()}),Mt=sT({ttl:G().optional(),pollInterval:G().optional()}),Nt=hT([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Pt=J({taskId:W(),status:Nt,ttl:Y([G(),Qw()]),createdAt:W(),lastUpdatedAt:W(),pollInterval:bT(G()),statusMessage:bT(W())}),Ft=f.extend({task:Pt}),It=u.merge(Pt),Lt=d.extend({method:Z(`notifications/tasks/status`),params:It}),Rt=l.extend({method:Z(`tasks/get`),params:s.extend({taskId:W()})}),zt=f.merge(Pt),Bt=l.extend({method:Z(`tasks/result`),params:s.extend({taskId:W()})}),Vt=f.loose(),Ht=F.extend({method:Z(`tasks/list`)}),Ut=ee.extend({tasks:q(Pt)}),Wt=l.extend({method:Z(`tasks/cancel`),params:s.extend({taskId:W()})});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:P,PaginatedRequestSchema:F,PaginatedResultSchema:ee,ResourceContentsSchema:I,TextResourceContentsSchema:te,BlobResourceContentsSchema:L,RoleSchema:re,AnnotationsSchema:R,ResourceSchema:ie,ResourceTemplateSchema:ae,ListResourcesRequestSchema:z,ListResourcesResultSchema:oe,ListResourceTemplatesRequestSchema:se,ListResourceTemplatesResultSchema:ce,ResourceRequestParamsSchema:le,ReadResourceRequestParamsSchema:ue,ReadResourceRequestSchema:B,ReadResourceResultSchema:de,ResourceListChangedNotificationSchema:fe,SubscribeRequestParamsSchema:pe,SubscribeRequestSchema:me,UnsubscribeRequestParamsSchema:he,UnsubscribeRequestSchema:ge,ResourceUpdatedNotificationParamsSchema:_e,ResourceUpdatedNotificationSchema:ve,PromptArgumentSchema:ye,PromptSchema:be,ListPromptsRequestSchema:xe,ListPromptsResultSchema:Se,GetPromptRequestParamsSchema:Ce,GetPromptRequestSchema:we,TextContentSchema:V,ImageContentSchema:Te,AudioContentSchema:Ee,ToolUseContentSchema:De,EmbeddedResourceSchema:Oe,ResourceLinkSchema:ke,ContentBlockSchema:Ae,PromptMessageSchema:je,GetPromptResultSchema:Me,PromptListChangedNotificationSchema:Ne,ToolAnnotationsSchema:Pe,ToolExecutionSchema:Fe,ToolSchema:Ie,ListToolsRequestSchema:Le,ListToolsResultSchema:Re,CallToolResultSchema:ze,CallToolRequestParamsSchema:Be,CallToolRequestSchema:Ve,ToolListChangedNotificationSchema:He,LoggingLevelSchema:Ue,SetLevelRequestParamsSchema:We,SetLevelRequestSchema:Ge,LoggingMessageNotificationParamsSchema:Ke,LoggingMessageNotificationSchema:qe,ModelHintSchema:Je,ModelPreferencesSchema:Ye,ToolChoiceSchema:Xe,ToolResultContentSchema:Ze,SamplingContentSchema:Qe,SamplingMessageContentBlockSchema:$e,SamplingMessageSchema:et,CreateMessageRequestParamsSchema:tt,CreateMessageRequestSchema:H,CreateMessageResultSchema:nt,CreateMessageResultWithToolsSchema:rt,BooleanSchemaSchema:it,StringSchemaSchema:at,NumberSchemaSchema:ot,UntitledSingleSelectEnumSchemaSchema:st,TitledSingleSelectEnumSchemaSchema:ct,LegacyTitledEnumSchemaSchema:lt,SingleSelectEnumSchemaSchema:ut,UntitledMultiSelectEnumSchemaSchema:dt,TitledMultiSelectEnumSchemaSchema:ft,MultiSelectEnumSchemaSchema:pt,EnumSchemaSchema:mt,PrimitiveSchemaDefinitionSchema:ht,ElicitRequestFormParamsSchema:gt,ElicitRequestURLParamsSchema:_t,ElicitRequestParamsSchema:vt,ElicitRequestSchema:yt,ElicitationCompleteNotificationParamsSchema:bt,ElicitationCompleteNotificationSchema:xt,ElicitResultSchema:St,ResourceTemplateReferenceSchema:Ct,PromptReferenceSchema:wt,CompleteRequestParamsSchema:Tt,CompleteRequestSchema:Et,CompleteResultSchema:Dt,RootSchema:Ot,ListRootsRequestSchema:kt,ListRootsResultSchema:At,RootsListChangedNotificationSchema:jt,TaskCreationParamsSchema:Mt,TaskStatusSchema:Nt,TaskSchema:Pt,CreateTaskResultSchema:Ft,TaskStatusNotificationParamsSchema:It,TaskStatusNotificationSchema:Lt,GetTaskRequestSchema:Rt,GetTaskResultSchema:zt,GetTaskPayloadRequestSchema:Bt,GetTaskPayloadResultSchema:Vt,ListTasksRequestSchema:Ht,ListTasksResultSchema:Ut,CancelTaskRequestSchema:Wt,CancelTaskResultSchema:f.merge(Pt),ClientRequestSchema:Y([A,E,Et,Ge,we,xe,z,se,B,me,ge,Ve,Le,Rt,Bt,Ht,Wt]),ClientNotificationSchema:Y([g,N,k,jt,Lt]),ClientResultSchema:Y([m,nt,rt,St,At,zt,Ut,Ft]),ServerRequestSchema:Y([A,H,yt,kt,Rt,Bt,Ht,Wt]),ServerNotificationSchema:Y([g,N,qe,ve,fe,He,Ne,Lt,xt]),ServerResultSchema:Y([m,O,Dt,Me,Se,oe,ce,de,ze,Re,zt,Ut,Ft]),CallToolResultWireSchema:nT().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of Pk)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(Fk).pipe(ze)}}var Lk;function Rk(){return Lk??=Ik()}function zk(e){return e.type!==`object`}var Bk=new Set([`const`,`enum`,`default`,`examples`]),Vk=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function Hk(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function Uk(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(Hk(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=ag(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&Hk(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=Bk.has(o)?s:Vk.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Wk={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},Gk={"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},Kk={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},qk;function Jk(){if(qk)return qk;let e=Rk();return qk={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}},qk}function Yk(e){return Object.prototype.hasOwnProperty.call(Wk,e)}function Xk(e){return Object.prototype.hasOwnProperty.call(Gk,e)}function Zk(e){return Object.prototype.hasOwnProperty.call(Kk,e)}function Qk(e){return Zk(e)?Jk().resultSchemas[e]:void 0}function $k(e){return Yk(e)?Jk().requestSchemas[e]:void 0}function eA(e){return Xk(e)?Jk().notificationSchemas[e]:void 0}Object.keys(Wk),Object.keys(Gk);function tA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function nA(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 rA={ok:!1,reason:`not-in-era`};function iA(e){return tA(e)&&tA(e.outputSchema)&&zk(e.outputSchema)}function aA(e){return e}var oA={era:`2025-11-25`,hasRequestMethod:Yk,hasNotificationMethod:Xk,validateRequest:(e,t)=>nA($k(e),t),validateResult:(e,t)=>nA(Qk(e),t),validateNotification:(e,t)=>nA(eA(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>rA,validateInputResponse:()=>rA,samplingResultVariant:((e,t)=>{let n=Rk();return nA(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=Nk(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&zk(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(tA(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:aA(e)}}return{kind:`complete`,result:aA(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>iA(e))?t:{...t,tools:n.map(e=>iA(e)?{...e,outputSchema:Uk(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function sA(){let e=zT(()=>Y([W(),G(),K(),Qw(),X(W(),e),q(e)])),t=X(W(),e),n=Y([W(),G().int()]),r=W(),i=Y([W(),G().int()]),a=hT([`user`,`assistant`]),o=hT([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=W().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=J({ttl:G().optional()}),l=J({taskId:W()}),u=sT({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:W(),params:p.loose().optional()}),h=J({src:W(),mimeType:W().optional(),sizes:q(W()).optional(),theme:hT([`light`,`dark`]).optional()}),g=J({icons:q(h).optional()}),_=J({name:W(),title:W().optional()}),v=_.extend({..._.shape,...g.shape,version:W(),websiteUrl:W().optional(),description:W().optional()}),y=KT(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,fT(J({form:fT(J({applyDefaults:K().optional()}),t).optional(),url:t.optional()}),t.optional())),b=sT({list:t.optional(),cancel:t.optional(),requests:sT({sampling:sT({createMessage:t.optional()}).optional(),elicitation:sT({create:t.optional()}).optional()}).optional()}),x=sT({list:t.optional(),cancel:t.optional(),requests:sT({tools:sT({call:t.optional()}).optional()}).optional()}),S=J({experimental:X(W(),t).optional(),sampling:J({context:t.optional(),tools:t.optional()}).optional(),elicitation:y.optional(),roots:J({listChanged:K().optional()}).optional(),tasks:b.optional(),extensions:X(W(),t).optional()}),C=J({experimental:X(W(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:J({listChanged:K().optional()}).optional(),resources:J({subscribe:K().optional(),listChanged:K().optional()}).optional(),tools:J({listChanged:K().optional()}).optional(),tasks:x.optional(),extensions:X(W(),t).optional()}),w=J({progress:G(),total:bT(G()),message:bT(W())}),T=J({...p.shape,...w.shape,progressToken:n}),E=m.extend({method:Z(`notifications/progress`),params:T}),D=p.extend({level:o,logger:W().optional(),data:nT()}),O=m.extend({method:Z(`notifications/message`),params:D}),k=J({uri:W(),mimeType:bT(W()),_meta:X(W(),nT()).optional()}),A=k.extend({text:W()}),j=k.extend({blob:s}),M=J({audience:q(a).optional(),priority:G().min(0).max(1).optional(),lastModified:YT({offset:!0}).optional()}),N=J({..._.shape,...g.shape,uri:W(),description:bT(W()),mimeType:bT(W()),size:bT(G()),annotations:M.optional(),_meta:bT(sT({}))}),P=J({..._.shape,...g.shape,uriTemplate:W(),description:bT(W()),mimeType:bT(W()),annotations:M.optional(),_meta:bT(sT({}))}),F=m.extend({method:Z(`notifications/resources/list_changed`),params:p.optional()}),ee=p.extend({uri:W()}),I=m.extend({method:Z(`notifications/resources/updated`),params:ee}),te=J({name:W(),description:bT(W()),required:bT(K())}),ne=J({..._.shape,...g.shape,description:bT(W()),arguments:bT(q(te)),_meta:bT(sT({}))}),L=m.extend({method:Z(`notifications/prompts/list_changed`),params:p.optional()}),re=J({type:Z(`text`),text:W(),annotations:M.optional(),_meta:X(W(),nT()).optional()}),R=J({type:Z(`image`),data:s,mimeType:W(),annotations:M.optional(),_meta:X(W(),nT()).optional()}),ie=J({type:Z(`audio`),data:s,mimeType:W(),annotations:M.optional(),_meta:X(W(),nT()).optional()}),ae=J({type:Z(`tool_use`),name:W(),id:W(),input:X(W(),nT()),_meta:X(W(),nT()).optional()}),z=J({type:Z(`resource`),resource:Y([A,j]),annotations:M.optional(),_meta:X(W(),nT()).optional()}),oe=N.extend({type:Z(`resource_link`)}),se=Y([re,R,ie,oe,z]),ce=J({role:a,content:se}),le=J({title:W().optional(),readOnlyHint:K().optional(),destructiveHint:K().optional(),idempotentHint:K().optional(),openWorldHint:K().optional()}),ue=m.extend({method:Z(`notifications/tools/list_changed`),params:p.optional()}),B=J({name:W().optional()}),de=J({hints:q(B).optional(),costPriority:G().min(0).max(1).optional(),speedPriority:G().min(0).max(1).optional(),intelligencePriority:G().min(0).max(1).optional()}),fe=J({mode:hT([`auto`,`required`,`none`]).optional()}),pe=J({type:Z(`boolean`),title:W().optional(),description:W().optional(),default:K().optional()}),me=J({type:Z(`string`),title:W().optional(),description:W().optional(),minLength:G().optional(),maxLength:G().optional(),format:hT([`email`,`uri`,`date`,`date-time`]).optional(),default:W().optional()}),he=J({type:hT([`number`,`integer`]),title:W().optional(),description:W().optional(),minimum:G().optional(),maximum:G().optional(),default:G().optional()}),ge=J({type:Z(`string`),title:W().optional(),description:W().optional(),enum:q(W()),default:W().optional()}),_e=J({type:Z(`string`),title:W().optional(),description:W().optional(),oneOf:q(J({const:W(),title:W()})),default:W().optional()}),ve=J({type:Z(`string`),title:W().optional(),description:W().optional(),enum:q(W()),enumNames:q(W()).optional(),default:W().optional()}),ye=Y([ge,_e]),be=J({type:Z(`array`),title:W().optional(),description:W().optional(),minItems:G().optional(),maxItems:G().optional(),items:J({type:Z(`string`),enum:q(W())}),default:q(W()).optional()}),xe=J({type:Z(`array`),title:W().optional(),description:W().optional(),minItems:G().optional(),maxItems:G().optional(),items:J({anyOf:q(J({const:W(),title:W()}))}),default:q(W()).optional()}),Se=Y([be,xe]),Ce=Y([ve,ye,Se]),we=Y([Ce,pe,me,he]),V=f.extend({mode:Z(`form`).optional(),message:W(),requestedSchema:J({type:Z(`object`),properties:X(W(),we),required:q(W()).optional()}).catchall(nT())}),Te=J({type:Z(`ref/resource`),uri:W()}),Ee=J({type:Z(`ref/prompt`),name:W()}),De=J({uri:W().startsWith(`file://`),name:W().optional(),_meta:X(W(),nT()).optional()}),Oe=S.shape,ke=J({experimental:Oe.experimental,sampling:Oe.sampling,elicitation:Oe.elicitation,roots:Oe.roots,extensions:Oe.extensions}),Ae=C.shape,je=J({experimental:Ae.experimental,logging:Ae.logging,completions:Ae.completions,prompts:Ae.prompts,resources:Ae.resources,tools:Ae.tools,extensions:Ae.extensions}),Me=sT({progressToken:n.optional(),[eE]:W(),[tE]:v.optional(),[rE]:ke,[aE]:o.optional()}),Ne=J({..._.shape,...g.shape,description:W().optional(),inputSchema:sT({$schema:W().optional(),type:Z(`object`)}),outputSchema:sT({$schema:W().optional()}).optional(),annotations:le.optional(),_meta:X(W(),nT()).optional()}),Pe=J({type:Z(`tool_result`),toolUseId:W(),content:q(se),structuredContent:nT().optional(),isError:K().optional(),_meta:X(W(),nT()).optional()}),Fe=Y([re,R,ie,ae,Pe]),Ie=J({role:a,content:Y([Fe,q(Fe)]),_meta:X(W(),nT()).optional()}),Le=W(),Re=sT({[nE]:v.optional().catch(void 0)}),ze=Re.optional();function Be(e){return sT({_meta:ze,resultType:Le.default(`complete`),...e})}let Ve=Be({}),He=Be({nextCursor:r.optional()}),Ue=Be({content:q(se),structuredContent:nT().optional(),isError:K().optional()}),We=Be({ttlMs:G().int().min(0),cacheScope:hT([`public`,`private`]),tools:q(Ne),nextCursor:r.optional()}),Ge=Be({ttlMs:G().int().min(0),cacheScope:hT([`public`,`private`]),prompts:q(ne),nextCursor:r.optional()}),Ke=Be({description:W().optional(),messages:q(ce)}),qe=Be({ttlMs:G().int().min(0),cacheScope:hT([`public`,`private`]),resources:q(N),nextCursor:r.optional()}),Je=Be({ttlMs:G().int().min(0),cacheScope:hT([`public`,`private`]),resourceTemplates:q(P),nextCursor:r.optional()}),Ye=Be({ttlMs:G().int().min(0),cacheScope:hT([`public`,`private`]),contents:q(Y([A,j]))}),Xe=Be({completion:J({values:q(W()).max(100),total:G().int().optional(),hasMore:K().optional()}).loose()}),Ze=Be({ttlMs:G().int().min(0),cacheScope:hT([`public`,`private`])}),Qe=Be({ttlMs:G().int().min(0).catch(0),cacheScope:hT([`public`,`private`]).catch(`private`),supportedVersions:q(W()),capabilities:je,instructions:W().optional()}),$e=J({messages:q(Ie),modelPreferences:de.optional(),systemPrompt:W().optional(),includeContext:hT([`none`,`thisServer`,`allServers`]).optional(),temperature:G().optional(),maxTokens:G().int(),stopSequences:q(W()).optional(),metadata:t.optional(),tools:q(Ne).optional(),toolChoice:fe.optional()}),et=J({method:Z(`sampling/createMessage`),params:$e}),tt=J({method:Z(`roots/list`),params:J({_meta:X(W(),nT()).optional()}).optional()}),H=J({...Ie.shape,model:W(),stopReason:W().optional()}),nt=J({roots:q(De)}),rt=J({action:hT([`accept`,`decline`,`cancel`]),content:X(W(),Y([W(),G(),K(),q(W())])).optional()}),it=J({mode:Z(`url`),message:W(),url:W().url()}),at=Y([V,it]),ot=J({method:Z(`elicitation/create`),params:at}),st=Y([et,tt,ot]),ct=Y([H,nt,rt]),lt=X(W(),st),ut=X(W(),ct),dt=Be({inputRequests:lt.optional(),requestState:W().optional()}),ft={inputResponses:ut.optional(),requestState:W().optional()},pt=J({_meta:Me,...ft}),mt=sT({progressToken:n.optional()});function ht(e,t){return J({method:Z(e),params:J({_meta:Me,...t})})}function gt(e,t){return J({method:Z(e),params:J({_meta:mt.optional(),...t}).optional()})}let _t={name:W(),arguments:X(W(),nT()).optional(),...ft},vt={cursor:r.optional()},yt=ht(`tools/call`,_t),bt=ht(`tools/list`,vt),xt=ht(`prompts/list`,vt),St=ht(`prompts/get`,{name:W(),arguments:X(W(),W()).optional(),...ft}),Ct=ht(`resources/list`,vt),wt=ht(`resources/templates/list`,vt),Tt=ht(`resources/read`,{uri:W(),...ft}),Et={ref:Y([Ee,Te]),argument:J({name:W(),value:W()}),context:J({arguments:X(W(),W()).optional()}).optional()},Dt=ht(`completion/complete`,Et),Ot=ht(`server/discover`,{}),kt=J({toolsListChanged:K().optional(),promptsListChanged:K().optional(),resourcesListChanged:K().optional(),resourceSubscriptions:q(W()).optional()}),At={notifications:kt},jt=ht(`subscriptions/listen`,At),Mt=Re.extend({"io.modelcontextprotocol/subscriptionId":i}),Nt=sT({_meta:Mt,resultType:Le.default(`complete`)}),Pt={"tools/call":gt(`tools/call`,_t),"tools/list":gt(`tools/list`,vt),"prompts/get":gt(`prompts/get`,{name:W(),arguments:X(W(),W()).optional()}),"prompts/list":gt(`prompts/list`,vt),"resources/list":gt(`resources/list`,vt),"resources/templates/list":gt(`resources/templates/list`,vt),"resources/read":gt(`resources/read`,{uri:W()}),"completion/complete":gt(`completion/complete`,Et),"server/discover":gt(`server/discover`,{}),"subscriptions/listen":gt(`subscriptions/listen`,At)};function Ft(e){return sT({_meta:ze,...e})}let It={"tools/call":Ft({content:q(se),structuredContent:nT().optional(),isError:K().optional()}),"tools/list":Ft({ttlMs:G().int().min(0),cacheScope:hT([`public`,`private`]),tools:q(Ne),nextCursor:r.optional()}),"prompts/get":Ft({description:W().optional(),messages:q(ce)}),"prompts/list":Ft({ttlMs:G().int().min(0),cacheScope:hT([`public`,`private`]),prompts:q(ne),nextCursor:r.optional()}),"resources/list":Ft({ttlMs:G().int().min(0),cacheScope:hT([`public`,`private`]),resources:q(N),nextCursor:r.optional()}),"resources/templates/list":Ft({ttlMs:G().int().min(0),cacheScope:hT([`public`,`private`]),resourceTemplates:q(P),nextCursor:r.optional()}),"resources/read":Ft({ttlMs:G().int().min(0),cacheScope:hT([`public`,`private`]),contents:q(Y([A,j]))}),"completion/complete":Ft({completion:J({values:q(W()).max(100),total:G().int().optional(),hasMore:K().optional()}).loose()}),"server/discover":Ft({ttlMs:G().int().min(0).catch(0),cacheScope:hT([`public`,`private`]).catch(`private`),supportedVersions:q(W()),capabilities:je,instructions:W().optional()}),"subscriptions/listen":Ft({})},Lt=sT({"io.modelcontextprotocol/subscriptionId":i.optional()}),Rt=J({method:Z(`notifications/subscriptions/acknowledged`),params:J({_meta:Lt.optional(),notifications:kt})}),zt=J({_meta:Lt.optional(),requestId:i,reason:W().optional()}),Bt=J({method:Z(`notifications/cancelled`),params:zt}),Vt={"notifications/cancelled":Bt,"notifications/progress":E,"notifications/message":O,"notifications/resources/updated":I,"notifications/resources/list_changed":F,"notifications/tools/list_changed":ue,"notifications/prompts/list_changed":L,"notifications/subscriptions/acknowledged":Rt},Ht=e=>J({jsonrpc:Z(`2.0`),id:Y([W(),G().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:P,ResourceListChangedNotificationSchema:F,ResourceUpdatedNotificationParamsSchema:ee,ResourceUpdatedNotificationSchema:I,PromptArgumentSchema:te,PromptSchema:ne,PromptListChangedNotificationSchema:L,TextContentSchema:re,ImageContentSchema:R,AudioContentSchema:ie,ToolUseContentSchema:ae,EmbeddedResourceSchema:z,ResourceLinkSchema:oe,ContentBlockSchema:se,PromptMessageSchema:ce,ToolAnnotationsSchema:le,ToolListChangedNotificationSchema:ue,ModelHintSchema:B,ModelPreferencesSchema:de,ToolChoiceSchema:fe,BooleanSchemaSchema:pe,StringSchemaSchema:me,NumberSchemaSchema:he,UntitledSingleSelectEnumSchemaSchema:ge,TitledSingleSelectEnumSchemaSchema:_e,LegacyTitledEnumSchemaSchema:ve,SingleSelectEnumSchemaSchema:ye,UntitledMultiSelectEnumSchemaSchema:be,TitledMultiSelectEnumSchemaSchema:xe,MultiSelectEnumSchemaSchema:Se,EnumSchemaSchema:Ce,PrimitiveSchemaDefinitionSchema:we,ElicitRequestFormParamsSchema:V,ResourceTemplateReferenceSchema:Te,PromptReferenceSchema:Ee,RootSchema:De,ClientCapabilities2026Schema:ke,ServerCapabilities2026Schema:je,RequestMetaEnvelopeSchema:Me,ToolSchema:Ne,ToolResultContentSchema:Pe,SamplingMessageContentBlockSchema:Fe,SamplingMessageSchema:Ie,ResultTypeSchema:Le,ResultMetaSchema:Re,ResultSchema:Ve,PaginatedResultSchema:He,CallToolResultSchema:Ue,ListToolsResultSchema:We,ListPromptsResultSchema:Ge,GetPromptResultSchema:Ke,ListResourcesResultSchema:qe,ListResourceTemplatesResultSchema:Je,ReadResourceResultSchema:Ye,CompleteResultSchema:Xe,CacheableResultSchema:Ze,DiscoverResultSchema:Qe,CreateMessageRequestParamsSchema:$e,CreateMessageRequestSchema:et,ListRootsRequestSchema:tt,CreateMessageResultSchema:H,ListRootsResultSchema:nt,ElicitResultSchema:rt,ElicitRequestURLParamsSchema:it,ElicitRequestParamsSchema:at,ElicitRequestSchema:ot,InputRequestSchema:st,InputResponseSchema:ct,InputRequestsSchema:lt,InputResponsesSchema:ut,InputRequiredResultSchema:dt,InputResponseRequestParamsSchema:pt,CallToolRequestSchema:yt,ListToolsRequestSchema:bt,ListPromptsRequestSchema:xt,GetPromptRequestSchema:St,ListResourcesRequestSchema:Ct,ListResourceTemplatesRequestSchema:wt,ReadResourceRequestSchema:Tt,CompleteRequestSchema:Dt,DiscoverRequestSchema:Ot,SubscriptionFilterSchema:kt,SubscriptionsListenRequestSchema:jt,SubscriptionsListenResultMetaSchema:Mt,SubscriptionsListenResultSchema:Nt,dispatchRequestSchemas:Pt,dispatchResultSchemas:It,NotificationMetaSchema:Lt,SubscriptionsAcknowledgedNotificationSchema:Rt,CancelledNotificationParamsSchema:zt,CancelledNotificationSchema:Bt,notificationSchemas2026:Vt,JSONRPCResultResponseSchema:Ht(Ve),CallToolResultResponseSchema:Ht(Y([Ue,dt])),ListToolsResultResponseSchema:Ht(We),ListPromptsResultResponseSchema:Ht(Ge),GetPromptResultResponseSchema:Ht(Y([Ke,dt])),ListResourcesResultResponseSchema:Ht(qe),ListResourceTemplatesResultResponseSchema:Ht(Je),ReadResourceResultResponseSchema:Ht(Y([Ye,dt])),CompleteResultResponseSchema:Ht(Xe),DiscoverResultResponseSchema:Ht(Qe),SubscriptionsListenResultResponseSchema:Ht(Nt)}}var cA;function lA(){return cA??=sA()}var uA=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function dA(e){return uA.includes(e)}var fA=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function pA(e){return e[fA]}function mA(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function hA(e){return e===`public`||e===`private`}var gA=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}({}),_A=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return Ok(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 Ok(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Dk(this,new.target)}static fromError(t,n,r){if(t===gA.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new yA(e.elicitations,n)}if(t===gA.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new bA({supported:e.supported,requested:e.requested},n)}if(t===gA.InvalidParams||t===gA.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===gA.ResourceNotFound||Object.keys(e).length===1))return new vA(e.uri,n)}if(t===gA.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new xA({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},vA=class extends _A{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(gA.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},yA=class extends _A{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(gA.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},bA=class extends _A{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(gA.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},xA=class extends _A{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(gA.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},SA=0,CA=`private`,wA=[`tools/call`,`prompts/get`,`resources/read`];function TA(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||wA.includes(e))return t;throw new _A(gA.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function EA(e,t){let n=pA(t);if(t.resultType!==`complete`||!dA(e))return n===void 0?t:jA(t);let r=t,i=mA(r.ttlMs)?r.ttlMs:kA(n),a=hA(r.cacheScope)?r.cacheScope:AA(n),o={...r,ttlMs:i,cacheScope:a};return delete o[fA],o}function DA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function OA(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[nE]:t}}:!DA(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[nE]:t}}}function kA(e){return e!==void 0&&mA(e.ttlMs)?e.ttlMs:SA}function AA(e){return e!==void 0&&hA(e.cacheScope)?e.cacheScope:CA}function jA(e){let t={...e};return delete t[fA],t}var MA=[`elicitation/create`,`sampling/createMessage`,`roots/list`],NA;function PA(){if(NA)return NA;let e=lA();return NA={request:{"elicitation/create":J({method:Z(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":J({method:Z(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":J({method:Z(`roots/list`),params:sT({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},NA}function FA(e){return MA.includes(e)}function IA(e){return FA(e)?PA().request[e]:void 0}function LA(e){return FA(e)?PA().response[e]:void 0}var RA={"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},zA={"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 BA(e){return Object.prototype.hasOwnProperty.call(RA,e)}function VA(e){return Object.prototype.hasOwnProperty.call(zA,e)}function HA(e){return Object.prototype.hasOwnProperty.call(RA,e)}function UA(e){return BA(e)?lA().dispatchRequestSchemas[e]:void 0}function WA(e){return HA(e)?lA().dispatchResultSchemas[e]:void 0}function GA(e){return VA(e)?lA().notificationSchemas2026[e]:void 0}Object.keys(RA),Object.keys(zA);function KA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function qA(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 JA={ok:!1,reason:`not-in-era`},YA=[eE,rE];function XA(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=>KA(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!KA(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(KA(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var ZA={era:`2026-07-28`,hasRequestMethod:BA,hasNotificationMethod:VA,hasInputRequestMethod:e=>IA(e)!==void 0,validateRequest:(e,t)=>qA(UA(e),t),validateResult:(e,t)=>qA(WA(e),t),validateNotification:(e,t)=>qA(GA(e),t),validateInputRequest:(e,t)=>qA(IA(e),t),validateInputResponse:(e,t)=>qA(LA(e),t),samplingResultVariant:()=>JA,outboundEnvelope(e){return{[eE]:e.protocolVersion,[tE]:e.clientInfo,[rE]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of YA)n in e||t.push({key:n,problem:`missing`});let n=lA().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=>Nk(e),inputRequestSchema:IA,decodeResult(e,t){if(!KA(t))return{kind:`invalid`,error:new Ak(kk.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Ak(kk.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 Ak(kk.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=KA(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:lA().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Ak(kk.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},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Ak(kk.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=$A(),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 Ak(kk.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 OA(EA(e,TA(e,XA(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=lA().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(`; `)}`}},QA;function $A(){if(QA)return QA;let e=lA();return QA={"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},QA}var ej=`2026-07-28`;function tj(e){return e!==void 0&&Mk(e)?ZA:oA}function nj(e){return e.revision===void 0?e.era===`modern`?ZA.era:oA.era:tj(e.revision).era}function rj(e){return oj.some(t=>t.hasRequestMethod(e))}function ij(e){return oj.some(t=>t.hasNotificationMethod(e))}function aj(e){return e===`tasks/get`||e===`tasks/cancel`}var oj=[oA,ZA],sj=rg({AnnotationsSchema:()=>iD,AudioContentSchema:()=>LD,BaseMetadataSchema:()=>NE,BaseRequestParamsSchema:()=>mE,BlobResourceContentsSchema:()=>nD,BooleanSchemaSchema:()=>vO,CallToolRequestParamsSchema:()=>QD,CallToolRequestSchema:()=>$D,CallToolResultSchema:()=>XD,CancelTaskRequestSchema:()=>ik,CancelTaskResultSchema:()=>ak,CancelledNotificationParamsSchema:()=>kE,CancelledNotificationSchema:()=>AE,ClientCapabilitiesSchema:()=>RE,ClientNotificationSchema:()=>sk,ClientRequestSchema:()=>ok,ClientResultSchema:()=>ck,ClientTasksCapabilitySchema:()=>IE,CompatibilityCallToolResultSchema:()=>ZD,CompleteRequestParamsSchema:()=>zO,CompleteRequestSchema:()=>BO,CompleteResultSchema:()=>VO,ContentBlockSchema:()=>VD,CreateMessageRequestParamsSchema:()=>mO,CreateMessageRequestSchema:()=>hO,CreateMessageResultSchema:()=>gO,CreateMessageResultWithToolsSchema:()=>_O,CreateTaskResultSchema:()=>YO,CursorSchema:()=>uE,DiscoverRequestSchema:()=>WE,DiscoverResultSchema:()=>GE,ElicitRequestFormParamsSchema:()=>AO,ElicitRequestParamsSchema:()=>MO,ElicitRequestSchema:()=>NO,ElicitRequestURLParamsSchema:()=>jO,ElicitResultSchema:()=>IO,ElicitationCompleteNotificationParamsSchema:()=>PO,ElicitationCompleteNotificationSchema:()=>FO,EmbeddedResourceSchema:()=>zD,EmptyResultSchema:()=>OE,EnumSchemaSchema:()=>OO,GetPromptRequestParamsSchema:()=>ND,GetPromptRequestSchema:()=>PD,GetPromptResultSchema:()=>UD,GetTaskPayloadRequestSchema:()=>ek,GetTaskPayloadResultSchema:()=>tk,GetTaskRequestSchema:()=>QO,GetTaskResultSchema:()=>$O,IconSchema:()=>jE,IconsSchema:()=>ME,ImageContentSchema:()=>ID,ImplementationSchema:()=>PE,InitializeRequestParamsSchema:()=>zE,InitializeRequestSchema:()=>BE,InitializeResultSchema:()=>HE,InitializedNotificationSchema:()=>UE,JSONArraySchema:()=>cE,JSONObjectSchema:()=>sE,JSONRPCErrorResponseSchema:()=>TE,JSONRPCMessageSchema:()=>EE,JSONRPCNotificationSchema:()=>CE,JSONRPCRequestSchema:()=>SE,JSONRPCResponseSchema:()=>DE,JSONRPCResultResponseSchema:()=>wE,JSONValueSchema:()=>oE,LegacyTitledEnumSchemaSchema:()=>CO,ListChangedOptionsBaseSchema:()=>tO,ListPromptsRequestSchema:()=>jD,ListPromptsResultSchema:()=>MD,ListResourceTemplatesRequestSchema:()=>lD,ListResourceTemplatesResultSchema:()=>uD,ListResourcesRequestSchema:()=>sD,ListResourcesResultSchema:()=>cD,ListRootsRequestSchema:()=>UO,ListRootsResultSchema:()=>WO,ListTasksRequestSchema:()=>nk,ListTasksResultSchema:()=>rk,ListToolsRequestSchema:()=>JD,ListToolsResultSchema:()=>YD,LoggingLevelSchema:()=>nO,LoggingMessageNotificationParamsSchema:()=>aO,LoggingMessageNotificationSchema:()=>oO,ModelHintSchema:()=>sO,ModelPreferencesSchema:()=>cO,MultiSelectEnumSchemaSchema:()=>DO,NotificationSchema:()=>vE,NotificationsParamsSchema:()=>_E,NumberSchemaSchema:()=>bO,PaginatedRequestParamsSchema:()=>XE,PaginatedRequestSchema:()=>ZE,PaginatedResultSchema:()=>QE,PingRequestSchema:()=>KE,PrimitiveSchemaDefinitionSchema:()=>kO,ProgressNotificationParamsSchema:()=>JE,ProgressNotificationSchema:()=>YE,ProgressSchema:()=>qE,ProgressTokenSchema:()=>lE,PromptArgumentSchema:()=>kD,PromptListChangedNotificationSchema:()=>WD,PromptMessageSchema:()=>HD,PromptReferenceSchema:()=>RO,PromptSchema:()=>AD,ReadResourceRequestParamsSchema:()=>fD,ReadResourceRequestSchema:()=>pD,ReadResourceResultSchema:()=>mD,RelatedTaskMetadataSchema:()=>fE,RequestIdSchema:()=>xE,RequestMetaSchema:()=>pE,RequestSchema:()=>gE,ResourceContentsSchema:()=>$E,ResourceLinkSchema:()=>BD,ResourceListChangedNotificationSchema:()=>hD,ResourceRequestParamsSchema:()=>dD,ResourceSchema:()=>aD,ResourceTemplateReferenceSchema:()=>LO,ResourceTemplateSchema:()=>oD,ResourceUpdatedNotificationParamsSchema:()=>DD,ResourceUpdatedNotificationSchema:()=>OD,ResultMetaObjectSchema:()=>yE,ResultSchema:()=>bE,RoleSchema:()=>rD,RootSchema:()=>HO,RootsListChangedNotificationSchema:()=>GO,SamplingContentSchema:()=>dO,SamplingMessageContentBlockSchema:()=>fO,SamplingMessageSchema:()=>pO,ServerCapabilitiesSchema:()=>VE,ServerNotificationSchema:()=>uk,ServerRequestSchema:()=>lk,ServerResultSchema:()=>dk,ServerTasksCapabilitySchema:()=>LE,SetLevelRequestParamsSchema:()=>rO,SetLevelRequestSchema:()=>iO,SingleSelectEnumSchemaSchema:()=>wO,StringSchemaSchema:()=>yO,SubscribeRequestParamsSchema:()=>gD,SubscribeRequestSchema:()=>_D,SubscriptionFilterSchema:()=>bD,SubscriptionsAcknowledgedNotificationParamsSchema:()=>CD,SubscriptionsAcknowledgedNotificationSchema:()=>wD,SubscriptionsListenRequestParamsSchema:()=>xD,SubscriptionsListenRequestSchema:()=>SD,SubscriptionsListenResultMetaSchema:()=>TD,SubscriptionsListenResultSchema:()=>ED,TaskAugmentedRequestParamsSchema:()=>hE,TaskCreationParamsSchema:()=>KO,TaskMetadataSchema:()=>dE,TaskSchema:()=>JO,TaskStatusNotificationParamsSchema:()=>XO,TaskStatusNotificationSchema:()=>ZO,TaskStatusSchema:()=>qO,TextContentSchema:()=>FD,TextResourceContentsSchema:()=>eD,TitledMultiSelectEnumSchemaSchema:()=>EO,TitledSingleSelectEnumSchemaSchema:()=>SO,ToolAnnotationsSchema:()=>GD,ToolChoiceSchema:()=>lO,ToolExecutionSchema:()=>KD,ToolListChangedNotificationSchema:()=>eO,ToolResultContentSchema:()=>uO,ToolSchema:()=>qD,ToolUseContentSchema:()=>RD,UnsubscribeRequestParamsSchema:()=>vD,UnsubscribeRequestSchema:()=>yD,UntitledMultiSelectEnumSchemaSchema:()=>TO,UntitledSingleSelectEnumSchemaSchema:()=>xO}),cj=e=>SE.safeParse(e).success,lj=e=>CE.safeParse(e).success,uj=e=>wE.safeParse(e).success,dj=e=>TE.safeParse(e).success;gA.InvalidRequest,gA.UnsupportedProtocolVersion,gA.InvalidParams,gA.MethodNotFound,gA.InvalidParams,gA.MissingRequiredClientCapability,gA.ParseError,gA.InvalidRequest,gA.MethodNotFound,gA.UnsupportedProtocolVersion,gA.MissingRequiredClientCapability;function fj(e,t){return iw(e,t)}function pj(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function mj(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 hj=!1,gj=`draft-2020-12`;function _j(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:gj});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().`);hj||(hj=!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=QC(e,{target:gj,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&&yj(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}}var vj=/^#\/(\$defs|definitions)\/([^/~%]+)$/;function yj(e,t=e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;let n=typeof e.$ref==`string`&&vj.exec(e.$ref);if(n&&t[n[1]]?.[n[2]]?.type===`object`)return!0;for(let n of[`oneOf`,`anyOf`,`allOf`]){let r=e[n];if(Array.isArray(r)&&r.length>0)return r.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||yj(e,`$id`in e?{}:t)))}return!1}function bj(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function xj(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>bj(e)).join(`, `)}:{success:!0,data:n.value}}function Sj(e){let t=QC(e,{target:gj,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var Cj=/\\\.\\d\{(\d+)\}/;function wj(e){let t=Cj.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=>YT({local:e,offset:t,precision:n}))))}function Tj(e,t){let n;switch(e){case`email`:n=[Tw()];break;case`uri`:n=[kw()];break;case`date`:n=[XT()];break;case`date-time`:n=wj(t)}return new Set(n.map(e=>Sj(e)).filter(e=>e!==void 0))}function Ej(e,t,n){return n!==`zod`||Tj(e,t).has(t)}function Dj(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Oj(e){try{return _j(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new _A(gA.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var kj=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Aj(e){return kj.has(e)||e.startsWith(`x-`)}var jj=new Set([`$schema`,...Object.keys(AO.shape.requestedSchema.shape)]),Mj={string:pj([yO,xO,SO,CO]),number:pj([bO]),integer:pj([bO]),boolean:pj([vO]),array:pj([TO,EO])},Nj=new Set(yO.shape.format.unwrap().options);function Pj(e,t,n,r){if(!Dj(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(Mj,e.type)?Mj[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Aj(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?Nj.has(e.format)?typeof s==`string`&&Ej(e.format,s,n)||r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function Fj(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&Dj(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,Pj(n,`properties.${e}`,t,r)])):jj.has(i)?n[i]=a:Aj(i)||r.push(i);if(r.length>0)throw new _A(gA.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function Ij(e,t){if(!Dj(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!fj(kO,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Lj(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Lj(e,t[r],`${n}[${r}]`)):!Dj(e)||!Dj(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Lj(r,t[e],i):Aj(e)?[]:[i]})}function Rj(e){if(!mj(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=Fj(Oj(e.requestedSchema),t),r=fj(AO.shape.requestedSchema,n);if(!r.success)throw new _A(gA.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Ij(n,r.error.message)}`);let i=Lj(n,r.data);if(i.length>0)throw new _A(gA.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 _A(gA.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function zj(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(zj,{elicit(e){try{return{method:`elicitation/create`,params:Rj(e)}}catch(e){throw e instanceof _A?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`}}});var Bj=`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(`.`),Vj={IdJagTokenExchangeResponseSchema:vk,OAuthClientInformationFullSchema:Ck,OAuthClientInformationSchema:Sk,OAuthClientMetadataSchema:xk,OAuthClientRegistrationErrorSchema:wk,OAuthErrorResponseSchema:yk,OAuthMetadataSchema:mk,OAuthProtectedResourceMetadataSchema:pk,OAuthTokenRevocationRequestSchema:Tk,OAuthTokensSchema:_k,OpenIdProviderDiscoveryMetadataSchema:gk,OpenIdProviderMetadataSchema:hk},Hj={},Uj={};function Wj(e,t){let n=e.slice(0,-6);Hj[n]=t,Uj[n]=e=>t.safeParse(e).success}for(let e of Bj)Wj(e,sj[e]);for(let[e,t]of Object.entries(Vj))Wj(e,t);Object.freeze(Hj),Object.freeze(Uj);function Gj(e){switch(e){case`initialize`:case`notifications/initialized`:return tj(void 0);case`server/discover`:return tj(ej);default:return}}var Kj=[eE,tE,rE,aE],qj=[`inputResponses`,`requestState`];function Jj(e,t){let n=e.params;if(!$j(n))return{message:e,lifted:{}};let r=n._meta,i=$j(r)?Kj.filter(e=>e in r):[],a=t===`request`?qj.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&$j(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 Yj(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 Xj(e){return()=>e}var Zj=Xj(void 0),Qj=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_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??QT,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 Ak(kk.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!==void 0&&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 Ak(kk.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),uj(e)||dj(e)?this._onresponse(e):cj(e)?this._onrequest(e,t):lj(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 Ak(kk.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}=Jj(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=nj(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(ij(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}=Jj(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=nj(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(gA.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(rj(n.method)&&!i.hasRequestMethod(n.method)&&!(aj(n.method)&&this._customSchemaRequestMethods.has(n.method))){o(gA.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(gA.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(gA.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:tM(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?Zj:Xj(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),mj(t))return u(e,t,n);let i=Yj(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(gA.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:gA.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);n===void 0?this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`)):(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),uj(e)?n(e):n(_A.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(mj(t))return aj(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n);this._assertOutboundRequestInEra(r,e.method);let i=Yj(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 tj(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Gj(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(rj(t)&&!e.hasRequestMethod(t))throw new Ak(kk.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 Ak?e:new Ak(kk.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?t.method!==`initialize`&&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 Ak?e:new Ak(kk.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(nM(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;xj(n,o).then(e=>{e.success?d(e.data):f(new Ak(kk.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 Ak(kk.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 await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Ak(kk.NotConnected,`Not connected`);if(ij(t.method)&&!e.hasNotificationMethod(t.method))throw new Ak(kk.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===void 0){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))})}else await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!rj(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 _A(gA.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 xj(t.params,{...r.params});if(!a.success)throw new _A(gA.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);typeof t==`function`?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.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(!ij(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 _A(gA.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))})}else{if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await xj(t.params,{...r.params});if(!i.success)throw new _A(gA.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function $j(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function eM(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function tM(e){let t={},n=[];if(!eM(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e))!eM(i)||`method`in i||`result`in i?n.push(r):t[r]=i;return{accepted:t,droppedKeys:n}}function nM(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}ng((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}}))(),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`);var rM=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,iM=/^(?=.{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,aM=/^(?:[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,oM=/^(?:(?:[^\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,sM=/^(?:(?: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,cM=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,lM=/^(?:\/(?:[^~/]|~0|~1)*)*$/,uM=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,dM=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,fM=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,pM=/^((([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;function mM(e){return e.test.bind(e)}hM.bind(void 0,!1),mM(aM),mM(oM),mM(sM),mM(iM),mM(fM),mM(pM),mM(cM),mM(lM),mM(uM),mM(dM);function hM(e,t){let n=t.match(rM);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)}globalThis.crypto;var gM=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return Ok(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 Ok(this,e)}constructor(e){super(e),this.name=new.target.name,Dk(this,new.target)}};(class extends gM{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}}),class extends gM{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}},class extends gM{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 / *.localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},class extends gM{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`),this.recordedIssuer=e,this.currentIssuer=t}},class extends gM{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}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return Ok(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 Ok(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,Dk(this,new.target)}};var _M=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},vM=10,yM=13,bM=32;function xM(e){}function SM(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=xM,onError:n=xM,onRetry:r=xM,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(`
71
+ `)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new _M(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(`
72
+ `,n);for(;r!==-1;){if(n===r){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0,n=r+1,r=e.indexOf(`
73
+ `,n);continue}let i=e.charCodeAt(n);if(CM(e,n,i)){let i=e.charCodeAt(n+5)===bM?n+6:n+5,a=e.slice(i,r);if(d===0&&e.charCodeAt(r+1)===vM){t({id:l,event:f,data:a}),l=void 0,u=``,f=void 0,n=r+2,r=e.indexOf(`
74
+ `,n);continue}u=d===0?a:`${u}
75
+ ${a}`,d++}else wM(e,n,i)?f=e.slice(e.charCodeAt(n+6)===bM?n+7:n+6,r)||void 0:_(e,n,r);n=r+1,r=e.indexOf(`
76
+ `,n)}return e.slice(n)}for(;n<e.length;){let t=e.indexOf(`\r`,n),r=e.indexOf(`
77
+ `,n),i=-1;if(t!==-1&&r!==-1?i=t<r?t:r:t===-1?r!==-1&&(i=r):i=t===e.length-1?-1:t,i===-1)break;_(e,n,i),n=i+1,e.charCodeAt(n-1)===yM&&e.charCodeAt(n)===vM&&n++}return e.slice(n)}function _(e,t,n){if(t===n){y();return}let r=e.charCodeAt(t);if(CM(e,t,r)){let r=e.charCodeAt(t+5)===bM?t+6:t+5,i=e.slice(r,n);u=d===0?i:`${u}
78
+ ${i}`,d++;return}if(wM(e,t,r)){f=e.slice(e.charCodeAt(t+6)===bM?t+7:t+6,n)||void 0;return}if(r===105&&e.charCodeAt(t+1)===100&&e.charCodeAt(t+2)===58){let r=e.slice(e.charCodeAt(t+3)===bM?t+4:t+3,n);r.includes(`\0`)||(l=r);return}if(r===58){if(i){let r=e.slice(t,n);i(r.slice(e.charCodeAt(t+1)===bM?2:1))}return}let a=e.slice(t,n),o=a.indexOf(`:`);if(o===-1){v(a,``,a);return}let s=a.slice(0,o),c=a.charCodeAt(o+1)===bM?2:1;v(s,a.slice(o+c),a)}function v(e,t,i){switch(e){case`event`:f=t||void 0;break;case`data`:u=d===0?t:`${u}
79
+ ${t}`,d++;break;case`id`:t.includes(`\0`)||(l=t);break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new _M(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new _M(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}))}}function y(){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0}function b(e={}){if(e.consume&&o.length>0){let e=o.join(``);_(e,0,e.length)}c=!0,l=void 0,u=``,d=0,f=void 0,o.length=0,s=0,p=!1}return{feed:m,reset:b}}function CM(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function wM(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var TM=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=SM({onEvent:e=>{a.enqueue(e)},onError(t){typeof e==`function`&&e(t),(e===`terminate`||t.type===`max-buffer-size-exceeded`)&&a.error(t)},onRetry:t,onComment:n,maxBufferSize:r})},transform(e){i.feed(e)}})}};(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return Ok(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 Ok(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,Dk(this,new.target)}});var EM=class{_eventSlots=new Map;setHandler(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}getHandler(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)}dispatch(e,t){let n=this._eventSlots.get(e);if(n){n.onHandler?.(t);for(let e of[...n.listeners])e(t)}}_ensureEventSlot(e){let t=this._eventSlots.get(e);return t||(t={listeners:[]},this._eventSlots.set(e,t)),t}},DM=class{_methods=new Set;claim(e,t){if(this._methods.has(e))throw Error(`Handler for "${e}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(e)}replace(e){this._methods.add(e)}release(e){this._methods.delete(e)}has(e){return this._methods.has(e)}},OM=new Set;function kM(e,t){let[n,r]=t,i=n?.shape;if(typeof i?.method?.value!=`string`)return;let a=i.method.value,o=e===`request`?`setRequestHandler`:`setNotificationHandler`;OM.has(o)||(OM.add(o),console.warn(`[ext-apps] ${o}(Schema, handler) is deprecated; use ${o}("${a}", { params: Schema.shape.params }, handler).`));let s=r;return[a,{params:i.params},e===`request`?(e,t)=>s({method:a,params:e},AM(t)):e=>s({method:a,params:e})]}function AM(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var jM=`2026-01-26`,MM=Y([Z(`light`),Z(`dark`)]).describe(`Color theme preference for the host environment.`),NM=Y([Z(`inline`),Z(`fullscreen`),Z(`pip`)]).describe(`Display mode for UI presentation.`),PM=X(Y([Z(`--color-background-primary`),Z(`--color-background-secondary`),Z(`--color-background-tertiary`),Z(`--color-background-inverse`),Z(`--color-background-ghost`),Z(`--color-background-info`),Z(`--color-background-danger`),Z(`--color-background-success`),Z(`--color-background-warning`),Z(`--color-background-disabled`),Z(`--color-text-primary`),Z(`--color-text-secondary`),Z(`--color-text-tertiary`),Z(`--color-text-inverse`),Z(`--color-text-ghost`),Z(`--color-text-info`),Z(`--color-text-danger`),Z(`--color-text-success`),Z(`--color-text-warning`),Z(`--color-text-disabled`),Z(`--color-border-primary`),Z(`--color-border-secondary`),Z(`--color-border-tertiary`),Z(`--color-border-inverse`),Z(`--color-border-ghost`),Z(`--color-border-info`),Z(`--color-border-danger`),Z(`--color-border-success`),Z(`--color-border-warning`),Z(`--color-border-disabled`),Z(`--color-ring-primary`),Z(`--color-ring-secondary`),Z(`--color-ring-inverse`),Z(`--color-ring-info`),Z(`--color-ring-danger`),Z(`--color-ring-success`),Z(`--color-ring-warning`),Z(`--font-sans`),Z(`--font-mono`),Z(`--font-weight-normal`),Z(`--font-weight-medium`),Z(`--font-weight-semibold`),Z(`--font-weight-bold`),Z(`--font-text-xs-size`),Z(`--font-text-sm-size`),Z(`--font-text-md-size`),Z(`--font-text-lg-size`),Z(`--font-heading-xs-size`),Z(`--font-heading-sm-size`),Z(`--font-heading-md-size`),Z(`--font-heading-lg-size`),Z(`--font-heading-xl-size`),Z(`--font-heading-2xl-size`),Z(`--font-heading-3xl-size`),Z(`--font-text-xs-line-height`),Z(`--font-text-sm-line-height`),Z(`--font-text-md-line-height`),Z(`--font-text-lg-line-height`),Z(`--font-heading-xs-line-height`),Z(`--font-heading-sm-line-height`),Z(`--font-heading-md-line-height`),Z(`--font-heading-lg-line-height`),Z(`--font-heading-xl-line-height`),Z(`--font-heading-2xl-line-height`),Z(`--font-heading-3xl-line-height`),Z(`--border-radius-xs`),Z(`--border-radius-sm`),Z(`--border-radius-md`),Z(`--border-radius-lg`),Z(`--border-radius-xl`),Z(`--border-radius-full`),Z(`--border-width-regular`),Z(`--shadow-hairline`),Z(`--shadow-sm`),Z(`--shadow-md`),Z(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
80
+
81
+ Individual style keys are optional - hosts may provide any subset of these values.
82
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
83
+
84
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
85
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Y([W(),Xw()]).describe(`Style variables for theming MCP apps.
86
+
87
+ Individual style keys are optional - hosts may provide any subset of these values.
88
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
89
+
90
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
91
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
92
+
93
+ Individual style keys are optional - hosts may provide any subset of these values.
94
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
95
+
96
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
97
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),FM=J({method:Z(`ui/open-link`),params:J({url:W().describe(`URL to open in the host's browser`)})}),IM=J({isError:K().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),LM=J({isError:K().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),RM=J({isError:K().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough(),zM=J({method:Z(`ui/notifications/sandbox-proxy-ready`),params:J({})}),BM=J({connectDomains:q(W()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
98
+
99
+ - Maps to CSP \`connect-src\` directive
100
+ - Empty or omitted → no network connections (secure default)`),resourceDomains:q(W()).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(W()).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(W()).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'`)")}),VM=J({camera:J({}).optional().describe(`Request camera access.
101
+
102
+ Maps to Permission Policy \`camera\` feature.`),microphone:J({}).optional().describe(`Request microphone access.
103
+
104
+ Maps to Permission Policy \`microphone\` feature.`),geolocation:J({}).optional().describe(`Request geolocation access.
105
+
106
+ Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:J({}).optional().describe(`Request clipboard write access.
107
+
108
+ Maps to Permission Policy \`clipboard-write\` feature.`)}),HM=J({method:Z(`ui/notifications/size-changed`),params:J({width:G().optional().describe(`New width in pixels.`),height:G().optional().describe(`New height in pixels.`)})});J({method:Z(`ui/notifications/tool-input`),params:J({arguments:X(W(),nT().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),J({method:Z(`ui/notifications/tool-input-partial`),params:J({arguments:X(W(),nT().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),J({method:Z(`ui/notifications/tool-cancelled`),params:J({reason:W().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})});var UM=J({fonts:W().optional()}),WM=J({variables:PM.optional().describe(`CSS variables for theming the app.`),css:UM.optional().describe(`CSS blocks that apps can inject.`)});J({method:Z(`ui/resource-teardown`),params:J({})});var GM=X(W(),nT()),KM=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.`)}),qM=J({method:Z(`ui/notifications/request-teardown`),params:J({}).optional()}),JM=J({experimental:X(W(),X(W(),eT()).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:K().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:J({listChanged:K().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:VM.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:BM.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:KM.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:KM.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.")}),YM=J({experimental:X(W(),X(W(),eT()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:J({listChanged:K().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:q(NM).optional().describe(`Display modes the app supports.`)}),XM=J({method:Z(`ui/notifications/initialized`),params:J({}).optional()});J({csp:BM.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:VM.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:W().optional().describe(`Dedicated origin for view sandbox.
109
+
110
+ Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
111
+
112
+ **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:
113
+ - Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
114
+ - URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
115
+
116
+ If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:K().optional().describe(`Visual boundary preference - true if view prefers a visible border.
117
+
118
+ 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.
119
+
120
+ - \`true\`: request visible border + background
121
+ - \`false\`: request no visible border + background
122
+ - omitted: host decides border`)});var ZM=J({method:Z(`ui/request-display-mode`),params:J({mode:NM.describe(`The display mode being requested.`)})}),QM=J({mode:NM.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),$M=Y([Z(`model`),Z(`app`)]).describe(`Tool visibility scope - who can access the tool.`);J({resourceUri:W().optional(),visibility:q($M).optional().describe(`Who can access this tool. Default: ["model", "app"]
123
+ - "model": Tool visible to and callable by the agent
124
+ - "app": Tool callable by the app from this server only`),csp:iT().optional(),permissions:iT().optional()}),J({mimeTypes:q(W()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});var eN=J({method:Z(`ui/download-file`),params:J({contents:q(Y([zD,BD])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),tN=J({method:Z(`ui/message`),params:J({role:Z(`user`).describe(`Message role, currently only "user" is supported.`),content:q(VD).describe(`Message content blocks (text, image, etc.).`)})});J({method:Z(`ui/notifications/sandbox-resource-ready`),params:J({html:W().describe(`HTML content to load into the inner iframe.`),sandbox:W().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:BM.optional().describe(`CSP configuration from resource metadata.`),permissions:VM.optional().describe(`Sandbox permissions from resource metadata.`)})}),J({method:Z(`ui/notifications/tool-result`),params:XD.describe(`Standard MCP tool execution result.`)});var nN=J({toolInfo:J({id:xE.optional().describe(`JSON-RPC id of the tools/call request.`),tool:qD.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:MM.optional().describe(`Current color theme preference.`),styles:WM.optional().describe(`Style configuration for theming the app.`),displayMode:NM.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:q(NM).optional().describe(`Display modes the host supports.`),containerDimensions:Y([J({height:G().describe(`Fixed container height in pixels.`)}),J({maxHeight:Y([G(),Xw()]).optional().describe(`Maximum container height in pixels.`)})]).and(Y([J({width:G().describe(`Fixed container width in pixels.`)}),J({maxWidth:Y([G(),Xw()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
125
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:W().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:W().optional().describe(`User's timezone in IANA format.`),userAgent:W().optional().describe(`Host application identifier.`),platform:Y([Z(`web`),Z(`desktop`),Z(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:J({touch:K().optional().describe(`Whether the device supports touch input.`),hover:K().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:J({top:G().describe(`Top safe area inset in pixels.`),right:G().describe(`Right safe area inset in pixels.`),bottom:G().describe(`Bottom safe area inset in pixels.`),left:G().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();J({method:Z(`ui/notifications/host-context-changed`),params:nN.describe(`Partial context update containing only changed fields.`)});var rN=J({method:Z(`ui/update-model-context`),params:J({content:q(VD).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:X(W(),nT().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),iN=J({method:Z(`ui/initialize`),params:J({appInfo:PE.describe(`App identification (name and version).`),appCapabilities:YM.describe(`Features and capabilities this app provides.`),protocolVersion:W().describe(`Protocol version this app supports.`)})}),aN=J({protocolVersion:W().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:PE.describe(`Host application identification and version.`),hostCapabilities:JM.describe(`Features and capabilities provided by the host.`),hostContext:nN.describe(`Rich context about the host environment.`)}).passthrough(),oN=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=EE.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},sN=[jM],cN=class extends Qj{_client;_hostInfo;_hostCapabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_registeredEvents=new Set;_events=new EM;_methods=new DM;setRequestHandler=(...e)=>{let[t,...n]=kM(`request`,e)??e;this._methods.claim(t,`setRequestHandler`),super.setRequestHandler.call(this,t,...n)};setNotificationHandler=(...e)=>{let[t,...n]=kM(`notification`,e)??e;this._methods.claim(t,`setNotificationHandler`),super.setNotificationHandler.call(this,t,...n)};removeRequestHandler=e=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=e=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_wrapHandler(e,t){let n=super._wrapHandler(e,t);return e===`ui/initialize`||e===`ping`?n:async(t,r)=>(this._initializedReceived||console.warn(`[ext-apps] AppBridge received '${e}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`),n(t,r))}eventSchemas={sizechange:HM,sandboxready:zM,initialized:XM,requestteardown:qM,loggingmessage:oO};setEventHandler(e,t){this._ensureEventSlot(e),this._events.setHandler(e,t)}getEventHandler(e){return this._events.getHandler(e)}addEventListener(e,t){this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);let n=t=>{e===`initialized`&&(this._initializedReceived=!0),this._events.dispatch(e,t)};e===`loggingmessage`?this.setNotificationHandler(`notifications/message`,e=>{n(e.params)}):this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},e=>n(e)),this._registeredEvents.add(e)}warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t,n,r){super(r),this._client=e,this._hostInfo=t,this._hostCapabilities=n,this._methods.replace(`notifications/cancelled`),this._methods.replace(`notifications/progress`),this._ensureEventSlot(`initialized`),this._hostContext=r?.hostContext||{},this.replaceRequestHandler(`ui/initialize`,{params:iN.shape.params,result:aN},e=>this._onAppsInitialize(e)),this.replaceRequestHandler(`ping`,(e,t)=>(this.onping?.(e.params,t),{})),this.replaceRequestHandler(`ui/request-display-mode`,{params:ZM.shape.params,result:QM},()=>({mode:this._hostContext.displayMode??`inline`}))}buildContext(e){return e}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}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(`ui/message`,{params:tN.shape.params,result:RM},async(e,t)=>{if(!this._onmessage)throw Error(`No onmessage handler set`);return this._onmessage(e,t)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced(`onopenlink`,this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(`ui/open-link`,{params:FM.shape.params,result:IM},async(e,t)=>{if(!this._onopenlink)throw Error(`No onopenlink handler set`);return this._onopenlink(e,t)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced(`ondownloadfile`,this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(`ui/download-file`,{params:eN.shape.params,result:LM},async(e,t)=>{if(!this._ondownloadfile)throw Error(`No ondownloadfile handler set`);return this._ondownloadfile(e,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(`ui/request-display-mode`,{params:ZM.shape.params,result:QM},async(e,t)=>{if(!this._onrequestdisplaymode)throw Error(`No onrequestdisplaymode handler set`);return this._onrequestdisplaymode(e,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(`ui/update-model-context`,{params:rN.shape.params,result:OE},async(e,t)=>{if(!this._onupdatemodelcontext)throw Error(`No onupdatemodelcontext handler set`);return this._onupdatemodelcontext(e,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(`tools/call`,async(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_oncreatesamplingmessage;get oncreatesamplingmessage(){return this._oncreatesamplingmessage}set oncreatesamplingmessage(e){this.warnIfRequestHandlerReplaced(`oncreatesamplingmessage`,this._oncreatesamplingmessage,e),this._oncreatesamplingmessage=e,this.replaceRequestHandler(`sampling/createMessage`,async(e,t)=>{if(!this._oncreatesamplingmessage)throw Error(`No oncreatesamplingmessage handler set`);return this._oncreatesamplingmessage(e.params,t)})}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(`resources/list`,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(`resources/templates/list`,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(`resources/read`,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(`prompts/list`,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})}getCapabilities(){return this._hostCapabilities}async _onAppsInitialize(e){let t=e.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.appCapabilities,this._appInfo=e.appInfo,{protocolVersion:sN.includes(t)?t:jM,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];lN(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},GM,t)}sendResourceTeardown=this.teardownResource;callTool(e,t){return this.request({method:`tools/call`,params:e},t)}listTools(e,t){return this.request({method:`tools/list`,params:e},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},{signal:t.mcpReq.signal}),e.tools.listChanged&&this._client.setNotificationHandler(`notifications/tools/list_changed`,e=>this.sendToolListChanged(e.params))),e.resources&&(this.onlistresources=async(e,t)=>this._client.request({method:`resources/list`,params:e},{signal:t.mcpReq.signal}),this.onlistresourcetemplates=async(e,t)=>this._client.request({method:`resources/templates/list`,params:e},{signal:t.mcpReq.signal}),this.onreadresource=async(e,t)=>this._client.request({method:`resources/read`,params:e},{signal:t.mcpReq.signal}),e.resources.listChanged&&this._client.setNotificationHandler(`notifications/resources/list_changed`,e=>this.sendResourceListChanged(e.params))),e.prompts&&(this.onlistprompts=async(e,t)=>this._client.request({method:`prompts/list`,params:e},{signal:t.mcpReq.signal}),e.prompts.listChanged&&this._client.setNotificationHandler(`notifications/prompts/list_changed`,e=>this.sendPromptListChanged(e.params)))}return super.connect(e)}};function lN(e,t){return JSON.stringify(e)===JSON.stringify(t)}function uN({server:e,uri:t,input:n,result:r,onMessage:i}){let a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(!1),c=(0,v.useRef)({input:n,result:r,onMessage:i});c.current={input:n,result:r,onMessage:i};let[l,u]=(0,v.useState)(120),[d,f]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let n=a.current;if(!n?.contentWindow)return;let r=!1;s.current=!1;let i=new cN(null,{name:`PlugMCP Studio`,version:`0.1.0`},{openLinks:{},serverTools:{},logging:{}},{hostContext:{theme:`dark`,displayMode:`inline`,availableDisplayModes:[`inline`]}});return o.current=i,i.oncalltool=async t=>(await Ce.call(e,t.name,t.arguments??{})).result,i.onmessage=async e=>{let t=e.content.map(e=>e.type===`text`?e.text:``).join(``);return t&&c.current.onMessage?.(t),{}},i.onopenlink=async({url:e})=>(window.open(e,`_blank`,`noopener,noreferrer`),{}),i.addEventListener(`sizechange`,({height:e})=>{typeof e==`number`&&u(Math.min(Math.max(e,40),900))}),i.addEventListener(`initialized`,()=>{s.current=!0,i.sendToolInput({arguments:c.current.input}),c.current.result&&i.sendToolResult(c.current.result)}),(async()=>{try{let{html:a}=await Ce.view(e,t);if(r)return;await i.connect(new oN(n.contentWindow,n.contentWindow)),n.srcdoc=a}catch(e){r||f(e instanceof Error?e.message:String(e))}})(),()=>{r=!0,o.current=null,i.close()}},[e,t]),(0,v.useEffect)(()=>{s.current&&r&&o.current?.sendToolResult(r)},[r]),d?(0,V.jsx)(`p`,{className:`note fault`,children:d}):(0,V.jsx)(`iframe`,{ref:a,className:`view-frame`,title:`Tool view`,sandbox:`allow-scripts allow-forms`,style:{height:l}})}function dN({selected:e,onNew:t}){let{server:n,remote:r,tools:i,refresh:a}=Ae(),[o,s]=(0,v.useState)(``);if(!n)return null;let c=e=>!o||`${e.name} ${e.description??``}`.toLowerCase().includes(o.toLowerCase()),l=[{name:n.name,note:`This server`,tools:n.tools.filter(c)},...r.map(e=>({name:e.name,note:`Added from the directory`,tools:e.tools.filter(c)}))],u=i.find(t=>t.id===e)??null;return(0,V.jsxs)(`div`,{className:`split${u?` has-pick`:``}`,children:[(0,V.jsxs)(`div`,{className:`split-list`,children:[(0,V.jsxs)(`div`,{className:`split-list-head`,children:[(0,V.jsxs)(`div`,{className:`row`,children:[(0,V.jsxs)(`h2`,{className:`grow`,style:{paddingLeft:4},children:[`Tools `,(0,V.jsx)(`span`,{className:`muted`,style:{fontWeight:400},children:i.length})]}),(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:t,children:[(0,V.jsx)(z,{size:14,stroke:2}),` New tool`]})]}),(0,V.jsx)(Ve,{value:`list`,onChange:t=>t===`canvas`&&We(e?`/canvas/${e}`:`/canvas`),options:[{id:`list`,label:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(I,{size:14,stroke:1.75}),` List`]})},{id:`canvas`,label:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(le,{size:14,stroke:1.75}),` Canvas`]})}]}),i.length>5?(0,V.jsxs)(`div`,{className:`search`,children:[(0,V.jsx)(oe,{size:15,stroke:1.75}),(0,V.jsx)(`input`,{className:`input`,value:o,onChange:e=>s(e.target.value),placeholder:`Filter tools`,"aria-label":`Filter tools`})]}):null]}),(0,V.jsx)(`div`,{className:`split-list-body`,children:l.map(t=>t.tools.length||t.note===`This server`?(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`group-label`,children:[t.name,` `,(0,V.jsxs)(`span`,{style:{fontWeight:400},children:[`· `,t.note]})]}),t.tools.map(t=>(0,V.jsxs)(`button`,{type:`button`,className:`tool-item${t.id===e?` is-active`:``}`,onClick:()=>We(`/tools/${t.id}`),children:[(0,V.jsxs)(`span`,{className:`tool-item-name`,children:[(0,V.jsx)(`span`,{className:`truncate`,children:t.name}),t.view?(0,V.jsx)(T,{size:13,stroke:1.75,"aria-label":`Has a view`}):null]}),(0,V.jsx)(`span`,{className:`tool-item-desc truncate`,children:t.description??`No description yet`})]},t.id)),t.tools.length===0?(0,V.jsx)(`p`,{className:`hint`,style:{padding:`4px 8px`},children:o?`Nothing matches.`:`No tools yet.`}):null]},t.name):null)})]}),(0,V.jsx)(`div`,{className:`split-detail`,children:u?(0,V.jsx)(pN,{tool:u,entry:n.entry,onSaved:a},u.id):(0,V.jsx)(`div`,{className:`detail`,children:(0,V.jsx)(Le,{icon:pe,title:i.length?`Pick a tool`:`No tools yet`,actions:(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:t,children:[(0,V.jsx)(z,{size:15,stroke:2}),` New tool`]}),children:i.length?`Choose a tool on the left to see its schema, run it, and edit its code.`:`A tool is one function a model can call. Add one here, or write server.tool(...) in ${n.entry}.`})})})]})}function fN({tool:e,onSaved:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(e.description??``),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null);return n?(0,V.jsxs)(`form`,{className:`stack`,style:{marginTop:8,gap:8},onSubmit:n=>{n.preventDefault(),s(!0),l(null),Ce.describeTool(e.name,i).then(()=>{t(),r(!1)}).catch(e=>l(Me(e))).finally(()=>s(!1))},children:[(0,V.jsx)(`textarea`,{className:`input`,rows:3,value:i,onChange:e=>a(e.target.value),"aria-label":`Description`,autoFocus:!0}),(0,V.jsx)(`p`,{className:`hint`,children:`The model reads this to decide when to call the tool.`}),c?(0,V.jsx)(`p`,{className:`small fault`,children:c}):null,(0,V.jsxs)(`div`,{className:`row`,children:[(0,V.jsx)(`button`,{type:`submit`,className:`btn btn-primary btn-sm`,disabled:o||!i.trim(),children:o?`Saving`:`Save`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>r(!1),children:`Cancel`})]})]}):(0,V.jsxs)(`p`,{className:`muted`,style:{marginTop:6,maxWidth:`72ch`},children:[e.description??`No description yet. Add one so a model knows when to call this tool.`,` `,e.local?(0,V.jsxs)(`button`,{type:`button`,className:`link small`,style:{background:`none`,border:0,padding:0,cursor:`pointer`},onClick:()=>r(!0),children:[(0,V.jsx)(re,{size:12,stroke:1.75,style:{verticalAlign:-1}}),` Edit`]}):null]})}function pN({tool:e,entry:t,onSaved:n,back:r=`/tools`}){let[i,a]=(0,v.useState)(`schema`),o=[{id:`schema`,label:`Schema`}];return e.local&&o.push({id:`code`,label:`Code`}),e.local&&e.viewFile&&o.push({id:`view`,label:`View code`}),(0,V.jsxs)(`div`,{className:`detail`,children:[(0,V.jsxs)(`div`,{className:`detail-head`,children:[(0,V.jsxs)(`div`,{className:`grow`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm only-sm`,style:{marginLeft:-10,marginBottom:6},onClick:()=>We(r),children:[(0,V.jsx)(S,{size:14}),` `,r===`/tools`?`All tools`:`Canvas`]}),(0,V.jsxs)(`div`,{className:`row`,children:[(0,V.jsx)(`h1`,{className:`truncate`,children:e.name}),(0,V.jsx)(ze,{value:e.name,label:`Copy the name`}),(0,V.jsx)(`span`,{className:`pill${e.view?` pill-signal`:``}`,children:e.view?`MCP app`:`Tool`}),e.local?null:(0,V.jsx)(`span`,{className:`pill`,children:e.server})]}),(0,V.jsx)(fN,{tool:e,onSaved:n},e.description)]}),(0,V.jsxs)(`a`,{className:`btn btn-outline`,href:`#/playground`,children:[(0,V.jsx)(L,{size:15,stroke:1.75}),` Try in chat`]})]}),(0,V.jsxs)(`div`,{className:`tool-body`,children:[(0,V.jsxs)(`div`,{className:`stack`,style:{minWidth:0},children:[(0,V.jsx)(Ve,{value:i,options:o,onChange:a}),i===`schema`?(0,V.jsx)(_N,{tool:e,onSaved:n}):null,i===`code`?(0,V.jsx)(Qh,{path:t,onSaved:n}):null,i===`view`&&e.viewFile?(0,V.jsx)(Qh,{path:e.viewFile,onSaved:n}):null]}),(0,V.jsx)(`aside`,{className:`tool-run`,"aria-label":`Run the tool`,children:(0,V.jsx)(mN,{tool:e})})]})]})}function mN({tool:e}){let t=Ye(e.name),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)({}),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(0),[y,b]=(0,v.useState)(e.view?`view`:`json`);async function x(){p(!0),h(null),l(void 0),r(!1),s(i),_(e=>e+1);try{let t=await Ce.call(e.local?`local`:e.server,e.name,i);l(t.result),d(t.ms)}catch(e){h(Me(e))}finally{p(!1)}}let S=c?.content?.filter(e=>e.type===`text`).map(e=>e.text).join(`
126
+ `),C=c?c.structuredContent?JSON.stringify(c.structuredContent,null,2):S??``:``;return(0,V.jsxs)(`div`,{className:`test-grid`,children:[(0,V.jsxs)(`form`,{className:`panel`,onSubmit:e=>{e.preventDefault(),x()},children:[(0,V.jsxs)(`div`,{className:`panel-head`,children:[(0,V.jsx)(`h2`,{className:`section-title`,children:`Try it`}),(0,V.jsxs)(`button`,{className:`btn btn-primary btn-sm`,type:`submit`,disabled:f,children:[(0,V.jsx)(R,{size:14,stroke:2}),` `,f?`Running`:`Run tool`]})]}),(0,V.jsx)(`div`,{className:`panel-pad`,children:(0,V.jsx)(eg,{schema:e.inputSchema,value:i,onChange:a})})]}),(0,V.jsxs)(`div`,{className:`panel`,children:[(0,V.jsxs)(`div`,{className:`panel-head`,children:[(0,V.jsxs)(`h2`,{className:`section-title`,children:[`Result`,c?(0,V.jsx)(`span`,{className:`pill ${c.isError?`pill-fault`:`pill-ok`}`,children:c.isError?`Error`:`OK`}):null,c&&u!==null?(0,V.jsxs)(`span`,{className:`num`,children:[u,` ms`]}):null]}),e.view?(0,V.jsx)(Ve,{value:y,onChange:b,options:[{id:`view`,label:`View`},{id:`json`,label:`Data`}]}):c?(0,V.jsx)(ze,{value:C,label:`Copy the result`}):null]}),c&&o&&e.local?(0,V.jsxs)(`div`,{className:`save-test`,children:[(0,V.jsx)(`span`,{className:`small muted grow`,children:n?`Saved. Run it again any time, here or with plugmcp test.`:`Keep this call as a test you can run after every change.`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-outline btn-sm`,disabled:n,onClick:()=>{let n=Object.values(o).find(e=>typeof e==`string`||typeof e==`number`);t.save({tool:e.name,name:n===void 0?``:`${e.name} with ${String(n).slice(0,60)}`,arguments:o,expectError:c.isError===!0}).then(()=>r(!0)).catch(e=>h(Me(e)))},children:n?`Saved`:`Save as test`})]}):null,(0,V.jsxs)(`div`,{className:`panel-pad stack`,children:[m?(0,V.jsx)(`p`,{className:`small fault`,children:m}):null,!o&&!m?(0,V.jsxs)(`p`,{className:`muted small`,children:[`Fill in the input and press Run. `,e.view?`Its view appears here the way a chat client shows it.`:`The result appears here.`]}):null,e.view&&o?(0,V.jsx)(`div`,{className:`view-stage`,hidden:y!==`view`,children:(0,V.jsx)(uN,{server:e.local?`local`:e.server,uri:e.view,input:o,result:c},g)}):null,o&&(y===`json`||!e.view)?(0,V.jsx)(`pre`,{className:`code`,children:f?`Running`:C}):null,e.view&&e.viewFile&&o&&y===`view`?(0,V.jsxs)(`p`,{className:`hint`,children:[`Edit `,e.viewFile,` and this updates without a restart.`]}):null]})]}),(0,V.jsx)(Ze,{state:t})]})}var hN=e=>{let t=Array.isArray(e.type)?e.type.filter(e=>e!==`null`).join(` or `):e.type;return e.enum?`one of`:t===`array`&&e.items?`${hN(e.items)} list`:t??`any`};function gN({tool:e,name:t,description:n,onSaved:r}){let[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(n??``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null);return i?(0,V.jsxs)(`form`,{className:`stack`,style:{gap:8},onSubmit:n=>{n.preventDefault(),l(!0),d(null),Ce.describeInput(e.name,t,o).then(()=>{r(),a(!1)}).catch(e=>d(Me(e))).finally(()=>l(!1))},children:[(0,V.jsx)(`textarea`,{className:`input`,rows:2,value:o,onChange:e=>s(e.target.value),"aria-label":`Description of ${t}`,placeholder:`What to send, with an example`,autoFocus:!0}),u?(0,V.jsx)(`p`,{className:`small fault`,children:u}):null,(0,V.jsxs)(`div`,{className:`row`,children:[(0,V.jsx)(`button`,{type:`submit`,className:`btn btn-primary btn-sm`,disabled:c||!o.trim(),children:c?`Saving`:`Save`}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>a(!1),children:`Cancel`})]})]}):(0,V.jsxs)(`p`,{className:`field-text`,children:[n??`No description yet. The model needs one to know what to send.`,` `,e.local?(0,V.jsxs)(`button`,{type:`button`,className:`link small`,style:{background:`none`,border:0,padding:0,cursor:`pointer`},onClick:()=>{s(n??``),a(!0)},children:[(0,V.jsx)(re,{size:12,stroke:1.75,style:{verticalAlign:-1}}),` `,n?`Edit`:`Add`]}):null]})}function _N({tool:e,onSaved:t}){let n=e.inputSchema,r=Object.entries(n.properties??{}),[i,a]=(0,v.useState)(!1);return(0,V.jsxs)(`div`,{className:`stack`,children:[(0,V.jsxs)(`div`,{className:`panel`,children:[(0,V.jsxs)(`div`,{className:`panel-head`,children:[(0,V.jsx)(`h2`,{className:`section-title`,children:`Input`}),(0,V.jsx)(`span`,{className:`muted small`,children:r.length?`${Ge(r.length,`field`)} the model fills in`:`Nothing to fill in`})]}),r.length===0?(0,V.jsx)(`p`,{className:`panel-pad muted small`,children:`This tool takes no input. The model calls it as is.`}):null,r.map(([r,i])=>{let a=n.required?.includes(r)??!1;return(0,V.jsxs)(`div`,{className:`field-row`,children:[(0,V.jsxs)(`div`,{className:`field-row-top`,children:[(0,V.jsx)(`span`,{className:`mono field-name`,children:r}),(0,V.jsx)(`span`,{className:`pill`,children:hN(i)}),(0,V.jsx)(`span`,{className:`pill${a?` pill-signal`:``}`,children:a?`Required`:`Optional`})]}),(0,V.jsx)(gN,{tool:e,name:r,description:i.description,onSaved:t}),i.enum?(0,V.jsx)(`div`,{className:`row-wrap`,children:i.enum.map(e=>(0,V.jsx)(`span`,{className:`node-chip mono`,children:String(e)},String(e)))}):null,i.default===void 0?null:(0,V.jsxs)(`p`,{className:`hint`,children:[`Default: `,(0,V.jsx)(`span`,{className:`mono`,children:JSON.stringify(i.default)})]})]},r)})]}),(0,V.jsxs)(`div`,{className:`panel`,children:[(0,V.jsxs)(`div`,{className:`panel-head`,children:[(0,V.jsx)(`h2`,{className:`section-title`,children:`Output`}),(0,V.jsx)(`span`,{className:`pill${e.view?` pill-signal`:``}`,children:e.view?`Data and a view`:`Data`})]}),(0,V.jsx)(`p`,{className:`panel-pad muted small`,children:e.view?`The tool returns data, and ${e.viewFile??`its view`} draws it inside the chat. That makes this tool an MCP app.`:`The tool returns data the model reads. Add a view file to show it as a card in the chat.`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`section-head`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`link small`,style:{background:`none`,border:0,padding:0,cursor:`pointer`},onClick:()=>a(e=>!e),"aria-expanded":i,children:[i?`Hide`:`Show`,` the JSON Schema`]}),i?(0,V.jsx)(ze,{value:JSON.stringify(n,null,2),label:`Copy the schema`}):null]}),i?(0,V.jsx)(`pre`,{className:`code`,children:JSON.stringify(n,null,2)}):null]})]})}function vN({data:e}){return(0,V.jsxs)(`div`,{className:`node node-server${e.added?` node-server-added`:``}`,children:[(0,V.jsxs)(`div`,{className:`node-kind`,children:[(0,V.jsx)(ce,{size:13,stroke:1.75}),` `,e.added?`Added from the directory`:`MCP server`,e.added?null:(0,V.jsx)(`span`,{className:`node-edit`,children:`Edit`}),e.added?null:(0,V.jsx)(`span`,{className:`dot dot-ok`,style:{marginLeft:6}})]}),(0,V.jsx)(`div`,{className:`node-title node-title-lg truncate`,children:e.name}),(0,V.jsx)(`div`,{className:`node-sub clamp-2`,children:e.description??(e.added?`Its tools are in your chat.`:`No description yet.`)}),(0,V.jsx)(`div`,{className:`node-foot`,children:(0,V.jsx)(`span`,{className:`node-chip mono truncate`,children:e.address})}),(0,V.jsx)(`div`,{className:`node-port`,children:Ge(e.count,`tool`)}),(0,V.jsx)(up,{type:`source`,position:Ys.Bottom})]})}function yN({data:e}){let t=Object.keys(e.tool.inputSchema.properties??{});return(0,V.jsxs)(`div`,{className:`node node-tool${e.picked?` is-picked`:``}`,children:[(0,V.jsx)(up,{type:`target`,position:Ys.Top}),(0,V.jsxs)(`div`,{className:`node-kind`,children:[(0,V.jsx)(pe,{size:13,stroke:1.75}),` `,e.tool.view?`MCP app`:`Tool`,e.tool.view?(0,V.jsxs)(`span`,{className:`node-view-tag`,children:[(0,V.jsx)(T,{size:12,stroke:1.75}),` View`]}):null]}),(0,V.jsx)(`div`,{className:`node-title mono truncate`,children:e.tool.name}),(0,V.jsx)(`div`,{className:`node-sub clamp-3`,children:e.tool.description??`No description yet. Click to add one.`}),(0,V.jsxs)(`div`,{className:`node-foot`,children:[t.slice(0,3).map(e=>(0,V.jsx)(`span`,{className:`node-chip mono`,children:e},e)),t.length>3?(0,V.jsxs)(`span`,{className:`node-chip`,children:[`+`,t.length-3]}):null,t.length===0?(0,V.jsx)(`span`,{className:`node-chip`,children:`No input`}):null]})]})}function bN(){return(0,V.jsxs)(`div`,{className:`node node-add`,children:[(0,V.jsx)(up,{type:`target`,position:Ys.Top}),(0,V.jsx)(z,{size:18,stroke:1.75}),(0,V.jsx)(`span`,{children:`New tool`})]})}var xN={server:vN,tool:yN,add:bN},SN=286,CN=196,wN=4,TN=320,EN=e=>{try{return JSON.parse(localStorage.getItem(e)??`{}`)}catch{return{}}};function DN({selected:e,onNew:t,onEditMcp:n}){let{server:r,remote:i,tools:a,refresh:o}=Ae(),s=Ee(),c=a.find(t=>t.id===e)??null,l=`plugmcp.canvas.${s.name}.${s.current}`,[u,d]=(0,v.useState)(()=>EN(l));(0,v.useEffect)(()=>d(EN(l)),[l]);let f=(0,v.useMemo)(()=>{let t=[],n=[];if(!r)return{nodes:t,edges:n};let a=e=>e.replace(`127.0.0.1`,`localhost`).replace(/^https?:\/\//,``),o=[{key:`mcp`,name:r.title??r.name,description:r.description,address:a(r.mcpUrl),added:!1,tools:r.tools},...i.map(e=>({key:`added:${e.name}`,name:e.name,description:null,address:a(e.url),added:!0,tools:e.tools}))],s=0;for(let r of o){let i=r.added?r.tools:[...r.tools,null],a=Math.max(1,Math.ceil(i.length/wN)),o=Math.min(Math.max(i.length,1),wN),c=Math.max(o*SN+(a>1?SN/2:0),360),l=s+c/2;t.push({id:r.key,type:`server`,position:{x:l-TN/2,y:0},data:{name:r.name,description:r.description,address:r.address,count:r.tools.length,added:r.added}}),i.forEach((o,s)=>{let c=Math.floor(s/wN),u=Math.min(wN,i.length-c*wN),d=a>1?c%2==1?SN/4:-286/4:0,f={x:l-u*SN/2+s%wN*SN+18+d,y:220+c*CN},p=o?`tool:${r.key}:${o.id}`:`add`;o?t.push({id:p,type:`tool`,position:f,data:{tool:o,picked:o.id===e}}):t.push({id:p,type:`add`,position:f,data:{}}),n.push({id:`e:${p}`,source:r.key,target:p,type:`smoothstep`})}),s+=c+140}return{nodes:t,edges:n}},[r,i,e]),[p,m,h]=sh([]);(0,v.useEffect)(()=>{m(f.nodes.map(e=>u[e.id]?{...e,position:u[e.id]}:e))},[f,u,m]);let g=e=>{d(e);try{localStorage.setItem(l,JSON.stringify(e))}catch{}};if(!r)return null;let _=Object.keys(u).length>0;return(0,V.jsxs)(`div`,{className:`canvas${c?` has-pick`:``}`,children:[(0,V.jsxs)(`div`,{className:`canvas-stage`,children:[(0,V.jsxs)(oh,{nodes:p,edges:f.edges,nodeTypes:xN,fitView:!0,fitViewOptions:{padding:.2,maxZoom:1},minZoom:.2,nodesConnectable:!1,onNodesChange:h,onNodeDragStop:(e,t)=>g({...u,[t.id]:t.position}),proOptions:{hideAttribution:!0},onNodeClick:(e,r)=>{r.type===`tool`&&We(`/canvas/${r.data.tool.id}`),r.type===`add`&&t(),r.id===`mcp`&&n()},onPaneClick:()=>c&&We(`/canvas`),children:[(0,V.jsx)(hh,{variant:uh.Dots,gap:18,size:1,color:`rgba(141,137,132,0.3)`}),(0,V.jsx)(kh,{showInteractive:!1,position:`bottom-left`})]},`${s.current}:${f.nodes.length}`),(0,V.jsxs)(`div`,{className:`canvas-tools`,children:[(0,V.jsx)(Ve,{value:`canvas`,onChange:t=>t===`list`&&We(e?`/tools/${e}`:`/tools`),options:[{id:`list`,label:`List`},{id:`canvas`,label:`Canvas`}]}),(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-secondary btn-sm`,onClick:t,children:[(0,V.jsx)(z,{size:14,stroke:2}),` New tool`]}),_?(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>g({}),children:[(0,V.jsx)(F,{size:14,stroke:1.75}),` Tidy up`]}):null]}),c?null:(0,V.jsx)(`div`,{className:`canvas-hint`,children:`Drag a card to move it. Click the server to edit its name and description, or a tool to edit its schema, run it and change its code.`})]}),c?(0,V.jsxs)(`aside`,{className:`inspector`,"aria-label":`Tool ${c.name}`,children:[(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm btn-icon inspector-close`,onClick:()=>We(`/canvas`),"aria-label":`Close`,children:(0,V.jsx)(he,{size:16})}),(0,V.jsx)(pN,{tool:c,entry:r.entry,onSaved:o,back:`/canvas`},c.id)]}):null]})}function ON(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(`local`),[o,s]=(0,v.useState)(``);(0,v.useEffect)(()=>{Ce.ship().then(t).catch(e=>r(Me(e)))},[]);let c=e?.snippets.filter(e=>e.kind===`link`)??[],l=e?.snippets.filter(e=>e.kind===`code`&&![`claude`,`chatgpt`].includes(e.id))??[],u=l.find(e=>e.id===o)??l[0];return(0,V.jsxs)(`div`,{className:`page page-narrow`,children:[(0,V.jsx)(Fe,{title:`Connect`,lede:`Use the server in your editor now. Put it online and list it when it is ready for other people.`,children:(0,V.jsx)(Ve,{value:i,onChange:a,options:[{id:`local`,label:`On this machine`},{id:`live`,label:`Go live`}]})}),n?(0,V.jsx)(`p`,{className:`small fault`,children:n}):null,e&&i===`local`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{className:`panel panel-pad stack`,children:[(0,V.jsx)(`h2`,{children:`One click`}),(0,V.jsx)(`p`,{className:`muted small`,children:`These add the server running here to your editor. It works while plugmcp dev is running.`}),(0,V.jsx)(`div`,{className:`row-wrap`,children:c.map(e=>(0,V.jsxs)(`a`,{className:`btn btn-secondary`,href:e.value,children:[`Add to `,e.label]},e.id))})]}),u?(0,V.jsxs)(`section`,{className:`panel panel-pad stack`,children:[(0,V.jsxs)(`div`,{className:`row-wrap`,style:{justifyContent:`space-between`},children:[(0,V.jsx)(`h2`,{children:`Other clients`}),(0,V.jsx)(Ve,{value:u.id,onChange:s,options:l.map(e=>({id:e.id,label:e.label}))})]}),u.hint?(0,V.jsx)(`p`,{className:`muted small`,children:u.hint}):null,(0,V.jsx)(Be,{value:u.value,label:u.label})]}):null,(0,V.jsxs)(`p`,{className:`muted small`,children:[`Claude and ChatGPT connect over the internet, so they need a public address.`,` `,(0,V.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>a(`live`),children:`See how to go live`})]})]}):null,e&&i===`live`?(0,V.jsxs)(`ol`,{className:`numbered`,children:[(0,V.jsx)(`li`,{className:`panel`,children:(0,V.jsxs)(`div`,{className:`stack`,children:[(0,V.jsx)(`h2`,{children:`Put it online`}),(0,V.jsx)(`p`,{className:`muted small`,children:`Build it, then run it on any host that runs Node, such as Railway or Fly. It reads the PORT the host sets. The result is a plain Node server with nothing tied to PlugMCP.`}),(0,V.jsx)(Be,{value:`plugmcp build
127
+ plugmcp start`,label:`the build commands`})]})}),(0,V.jsx)(`li`,{className:`panel`,children:(0,V.jsxs)(`div`,{className:`stack`,children:[(0,V.jsx)(`h2`,{children:`List it in the directory`}),(0,V.jsx)(`p`,{className:`muted small`,children:`A page on plugmcp.ai where people and agents find your server, with install buttons for every client.`}),(0,V.jsx)(Be,{value:`plugmcp list --url https://your-host.example/mcp`,label:`the list command`}),(0,V.jsx)(`p`,{className:`hint`,children:`Optional badge for your README. It links to your page once the server is listed.`}),(0,V.jsx)(Be,{value:e.badge,label:`the badge`})]})}),(0,V.jsx)(`li`,{className:`panel`,children:(0,V.jsxs)(`div`,{className:`stack`,children:[(0,V.jsx)(`h2`,{children:`Add keys, logs and alerts`}),(0,V.jsx)(`p`,{className:`muted small`,children:`Put the hosted server behind plugmcp.ai to get a gateway address, API keys you can revoke, a log of every call and alerts when it breaks.`}),(0,V.jsx)(Be,{value:`plugmcp login
128
+ plugmcp deploy --url https://your-host.example/mcp`,label:`the deploy commands`}),(0,V.jsx)(`div`,{className:`row-wrap`,children:(0,V.jsxs)(`a`,{className:`btn btn-outline`,href:e.hostUrl,target:`_blank`,rel:`noopener`,children:[`Open plugmcp.ai `,(0,V.jsx)(M,{size:14,stroke:1.75})]})})]})})]}):null]})}var kN=e=>(e??``).replace(/<[^>]*>?/g,` `).replace(/[#*_`>|]+/g,` `).replace(/\s+/g,` `).trim();function AN({server:e}){let t=/^io\.github\.([A-Za-z0-9-]+)$/.exec(e.publisher??``)?.[1],[n,r]=(0,v.useState)(!1);return!t||n?(0,V.jsx)(Pe,{name:e.name}):(0,V.jsx)(`img`,{className:`glyph logo`,src:`https://github.com/${t}.png?size=72`,alt:``,loading:`lazy`,onError:()=>r(!0)})}var jN=4,MN=8;function NN(){let{remote:e,reloadRemote:t}=Ae(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!0),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(null),y=(0,v.useRef)(0);(0,v.useEffect)(()=>{let e=++y.current;d(!0);let t=setTimeout(()=>{Ce.directory(n.trim(),i).then(t=>{e===y.current&&(s(t.servers),l(t.total),p(null))}).catch(t=>e===y.current&&p(Me(t))).finally(()=>e===y.current&&d(!1))},n?450:0);return()=>clearTimeout(t)},[n,i]);async function b(e){_(e.slug),h(null);try{await Ce.addServer({slug:e.slug}),await t(),h({slug:e.slug,ok:!0,text:`Added. Its tools are in the chat now.`})}catch(t){h({slug:e.slug,ok:!1,text:Me(t)})}finally{_(null)}}return(0,V.jsxs)(`div`,{className:`page`,children:[(0,V.jsx)(Fe,{title:`Directory`,lede:`A few servers from the PlugMCP directory to try next to your own. The full directory, with every server and its install steps, is on plugmcp.ai.`,children:(0,V.jsxs)(`a`,{className:`btn btn-outline`,href:`https://plugmcp.ai/mcp${n?`?q=${encodeURIComponent(n)}`:``}`,target:`_blank`,rel:`noopener`,children:[`Browse all on plugmcp.ai `,(0,V.jsx)(M,{size:14,stroke:1.75})]})}),(0,V.jsxs)(`div`,{className:`stack`,children:[(0,V.jsxs)(`div`,{className:`search search-lg`,children:[(0,V.jsx)(oe,{size:18,stroke:1.75}),(0,V.jsx)(`input`,{className:`input`,value:n,onChange:e=>r(e.target.value),placeholder:`Search servers, for example github or postgres`,"aria-label":`Search the directory`,autoFocus:!0})]}),(0,V.jsxs)(`label`,{className:`check`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked)}),`Only hosted servers I can add to the chat`]})]}),e.length?(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h2`,{className:`section-title`,style:{marginBottom:10},children:`In your chat`}),(0,V.jsx)(`ul`,{className:`panel rows`,children:e.map(e=>(0,V.jsxs)(`li`,{className:`rowlink`,children:[(0,V.jsx)(Pe,{name:e.name}),(0,V.jsxs)(`div`,{className:`grow`,children:[(0,V.jsx)(`div`,{className:`row-title`,children:e.name}),(0,V.jsx)(`div`,{className:`row-sub${e.ok?``:` fault`}`,children:e.ok?Ge(e.tools.length,`tool`):`Not reachable: ${e.error}`})]}),(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm btn-icon`,"aria-label":`Remove ${e.name}`,onClick:async()=>{await Ce.removeServer(e.name),await t()},children:(0,V.jsx)(me,{size:15,stroke:1.75})})]},e.name))})]}):null,(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`section-head`,children:[(0,V.jsx)(`h2`,{className:`section-title`,children:n?`Results`:`Popular on PlugMCP`}),c!==null&&n?(0,V.jsxs)(`span`,{className:`muted small`,children:[c.toLocaleString(),` found`]}):null]}),f?(0,V.jsx)(`p`,{className:`small fault`,children:f}):null,!f&&!u&&o.length===0?(0,V.jsx)(`p`,{className:`muted`,children:`Nothing matched. That may be a gap worth filling with your own server.`}):null,(0,V.jsx)(`ul`,{className:`cards${u?` is-loading`:``}`,children:o.slice(0,n?MN:jN).map(e=>(0,V.jsxs)(`li`,{className:`card`,children:[(0,V.jsxs)(`div`,{className:`row`,children:[(0,V.jsx)(AN,{server:e}),(0,V.jsxs)(`a`,{className:`card-title grow truncate`,href:e.url,target:`_blank`,rel:`noopener`,children:[(0,V.jsx)(`span`,{className:`truncate`,children:e.name}),` `,(0,V.jsx)(M,{size:13,stroke:1.75})]}),e.stars?(0,V.jsxs)(`span`,{className:`num row`,style:{gap:3},children:[(0,V.jsx)(de,{size:12,stroke:1.75}),` `,e.stars.toLocaleString()]}):null]}),(0,V.jsx)(`p`,{className:`card-text clamp-3`,children:kN(e.summary)}),(0,V.jsxs)(`div`,{className:`card-foot`,children:[(0,V.jsxs)(`div`,{className:`row`,children:[e.verified?(0,V.jsx)(`span`,{className:`pill pill-ok`,children:`Verified`}):null,(0,V.jsx)(`span`,{className:`pill`,children:e.remote?`Hosted`:`Runs locally`})]}),e.remote?(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-secondary btn-sm`,disabled:g===e.slug,onClick:()=>void b(e),children:[(0,V.jsx)(z,{size:13,stroke:2}),` `,g===e.slug?`Adding`:`Add to chat`]}):(0,V.jsx)(`a`,{className:`btn btn-ghost btn-sm`,href:e.url,target:`_blank`,rel:`noopener`,children:`Install steps`})]}),m?.slug===e.slug?(0,V.jsx)(`p`,{className:`small ${m.ok?`ok`:`fault`}`,children:m.text}):null]},e.slug))}),!f&&o.length?(0,V.jsxs)(`a`,{className:`more-link`,href:`https://plugmcp.ai/mcp${n?`?q=${encodeURIComponent(n)}`:``}`,target:`_blank`,rel:`noopener`,children:[n&&c!==null&&c>MN?`See all ${c.toLocaleString()} results on plugmcp.ai`:`See all ${c===null?``:`${c.toLocaleString()} `}servers on plugmcp.ai`,(0,V.jsx)(M,{size:14,stroke:1.75})]}):null]})]})}function PN({onNew:e,onNewMcp:t,onEditMcp:n}){let{server:r,model:i,remote:a}=Ae(),o=Ee(),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)([]),d=r?.calls??0;(0,v.useEffect)(()=>{Ce.logs().then(e=>c(e.calls.slice(0,5))).catch(()=>void 0)},[d]);let f=r?.name;if((0,v.useEffect)(()=>{f&&Ce.directory(f.replace(/[-_]/g,` `),!1).then(e=>u(e.servers.slice(0,3))).catch(()=>void 0)},[f]),!r)return null;let p=r.tools.filter(e=>e.view).length,m=r.mcpUrl.replace(`127.0.0.1`,`localhost`),h=[{id:`tool`,label:`Add a tool`,done:r.tools.length>0,href:`#/tools`,action:`Open tools`},{id:`run`,label:`Run a tool and see its result`,done:d>0,href:r.tools[0]?`#/tools/${r.tools[0].id}`:`#/tools`,action:`Run one`},{id:`key`,label:`Connect a model with your own key`,done:!!i,href:`#/settings`,action:`Add a key`},{id:`chat`,label:`Chat with your tools, or ask the chat to build one`,done:!!i&&d>1,href:`#/playground`,action:`Open the chat`},{id:`connect`,label:`Connect Cursor, Claude or another client`,done:!1,href:`#/connect`,action:`Install steps`}],g=h.filter(e=>e.done).length;return(0,V.jsxs)(`div`,{className:`page`,children:[(0,V.jsx)(Fe,{title:o.name||`Workspace`,lede:`${Ge(o.servers.length,`MCP server`)} in this folder. Each one is a set of tools behind its own address. Pick one to work on it, or start another.`,children:(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:t,children:[(0,V.jsx)(z,{size:15,stroke:2}),` New MCP server`]})}),(0,V.jsxs)(`div`,{className:`cards`,children:[o.servers.map(e=>{let t=e.id===o.current;return(0,V.jsxs)(`button`,{type:`button`,className:`card mcp-card${t?` is-current`:``}`,onClick:()=>o.switchTo(e.id),"aria-pressed":t,children:[(0,V.jsxs)(`div`,{className:`row`,children:[(0,V.jsx)(Pe,{name:e.ok?e.name:e.id}),(0,V.jsxs)(`div`,{className:`grow`,children:[(0,V.jsx)(`div`,{className:`card-title truncate`,children:e.ok?e.title??e.name:e.id}),(0,V.jsx)(`div`,{className:`row-sub mono truncate`,children:e.mcpUrl.replace(`http://127.0.0.1`,`localhost`)})]}),(0,V.jsx)(`span`,{className:`dot ${e.ok?`dot-ok`:`dot-error`}`})]}),(0,V.jsx)(`p`,{className:`card-text clamp-2`,children:e.ok?e.description??`No description yet.`:`The server file has an error. Open it to see what is wrong.`}),(0,V.jsxs)(`div`,{className:`card-foot`,children:[(0,V.jsxs)(`span`,{className:`row`,children:[e.ok?(0,V.jsx)(`span`,{className:`pill`,children:Ge(e.tools.length,`tool`)}):(0,V.jsx)(`span`,{className:`pill pill-fault`,children:`Error`}),e.ok&&e.tools.some(e=>e.view)?(0,V.jsx)(`span`,{className:`pill pill-signal`,children:Ge(e.tools.filter(e=>e.view).length,`view`)}):null]}),(0,V.jsx)(`span`,{className:t?`small`:`muted small`,style:t?{color:`var(--signal-2)`}:void 0,children:t?`Open now`:`Open`})]})]},e.id)}),(0,V.jsxs)(`button`,{type:`button`,className:`card card-dashed`,onClick:t,children:[(0,V.jsx)(z,{size:18,stroke:1.75}),`New MCP server`]})]}),(0,V.jsxs)(`div`,{className:`page-head mcp-head`,children:[(0,V.jsxs)(`div`,{className:`hero grow`,children:[(0,V.jsx)(Pe,{name:r.title??r.name,large:!0}),(0,V.jsxs)(`div`,{className:`grow`,children:[(0,V.jsx)(`h1`,{className:`truncate`,children:r.title??r.name}),(0,V.jsx)(`p`,{className:`lede`,style:{marginTop:2},children:r.description??`Running from ${r.file}.`})]})]}),(0,V.jsxs)(`div`,{className:`row-wrap`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:n,children:[(0,V.jsx)(re,{size:15,stroke:1.75}),` Edit`]}),(0,V.jsxs)(`a`,{className:`btn btn-outline`,href:`#/canvas`,children:[(0,V.jsx)(le,{size:15,stroke:1.75}),` Canvas`]}),(0,V.jsxs)(`a`,{className:`btn btn-outline`,href:`#/playground`,children:[(0,V.jsx)(L,{size:15,stroke:1.75}),` Chat`]}),(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:e,children:[(0,V.jsx)(z,{size:15,stroke:2}),` New tool`]})]})]}),(0,V.jsxs)(`div`,{className:`stats`,children:[(0,V.jsx)(FN,{href:`#/tools`,icon:pe,label:`Tools`,value:r.tools.length}),(0,V.jsx)(FN,{href:`#/tools`,icon:T,label:`Views`,value:p}),(0,V.jsx)(FN,{href:`#/logs`,icon:ee,label:`Calls this session`,value:d}),(0,V.jsx)(FN,{href:`#/logs`,icon:x,label:`Failed calls`,value:r.failed,tone:r.failed?`fault`:void 0})]}),(0,V.jsxs)(`div`,{className:`grid-2`,children:[(0,V.jsxs)(`div`,{className:`stack-lg`,children:[(0,V.jsxs)(`section`,{children:[(0,V.jsx)(Ie,{icon:pe,action:(0,V.jsx)(`a`,{className:`link small`,href:`#/tools`,children:`All tools`}),children:`Tools`}),r.tools.length===0?(0,V.jsx)(Le,{icon:pe,title:`No tools yet`,actions:(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:e,children:[(0,V.jsx)(z,{size:15,stroke:2}),` New tool`]}),children:`A tool is one function a model can call. Describe what you want and your model writes it, or start from a blank one.`}):(0,V.jsx)(`div`,{className:`panel rows`,children:r.tools.slice(0,6).map(e=>(0,V.jsxs)(`a`,{className:`rowlink`,href:`#/tools/${e.id}`,children:[(0,V.jsx)(`span`,{className:`icon-tile`,children:e.view?(0,V.jsx)(T,{size:16,stroke:1.75}):(0,V.jsx)(pe,{size:16,stroke:1.75})}),(0,V.jsxs)(`span`,{className:`grow`,children:[(0,V.jsx)(`span`,{className:`row-title mono truncate`,style:{display:`block`},children:e.name}),(0,V.jsx)(`span`,{className:`row-sub truncate`,style:{display:`block`},children:e.description??`No description yet`})]}),e.view?(0,V.jsx)(`span`,{className:`pill pill-signal hide-sm`,children:`View`}):null,(0,V.jsxs)(`span`,{className:`btn btn-outline btn-sm hide-sm`,children:[(0,V.jsx)(R,{size:13,stroke:2}),` Run`]}),(0,V.jsx)(O,{size:14,className:`chev`})]},e.id))})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(Ie,{icon:ee,action:(0,V.jsx)(`a`,{className:`link small`,href:`#/logs`,children:`All calls`}),children:`Recent calls`}),s.length===0?(0,V.jsx)(`p`,{className:`panel panel-pad muted small`,children:`Calls from the Studio, your editor and any other connected client show up here as they happen.`}):(0,V.jsx)(`div`,{className:`panel rows`,children:s.map(e=>(0,V.jsxs)(`a`,{className:`rowlink`,href:`#/logs`,children:[(0,V.jsx)(`span`,{className:`dot ${e.ok?`dot-ok`:`dot-error`}`}),(0,V.jsx)(`span`,{className:`mono grow truncate`,style:{fontSize:13},children:e.tool}),(0,V.jsxs)(`span`,{className:`num`,children:[e.ms,` ms`]}),(0,V.jsx)(`span`,{className:`num hide-sm`,children:Ke(e.at)})]},e.id))})]})]}),(0,V.jsxs)(`div`,{className:`stack-lg`,children:[g<h.length?(0,V.jsxs)(`section`,{children:[(0,V.jsx)(Ie,{icon:E,action:(0,V.jsx)(`span`,{className:`progress`,"aria-label":`${g} of ${h.length} done`,children:h.map(e=>(0,V.jsx)(`span`,{className:e.done?`is-done`:``},e.id))}),children:`Get started`}),(0,V.jsx)(`ul`,{className:`panel steps`,children:h.map(e=>(0,V.jsxs)(`li`,{className:e.done?`is-done`:``,children:[(0,V.jsx)(`span`,{className:`step-mark${e.done?` is-done`:``}`,children:e.done?(0,V.jsx)(E,{size:12,stroke:3}):null}),(0,V.jsx)(`span`,{className:`row-title grow`,children:e.label}),e.done?null:(0,V.jsx)(`a`,{className:`link small`,href:e.href,children:e.action})]},e.id))})]}):null,(0,V.jsxs)(`section`,{children:[(0,V.jsx)(Ie,{icon:M,action:(0,V.jsx)(`a`,{className:`link small`,href:`#/connect`,children:`Install steps`}),children:`Connect a client`}),(0,V.jsxs)(`div`,{className:`panel panel-pad stack`,children:[(0,V.jsx)(`p`,{className:`muted small`,children:`Point Cursor, VS Code, Claude Code or any MCP client at this address while the dev server runs.`}),(0,V.jsxs)(`div`,{className:`row`,children:[(0,V.jsx)(`code`,{className:`code grow truncate`,style:{padding:`8px 12px`,whiteSpace:`nowrap`},children:m}),(0,V.jsx)(ze,{value:m,label:`Copy the address`})]})]})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(Ie,{icon:B,action:(0,V.jsx)(`a`,{className:`link small`,href:`#/directory`,children:`Browse`}),children:`Already in the directory`}),(0,V.jsxs)(`div`,{className:`panel rows`,children:[l.map(e=>(0,V.jsxs)(`a`,{className:`rowlink`,href:e.url,target:`_blank`,rel:`noopener`,children:[(0,V.jsx)(Pe,{name:e.name}),(0,V.jsxs)(`span`,{className:`grow`,children:[(0,V.jsx)(`span`,{className:`row-title truncate`,style:{display:`block`},children:e.name}),(0,V.jsxs)(`span`,{className:`row-sub truncate`,style:{display:`block`},children:[e.remote?`Hosted`:`Runs locally`,e.publisher?` · ${e.publisher}`:``]})]}),(0,V.jsx)(M,{size:14,className:`chev`})]},e.slug)),l.length===0?(0,V.jsx)(`p`,{className:`panel-pad muted small`,children:`Search 70,000+ servers on plugmcp.ai before you build, and add hosted ones to your chat.`}):null]}),a.length?(0,V.jsxs)(`p`,{className:`hint`,style:{marginTop:8},children:[a.length,` added to your chat.`]}):null]})]})]})]})}function FN({href:e,icon:t,label:n,value:r,tone:i}){return(0,V.jsxs)(`a`,{className:`panel stat`,href:e,children:[(0,V.jsxs)(`span`,{className:`grow`,children:[(0,V.jsxs)(`span`,{className:`stat-label`,children:[(0,V.jsx)(t,{size:14,stroke:1.75,style:i?{color:`var(--fault)`}:void 0}),(0,V.jsx)(`span`,{className:`truncate`,children:n})]}),(0,V.jsx)(`span`,{className:`stat-value`,style:{display:`block`},children:r.toLocaleString()})]}),(0,V.jsx)(O,{size:14})]})}var IN=e=>typeof e==`string`?e:JSON.stringify(e,null,2);function LN(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(`all`);(0,v.useEffect)(()=>{let e=()=>document.visibilityState===`visible`&&void Ce.logs().then(t).catch(()=>void 0);e();let n=setInterval(e,2e3);return()=>clearInterval(n)},[]);let o=(e?.calls??[]).filter(e=>i===`all`||!e.ok);return(0,V.jsxs)(`div`,{className:`page`,children:[(0,V.jsxs)(Fe,{title:`Logs`,lede:`Every tool call this dev server has handled, from the Studio, your editor or any other connected client. The last 300 are kept, also after a restart.`,children:[(0,V.jsx)(Ve,{value:i,onChange:a,options:[{id:`all`,label:`All ${e?.total??0}`},{id:`failed`,label:`Failed ${e?.failed??0}`}]}),e?.calls.length?(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>void Ce.clearLogs().then(t),children:[(0,V.jsx)(me,{size:15,stroke:1.75}),` Clear`]}):null]}),o.length===0?(0,V.jsx)(Le,{icon:ee,title:i===`failed`?`No failed calls`:`No calls yet`,actions:(0,V.jsx)(`a`,{className:`btn btn-outline`,href:`#/tools`,children:`Run a tool`}),children:i===`failed`?`Calls that return an error show up here with their input and the error text.`:`Run a tool or send a chat message and the call appears here with its input, result and time.`}):(0,V.jsx)(`div`,{className:`panel`,style:{overflowX:`auto`},children:(0,V.jsxs)(`table`,{className:`table`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{style:{width:28}}),(0,V.jsx)(`th`,{children:`Tool`}),(0,V.jsx)(`th`,{className:`hide-sm`,children:`Server`}),(0,V.jsx)(`th`,{children:`Time`}),(0,V.jsx)(`th`,{children:`When`})]})}),(0,V.jsx)(`tbody`,{children:o.map(e=>(0,V.jsxs)(v.Fragment,{children:[(0,V.jsxs)(`tr`,{className:`is-click`,onClick:()=>r(n===e.id?null:e.id),"aria-expanded":n===e.id,children:[(0,V.jsx)(`td`,{children:(0,V.jsx)(`span`,{className:`dot ${e.ok?`dot-ok`:`dot-error`}`,style:{display:`inline-block`},"aria-label":e.ok?`OK`:`Failed`})}),(0,V.jsx)(`td`,{className:`mono`,children:e.tool}),(0,V.jsx)(`td`,{className:`muted hide-sm`,children:e.server===`local`?`This server`:e.server}),(0,V.jsxs)(`td`,{className:`num`,children:[e.ms,` ms`]}),(0,V.jsx)(`td`,{className:`num`,children:new Date(e.at).toLocaleTimeString()})]}),n===e.id?(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{}),(0,V.jsx)(`td`,{colSpan:4,children:(0,V.jsxs)(`div`,{className:`log-detail`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`label`,children:`Input`}),(0,V.jsx)(`pre`,{className:`code`,children:IN(e.input)})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`label`,children:e.ok?`Result`:`Error`}),(0,V.jsx)(`pre`,{className:`code${e.ok?``:` fault`}`,children:IN(e.output)})]})]})})]}):null]},e.id))})]})})]})}var RN=`vercel.ai.error`,zN=Symbol.for(RN),BN=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[zN]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,RN)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}},VN=`AI_APICallError`,HN=`vercel.ai.error.${VN}`,UN=Symbol.for(HN),WN=class extends BN{constructor({message:e,url:t,requestBodyValues:n,statusCode:r,responseHeaders:i,responseBody:a,cause:o,isRetryable:s=r!=null&&(r===408||r===409||r===429||r>=500),data:c}){super({name:VN,message:e,cause:o}),this[UN]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=i,this.responseBody=a,this.isRetryable=s,this.data=c}static isInstance(e){return BN.hasMarker(e,HN)}},GN=`AI_EmptyResponseBodyError`,KN=`vercel.ai.error.${GN}`,qN=Symbol.for(KN),JN=class extends BN{constructor({message:e=`Empty response body`}={}){super({name:GN,message:e}),this[qN]=!0}static isInstance(e){return BN.hasMarker(e,KN)}};function YN(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var XN=`AI_InvalidArgumentError`,ZN=`vercel.ai.error.${XN}`,QN=Symbol.for(ZN),$N=class extends BN{constructor({message:e,cause:t,argument:n}){super({name:XN,message:e,cause:t}),this[QN]=!0,this.argument=n}static isInstance(e){return BN.hasMarker(e,ZN)}},eP=`AI_JSONParseError`,tP=`vercel.ai.error.${eP}`,nP=Symbol.for(tP),rP=class extends BN{constructor({text:e,cause:t}){super({name:eP,message:`JSON parsing failed: Text: ${e}.\nError message: ${YN(t)}`,cause:t}),this[nP]=!0,this.text=e}static isInstance(e){return BN.hasMarker(e,tP)}},iP=`AI_TypeValidationError`,aP=`vercel.ai.error.${iP}`,oP=Symbol.for(aP),sP=class e extends BN{constructor({value:e,cause:t,context:n}){let r=`Type validation failed`;if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=` (`;let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(`, `),r+=`)`}super({name:iP,message:`${r}: Value: ${JSON.stringify(e)}.\nError message: ${YN(t)}`,cause:t}),this[oP]=!0,this.value=e,this.context=n}static isInstance(e){return BN.hasMarker(e,aP)}static wrap({value:t,cause:n,context:r}){return e.isInstance(n)&&n.value===t&&n.context?.field===r?.field&&n.context?.entityName===r?.entityName&&n.context?.entityId===r?.entityId?n:new e({value:t,cause:n,context:r})}},cP=`AI_UnsupportedFunctionalityError`,lP=`vercel.ai.error.${cP}`,uP=Symbol.for(lP),dP=class extends BN{constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:cP,message:t}),this[uP]=!0,this.functionality=e}static isInstance(e){return BN.hasMarker(e,lP)}};new TextDecoder;var{btoa:fP,atob:pP}=globalThis,mP=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get,hP=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,`byteLength`).get;function gP(e){return ArrayBuffer.isView(e)&&mP.call(e)===`Uint8Array`}function _P(e){if(typeof e!=`object`||!e||!(`byteLength`in e))return!1;try{return hP.call(e),!0}catch{return!1}}function vP(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((e,n)=>{t[n.toLowerCase()]=e});else{Array.isArray(e)||(e=Object.entries(e));for(let[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}var yP=({prefix:e,size:t=16,alphabet:n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,separator:r=`-`}={})=>{let i=()=>{let e=n.length,r=Array(t);for(let i=0;i<t;i++)r[i]=n[Math.random()*e|0];return r.join(``)};if(e==null)return i;if(n.includes(r))throw new $N({argument:`separator`,message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},bP=yP();function xP(e){return globalThis.Buffer?.isBuffer(e)??!1}var SP=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,CP=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function wP(e){let t=JSON.parse(e);return typeof t!=`object`||!t||SP.test(e)===!1&&CP.test(e)===!1?t:TP(t)}function TP(e){let t=[e];for(;t.length;){let e=t;t=[];for(let n of e){if(Object.prototype.hasOwnProperty.call(n,`__proto__`)||Object.prototype.hasOwnProperty.call(n,`constructor`)&&n.constructor!==null&&typeof n.constructor==`object`&&Object.prototype.hasOwnProperty.call(n.constructor,`prototype`))throw SyntaxError(`Object contains forbidden prototype property`);for(let e in n){let r=n[e];r&&typeof r==`object`&&t.push(r)}}}return e}function EP(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return wP(e)}try{return wP(e)}finally{Error.stackTraceLimit=t}}function DP(e){if(e.type===`object`||Array.isArray(e.type)&&e.type.includes(`object`)){let{additionalProperties:t}=e;e.additionalProperties=t!=null&&typeof t!=`boolean`&&OP(t);let{properties:n}=e;if(n!=null)for(let e of Object.keys(n))n[e]=OP(n[e])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(OP):OP(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(OP)),e.allOf!=null&&(e.allOf=e.allOf.map(OP)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(OP));let{definitions:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=OP(t[e]);return e}function OP(e){return typeof e==`boolean`?e:DP(e)}var kP=Symbol(`Let zodToJsonSchema decide on which parser to use`),AP={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`},jP=e=>typeof e==`string`?{...AP,name:e}:{...AP,...e};function MP(){return{}}function NP(e,t){let n={type:`array`};return e.type?._def&&e.type?._def?.typeName!==`ZodAny`&&(n.items=wF(e.type._def,{...t,currentPath:[...t.currentPath,`items`]})),e.minLength&&(n.minItems=e.minLength.value),e.maxLength&&(n.maxItems=e.maxLength.value),e.exactLength&&(n.minItems=e.exactLength.value,n.maxItems=e.exactLength.value),n}function PP(e){let t={type:`integer`,format:`int64`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value}return t}function FP(){return{type:`boolean`}}function IP(e,t){return wF(e.type._def,t)}var LP=(e,t)=>wF(e.innerType._def,t);function RP(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(n=>RP(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return zP(e)}}var zP=e=>{let t={type:`integer`,format:`unix-time`};for(let n of e.checks)switch(n.kind){case`min`:t.minimum=n.value;break;case`max`:t.maximum=n.value}return t};function BP(e,t){return{...wF(e.innerType._def,t),default:e.defaultValue()}}function VP(e,t){return t.effectStrategy===`input`?wF(e.schema._def,t):MP()}function HP(e){return{type:`string`,enum:Array.from(e.values)}}var UP=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function WP(e,t){let n=[wF(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),wF(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=[];return n.forEach(e=>{if(UP(e))r.push(...e.allOf);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}r.push(t)}}),r.length?{allOf:r}:void 0}function GP(e){let t=typeof e.value;return t!==`bigint`&&t!==`number`&&t!==`boolean`&&t!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:{type:t===`bigint`?`integer`:t,const:e.value}}var KP=void 0,qP={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(KP===void 0&&(KP=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),KP),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function JP(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value;break;case`max`:n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`email`:switch(t.emailStrategy){case`format:email`:QP(n,`email`,r.message,t);break;case`format:idn-email`:QP(n,`idn-email`,r.message,t);break;case`pattern:zod`:$P(n,qP.email,r.message,t)}break;case`url`:QP(n,`uri`,r.message,t);break;case`uuid`:QP(n,`uuid`,r.message,t);break;case`regex`:$P(n,r.regex,r.message,t);break;case`cuid`:$P(n,qP.cuid,r.message,t);break;case`cuid2`:$P(n,qP.cuid2,r.message,t);break;case`startsWith`:$P(n,RegExp(`^${YP(r.value,t)}`),r.message,t);break;case`endsWith`:$P(n,RegExp(`${YP(r.value,t)}$`),r.message,t);break;case`datetime`:QP(n,`date-time`,r.message,t);break;case`date`:QP(n,`date`,r.message,t);break;case`time`:QP(n,`time`,r.message,t);break;case`duration`:QP(n,`duration`,r.message,t);break;case`length`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`includes`:$P(n,RegExp(YP(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&QP(n,`ipv4`,r.message,t),r.version!==`v4`&&QP(n,`ipv6`,r.message,t);break;case`base64url`:$P(n,qP.base64url,r.message,t);break;case`jwt`:$P(n,qP.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&$P(n,qP.ipv4Cidr,r.message,t),r.version!==`v4`&&$P(n,qP.ipv6Cidr,r.message,t);break;case`emoji`:$P(n,qP.emoji(),r.message,t);break;case`ulid`:$P(n,qP.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:QP(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:$P(n,qP.base64,r.message,t)}break;case`nanoid`:$P(n,qP.nanoid,r.message,t)}return n}function YP(e,t){return t.patternStrategy===`escape`?ZP(e):e}var XP=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function ZP(e){let t=``;for(let n=0;n<e.length;n++)XP.has(e[n])||(t+=`\\`),t+=e[n];return t}function QP(e,t,n,r){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function $P(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:eF(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=eF(t,r)}function eF(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e<r.length;e++)if(a)i+=r[e],a=!1;else{if(n.i){if(o){if(r[e].match(/[a-z]/)){s?(i+=r[e],i+=`${r[e-2]}-${r[e]}`.toUpperCase(),s=!1):r[e+1]===`-`&&r[e+2]?.match(/[a-z]/)?(i+=r[e],s=!0):i+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){i+=`[${r[e]}${r[e].toUpperCase()}]`;continue}}if(n.m){if(r[e]===`^`){i+=`(^|(?<=[\r
129
+ ]))`;continue}if(r[e]===`$`){i+=`($|(?=[\r
130
+ ]))`;continue}}n.s&&r[e]===`.`?i+=o?`${r[e]}\r\n`:`[${r[e]}\r\n]`:(i+=r[e],r[e]===`\\`?a=!0:o&&r[e]===`]`?o=!1:!o&&r[e]===`[`&&(o=!0))}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join(`/`)} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function tF(e,t){let n={type:`object`,additionalProperties:wF(e.valueType._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]})??t.allowedAdditionalProperties};if(e.keyType?._def.typeName===`ZodString`&&e.keyType._def.checks?.length){let{type:r,...i}=JP(e.keyType._def,t);return{...n,propertyNames:i}}if(e.keyType?._def.typeName===`ZodEnum`)return{...n,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===`ZodBranded`&&e.keyType._def.type._def.typeName===`ZodString`&&e.keyType._def.type._def.checks?.length){let{type:r,...i}=IP(e.keyType._def,t);return{...n,propertyNames:i}}return n}function nF(e,t){return t.mapStrategy===`record`?tF(e,t):{type:`array`,maxItems:125,items:{type:`array`,items:[wF(e.keyType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`0`]})||MP(),wF(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`1`]})||MP()],minItems:2,maxItems:2}}}function rF(e){let t=e.values,n=Object.keys(e.values).filter(e=>typeof t[t[e]]!=`number`).map(e=>t[e]),r=Array.from(new Set(n.map(e=>typeof e)));return{type:r.length===1?r[0]===`string`?`string`:`number`:[`string`,`number`],enum:n}}function iF(){return{not:MP()}}function aF(){return{type:`null`}}var oF={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function sF(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in oF&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=oF[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}if(n.every(e=>e._def.typeName===`ZodLiteral`&&!e.description)){let e=n.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case`string`:case`number`:case`boolean`:return[...e,n];case`bigint`:return[...e,`integer`];case`object`:if(t._def.value===null)return[...e,`null`];default:return e}},[]);if(e.length===n.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>e._def.typeName===`ZodEnum`))return{type:`string`,enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return cF(e,t)}var cF=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>wF(e._def,{...t,currentPath:[...t.currentPath,`anyOf`,`${n}`]})).filter(e=>!!e&&(!t.strictUnions||typeof e==`object`&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function lF(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[oF[e.innerType._def.typeName],`null`]};let n=wF(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`0`]});return n&&{anyOf:[n,{type:`null`}]}}function uF(e){let t={type:`number`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`int`:t.type=`integer`;break;case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value}return t}function dF(e,t){let n={type:`object`,properties:{}},r=[],i=e.shape();for(let e in i){let a=i[e];if(a===void 0||a._def===void 0)continue;let o=pF(a),s=wF(a._def,{...t,currentPath:[...t.currentPath,`properties`,e],propertyPath:[...t.currentPath,`properties`,e]});s!==void 0&&(n.properties[e]=s,o||r.push(e))}r.length&&(n.required=r);let a=fF(e,t);return a!==void 0&&(n.additionalProperties=a),n}function fF(e,t){if(e.catchall._def.typeName!==`ZodNever`)return wF(e.catchall._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]});switch(e.unknownKeys){case`passthrough`:return t.allowedAdditionalProperties;case`strict`:return t.rejectedAdditionalProperties;case`strip`:return t.removeAdditionalStrategy===`strict`?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function pF(e){try{return e.isOptional()}catch{return!0}}var mF=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return wF(e.innerType._def,t);let n=wF(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`1`]});return n?{anyOf:[{not:MP()},n]}:MP()},hF=(e,t)=>{if(t.pipeStrategy===`input`)return wF(e.in._def,t);if(t.pipeStrategy===`output`)return wF(e.out._def,t);let n=wF(e.in._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]});return{allOf:[n,wF(e.out._def,{...t,currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]})].filter(e=>e!==void 0)}};function gF(e,t){return wF(e.type._def,t)}function _F(e,t){let n={type:`array`,uniqueItems:!0,items:wF(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function vF(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>wF(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:wF(e.rest._def,{...t,currentPath:[...t.currentPath,`additionalItems`]})}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>wF(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function yF(){return{not:MP()}}function bF(){return MP()}var xF=(e,t)=>wF(e.innerType._def,t),SF=(e,t,n)=>{switch(t){case`ZodString`:return JP(e,n);case`ZodNumber`:return uF(e);case`ZodObject`:return dF(e,n);case`ZodBigInt`:return PP(e);case`ZodBoolean`:return FP();case`ZodDate`:return RP(e,n);case`ZodUndefined`:return yF();case`ZodNull`:return aF();case`ZodArray`:return NP(e,n);case`ZodUnion`:case`ZodDiscriminatedUnion`:return sF(e,n);case`ZodIntersection`:return WP(e,n);case`ZodTuple`:return vF(e,n);case`ZodRecord`:return tF(e,n);case`ZodLiteral`:return GP(e);case`ZodEnum`:return HP(e);case`ZodNativeEnum`:return rF(e);case`ZodNullable`:return lF(e,n);case`ZodOptional`:return mF(e,n);case`ZodMap`:return nF(e,n);case`ZodSet`:return _F(e,n);case`ZodLazy`:return()=>e.getter()._def;case`ZodPromise`:return gF(e,n);case`ZodNaN`:case`ZodNever`:return iF();case`ZodEffects`:return VP(e,n);case`ZodAny`:return MP();case`ZodUnknown`:return bF();case`ZodDefault`:return BP(e,n);case`ZodBranded`:return IP(e,n);case`ZodReadonly`:return xF(e,n);case`ZodCatch`:return LP(e,n);case`ZodPipeline`:return hF(e,n);case`ZodFunction`:case`ZodVoid`:case`ZodSymbol`:return;default:return(e=>void 0)(t)}},CF=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join(`/`)};function wF(e,t,n=!1){let r=t.seen.get(e);if(t.override){let i=t.override?.(e,t,r,n);if(i!==kP)return i}if(r&&!n){let e=TF(r,t);if(e!==void 0)return e}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let a=SF(e,e.typeName,t),o=typeof a==`function`?wF(a(),t):a;if(o&&EF(e,t,o),t.postProcess){let n=t.postProcess(o,e,t);return i.jsonSchema=o,n}return i.jsonSchema=o,o}var TF=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:CF(t.currentPath,e.path)};case`none`:case`seen`:return e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join(`/`)}! Defaulting to any`),MP()):t.$refStrategy===`seen`?MP():void 0}},EF=(e,t,n)=>(e.description&&(n.description=e.description),n),DF=e=>{let t=jP(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}},OF=(e,t)=>{let n=DF(t),r=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:wF(r._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0)??MP()}),{}):void 0,i=typeof t==`string`?t:t?.nameStrategy===`title`?void 0:t?.name,a=wF(e._def,i===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,i]},!1)??MP(),o=typeof t==`object`&&t.name!==void 0&&t.nameStrategy===`title`?t.name:void 0;o!==void 0&&(a.title=o);let s=i===void 0?r?{...a,[n.definitionPath]:r}:a:{$ref:[...n.$refStrategy===`relative`?[]:n.basePath,n.definitionPath,i].join(`/`),[n.definitionPath]:{...r,[i]:a}};return s.$schema=`http://json-schema.org/draft-07/schema#`,s},kF=Symbol.for(`vercel.ai.schema`);function AF(e){let t;return()=>(t??=e(),t)}function jF(e,{validate:t}={}){return{[kF]:!0,_type:void 0,get jsonSchema(){return typeof e==`function`&&(e=e()),e},validate:t}}function MF(e){return typeof e==`object`&&!!e&&kF in e&&e[kF]===!0&&`jsonSchema`in e&&`validate`in e}function NF(e){return e==null?jF({type:`object`,properties:{},additionalProperties:!1}):MF(e)?e:`~standard`in e?e[`~standard`].vendor===`zod`?zF(e):PF(e):e()}function PF(e){return jF(()=>{if(!FF(e))throw Error(`Standard schema vendor '${e[`~standard`].vendor}' does not support JSON Schema conversion.`);return DP(e[`~standard`].jsonSchema.input({target:`draft-07`}))},{validate:async t=>{let n=await e[`~standard`].validate(t);return n.issues===void 0&&`value`in n?{success:!0,value:n.value}:{success:!1,error:new sP({value:t,cause:n.issues})}}})}function FF(e){return e[`~standard`].jsonSchema!=null}function IF(e,t){let n=t?.useReferences??!1;return jF(()=>OF(e,{$refStrategy:n?`root`:`none`}),{validate:async t=>{let n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function LF(e,t){D_().localeError||D_(px());let n=t?.useReferences??!1;return jF(()=>DP(QC(e,{target:`draft-7`,io:`input`,reused:n?`ref`:`inline`})),{validate:async t=>{let n=await aw(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function RF(e){return`_zod`in e}function zF(e,t){return RF(e)?LF(e,t):IF(e,t)}async function BF({value:e,schema:t,context:n}){let r=await VF({value:e,schema:t,context:n});if(!r.success)throw sP.wrap({value:e,cause:r.error,context:n});return r.value}async function VF({value:e,schema:t,context:n}){let r=NF(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};let t=await r.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:sP.wrap({value:e,cause:t.error,context:n}),rawValue:e}}catch(t){return{success:!1,error:sP.wrap({value:e,cause:t,context:n}),rawValue:e}}}async function HF({text:e,schema:t}){try{let n=EP(e);return t==null?{success:!0,value:n,rawValue:n}:await VF({value:n,schema:t})}catch(t){return{success:!1,error:rP.isInstance(t)?t:new rP({text:e,cause:t}),rawValue:void 0}}}function UF({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new TM).pipeThrough(new TransformStream({async transform({data:e},n){e!==`[DONE]`&&n.enqueue(await HF({text:e,schema:t}))}}))}async function WF(e){return typeof e==`function`&&(e=e()),e}new TextDecoder;var GF=U(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);dy.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){s_(this,`with`,e)},parse(e,t){return V_(this,e,t,{callee:this.parse})},parseAsync(e,t){return U_(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return G_(this,e,t)},safeParseAsync(e,t){return J_(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0})},clone(e,t){return Ng(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),KF=U(`ZodMiniString`,(e,t)=>{hy.init(e,t),GF.init(e,t)});function qF(e){return yx(KF,e)}var JF=U(`ZodMiniNumber`,(e,t)=>{tb.init(e,t),GF.init(e,t)});function YF(e){return Kx(JF,e)}var XF=U(`ZodMiniNumberFormat`,(e,t)=>{nb.init(e,t),JF.init(e,t)});function ZF(e){return Jx(XF,e)}var QF=U(`ZodMiniBoolean`,(e,t)=>{rb.init(e,t),GF.init(e,t)});function $F(e){return Yx(QF,e)}var eI=U(`ZodMiniUnknown`,(e,t)=>{sb.init(e,t),GF.init(e,t)});function tI(){return $x(eI)}var nI=U(`ZodMiniNever`,(e,t)=>{cb.init(e,t),GF.init(e,t)});function rI(e){return eS(nI,e)}var iI=U(`ZodMiniArray`,(e,t)=>{fb.init(e,t),GF.init(e,t)});function aI(e,t){return new iI({type:`array`,element:e,...Pg(t)})}var oI=U(`ZodMiniObject`,(e,t)=>{_b.init(e,t),GF.init(e,t),g_(e,`shape`,e=>e._zod.def.shape,!1)});function sI(e,t){return new oI({type:`object`,shape:e??{},...Pg(t)})}function cI(e,t){return new oI({type:`object`,shape:e,catchall:tI(),...Pg(t)})}function lI(e,t){return Hg(e,t)}var uI=U(`ZodMiniUnion`,(e,t)=>{bb.init(e,t),GF.init(e,t)});function dI(e,t){return new uI({type:`union`,options:e,...Pg(t)})}var fI=U(`ZodMiniDiscriminatedUnion`,(e,t)=>{Sb.init(e,t),GF.init(e,t)});function pI(e,t,n){return new fI({type:`union`,options:t,discriminator:e,...Pg(n)})}var mI=U(`ZodMiniRecord`,(e,t)=>{Eb.init(e,t),GF.init(e,t)});function hI(e,t,n){return!t||!t._zod?new mI({type:`record`,keyType:qF(),valueType:e,...Pg(t)}):new mI({type:`record`,keyType:e,valueType:t,...Pg(n)})}var gI=U(`ZodMiniEnum`,(e,t)=>{Db.init(e,t),GF.init(e,t),e.options=[...e._zod.values]});function _I(e,t){return new gI({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Pg(t)})}var vI=U(`ZodMiniLiteral`,(e,t)=>{Ob.init(e,t),GF.init(e,t)});function yI(e,t){return new vI({type:`literal`,values:Array.isArray(e)?e:[e],...Pg(t)})}var bI=U(`ZodMiniTransform`,(e,t)=>{kb.init(e,t),GF.init(e,t)});function xI(e){return new bI({type:`transform`,transform:e})}var SI=U(`ZodMiniOptional`,(e,t)=>{jb.init(e,t),GF.init(e,t)});function CI(e){return new SI({type:`optional`,innerType:e})}var wI=U(`ZodMiniPipe`,(e,t)=>{Vb.init(e,t),GF.init(e,t)});function TI(e,t){return new wI({type:`pipe`,in:e,out:t})}var EI=U(`ZodMiniCustom`,(e,t)=>{qb.init(e,t),GF.init(e,t)});function DI(e,t){return TS(EI,e??(()=>!0),t)}function OI(e,t={}){return ES(EI,e,t)}var kI=`AI_InvalidArgumentError`,AI=`vercel.ai.error.${kI}`,jI=Symbol.for(AI),MI=class extends BN{constructor({parameter:e,value:t,message:n}){super({name:kI,message:`Invalid argument for parameter ${e}: ${n}`}),this[jI]=!0,this.parameter=e,this.value=t}static isInstance(e){return BN.hasMarker(e,AI)}},NI=`AI_UIMessageStreamError`,PI=`vercel.ai.error.${NI}`,FI=Symbol.for(PI),II=class extends BN{constructor({chunkType:e,chunkId:t,message:n}){super({name:NI,message:n}),this[FI]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return BN.hasMarker(e,PI)}};function LI(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n={...e};for(let r in t)if(r!==`__proto__`&&r!==`constructor`&&r!==`prototype`&&Object.prototype.hasOwnProperty.call(t,r)){let i=t[r];if(i===void 0)continue;let a=r in e?e[r]:void 0,o=typeof i==`object`&&!!i&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),s=typeof a==`object`&&!!a&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);n[r]=o&&s?LI(a,i):i}return n}function RI(e){let t=[`ROOT`],n=-1,r=null,i=0;function a(e){return e>=`0`&&e<=`9`||e>=`A`&&e<=`F`||e>=`a`&&e<=`f`}function o(e,i,a){switch(e){case`"`:n=i,t.pop(),t.push(a),t.push(`INSIDE_STRING`);break;case`f`:case`t`:case`n`:n=i,r=i,t.pop(),t.push(a),t.push(`INSIDE_LITERAL`);break;case`-`:t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=i,t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`{`:n=i,t.pop(),t.push(a),t.push(`INSIDE_OBJECT_START`);break;case`[`:n=i,t.pop(),t.push(a),t.push(`INSIDE_ARRAY_START`)}}function s(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop()}}function c(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=r,t.pop()}}for(let l=0;l<e.length;l++){let u=e[l];switch(t[t.length-1]){case`ROOT`:o(u,l,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break;case`}`:n=l,t.pop()}break;case`INSIDE_OBJECT_AFTER_COMMA`:u===`"`&&(t.pop(),t.push(`INSIDE_OBJECT_KEY`));break;case`INSIDE_OBJECT_KEY`:u===`"`&&(t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`));break;case`INSIDE_OBJECT_AFTER_KEY`:u===`:`&&(t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`));break;case`INSIDE_OBJECT_BEFORE_VALUE`:o(u,l,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:s(u,l);break;case`INSIDE_STRING`:switch(u){case`"`:t.pop(),n=l;break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=l}break;case`INSIDE_ARRAY_START`:switch(u){case`]`:n=l,t.pop();break;default:o(u,l,`INSIDE_ARRAY_AFTER_VALUE`)}break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(u){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=l,t.pop();break;default:n=l}break;case`INSIDE_ARRAY_AFTER_COMMA`:o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),u===`u`?(i=0,t.push(`INSIDE_STRING_UNICODE_ESCAPE`)):n=l;break;case`INSIDE_STRING_UNICODE_ESCAPE`:a(u)&&(i++,i===4&&(t.pop(),n=l));break;case`INSIDE_NUMBER`:switch(u){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=l;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`}`:t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`]`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l);break;default:t.pop()}break;case`INSIDE_LITERAL`:{let i=e.substring(r,l+1);!`false`.startsWith(i)&&!`true`.startsWith(i)&&!`null`.startsWith(i)?(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?s(u,l):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l)):n=l;break}}}let l=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case`INSIDE_STRING`:l+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:l+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:l+=`]`;break;case`INSIDE_LITERAL`:{let t=e.substring(r,e.length);`true`.startsWith(t)?l+=`true`.slice(t.length):`false`.startsWith(t)?l+=`false`.slice(t.length):`null`.startsWith(t)&&(l+=`null`.slice(t.length))}}return l}async function zI(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await HF({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await HF({text:RI(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}yP({prefix:`steer`,size:24}),new TextEncoder,new TextEncoder,yP({prefix:`aitxt`,size:24}),yP({prefix:`call`,size:24}),TransformStream;var Q={NEVER:b_,array:aI,boolean:$F,custom:DI,discriminatedUnion:pI,enum:_I,extend:lI,int:ZF,literal:yI,looseObject:cI,maximum:nS,minLength:lS,never:rI,nonnegative:oS,number:YF,object:sI,optional:CI,pipe:TI,positive:aS,record:hI,refine:OI,safeParse:G_,startsWith:hS,string:qF,transform:xI,union:dI,unknown:tI},$={array:q,boolean:K,custom:VT,discriminatedUnion:uT,instanceof:GT,lazy:zT,literal:Z,null:Qw,number:G,object:J,record:X,string:W,union:Y,unknown:nT},BI=$.lazy(()=>$.union([$.null(),$.string(),$.number(),$.boolean(),$.record($.string(),BI.optional()),$.array(BI)])),VI=$.record($.string(),$.record($.string(),BI.optional()));function HI(e){return Q.object({source:Q.discriminatedUnion(`sourceType`,[Q.object({type:Q.literal(`source`),sourceType:Q.literal(`url`),id:Q.string(),url:Q.string(),title:Q.optional(Q.string()),providerMetadata:Q.optional(e)}),Q.object({type:Q.literal(`source`),sourceType:Q.literal(`document`),id:Q.string(),mediaType:Q.string(),title:Q.string(),filename:Q.optional(Q.string()),providerMetadata:Q.optional(e)})]),startIndex:Q.optional(Q.number().check(Q.int()).check(Q.nonnegative())),endIndex:Q.optional(Q.number().check(Q.int()).check(Q.nonnegative())),citedText:Q.optional(Q.string())})}var UI=HI(VI),WI=Q.record(Q.string(),Q.optional(BI)),GI=AF(()=>zF(Q.union([Q.looseObject({type:Q.literal(`text-start`),id:Q.string(),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`text-delta`),id:Q.string(),delta:Q.string(),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`text-end`),id:Q.string(),citations:Q.optional(Q.array(UI)),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`error`),errorText:Q.string()}),Q.looseObject({type:Q.literal(`tool-input-start`),toolCallId:Q.string(),toolName:Q.string(),inputEncoding:Q.optional(Q.enum([`json`,`text`])),providerExecuted:Q.optional(Q.boolean()),providerMetadata:Q.optional(VI),toolMetadata:Q.optional(WI),dynamic:Q.optional(Q.boolean()),title:Q.optional(Q.string())}),Q.looseObject({type:Q.literal(`tool-input-delta`),toolCallId:Q.string(),inputTextDelta:Q.string()}),Q.looseObject({type:Q.literal(`tool-input-available`),toolCallId:Q.string(),toolName:Q.string(),input:Q.unknown(),providerExecuted:Q.optional(Q.boolean()),providerMetadata:Q.optional(VI),toolMetadata:Q.optional(WI),dynamic:Q.optional(Q.boolean()),title:Q.optional(Q.string())}),Q.looseObject({type:Q.literal(`tool-input-error`),toolCallId:Q.string(),toolName:Q.string(),input:Q.unknown(),providerExecuted:Q.optional(Q.boolean()),providerMetadata:Q.optional(VI),toolMetadata:Q.optional(WI),dynamic:Q.optional(Q.boolean()),errorText:Q.string(),title:Q.optional(Q.string())}),Q.looseObject({type:Q.literal(`tool-approval-request`),approvalId:Q.string(),toolCallId:Q.string(),approvalDescriptor:Q.optional(Q.unknown()),inputSchemaInput:Q.optional(Q.unknown()),reason:Q.optional(Q.string()),isAutomatic:Q.optional(Q.boolean()),signature:Q.optional(Q.string())}),Q.looseObject({type:Q.literal(`tool-approval-response`),approvalId:Q.string(),approved:Q.boolean(),reason:Q.optional(Q.string()),providerExecuted:Q.optional(Q.boolean()),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`tool-output-available`),toolCallId:Q.string(),output:Q.unknown(),providerExecuted:Q.optional(Q.boolean()),providerMetadata:Q.optional(VI),toolMetadata:Q.optional(WI),dynamic:Q.optional(Q.boolean()),preliminary:Q.optional(Q.boolean())}),Q.looseObject({type:Q.literal(`tool-output-error`),toolCallId:Q.string(),errorText:Q.string(),providerExecuted:Q.optional(Q.boolean()),providerMetadata:Q.optional(VI),toolMetadata:Q.optional(WI),dynamic:Q.optional(Q.boolean())}),Q.looseObject({type:Q.literal(`tool-output-denied`),toolCallId:Q.string()}),Q.looseObject({type:Q.literal(`reasoning-start`),id:Q.string(),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`reasoning-delta`),id:Q.string(),delta:Q.string(),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`reasoning-end`),id:Q.string(),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`custom`),kind:Q.pipe(Q.string(),Q.transform(e=>e)),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`source-url`),sourceId:Q.string(),url:Q.string(),title:Q.optional(Q.string()),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`source-document`),sourceId:Q.string(),mediaType:Q.string(),title:Q.string(),filename:Q.optional(Q.string()),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`file`),url:Q.string(),mediaType:Q.string(),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`reasoning-file`),url:Q.string(),mediaType:Q.string(),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`steering-message`),id:Q.string(),parts:Q.array(Q.union([Q.looseObject({type:Q.literal(`text`),text:Q.string(),providerMetadata:Q.optional(VI)}),Q.looseObject({type:Q.literal(`file`),mediaType:Q.string(),url:Q.string(),filename:Q.optional(Q.string()),providerReference:Q.optional(Q.record(Q.string(),Q.string())),providerMetadata:Q.optional(VI)})]))}),Q.looseObject({type:Q.custom(e=>typeof e==`string`&&e.startsWith(`data-`),{message:`Type must start with "data-"`}),id:Q.optional(Q.string()),data:Q.unknown(),transient:Q.optional(Q.boolean())}),Q.looseObject({type:Q.literal(`start-step`)}),Q.looseObject({type:Q.literal(`finish-step`)}),Q.looseObject({type:Q.literal(`reset-step`)}),Q.looseObject({type:Q.literal(`start`),messageId:Q.optional(Q.string()),messageMetadata:Q.optional(Q.unknown())}),Q.looseObject({type:Q.literal(`finish`),finishReason:Q.optional(Q.enum([`stop`,`length`,`content-filter`,`tool-calls`,`error`,`interrupted`,`other`])),messageMetadata:Q.optional(Q.unknown())}),Q.looseObject({type:Q.literal(`abort`),reason:Q.optional(Q.string())}),Q.looseObject({type:Q.literal(`message-metadata`),messageMetadata:Q.unknown()})])));function KI(e){return e.type.startsWith(`data-`)}function qI(){return Object.create(null)}function JI(e){return e.type.startsWith(`tool-`)}function YI(e){return e.type===`dynamic-tool`}function XI(e){return JI(e)||YI(e)}function ZI(e){return e.type.split(`-`).slice(1).join(`-`)}function QI({lastMessage:e,messageId:t}){let n=e?.role===`assistant`?e:{id:t,metadata:void 0,role:`assistant`,parts:[]},r=qI(),i=n.parts.findLastIndex(e=>e.type===`step-start`),a=0;for(let e of n.parts.slice(i+1)){if(!XI(e))continue;let t=a;JI(e)&&a++,e.state===`input-streaming`&&(r[e.toolCallId]={text:e.rawInput??``,inputEncoding:e.inputEncoding,index:t,toolName:e.type===`dynamic-tool`?e.toolName:ZI(e),dynamic:e.type===`dynamic-tool`,title:e.title,toolMetadata:e.toolMetadata})}return{message:n,activeTextParts:qI(),activeReasoningParts:qI(),partialToolCalls:r}}function $I({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:a,onData:o,resetStateOnMessageIdChange:s=!1,resetStateOnFirstMessageStart:c=!1}){let l=!0;return e.pipeThrough(new TransformStream({async transform(e,u){await r(async({state:r,write:d})=>{function f(){let e=r.message.parts,t=e.length-1;for(;t>=0&&e[t].type!==`step-start`;)t--;return e.slice(t+1)}function p(){return f().filter(XI)}function m(e){let t=p().find(t=>t.toolCallId===e);if(t==null){let n=r.message.parts;for(let r=n.length-1;r>=0;r--){let i=n[r];if(XI(i)&&i.toolCallId===e){t=i;break}}}if(t==null)throw new II({chunkType:`tool-invocation`,chunkId:e,message:`No tool invocation found for tool call ID "${e}".`});return t}function h(e){let t=r.message.parts.filter(XI).find(t=>t.approval?.id===e);if(t==null)throw new II({chunkType:`tool-approval-response`,chunkId:e,message:`No tool invocation found for approval ID "${e}".`});return t}function g(e,t){let n=t??f().find(t=>JI(t)&&t.toolCallId===e.toolCallId),i=e,a=n;if(n!=null){n.state=e.state,a.type=`tool-${e.toolName}`,a.input=i.input,a.output=i.output,a.errorText=i.errorText,a.rawInput=i.rawInput,i.inputEncoding==null?delete a.inputEncoding:a.inputEncoding=i.inputEncoding,a.preliminary=i.preliminary,e.title!==void 0&&(a.title=e.title),e.toolMetadata!==void 0&&(a.toolMetadata=e.toolMetadata),a.providerExecuted=i.providerExecuted??n.providerExecuted;let t=i.providerMetadata;if(t!=null){if(e.state===`output-available`||e.state===`output-error`){let e=n;e.resultProviderMetadata=t}else n.callProviderMetadata=t}}else r.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,...e.toolMetadata===void 0?{}:{toolMetadata:e.toolMetadata},input:i.input,...i.inputEncoding==null?{}:{inputEncoding:i.inputEncoding},output:i.output,rawInput:i.rawInput,errorText:i.errorText,providerExecuted:i.providerExecuted,preliminary:i.preliminary,...i.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:i.providerMetadata}:{},...i.providerMetadata!=null&&e.state!==`output-available`&&e.state!==`output-error`?{callProviderMetadata:i.providerMetadata}:{}})}function _(e,t){let n=t??f().find(t=>t.type===`dynamic-tool`&&t.toolCallId===e.toolCallId),i=e,a=n;if(n!=null){n.state=e.state,a.toolName=e.toolName,a.input=i.input,a.output=i.output,a.errorText=i.errorText,a.rawInput=i.rawInput,i.inputEncoding==null?delete a.inputEncoding:a.inputEncoding=i.inputEncoding,a.preliminary=i.preliminary,e.title!==void 0&&(a.title=e.title),e.toolMetadata!==void 0&&(a.toolMetadata=e.toolMetadata),a.providerExecuted=i.providerExecuted??n.providerExecuted;let t=i.providerMetadata;if(t!=null){if(e.state===`output-available`||e.state===`output-error`){let e=n;e.resultProviderMetadata=t}else n.callProviderMetadata=t}}else r.message.parts.push({type:`dynamic-tool`,toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:i.input,...i.inputEncoding==null?{}:{inputEncoding:i.inputEncoding},output:i.output,errorText:i.errorText,preliminary:i.preliminary,providerExecuted:i.providerExecuted,title:e.title,...e.toolMetadata===void 0?{}:{toolMetadata:e.toolMetadata},...i.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:i.providerMetadata}:{},...i.providerMetadata!=null&&e.state!==`output-available`&&e.state!==`output-error`?{callProviderMetadata:i.providerMetadata}:{}})}async function v(e){if(e!=null){let n=r.message.metadata==null?e:LI(r.message.metadata,e);t!=null&&await BF({value:n,schema:t,context:{field:`message.metadata`,entityId:r.message.id}}),r.message.metadata=n}}switch(e.type){case`text-start`:{let t={type:`text`,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeTextParts[e.id]=t,r.message.parts.push(t),d();break}case`text-delta`:{let t=r.activeTextParts[e.id];if(t==null)throw new II({chunkType:`text-delta`,chunkId:e.id,message:`Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});t.text+=e.delta,t.providerMetadata=e.providerMetadata??t.providerMetadata,d();break}case`text-end`:{let t=r.activeTextParts[e.id];if(t==null)throw new II({chunkType:`text-end`,chunkId:e.id,message:`Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});t.state=`done`,e.citations!=null&&(t.citations=e.citations),t.providerMetadata=e.providerMetadata??t.providerMetadata,delete r.activeTextParts[e.id],d();break}case`custom`:{let t={type:`custom`,kind:e.kind,providerMetadata:e.providerMetadata};r.message.parts.push(t),d();break}case`reasoning-start`:{let t={type:`reasoning`,id:e.id,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),d();break}case`reasoning-delta`:{let t=r.activeReasoningParts[e.id];if(t==null)throw new II({chunkType:`reasoning-delta`,chunkId:e.id,message:`Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});t.text+=e.delta,t.providerMetadata=e.providerMetadata??t.providerMetadata,d();break}case`reasoning-end`:{let t=r.activeReasoningParts[e.id];if(t==null)throw new II({chunkType:`reasoning-end`,chunkId:e.id,message:`Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});t.providerMetadata=e.providerMetadata??t.providerMetadata,t.state=`done`,delete r.activeReasoningParts[e.id],d();break}case`file`:case`reasoning-file`:r.message.parts.push({type:e.type,mediaType:e.mediaType,url:e.url,...e.providerMetadata==null?{}:{providerMetadata:e.providerMetadata}}),d();break;case`source-url`:r.message.parts.push({type:`source-url`,sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),d();break;case`source-document`:r.message.parts.push({type:`source-document`,sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),d();break;case`tool-input-start`:{let t=f().filter(JI);r.partialToolCalls[e.toolCallId]={text:``,inputEncoding:e.inputEncoding,toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title,toolMetadata:e.toolMetadata},e.dynamic?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,inputEncoding:e.inputEncoding,input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}):g({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,inputEncoding:e.inputEncoding,input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}),d();break}case`tool-input-delta`:{let t=r.partialToolCalls[e.toolCallId];if(t==null)throw new II({chunkType:`tool-input-delta`,chunkId:e.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});t.text+=e.inputTextDelta;let n=t.inputEncoding===`text`?t.text:(await zI(t.text)).value;t.dynamic?_({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,inputEncoding:t.inputEncoding,input:n,rawInput:t.text,title:t.title,toolMetadata:t.toolMetadata}):g({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,inputEncoding:t.inputEncoding,input:n,rawInput:t.text,title:t.title,toolMetadata:t.toolMetadata}),d();break}case`tool-input-available`:e.dynamic?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}):g({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}),d(),a&&!e.providerExecuted&&await a({toolCall:e});break;case`tool-input-error`:{let t=f().filter(XI).find(t=>t.toolCallId===e.toolCallId);(t==null?e.dynamic:t.type===`dynamic-tool`)?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}):g({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}),d();break}case`tool-approval-request`:{let t=m(e.toolCallId);t.state=`approval-requested`,t.approval={id:e.approvalId,...e.approvalDescriptor==null?{}:{descriptor:e.approvalDescriptor},...Object.prototype.hasOwnProperty.call(e,`inputSchemaInput`)?{inputSchemaInput:e.inputSchemaInput}:{},...e.reason==null?{}:{requestReason:e.reason},...e.isAutomatic===!0?{isAutomatic:!0}:{},...e.signature==null?{}:{signature:e.signature}},d();break}case`tool-approval-response`:{let t=h(e.approvalId),n=t.approval==null?{id:e.approvalId}:t.approval;t.state=`approval-responded`,t.approval={...n,id:e.approvalId,approved:e.approved,...e.reason==null?{}:{reason:e.reason}},e.providerExecuted!=null&&(t.providerExecuted=e.providerExecuted),e.providerMetadata!=null&&(t.callProviderMetadata=e.providerMetadata),d();break}case`tool-output-denied`:{let t=m(e.toolCallId);t.state=`output-denied`,d();break}case`tool-output-available`:{let t=m(e.toolCallId);t.type===`dynamic-tool`?_({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-available`,input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t):g({toolCallId:e.toolCallId,toolName:ZI(t),state:`output-available`,input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t),d();break}case`tool-output-error`:{let t=m(e.toolCallId);t.type===`dynamic-tool`?_({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-error`,input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t):g({toolCallId:e.toolCallId,toolName:ZI(t),state:`output-error`,input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:e.toolMetadata??t.toolMetadata},t),d();break}case`steering-message`:r.message.parts.push({type:`steering-message`,id:e.id,parts:e.parts}),d();break;case`start-step`:r.message.parts.push({type:`step-start`});break;case`finish-step`:break;case`reset-step`:{let e=f();r.activeTextParts=qI(),r.activeReasoningParts=qI(),r.partialToolCalls=qI(),e.length>0&&(r.message.parts.splice(r.message.parts.length-e.length,e.length),d());break}case`start`:{let t=c&&l||s&&e.messageId!=null&&e.messageId!==r.message.id;l=!1,t&&Object.assign(r,QI({lastMessage:void 0,messageId:e.messageId??r.message.id}),{finishReason:void 0}),e.messageId!=null&&(r.message.id=e.messageId),await v(e.messageMetadata),(t||e.messageId!=null||e.messageMetadata!=null)&&d({updateStatus:!1});break}case`finish`:e.finishReason!=null&&(r.finishReason=e.finishReason),await v(e.messageMetadata),e.messageMetadata!=null&&d();break;case`message-metadata`:await v(e.messageMetadata),e.messageMetadata!=null&&d();break;case`error`:i?.(Error(e.errorText));break;default:if(KI(e)){let t=n?.[e.type.slice(5)];if(t!=null){let n=r.message.parts.findIndex(t=>`id`in t&&`data`in t&&t.id===e.id&&t.type===e.type),i=n>=0?n:r.message.parts.length;await BF({value:e.data,schema:t,context:{field:`message.parts[${i}].data`,entityName:e.type,entityId:e.id}})}let i=e;if(i.transient){o?.(i);break}let a=i.id==null?void 0:r.message.parts.find(e=>i.type===e.type&&i.id===e.id);a==null?r.message.parts.push(i):a.data=i.data,o?.(i),d()}}u.enqueue(e)})}}))}async function eL({stream:e,onError:t,abortSignal:n}){let r=e.getReader(),i=()=>{r.cancel().catch(()=>{})};n?.aborted?i():n?.addEventListener(`abort`,i,{once:!0});try{for(;;){let{done:e}=await r.read();if(e)break}}catch(e){t?.(e)}finally{n?.removeEventListener(`abort`,i),r.releaseLock()}}function tL(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}yP({prefix:`aitxt`,size:24}),yP({prefix:`call`,size:24}),yP({prefix:`aitxt`,size:24}),yP({prefix:`call`,size:24});var nL=Symbol(`invalid`);function rL(e){let t=[],n=iL(e,t,new Set);return n===nL?{success:!1,path:t}:{success:!0,value:n}}function iL(e,t,n){switch(typeof e){case`string`:case`boolean`:return e;case`number`:return Number.isFinite(e)?e:nL;case`object`:{if(e===null)return e;if(n.has(e))return nL;n.add(e);let r=Array.isArray(e)?aL(e,t,n):oL(e,t,n);return n.delete(e),r}default:return nL}}function aL(e,t,n){let r;for(let i=0;i<e.length;i++){let a=e[i];t.push(i);let o=iL(a,t,n);if(o===nL)return nL;t.pop(),r==null?o!==a&&(r=e.slice(0,i),r.push(o)):r.push(o)}return r??e}function oL(e,t,n){if(!cL(e)||lL(e))return nL;let r=Object.keys(e),i;for(let a=0;a<r.length;a++){let o=r[a];if(o===`__proto__`){i??=sL(e,r,a);continue}let s=e[o],c=s;if(s!==void 0){if(t.push(o),c=iL(s,t,n),c===nL)return nL;t.pop()}i==null?c!==s&&(i=sL(e,r,a),i[o]=c):i[o]=c}return i??e}function sL(e,t,n){let r={};for(let i=0;i<n;i++)r[t[i]]=e[t[i]];return r}function cL(e){let t=e.constructor;if(typeof t!=`function`)return!0;let n=t.prototype;return typeof n==`object`&&!!n&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)}function lL(e){let t=Object.getOwnPropertySymbols(e);for(let n=0;n<t.length;n++)if(Object.prototype.propertyIsEnumerable.call(e,t[n]))return!0;return!1}var uL=Q.pipe(Q.unknown(),Q.transform((e,t)=>{let n=rL(e);return n.success?n.value:(t.issues.push({code:`custom`,message:`Invalid JSON value. Expected null, a string, a finite number, a boolean, an array, or an object.`,input:e,path:n.path}),Q.NEVER)})),dL=Q.custom();Q.pipe(uL,Q.record(Q.string(),dL));var fL=Q.pipe(uL,Q.record(Q.string(),Q.record(Q.string(),dL)));Q.record(Q.string(),Q.string()),HI(fL),yP({prefix:`call`,size:24}),yP({prefix:`call`,size:24}),new TextEncoder,yP({prefix:`call`,size:24}),yP({prefix:`aiobj`,size:24});var{atob:pL}=globalThis,mL=class{constructor(){this.queue=[],this.isProcessing=!1,this.idleWaiters=[]}async processQueue(){if(!this.isProcessing){this.isProcessing=!0;try{for(;this.queue.length>0;)await this.queue[0](),this.queue.shift()}finally{this.isProcessing=!1;for(let e of this.idleWaiters.splice(0))e()}}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(e){n(e)}}),this.processQueue()})}async waitForIdle(){(this.isProcessing||this.queue.length!==0)&&await new Promise(e=>{this.idleWaiters.push(e)})}};yP({prefix:`aiobj`,size:24}),yP({prefix:`call`,size:24});var hL=$.union([$.string(),$.custom(gP,{message:`Must be a Uint8Array`}),$.custom(_P,{message:`Must be an ArrayBuffer`}),$.custom(xP,{message:`Must be a Buffer`})]),gL=$.record($.string(),$.string()),_L=$.object({type:$.literal(`text`),text:$.string(),providerOptions:VI.optional()}),vL=$.object({type:$.literal(`image`),image:$.union([hL,$.instanceof(URL),gL]),mediaType:$.string().optional(),providerOptions:VI.optional()}),yL=$.discriminatedUnion(`type`,[$.object({type:$.literal(`data`),data:hL}),$.object({type:$.literal(`url`),url:$.instanceof(URL)}),$.object({type:$.literal(`reference`),reference:gL}),$.object({type:$.literal(`text`),text:$.string()})]),bL=$.discriminatedUnion(`type`,[$.object({type:$.literal(`data`),data:hL}),$.object({type:$.literal(`url`),url:$.instanceof(URL)})]),xL=$.object({type:$.literal(`file`),data:$.union([yL,hL,$.instanceof(URL),gL]),filename:$.string().optional(),mediaType:$.string(),providerOptions:VI.optional()}),SL=$.object({type:$.literal(`reasoning`),text:$.string(),providerOptions:VI.optional()}),CL=$.object({type:$.literal(`custom`),kind:$.string().transform(e=>e),providerOptions:VI.optional()}),wL=$.object({type:$.literal(`reasoning-file`),data:$.union([bL,hL,$.instanceof(URL)]),mediaType:$.string(),providerOptions:VI.optional()}),TL=$.object({type:$.literal(`tool-call`),toolCallId:$.string(),toolName:$.string(),input:$.unknown(),providerOptions:VI.optional(),providerExecuted:$.boolean().optional()}),EL=$.discriminatedUnion(`type`,[$.object({type:$.literal(`text`),value:$.string(),providerOptions:VI.optional()}),$.object({type:$.literal(`json`),value:BI,providerOptions:VI.optional()}),$.object({type:$.literal(`execution-denied`),reason:$.string().optional(),providerOptions:VI.optional()}),$.object({type:$.literal(`error-text`),value:$.string(),providerOptions:VI.optional()}),$.object({type:$.literal(`error-json`),value:BI,providerOptions:VI.optional()}),$.object({type:$.literal(`content`),value:$.array($.union([$.object({type:$.literal(`text`),text:$.string(),providerOptions:VI.optional()}),$.object({type:$.literal(`file`),data:yL,mediaType:$.string(),filename:$.string().optional(),providerOptions:VI.optional()}),$.object({type:$.literal(`file-data`),data:$.string(),mediaType:$.string(),filename:$.string().optional(),providerOptions:VI.optional()}),$.object({type:$.literal(`file-url`),url:$.string(),mediaType:$.string().optional(),providerOptions:VI.optional()}),$.object({type:$.literal(`file-id`),fileId:$.union([$.string(),$.record($.string(),$.string())]),providerOptions:VI.optional()}),$.object({type:$.literal(`file-reference`),providerReference:$.record($.string(),$.string()),providerOptions:VI.optional()}),$.object({type:$.literal(`image-data`),data:$.string(),mediaType:$.string(),providerOptions:VI.optional()}),$.object({type:$.literal(`image-url`),url:$.string(),providerOptions:VI.optional()}),$.object({type:$.literal(`image-file-id`),fileId:$.union([$.string(),$.record($.string(),$.string())]),providerOptions:VI.optional()}),$.object({type:$.literal(`image-file-reference`),providerReference:$.record($.string(),$.string()),providerOptions:VI.optional()}),$.object({type:$.literal(`custom`),providerOptions:VI.optional()})]))})]),DL=$.object({type:$.literal(`tool-result`),toolCallId:$.string(),toolName:$.string(),output:EL,providerOptions:VI.optional()}),OL=$.object({type:$.literal(`tool-approval-request`),approvalId:$.string(),toolCallId:$.string(),reason:$.string().optional(),isAutomatic:$.boolean().optional(),signature:$.string().optional(),inputSchemaInput:$.unknown().optional()}),kL=$.object({type:$.literal(`tool-approval-response`),approvalId:$.string(),approved:$.boolean(),reason:$.string().optional()}),AL=$.object({role:$.literal(`system`),content:$.string(),providerOptions:VI.optional()}),jL=$.object({role:$.literal(`user`),content:$.union([$.string(),$.array($.union([_L,vL,xL]))]),providerOptions:VI.optional()}),ML=$.object({role:$.literal(`assistant`),content:$.union([$.string(),$.array($.union([_L,CL,xL,SL,wL,TL,DL,OL]))]),providerOptions:VI.optional()}),NL=$.object({role:$.literal(`tool`),content:$.array($.union([DL,kL])),providerOptions:VI.optional()});$.union([AL,jL,ML,NL]),Q.object({token:Q.string().check(Q.refine(e=>e.trim().length>0)),url:Q.string().check(Q.refine(e=>{try{let t=new URL(e);return(t.protocol===`ws:`||t.protocol===`wss:`)&&t.hostname!==``}catch{return!1}})),expiresAt:Q.optional(Q.number().check(Q.positive()).check(Q.maximum(2**53-1))),tools:Q.optional(Q.array(Q.object({type:Q.literal(`function`),name:Q.string().check(Q.minLength(1)),description:Q.optional(Q.string()),parameters:Q.record(Q.string(),Q.unknown())})))}),yP({prefix:`call`,size:24}),yP({prefix:`call`,size:24}),yP({prefix:`call`,size:24});async function PL({response:e,url:t,fallbackMessage:n}){let r=await e.text();return new WN({message:r||n,url:t,requestBodyValues:void 0,statusCode:e.status,responseBody:r})}async function FL(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new dP({functionality:`FileList`,message:`FileList is not supported in the current environment`});return Promise.all(Array.from(e).map(async e=>{let{name:t,type:n}=e;return{type:`file`,mediaType:n,filename:t,url:await new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{t(e.target?.result)},r.onerror=e=>n(e),r.readAsDataURL(e)})}}))}function IL(e,t){let n=e.search(/[?#]/),r=n===-1?e:e.slice(0,n),i=n===-1?``:e.slice(n);return`${r.endsWith(`/`)&&t.startsWith(`/`)?r.slice(0,-1):r}${t}${i}`}var LL=class{constructor({api:e=`/api/chat`,credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:o}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=o}async sendMessages({abortSignal:e,...t}){let n=await WF(this.body),r=await WF(this.headers),i=await WF(this.credentials),a={...vP(r),...vP(t.headers)},o=await this.prepareSendMessagesRequest?.({api:this.api,id:t.chatId,messages:t.messages,body:{...n,...t.body},headers:a,credentials:i,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId}),s=o?.api??this.api,c=o?.headers===void 0?a:vP(o.headers),l=o?.body===void 0?{...n,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId}:o.body,u=o?.credentials??i,d=await(this.fetch??globalThis.fetch)(s,{method:`POST`,headers:{"content-type":`application/json`,...c},body:JSON.stringify(l),credentials:u,signal:e});if(!d.ok)throw await PL({response:d,url:s,fallbackMessage:`Failed to fetch the chat response.`});if(!d.body)throw new JN({message:`The response body is empty.`});return this.processResponseStream(d.body)}async reconnectToStream(e){let t=await WF(this.body),n=await WF(this.headers),r=await WF(this.credentials),i={...vP(n),...vP(e.headers)},a=await this.prepareReconnectToStreamRequest?.({api:this.api,id:e.chatId,body:{...t,...e.body},headers:i,credentials:r,requestMetadata:e.metadata}),o=a?.api;if(o==null){if(e.chatId===`.`||e.chatId===`..`)throw new MI({parameter:`chatId`,value:e.chatId,message:`Chat IDs must not be "." or ".." when using the default reconnect URL.`});o=IL(this.api,`/${encodeURIComponent(e.chatId)}/stream`)}let s=a?.headers===void 0?i:vP(a.headers),c=a?.credentials??r,l=await(this.fetch??globalThis.fetch)(o,{method:`GET`,headers:s,credentials:c,signal:e.abortSignal});if(l.status===204)return null;if(!l.ok)throw await PL({response:l,url:o,fallbackMessage:`Failed to fetch the chat response.`});if(!l.body)throw new JN({message:`The response body is empty.`});return this.processResponseStream(l.body)}},RL=class extends LL{constructor({resumeStreamIsReplay:e=!0,...t}={}){super(t),this.resumeStreamIsReplay=e}processResponseStream(e){return UF({stream:e,schema:GI}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},zL=class{get id(){return this._id??=this.generateId()}constructor({generateId:e=bP,id:t,transport:n=new RL,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:o,onToolCall:s,onFinish:c,onData:l,sendAutomaticallyWhen:u,experimental_queue:d=!1}){this.queuedMessagesFallback=[],this.queuedMessageOptions=new Map,this.isQueuePaused=!1,this.pendingAutomaticDecisions=[],this.pendingMessagePreparations=new Set,this.interruptedMessageIds=new Set,this.activeResponse=void 0,this.activeResumeRequest=void 0,this.resumableStreamState=void 0,this.jobExecutor=new mL,this.activeStopCount=0,this.stopGeneration=0,this.experimental_removeQueuedMessage=e=>{this.queuedMessageOptions.delete(e),this.setQueuedMessages(this.experimental_queuedMessages.filter(t=>t.id!==e))},this.experimental_sendQueuedMessageNow=async e=>{let t=this.experimental_queuedMessages.find(t=>t.id===e);if(t==null)return;this.setQueuedMessages([t,...this.experimental_queuedMessages.filter(t=>t.id!==e)]);let n=this.stopGeneration+1;await this.stop(),n===this.stopGeneration&&await this.resumeQueue({skipWaitForUser:!0,options:this.queuedMessageOptions.get(e)})},this.sendMessage=async(e,t)=>{if(e==null){let e=this.pendingApprovalMessageId;if(e==null){e=this.lastMessage?.id;for(let t=this.state.messages.length-1;t>=0;t--){let n=this.state.messages[t];if(n.role===`assistant`&&n.parts.some(e=>XI(e)&&e.state===`approval-responded`)){e=n.id;break}}}let n=e!=null&&e===this.pendingApprovalMessageId?this.state.messages.findIndex(t=>t.id===e):-1;await this.makeRequestForToolApproval({messageId:e,messageIndex:n,...t});return}let n;if(`text`in e||`files`in e){let t=new AbortController;this.pendingMessagePreparations.add(t);let r;try{r=Array.isArray(e.files)?e.files:await FL(e.files)}finally{this.pendingMessagePreparations.delete(t)}if(t.signal.aborted)return;n={parts:[...r,...`text`in e&&e.text!=null?[{type:`text`,text:e.text}]:[]]}}else n=e;if(this.queueEnabled&&e.messageId==null&&(this.isRequestInProgress()||this.isWaitingForUser()||this.experimental_queuedMessages.length>0)){let r={...n,id:n.id??this.generateId(),role:n.role??`user`,metadata:e.metadata};t!=null&&this.queuedMessageOptions.set(r.id,t),this.setQueuedMessages([...this.experimental_queuedMessages,r]),await this.resumeQueue({skipWaitForUser:this.isQueuePaused,options:t})}else{if(e.messageId!=null){await this.clearQueueForHistoryChange();let t=this.state.messages.findIndex(t=>t.id===e.messageId);if(t===-1)throw new MI({parameter:`message.messageId`,value:e.messageId,message:`message with id ${e.messageId} not found`});if(this.state.messages[t].role!==`user`)throw new MI({parameter:`message.messageId`,value:e.messageId,message:`message with id ${e.messageId} is not a user message`});this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{id:e.messageId,...n,role:n.role??`user`,metadata:e.metadata})}else this.state.pushMessage({...n,id:n.id??this.generateId(),role:n.role??`user`,metadata:e.metadata});this.isQueuePaused=!1,await this.makeRequest({trigger:`submit-message`,messageId:e.messageId,...t})}},this.regenerate=async({messageId:e,...t}={})=>{await this.clearQueueForHistoryChange();let n=e==null?this.state.messages.length-1:this.state.messages.findIndex(t=>t.id===e);if(n===-1)throw new MI({parameter:`messageId`,value:e,message:`message ${e} not found`});this.state.messages=this.state.messages.slice(0,this.messages[n].role===`assistant`?n:n+1),await this.makeRequest({trigger:`regenerate-message`,messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:`resume-stream`,...e})},this[`~resumeStreamIfDisconnected`]=async({shouldResume:e=()=>!0}={})=>{let t=this.activeResponse;this.resumableStreamState==null&&t!=null&&(await t.completionPromise,this.resumableStreamState!==t.state)||this.resumableStreamState!=null&&e()&&await this.resumeStream()},this.clearError=()=>{this.status===`error`&&(this.state.error=void 0,this.setStatus({status:`ready`}))},this.addToolApprovalResponse=async({id:e,approved:t,reason:n,options:r})=>this.jobExecutor.run(async()=>{let i=this.stopGeneration,a=this.state.messages,o=r=>XI(r)&&r.state===`approval-requested`&&r.approval.id===e?{...r,state:`approval-responded`,approval:{...r.approval,id:e,approved:t,reason:n}}:r,s=a.findIndex(t=>t.parts.some(t=>XI(t)&&t.state===`approval-requested`&&t.approval.id===e));if(s!==-1){let e=a[s];this.state.replaceMessage(s,{...e,parts:e.parts.map(o)}),this.pendingApprovalMessageId=e.id}if(this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(o)),s!==-1&&this.status!==`streaming`&&this.status!==`submitted`&&this.sendAutomaticallyWhen){let e=await this.shouldSendAutomatically(a[s].id);if(e){this.runAutomaticRequest(()=>{let e=s===-1?this.lastMessage?.id:a[s].id;return this.makeRequestForToolApproval({messageId:e,messageIndex:s,...r})},e);return}}this.settleQueue({stopGeneration:i})}),this.addToolOutput=async({state:e,toolCallId:t,output:n,errorText:r,options:i})=>this.jobExecutor.run(async()=>{let a=this.stopGeneration,o=this.state.messages,s=i=>{if(!XI(i)||i.toolCallId!==t)return i;let{approval:a,...o}=i,s=a?.approved===!0?{approval:{...a,approved:a.approved}}:{};return e===`output-error`?{...o,...s,state:e,input:i.input,output:void 0,errorText:r}:{...o,...s,state:`output-available`,input:i.input,output:n,errorText:void 0}},c=o.findIndex(e=>e.parts.some(e=>XI(e)&&e.toolCallId===t));if(c!==-1){let e=o[c];this.state.replaceMessage(c,{...e,parts:e.parts.map(s)})}if(this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(s)),c!==-1&&this.status!==`streaming`&&this.status!==`submitted`&&this.sendAutomaticallyWhen){let e=await this.shouldSendAutomatically(o[c].id);if(e){this.runAutomaticRequest(()=>this.makeRequest({trigger:`submit-message`,messageId:o[c].id,...i}),e);return}}this.settleQueue({stopGeneration:a})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{this.activeStopCount++,this.stopGeneration++,this.deferredApprovalSend=void 0;try{let e=this.activeResumeRequest,t=this.activeResponse;for(let e of this.pendingMessagePreparations)e.abort();e?.abortController.abort(),t?.abortController.abort(),await Promise.all([e?.completionPromise,t?.completionPromise]),await this.jobExecutor.waitForIdle(),this.isQueuePaused=!0}finally{this.activeStopCount--}},this.dispose=async()=>{await this.stop(),this.transport.close?.()},this._id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=a,this.onError=o,this.onToolCall=s,this.onFinish=c,this.onData=l,this.sendAutomaticallyWhen=u,this.queueEnabled=d}get status(){return this.state.status}setStatus({status:e,error:t}){this.status===e?this.error!==t&&(this.state.error=t):(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}get experimental_queuedMessages(){return this.state.experimental_queuedMessages??this.queuedMessagesFallback}setQueuedMessages(e){`experimental_queuedMessages`in this.state?this.state.experimental_queuedMessages=e:this.queuedMessagesFallback=e}async resumeQueue({skipWaitForUser:e,options:t}){if(this.isQueuePaused=!1,this.hasUnsentApprovalResponse()){if(!this.isRequestInProgress()){await this.sendMessage(void 0,t);return}this.deferredApprovalSend={options:t}}await this.settleQueue({skipWaitForUser:e})}async clearQueueForHistoryChange(){this.queueEnabled&&(this.queuedMessageOptions.clear(),this.setQueuedMessages([]),this.deferredApprovalSend=void 0,this.isRequestInProgress()&&await this.stop())}isRequestInProgress(){return this.pendingAutomaticDecisions.includes(this.stopGeneration)||this.activeResponse!=null||this.status===`submitted`||this.status===`streaming`}isWaitingForUser(){let e=this.lastMessage;return e?.role===`assistant`&&e.parts.some(e=>XI(e)&&(e.state===`approval-requested`||e.state===`approval-responded`||!e.providerExecuted&&(e.state===`input-streaming`||e.state===`input-available`)))}hasUnsentApprovalResponse(){let e=this.lastMessage;return e?.role===`assistant`&&e.parts.some(e=>XI(e)&&e.state===`approval-responded`)&&!e.parts.some(e=>XI(e)&&(e.state===`approval-requested`||!e.providerExecuted&&(e.state===`input-streaming`||e.state===`input-available`)))}async settleQueue({stopGeneration:e=this.stopGeneration,skipWaitForUser:t=!1}={}){if(this.isQueuePaused||this.isRequestInProgress()||this.activeStopCount>0||e!==this.stopGeneration)return;let n=this.deferredApprovalSend;if(this.deferredApprovalSend=void 0,n!=null&&this.hasUnsentApprovalResponse()){await this.sendMessage(void 0,n.options);return}let[r,...i]=this.experimental_queuedMessages;if(r==null||!t&&this.isWaitingForUser())return;let a=this.queuedMessageOptions.get(r.id);this.queuedMessageOptions.delete(r.id),this.setQueuedMessages(i),this.state.pushMessage(r),await this.makeRequest({trigger:`submit-message`,...a})}set messages(e){this.state.messages=e}async shouldSendAutomatically(e=this.lastMessage?.id){let t=e=>e!=null&&this.interruptedMessageIds.has(e);if(!this.sendAutomaticallyWhen||t(e)||t(this.lastMessage?.id))return!1;let n=this.stopGeneration;this.pendingAutomaticDecisions.push(n);let r;try{r=await this.sendAutomaticallyWhen({messages:this.state.messages})}finally{this.pendingAutomaticDecisions.splice(this.pendingAutomaticDecisions.indexOf(n),1)}return r&&!t(e)&&!t(this.lastMessage?.id)}async runAutomaticRequest(e,t){let n=this.stopGeneration,r=this.activeStopCount>0;return!(t??await this.shouldSendAutomatically())||r||n!==this.stopGeneration||this.activeStopCount>0?!1:(await e(),!0)}async makeRequestForToolApproval({messageId:e,messageIndex:t,...n}){this.deferredApprovalSend=void 0;let r=e!=null&&e===this.pendingApprovalMessageId;r&&(this.pendingApprovalMessageId=void 0),await this.makeRequest({trigger:`submit-message`,messageId:e,...n}),r&&this.status===`error`&&this.pendingApprovalMessageId==null&&(this.pendingApprovalMessageId=this.state.messages[t]?.id??e)}async makeRequest(e){let t=tL();try{await this.makeRequestImpl({...e,completionPromise:t.promise})}finally{t.resolve()}}async makeRequestImpl({trigger:e,metadata:t,headers:n,body:r,messageId:i,completionPromise:a}){e!==`resume-stream`&&(this.resumableStreamState=void 0);let o=new AbortController,s=e===`resume-stream`?{abortController:o,completionPromise:a}:void 0;s&&(this.activeResumeRequest?.abortController.abort(),this.activeResumeRequest=s);let c=()=>s==null||this.activeResumeRequest===s,l=()=>{this.activeResumeRequest===s&&(this.activeResumeRequest=void 0)},u;if(e===`resume-stream`)try{let e=await this.transport.reconnectToStream({chatId:this.id,abortSignal:o.signal,metadata:t,headers:n,body:r});if(o.signal.aborted||!c()){await e?.cancel().catch(()=>{}),c()&&(this.setStatus({status:`ready`}),this.resumableStreamState=void 0),l();return}if(e==null){this.setStatus({status:`ready`}),this.resumableStreamState=void 0,l();return}u=e}catch(e){if(o.signal.aborted||e.name===`AbortError`){c()&&(this.setStatus({status:`ready`}),this.resumableStreamState=void 0),l();return}if(!c())return;this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:`error`,error:e}),l();return}this.setStatus({status:`submitted`,error:void 0});let d=this.lastMessage,f=e===`submit-message`&&i!=null?this.state.messages.findIndex(e=>e.id===i):this.state.messages.length-1,p=f===-1?d:this.state.messages[f],m=p?.id,h=e===`resume-stream`&&p?.role===`assistant`&&p.parts.some(e=>XI(e)&&(e.state===`input-streaming`||e.state===`input-available`&&e.providerExecuted||e.state===`approval-responded`))?this.state.snapshot(p):void 0,g=f!==-1&&f<this.state.messages.length-1&&p?.role===`assistant`,_=!1,v=!1,y=!1,b;try{let s={state:e===`resume-stream`&&this.resumableStreamState!=null?this.resumableStreamState:QI({lastMessage:e===`resume-stream`?h:e===`regenerate-message`?void 0:this.state.snapshot(p),messageId:this.generateId()}),abortController:o,completionPromise:a};b=s,s.abortController.signal.addEventListener(`abort`,()=>{_=!0}),this.activeResponse=s;let l;if(l=e===`resume-stream`?u:await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:s.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i}),await eL({stream:$I({stream:l,resetStateOnMessageIdChange:e===`resume-stream`,resetStateOnFirstMessageStart:e===`resume-stream`&&this.transport.resumeStreamIsReplay,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:e=>this.jobExecutor.run(()=>s.abortController.signal.aborted?Promise.resolve():e({state:s.state,write:({updateStatus:e=!0}={})=>{if(s.abortController.signal.aborted)return;e&&this.setStatus({status:`streaming`});let t=this.state.messages.findLastIndex(e=>e.id===s.state.message.id);if(t!==-1)this.state.replaceMessage(t,s.state.message);else if(g){let e=this.state.messages.findLastIndex(e=>e.id===m);e===-1?this.state.pushMessage(s.state.message):this.state.replaceMessage(e,s.state.message)}else this.state.pushMessage(s.state.message)}})),onError:e=>{throw e}}),abortSignal:s.abortController.signal,onError:e=>{throw e}}),_)return c()&&(this.setStatus({status:`ready`}),this.resumableStreamState===s.state&&(this.resumableStreamState=void 0)),null;c()&&(this.setStatus({status:`ready`}),this.resumableStreamState===s.state&&(this.resumableStreamState=void 0))}catch(e){if(_||e.name===`AbortError`)return _=!0,c()&&(this.setStatus({status:`ready`}),this.resumableStreamState===b?.state&&(this.resumableStreamState=void 0)),null;if(!c())return null;if(y=!0,e instanceof TypeError){let t=e.message.toLowerCase();v=t.includes(`fetch`)||t.includes(`network`)||t===`load failed`}v?this.resumableStreamState=b?.state:this.resumableStreamState===b?.state&&(this.resumableStreamState=void 0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:`error`,error:e})}finally{try{if(b){let{message:e,finishReason:t}=b.state;t===`interrupted`?this.interruptedMessageIds.add(e.id):!_&&!y&&this.interruptedMessageIds.delete(e.id),this.onFinish?.({message:b.state.message,messages:this.state.messages,isAbort:_,isDisconnect:v,isError:y,finishReason:b.state.finishReason})}}finally{(_||y||b?.state.finishReason===`interrupted`)&&(this.isQueuePaused=!0),this.activeResponse===b&&(this.activeResponse=void 0),l()}}if(!_&&!y&&b?.state.finishReason!==`interrupted`){let e=this.stopGeneration;await this.runAutomaticRequest(()=>this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,metadata:t,headers:n,body:r}))||await this.settleQueue({stopGeneration:e})}}},BL=c(o(((e,t)=>{function n(e,t){if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);let a=Date.now(),o=t-(a-r);o<=0?(r=a,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},o)}}t.exports=n}))(),1);function VL(e,t){return t==null?e:(0,BL.default)(e,t)}function HL(e){return Array.isArray(e)?[...e]:typeof e==`object`&&e&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)?{...e}:e}var UL=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e=[]){this.#t=`ready`,this.#n=void 0,this.#r=[],this.#i=new Set,this.#a=new Set,this.#o=new Set,this.#s=new Set,this.pushMessage=e=>{this.#e=this.#e.concat(e),this.#c()},this.popMessage=()=>{this.#e=this.#e.slice(0,-1),this.#c()},this.replaceMessage=(e,t)=>{this.#e=[...this.#e.slice(0,e),this.snapshot(t),...this.#e.slice(e+1)],this.#c()},this.snapshot=e=>{if(typeof e!=`object`||!e||!(`parts`in e)||!Array.isArray(e.parts))return e;let t=e,n={...t,parts:t.parts.map(e=>({...e}))};return`metadata`in t&&(n.metadata=HL(t.metadata)),n},this[`~registerMessagesCallback`]=(e,t)=>{let n=t?VL(e,t):e;return this.#i.add(n),()=>{this.#i.delete(n)}},this[`~registerStatusCallback`]=e=>(this.#o.add(e),()=>{this.#o.delete(e)}),this[`~registerErrorCallback`]=e=>(this.#s.add(e),()=>{this.#s.delete(e)}),this[`~registerQueuedMessagesCallback`]=e=>(this.#a.add(e),()=>{this.#a.delete(e)}),this.#c=()=>{this.#i.forEach(e=>e())},this.#l=()=>{this.#o.forEach(e=>e())},this.#u=()=>{this.#s.forEach(e=>e())},this.#e=e}get status(){return this.#t}set status(e){this.#t=e,this.#l()}get error(){return this.#n}set error(e){this.#n=e,this.#u()}get experimental_queuedMessages(){return this.#r}set experimental_queuedMessages(e){this.#r=e,this.#a.forEach(e=>e())}get messages(){return this.#e}set messages(e){this.#e=[...e],this.#c()}#c;#l;#u},WL=class extends zL{#e;constructor({messages:e,...t}){let n=new UL(e);super({...t,state:n}),this[`~registerMessagesCallback`]=(e,t)=>this.#e[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>this.#e[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>this.#e[`~registerErrorCallback`](e),this[`~registerQueuedMessagesCallback`]=e=>this.#e[`~registerQueuedMessagesCallback`](e),this.#e=n}},GL=new WeakMap;function KL({chat:e,state:t}){if(document.visibilityState!==`visible`||t.pendingVisibilityResume!=null)return;let n=()=>GL.get(e)===t&&t.registrations.size>0,r=()=>{t.pendingVisibilityResume=void 0};t.pendingVisibilityResume=e[`~resumeStreamIfDisconnected`]({shouldResume:()=>n()&&document.visibilityState===`visible`}).then(r,r)}function qL({chat:e,registration:t}){let n=GL.get(e);if(n==null){let t={registrations:new Set};if(GL.set(e,t),n=t,typeof document<`u`){let n=()=>KL({chat:e,state:t});document.addEventListener(`visibilitychange`,n),t.cleanupVisibilityListener=()=>{document.removeEventListener(`visibilitychange`,n)}}}let{registrations:r}=n,i=r.size===0;return r.add(t),i&&e.status!==`submitted`&&e.status!==`streaming`&&e.resumeStream(),()=>{r.delete(t),r.size===0&&(n.cleanupVisibilityListener?.(),GL.delete(e))}}function JL(e){return{chat:e,messages:e.messages,status:e.status,error:e.error,experimental_queuedMessages:e.experimental_queuedMessages}}function YL(e,t){return e.chat===t.chat&&e.messages===t.messages&&e.status===t.status&&e.error===t.error&&e.experimental_queuedMessages===t.experimental_queuedMessages}function XL({throttle:e,experimental_throttle:t,resume:n=!1,...r}={}){let i=e??t,a=(0,v.useRef)({}),o=(0,v.useRef)({});`chat`in r||(o.current={onToolCall:r.onToolCall,onData:r.onData,onFinish:r.onFinish,onError:r.onError,sendAutomaticallyWhen:r.sendAutomaticallyWhen,transport:r.transport});let s,c=()=>o.current.transport??(s??=new RL),l={...r,transport:{get resumeStreamIsReplay(){return c().resumeStreamIsReplay},sendMessages:e=>c().sendMessages(e),reconnectToStream:e=>c().reconnectToStream(e)},onToolCall:e=>o.current.onToolCall?.(e),onData:e=>o.current.onData?.(e),onFinish:e=>o.current.onFinish?.(e),onError:e=>o.current.onError?.(e),sendAutomaticallyWhen:e=>o.current.sendAutomaticallyWhen?.(e)??!1},u=`chat`in r?r.chat:r.id,{chat:d,isExternallyManaged:f}=(0,v.useMemo)(()=>({chat:`chat`in r?r.chat:new WL(l),isExternallyManaged:`chat`in r}),[u]);(0,v.useEffect)(()=>{if(!f)return()=>{d.stop()}},[d,f]);let[p,m]=(0,v.useState)(()=>JL(d));p.chat!==d&&m(JL(d)),(0,v.useEffect)(()=>{let e=!0,t=()=>{if(!e)return;let t=JL(d);m(e=>e.chat!==d||YL(e,t)?e:t)},n=[d[`~registerMessagesCallback`](t,i),d[`~registerStatusCallback`](t),d[`~registerErrorCallback`](t),d[`~registerQueuedMessagesCallback`](t)],r=JL(d);return m(e=>YL(e,r)?e:r),()=>{e=!1,n.forEach(e=>e())}},[d,i]);let{messages:h,status:g,error:_,experimental_queuedMessages:y}=p,b=(0,v.useCallback)(e=>{typeof e==`function`&&(e=e(d.messages)),d.messages=e},[d]);return(0,v.useEffect)(()=>{if(n)return qL({chat:d,registration:a.current})},[n,d]),{get id(){return d.id},messages:h,setMessages:b,sendMessage:d.sendMessage,regenerate:d.regenerate,clearError:d.clearError,stop:d.stop,error:_,resumeStream:d.resumeStream,status:g,addToolResult:d.addToolOutput,addToolOutput:d.addToolOutput,addToolApprovalResponse:d.addToolApprovalResponse,experimental_queuedMessages:y,experimental_removeQueuedMessage:d.experimental_removeQueuedMessage,experimental_sendQueuedMessageNow:d.experimental_sendQueuedMessageNow}}var ZL=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)|(\[[^\]\n]+\]\(https?:\/\/[^\s)]+\))/g;function QL(e){let t=[],n=0,r=0;for(let i of e.matchAll(ZL)){let a=i.index??0;a>n&&t.push(e.slice(n,a));let o=i[0];if(o.startsWith("`"))t.push((0,V.jsx)(`code`,{children:o.slice(1,-1)},r++));else if(o.startsWith(`**`))t.push((0,V.jsx)(`strong`,{children:o.slice(2,-2)},r++));else if(o.startsWith(`*`))t.push((0,V.jsx)(`em`,{children:o.slice(1,-1)},r++));else{let[,e=``,n=``]=/^\[([^\]]+)\]\((.+)\)$/.exec(o)??[];t.push((0,V.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,children:e},r++))}n=a+o.length}return n<e.length&&t.push(e.slice(n)),t}function $L({text:e}){let t=[],n=e.split(`
131
+ `),r=0,i=0;for(;r<n.length;){let e=n[r]??``;if(e.startsWith("```")){let e=[];for(r++;r<n.length&&!(n[r]??``).startsWith("```");)e.push(n[r++]??``);r++,t.push((0,V.jsx)(`pre`,{className:`code`,children:e.join(`
132
+ `)},i++));continue}let a=/^\s*([-*]|\d+[.)])\s+/;if(a.test(e)){let o=/^\s*\d/.test(e),s=[];for(;r<n.length&&a.test(n[r]??``);)s.push((n[r++]??``).replace(a,``));let c=o?`ol`:`ul`;t.push((0,V.jsx)(c,{children:s.map((e,t)=>(0,V.jsx)(`li`,{children:QL(e)},t))},i++));continue}let o=/^(#{1,4})\s+(.*)$/.exec(e);if(o){t.push((0,V.jsx)(`p`,{className:`md-heading`,children:QL(o[2]??``)},i++)),r++;continue}if(!e.trim()){r++;continue}let s=[];for(;r<n.length&&(n[r]??``).trim()&&!a.test(n[r]??``)&&!(n[r]??``).startsWith("```");)s.push(n[r++]??``);t.push((0,V.jsx)(`p`,{children:QL(s.join(`
133
+ `))},i++))}return(0,V.jsx)(`div`,{className:`md`,children:t})}function eR({id:e,body:t,title:n,lede:r,starters:i,gate:a,onState:o,note:s,placeholder:c}){let{tools:l}=Ae(),[u,d]=(0,v.useState)(``),f=(0,v.useRef)(null),{messages:p,sendMessage:m,status:h,stop:g,error:_,setMessages:y,clearError:b}=XL({id:e,transport:(0,v.useMemo)(()=>new RL({api:Ce.chatUrl}),[])}),x=(0,v.useRef)(t);x.current=t;let S=(0,v.useMemo)(()=>new Map(l.map(e=>[e.id,e])),[l]);(0,v.useEffect)(()=>{f.current?.scrollIntoView({block:`end`})},[p,h]);let w=(0,v.useCallback)(()=>{y([]),b()},[y,b]);(0,v.useEffect)(()=>{o?.({clear:w,count:p.length})},[o,w,p.length]);let T=(0,v.useCallback)(e=>{e.trim()&&x.current&&(b(),m({text:e},{body:x.current}))},[b,m]),E=h===`submitted`||h===`streaming`,D=t!==null;return(0,V.jsxs)(`div`,{className:`chat`,children:[(0,V.jsx)(`div`,{className:`chat-scroll`,children:(0,V.jsxs)(`div`,{className:`chat-thread`,children:[p.length===0?!D&&a?a:(0,V.jsxs)(`div`,{className:`chat-empty`,children:[(0,V.jsx)(`h2`,{children:n}),(0,V.jsx)(`p`,{children:r}),D&&i.length?(0,V.jsx)(`div`,{className:`suggestions`,children:i.map(e=>(0,V.jsx)(`button`,{type:`button`,className:`chip`,onClick:()=>T(e),children:e},e))}):null]}):null,p.map(e=>(0,V.jsx)(`div`,{className:`msg msg-${e.role}`,children:e.parts.map((t,n)=>{if(t.type===`text`)return t.text?(0,V.jsx)(`div`,{className:`bubble`,children:e.role===`assistant`?(0,V.jsx)($L,{text:t.text}):t.text},n):null;if(t.type===`dynamic-tool`){let e=t;if(e.toolName===`studio_try_tool`){let t=e.input??{},n={...e,toolName:t.name??`tool`,input:t.arguments??{}};return(0,V.jsx)(nR,{call:n,tool:S.get(n.toolName),onMessage:T},e.toolCallId)}return e.toolName.startsWith(`studio_`)?(0,V.jsx)(tR,{call:e},e.toolCallId):(0,V.jsx)(nR,{call:e,tool:S.get(e.toolName),onMessage:T},e.toolCallId)}return null})},e.id)),h===`submitted`?(0,V.jsx)(`div`,{className:`msg msg-assistant`,children:(0,V.jsx)(`div`,{className:`thinking`,children:`Thinking`})}):null,_?(0,V.jsx)(`p`,{className:`small fault`,children:_.message}):null,(0,V.jsx)(`div`,{ref:f})]})}),(0,V.jsxs)(`div`,{className:`composer-wrap`,children:[(0,V.jsxs)(`form`,{className:`composer`,onSubmit:e=>{e.preventDefault(),E||(T(u),d(``))},children:[(0,V.jsx)(`textarea`,{rows:1,value:u,placeholder:D?c??`Ask something that needs your tools`:`Add a model key to start`,disabled:!D,"aria-label":`Message`,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}}),E?(0,V.jsx)(`button`,{type:`button`,className:`send`,onClick:()=>void g(),"aria-label":`Stop`,children:(0,V.jsx)(ie,{size:17,stroke:2})}):(0,V.jsx)(`button`,{type:`submit`,className:`send`,disabled:!D||!u.trim(),"aria-label":`Send`,children:(0,V.jsx)(C,{size:17,stroke:2.25})})]}),s?(0,V.jsx)(`p`,{className:`composer-note`,children:s}):null]})]})}function tR({call:e}){let{refresh:t}=Ae(),[n,r]=(0,v.useState)(!1),i=e.state===`output-available`,a=e.state===`output-error`,o=e.input??{},s=e.toolName===`studio_add_tool`,c=e.toolName===`studio_read_file`,l=s?o.name:o.path,u=s?i?`Added tool`:`Writing tool`:c?i?`Read`:`Reading`:i?`Saved`:`Writing`,d=s?[o.tool,o.view].filter(Boolean).join(`
134
+
135
+ // view
136
+
137
+ `):c?``:o.content??``,f=s?`#/tools/${o.name}`:o.path?.startsWith(`views/`)?`#/tools/${o.path.slice(6).replace(/\.\w+$/,``)}`:`#/tools`;return(0,v.useEffect)(()=>{i&&!c&&t()},[i,c,t]),(0,V.jsxs)(`div`,{className:`toolcall`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`toolcall-head`,onClick:()=>r(e=>!e),"aria-expanded":n,children:[(0,V.jsx)(k,{size:14,stroke:1.75}),(0,V.jsx)(`span`,{children:u}),l?(0,V.jsx)(`span`,{className:`mono`,children:l}):null,(0,V.jsx)(`span`,{className:`pill ${a?`pill-fault`:i?`pill-ok`:`pill-wait`}`,children:a?`Did not load`:i?`Done`:`Working`}),(0,V.jsx)(D,{size:14,stroke:2,className:`chevron`})]}),n?(0,V.jsxs)(`div`,{className:`toolcall-body`,children:[e.errorText?(0,V.jsx)(`pre`,{className:`code`,children:e.errorText}):null,d?(0,V.jsx)(`pre`,{className:`code`,children:d}):null,i&&!c?(0,V.jsx)(`a`,{className:`link small`,href:f,children:`Open it in Tools`}):null]}):null]})}function nR({call:e,tool:t,onMessage:n}){let[r,i]=(0,v.useState)(!1),a=e.state===`output-available`,o=e.state===`output-error`||a&&e.output?.isError===!0,s=a?e.output:void 0,c=e.input??{};return(0,V.jsxs)(`div`,{className:`toolcall`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`toolcall-head`,onClick:()=>i(e=>!e),"aria-expanded":r,children:[(0,V.jsx)(pe,{size:14,stroke:1.75}),(0,V.jsx)(`span`,{className:`mono`,children:t?.name??e.toolName}),t&&!t.local?(0,V.jsx)(`span`,{className:`muted small`,children:t.server}):null,(0,V.jsx)(`span`,{className:`pill ${o?`pill-fault`:a?`pill-ok`:`pill-wait`}`,children:o?`Failed`:a?`Done`:`Running`}),(0,V.jsx)(D,{size:14,stroke:2,className:`chevron`})]}),r?(0,V.jsxs)(`div`,{className:`toolcall-body`,children:[(0,V.jsx)(`div`,{className:`muted small`,children:`Input`}),(0,V.jsx)(`pre`,{className:`code`,children:JSON.stringify(c,null,2)}),a||e.errorText?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`muted small`,children:`Result`}),(0,V.jsx)(`pre`,{className:`code`,children:e.errorText??JSON.stringify(s?.structuredContent??s?.content,null,2)})]}):null]}):null,t?.view&&e.state!==`input-streaming`&&!o?(0,V.jsx)(`div`,{className:`toolcall-view`,children:(0,V.jsx)(uN,{server:t.local?`local`:t.server,uri:t.view,input:c,result:s,onMessage:n})}):null]})}var rR={openai:`https://platform.openai.com/api-keys`,anthropic:`https://console.anthropic.com/settings/keys`,google:`https://aistudio.google.com/apikey`,openrouter:`https://openrouter.ai/keys`},iR=new Map;function aR(e,t){let[n,r]=(0,v.useState)(e?iR.get(e)??[]:[]),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(a(null),!e||!t)return r([]);let n=iR.get(e);if(n)return r(n);let i=!0;return s(!0),Ce.models(e).then(t=>{iR.set(e,t.models),i&&r(t.models)}).catch(e=>i&&a(Me(e))).finally(()=>i&&s(!1)),()=>{i=!1}},[e,t]),{models:n,error:i,loading:o}}var oR=e=>iR.delete(e);function sR({provider:e,model:t,onChange:n,compact:r=!1}){let{settings:i}=Ae(),a=i?.providers.find(t=>t.id===e),o=!(!a||a.needsKey&&!a.hasKey),{models:s,loading:c,error:l}=aR(e,o);(0,v.useEffect)(()=>{o&&!t&&s[0]&&n(e,s[0])},[o,t,s,e,n]);let u=r?{minHeight:30,width:`auto`,fontSize:13}:void 0;return(0,V.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,V.jsxs)(`select`,{className:`input`,style:r?{...u,maxWidth:150}:{flex:`0 0 180px`},"aria-label":`Provider`,value:e,onChange:e=>n(e.target.value,i?.models[e.target.value]??``),children:[a?null:(0,V.jsx)(`option`,{value:``,children:`Choose a provider`}),i?.providers.map(e=>(0,V.jsxs)(`option`,{value:e.id,disabled:e.needsKey&&!e.hasKey,children:[e.label,e.needsKey&&!e.hasKey?` (no key)`:``]},e.id))]}),s.length?(0,V.jsxs)(`select`,{className:`input mono`,style:r?{...u,maxWidth:220}:{flex:1,minWidth:160},"aria-label":`Model`,value:t,onChange:t=>n(e,t.target.value),children:[t&&!s.includes(t)?(0,V.jsx)(`option`,{value:t,children:t}):null,s.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]}):(0,V.jsx)(`input`,{className:`input mono`,style:r?{...u,width:200}:{flex:1,minWidth:160},"aria-label":`Model`,value:t,placeholder:c?`Loading models`:`Model name`,onChange:t=>n(e,t.target.value)}),l&&!r?(0,V.jsx)(`p`,{className:`hint fault`,style:{flexBasis:`100%`},children:l}):null]})}function cR({onDone:e}){let{settings:t,setSettings:n}=Ae(),[r,i]=(0,v.useState)(`openai`),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null);if(!t)return null;let p=t.providers.find(e=>e.id===r),m=!!p?.hasKey,h=!!p?.needsKey;async function g(){u(!0),f(null);try{let t=await Ce.saveSettings({provider:r,key:a.trim()||void 0,customBaseUrl:r===`custom`?s:void 0});if(oR(r),!t.models[r]){let{models:e}=await Ce.models(r);e[0]&&(t=await Ce.saveSettings({provider:r,model:e[0]}))}n(t),o(``),e?.()}catch(e){f(Me(e))}finally{u(!1)}}return(0,V.jsxs)(`form`,{className:`form`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,V.jsx)(`div`,{className:`provider-grid`,children:t.providers.map(e=>(0,V.jsxs)(`button`,{type:`button`,className:`provider${r===e.id?` is-active`:``}`,onClick:()=>i(e.id),children:[e.label,(0,V.jsx)(`small`,{children:e.hasKey?`Key found`:e.needsKey?`Needs a key`:`No key needed`})]},e.id))}),r===`custom`?(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsx)(`label`,{htmlFor:`setup-base`,children:`Base address`}),(0,V.jsx)(`input`,{id:`setup-base`,className:`mono`,value:s,onChange:e=>c(e.target.value),placeholder:`https://api.example.com/v1`})]}):null,m?(0,V.jsxs)(`p`,{className:`hint`,children:[(0,V.jsx)(P,{size:13,stroke:1.75,style:{verticalAlign:-2}}),` Using the key from`,` `,p?.source===`saved`?`this machine`:`your ${p?.source}`,`.`]}):h||r===`custom`?(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsxs)(`label`,{htmlFor:`setup-key`,children:[`API key`,rR[r]?(0,V.jsx)(`a`,{className:`link optional`,href:rR[r],target:`_blank`,rel:`noopener`,children:`Get one`}):null]}),(0,V.jsx)(`input`,{id:`setup-key`,type:`password`,className:`mono`,value:a,onChange:e=>o(e.target.value),placeholder:`Paste your key`,autoComplete:`off`}),(0,V.jsxs)(`p`,{className:`hint`,children:[(0,V.jsx)(te,{size:12,stroke:1.75,style:{verticalAlign:-1}}),` Saved on this machine in ~/.plugmcp/keys.json. It goes only to `,p?.label,`, never to PlugMCP.`]})]}):(0,V.jsx)(`p`,{className:`hint`,children:`Ollama runs on this machine. Start it and pull a model first.`}),d?(0,V.jsx)(`p`,{className:`hint fault`,children:d}):null,(0,V.jsx)(`button`,{className:`btn btn-primary btn-lg`,type:`submit`,disabled:l||h&&!m&&!a.trim(),children:l?`Checking`:`Start chatting`})]})}var lR=e=>`plugmcp.instructions.${e}`,uR=e=>{try{return localStorage.getItem(lR(e))??``}catch{return``}};function dR(){let{server:e,settings:t,setSettings:n,tools:r,remote:i,model:a}=Ae(),o=Ee(),[s,c]=(0,v.useState)(new Set),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(()=>uR(o.current)),h=(0,v.useCallback)((e,t)=>{Ce.saveSettings({provider:e,model:t}).then(n)},[n]),g=e=>{m(e);try{localStorage.setItem(lR(o.current),e)}catch{}},_=(0,v.useMemo)(()=>a?{provider:a.provider,model:a.model,build:!0,instructions:p.trim()||void 0,tools:s.size?r.filter(e=>!s.has(e.id)).map(e=>e.id):void 0}:null,[a,s,r,p]);if(!e)return null;let y=r.filter(e=>!s.has(e.id)),x=[{name:e.name,local:!0,tools:e.tools},...i.map(e=>({name:e.name,local:!1,tools:e.tools}))],S=[`Build an MCP app that draws a flowchart from a list of steps`,`Build a tool that converts currencies with live rates, with a card`,...e.tools.slice(0,1).map(e=>`Use ${e.name} and show me the result`)];return(0,V.jsxs)(`div`,{className:`play${l?` show-rail`:``}`,style:{position:`relative`},children:[(0,V.jsxs)(`div`,{className:`chat`,children:[(0,V.jsxs)(`div`,{className:`chat-bar`,children:[(0,V.jsx)(`span`,{className:`pill`,children:`Test agent`}),t&&a?(0,V.jsx)(sR,{compact:!0,provider:a.provider,model:a.model,onChange:h}):null,(0,V.jsx)(`span`,{className:`grow`}),d?.count?(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:d.clear,children:[(0,V.jsx)(me,{size:14,stroke:1.75}),` New chat`]}):null,(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-outline btn-sm`,onClick:()=>u(e=>!e),"aria-expanded":l,children:[(0,V.jsx)(b,{size:14,stroke:1.75}),` `,Ge(y.length,`tool`)]})]}),(0,V.jsx)(eR,{id:`play`,body:_,placeholder:`Ask for a new tool or app, or use the ones you have`,title:`Chat with ${e.title??e.name}`,lede:`Ask for a tool or an MCP app and it is written into this server and run right here. The chat can also call the tools you already have, and their views show up the way they will in Claude or ChatGPT.`,starters:S,onState:f,note:`Runs on this machine with your own key.`,gate:(0,V.jsxs)(`div`,{className:`panel keygate`,children:[(0,V.jsx)(`h2`,{style:{fontSize:18},children:`Add your model key to start`}),(0,V.jsx)(`p`,{className:`muted`,style:{margin:`4px 0 18px`},children:`The chat runs on your own model. Pick a provider and paste your key. It stays on this machine, you pay the provider directly and nothing passes through PlugMCP.`}),(0,V.jsx)(cR,{})]})})]}),(0,V.jsxs)(`aside`,{className:`rail`,"aria-label":`Chat setup`,children:[(0,V.jsxs)(`div`,{className:`rail-section`,children:[(0,V.jsxs)(`div`,{className:`rail-title`,children:[`Instructions`,(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm btn-icon`,style:{display:l?void 0:`none`},onClick:()=>u(!1),"aria-label":`Close`,children:(0,V.jsx)(he,{size:14})})]}),(0,V.jsx)(`textarea`,{className:`input`,rows:4,value:p,onChange:e=>g(e.target.value),placeholder:`How the test agent should behave. For example: you are a support agent, keep answers short.`,"aria-label":`Instructions for the test agent`}),(0,V.jsx)(`p`,{className:`hint`,children:p.trim()?`Used from your next message.`:`Empty means the server's own instructions.`})]}),(0,V.jsxs)(`div`,{className:`rail-section`,children:[(0,V.jsx)(`div`,{className:`rail-title`,children:`Tools in this chat`}),(0,V.jsx)(`p`,{className:`hint`,children:`Untick a tool to hide it from the model.`})]}),x.map(e=>(0,V.jsxs)(`div`,{className:`rail-section`,children:[(0,V.jsxs)(`div`,{className:`rail-title`,children:[(0,V.jsx)(`span`,{className:`truncate`,children:e.name}),(0,V.jsx)(`span`,{className:`pill`,children:e.local?`This server`:`Added`})]}),e.tools.length===0?(0,V.jsx)(`p`,{className:`hint`,children:`No tools yet. Ask the chat to build one.`}):null,(0,V.jsx)(`div`,{children:e.tools.map(e=>(0,V.jsxs)(`label`,{className:`toggle-row`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:!s.has(e.id),onChange:()=>c(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})}),(0,V.jsxs)(`span`,{className:`grow`,children:[(0,V.jsx)(`span`,{className:`mono`,style:{display:`block`,fontSize:12.5},children:e.name}),(0,V.jsx)(`span`,{className:`hint clamp-2`,children:e.description})]})]},e.id))})]},e.name)),(0,V.jsxs)(`div`,{className:`rail-section`,children:[(0,V.jsx)(`div`,{className:`rail-title`,children:`More tools`}),(0,V.jsx)(`p`,{className:`hint`,children:`Add a hosted server from the PlugMCP directory to try it next to your own.`}),(0,V.jsxs)(`a`,{className:`btn btn-outline btn-sm`,href:`#/directory`,children:[(0,V.jsx)(z,{size:14,stroke:2}),` Browse the directory`]}),(0,V.jsxs)(`a`,{className:`link small`,href:`https://plugmcp.ai/mcp`,target:`_blank`,rel:`noopener`,children:[`plugmcp.ai/mcp `,(0,V.jsx)(M,{size:12,stroke:1.75,style:{verticalAlign:-1}})]})]})]})]})}function fR(){let{settings:e,setSettings:t,model:n}=Ae(),r=(0,v.useCallback)((e,n)=>{Ce.saveSettings({provider:e,model:n}).then(t)},[t]);if(!e)return null;let i=e.provider??e.providers.find(e=>e.hasKey)?.id??``;return(0,V.jsxs)(`div`,{className:`page page-narrow`,children:[(0,V.jsx)(Fe,{title:`Models and keys`,lede:`The chat runs on your own model keys. Pick the model to use, and add a key for each provider you want.`}),(0,V.jsxs)(`section`,{className:`panel panel-pad stack`,children:[(0,V.jsx)(`h2`,{children:`Model for the chat`}),e.providers.some(e=>!e.needsKey||e.hasKey)?(0,V.jsx)(sR,{provider:i,model:e.models[i]??``,onChange:r}):null,(0,V.jsx)(`p`,{className:`hint`,children:n?`Using ${n.label} ${n.model}.`:`Add a key below, then choose a model here.`})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h2`,{className:`section-title`,style:{marginBottom:10},children:`Providers`}),(0,V.jsx)(`ul`,{className:`panel rows`,children:e.providers.map(e=>(0,V.jsx)(pR,{provider:e},e.id))}),(0,V.jsxs)(`p`,{className:`hint`,style:{marginTop:10},children:[(0,V.jsx)(te,{size:12,stroke:1.75,style:{verticalAlign:-1}}),` Keys are saved on this machine in ~/.plugmcp/keys.json, or read from your project's .env. They are sent only to the provider, never to the browser or to PlugMCP.`]})]})]})}function pR({provider:e}){let{settings:t,setSettings:n}=Ae(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(t?.customBaseUrl??``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),d=e.id===`custom`;async function f(r){c(!0),u(null);try{let a=await Ce.saveSettings({provider:e.id,...r});oR(e.id),n(t?.provider&&t.provider!==e.id?await Ce.saveSettings({provider:t.provider}):a),i(``)}catch(e){u(Me(e))}finally{c(!1)}}return(0,V.jsxs)(`li`,{style:{padding:`14px 16px`},className:`stack`,children:[(0,V.jsxs)(`div`,{className:`row`,children:[(0,V.jsxs)(`div`,{className:`grow`,children:[(0,V.jsx)(`div`,{className:`row-title`,children:e.label}),(0,V.jsx)(`div`,{className:`row-sub`,children:e.hasKey?`Key from ${e.source===`saved`?`this machine`:e.source}`:e.needsKey?`No key yet`:d?`Any endpoint that speaks the OpenAI API`:`Runs on this machine, no key needed`})]}),e.hasKey?(0,V.jsxs)(`span`,{className:`pill pill-ok`,children:[(0,V.jsx)(E,{size:12,stroke:2.5}),` Ready`]}):null,e.source===`saved`?(0,V.jsx)(`button`,{type:`button`,className:`btn btn-danger btn-sm`,disabled:s,onClick:()=>void f({key:null}),children:`Remove key`}):null]}),d?(0,V.jsx)(`input`,{className:`input mono`,value:a,onChange:e=>o(e.target.value),placeholder:`https://api.example.com/v1`,"aria-label":`Base address`}):null,(e.needsKey||d)&&e.source!==`project .env`&&e.source!==`environment`?(0,V.jsxs)(`form`,{className:`row`,onSubmit:e=>{e.preventDefault(),f({key:r.trim()||void 0,customBaseUrl:d?a:void 0})},children:[(0,V.jsx)(`input`,{className:`input mono grow`,type:`password`,value:r,onChange:e=>i(e.target.value),placeholder:e.hasKey?`Paste a new key to replace it`:d?`API key, if the endpoint needs one`:`Paste your key`,autoComplete:`off`,"aria-label":`${e.label} API key`}),(0,V.jsx)(`button`,{type:`submit`,className:`btn btn-secondary`,disabled:s||!r.trim()&&!d,children:s?`Saving`:`Save`})]}):null,l?(0,V.jsx)(`p`,{className:`small fault`,children:l}):null]})}function mR(){return(0,V.jsx)(Oe,{children:(0,V.jsx)(hR,{})})}function hR(){let{info:e,server:t,offline:n,tools:r,model:i}=Ae(),a=Ue(),o=a[0]??`home`,[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=Re(),b=Ee();(0,v.useEffect)(()=>{c(!1),g(!1)},[a]);let x=[{label:`Build`,items:[{id:`home`,label:`Overview`,icon:N},{id:`tools`,label:`Tools`,icon:pe,badge:r.length},{id:`canvas`,label:`Canvas`,icon:le}]},{label:`Test`,items:[{id:`playground`,label:`Chat`,icon:L},{id:`tests`,label:`Tests`,icon:fe},{id:`logs`,label:`Logs`,icon:ee,badge:t?.calls||void 0}]},{label:`Share`,items:[{id:`connect`,label:`Connect`,icon:ae},{id:`directory`,label:`Directory`,icon:B}]}],S={settings:`Models and keys`};for(let e of x)for(let t of e.items)S[t.id]=t.label;let C=e&&!e.ok?e:null,T=n?`offline`:C?`error`:t?`ok`:`loading`,D=t?t.mcpUrl.replace(`127.0.0.1`,`localhost`):``,k=[`tools`,`playground`,`canvas`].includes(o),j=o===`tools`||o===`canvas`?a[1]:void 0;return(0,V.jsxs)(`div`,{className:`shell${s?` menu-open`:``}`,onClick:e=>s&&e.target===e.currentTarget&&c(!1),children:[(0,V.jsxs)(`aside`,{className:`side`,children:[(0,V.jsxs)(`a`,{className:`brand`,href:`#/`,"aria-label":`PlugMCP Studio, overview`,children:[(0,V.jsx)(Ne,{size:26}),(0,V.jsx)(`span`,{className:`brand-name`,children:`PlugMCP`}),(0,V.jsx)(`span`,{className:`brand-tag`,children:`Studio`})]}),(0,V.jsxs)(`div`,{className:`server-card`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`server-card-top switch-btn`,onClick:()=>g(e=>!e),"aria-expanded":h,"aria-label":`Choose an MCP server`,children:[(0,V.jsx)(Pe,{name:t?.name??e?.project??`?`}),(0,V.jsxs)(`div`,{className:`grow`,children:[(0,V.jsx)(`div`,{className:`server-name truncate`,children:t?.title??t?.name??e?.project??`Starting`}),(0,V.jsxs)(`div`,{className:`server-state`,children:[(0,V.jsx)(`span`,{className:`dot dot-${T}`}),n?`Stopped`:C?`Error in the code`:t?`MCP server, running`:`Starting`]})]}),(0,V.jsx)(se,{size:15,stroke:1.75,className:`muted`})]}),h?(0,V.jsxs)(`div`,{className:`switch-menu`,children:[(0,V.jsxs)(`p`,{className:`nav-label`,children:[`MCP servers in `,b.name||`this folder`]}),b.servers.map(e=>(0,V.jsxs)(`button`,{type:`button`,className:`switch-item${e.id===b.current?` is-active`:``}`,onClick:()=>{g(!1),b.switchTo(e.id)},children:[(0,V.jsx)(Pe,{name:e.ok?e.name:e.id}),(0,V.jsxs)(`span`,{className:`grow`,children:[(0,V.jsx)(`span`,{className:`truncate`,style:{display:`block`},children:e.ok?e.title??e.name:e.id}),(0,V.jsx)(`span`,{className:`row-sub`,style:{display:`block`},children:e.ok?`${e.tools.length} tool${e.tools.length===1?``:`s`}`:`Error in the code`})]}),e.id===b.current?(0,V.jsx)(E,{size:14,stroke:2}):null]},e.id)),(0,V.jsxs)(`button`,{type:`button`,className:`switch-item switch-new`,onClick:()=>{g(!1),f(!0)},children:[(0,V.jsx)(`span`,{className:`icon-tile`,style:{width:28,height:28},children:(0,V.jsx)(z,{size:15,stroke:2})}),`New MCP server`]})]}):null,D?(0,V.jsxs)(`button`,{type:`button`,className:`addr`,title:`Copy the MCP address`,onClick:()=>y(D),children:[(0,V.jsx)(`span`,{className:`grow truncate`,children:D.replace(`http://`,``)}),_?(0,V.jsx)(E,{size:13,stroke:2}):(0,V.jsx)(A,{size:13,stroke:1.75})]}):null]}),(0,V.jsx)(`nav`,{className:`nav`,"aria-label":`Studio`,children:x.map(e=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`nav-label`,children:e.label}),e.items.map(({id:e,label:t,icon:n,badge:r})=>(0,V.jsxs)(`a`,{href:e===`home`?`#/`:`#/${e}`,className:`nav-item${o===e?` is-active`:``}`,"aria-current":o===e?`page`:void 0,children:[(0,V.jsx)(n,{size:16,stroke:1.75,"aria-hidden":`true`}),t,r?(0,V.jsx)(`span`,{className:`nav-badge`,children:r}):null]},e))]},e.label))}),(0,V.jsxs)(`div`,{className:`side-foot`,children:[(0,V.jsxs)(`a`,{className:`go-live`,href:`https://plugmcp.ai/app`,target:`_blank`,rel:`noopener`,children:[(0,V.jsx)(`span`,{className:`go-live-title`,children:`Go live on plugmcp.ai`}),(0,V.jsx)(`span`,{className:`go-live-sub`,children:`Hosting, API keys, call logs and a directory page for this server.`})]}),(0,V.jsxs)(`a`,{className:`nav-item`,href:`https://github.com/plugmcp-ai/plugmcp-framework#readme`,target:`_blank`,rel:`noopener`,children:[(0,V.jsx)(w,{size:16,stroke:1.75,"aria-hidden":`true`}),`Docs`]}),(0,V.jsxs)(`a`,{className:`key-card${o===`settings`?` is-active`:``}`,href:`#/settings`,children:[(0,V.jsx)(`span`,{className:`icon-tile`,style:{width:28,height:28},children:(0,V.jsx)(P,{size:15,stroke:1.75})}),(0,V.jsxs)(`span`,{className:`grow`,children:[(0,V.jsx)(`span`,{className:`key-card-title truncate`,style:{display:`block`},children:i?i.label:`Connect a model`}),(0,V.jsx)(`span`,{className:`key-card-sub mono truncate`,style:{display:`block`},children:i?i.model:`Your own key, kept here`})]}),(0,V.jsx)(`span`,{className:`dot ${i?`dot-ok`:``}`})]})]})]}),(0,V.jsxs)(`div`,{className:`main`,children:[(0,V.jsxs)(`header`,{className:`top`,children:[(0,V.jsxs)(`div`,{className:`crumbs`,children:[(0,V.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-icon menu-btn`,onClick:()=>c(!0),"aria-label":`Open menu`,children:(0,V.jsx)(ne,{size:18})}),b.servers.length>1?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`truncate hide-sm`,children:b.name||`Workspace`}),(0,V.jsx)(O,{size:13,className:`hide-sm`})]}):null,(0,V.jsx)(`span`,{className:`truncate hide-sm`,children:t?.title??t?.name??e?.project??`MCP server`}),(0,V.jsx)(O,{size:13,className:`hide-sm`}),j?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`a`,{href:`#/${o}`,children:S[o]}),(0,V.jsx)(O,{size:13}),(0,V.jsx)(`span`,{className:`here truncate`,children:j})]}):(0,V.jsx)(`span`,{className:`here`,children:S[o]??`Overview`})]}),(0,V.jsxs)(`div`,{className:`top-actions`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`btn btn-outline btn-sm`,onClick:()=>u(!0),disabled:!t,children:[(0,V.jsx)(z,{size:14,stroke:2}),` New tool`]}),(0,V.jsx)(`a`,{className:`btn btn-ghost btn-sm hide-sm`,href:`https://plugmcp.ai/mcp`,target:`_blank`,rel:`noopener`,children:`plugmcp.ai`})]})]}),C?(0,V.jsxs)(`div`,{className:`banner`,role:`alert`,children:[(0,V.jsx)(`span`,{className:`dot dot-error`,style:{marginTop:6}}),(0,V.jsxs)(`div`,{className:`grow`,children:[(0,V.jsxs)(`strong`,{style:{fontWeight:500},children:[C.file,` has an error.`]}),` Fix it and save. The Studio shows the last working version until then.`,(0,V.jsx)(`pre`,{children:C.error})]})]}):null,(0,V.jsx)(`main`,{className:`content${k?` is-fixed`:``}`,children:n?(0,V.jsx)(`div`,{className:`page`,children:(0,V.jsx)(Le,{icon:ae,title:`The dev server is not running`,children:`Start it again with plugmcp dev in your project folder. This page reconnects by itself.`})}):t?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{hidden:o!==`playground`,style:{flex:1,minHeight:0,display:o===`playground`?`flex`:void 0},children:(0,V.jsx)(dR,{})}),o===`home`?(0,V.jsx)(PN,{onNew:()=>u(!0),onNewMcp:()=>f(!0),onEditMcp:()=>m(!0)}):null,o===`tests`?(0,V.jsx)($e,{}):null,o===`tools`?(0,V.jsx)(dN,{selected:a[1],onNew:()=>u(!0)}):null,o===`canvas`?(0,V.jsx)(DN,{selected:a[1],onNew:()=>u(!0),onEditMcp:()=>m(!0)}):null,o===`logs`?(0,V.jsx)(LN,{}):null,o===`directory`?(0,V.jsx)(NN,{}):null,o===`connect`?(0,V.jsx)(ON,{}):null,o===`settings`?(0,V.jsx)(fR,{}):null]}):C?(0,V.jsx)(`div`,{className:`page`,children:(0,V.jsxs)(Le,{icon:pe,title:`Waiting for a working server file`,children:[`The Studio opens as soon as `,C.file,` loads without errors.`]})}):null})]}),l?(0,V.jsx)(tt,{onClose:()=>u(!1)}):null,d?(0,V.jsx)(Je,{onClose:()=>f(!1)}):null,p?(0,V.jsx)(qe,{onClose:()=>m(!1)}):null]})}(0,ge.createRoot)(document.getElementById(`root`)).render((0,V.jsx)(v.StrictMode,{children:(0,V.jsx)(mR,{})}));