@adonis-agora/durable-dashboard 1.0.0-rc.0 → 1.0.0-rc.2

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.
@@ -0,0 +1,16 @@
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 I(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 L=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 R(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,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ee(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 R(ee.bind(null,e))}var z={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=z,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=ee,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:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,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=>{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})),f=o(((e,t)=>{t.exports=d()})),p=c(u(),1),m=f(),h=p.createContext(void 0),g=e=>{let t=p.useContext(h);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},_=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,m.jsx)(h.Provider,{value:e,children:t})),v={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},y=new class{#e=v;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function b(e){setTimeout(e,0)}var x=typeof window>`u`||`Deno`in globalThis;function S(){}function C(e,t){return typeof e==`function`?e(t):e}function w(e){return typeof e==`number`&&e>=0&&e!==1/0}function T(e,t){return Math.max(e+(t||0)-Date.now(),0)}function E(e,t){return typeof e==`function`?e(t):e}function D(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==k(o,t.options))return!1}else if(!j(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function O(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(A(t.options.mutationKey)!==A(a))return!1}else if(!j(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function k(e,t){return(t?.queryKeyHashFn||A)(e)}function A(e){return JSON.stringify(e,(e,t)=>I(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function j(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!j(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!j(e[r],t[r]))return!1;return!0}return!1}var M=Object.prototype.hasOwnProperty;function N(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=F(e)&&F(t);if(!r&&!(I(e)&&I(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:M.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=N(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function P(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n of Object.keys(e))if(!M.call(t,n)||e[n]!==t[n])return!1;return!0}function F(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function I(e){if(!L(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!L(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function L(e){return Object.prototype.toString.call(e)===`[object Object]`}function R(e){return new Promise(t=>{y.setTimeout(t,e)})}function ee(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:N(e,t)}function z(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(-n):r}function te(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,n):r}var B=Symbol();function ne(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===B?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function re(e,t){return typeof e==`function`?e(...t):!!e}var V=Symbol();function ie(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[V]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var H=()=>x,ae=()=>H(),U=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},W=new class extends U{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},oe=b;function se(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=oe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var G=se(),ce=new class extends U{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function le(e){return Math.min(1e3*2**e,3e4)}function ue(e){return(e??`online`)!==`online`||ce.isOnline()}var de=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function fe(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(S);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new de(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>W.isFocused()&&(e.networkMode===`always`||ce.isOnline())&&e.canRun(),p=()=>ue(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ae()?0:3),a=e.retryDelay??le,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),R(o).then(()=>c()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var pe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w(this.gcTime)&&(this.#e=y.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ae()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(y.clearTimeout(this.#e),this.#e=void 0)}};function me(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{ie(e,()=>t.signal,()=>n=!0,l[V])},d=ne(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options,c=i?te:z;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ge:he,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:he(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function he(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ge(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function _e(e,t){return t?he(e,t)!=null:!1}function ve(e,t){return!t||!e.getPreviousPageParam?!1:ge(e,t)!=null}var ye=class extends pe{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Se(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Se(this.options);e.data!==void 0&&(this.setState(xe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ee(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(S).catch(S):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>E(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===B||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>E(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!T(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[V]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=ne(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?me(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=fe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof de&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof de){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.scheduleGc()}})();return this.#o=s,o.start(),s}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...be(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...xe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),G.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function be(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ue(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function xe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Se(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ce=class extends U{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Te(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ee(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ee(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof E(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!P(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&De(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||E(this.options.enabled,this.#t)!==E(t.enabled,this.#t)||E(this.options.staleTime,this.#t)!==E(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||E(this.options.enabled,this.#t)!==E(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return P(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(S)),t}#h(e){return!ae()&&E(this.options.enabled,this.#t)!==!1&&w(e)}#g(){this.#b();let e=E(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=T(this.#r.dataUpdatedAt,e)+1;this.#u=y.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return E(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=y.setInterval(()=>{(this.options.refetchIntervalInBackground||W.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(y.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(y.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Te(e,t),o=i&&De(e,n,t,r);(a||o)&&(l={...l,...be(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ee(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ee(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=i?.error===f?i.errorUpdatedAt:Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Oe(e,t),refetch:this.refetch,isEnabled:E(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),P(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();G.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function we(e,t){return E(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||E(t.retryOnMount,e)!==!1)}function Te(e,t){return we(e,t)||e.state.data!==void 0&&Ee(e,t,t.refetchOnMount)}function Ee(e,t,n){if(E(t.enabled,e)!==!1&&E(t.staleTime,e)!==`static`){let r=E(n,e);return r===`always`||r!==!1&&Oe(e,t)}return!1}function De(e,t,n,r){return(e!==t||E(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Oe(e,n)}function Oe(e,t){return E(t.enabled,e)!==!1&&e.isStaleByTime(E(t.staleTime,e))}var ke=class extends Ce{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:_e(t,n.data),hasPreviousPage:ve(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Ae=class extends pe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||je(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=fe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),G.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function je(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Me=class extends U{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Ae({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ne(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ne(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ne(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Ne(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){G.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>O(t,e))}findAll(e={}){return this.getAll().filter(t=>O(e,t))}notify(e){G.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return G.batch(()=>Promise.all(e.map(e=>e.continue().catch(S))))}};function Ne(e){return e.options.scope?.id}var Pe=class extends U{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),P(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&A(t.mutationKey)!==A(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??je();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){G.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Fe(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Ie=class extends U{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,G.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!P(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Fe(e,n).forEach(e=>{e.destroy()}),Fe(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=N(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Ce(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&G.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Le=class extends U{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??k(r,t),a=this.get(i);return a||(a=new ye({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){G.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>D(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>D(e,t)):t}notify(e){G.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){G.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){G.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Re=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Le,this.#t=e.mutationCache||new Me,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=W.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ce.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(E(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=C(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return G.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;G.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return G.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=G.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(S).catch(S)}invalidateQueries(e,t={}){return G.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=G.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(S)),r?Promise.resolve():t}));return Promise.all(r).then(S)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(E(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(E(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(S).catch(S)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(S).catch(S)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ce.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(A(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{j(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(A(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{j(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=k(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===B&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},ze=p.createContext(!1),Be=()=>p.useContext(ze);ze.Provider;function Ve(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var He=p.createContext(Ve()),Ue=()=>p.useContext(He),We=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?re(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ge=e=>{p.useEffect(()=>{e.clearReset()},[e])},Ke=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||re(n,[e.error,r])),qe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Je=(e,t)=>e?.suspense&&t.isPending,Ye=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Xe({queries:e,...t},n){let r=g(n),i=Be(),a=Ue(),o=t.subscribed!==!1,s=p.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{qe(e);let t=r.getQueryCache().get(e.queryHash);We(e,a,t)}),Ge(a);let[c]=p.useState(()=>new Ie(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine);p.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let f=!i&&o;p.useSyncExternalStore(p.useCallback(e=>f?c.subscribe(G.batchCalls(e)):S,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult());let m=l.some((e,t)=>Je(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&Je(n,e)?Ye(n,new Ce(r,n),a):[]}):[];if(m.length>0)throw Promise.all(m);let h=l.find((e,t)=>{let n=s[t];return n&&Ke({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(h)throw h.error;return u(d())}function Ze(e,t,n){let r=Be(),i=Ue(),a=g(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,qe(o),We(o,i,s),Ge(i);let[l]=p.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);p.useEffect(()=>{l.setOptions(o)},[o,l]);let d=!r&&c;if(p.useSyncExternalStore(p.useCallback(e=>{let t=d?l.subscribe(G.batchCalls(e)):S;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Je(o,u))throw Ye(o,l,i);if(Ke({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Qe(e,t){return Ze(e,Ce,t)}function $e(e,t){let n=g(t),[r]=p.useState(()=>new Pe(n,e));p.useEffect(()=>{r.setOptions(e)},[r,e]);let i=p.useSyncExternalStore(p.useCallback(e=>r.subscribe(G.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=p.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(S)},[r]);if(i.error&&re(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function et(e,t){return Ze(e,ke,t)}var tt=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}}}})),nt=o(((e,t)=>{t.exports=tt()})),rt=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`})),it=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=rt()})),at=o((e=>{var t=nt(),n=u(),r=it();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 f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(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)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(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 h(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 g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(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)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(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 y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(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 w(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 T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),A=Symbol.for(`react.strict_mode`),j=Symbol.for(`react.profiler`),M=Symbol.for(`react.consumer`),N=Symbol.for(`react.context`),P=Symbol.for(`react.forward_ref`),F=Symbol.for(`react.suspense`),I=Symbol.for(`react.suspense_list`),L=Symbol.for(`react.memo`),R=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),z=Symbol.for(`react.legacy_hidden`),te=Symbol.for(`react.memo_cache_sentinel`),B=Symbol.for(`react.view_transition`),ne=Symbol.for(`react.recoverable`),re=Symbol.iterator;function V(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ie=Symbol.for(`react.client.reference`);function H(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case j:return`Profiler`;case A:return`StrictMode`;case F:return`Suspense`;case I:return`SuspenseList`;case ee:return`Activity`;case B:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case N:return e.displayName||`Context`;case M:return(e._context.displayName||`Context`)+`.Consumer`;case P:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case L:return t=e.displayName||null,t===null?H(e.type)||`Memo`:t;case R:t=e._payload,e=e._init;try{return H(e(t))}catch{}}return null}var ae=Array.isArray,U=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],G=-1;function ce(e){return{current:e}}function le(e){0>G||(e.current=se[G],se[G]=null,G--)}function ue(e,t){G++,se[G]=e.current,e.current=t}var de=ce(null),fe=ce(null),pe=ce(null),me=ce(null);function he(e,t){switch(ue(pe,t),ue(fe,e),ue(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dp(t),e=fp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(de),ue(de,e)}function ge(){le(de),le(fe),le(pe)}function _e(e){var t=e.memoizedState;t!==null&&(ch._currentValue=t.memoizedState,ue(me,e)),t=de.current;var n=fp(t,e.type);t!==n&&(ue(fe,e),ue(de,n))}function ve(e){fe.current===e&&(le(de),le(fe)),me.current===e&&(le(me),ch._currentValue=oe)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+ye+e+be}var Se=!1;function Ce(e,t){if(!e||Se)return``;Se=!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{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);case 30:return xe(`ViewTransition`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(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 Ze(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=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(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 Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(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-Ue(n),i=1<<r;t|=e[r],n&=~i}return t}function et(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 tt(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function at(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ot(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-Ue(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&&st(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function st(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ue(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ct(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ue(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function lt(e,t){var n=t&-t;return n=n&42?1:ut(n),(n&(e.suspendedLanes|t))===0?n:0}function ut(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 dt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ft(){var e=W.p;return e===0?(e=window.event,e===void 0?32:wh(e.type)):e}function pt(e,t){var n=W.p;try{return W.p=e,t()}finally{W.p=n}}var mt=Math.random().toString(36).slice(2),ht=`__reactFiber$`+mt,gt=`__reactProps$`+mt,_t=`__reactContainer$`+mt,vt=`__reactEvents$`+mt,yt=`__reactListeners$`+mt,bt=`__reactHandles$`+mt,xt=`__reactResources$`+mt,St=`__reactMarker$`+mt,Ct=`__reactLoad$`+mt;function wt(e){delete e[ht],delete e[gt],delete e[yt],delete e[bt]}function Tt(e){var t;if(t=e[ht])return t;for(var n=e.parentNode;n;){if(t=n[_t]||n[ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pm(e);e!==null;){if(n=e[ht])return n;e=pm(e)}return t}e=n,n=e.parentNode}return null}function Et(e){if(e=e[ht]||e[_t]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ot(e){var t=e[xt];return t||=e[xt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function kt(e){e[St]=!0}function At(e){e[Ct]=void 0}var jt=new Set,Mt={};function Nt(e,t){Pt(e,t),Pt(e+`Capture`,t)}function Pt(e,t){for(Mt[e]=t,e=0;e<t.length;e++)jt.add(t[e])}var Ft=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]*$`),It={},Lt={};function Rt(e){return Ee.call(Lt,e)?!0:Ee.call(It,e)?!1:Ft.test(e)?Lt[e]=!0:(It[e]=!0,!1)}var zt=!1;function Bt(){var e=zt;return zt=!1,e}function Vt(e,t,n){if(Rt(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 Ht(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 Ut(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 Wt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Gt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Kt(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 qt(e){if(!e._valueTracker){var t=Gt(e)?`checked`:`value`;e._valueTracker=Kt(e,t,``+e[t])}}function Jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Gt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Yt=/[\n"\\]/g;function Xt(e){return e.replace(Yt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Zt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Wt(t)):e.value!==``+Wt(t)&&(e.value=``+Wt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):$t(e,Wt(n)):o===`number`&&e.value==t?$t(e,Wt(e.value)):$t(e,Wt(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=``+Wt(s):e.removeAttribute(`name`)}function Qt(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)){qt(e);return}n=n==null?``:``+Wt(n),t=t==null?n:``+Wt(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),qt(e)}function $t(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function en(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=``+Wt(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 tn(e,t,n){t!=null&&(t=``+Wt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Wt(n)}function nn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ae(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Wt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),qt(e)}function rn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var an=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 on(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||an.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function sn(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]=``,zt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(on(e,a,r),zt=!0)}else for(var o in t)t.hasOwnProperty(o)&&on(e,o,t[o])}function cn(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 ln=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`]]),un=/^[\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 dn(e){return un.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function fn(){}var pn=null;function mn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hn=null,gn=null;function _n(e){var t=Et(e);if(t&&(e=t.stateNode)){var n=e[gt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Zt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Xt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[gt]||null;if(!a)throw Error(i(90));Zt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Jt(r)}break a;case`textarea`:tn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&en(e,!!n.multiple,t,!1)}}}var vn=!1;function yn(e,t,n){if(vn)return e(t,n);vn=!0;try{return e(t)}finally{if(vn=!1,(hn!==null||gn!==null)&&(Ld(),hn&&(t=hn,e=gn,gn=hn=null,_n(t),e)))for(t=0;t<e.length;t++)_n(e[t])}}function bn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[gt]||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 xn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Sn=!1;if(xn)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Sn=!0}}),window.addEventListener(`test`,Cn,Cn),window.removeEventListener(`test`,Cn,Cn)}catch{Sn=!1}var wn=null,Tn=null,En=null;function Dn(){if(En)return En;var e,t=Tn,n=t.length,r,i=`value`in wn?wn.value:wn.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 En=i.slice(e,1<r?1-r:void 0)}function On(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 kn(){return!0}function An(){return!1}function jn(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)?kn:An,this.isPropagationStopped=An,this}return T(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=kn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=kn)},persist:function(){},isPersistent:kn}),t}var Mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nn=jn(Mn),Pn=T({},Mn,{view:0,detail:0}),Fn=jn(Pn),In,Ln,Rn,zn=T({},Pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xn,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!==Rn&&(Rn&&e.type===`mousemove`?(In=e.screenX-Rn.screenX,Ln=e.screenY-Rn.screenY):Ln=In=0,Rn=e),In)},movementY:function(e){return`movementY`in e?e.movementY:Ln}}),Bn=jn(zn),Vn=jn(T({},zn,{dataTransfer:0})),Hn=jn(T({},Pn,{relatedTarget:0})),Un=jn(T({},Mn,{animationName:0,elapsedTime:0,pseudoElement:0})),Wn=jn(T({},Mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Gn=jn(T({},Mn,{data:0})),Kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},qn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Yn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jn[e])?!!t[e]:!1}function Xn(){return Yn}var Zn=jn(T({},Pn,{key:function(e){if(e.key){var t=Kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=On(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?qn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xn,charCode:function(e){return e.type===`keypress`?On(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?On(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Qn=jn(T({},zn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),$n=jn(T({},Mn,{submitter:0})),er=jn(T({},Pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xn})),tr=jn(T({},Mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),nr=jn(T({},zn,{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})),rr=jn(T({},Mn,{newState:0,oldState:0,source:0})),ir=[9,13,27,32],ar=xn&&`CompositionEvent`in window,or=null;xn&&`documentMode`in document&&(or=document.documentMode);var sr=xn&&`TextEvent`in window&&!or,cr=xn&&(!ar||or&&8<or&&11>=or),lr=` `,ur=!1;function dr(e,t){switch(e){case`keyup`:return ir.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function fr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var pr=!1;function mr(e,t){switch(e){case`compositionend`:return fr(t);case`keypress`:return t.which===32?(ur=!0,lr):null;case`textInput`:return e=t.data,e===lr&&ur?null:e;default:return null}}function hr(e,t){if(pr)return e===`compositionend`||!ar&&dr(e,t)?(e=Dn(),En=Tn=wn=null,pr=!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 cr&&t.locale!==`ko`?null:t.data;default:return null}}var gr={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 _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!gr[e.type]:t===`textarea`}function vr(e,t,n,r){hn?gn?gn.push(r):gn=[r]:hn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Nn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var yr=null,br=null;function xr(e){Bf(e,0)}function Sr(e){if(Jt(Dt(e)))return e}function Cr(e,t){if(e===`change`)return t}var wr=!1;if(xn){var Tr;if(xn){var Er=`oninput`in document;if(!Er){var Dr=document.createElement(`div`);Dr.setAttribute(`oninput`,`return;`),Er=typeof Dr.oninput==`function`}Tr=Er}else Tr=!1;wr=Tr&&(!document.documentMode||9<document.documentMode)}function Or(){yr&&(yr.detachEvent(`onpropertychange`,kr),br=yr=null)}function kr(e){if(e.propertyName===`value`&&Sr(br)){var t=[];vr(t,br,e,mn(e)),yn(xr,t)}}function Ar(e,t,n){e===`focusin`?(Or(),yr=t,br=n,yr.attachEvent(`onpropertychange`,kr)):e===`focusout`&&Or()}function jr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Sr(br)}function Mr(e,t){if(e===`click`)return Sr(t)}function Nr(e,t){if(e===`input`||e===`change`)return Sr(t)}function Pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Fr=typeof Object.is==`function`?Object.is:Pr;function Ir(e,t){if(Fr(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(!Ee.call(t,i)||!Fr(e[i],t[i]))return!1}return!0}function Lr(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 Rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zr(e,t){var n=Rr(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=Rr(n)}}function Br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lr(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=Lr(e.document)}return t}function Hr(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 Ur=xn&&`documentMode`in document&&11>=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==Lr(r)||(r=Wr,`selectionStart`in r&&Hr(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}),Kr&&Ir(Kr,r)||(Kr=r,r=Jf(Gr,`onSelect`),0<r.length&&(t=new Nn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Xr={animationend:Yr(`Animation`,`AnimationEnd`),animationiteration:Yr(`Animation`,`AnimationIteration`),animationstart:Yr(`Animation`,`AnimationStart`),transitionrun:Yr(`Transition`,`TransitionRun`),transitionstart:Yr(`Transition`,`TransitionStart`),transitioncancel:Yr(`Transition`,`TransitionCancel`),transitionend:Yr(`Transition`,`TransitionEnd`)},Zr={},Qr={};xn&&(Qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),`TransitionEvent`in window||delete Xr.transitionend.transition);function $r(e){if(Zr[e])return Zr[e];if(!Xr[e])return e;var t=Xr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qr)return Zr[e]=t[n];return e}var ei=$r(`animationend`),ti=$r(`animationiteration`),ni=$r(`animationstart`),ri=$r(`transitionrun`),ii=$r(`transitionstart`),ai=$r(`transitioncancel`),oi=$r(`transitionend`),si=new Map,ci=`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(` `);ci.push(`scrollEnd`);function li(e,t){si.set(e,t),Nt(t,[e])}var ui=0;function di(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=ui++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function fi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;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 pi(e,t){return e=fi(e),t=fi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var mi=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)},hi=[],gi=0,_i=0;function vi(){for(var e=gi,t=_i=gi=0;t<e;){var n=hi[t];hi[t++]=null;var r=hi[t];hi[t++]=null;var i=hi[t];hi[t++]=null;var a=hi[t];if(hi[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&&Si(n,i,a)}}function yi(e,t,n,r){hi[gi++]=e,hi[gi++]=t,hi[gi++]=n,hi[gi++]=r,_i|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function bi(e,t,n,r){return yi(e,t,n,r),Ci(e)}function xi(e,t){return yi(e,null,null,t),Ci(e)}function Si(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-Ue(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ci(e){if(50<Dd)throw Dd=0,Od=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wi={};function Ti(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ei(e,t,n,r){return new Ti(e,t,n,r)}function Di(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Oi(e,t){var n=e.alternate;return n===null?(n=Ei(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 ki(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 Ai(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Di(r)&&(s=1);else if(typeof r==`string`)s=Jm(e,n,de.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ee:return e=Ei(31,n,t,a),e.elementType=ee,e.lanes=o,e;case k:return ji(n.children,a,o,t);case A:s=8,a|=24;break;case j:return e=Ei(12,n,t,a|2),e.elementType=j,e.lanes=o,e;case F:return e=Ei(13,n,t,a),e.elementType=F,e.lanes=o,e;case I:return e=Ei(19,n,t,a),e.elementType=I,e.lanes=o,e;case z:case B:return e=a|32,e=Ei(30,n,t,e),e.elementType=B,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case M:s=9;break a;case P:s=11;break a;case L:s=14;break a;case R:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ji(e,t,n,r){return e=Ei(7,e,r,t),e.lanes=n,e}function Mi(e,t,n){return e=Ei(6,e,null,t),e.lanes=n,e}function Ni(e){var t=Ei(18,null,null,0);return t.stateNode=e,t}function Pi(e,t,n){return t=Ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fi=new WeakMap;function Ii(e,t){if(typeof e==`object`&&e){var n=Fi.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},Fi.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var Li=[],Ri=0,zi=null,Bi=0,Vi=[],Hi=0,Ui=null,Wi=1,Gi=``;function Ki(e,t){Li[Ri++]=Bi,Li[Ri++]=zi,zi=e,Bi=t}function qi(e,t,n){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Ui=e;var r=Wi;e=Gi;var i=32-Ue(r)-1;r&=~(1<<i),n+=1;var a=32-Ue(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Wi=1<<32-Ue(t)+i|n<<i|r,Gi=a+e}else Wi=1<<a|n<<i|r,Gi=e}function Ji(e){e.return!==null&&(Ki(e,1),qi(e,1,0))}function Yi(e){for(;e===zi;)zi=Li[--Ri],Li[Ri]=null,Bi=Li[--Ri],Li[Ri]=null;for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Gi=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null}function Xi(e,t){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Wi=t.id,Gi=t.overflow,Ui=e}var Zi=null,K=null,q=!1,Qi=null,$i=!1,ea=Error(i(519));function ta(e){throw oa(Ii(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ea}function na(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ht]=e,t[gt]=r,n){case`dialog`:Vf(`cancel`,t),Vf(`close`,t);break;case`iframe`:case`object`:case`embed`:Vf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)Vf(Rf[n],t);break;case`source`:Vf(`error`,t);break;case`img`:case`image`:case`link`:Vf(`error`,t),Vf(`load`,t);break;case`details`:Vf(`toggle`,t);break;case`input`:Vf(`invalid`,t),Qt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Vf(`invalid`,t);break;case`textarea`:Vf(`invalid`,t),nn(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||ep(t.textContent,n)?(r.popover!=null&&(Vf(`beforetoggle`,t),Vf(`toggle`,t)),r.onScroll!=null&&Vf(`scroll`,t),r.onScrollEnd!=null&&Vf(`scrollend`,t),r.onClick!=null&&(t.onclick=fn),t=!0):t=!1,t||ta(e,!0)}function ra(e){for(Zi=e.return;Zi;)switch(Zi.tag){case 5:case 31:case 13:$i=!1;return;case 27:case 3:$i=!0;return;default:Zi=Zi.return}}function J(e){if(e!==Zi)return!1;if(!q)return ra(e),q=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||mp(e.type,e.memoizedProps)),n=!n),n&&K&&ta(e),ra(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));K=fm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));K=fm(e)}else t===27?(t=K,Cp(e.type)?(e=dm,dm=null,K=e):K=t):K=Zi?um(e.stateNode.nextSibling):null;return!0}function ia(){K=Zi=null,q=!1}function aa(){var e=Qi;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),Qi=null),e}function oa(e){Qi===null?Qi=[e]:Qi.push(e)}var sa=ce(null),ca=null,la=null;function ua(e,t,n){ue(sa,t._currentValue),t._currentValue=n}function da(e){e._currentValue=sa.current,le(sa)}function fa(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 pa(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),fa(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),fa(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),fa(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 ma(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;Fr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ch]:e.push(ch))}a=a.return}return e!==null&&pa(t,e,n,r),t.flags|=262144,e!==null}function ha(e){for(e=e.firstContext;e!==null;){if(!Fr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ga(e){ca=e,la=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function _a(e){return ya(ca,e)}function va(e,t){return ca===null&&ga(e),ya(e,t)}function ya(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},la===null){if(e===null)throw Error(i(308));la=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else la=la.next=t;return n}var ba=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()})}},xa=t.unstable_scheduleCallback,Sa=t.unstable_NormalPriority,Ca={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wa(){return{controller:new ba,data:new Map,refCount:0}}function Ta(e){e.refCount--,e.refCount===0&&xa(Sa,function(){e.controller.abort()})}function Y(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 Ea=null;function Da(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Oa=null,ka=0,Aa=0,ja=null;function Ma(e,t){if(Oa===null){var n=Oa=[];ka=0,Aa=Nf(),ja={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ka++,t.then(Na,Na),t}function Na(){if(--ka===0&&(Ea=null,Oa!==null)){ja!==null&&(ja.status=`fulfilled`);var e=Oa;Oa=null,Aa=0,ja=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Fa=U.S;U.S=function(e,t){if(pd=je(),typeof t==`object`&&t&&typeof t.then==`function`&&Ma(e,t),Ea!==null)for(var n=yf;n!==null;)Y(n,Ea),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)Y(r,n),r=r.next;if(Aa!==0){r=Ea,r===null&&(r=Ea=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Fa!==null&&Fa(e,t)};var Ia=ce(null);function La(){var e=Ia.current;return e===null?Ju.pooledCache:e}function Ra(e,t){t===null?ue(Ia,Ia.current):ue(Ia,t.pool)}function za(){var e=La();return e===null?null:{parent:Ca._currentValue,pool:e}}var Ba=Error(i(460)),Va=Error(i(474)),Ha=Error(i(542)),Ua={then:function(){}};function X(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Wa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(fn,fn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ja(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(fn,fn);else{if(e=Ju,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,Ja(e),e}throw Ka=t,Ba}}function Ga(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ka=e,Ba):e}}var Ka=null;function qa(){if(Ka===null)throw Error(i(459));var e=Ka;return Ka=null,e}function Ja(e){if(e===Ba||e===Ha)throw Error(i(483))}var Ya=null,Xa=0;function Za(e){var t=Xa;return Xa+=1,Ya===null&&(Ya=[]),Wa(Ya,e,t)}function Qa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function $a(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function eo(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=Oi(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=Mi(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===k?(e=d(e,t,n.props.children,r,n.key),Qa(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===R&&Ga(i)===t.type)?(t=a(t,n.props),Qa(t,n),t.return=e,t):(t=Ai(n.type,n.key,n.props,null,e.mode,r),Qa(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=Pi(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=ji(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=Mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Ai(t.type,t.key,t.props,null,e.mode,n),Qa(n,t),n.return=e,n;case O:return t=Pi(t,e.mode,n),t.return=e,t;case R:return t=Ga(t),f(e,t,n)}if(ae(t)||V(t))return t=ji(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Za(t),n);if(t.$$typeof===N)return f(e,va(e,t),n);$a(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 D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case R:return n=Ga(n),p(e,t,n,r)}if(ae(n)||V(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Za(n),r);if(n.$$typeof===N)return p(e,t,va(e,n),r);$a(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 D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case R:return r=Ga(r),m(e,t,n,r,i)}if(ae(r)||V(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Za(r),i);if(r.$$typeof===N)return m(e,t,n,va(t,r),i);$a(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),q&&Ki(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 q&&Ki(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)}),q&&Ki(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),q&&Ki(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 q&&Ki(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)}),q&&Ki(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),Qa(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===R&&Ga(l)===r.type){n(e,r.sibling),c=a(r,o.props),Qa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=ji(o.props.children,e.mode,c,o.key),Qa(c,o),c.return=e,e=c):(c=Ai(o.type,o.key,o.props,null,e.mode,c),Qa(c,o),c.return=e,e=c)}return s(e);case O: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=Pi(o,e.mode,c),c.return=e,e=c}return s(e);case R:return o=Ga(o),_(e,r,o,c)}if(ae(o))return h(e,r,o,c);if(V(o)){if(l=V(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,Za(o),c);if(o.$$typeof===N)return _(e,r,va(e,o),c);$a(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=Mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Xa=0;var i=_(e,t,n,r);return Ya=null,i}catch(t){if(t===Ba||t===Ha)throw t;var a=Ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var to=eo(!0),no=eo(!1),ro=!1;function io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ao(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 oo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function so(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,qu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ci(e),Si(e,null,n),t}return yi(e,r,t,n),Ci(e)}function co(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,ct(e,n)}}function lo(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 uo=!1;function fo(){if(uo){var e=ja;if(e!==null)throw e}}function po(e,t,n,r){uo=!1;var i=e.updateQueue;ro=!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?(Xu&f)===f:(r&f)===f){f!==0&&f===Aa&&(uo=!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=T({},d,f);break a;case 2:ro=!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),id|=o,e.lanes=o,e.memoizedState=d}}function mo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function ho(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)mo(n[e],t)}var go=ce(null),_o=ce(0);function vo(e,t){e=nd,ue(_o,e),ue(go,t),nd=e|t.baseLanes}function yo(){ue(_o,nd),ue(go,go.current)}function bo(){nd=_o.current,le(go),le(_o)}var xo=ce(null),So=null;function Co(e){var t=e.alternate;ue(Oo,Oo.current&1),ue(xo,e),So===null&&(t===null||go.current!==null||t.memoizedState!==null)&&(So=e)}function wo(e){ue(Oo,Oo.current),ue(xo,e),So===null&&(So=e)}function To(e){e.tag===22?(ue(Oo,Oo.current),ue(xo,e),So===null&&(So=e)):Eo()}function Eo(){ue(Oo,Oo.current),ue(xo,xo.current)}function Do(e){le(xo),So===e&&(So=null),le(Oo)}var Oo=ce(0);function ko(e,t){ue(xo,xo.current),ue(Oo,t)}function Ao(e){le(Oo),le(xo),So===e&&(So=null)}function jo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sm(n)||cm(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 Mo=0,No=null,Po=null,Fo=null,Io=!1,Z=!1,Lo=!1,Ro=0,zo=0,Bo=null,Vo=0;function Ho(){throw Error(i(321))}function Uo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function Wo(e,t,n,r,i,a){return Mo=a,No=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?oc:sc,Lo=!1,a=n(r,i),Lo=!1,Z&&(a=Ko(t,n,r,i)),Go(e),a}function Go(e){U.H=ac;var t=Po!==null&&Po.next!==null;if(Mo=0,Fo=Po=No=null,Io=!1,zo=0,Bo=null,t)throw Error(i(300));e===null||wc||(e=e.dependencies,e!==null&&ha(e)&&(wc=!0))}function Ko(e,t,n,r){No=e;var a=0;do{if(Z&&(Bo=null),zo=0,Z=!1,25<=a)throw Error(i(301));if(a+=1,Fo=Po=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}U.H=cc,o=t(n,r)}while(Z);return o}function qo(){var e=U.H,t=e.useState()[0];return t=typeof t.then==`function`?es(t):t,e=e.useState()[0],(Po===null?null:Po.memoizedState)!==e&&(No.flags|=1024),t}function Jo(){var e=Ro!==0;return Ro=0,e}function Yo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Xo(e){if(Io){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Io=!1}Mo=0,Fo=Po=No=null,Z=!1,zo=Ro=0,Bo=null}function Zo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fo===null?No.memoizedState=Fo=e:Fo=Fo.next=e,Fo}function Qo(){if(Po===null){var e=No.alternate;e=e===null?null:e.memoizedState}else e=Po.next;var t=Fo===null?No.memoizedState:Fo.next;if(t!==null)Fo=t,Po=e;else{if(e===null)throw No.alternate===null?Error(i(467)):Error(i(310));Po=e,e={memoizedState:Po.memoizedState,baseState:Po.baseState,baseQueue:Po.baseQueue,queue:Po.queue,next:null},Fo===null?No.memoizedState=Fo=e:Fo=Fo.next=e}return Fo}function $o(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function es(e){var t=zo;return zo+=1,Bo===null&&(Bo=[]),e=Wa(Bo,e,t),t=No,(Fo===null?t.memoizedState:Fo.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?oc:sc),e}function ts(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return es(e);if(e.$$typeof===ne)return;if(e.$$typeof===N)return _a(e)}throw Error(i(438,String(e)))}function ns(e){var t=null,n=No.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=No.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=$o(),No.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]=te;return t.index++,n}function rs(e,t){return typeof t==`function`?t(e):t}function is(e){return as(Qo(),Po,e)}function as(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?(Mo&f)===f:(Xu&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===Aa&&(d=!0);else if((Mo&p)===p){u=u.next,p===Aa&&(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,No.lanes|=p,id|=p;f=u.action,Lo&&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,No.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Fr(o,e.memoizedState)&&(wc=!0,d&&(n=ja,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 os(e){var t=Qo(),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);Fr(o,t.memoizedState)||(wc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ss(e,t,n){var r=No,a=Qo(),o=q;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Fr((Po||a).memoizedState,n);if(s&&(a.memoizedState=n,wc=!0),a=a.queue,Ms(us.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Fo!==null&&!!(Fo.memoizedState.tag&1),Ds(e?9:8,{destroy:void 0},ls.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Ju===null)throw Error(i(349));o||Mo&127||cs(r,t,n)}return n}function cs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=No.updateQueue,t===null?(t=$o(),No.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ls(e,t,n,r){t.value=n,t.getSnapshot=r,ds(t)&&fs(e)}function us(e,t,n){return n(function(){ds(t)&&fs(e)})}function ds(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Fr(e,n)}catch{return!0}}function fs(e){var t=xi(e,2);t!==null&&Md(t,e,2)}function ps(e){var t=Zo();if(typeof e==`function`){var n=e;if(e=n(),Lo){He(!0);try{n()}finally{He(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:e},t}function ms(e,t,n,r){return e.baseState=n,as(e,Po,typeof r==`function`?r:rs)}function hs(e,t,n,r,a){if(nc(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)}};U.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,gs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function gs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=U.T,o={};o.types=a===null?null:a.types,U.T=o;try{var s=n(i,r),c=U.S;c!==null&&c(o,s),_s(e,t,s)}catch(n){ys(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),U.T=a}}else try{a=n(i,r),_s(e,t,a)}catch(n){ys(e,t,n)}}function _s(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){vs(e,t,n)},function(n){return ys(e,t,n)}):vs(e,t,n)}function vs(e,t,n){t.status=`fulfilled`,t.value=n,bs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,gs(e,n)))}function ys(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,bs(t),t=t.next;while(t!==r)}e.action=null}function bs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function xs(e,t){return t}function Ss(e,t){if(q){var n=Ju.formState;if(n!==null){a:{var r=No;if(q){if(K){b:{for(var i=K,a=$i;i.nodeType!==8;)if(!a||(i=um(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){K=um(i.nextSibling),r=i.data===`F!`;break a}}ta(r)}r=!1}r&&(t=n[0])}}return n=Zo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:t},n.queue=r,n=$s.bind(null,No,r),r.dispatch=n,r=ps(!1),a=tc.bind(null,No,!1,r.queue),r=Zo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=hs.bind(null,No,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Cs(e){return ws(Qo(),Po,e)}function ws(e,t,n){if(t=as(e,t,xs)[0],e=is(rs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=es(t)}catch(e){throw e===Ba?Ha:e}else r=t;t=Qo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(No.flags|=2048,Ds(9,{destroy:void 0},Ts.bind(null,i,n),null)),[r,a,e]}function Ts(e,t){e.action=t}function Es(e){var t=Qo(),n=Po;if(n!==null)return ws(t,n,e);Qo(),t=t.memoizedState,n=Qo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ds(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=No.updateQueue,t===null&&(t=$o(),No.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 Os(){return Qo().memoizedState}function ks(e,t,n,r){var i=Zo();No.flags|=e,i.memoizedState=Ds(1|t,{destroy:void 0},n,r===void 0?null:r)}function As(e,t,n,r){var i=Qo();r=r===void 0?null:r;var a=i.memoizedState.inst;Po!==null&&r!==null&&Uo(r,Po.memoizedState.deps)?i.memoizedState=Ds(t,a,n,r):(No.flags|=e,i.memoizedState=Ds(1|t,a,n,r))}function js(e,t){ks(8390656,8,e,t)}function Ms(e,t){As(2048,8,e,t)}function Ns(e){No.flags|=4;var t=No.updateQueue;if(t===null)t=$o(),No.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ps(e){var t=Qo().memoizedState;return Ns({ref:t,nextImpl:e}),function(){if(qu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Fs(e,t){return As(4,2,e,t)}function Is(e,t){return As(4,4,e,t)}function Ls(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 Rs(e,t,n){n=n==null?null:n.concat([e]),As(4,4,Ls.bind(null,t,e),n)}function zs(){}function Bs(e,t){var n=Qo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Uo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Vs(e,t){var n=Qo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Uo(t,r[1]))return r[0];if(r=e(),Lo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r}function Hs(e,t,n){return n===void 0||Mo&1073741824&&!(Xu&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),No.lanes|=e,id|=e,n)}function Us(e,t,n,r){return Fr(n,t)?n:go.current===null?!(Mo&106)||Mo&1073741824&&!(Xu&261930)?(wc=!0,e.memoizedState=n):(e=Ad(),No.lanes|=e,id|=e,t):(e=Hs(e,n,r),Fr(e,t)||(wc=!0),e)}function Ws(e,t,n,r,i){var a=W.p;W.p=a!==0&&8>a?a:8;var o=U.T,s={};s.types=o===null?null:o.types,U.T=s,tc(e,!1,t,n);try{var c=i(),l=U.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ec(e,t,Pa(c,r),kd(e)):ec(e,t,r,kd(e))}catch(n){ec(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{W.p=a,o!==null&&s.types!==null&&(o.types=s.types),U.T=o}}function Gs(){}function Ks(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=qs(e).queue;Ws(e,a,t,oe,n===null?Gs:function(){return Js(e),n(r)})}function qs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Js(e){var t=qs(e);t.next===null&&(t=e.alternate.memoizedState),ec(e,t.next.queue,{},kd())}function Ys(){return _a(ch)}function Q(){return Qo().memoizedState}function Xs(){return Qo().memoizedState}function Zs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=oo(n);var r=so(t,e,n);r!==null&&(Md(r,t,n),co(r,t,n)),t={cache:wa()},e.payload=t;return}t=t.return}}function Qs(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},nc(e)?rc(t,n):(n=bi(e,t,n,r),n!==null&&(Md(n,e,r),ic(n,t,r)))}function $s(e,t,n){ec(e,t,n,kd())}function ec(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(nc(e))rc(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,Fr(s,o))return yi(e,t,i,0),Ju===null&&vi(),!1}catch{}if(n=bi(e,t,i,r),n!==null)return Md(n,e,r),ic(n,t,r),!0}return!1}function tc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},nc(e)){if(t)throw Error(i(479))}else t=bi(e,n,r,2),t!==null&&Md(t,e,2)}function nc(e){var t=e.alternate;return e===No||t!==null&&t===No}function rc(e,t){Z=Io=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ic(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}var ac={readContext:_a,use:ts,useCallback:Ho,useContext:Ho,useEffect:Ho,useImperativeHandle:Ho,useLayoutEffect:Ho,useInsertionEffect:Ho,useMemo:Ho,useReducer:Ho,useRef:Ho,useState:Ho,useDebugValue:Ho,useDeferredValue:Ho,useTransition:Ho,useSyncExternalStore:Ho,useId:Ho,useHostTransitionStatus:Ho,useFormState:Ho,useActionState:Ho,useOptimistic:Ho,useMemoCache:Ho,useCacheRefresh:Ho,useEffectEvent:Ho},oc={readContext:_a,use:ts,useCallback:function(e,t){return Zo().memoizedState=[e,t===void 0?null:t],e},useContext:_a,useEffect:js,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ks(4194308,4,Ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ks(4194308,4,e,t)},useInsertionEffect:function(e,t){ks(4,2,e,t)},useMemo:function(e,t){var n=Zo();t=t===void 0?null:t;var r=e();if(Lo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Zo();if(n!==void 0){var i=n(t);if(Lo){He(!0);try{n(t)}finally{He(!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=Qs.bind(null,No,e),[r.memoizedState,e]},useRef:function(e){var t=Zo();return e={current:e},t.memoizedState=e},useState:function(e){e=ps(e);var t=e.queue,n=$s.bind(null,No,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:zs,useDeferredValue:function(e,t){return Hs(Zo(),e,t)},useTransition:function(){var e=ps(!1);return e=Ws.bind(null,No,e.queue,!0,!1),Zo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=No,a=Zo();if(q){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ju===null)throw Error(i(349));Xu&127||cs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,js(us.bind(null,r,o,e),[e]),r.flags|=2048,Ds(9,{destroy:void 0},ls.bind(null,r,o,n,t),null),n},useId:function(){var e=Zo(),t=Ju.identifierPrefix;if(q){var n=Gi,r=Wi;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ro++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Vo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ys,useFormState:Ss,useActionState:Ss,useOptimistic:function(e){var t=Zo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=tc.bind(null,No,!0,n),n.dispatch=t,[e,t]},useMemoCache:ns,useCacheRefresh:function(){return Zo().memoizedState=Zs.bind(null,No)},useEffectEvent:function(e){var t=Zo(),n={impl:e};return t.memoizedState=n,function(){if(qu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},sc={readContext:_a,use:ts,useCallback:Bs,useContext:_a,useEffect:Ms,useImperativeHandle:Rs,useInsertionEffect:Fs,useLayoutEffect:Is,useMemo:Vs,useReducer:is,useRef:Os,useState:function(){return is(rs)},useDebugValue:zs,useDeferredValue:function(e,t){return Us(Qo(),Po.memoizedState,e,t)},useTransition:function(){var e=is(rs)[0],t=Qo().memoizedState;return[typeof e==`boolean`?e:es(e),t]},useSyncExternalStore:ss,useId:Q,useHostTransitionStatus:Ys,useFormState:Cs,useActionState:Cs,useOptimistic:function(e,t){return ms(Qo(),Po,e,t)},useMemoCache:ns,useCacheRefresh:Xs,useEffectEvent:Ps},cc={readContext:_a,use:ts,useCallback:Bs,useContext:_a,useEffect:Ms,useImperativeHandle:Rs,useInsertionEffect:Fs,useLayoutEffect:Is,useMemo:Vs,useReducer:os,useRef:Os,useState:function(){return os(rs)},useDebugValue:zs,useDeferredValue:function(e,t){var n=Qo();return Po===null?Hs(n,e,t):Us(n,Po.memoizedState,e,t)},useTransition:function(){var e=os(rs)[0],t=Qo().memoizedState;return[typeof e==`boolean`?e:es(e),t]},useSyncExternalStore:ss,useId:Q,useHostTransitionStatus:Ys,useFormState:Es,useActionState:Es,useOptimistic:function(e,t){var n=Qo();return Po===null?(n.baseState=e,[e,n.queue.dispatch]):ms(n,Po,e,t)},useMemoCache:ns,useCacheRefresh:Xs,useEffectEvent:Ps};function lc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var uc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=oo(r);i.payload=t,n!=null&&(i.callback=n),t=so(e,i,r),t!==null&&(Md(t,e,r),co(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=oo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=so(e,i,r),t!==null&&(Md(t,e,r),co(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=oo(n);r.tag=2,t!=null&&(r.callback=t),t=so(e,r,n),t!==null&&(Md(t,e,n),co(t,e,n))}};function dc(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?!Ir(n,r)||!Ir(i,a):!0}function fc(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&&uc.enqueueReplaceState(t,t.state,null)}function pc(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=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function mc(e){mi(e)}function hc(e){console.error(e)}function gc(e){mi(e)}function _c(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function vc(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 yc(e,t,n){return n=oo(n),n.tag=3,n.payload={element:null},n.callback=function(){_c(e,t)},n}function bc(e){return e=oo(e),e.tag=3,e}function xc(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(){vc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){vc(t,n,r),typeof i!=`function`&&(gd===null?gd=new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Sc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ma(t,n,a,!0),n=xo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return So===null?Wd():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ua?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),pf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ua?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)),pf(e,r,a)),!1}throw Error(i(435,n.tag))}return pf(e,r,a),Wd(),!1}if(q)return t=xo.current,t===null?(r!==ea&&(t=Error(i(423),{cause:r}),oa(Ii(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ii(r,n),a=yc(e.stateNode,r,a),lo(e,a),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ea&&(e=Error(i(422),{cause:r}),oa(Ii(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ii(o,n),ld===null?ld=[o]:ld.push(o),rd!==4&&(rd=2),t===null)return!0;r=Ii(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=yc(n.stateNode,r,e),lo(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`&&(gd===null||!gd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=bc(a),xc(a,e,n,r),lo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Cc=Error(i(461)),wc=!1;function Tc(e,t,n,r){t.child=e===null?no(t,null,n,r):to(t,e.child,n,r)}function Ec(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 ga(t),r=Wo(e,t,n,o,a,i),s=Jo(),e!==null&&!wc?(Yo(e,t,i),el(e,t,i)):(q&&s&&Ji(t),t.flags|=1,Tc(e,t,r,i),t.child)}function Dc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Di(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Oc(e,t,a,r,i)):(e=Ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!tl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ir:n,n(o,r)&&e.ref===t.ref)return el(e,t,i)}return t.flags|=1,e=Oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Oc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ir(a,r)&&e.ref===t.ref){if(wc=!1,t.pendingProps=r=a,tl(e,i))e.flags&131072&&(wc=!0);else return t.lanes=e.lanes,el(e,t,i)}}return Ic(e,t,n,r,i)}function kc(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 jc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ra(t,a===null?null:a.cachePool),a===null?yo():vo(t,a),To(t);else return r=t.lanes=536870912,jc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ra(t,null),yo(),Eo()):(Ra(t,a.cachePool),vo(t,a),Eo(),t.memoizedState=null);return Tc(e,t,i,n),t.child}function Ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function jc(e,t,n,r,i){var a=La();return a=a===null?null:{parent:Ca._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ra(t,null),yo(),To(t),e!==null&&ma(e,t,r,!0),t.childLanes=i,null}function Mc(e,t){return t=Gc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Nc(e,t,n){return to(t,e.child,null,n),e=Mc(t,t.pendingProps),e.flags|=2,Do(t),t.memoizedState=null,e}function Pc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(q){if(r.mode===`hidden`)return e=Mc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ac(null,e);if(wo(t),(e=K)?(e=om(e,$i),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,K=null)):e=null,e===null)throw ta(t);return t.lanes=536870912,null}return Mc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(wo(t),a){if(t.flags&256)t.flags&=-257,t=Nc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(wc||ma(e,t,n,!1),a=(n&e.childLanes)!==0,wc||a){if(go.current===null){if(r=Ju,r!==null&&(s=lt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,xi(e,s),Md(r,e,s),Cc;Wd()}t=Nc(e,t,n)}else e=o.treeContext,K=um(s.nextSibling),Zi=t,q=!0,Qi=null,$i=!1,e!==null&&Xi(t,e),t=Mc(t,r),t.flags|=134221824;return t}return e=Oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Ic(e,t,n,r,i){return ga(t),n=Wo(e,t,n,r,void 0,i),r=Jo(),e!==null&&!wc?(Yo(e,t,i),el(e,t,i)):(q&&r&&Ji(t),t.flags|=1,Tc(e,t,n,i),t.child)}function Lc(e,t,n,r,i,a){return ga(t),t.updateQueue=null,n=Ko(t,r,n,i),Go(e),r=Jo(),e!==null&&!wc?(Yo(e,t,a),el(e,t,a)):(q&&r&&Ji(t),t.flags|=1,Tc(e,t,n,a),t.child)}function Rc(e,t,n,r,i){if(ga(t),t.stateNode===null){var a=wi,o=n.contextType;typeof o==`object`&&o&&(a=_a(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=uc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},io(t),o=n.contextType,a.context=typeof o==`object`&&o?_a(o):wi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(lc(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&&uc.enqueueReplaceState(a,a.state,null),po(t,r,a,i),fo(),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=pc(n,s);a.props=c;var l=a.context,u=n.contextType;o=wi,typeof u==`object`&&u&&(o=_a(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)&&fc(t,a,r,o),ro=!1;var f=t.memoizedState;a.state=f,po(t,r,a,i),fo(),l=t.memoizedState,s||f!==l||ro?(typeof d==`function`&&(lc(t,n,d,r),l=t.memoizedState),(c=ro||dc(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,ao(e,t),o=t.memoizedProps,u=pc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=wi,typeof l==`object`&&l&&(c=_a(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)&&fc(t,a,r,c),ro=!1,f=t.memoizedState,a.state=f,po(t,r,a,i),fo();var p=t.memoizedState;o!==d||f!==p||ro||e!==null&&e.dependencies!==null&&ha(e.dependencies)?(typeof s==`function`&&(lc(t,n,s,r),p=t.memoizedState),(u=ro||dc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ha(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Fc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=to(t,e.child,null,i),t.child=to(t,null,n,i)):Tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=el(e,t,i),e}function zc(e,t,n,r){return ia(),t.flags|=256,Tc(e,t,n,r),t.child}var Bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vc(e){return{baseLanes:e,cachePool:za()}}function Hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function Uc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Oo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(q){if(i?Co(t):Eo(),(e=K)?(e=om(e,$i),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,K=null)):e=null,e===null)throw ta(t);return t.lanes=cm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Eo(),i=t.mode,a=Gc({mode:`hidden`,children:a},i),r=ji(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Vc(n),r.childLanes=Hc(e,o,n),t.memoizedState=Bc,Ac(null,r)):(Co(t),Wc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return qc(e,t,a,o,r,c,s,n)}return i?(Eo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Oi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=ji(i,a,n,null),i.flags|=2):i=Oi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Ac(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Vc(n):(a=i.cachePool,a===null?a=za():(s=Ca._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Hc(e,o,n),t.memoizedState=Bc,Ac(e.child,r)):(Co(t),n=e.child,e=n.sibling,n=Oi(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 Wc(e,t){return t=Gc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Gc(e,t){return e=Ei(22,e,null,t),e.lanes=0,e}function Kc(e,t,n){return to(t,e.child,null,n),e=Wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Co(t),t.flags&=-257,Kc(e,t,c)):t.memoizedState===null?(Eo(),o=a.fallback,s=t.mode,a=Gc({mode:`visible`,children:a.children},s),o=ji(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,to(t,e.child,null,c),a=t.child,a.memoizedState=Vc(c),a.childLanes=Hc(e,r,c),t.memoizedState=Bc,Ac(null,a)):(Eo(),t.child=e.child,t.flags|=128,null);if(Co(t),cm(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,oa({value:a,source:null,stack:null})),Kc(e,t,c)}if(wc||ma(e,t,c,!1),r=(c&e.childLanes)!==0,wc||r){if(go.current!==null)return Kc(e,t,c);if(r=Ju,r!==null&&(a=lt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,xi(e,a),Md(r,e,a),Cc;return sm(o)||Wd(),Kc(e,t,c)}return sm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,K=um(o.nextSibling),Zi=t,q=!0,Qi=null,$i=!1,e!==null&&Xi(t,e),t=Wc(t,a.children),t.flags|=134221824,t)}function Jc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),fa(e.return,t,n)}function Yc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&jo(n)===null&&(t=e),e=e.sibling}return t}function Xc(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 Zc(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 Qc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Oo.current;if(t.flags&128)return ko(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,ko(t,o),i===`backwards`&&e!==null?(Zc(e),Tc(e,t,r,n),Zc(e)):Tc(e,t,r,n),r=q?Bi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jc(e,n,t);else if(e.tag===19)Jc(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=Yc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,Zc(t)),Xc(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&&jo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Xc(t,!0,n,null,a,r);break;case`together`:Xc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Yc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Xc(t,!1,i,n,a,r)}return t.child}function $c(e,t,n){var r=t.pendingProps;return ua(t,t.type,r.value),Tc(e,t,r.children,n),t.child}function el(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ma(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=Oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function tl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ha(e)))}function nl(e,t,n){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),ua(t,Ca,e.memoizedState.cache),ia();break;case 27:case 5:_e(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:ua(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,wo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Co(t),t.flags|=128,null;r=ma(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Uc(e,t,n):(Co(t),e=el(e,t,n),e===null?null:e.sibling)}Co(t);break;case 19:if(t.flags&128)return Qc(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ma(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Qc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ko(t,Oo.current),r)break;return null;case 22:return t.lanes=0,kc(e,t,n,t.pendingProps);case 24:ua(t,Ca,e.memoizedState.cache)}return el(e,t,n)}function rl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)wc=!0;else{if(!tl(e,n)&&!(t.flags&128))return wc=!1,nl(e,t,n);wc=!!(e.flags&131072)}}else wc=!1,q&&t.flags&1048576&&qi(t,Bi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ga(t.elementType),t.type=e,typeof e==`function`)Di(e)?(r=pc(e,r),t.tag=1,t=Rc(null,t,e,r,n)):(t.tag=0,t=Ic(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===P){t.tag=11,t=Ec(null,t,e,r,n);break a}if(a===L){t.tag=14,t=Dc(null,t,e,r,n);break a}if(a===N){t.tag=10,t.type=e,t=$c(null,t,n);break a}}throw t=H(e)||e,Error(i(306,t,``))}}return t;case 0:return Ic(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=pc(r,t.pendingProps),Rc(e,t,r,a,n);case 3:a:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ao(e,t),po(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ua(t,Ca,r),r!==o.cache&&pa(t,[Ca],n,!0),fo(),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=zc(e,t,r,n);break a}if(r!==a){a=Ii(Error(i(424)),t),oa(a),t=zc(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(K=um(e.firstChild),Zi=t,q=!0,Qi=null,$i=!0,n=no(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ia(),r===a){t=el(e,t,n);break a}Tc(e,t,r,n)}t=t.child}return t;case 26:return Fc(e,t),e===null?(n=Pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:q||(t.stateNode=pp(t.type,t.pendingProps,pe.current,t)):t.memoizedState=Pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&q&&(r=t.stateNode=gm(t.type,t.pendingProps,pe.current),Zi=t,$i=!0,a=K,Cp(t.type)?(dm=a,K=um(r.firstChild)):K=a),Tc(e,t,t.pendingProps.children,n),Fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&q&&((a=r=K)&&(r=im(r,t.type,t.pendingProps,$i),r===null?a=!1:(t.stateNode=r,Zi=t,K=um(r.firstChild),$i=!1,a=!0)),a||ta(t)),_e(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,mp(a,o)?r=null:s!==null&&mp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Wo(e,t,qo,null,null,n),ch._currentValue=a),Fc(e,t),Tc(e,t,r,n),t.child;case 6:return e===null&&q&&((e=n=K)&&(n=am(n,t.pendingProps,$i),n===null?e=!1:(t.stateNode=n,Zi=t,K=null,e=!0)),e||ta(t)),null;case 13:return Uc(e,t,n);case 4:return he(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=to(t,null,r,n):Tc(e,t,r,n),t.child;case 11:return Ec(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Fc(e,t),Tc(e,t,r,n),t.child;case 8:return Tc(e,t,t.pendingProps.children,n),t.child;case 12:return Tc(e,t,t.pendingProps.children,n),t.child;case 10:return $c(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ga(t),a=_a(a),r=r(a),t.flags|=1,Tc(e,t,r,n),t.child;case 14:return Dc(e,t,t.type,t.pendingProps,n);case 15:return Oc(e,t,t.type,t.pendingProps,n);case 19:return Qc(e,t,n);case 31:return Pc(e,t,n);case 22:return kc(e,t,n,t.pendingProps);case 24:return ga(t),r=_a(Ca),e===null?(a=La(),a===null&&(a=Ju,o=wa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},io(t),ua(t,Ca,a)):((e.lanes&n)!==0&&(ao(e,t),po(t,null,null,n),fo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ua(t,Ca,r),r!==a.cache&&pa(t,[Ca],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ua(t,Ca,r))),Tc(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:q&&Ji(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Fc(e,t),Tc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function il(e){e.flags|=4}function al(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Ym(t,r):Ym(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(Vd())e.flags|=8192;else throw Ka=Ua,Va}}else e.flags&=-16777217}function ol(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t)){if(Vd())e.flags|=8192;else throw Ka=Ua,Va}}function sl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,cd|=t)}function cl(e,t){if(!q)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 ll(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 ul(e,t,n){var r=t.pendingProps;switch(Yi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ll(t),null;case 1:return ll(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),da(Ca),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(J(t)?il(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,aa())),ll(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(il(t),o===null?(ll(t),al(t,a,null,r,n)):(ll(t),ol(t,o))):o?o===e.memoizedState?(ll(t),t.flags&=-16777217):(il(t),ll(t),ol(t,o)):(e=e.memoizedProps,e!==r&&il(t),ll(t),al(t,a,e,r,n)),null;case 27:if(ve(t),n=pe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&il(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ll(t),t.subtreeFlags&=-33554433,null}e=de.current,J(t)?na(t,e):(e=gm(a,r,n),t.stateNode=e,il(t))}return ll(t),t.subtreeFlags&=-33554433,null;case 5:if(ve(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&il(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ll(t),t.subtreeFlags&=-33554433,null}if(o=de.current,J(t))na(t,o);else{var s=up(pe.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[ht]=t,o[gt]=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(rp(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&&il(t)}}return ll(t),t.subtreeFlags&=-33554433,al(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&il(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,J(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Zi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ht]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||ta(t,!0)}else e=up(e).createTextNode(r),e[ht]=t,t.stateNode=e}return ll(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=J(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[ht]=t}else ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ll(t),e=!1}else n=aa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Do(t),t):(Do(t),null);if(t.flags&128)throw Error(i(558))}return ll(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=J(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[ht]=t}else ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ll(t),a=!1}else a=aa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Do(t),t):(Do(t),null)}return Do(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),sl(t,t.updateQueue),ll(t),null);case 4:return ge(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,ll(t),null;case 10:return da(t.type),ll(t),null;case 19:if(Ao(t),r=t.memoizedState,r===null)return ll(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)cl(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=jo(e),o!==null){for(t.flags|=128,cl(r,!1),e=o.updateQueue,t.updateQueue=e,sl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ki(n,e),n=n.sibling;return ko(t,Oo.current&1|2),q&&Ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>md&&(t.flags|=128,a=!0,cl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=jo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,sl(t,e),cl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!q)return ll(t),null}else 2*je()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,a=!0,cl(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=je(),e.sibling=null,o=Oo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||q?ko(t,o):(n=o,ue(xo,t),ue(Oo,n),So===null&&(So=t)),q&&Ki(t,r.treeForkCount),e}return ll(t),null;case 22:case 23:return Do(t),bo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(ll(t),t.subtreeFlags&6&&(t.flags|=8192)):ll(t),n=t.updateQueue,n!==null&&sl(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&&le(Ia),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),da(Ca),ll(t),null;case 25:return null;case 30:return t.flags|=33554432,ll(t),null}throw Error(i(156,t.tag))}function dl(e,t){switch(Yi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return da(Ca),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(Do(t),t.alternate===null)throw Error(i(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Do(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ao(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 ge(),null;case 10:return da(t.type),null;case 22:case 23:return Do(t),bo(),e!==null&&le(Ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return da(Ca),null;case 25:return null;default:return null}}function fl(e,t){switch(Yi(t),t.tag){case 3:da(Ca),ge();break;case 26:case 27:case 5:ve(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&Do(t);break;case 13:Do(t);break;case 19:Ao(t);break;case 10:da(t.type);break;case 22:case 23:Do(t),bo(),e!==null&&le(Ia);break;case 24:da(Ca)}}function pl(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){ff(t,t.return,e)}}function ml(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){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function hl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ho(t,n)}catch(t){ff(e,e.return,t)}}}function gl(e,t,n){n.props=pc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function _l(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=di(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Fp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Ip(e);p(e.child,!1,$p,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){ff(e,t,n)}}function vl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(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){ff(e,t,n)}else n.current=null}}function yl(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++)tm(e.stateNode,t[n])}function bl(e){for(var t=e.return;t!==null&&(Cl(t)&&tm(e.stateNode,t.stateNode),!Sl(t));)t=t.return}function xl(e){for(var t=e.return;t!==null&&(Cl(t)&&nm(e.stateNode,t.stateNode),!Sl(t));)t=t.return}function Sl(e){return e.tag===5||e.tag===3||e.tag===27}function Cl(e){return e&&e.tag===7&&e.stateNode!==null}function wl(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){ff(e,e.return,t)}}function Tl(e,t,n){try{var r=e.stateNode;ap(r,e.type,n,t),r[gt]=t}catch(t){ff(e,e.return,t)}}function El(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cp(e.type)||e.tag===4}function Dl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||El(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&&Cp(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 Ol(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=fn)),yl(e,r),zt=!0;else if(i!==4&&(i===27&&(yl(e,r),r=null,Cp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ol(e,t,n,r),e=e.sibling;e!==null;)Ol(e,t,n,r),e=e.sibling}function kl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),yl(e,r),zt=!0;else if(i!==4&&(i===27&&(yl(e,r),r=null,Cp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(kl(e,t,n,r),e=e.sibling;e!==null;)kl(e,t,n,r),e=e.sibling}function Al(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);rp(t,r,n),t[ht]=e,t[gt]=n}catch(t){ff(e,e.return,t)}}var jl=!1,Ml=null;function Nl(e){(e.tag===30||e.subtreeFlags&33554432)&&(jl=!0)}var Pl=null;function Fl(){var e=Pl;return Pl=null,e}var Il=0;function Ll(e,t,n,r,i){return Il=0,Rl(e.child,t,n,r,i)}function Rl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=kp(o);r.push(s),s.view&&(a=!0)}else a||kp(o).view&&(a=!0);jl=!0,Ep(o,Il===0?t:t+`_`+Il,n),Il++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Rl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function zl(e,t){for(;e!==null;)e.tag===5?Dp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||zl(e.child,t),e=e.sibling}function Bl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Bl(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=pi(t.default,t.share),t!==`none`&&(Ll(e,n,t,null,!1)||zl(e.child,!1))}e=e.sibling}}function Vl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=di(r,n),a=pi(r.default,n.paired?r.share:r.enter);a===`none`?Bl(e):Ll(e,i,a,null,!1)?(Bl(e),n.paired||t||jd(e,r.onEnter)):zl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Vl(e,t),e=e.sibling;else Bl(e)}function Hl(e){if(Ml!==null&&Ml.size!==0){var t=Ml;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=pi(n.default,n.share);if(a!==`none`&&(Ll(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):zl(e.child,!1)),t.delete(r),t.size===0)break}}}Hl(e)}e=e.sibling}}}function Ul(e){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode),r=Ml===null?void 0:Ml.get(n),i=pi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Ll(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ml.delete(n),jd(e,t.onShare)):zl(e.child,!1)),Ml!==null&&Hl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e),e=e.sibling;else Ml!==null&&Hl(e)}function Wl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode);t=pi(t.default,t.update),e.flags&=-5,t!==`none`&&Ll(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Wl(e);e=e.sibling}}function Gl(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,zl(e.child,!1))}Gl(e)}e=e.sibling}}function Kl(e){if(e.tag===30)e.stateNode.paired=null,zl(e.child,!1),Gl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e),e=e.sibling;else Gl(e)}function ql(e){for(e=e.child;e!==null;)e.tag===30?zl(e.child,!1):e.subtreeFlags&33554432&&ql(e),e=e.sibling}function Jl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Il<a.length){var l=a[Il],u=kp(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&&Ep(c,Il===0?n:n+`_`+Il,i),s&&e.flags&4||(Pl===null&&(Pl=[]),Pl.push(c,Il===0?r:r+`_`+Il,t.memoizedProps)),Il++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Jl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Yl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=di(n,r),a=pi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ap)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Il=0,i=Jl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Yl(e,t);e=e.sibling}}var Xl=!1,Zl=!1,Ql=!1,$l=!1,eu=typeof WeakSet==`function`?WeakSet:Set,tu=null,nu=!1,ru=!1,iu=!1,au=!1;function ou(e,t,n){if(e=e.containerInfo,cp=_h,e=Vr(e),Hr(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(lp={focusedElem:e,selectionRange:r},_h=!1,n=(n&335544064)===n,tu=t,t=n?9270:1024;tu!==null;){if(e=tu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ul(r[a]);if(e.alternate===null&&e.flags&2)n&&Nl(e),su(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ul(r),su(n);continue}if(r!==null&&r.memoizedState!==null){n&&Nl(e),su(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,tu=r):(n&&Wl(e),su(n))}}Ml=null}function su(e){for(;tu!==null;){var t=tu,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=pc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)rm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:rm(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=di(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=pi(a.default,a.update),a!==`none`&&Ll(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,tu=r;break}tu=t.return}}function cu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ou(e,n),r&4&&pl(5,n);break;case 1:if(Ou(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=pc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&hl(n),r&512&&_l(n,n.return);break;case 3:if(Ou(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{ho(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Al(n);case 26:case 5:Ou(e,n),t===null&&r&4&&wl(n),r&512&&_l(n,n.return);break;case 12:Ou(e,n);break;case 31:Ou(e,n),r&4&&_u(e,n);break;case 13:Ou(e,n),r&4&&vu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),lm(e,n))));break;case 22:if(r=n.memoizedState!==null||Xl,!r){var a=t!==null&&t.memoizedState!==null||Zl;t=Xl,i=Zl,Xl=r,(Zl=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Au(e,n,r)):Ou(e,n),Xl=t,Zl=i}break;case 30:Ou(e,n),r&512&&_l(n,n.return);break;case 7:r&512&&_l(n,n.return);default:Ou(e,n)}}function lu(e,t){for(e=e.child;e!==null;)uu(e,t),e=e.sibling}function uu(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){ff(e,e.return,t)}du(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,zt=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Tp(s,!0):Tp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&lu(e,t);break;default:lu(e,t)}}function du(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:uu(n,r);break a;case 22:n.memoizedState===null&&du(n,r);break a;default:du(n,r)}}e=e.sibling}}function fu(e){var t=e.alternate;t!==null&&(e.alternate=null,fu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wt(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 pu=null,mu=!1;function hu(e,t,n){for(n=n.child;n!==null;)gu(e,t,n),n=n.sibling}function gu(e,t,n){if(Ve&&typeof Ve.onCommitFiberUnmount==`function`)try{Ve.onCommitFiberUnmount(Be,n)}catch{}switch(n.tag){case 26:Zl||vl(n,t),hu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Zl&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Zl||vl(n,t),xl(n);var r=pu,i=mu;Cp(n.type)&&(pu=n.stateNode,mu=!1),hu(e,t,n),_m(n.stateNode,n.type,n.memoizedProps),pu=r,mu=i;break;case 5:Zl||vl(n,t),xl(n);case 6:if(n.tag===6&&xl(n),r=pu,i=mu,pu=null,hu(e,t,n),pu=r,mu=i,pu!==null){if(mu)try{(pu.nodeType===9?pu.body:pu.nodeName===`HTML`?pu.ownerDocument.body:pu).removeChild(n.stateNode),zt=!0}catch(e){ff(n,t,e)}else try{pu.removeChild(n.stateNode),zt=!0}catch(e){ff(n,t,e)}}break;case 18:pu!==null&&(mu?(e=pu,wp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Uh(e)):wp(pu,n.stateNode));break;case 4:r=pu,i=mu,pu=n.stateNode.containerInfo,mu=!0,hu(e,t,n),pu=r,mu=i;break;case 0:case 11:case 14:case 15:ml(2,n,t),Zl||ml(4,n,t),hu(e,t,n);break;case 1:Zl||(vl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&gl(n,t,r)),hu(e,t,n);break;case 21:hu(e,t,n);break;case 22:Zl=(r=Zl)||n.memoizedState!==null,hu(e,t,n),Zl=r;break;case 30:vl(n,t),hu(e,t,n);break;case 7:Zl||vl(n,t),hu(e,t,n);break;default:hu(e,t,n)}}function _u(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Uh(e)}catch(e){ff(t,t.return,e)}}}function vu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Uh(e)}catch(e){ff(t,t.return,e)}}function yu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new eu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new eu),t;default:throw Error(i(435,e.tag))}}function bu(e,t){var n=yu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function xu(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(Cp(l.type)){pu=l.stateNode,mu=!1;break a}break;case 5:pu=l.stateNode,mu=!1;break a;case 3:case 4:pu=l.stateNode.containerInfo,mu=!0;break a}l=l.return}if(pu===null)throw Error(i(160));gu(s,c,o),pu=null,mu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cu(t,e,n),t=t.sibling}var Su=null;function Cu(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}xu(t,e,n),wu(e),a&4&&(ml(3,e,e.return),pl(3,e),ml(5,e,e.return));break;case 1:xu(t,e,n),wu(e),a&512&&(Zl||r===null||vl(r,r.return)),a&64&&Xl&&(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=Su,xu(t,e,n),wu(e),a&512&&(Zl||r===null||vl(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(Xl)e.stateNode=pp(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[St]||r[ht]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),rp(r,t,n),r[ht]=e,kt(r),t=r;break a;case`link`:if(o=Km(`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),rp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Km(`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),rp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[ht]=e,kt(r),t=r}e.stateNode=t}}else Xl||qm(o,e.type,e.stateNode)}else e.stateNode=Vm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Tl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||Zl||t.parentNode.removeChild(t)):a.count--,n===null?Xl||qm(o,e.type,e.stateNode):Vm(o,n,e.memoizedProps))}break;case 27:xu(t,e,n),wu(e),a&512&&(Zl||r===null||vl(r,r.return)),r!==null&&a&4&&Tl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=Ql,Ql=!1,xu(t,e,n),Ql=o,wu(e),a&512&&(Zl||r===null||vl(r,r.return)),e.flags&32){t=e.stateNode;try{rn(t,``),zt=!0}catch(t){ff(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Tl(e,t,r===null?t:r.memoizedProps)),a&1024&&($l=!0);break;case 6:if(xu(t,e,n),wu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,zt=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(zt=!1,Gm=null,o=Su,Su=xm(t.containerInfo),xu(t,e,n),Su=o,wu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Uh(t.containerInfo)}catch(t){ff(e,e.return,t)}$l&&($l=!1,Tu(e)),zt=!1;break;case 4:a=Ql,Ql=Xl,r=Bt(),o=Su,Su=xm(e.stateNode.containerInfo),xu(t,e,n),wu(e),Su=o,zt&&ru&&(iu=!0),zt=r,Ql=a;break;case 12:xu(t,e,n),wu(e);break;case 31:xu(t,e,n),wu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,bu(e,t)));break;case 13:xu(t,e,n),wu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=je()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,bu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Xl,l=Zl,u=Ql;Xl=c||o,Ql=u||o,Zl=l||s,xu(t,e,n),Zl=l,Ql=u,Xl=c,wu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Xl||Zl||(t=s||Zl,n=Xl,r=Zl,Xl=o||Xl,Zl=t,ku(e,2),Xl=n,Zl=r),!o&&Ql||lu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,bu(e,n))));break;case 19:xu(t,e,n),wu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,bu(e,t)));break;case 30:a&512&&(Zl||r===null||vl(r,r.return)),a=Bt(),o=ru,s=(n&335544064)===n,c=e.memoizedProps,ru=s&&pi(c.default,c.update)!==`none`,xu(t,e,n),wu(e),s&&r!==null&&zt&&(e.flags|=4),ru=o,zt=a;break;case 21:break;case 7:a&512&&(Zl||r===null||vl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:xu(t,e,n),wu(e)}}function wu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(El(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Cl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Sl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;kl(e,Dl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(rn(l,``),n.flags&=-33),kl(e,Dl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ol(e,Dl(e),u,s);break;default:throw Error(i(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,_h=!0,t.reset(),_h=!1),e=e.sibling}}function Eu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Du(t,e),t=t.sibling;else Yl(t,!1)}function Du(e,t){var n=e.alternate;if(n===null)Vl(e,!1);else switch(e.tag){case 3:if(au=nu=!1,Fl(),Eu(t,e),!nu&&!iu){if(e=Pl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Dp(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`})),au=!0}Pl=null;break;case 5:Eu(t,e);break;case 4:r=nu,nu=!1,Eu(t,e),nu&&(iu=!0),nu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Eu(t,e):Vl(e,!1));break;case 30:r=nu,i=Fl(),nu=!1,Eu(t,e),nu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=di(a,o),o=di(n.memoizedProps,o);var s=pi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Il=0,t=Jl(e,n,t,o,s,a,!0),Il!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),Pl=i):i!==null&&(i.push.apply(i,Pl),Pl=i),nu=e.flags&32?!0:r;break;default:Eu(t,e)}}function Ou(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cu(e,t.alternate,t),t=t.sibling}function ku(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:ml(4,n,n.return),ku(n,r);break;case 1:vl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&gl(n,n.return,i),ku(n,r);break;case 27:r&2&&_m(n.stateNode,n.type,n.memoizedProps);case 5:vl(n,n.return),n.tag!==5&&n.tag!==27||xl(n),ku(n,r);break;case 6:xl(n);break;case 26:vl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||Zl||i.parentNode.removeChild(i),ku(n,r);break;case 22:n.memoizedState===null&&ku(n,r);break;case 30:vl(n,n.return),ku(n,r);break;case 7:vl(n,n.return);default:ku(n,r)}e=e.sibling}}function Au(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:Au(i,a,n),pl(4,a);break;case 1:if(Au(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(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++)mo(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&hl(a),_l(a,a.return);break;case 27:n&2&&Al(a);case 5:a.tag!==5&&a.tag!==27||bl(a),Au(i,a,n),s&&r===null&&o&4&&wl(a),_l(a,a.return);break;case 6:bl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Xl||qm(xm(c.ownerDocument),a.type,c),Au(i,a,n),s&&r===null&&o&4&&wl(a),_l(a,a.return);break;case 12:Au(i,a,n);break;case 31:Au(i,a,n),s&&o&4&&_u(i,a);break;case 13:Au(i,a,n),s&&o&4&&vu(i,a);break;case 22:a.memoizedState===null&&Au(i,a,n),_l(a,a.return);break;case 30:Au(i,a,n),_l(a,a.return);break;case 7:_l(a,a.return);default:Au(i,a,n)}t=t.sibling}}function ju(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&&Ta(n))}function Mu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ta(e))}function Nu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Pu(e,t,n,r),t=t.sibling;else i&&ql(t)}function Pu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Kl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Nu(e,t,n,r),a&2048&&pl(9,t);break;case 1:Nu(e,t,n,r);break;case 3:Nu(e,t,n,r),i&&au&&(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&&Ta(a)));break;case 12:if(a&2048){Nu(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){ff(t,t.return,e)}}else Nu(e,t,n,r);break;case 31:Nu(e,t,n,r);break;case 13:Nu(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&&Kl(t),o._visibility&2?Nu(e,t,n,r):(o._visibility|=2,Fu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Kl(s),o._visibility&2?Nu(e,t,n,r):Iu(e,t)),a&2048&&ju(s,t);break;case 24:Nu(e,t,n,r),a&2048&&Mu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(zl(a.child,!0),zl(t.child,!0))),Nu(e,t,n,r);break;default:Nu(e,t,n,r)}}function Fu(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:Fu(a,o,s,c,i),pl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Fu(a,o,s,c,i)):u._visibility&2?Fu(a,o,s,c,i):Iu(a,o),i&&l&2048&&ju(o.alternate,o);break;case 24:Fu(a,o,s,c,i),i&&l&2048&&Mu(o.alternate,o);break;default:Fu(a,o,s,c,i)}t=t.sibling}}function Iu(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:Iu(n,r),i&2048&&ju(r.alternate,r);break;case 24:Iu(n,r),i&2048&&Mu(r.alternate,r);break;default:Iu(n,r)}t=t.sibling}}var Lu=8192;function Ru(e,t,n){if(e.subtreeFlags&Lu)for(e=e.child;e!==null;)zu(e,t,n),e=e.sibling}function zu(e,t,n){switch(e.tag){case 26:Ru(e,t,n),e.flags&Lu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Qm(n,e)):$m(n,Su,e.memoizedState,e.memoizedProps));break;case 5:Ru(e,t,n),e.flags&Lu&&(e=e.stateNode,(t&335544128)===t&&Qm(n,e));break;case 3:case 4:var r=Su;Su=xm(e.stateNode.containerInfo),Ru(e,t,n),Su=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Lu,Lu=16777216,Ru(e,t,n),Lu=r):Ru(e,t,n));break;case 30:if((e.flags&Lu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ml===null&&(Ml=new Map),Ml.set(r,i)}Ru(e,t,n);break;default:Ru(e,t,n)}}function Bu(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 Vu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tu=r,Wu(r,e)}Bu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hu(e),e=e.sibling}function Hu(e){switch(e.tag){case 0:case 11:case 15:Vu(e),e.flags&2048&&ml(9,e,e.return);break;case 3:Vu(e);break;case 12:Vu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Uu(e)):Vu(e);break;default:Vu(e)}}function Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tu=r,Wu(r,e)}Bu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ml(8,t,t.return),Uu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Uu(t));break;default:Uu(t)}e=e.sibling}}function Wu(e,t){for(;tu!==null;){var n=tu;switch(n.tag){case 0:case 11:case 15:ml(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:Ta(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tu=r;else a:for(n=e;tu!==null;){r=tu;var i=r.sibling,a=r.return;if(fu(r),r===n){tu=null;break a}if(i!==null){i.return=a,tu=i;break a}tu=a}}}var Gu={getCacheForType:function(e){var t=_a(Ca),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return _a(Ca).controller.signal}},Ku=typeof WeakMap==`function`?WeakMap:Map,qu=0,Ju=null,Yu=null,Xu=0,Zu=0,Qu=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return qu&2&&Xu!==0?Xu&-Xu:U.T===null?ft():Nf()}function Ad(){if(sd===0){if(!(Xu&536870912)||q){var e=Je;Je<<=1,!(Je&3932160)&&(Je=262144),sd=e}else sd=536870912}return e=xo.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Fp(di(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Ju&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Id(e,Xu,sd,!1)),at(e,n),qu&2&&e===Ju||(e===Ju&&(!(qu&2)&&(ad|=n),rd===4&&Id(e,Xu,sd,!1)),Tf(e))}function Nd(e,t,n){if(qu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Qe(e,t),a=r?qd(e,t):Gd(e,t,!0),o=r;do{if(a===0){ed&&!r&&Id(e,t,0,!1);break}if(n=e.current.alternate,o&&!Fd(n))a=Gd(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=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,s).flags|=256),s=Gd(c,s,!1),s!==2&&s!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=o,ad|=o,a=4;break a}o=ud,ud=a,o!==null&&(ud===null?ud=o:ud.push.apply(ud,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){zd(e,0),Id(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:Id(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=fd+300-je(),10<a)){if(Id(r,t,sd,!$u),Ze(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=_p(Pd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,o,`Throttled`,-0,0),a);break a}Pd(r,n,ud,hd,dd,t,sd,ad,cd,$u,o,null,-0,0)}break}}while(1);Tf(e)}function Pd(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:fn},Ml=null,zu(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=rh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?fd-je():(a&4194048)===a?pd-je():0,m=th(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Id(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Fd(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(!Fr(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 Id(e,t,n,r){t=$e(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ue(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&st(e,n,t)}function Ld(){return qu&6?!0:(Ef(0,!1),!1)}function Rd(){if(Yu!==null){if(Zu===0)var e=Yu.return;else e=Yu,la=ca=null,Xo(e),Ya=null,Xa=0,e=Yu;for(;e!==null;)fl(e.alternate,e),e=e.return;Yu=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,vp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Rd(),Ju=e,Yu=n=Oi(e.current,null),Xu=t,Zu=0,Qu=null,$u=!1,ed=Qe(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=$e(e,t),vi(),n}function Bd(e,t){No=null,U.H=ac,t===Ba||t===Ha?(t=qa(),Zu=3):t===Va?(t=qa(),Zu=4):Zu=t===Cc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Qu=t,Yu===null&&(rd=1,_c(e,Ii(t,e.current)))}function Vd(){var e=xo.current;return e===null?!0:(Xu&4194048)===Xu?So===null:(Xu&62914560)===Xu||Xu&536870912?e===So:!1}function Hd(){var e=U.H;return U.H=ac,e===null?ac:e}function Ud(){var e=U.A;return U.A=Gu,e}function Wd(){rd=4,$u||(Xu&4194048)!==Xu&&xo.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Ju===null||Id(Ju,Xu,sd,!1)}function Gd(e,t,n){var r=qu;qu|=2;var i=Hd(),a=Ud();(Ju!==e||Xu!==t)&&(hd=null,zd(e,t)),t=!1;var o=rd;a:do try{if(Zu!==0&&Yu!==null){var s=Yu,c=Qu;switch(Zu){case 8:Rd(),o=6;break a;case 3:case 2:case 9:case 6:xo.current===null&&(t=!0);var l=Zu;if(Zu=0,Qu=null,Zd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Zu,Zu=0,Qu=null,Zd(e,s,c,l)}}Kd(),o=rd;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,la=ca=null,qu=r,U.H=i,U.A=a,Yu===null&&(Ju=null,Xu=0,vi()),o}function Kd(){for(;Yu!==null;)Yd(Yu)}function qd(e,t){var n=qu;qu|=2;var r=Hd(),a=Ud();Ju!==e||Xu!==t?(hd=null,md=je()+500,zd(e,t)):ed=Qe(e,t);a:do try{if(Zu!==0&&Yu!==null){t=Yu;var o=Qu;b:switch(Zu){case 1:Zu=0,Qu=null,Zd(e,t,o,1);break;case 2:case 9:if(X(o)){Zu=0,Qu=null,Xd(t);break}t=function(){Zu!==2&&Zu!==9||Ju!==e||(Zu=7),Tf(e)},o.then(t,t);break a;case 3:Zu=7;break a;case 4:Zu=5;break a;case 7:X(o)?(Zu=0,Qu=null,Xd(t)):(Zu=0,Qu=null,Zd(e,t,o,7));break;case 5:var s=null;switch(Yu.tag){case 26:s=Yu.memoizedState;case 5:case 27:var c=Yu;if(s?Xm(s):c.stateNode.complete){Zu=0,Qu=null;var l=c.sibling;if(l!==null)Yu=l;else{var u=c.return;u===null?Yu=null:(Yu=u,Qd(u))}break b}}Zu=0,Qu=null,Zd(e,t,o,5);break;case 6:Zu=0,Qu=null,Zd(e,t,o,6);break;case 8:Rd(),rd=6;break a;default:throw Error(i(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return la=ca=null,U.H=r,U.A=a,qu=n,Yu===null?(Ju=null,Xu=0,vi(),rd):0}function Jd(){for(;Yu!==null&&!ke();)Yd(Yu)}function Yd(e){var t=rl(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Qd(e):Yu=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Lc(n,t,t.pendingProps,t.type,void 0,Xu);break;case 11:t=Lc(n,t,t.pendingProps,t.type.render,t.ref,Xu);break;case 5:Xo(t);var r=t;r===Zi&&(q?(ra(r),r.tag===5&&r.stateNode!=null&&(K=r.stateNode)):(ra(r),q=!0));default:fl(n,t),t=Yu=ki(t,nd),t=rl(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Qd(e):Yu=t}function Zd(e,t,n,r){la=ca=null,Xo(t),Ya=null,Xa=0;var i=t.return;try{if(Sc(e,i,t,n,Xu)){rd=1,_c(e,Ii(n,e.current)),Yu=null;return}}catch(t){if(i!==null)throw Yu=i,t;rd=1,_c(e,Ii(n,e.current)),Yu=null;return}t.flags&32768?(q||r===1?e=!0:ed||Xu&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=xo.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,$u);return}e=t.return;var n=ul(t.alternate,t,nd);if(n!==null){Yu=n;return}if(t=t.sibling,t!==null){Yu=t;return}Yu=t=e}while(t!==null);rd===0&&(rd=5)}function $d(e,t){do{var n=dl(e.alternate,e);if(n!==null){n.flags&=32767,Yu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Yu=e;return}Yu=e=n}while(e!==null);rd=6,Yu=null}function ef(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(_d!==0);if(qu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Ju&&(Yu=Ju=null,Xu=0),yd=t,vd=e,bd=n,Sd=a,Cd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=_i,ot(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=Da(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(Fe,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),jl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=U.T,U.T=null,i=W.p,W.p=2,a=qu,qu|=4;try{ou(e,t,n)}finally{qu=a,W.p=i,U.T=r}}_d=1,jl?wd=Np(o,e.containerInfo,Ed,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function rf(){_d===3&&(_d=0,Du(yd,vd),_d=4)}function af(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=U.T,U.T=null;var i=W.p;W.p=2;var a=qu;qu|=4;try{ru=iu=!1,Cu(t,e,n),n=lp;var o=Vr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Br(s.ownerDocument.documentElement,s)){if(c!==null&&Hr(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 _=zr(s,h),v=zr(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}}_h=!!cp,lp=cp=null}finally{qu=a,W.p=i,U.T=r}}e.current=t,_d=2}}function of(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=U.T,U.T=null;var r=W.p;W.p=2;var i=qu;qu|=4;try{cu(e,t.alternate,t)}finally{qu=i,W.p=r,U.T=n}}_d=3}}function sf(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,Ae();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),dt(r),n=n.stateNode,Ve&&typeof Ve.onCommitFiberRoot==`function`)try{Ve.onCommitFiberRoot(Be,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=U.T,a=W.p,W.p=2,U.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{U.T=n,W.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=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);bd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ta(t)))}function lf(){return wd!==null&&(wd.skipTransition(),wd=null),af(),of(),sf(),uf()}function uf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=dt(bd),r=U.T,a=W.p;try{W.p=32>n?32:n,U.T=null,n=Sd,Sd=null;var o=vd,s=bd;if(_d=0,yd=vd=null,bd=0,qu&6)throw Error(i(331));var c=qu;if(qu|=4,Hu(o.current),Pu(o,o.current,s,n),qu=c,Ef(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{W.p=a,U.T=r,cf(e,t)}}function df(e,t,n){t=Ii(n,t),t=yc(e.stateNode,t,2),e=so(e,t,2),e!==null&&(at(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=Ii(n,e),n=bc(2),r=so(t,n,2),r!==null&&(xc(n,r,t,e),at(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ku;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)||(td=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ju===e&&(Xu&n)===n&&(rd===4||rd===3&&(Xu&62914560)===Xu&&300>je()-fd?qu&2?od|=n:zd(e,0):od|=n,cd===Xu&&(cd=0)),Tf(e)}function hf(e,t){t===0&&(t=tt()),e=xi(e,t),e!==null&&(at(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(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),hf(e,n)}function vf(e,t){return De(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;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-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Xu,a=Ze(r,r===Ju?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Qe(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&gp()&&(e=wf);for(var t=je(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}_d!==0&&_d!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ue(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ju,n=Xu,n=Ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Oe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Oe(r),dt(n)){case 2:case 8:n=Pe;break;case 32:n=Fe;break;case 268435456:n=Le;break;default:n=Fe}return r=Af.bind(null,e),n=De(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Oe(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Xu;return r=Ze(e,e===Ju?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nd(e,r,t),kf(e,je()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Nd(e,t,!0)}function Mf(){xp(function(){qu&6?De(Ne,Df):Of()})}function Nf(){if(wf===0){var e=Aa;e===0&&(e=qe,qe<<=1,!(qe&261888)&&(qe=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:dn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[gt]||null).action),o=r.submitter;o&&(t=(t=o[gt]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Nn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);Ks(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Ks(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<ci.length;If++){var Lf=ci[If];li(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}li(ei,`onAnimationEnd`),li(ti,`onAnimationIteration`),li(ni,`onAnimationStart`),li(`dblclick`,`onDoubleClick`),li(`focusin`,`onFocus`),li(`focusout`,`onBlur`),li(ri,`onTransitionRun`),li(ii,`onTransitionStart`),li(ai,`onTransitionCancel`),li(oi,`onTransitionEnd`),Pt(`onMouseEnter`,[`mouseout`,`mouseover`]),Pt(`onMouseLeave`,[`mouseout`,`mouseover`]),Pt(`onPointerEnter`,[`pointerout`,`pointerover`]),Pt(`onPointerLeave`,[`pointerout`,`pointerover`]),Nt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Nt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Nt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Nt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`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(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(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){mi(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){mi(e)}i.currentTarget=null,a=c}}}}function Vf(e,t){var n=t[vt];n===void 0&&(n=t[vt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,jt.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(wh(t)){case 2:var i=vh;break;case 8:i=yh;break;default:i=bh}n=i.bind(null,t,n,e),i=void 0,!Sn||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 Kf(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=Tt(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}yn(function(){var r=a,i=mn(n),s=[];a:{var c=si.get(e);if(c!==void 0){var l=Nn,u=e;switch(e){case`keypress`:if(On(n)===0)break a;case`keydown`:case`keyup`:l=Zn;break;case`focusin`:u=`focus`,l=Hn;break;case`focusout`:u=`blur`,l=Hn;break;case`beforeblur`:case`afterblur`:l=Hn;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=Bn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Vn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=er;break;case ei:case ti:case ni:l=Un;break;case oi:l=tr;break;case`scroll`:case`scrollend`:l=Fn;break;case`wheel`:l=nr;break;case`copy`:case`cut`:case`paste`:l=Wn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Qn;break;case`submit`:l=$n;break;case`toggle`:case`beforetoggle`:l=rr}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=bn(m,p),g!=null&&d.push(qf(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!==pn&&(u=n.relatedTarget||n.fromElement)&&(Tt(u)||u[_t]))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?Tt(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=Bn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Qn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Dt(c),h=l==null?u:Dt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Tt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,Yf):null,c!==null&&Xf(s,u,c,d,!1),l!==null&&f!==null&&Xf(s,f,l,d,!0)))}a:{if(c=r?Dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Cr;else if(_r(c)){if(wr)_=Nr;else{_=jr;var v=Ar}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&cn(r.elementType)&&(_=Cr):_=Mr;if(_&&=_(e,r)){vr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Dt(r):window,e){case`focusin`:(_r(v)||v.contentEditable===`true`)&&(Wr=v,Gr=r,Kr=null);break;case`focusout`:Kr=Gr=Wr=null;break;case`mousedown`:qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:qr=!1,Jr(s,n,i);break;case`selectionchange`:if(Ur)break;case`keydown`:case`keyup`:Jr(s,n,i)}var y;if(ar)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 pr?dr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(cr&&n.locale!==`ko`&&(pr||b!==`onCompositionStart`?b===`onCompositionEnd`&&pr&&(y=Dn()):(wn=i,Tn=`value`in wn?wn.value:wn.textContent,pr=!0)),v=Jf(r,b),0<v.length&&(b=new Gn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=fr(n),y!==null&&(b.data=y)))),(y=sr?mr(e,n):hr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new Gn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Ff(s,e,r,n,i)}Bf(s,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(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=bn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=bn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(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=bn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=bn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
9
+ `).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function tp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&rn(e,``+r);else return;break;case`className`:Ht(e,`class`,r);break;case`tabIndex`:Ht(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ht(e,n,r);break;case`style`:sn(e,r,o);return;case`data`:if(t!==`object`){Ht(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=dn(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`&&tp(e,t,`name`,a.name,a,null),tp(e,t,`formEncType`,a.formEncType,a,null),tp(e,t,`formMethod`,a.formMethod,a,null),tp(e,t,`formTarget`,a.formTarget,a,null)):(tp(e,t,`encType`,a.encType,a,null),tp(e,t,`method`,a.method,a,null),tp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=fn);return;case`onScroll`:r!=null&&Vf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Vf(`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=dn(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`:Vf(`beforetoggle`,e),Vf(`toggle`,e),Vt(e,`popover`,r);break;case`xlinkActuate`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Vt(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=ln.get(n)||n,Vt(e,n,r);else return}zt=!0}function np(e,t,n,r,a,o){switch(n){case`style`:sn(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`)rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)rn(e,``+r);else return;break;case`onScroll`:r!=null&&Vf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Vf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=fn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Mt.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[gt]||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}zt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Vt(e,n,r)}return}zt=!0}function rp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Vf(`error`,e),Vf(`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:tp(e,t,o,s,n,null)}}a&&tp(e,t,`srcSet`,n.srcSet,n,null),r&&tp(e,t,`src`,n.src,n,null);return;case`input`:Vf(`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:tp(e,t,r,d,n,null)}}Qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Vf(`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:tp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&en(e,!!r,n,!0):en(e,!!r,t,!1);return;case`textarea`:for(s in Vf(`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:tp(e,t,s,c,n,null)}nn(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:tp(e,t,l,r,n,null)}return;case`dialog`:Vf(`beforetoggle`,e),Vf(`toggle`,e),Vf(`cancel`,e),Vf(`close`,e);break;case`iframe`:case`object`:Vf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)Vf(Rf[r],e);break;case`image`:Vf(`error`,e),Vf(`load`,e);break;case`details`:Vf(`toggle`,e);break;case`embed`:case`source`:case`link`:Vf(`error`,e),Vf(`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:tp(e,t,u,r,n,null)}return;default:if(cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&np(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&tp(e,t,c,r,n,null))}var ip={};function ap(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)||tp(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&&(zt=!0),o=m;break;case`name`:m!==f&&(zt=!0),a=m;break;case`checked`:m!==f&&(zt=!0),u=m;break;case`defaultChecked`:m!==f&&(zt=!0),d=m;break;case`value`:m!==f&&(zt=!0),s=m;break;case`defaultValue`:m!==f&&(zt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&tp(e,t,p,m,r,f)}}Zt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||tp(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&&(zt=!0),p=o;break;case`defaultValue`:o!==l&&(zt=!0),c=o;break;case`multiple`:o!==l&&(zt=!0),s=o;default:o!==l&&tp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?en(e,!!n,n?[]:``,!1):en(e,!!n,t,!0)):en(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:tp(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&&(zt=!0),p=a;break;case`defaultValue`:a!==o&&(zt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&tp(e,t,s,a,r,o)}tn(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:tp(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&&(zt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:tp(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)&&tp(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:tp(e,t,u,p,r,m)}return;default:if(cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&np(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||np(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&tp(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||tp(e,t,f,p,r,m)}function op(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function sp(){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&&op(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&&op(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 cp=null,lp=null;function up(e){return e.nodeType===9?e:e.ownerDocument}function dp(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 fp(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 pp(e,t,n,r){return n=up(n).createElement(e),n[ht]=r,n[gt]=t,rp(n,e,t),kt(n),n}function mp(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 hp=null;function gp(){var e=window.event;return e&&e.type===`popstate`?e!==hp&&(hp=e,!0):(hp=null,!1)}var _p=typeof setTimeout==`function`?setTimeout:void 0,vp=typeof clearTimeout==`function`?clearTimeout:void 0,yp=typeof Promise==`function`?Promise:void 0,bp=typeof requestAnimationFrame==`function`?requestAnimationFrame:_p,xp=typeof queueMicrotask==`function`?queueMicrotask:yp===void 0?_p:function(e){return yp.resolve(null).then(e).catch(Sp)};function Sp(e){setTimeout(function(){throw e})}function Cp(e){return e===`head`}function wp(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),Uh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[St]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Uh(t)}function Tp(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 Ep(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 Dp(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 Op(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 kp(e){return Op(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ap(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Op(t,n,e)}function jp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Np(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`&&(jp(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+=Zm(f),u>eh){s.length=o;break}f=new Promise(Mp.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 Pp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Pp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pp.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},Pp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fp(e){return{name:e,group:new Pp(`group`,e),imagePair:new Pp(`image-pair`,e),old:new Pp(`old`,e),new:new Pp(`new`,e)}}function Ip(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ip.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(Vp(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=zp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Lp,e,s,r)}this._eventListeners=a}};function Lp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Ip.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Vp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=zp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Rp,e,n,i),r.splice(t,1),a!==null&&a()}};function Rp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function zp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Bp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Vp(e,t,n,r){if(e.length===0)return-1;r=Bp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Bp(a.optionsOrUseCapture)===r)return i}return-1}Ip.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(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,zp(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,zp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Ip.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag!==6&&(e=v(e),mm(e,t))}Ip.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Up,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Hp(t[n],e);n--);};function Up(e,t){return t.push(e),!1}Ip.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=up(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0))};function Wp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ip.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Ip.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Kp,e,void 0,void 0);for(var n=t=0;n<qp.length;n++){var r=qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):qp[t++]=r}qp.length=t}};function Kp(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var qp=[],Jp=!1;function Yp(e,t,n){qp.push({fragmentInstance:e,observer:t,instance:n}),Jp||(Jp=!0,hm(function(){Jp=!1;var e=qp;qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Ip.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Xp,e,void 0,void 0),e};function Xp(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=v(e),t.push.apply(t,e.getClientRects());return!1}Ip.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Ip.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Up,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(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=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(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=v(n[0]),i=v(n[n.length-1]);var a=h(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||Zp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zp(e,t,n,r,i){var a=Tt(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=m(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=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Qp(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)}Ip.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,Up,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),Qp(e,n);return}if(r=v(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=v(a),Qp(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=v(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function tm(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,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<qp.length;i++){var a=qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(qp[r++]=a)}qp.length=r,n.observe(e)}),em(e,t))}function nm(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,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Yp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(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`:rm(n),wt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(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[St])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=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(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 um(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 dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(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 mm(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 hm(e){bp(function(){bp(function(t){return e(t)})})}function gm(e,t,n){switch(t=up(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 _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&tp(e,t,r,null,ip,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===fn&&(e.onclick=null),wt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wt(e)}var ym=new Map,bm=new Set;function xm(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 Sm=W.d;W.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=Ld();return e||t}function wm(e){var t=Et(e);t!==null&&t.tag===5&&t.type===`form`?Js(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=Xt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),rp(t,`link`,e),kt(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Xt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Xt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Xt(n.imageSizes)+`"]`)):i+=`[href="`+Xt(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);rp(o,`link`,e),t===`style`&&(o[Ct]=!0,o.onload=o.onerror=function(){At(o)}),kt(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Xt(r)+`"][href="`+Xt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zm(e)}if(!ym.has(a)&&(e=T({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),rp(r,`link`,e),kt(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=Ot(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);kt(c),rp(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,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=Ot(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=T({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),kt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=Ot(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),kt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var a=(a=pe.current)?xm(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=Fm(n.href),t=Ot(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=Fm(n.href);var o=Ot(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(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.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},ym.set(e,o)),Rm(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=zm(n),t=Ot(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 Fm(e){return`href="`+Xt(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ct]){r.loading=1;return}}else t=e.createElement(`link`),t[Ct]=!0,t.onload=t.onerror=At.bind(null,t),rp(t,`link`,n),kt(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 zm(e){return`[src="`+Xt(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Xt(n.href)+`"]`);if(r)return t.instance=r,kt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),kt(r),rp(r,`style`,a),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Fm(n.href);var o=e.querySelector(Im(a));if(o)return t.state.loading|=4,t.instance=o,kt(o),o;r=Lm(n),(a=ym.get(a))&&Um(r,a),o=(e.ownerDocument||e).createElement(`link`),kt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),rp(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(a=e.querySelector(Bm(o)))?(t.instance=a,kt(a),a):(r=n,(a=ym.get(o))&&(r=T({},n),Wm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),kt(a),rp(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,Hm(r,n.precedence,e));return t.instance}function Hm(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 Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,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[St]||a[ht]||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 qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(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 Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(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=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,kt(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),kt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),rp(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=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*sp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.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=rh.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 ch={$$typeof:N,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function lh(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=rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rt(0),this.hiddenUpdates=rt(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 uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ei(3,null,null,t),e.current=a,a.stateNode=e,t=wa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},io(a),e}function dh(e){return e?(e=wi,e):wi}function fh(e,t,n,r,i,a){i=dh(i),r.context===null?r.context=i:r.pendingContext=i,r=oo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=so(e,r,t),n!==null&&(Md(n,e,t),co(n,e,t))}function ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mh(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function hh(e){if(e.tag===13||e.tag===31){var t=xi(e,67108864);t!==null&&Md(t,e,67108864),mh(e,67108864)}}function gh(e){if(e.tag===13||e.tag===31){var t=kd();t=ut(t);var n=xi(e,t);n!==null&&Md(n,e,t),mh(e,t)}}var _h=!0;function vh(e,t,n,r){var i=U.T;U.T=null;var a=W.p;try{W.p=2,bh(e,t,n,r)}finally{W.p=a,U.T=i}}function yh(e,t,n,r){var i=U.T;U.T=null;var a=W.p;try{W.p=8,bh(e,t,n,r)}finally{W.p=a,U.T=i}}function bh(e,t,n,r){if(_h){var i=xh(r);if(i===null)Kf(e,t,r,Sh,n),Nh(e,r);else if(Fh(i,e,t,n,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<Mh.indexOf(e)){for(;i!==null;){var a=Et(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Xe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ue(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(qu&6)&&(md=je()+500,Ef(0,!1))}}break;case 31:case 13:s=xi(a,2),s!==null&&Md(s,a,2),Ld(),mh(a,2)}if(a=xh(r),a===null&&Kf(e,t,r,Sh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function xh(e){return e=mn(e),Ch(e)}var Sh=null;function Ch(e){if(Sh=null,e=Tt(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 Sh=e,null}function wh(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(Me()){case Ne:return 2;case Pe:return 8;case Fe:case Ie:return 32;case Le:return 268435456;default:return 32}default:return 32}}var Th=!1,Eh=null,Dh=null,Oh=null,kh=new Map,Ah=new Map,jh=[],Mh=`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 Nh(e,t){switch(e){case`focusin`:case`focusout`:Eh=null;break;case`dragenter`:case`dragleave`:Dh=null;break;case`mouseover`:case`mouseout`:Oh=null;break;case`pointerover`:case`pointerout`:kh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ah.delete(t.pointerId)}}function Ph(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=Et(t),t!==null&&hh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fh(e,t,n,r,i){switch(t){case`focusin`:return Eh=Ph(Eh,e,t,n,r,i),!0;case`dragenter`:return Dh=Ph(Dh,e,t,n,r,i),!0;case`mouseover`:return Oh=Ph(Oh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kh.set(a,Ph(kh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ah.set(a,Ph(Ah.get(a)||null,e,t,n,r,i)),!0}return!1}function Ih(e){var t=Tt(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,pt(e.priority,function(){gh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,pt(e.priority,function(){gh(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 Lh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pn=r,n.target.dispatchEvent(r),pn=null}else return t=Et(n),t!==null&&hh(t),e.blockedOn=n,!1;t.shift()}return!0}function Rh(e,t,n){Lh(e)&&n.delete(t)}function zh(){Th=!1,Eh!==null&&Lh(Eh)&&(Eh=null),Dh!==null&&Lh(Dh)&&(Dh=null),Oh!==null&&Lh(Oh)&&(Oh=null),kh.forEach(Rh),Ah.forEach(Rh)}function Bh(e,n){e.blockedOn===n&&(e.blockedOn=null,Th||(Th=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zh)))}var Vh=null;function Hh(e){Vh!==e&&(Vh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vh===e&&(Vh=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(Ch(r||n)===null)continue;break}var a=Et(n);a!==null&&(e.splice(t,3),t-=3,Ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Uh(e){function t(t){return Bh(t,e)}Eh!==null&&Bh(Eh,e),Dh!==null&&Bh(Dh,e),Oh!==null&&Bh(Oh,e),kh.forEach(t),Ah.forEach(t);for(var n=0;n<jh.length;n++){var r=jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jh.length&&(n=jh[0],n.blockedOn===null);)Ih(n),n.blockedOn===null&&jh.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[gt]||null;if(typeof a==`function`)o||Hh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[gt]||null)s=o.formAction;else if(Ch(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hh(n)}}}function Wh(){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 Gh(e){this._internalRoot=e}Kh.prototype.render=Gh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fh(n,kd(),e,t,null,null)},Kh.prototype.unmount=Gh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fh(e.current,2,null,e,null,null),Ld(),t[_t]=null}};function Kh(e){this._internalRoot=e}Kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ft();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jh.length&&t!==0&&t<jh[n].priority;n++);jh.splice(n,0,e),n===0&&Ih(e)}};var qh=n.version;if(qh!==`19.3.1`)throw Error(i(527,qh,`19.3.1`));W.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:f(e),e=e===null?null:e.stateNode,e};var Jh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:U,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{Be=Yh.inject(Jh),Ve=Yh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=mc,s=hc,c=gc;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=uh(e,1,!1,null,null,n,r,null,o,s,c,Wh),e[_t]=t.current,Wf(e),new Gh(t)}})),ot=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=at()})),st=c(it(),1),ct=ot();function lt(e){return typeof e==`object`?e.key:e}function ut(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function dt(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return(o.length!==r.length||o.some((e,t)=>r[t]!==e))&&(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1),i}return o.updateDeps=e=>{r=e},o}function ft(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var pt=(e,t)=>Math.abs(e-t)<1.01,mt=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})};function ht({offset:e,isScrolling:t,elementMax:n,holdOffset:r,scrollOffset:i,pendingWrite:a,clampedMaxAtWrite:o}){return t&&a===null&&e===i?`spurious`:a!==null&&Math.abs(e-a.target)<1.5?`readBack`:a!==null&&!a.smooth&&n!==null&&a.target>n+r+.5&&Math.abs(e-(n+r))<1.5||a!==null&&!a.smooth&&a.lowMaxes?.some(t=>Math.abs(e-t)<1.5)?`clampedReadBack`:o!==null&&Math.abs(e-o)<1.5?`clampedEcho`:`external`}var gt=e=>e===`smooth`||e===`smoothFinishing`;function _t({kind:e,offset:t,command:n,target:r}){return e!==`spurious`&&e!==`readBack`&&e!==`clampedReadBack`&&n?.index!=null&&n.phase!==`queued`&&!gt(n.phase)&&!pt(t,n.lastTargetOffset)&&!pt(t,r())&&e!==`clampedEcho`}var vt=40;function yt(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<vt;)n--;if(n<0)return!1;let r=e[n],i=n-1;for(;i>=0&&r.t-e[i].t<vt;)i--;if(i<0)return!1;let a=e[i],o=(t.offset-r.offset)/(t.t-r.t),s=(r.offset-a.offset)/(r.t-a.t);return o*s>=0&&Math.abs(o)>=2*Math.abs(s)&&Math.abs(o)-Math.abs(s)>=.8}function bt(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<vt;)n--;if(n<0)return!1;let r=e[n];return Math.abs(t.offset-r.offset)/(t.t-r.t)>=.05}var xt,St=()=>{if(xt!==void 0)return xt;if(typeof navigator>`u`)return xt=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return xt=!0;let e=navigator.maxTouchPoints;return xt=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Ct,wt=()=>Ct===void 0?Ct=St()&&typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`overflow-anchor: auto`):Ct,Tt=()=>!St()||wt(),Et={capture:!0,passive:!0},Dt=class{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!==`lateFling`,this.dragging=()=>this._touch?.phase===`down`&&this._touch.moved,this.tail=()=>this._touch?.phase===`tail`?this._touch.moved?`fling`:`tap`:null,this.onScroll=({isScrolling:e,ownReadBack:t,moved:n,external:r})=>(e&&this._touch?.phase===`tail`?this._openTail(this._touch.moved||!t,!1):this._touch?.phase===`lateFling`&&(this.host.now()>this._touch.until?this._touch=null:r&&e&&n&&this._openTail(!0,!1)),!t&&e&&n&&this._touch?.phase===`down`?(this._touch.moved=!0,!0):!1),this.touchStart=()=>{this.end(),this._touch={phase:`down`,moved:!1}},this.touchEnd=()=>{let e=this._touch?.phase===`down`&&this._touch.moved;this.end(),this._openTail(e,e)},this.end=()=>{let e=this.host.getWindow();this._touch?.phase===`tail`&&e!=null&&e.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),n=()=>this.touchEnd();return e.addEventListener(`touchstart`,t,Et),e.addEventListener(`touchend`,n,Et),e.addEventListener(`touchcancel`,n,Et),()=>{e.removeEventListener(`touchstart`,t,Et),e.removeEventListener(`touchend`,n,Et),e.removeEventListener(`touchcancel`,n,Et),this.end()}},this._openTail=(e,t)=>{let n=this.host.getWindow();if(n==null)return;this.end();let r={phase:`tail`,moved:e,awaitingFling:t,timerId:n.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(r.moved,r.awaitingFling):(this._touch=r.awaitingFling?{phase:`lateFling`,until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=r}}get touch(){return this._touch}},Ot=e=>{let{clientWidth:t,clientHeight:n}=e;return{width:t,height:n}},kt=e=>{let t=new Set;return{schedule:n=>{let r=e.requestAnimationFrame(()=>{t.delete(r),n()});t.add(r)},cancel:()=>{t.forEach(t=>e.cancelAnimationFrame(t)),t.clear()}}},At=e=>e,jt=e=>{let t=e.overscan*Math.max(e.lanes??1,1),n=Math.max(e.startIndex-t,0),r=Math.min(e.endIndex+t,e.count-1)-n+1,i=Array(r);for(let e=0;e<r;e++)i[e]=n+e;return i},Mt=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Ot(n)),!r.ResizeObserver)return()=>{};let a=kt(r),o=new r.ResizeObserver(()=>{let t=()=>{i(Ot(n))};e.options.useAnimationFrameWithResizeObserver?a.schedule(t):t()});return o.observe(n,{box:`content-box`}),()=>{o.unobserve(n),a.cancel()}},Nt={passive:!0},Pt=typeof window>`u`||`onscrollend`in window,Ft=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Pt,o=0,s=a?null:mt(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Nt),a&&r.addEventListener(`scrollend`,u,Nt),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},It=(e,t)=>Ft(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Lt=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Rt=(e,{adjustments:t=0,behavior:n},r)=>{var i;let{scrollElement:a,options:o}=r,s=e+t,c=o.horizontal&&o.isRtl&&a!==null&&`ownerDocument`in a;(i=a?.scrollTo)==null||i.call(a,{[o.horizontal?`left`:`top`]:c?-s:s,behavior:n})},zt=(e,t)=>e===`smooth`?t?`smoothLanded`:`smooth`:`instant`,Bt=e=>e?.phase===`smooth`||e?.phase===`smoothLanded`;function Vt(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var Ht=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new Dt({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if(e?.phase!==`queued`||this.pendingWrite!==null)return!1;let t=this._readElementOffset();return t===null||this._lastElementOffset===null||Math.abs(t-this._lastElementOffset)<1?!1:(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;e?.phase===`queued`&&bt(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand(),this._retryClampedAdjustment()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=null,n=!1,r=!1,i=new Set,a=()=>{if(e)return e;let r=this.targetWindow;if(!r||!r.ResizeObserver)return null;let i=t=kt(r);return e=new r.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(o)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment(),this.measureElement(null))}};if(this.options.useAnimationFrameWithResizeObserver)i.schedule(t);else{n=!0;try{t()}finally{n=!1}}})},o=e=>{let t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};return{disconnect:()=>{var n;(n=a())==null||n.disconnect(),t?.cancel(),i.clear(),r=!1,e=null,t=null},observe:o=>{let s=a();s&&(n?(i.add(o),r||(r=!0,t?.schedule(()=>{r=!1,i.forEach(t=>{t.isConnected&&e?.observe(t,{box:`border-box`})}),i.clear()}))):s.observe(o,{box:`border-box`}))},unobserve:e=>{var t;i.delete(e),(t=a())==null||t.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:At,rangeExtractor:jt,onChange:()=>{},measureElement:Lt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>lt(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||Vt(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:s}=this.options,c=0;for(;c<a&&s(c)!==e;)c++;if(c<a){let e=n[c];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(o=n-this.scrollOffset,this.scrollOffset=n)}}}i?this.pendingScrollAnchor={kind:`follow`,behavior:i}:o!==null&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:`anchor`,delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=dt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,(e=this._momentumStop)==null||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{let n=t?this._elementMaxScrollOffset():null,r=this._reportedOverscroll;this._reportedOverscroll=e<0||n!==null&&e>n+1;let i=e;this._lastElementOffset=i,e=this._toLayoutOffset(e);let a=this._classifyScrollEvent(e,t,n);if(a===`spurious`)return;a===`readBack`?e=this.pendingWrite.target:a===`clampedReadBack`&&this.scrollState?.index!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:_t({kind:a,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let o=this.getScrollOffset(),s=this.scrollDirection;this.scrollDirection=t?o===e?this.scrollDirection:o<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t;let c=this.scrollState;if(c?.phase===`queued`&&a===`external`&&t){if(r||this._reportedOverscroll)c.samples=[];else{let e=this.now();c.samples=[...(c.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:i}],(s!==null&&this.scrollDirection!==s||yt(c.samples))&&(this.scrollState=null)}}this._iosGesture.onScroll({isScrolling:t,ownReadBack:a===`readBack`,moved:e!==o,external:a===`external`&&this.scrollState?.phase!==`smooth`&&this.scrollState?.phase!==`smoothFinishing`})&&this.scrollState?.phase===`queued`&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let t=this.pendingScrollAnchor;this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled&&(t.kind===`anchor`?this._canWriteScroll()?Bt(this.scrollState)&&!pt(this.getScrollOffset()-t.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(t.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=t.delta,this._followOffsetTarget(t.delta),this.notify(!1)):this.scrollToEnd({behavior:t.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,n)=>ht({offset:e,isScrolling:t,elementMax:n,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:this._clampedAdjustment?.maxAtWrite??null}),this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled||!this._canWriteScroll())return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(e===null||e.phase!==`queued`)return;let{behavior:t}=e;this.getMeasurements();let n=this.getScrollStateTarget(e);e.lastTargetOffset=n,this._clampedAdjustment=null,e.phase=zt(t,e.index!=null&&pt(n,this.getScrollOffset())),this._scrollToOffset(n,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(e==null)return null;let{horizontal:t,isRtl:n}=this.options;return typeof e.scrollTop==`number`?t?e.scrollLeft*(n&&-1||1):e.scrollTop:typeof e.scrollY==`number`?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(St()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{if(this._holdOffset===0||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||this.scrollState?.phase===`smooth`)return;this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let t=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(t),this._scrollToOffset(t)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=dt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=dt(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=ut(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=dt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes,this._getLayoutTotalSize()+this.options.scrollMargin],(e,t,n,r,i)=>{if(e.length===0||t===0)return this.range=null,null;let a=Math.max(i-t,0);return this.range=Gt(e,t,Math.min(n,a),r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=dt(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,n,r,i,a)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n,lanes:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!Bt(this.scrollState))return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n;if(!this.isIndexInRange(e))return;this._resizeBatch?.sync&&this.getMeasurements();let r,i,a,o=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&o!=null)a=this.options.getItemKey(e),i=o[e*2],r=o[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;a=t.key,i=t.start,r=t.size}let s=this.itemSizeCache.get(a)??r,c=t-s;if(c!==0){let o=this.options.anchorTo===`end`&&!Bt(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,l=o?this._getLayoutTotalSize():0,u=this.getScrollOffset(),d=this.itemSizeCache.has(a)?i+s<=u&&this.scrollDirection!==`backward`:i<u,f=!Bt(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?d:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:a,start:i,size:r,end:i+r,lane:0},c,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(a,t),this.itemSizeCacheVersion++;let p=!1;if(this._awaitingCommandReadBack()||(o?p=this.applyScrollAdjustment(this._getLayoutTotalSize()-l):f&&(p=this.applyScrollAdjustment(c))),this._resizeBatch){this._resizeBatch.notify=!0,(n=this._resizeBatch).sync||(n.sync=p);return}this.notify(p),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=dt(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,n)=>{let r=[];for(let i=0,a=e.length;i<a;i++){let a=t[e[i]];r.push(n===0?a:{...a,start:a.start-n,end:a.end-n})}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return ft(t[Ut(0,t.length-1,r?e=>n[e*2]:e=>ft(t[e]).start,e)])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(e===null)return;let t=this.pendingWrite,n=Math.max(e,0)+this._holdOffset;if(n>=t.target)return;let r=t.lowMaxes??=[];r[r.length-1]!==n&&r.push(n)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{let t=e+this._holdOffset;return this.pendingScrollAnchor?.kind===`anchor`&&(t+=this.pendingScrollAnchor.delta),t},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(e===null)return null;if(`scrollHeight`in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(`document`in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,n=this.targetWindow;if(t===null||n===null)return;let r=`document`in t?t.document.scrollingElement:t;if(!r?.style)return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:i}=r,a=this.options.horizontal?`overflow-x`:`overflow-y`,o=i.getPropertyValue(a),s=i.getPropertyPriority(a),c=()=>this.options.horizontal?r.clientHeight:r.clientWidth,l=c();if(i.setProperty(a,`hidden`,`important`),c()!==l){i.setProperty(a,o,s);return}let u={restore:()=>i.getPropertyValue(a)!==`hidden`||i.getPropertyPriority(a)!==`important`?!1:(i.setProperty(a,o,s),!0),done:e};this._momentumStop=u,n.requestAnimationFrame(()=>n.requestAnimationFrame(()=>{this._momentumStop===u&&(this._momentumStop=null,u.restore()&&u.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(t===null)return null;let n=t+this._holdOffset;return e>n+.5?{target:e,maxAtWrite:n}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()+this.options.scrollMargin-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.getMeasurements()[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1){let e=this.getMaxScrollOffset(),n=e-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(n,e),0),t]}let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),n,`absolute`)},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r;this._startScroll({index:e,align:a},i,n,`absolute`)},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,`start`);this._startScroll({index:null,align:`start`},n,t,`relative`)},this.scrollToEnd=({behavior:e=`auto`}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:`end`,toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,`absolute`):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n}={})=>{let r={target:e+(t??0),smooth:n===`smooth`};return this.pendingWrite=r,this.options.scrollToFn(e-this._holdOffset,{behavior:n,adjustments:t},this),r},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(St()&&this._iosGesture.dragging())&&e!==null&&!pt(e,this.getScrollOffset())},this._followOffsetTarget=e=>{this.scrollState!==null&&this.scrollState.index==null&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(e===0)return!1;if(this._followOffsetTarget(e),this._canWriteScroll()){let n=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(n+e);let r=this._scrollToOffset(n,{adjustments:e,behavior:t});return this.scrollOffset!==null&&(this.pendingWrite===r&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}return this._holdOffset+=e,this.scrollOffset!==null&&(this.scrollOffset+=e),!0}scheduleScrollReconcile(){this.targetWindow?this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}):this.scrollState=null}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:e.index==null?void 0:this.getOffsetForIndex(e.index,e.align);return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if(this.scrollState.phase===`queued`){this.scheduleScrollReconcile();return}this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,n=e!==this.scrollState.lastTargetOffset;if(!n&&pt(e,this.getScrollOffset())){if(this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothLanded`:this.scrollState.phase===`smoothFinishing`&&(this.scrollState.phase=`instant`),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let t=this.getSize()||600,n=Math.abs(e-this.getScrollOffset()),r=Bt(this.scrollState)&&n>t;this.scrollState.lastTargetOffset=e,r?this.scrollState.phase=`smooth`:this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothFinishing`:this.scrollState.phase===`smoothLanded`&&(this.scrollState.phase=`instant`),this._scrollToOffset(e,{behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){this.pendingScrollAnchor=null,this._clampedAdjustment=null;let i=this._iosGesture.tail();if(r===`absolute`&&i!==null){if(i===`fling`&&Tt()){this._stopMomentum(()=>{this.scrollState?.phase!==`queued`||this._iosGesture.tail()!==`fling`||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:`queued`,behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:zt(n,e.index!=null&&pt(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}},Ut=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Wt(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function Gt(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=Wt(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=Ut(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var Kt=typeof document<`u`?p.useLayoutEffect:p.useEffect;function qt({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=p.useReducer(e=>e+1,0)[1],a=p.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=p.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=(e,t,n)=>{let r=a.current,i=!!e.options.horizontal,o=t.start-e.options.scrollMargin;r.lastPositions.get(n)!==o&&(r.lastPositions.set(n,o),r.mode===`transform`?n.style.transform=i?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:n.style[i?`left`:`top`]=`${o}px`)},l=e=>{let t=a.current;if(t.enabled&&t.container){s(e);for(let t of e.getVirtualItems()){let n=e.elementsCache.get(t.key);n&&c(e,t,n)}}},u={...r,onChange:(t,n)=>{var s;let c=a.current,u=!0;if(c.enabled){l(t);let e=t.range,n=c.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,st.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[d]=p.useState(()=>{let e=new Ht(u),t=e.measureElement;return e.measureElement=n=>{o.current=!0;try{t(n)}finally{o.current=!1}let r=a.current;if(n!==null&&r.enabled&&r.container){let t=e.measurementsCache[e.indexFromElement(n)];t&&c(e,t,n)}},Object.assign(e,{containerRef:t=>{let n=a.current;n.container=t,n.lastSize=null,t!==null&&l(e)}})});return d.setOptions(u),Kt(()=>d._didMount(),[]),Kt(()=>(s(d),d._willUpdate())),Kt(()=>{l(d)}),d}function Jt(e){return qt({observeElementRect:Mt,observeElementOffset:It,scrollToFn:Rt,...e})}function Yt(e){return encodeURIComponent(String(e))}function Xt(e){let t=[];for(let[n,r]of Object.entries(e))if(r!=null){if(Array.isArray(r))for(let e of r)t.push(`${Yt(n)}[]=${Yt(e)}`);else if(typeof r==`object`)for(let[e,i]of Object.entries(r))i!=null&&t.push(`${Yt(n)}[${Yt(e)}]=${Yt(i)}`);else t.push(`${Yt(n)}=${Yt(r)}`)}return t.join(`&`)}function Zt(e){let t=[];return Qt(e,`where`,t),t.join(`&`)}function Qt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r],a=`${t}[${r}]`;if(n.push(`${a}[field]=${Yt(i.field)}`),n.push(`${a}[operator]=${Yt(i.operator)}`),i.value!==void 0){if(Array.isArray(i.value))for(let e=0;e<i.value.length;e++)n.push(`${a}[value][${e}]=${Yt(i.value[e])}`);else n.push(`${a}[value]=${Yt(i.value)}`)}i.AND&&i.AND.length>0&&Qt(i.AND,`${a}[AND]`,n),i.OR&&i.OR.length>0&&Qt(i.OR,`${a}[OR]`,n)}}var $t=[`equals`,`notEquals`,`contains`,`notContains`,`iContains`,`startsWith`,`endsWith`,`gt`,`gte`,`lt`,`lte`,`between`,`notBetween`,`in`,`notIn`,`isAnyOf`,`isEmpty`,`isNotEmpty`,`isNull`,`isNotNull`,`exists`,`notExists`],en=[`equals`,`notEquals`,`gt`,`gte`,`lt`,`lte`],tn=[`contains`,`notContains`,`iContains`,`startsWith`,`endsWith`],nn=[`in`,`notIn`,`isAnyOf`],rn=[`between`,`notBetween`],an=[`isNull`,`isNotNull`,`isEmpty`,`isNotEmpty`,`exists`,`notExists`],on=[`gt`,`gte`,`lt`,`lte`],sn=new Set(en),cn=new Set(tn),ln=new Set(nn),un=new Set(rn),dn=new Set(an),fn=new Set(on);function pn(e,t){if(dn.has(e)){if(t!=null)throw Error(`Operator "${e}" does not accept a value.`)}else if(cn.has(e)){if(typeof t!=`string`)throw Error(`Operator "${e}" expects a string value.`)}else if(un.has(e)){if(!Array.isArray(t)||t.length!==2)throw Error(`Operator "${e}" expects [low, high] tuple.`)}else if(ln.has(e)){if(!Array.isArray(t))throw Error(`Operator "${e}" expects an array value.`)}else if(sn.has(e)&&Array.isArray(t))throw Error(`Operator "${e}" expects a scalar value, not an array. Use "in" for arrays.`)}function mn(e){if(!fn.has(e))throw Error(`Operator "${e}" should use where() (replace), not add(). add() is for range operators (gt, gte, lt, lte) on the same field.`)}var hn=class e{conditions=[];groups=[];extra={};includes=[];searchTerm;sorts=[];distinctFields=[];groupByCountSpec;pagination;version=0;snapshot=null;listeners=new Set;where(e,t,n){if(this.conditions=this.conditions.filter(t=>t.field!==e),n!==void 0){let r=t;pn(r,n),this.conditions.push({field:e,operator:r,value:n})}else Array.isArray(t)?this.conditions.push({field:e,operator:`in`,value:t}):typeof t==`string`&&[`isNull`,`isNotNull`,`isEmpty`,`isNotEmpty`,`exists`,`notExists`].includes(t)?(pn(t,void 0),this.conditions.push({field:e,operator:t,value:void 0})):this.conditions.push({field:e,operator:`equals`,value:t});return this.notify(),this}whereDynamic(e,t,n){if(!$t.includes(t))throw Error(`Unknown filter operator "${String(t)}".`);return pn(t,n),this.conditions=this.conditions.filter(t=>t.field!==e),this.conditions.push({field:e,operator:t,value:dn.has(t)?void 0:n}),this.notify(),this}add(e,t,n){return mn(t),pn(t,n),this.conditions.push({field:e,operator:t,value:n}),this.notify(),this}remove(e){return this.conditions=this.conditions.filter(t=>t.field!==e),this.notify(),this}clear(){return this.conditions=[],this.groups.length=0,this.extra={},this.includes=[],this.searchTerm=void 0,this.sorts=[],this.distinctFields=[],this.groupByCountSpec=void 0,this.pagination=void 0,this.notify(),this}or(t){let n=new e;return t(n),this.groups.push({type:`OR`,conditions:n.conditions}),this.notify(),this}and(t){let n=new e;return t(n),this.groups.push({type:`AND`,conditions:n.conditions}),this.notify(),this}equals(e,t){return this.where(e,`equals`,t)}notEquals(e,t){return this.where(e,`notEquals`,t)}contains(e,t){return this.where(e,`contains`,t)}in(e,t){return this.where(e,`in`,t)}notIn(e,t){return this.where(e,`notIn`,t)}between(e,t,n){return this.where(e,`between`,[t,n])}gt(e,t){return this.where(e,`gt`,t)}gte(e,t){return this.where(e,`gte`,t)}lt(e,t){return this.where(e,`lt`,t)}lte(e,t){return this.where(e,`lte`,t)}isNull(e){return this.where(e,`isNull`)}isNotNull(e){return this.where(e,`isNotNull`)}isEmpty(e){return this.where(e,`isEmpty`)}isNotEmpty(e){return this.where(e,`isNotEmpty`)}startsWith(e,t){return this.where(e,`startsWith`,t)}endsWith(e,t){return this.where(e,`endsWith`,t)}addGte(e,t){return this.add(e,`gte`,t)}addLte(e,t){return this.add(e,`lte`,t)}addGt(e,t){return this.add(e,`gt`,t)}addLt(e,t){return this.add(e,`lt`,t)}set(e,t){return this.extra[e]=t,this.notify(),this}include(...e){for(let t of e)typeof t==`string`&&(this.includes.includes(t)||this.includes.push(t));return this.notify(),this}search(e){return typeof e==`string`&&(this.searchTerm=e,this.notify()),this}distinct(...e){for(let t of e)typeof t==`string`&&(this.distinctFields.includes(t)||this.distinctFields.push(t));return this.notify(),this}groupByCount(e,t={}){return typeof e==`string`&&e!==``&&(this.groupByCountSpec={field:e,...t.limit!==void 0&&{limit:t.limit},...t.offset!==void 0&&{offset:t.offset},...t.search!==void 0&&{search:t.search}}),this.notify(),this}sort(e,t=`asc`){return this.sorts=this.sorts.filter(t=>t.field!==e),this.sorts.push({field:e,direction:t}),this.notify(),this}sortDynamic(e,t=`asc`){return this.sort(e,t)}sortDesc(e){return this.sort(e,`desc`)}sortAsc(e){return this.sort(e,`asc`)}page(e,t=25){return this.pagination={page:e,size:t},this.notify(),this}notify(){this.version++,this.snapshot=null;for(let e of this.listeners)e()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>(this.snapshot===null&&(this.snapshot=this.build()),this.snapshot);getVersion(){return this.version}build(){let e=[];for(let t of this.conditions)e.push({field:t.field,operator:t.operator,value:t.value});for(let t of this.groups){let n=t.conditions.map(e=>({field:e.field,operator:e.operator,value:e.value}));t.type===`OR`?e.push({field:``,operator:`equals`,value:void 0,OR:n}):e.push({field:``,operator:`equals`,value:void 0,AND:n})}let t={...this.extra,filter:{where:e}};return this.includes.length>0&&(t.include=[...this.includes]),this.searchTerm!==void 0&&(t.search=this.searchTerm),this.sorts.length>0&&(t.sort=[...this.sorts]),this.distinctFields.length>0&&(t.distinct=[...this.distinctFields]),this.groupByCountSpec!==void 0&&(t.groupByCount={...this.groupByCountSpec}),this.pagination!==void 0&&(t.paginate={...this.pagination}),t}toQueryString(){let e=[],t;if(this.groups.length===0){let e=this.toFlatObject();t=Xt(Object.fromEntries(Object.entries(e).map(([e,t])=>[`filter[${e}]`,t])))}else t=Zt(this.build().filter.where);if(t&&e.push(t),this.includes.length>0&&e.push(`include=${encodeURIComponent(this.includes.join(`,`))}`),this.searchTerm!==void 0&&e.push(`search=${encodeURIComponent(this.searchTerm)}`),this.sorts.length>0){let t=this.sorts.map(e=>e.direction===`desc`?`-${e.field}`:e.field).join(`,`);e.push(`sort=${encodeURIComponent(t)}`)}if(this.distinctFields.length>0&&e.push(`distinct=${encodeURIComponent(this.distinctFields.join(`,`))}`),this.groupByCountSpec!==void 0){let{field:t,limit:n,offset:r,search:i}=this.groupByCountSpec,a=[[`groupByCount[field]`,t]];n!==void 0&&a.push([`groupByCount[limit]`,n]),r!==void 0&&a.push([`groupByCount[offset]`,r]),i!==void 0&&a.push([`groupByCount[search]`,i]);let o=Xt(Object.fromEntries(a));o&&e.push(o)}this.pagination!==void 0&&(e.push(`page=${encodeURIComponent(String(this.pagination.page))}`),e.push(`size=${encodeURIComponent(String(this.pagination.size))}`));let n=Xt(this.extra);return n&&e.push(n),e.join(`&`)}toFlatObject(){let e={};for(let t of this.conditions)if(t.operator===`equals`)e[t.field]=t.value;else if(t.operator===`in`)e[t.field]=t.value;else{let n=e[t.field];typeof n==`object`&&n&&!Array.isArray(n)?n[t.operator]=t.value:e[t.field]={[t.operator]:t.value}}return e}},gn=new Set([`eq`,`ne`,`gt`,`gte`,`lt`,`lte`,`in`]);function _n(e,t,n){if(n!==void 0){if(Array.isArray(n)){if(n.length===0)return;e.where(t,n.length===1?n[0]:n)}else n!==``&&e.where(t,n)}}function vn(e,t={},n){let r=new hn;_n(r,`status`,e.status),_n(r,`workflow`,e.workflow),_n(r,`tag`,e.tag),_n(r,`namespace`,e.namespace),e.origin&&r.where(`origin`,e.origin);let i=[];for(let t of e.attr??[]){let[e,n,...r]=t.split(`:`);e&&gn.has(n??``)&&r.length!==0&&i.push(t)}return i.length>0&&r.where(`attr`,i.length===1?i[0]:i),t.page!==void 0&&r.set(`page`,t.page),t.size!==void 0&&r.set(`size`,t.size),n&&r.groupByCount(n.field,{...n.limit!==void 0&&{limit:n.limit},...n.offset!==void 0&&{offset:n.offset},...n.search?.trim()&&{search:n.search.trim()}}),r.toQueryString()}function yn(e){if(typeof e==`object`&&e&&`durationMs`in e){let t=e.durationMs;if(typeof t==`number`)return t}}function bn(e){let t=new Map,n=[];for(let r of e){let e=r.subId??r.name??r.process;if(e===void 0){n.push(r);continue}let i=t.get(e),a=i??{id:e,name:r.name??e,phases:[],logs:[]};i||t.set(e,a),r.name!==void 0&&(a.name=r.name),r.group!==void 0&&(a.group=r.group),r.status===void 0?r.phase===void 0?a.logs.push(r):a.phases.push(r):(a.terminal=r,a.status=r.status)}return{subs:[...t.values()].map(e=>{let t=[...e.phases,...e.logs],n=[...t,...e.terminal?[e.terminal]:[]].map(e=>e.at),r=n.length?n.reduce((e,t)=>t<e?t:e,1/0):void 0,i=yn(e.terminal?.data)??(e.terminal&&r!==void 0&&t.length>0?e.terminal.at-r:void 0);return{...e,startedAt:r,durationMs:i}}),stepLogs:n}}var xn={kind:`all`};function Sn(e){return e?.trim()||void 0}function Cn(e){return Sn(e)===void 0}function wn(e){let t=Sn(e);if(t===void 0)return`app`;let n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)||t}function Tn(e,t){return e.kind===t.kind?e.kind===`origin`&&t.kind===`origin`?e.origin===t.origin:!0:!1}function En(e){return e.kind===`origin`?`origin:${e.origin}`:e.kind}function Dn(e,t){if(t.kind===`all`)return!0;let n=Sn(e.origin);return t.kind===`unknown`?n===void 0:n===t.origin}function On(e,t){return t.kind===`all`?[...e]:e.filter(e=>Dn(e,t))}var kn=`The app's own workflows: runs with no package origin, i.e. not declared by any library.`;function An(e){let t=new Map,n=0;for(let r of e){let e=Sn(r.origin);e===void 0?n+=1:t.set(e,(t.get(e)??0)+1)}let r=[{filter:xn,label:`all`,title:`Every origin, including runs that have none`,count:e.length}];for(let e of[...t.keys()].sort())r.push({filter:{kind:`origin`,origin:e},label:wn(e),title:e,count:t.get(e)??0});return n>0&&r.push({filter:{kind:`unknown`},label:`app`,title:kn,count:n}),r}function jn(e){return e.some(e=>Sn(e.origin)!==void 0)}function Mn(e){return e.reduce((e,t)=>e+ +!!Cn(t.origin),0)}function Nn(e){return e.anyFilter?e.origin.kind===`unknown`?{message:e.unknownCount>0?`No app runs match the other filters.`:`Every run here comes from a package — none are the app's own.`}:e.origin.kind===`origin`&&e.unknownCount>0?{message:`No runs from ${wn(e.origin.origin)} match these filters.`,unclassified:e.unknownCount}:{message:`No runs match these filters.`}:{message:`No runs yet.`}}function Pn(e){return e.startsWith(`compensate:`)?e.slice(11):e}function Fn(e){let t=[],n=[];for(let r of e)r.seq<0?n.push(r):t.push(r);return n.sort((e,t)=>t.seq-e.seq),{body:t,compensations:n}}function In(e){let t=0,n=0,r=0;for(let i of e)i.status===`completed`?t++:i.status===`failed`?n++:r++;return{total:e.length,done:t,failed:n,pending:r}}var Ln=`update:`,Rn=`task:`,zn=`child:`,Bn=`runwait:`,Vn=[`bp:`,`breakpoint`];function Hn(e,t){let n=e.slice(t.length),r=n.indexOf(`:`);if(r===-1)return;let i=n.slice(r+1);return i.length>0?i:void 0}function Un(e){if(!Vn.some(t=>e.startsWith(t))&&!(e.startsWith(zn)||e.startsWith(Bn))){if(e.startsWith(Ln)){let t=Hn(e,Ln);if(t!==void 0)return{kind:`update`,token:e,name:t}}if(e.startsWith(Rn)){let t=Hn(e,Rn);if(t!==void 0)return{kind:`task`,token:e,name:t}}return{kind:`signal`,token:e}}}function Wn(e,t){let n=[];for(let t of e)t.kind===`signal`&&(t.status===`pending`||t.status===`running`)&&n.push(t.name);n.length===0&&t&&(t.on===`signal`||t.on===`webhook`)&&n.push(t.name);let r=new Set,i=[];for(let e of n){if(r.has(e))continue;r.add(e);let t=Un(e);t&&i.push(t)}return i}var Gn=6e5;function Kn(e,t){return e.kind!==`remote`||e.status!==`pending`?!1:t-(e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime())>Gn}function qn(e){return e===`running`||e===`suspended`||e===`cancelling`}var Jn=new Set([`running`,`suspended`,`blocked`,`cancelling`]),Yn=`durable:singleton:admitted`;function Xn(e){let t=e.lastIndexOf(`@`);return t===-1?e:e.slice(0,t)}function Zn(e,t){let n=Xn(e),r=t.filter(e=>Xn(e.group)===n),i=r.some(e=>e.depth>0),a=r.some(e=>e.liveWorkers.length>0);return i&&!a}function Qn(e){return e.startsWith(`wh:`)?`webhook ${e}`:e.startsWith(`child:`)?`child ${e.slice(6)}`:`signal ${e}`}function $n(e,t){let n=e.tags?.find(e=>e.startsWith(`singleton:`));if(!n||e.tags?.includes(Yn))return;let r=t.filter(e=>Jn.has(e.status)&&e.tags?.includes(n)).sort((e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id));return r.find(e=>e.tags?.includes(Yn))??r[0]}function er(e){return`${e.on} ${e.name}`}function tr(e,t){if(e.status!==`suspended`)return e.status===`pending`&&Zn(e.workflow,t.health)?{status:`no-worker`,detail:e.workflow}:e.status===`blocked`?{status:`blocked`,detail:e.error?.message??e.workflow}:{status:e.status};let n=$n(e,t.runs);if(n&&n.id!==e.id)return{status:`queued`,detail:`behind leader ${n.id.slice(0,8)}`};let r=t.timeline?.find(e=>e.status===`pending`||e.status===`running`);if(r){if(r.name.startsWith(`signal:child:${e.id}.onError.`)){let e=r.input?.workflow;return{status:`awaiting`,detail:typeof e==`string`?`failure handler ${e}`:`failure handler`}}return r.kind===`signal`?{status:`awaiting`,detail:Qn(r.name)}:r.kind===`sleep`?{status:`sleeping`}:r.workerGroup&&Zn(r.workerGroup,t.health)?{status:`no-worker`,detail:Xn(r.workerGroup)}:{status:`running`}}return e.waiting?{status:`awaiting`,detail:er(e.waiting)}:Zn(e.workflow,t.health)?{status:`no-worker`,detail:e.workflow}:t.timeline?{status:`suspended`}:{status:`running`}}function nr(e,t){return e.status===`suspended`?t?.some(e=>e.status===`pending`||e.status===`running`)?`running`:e.wakeAt==null?t?`awaiting`:`running`:`sleeping`:e.status}var rr=`durable-dashboard-config`;function ir(){if(typeof document>`u`)return{};let e=document.getElementById(rr);if(e===null)return{};try{let t=JSON.parse(e.textContent??``);return typeof t==`object`&&t?t:{}}catch{return{}}}function ar(){let e=ir().base;return typeof e==`string`?e:`/durable`}function or(){return`${ar()}/logout`}function sr(){let e=ir().api;return typeof e==`string`?e:`${ar()}/api`}async function cr(e){try{let t=await e.json();if(typeof t!=`object`||!t||!(`auth`in t))return;let n=t.auth;if(typeof n!=`object`||!n||!(`modes`in n))return;let r=n.modes;return Array.isArray(r)?r.filter(e=>typeof e==`string`):void 0}catch{return}}function lr(e){if(typeof window>`u`)return;let t=ar();if(e?.includes(`login`)){let e=encodeURIComponent(window.location.pathname+window.location.search);window.location.href=`${t}/login?returnTo=${e}`}else window.location.href=t}function ur(){if(typeof document>`u`)return{};let e=/(?:^|;\s*)XSRF-TOKEN=([^;]*)/.exec(document.cookie)?.[1];return e?{"x-xsrf-token":decodeURIComponent(e)}:{}}var dr=`The server redirected this request instead of answering it, usually because the session or its CSRF token expired. Reload the page and try again.`;async function fr(e,t){let n=(t?.method??`GET`).toUpperCase(),r=n!==`GET`&&n!==`HEAD`,i=await fetch(sr()+e,{...t,...r?{headers:{...t?.headers,...ur()},redirect:`manual`}:{}});if(i.status===401)throw lr(await cr(i)),Error(`Session expired; redirecting to sign-in.`);if(i.type===`opaqueredirect`||i.redirected||i.status>=300&&i.status<400)throw new mr(i.status,dr,void 0);return i}async function pr(e,t){let n=await fr(e,t);if(!n.ok)throw await _r(n);return await n.json()}var mr=class extends Error{status;body;constructor(e,t,n){super(t),this.status=e,this.body=n,this.name=`DurableActionError`}};function hr(e){if(!(e instanceof mr)||typeof e.body!=`object`||e.body===null)return;let t=e.body.waitingOn;if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}async function gr(e,t){let n=await fr(e,t);if(!n.ok)throw await _r(n);return await n.json()}async function _r(e){let t;try{t=await e.json()}catch{t=void 0}let n=typeof t==`object`&&t&&typeof t.error==`string`?t.error:`${e.status} ${e.statusText}`;return new mr(e.status,n,t)}function vr(e,t){return gr(e,{method:`POST`,...t===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}})}var yr={async runs(e,t,n,r){let{runs:i}=await yr.runsPage(e,t,n,r);return i},async runsPage(e,t,n,r,i){let a=vn({status:e,tag:t,attr:n,...r},i??{}),o=await pr(a?`/runs?${a}`:`/runs`);return{runs:o.runs,meta:o.meta}},async values(e,t={},n){return pr(`/runs/values?${vn(t,{},{field:e,...n})}`)},run(e){return pr(`/runs/${encodeURIComponent(e)}`)},fanMembers(e,t,n={}){let r=new URLSearchParams;n.offset!==void 0&&r.set(`offset`,String(n.offset)),n.limit!==void 0&&r.set(`limit`,String(n.limit)),n.failed&&r.set(`failed`,`true`);let i=r.toString(),a=`/runs/${encodeURIComponent(e)}/fans/${encodeURIComponent(t)}`;return pr(i?`${a}?${i}`:a)},workers(){return pr(`/workers`)},topology(){return pr(`/topology`)},compat(){return pr(`/compat`)},async retry(e){return(await pr(`/runs/${encodeURIComponent(e)}/retry`,{method:`POST`})).result},async retryWithInput(e,t){return(await pr(`/runs/${encodeURIComponent(e)}/retry-with-input`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({input:t})})).result},bulk(e,t){let{compensate:n,...r}=t,i=vn(r),a=n?`${i?`${i}&`:``}compensate=true`:i;return pr(`/bulk/${e}${a?`?${a}`:``}`,{method:`POST`})},async cancel(e,t){let n=t?.compensate?`?compensate=true`:``;return(await pr(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:`POST`})).result},async continue(e){return(await pr(`/runs/${encodeURIComponent(e)}/continue`,{method:`POST`})).result},workflowLifecycle(e){return pr(`/workflows/${encodeURIComponent(e)}/lifecycle`)},async republishLifecycle(e,t){return(await pr(`/runs/${encodeURIComponent(e)}/republish-lifecycle`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t===void 0?{}:{subscriber:t})})).result},async redispatch(e){return(await pr(`/runs/${encodeURIComponent(e)}/redispatch`,{method:`POST`})).result},async signal(e,t,n,r){return(await vr(`/runs/${encodeURIComponent(e)}/signal`,{token:t,payload:n,...r?.force?{force:!0}:{}})).result},async update(e,t,n){return(await vr(`/runs/${encodeURIComponent(e)}/updates/${encodeURIComponent(t)}`,{arg:n})).result},completeTask(e,t,n){return vr(`/runs/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}/complete`,{result:n})},failTask(e,t,n){return vr(`/runs/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}/fail`,{error:n})},async schedules(){return(await pr(`/schedules`)).schedules},setSchedulePaused(e,t){return vr(`/schedules/${encodeURIComponent(e)}/${t?`pause`:`resume`}`)},async triggerSchedule(e){return(await vr(`/schedules/${encodeURIComponent(e)}/trigger`)).result},streamRun(e,t){if(typeof EventSource>`u`)return()=>{};let n=new EventSource(`${sr()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=e=>{try{t(JSON.parse(e.data))}catch{}},()=>n.close()}},br=class{limit;events=[];pushed=0;listeners=new Set;constructor(e=200){this.limit=e}push(e){this.pushed+=1;let t=[...this.events,{id:this.pushed,event:e}];this.events=t.length>this.limit?t.slice(t.length-this.limit):t;for(let e of this.listeners)e()}snapshot=()=>this.events;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e))};function xr(e){let t=e.lastIndexOf(`@`);return t===-1?`default`:e.slice(t+1)}function Sr(e){let t=e.lastIndexOf(`@`);return t===-1?e:e.slice(0,t)}function Cr(e){let t=new Map;for(let n of e){let e=xr(n.group),r=t.get(e);r?r.push(n):t.set(e,[n])}return[...t.entries()].map(([e,t])=>{let n=new Set,r=0,i=0;for(let e of t){r+=e.depth,e.depth>0&&e.liveWorkers.length===0&&(i+=1);for(let t of e.liveWorkers)n.add(t.instanceId)}return{partition:e,workerCount:n.size,handlerCount:t.length,totalDepth:r,starvedCount:i}}).sort((e,t)=>e.partition==="default"?-1:t.partition==="default"?1:e.partition.localeCompare(t.partition))}function wr(e,t){if(!e)return t;let n=new Map(e.timeline.map(e=>[e.seq,e]));return{...t,timeline:t.timeline.map(e=>{if((e.status===`pending`||e.status===`running`)&&(e.events?.length??0)===0){let t=n.get(e.seq)?.events;if(t?.length)return{...e,events:t}}return e})}}function Tr(e,t,n){if(!e)return e;let r=e.timeline.findIndex(e=>e.seq===t),i=e.timeline[r];if(i===void 0)return e;let a=[...e.timeline];return a[r]={...i,events:[...i.events??[],n]},{...e,timeline:a}}function Er(e){let t=new Map;for(let n of e)for(let e of n.liveWorkers){let n=Sr(e.group),r=t.get(e.instanceId);r===void 0?t.set(e.instanceId,{instanceId:e.instanceId,partition:xr(e.group),runtime:e.status?.runtime,handlers:new Set([n]),status:e.status,lastBeatAt:e.lastBeatAt}):(r.handlers.add(n),e.lastBeatAt>=r.lastBeatAt&&(r.lastBeatAt=e.lastBeatAt,r.partition=xr(e.group),r.runtime=e.status?.runtime,r.status=e.status))}return[...t.values()].map(e=>({instanceId:e.instanceId,partition:e.partition,runtime:e.runtime,handlers:[...e.handlers].sort((e,t)=>e.localeCompare(t)),status:e.status,lastBeatAt:e.lastBeatAt})).sort((e,t)=>e.partition===t.partition?e.instanceId.localeCompare(t.instanceId):e.partition==="default"?-1:t.partition==="default"?1:e.partition.localeCompare(t.partition))}function Dr(e){let t=new Set,n=new Set,r=new Set;for(let i of e){for(let e of i.liveWorkers)t.add(e.instanceId);i.kind===`workflow`?n.add(Sr(i.group)):i.kind===`step`&&r.add(Sr(i.group))}let i=e.filter(e=>e.depth>0&&e.liveWorkers.length===0).sort((e,t)=>t.depth-e.depth);return{queueCount:e.length,workflowCount:n.size,stepCount:r.size,workerCount:t.size,starved:i,allDraining:i.length===0}}function Or(e,t,n=Date.now){let r=-1/0,i,a=()=>{i=void 0,r=n(),e()};return{call(){if(i!==void 0)return;let e=r+t-n();e<=0?a():i=setTimeout(a,e)},cancel(){i!==void 0&&clearTimeout(i),i=void 0}}}var kr={width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.7,strokeLinecap:`round`,strokeLinejoin:`round`};function Ar(e){return(0,m.jsxs)(`svg`,{...kr,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`rect`,{x:`7`,y:`7`,width:`10`,height:`10`,rx:`1.5`}),(0,m.jsx)(`path`,{d:`M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2`})]})}function jr(e){return(0,m.jsxs)(`svg`,{...kr,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,m.jsx)(`path`,{d:`M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18`})]})}function Mr(e){return(0,m.jsxs)(`svg`,{...kr,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`13`,r:`8`}),(0,m.jsx)(`path`,{d:`M12 13V9M9 2h6`})]})}function Nr(e){return(0,m.jsxs)(`svg`,{...kr,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`}),(0,m.jsx)(`path`,{d:`M7.8 7.8a6 6 0 0 0 0 8.4M16.2 16.2a6 6 0 0 0 0-8.4M5 5a10 10 0 0 0 0 14M19 19a10 10 0 0 0 0-14`})]})}function Pr(e){return(0,m.jsx)(`svg`,{...kr,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`m4 12 5 5L20 6`})})}function Fr(e){return(0,m.jsx)(`svg`,{...kr,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M6 6l12 12M18 6 6 18`})})}function Ir(e){return(0,m.jsxs)(`svg`,{...kr,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`rect`,{x:`9`,y:`9`,width:`11`,height:`11`,rx:`2`}),(0,m.jsx)(`path`,{d:`M5 15V5a2 2 0 0 1 2-2h8`})]})}function Lr(e){return(0,m.jsx)(`svg`,{...kr,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5`})})}function Rr(e){return(0,m.jsx)(`svg`,{...kr,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M13 2 4 14h7l-1 8 9-12h-7l1-8z`})})}function zr(e){return(0,m.jsx)(`svg`,{...kr,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M6 4l14 8-14 8z`})})}function Br(e){return(0,m.jsxs)(`svg`,{...kr,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,m.jsx)(`path`,{d:`m20 20-4-4`})]})}function Vr(e){return(0,m.jsxs)(`svg`,{...kr,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`8`,r:`4`}),(0,m.jsx)(`path`,{d:`M4 20a8 8 0 0 1 16 0`})]})}function Hr(e){return(0,m.jsxs)(`svg`,{...kr,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`6`,cy:`5`,r:`2`}),(0,m.jsx)(`path`,{d:`M6 7v6a4 4 0 004 4h4`}),(0,m.jsx)(`circle`,{cx:`18`,cy:`17`,r:`2`})]})}var Ur={local:Ar,remote:jr,sleep:Mr,signal:Nr,child:Hr};function Wr(e){return Ur[e]??Ar}var Gr={local:`In-process step`,remote:`Remote worker step`,sleep:`Durable timer`,signal:`External signal`,child:`Child workflow — click to open its run`};function Kr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Kr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function qr(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Kr(e))&&(r&&(r+=` `),r+=t);return r}var Jr=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Yr=qr,Xr=(e,t)=>n=>{if(t?.variants==null)return Yr(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Jr(t)||Jr(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Yr(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Zr=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Qr=(e,t)=>({classGroupId:e,validator:t}),$r=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ei=`-`,ti=[],ni=`arbitrary..`,ri=e=>{let t=oi(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ai(e);let n=e.split(ei);return ii(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Zr(i,t):t:i||ti}return n[e]||ti}}},ii=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ii(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(ei):e.slice(t).join(ei),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ai=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ni+r:void 0})(),oi=e=>{let{theme:t,classGroups:n}=e;return si(n,t)},si=(e,t)=>{let n=$r();for(let r in e){let i=e[r];ci(i,n,r,t)}return n},ci=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];li(i,t,n,r)}},li=(e,t,n,r)=>{typeof e==`string`?ui(e,t,n):typeof e==`function`?di(e,t,n,r):fi(e,t,n,r)},ui=(e,t,n)=>{let r=e===``?t:pi(t,e);r.classGroupId=n},di=(e,t,n,r)=>{mi(e)?ci(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(Qr(n,e)))},fi=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ci(o,pi(t,a),n,r)}},pi=(e,t)=>{let n=e,r=t.split(ei),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=$r(),n.nextPart.set(t,i)),n=i}return n},mi=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,hi=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},gi=`!`,_i=`:`,vi=[],yi=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),bi=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===_i){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(gi)?(c=s.slice(0,-1),l=!0):s.startsWith(gi)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return yi(t,l,c,u)};if(t){let e=t+_i,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):yi(vi,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},xi=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Si=e=>({cache:hi(e.cacheSize),parseClassName:bi(e),sortModifiers:xi(e),postfixLookupClassGroupIds:Ci(e),...ri(e)}),Ci=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},wi=/\s+/,Ti=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(wi),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+gi:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ei=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Di(n))&&(i&&(i+=` `),i+=r);return i},Di=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Di(e[r]))&&(n&&(n+=` `),n+=t);return n},Oi=(e,...t)=>{let n,r,i,a,o=o=>(n=Si(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Ti(e,n);return i(e,a),a};return a=o,(...e)=>a(Ei(...e))},ki=[],Ai=e=>{let t=t=>t[e]||ki;return t.isThemeGetter=!0,t.themeKey=e,t},ji=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Mi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ni=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Pi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fi=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ii=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Li=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ri=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zi=e=>Ni.test(e),Bi=e=>!!e&&!Number.isNaN(Number(e)),Vi=e=>!!e&&Number.isInteger(Number(e)),Hi=e=>e.endsWith(`%`)&&Bi(e.slice(0,-1)),Ui=e=>Pi.test(e),Wi=()=>!0,Gi=e=>Fi.test(e)&&!Ii.test(e),Ki=()=>!1,qi=e=>Li.test(e),Ji=e=>Ri.test(e),Yi=e=>!K(e)&&!J(e),Xi=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Zi=e=>da(e,ha,Ki),K=e=>ji.test(e),q=e=>da(e,ga,Gi),Qi=e=>da(e,_a,Bi),$i=e=>da(e,ya,Wi),ea=e=>da(e,va,Ki),ta=e=>da(e,pa,Ki),na=e=>da(e,ma,Ji),ra=e=>da(e,ba,qi),J=e=>Mi.test(e),ia=e=>fa(e,ga),aa=e=>fa(e,va),oa=e=>fa(e,pa),sa=e=>fa(e,ha),ca=e=>fa(e,ma),la=e=>fa(e,ba,!0),ua=e=>fa(e,ya,!0),da=(e,t,n)=>{let r=ji.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},fa=(e,t,n=!1)=>{let r=Mi.exec(e);return r?r[1]?t(r[1]):n:!1},pa=e=>e===`position`||e===`percentage`,ma=e=>e===`image`||e===`url`,ha=e=>e===`length`||e===`size`||e===`bg-size`,ga=e=>e===`length`,_a=e=>e===`number`,va=e=>e===`family-name`,ya=e=>e===`number`||e===`weight`,ba=e=>e===`shadow`,xa=Oi(()=>{let e=Ai(`color`),t=Ai(`font`),n=Ai(`text`),r=Ai(`font-weight`),i=Ai(`tracking`),a=Ai(`leading`),o=Ai(`breakpoint`),s=Ai(`container`),c=Ai(`spacing`),l=Ai(`radius`),u=Ai(`shadow`),d=Ai(`inset-shadow`),f=Ai(`text-shadow`),p=Ai(`drop-shadow`),m=Ai(`blur`),h=Ai(`perspective`),g=Ai(`aspect`),_=Ai(`ease`),v=Ai(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),J,K],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[J,K,c],T=()=>[zi,`full`,`auto`,...w()],E=()=>[Vi,`none`,`subgrid`,J,K],D=()=>[`auto`,{span:[`full`,Vi,J,K]},Vi,J,K],O=()=>[Vi,`auto`,J,K],k=()=>[`auto`,`min`,`max`,`fr`,J,K],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[zi,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,zi,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[zi,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,J,K],L=()=>[...b(),oa,ta,{position:[J,K]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ee=()=>[`auto`,`cover`,`contain`,sa,Zi,{size:[J,K]}],z=()=>[Hi,ia,q],te=()=>[``,`none`,`full`,l,J,K],B=()=>[``,Bi,ia,q],ne=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],V=()=>[Bi,Hi,oa,ta],ie=()=>[``,`none`,m,J,K],H=()=>[`none`,Bi,J,K],ae=()=>[`none`,Bi,J,K],U=()=>[Bi,J,K],W=()=>[zi,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ui],breakpoint:[Ui],color:[Wi],container:[Ui],"drop-shadow":[Ui],ease:[`in`,`out`,`in-out`],font:[Yi],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ui],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ui],shadow:[Ui],spacing:[`px`,Bi],text:[Ui],"text-shadow":[Ui],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,zi,K,J,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,J,K]}],"container-named":[Xi],columns:[{columns:[Bi,`auto`,K,J,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Vi,`auto`,J,K]}],basis:[{basis:[zi,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Bi,zi,`auto`,`initial`,`none`,K]}],grow:[{grow:[``,Bi,J,K]}],shrink:[{shrink:[``,Bi,J,K]}],order:[{order:[Vi,`first`,`last`,`none`,J,K]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,ia,q]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ua,$i]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Hi,K]}],"font-family":[{font:[aa,ea,t]}],"font-features":[{"font-features":[K]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,J,K]}],"line-clamp":[{"line-clamp":[Bi,`none`,J,Qi]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,J,K]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,J,K]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ne(),`wavy`]}],"text-decoration-thickness":[{decoration:[Bi,`from-font`,`auto`,J,q]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Bi,`auto`,J,K]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Vi,J,K]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,J,K]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,J,K]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Vi,J,K],radial:[``,J,K],conic:[``,Vi,J,K]},ca,na]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-bs":[{"border-bs":B()}],"border-w-be":[{"border-be":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":B()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ne(),`hidden`,`none`]}],"divide-style":[{divide:[...ne(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ne(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Bi,J,K]}],"outline-w":[{outline:[``,Bi,ia,q]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,la,ra]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,la,ra]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:B()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Bi,q]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,la,ra]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Bi,J,K]}],"mix-blend":[{"mix-blend":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Bi]}],"mask-image-linear-from-pos":[{"mask-linear-from":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[J,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Bi]}],"mask-image-conic-from-pos":[{"mask-conic-from":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,J,K]}],filter:[{filter:[``,`none`,J,K]}],blur:[{blur:ie()}],brightness:[{brightness:[Bi,J,K]}],contrast:[{contrast:[Bi,J,K]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,la,ra]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Bi,J,K]}],"hue-rotate":[{"hue-rotate":[Bi,J,K]}],invert:[{invert:[``,Bi,J,K]}],saturate:[{saturate:[Bi,J,K]}],sepia:[{sepia:[``,Bi,J,K]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,J,K]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Bi,J,K]}],"backdrop-contrast":[{"backdrop-contrast":[Bi,J,K]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Bi,J,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Bi,J,K]}],"backdrop-invert":[{"backdrop-invert":[``,Bi,J,K]}],"backdrop-opacity":[{"backdrop-opacity":[Bi,J,K]}],"backdrop-saturate":[{"backdrop-saturate":[Bi,J,K]}],"backdrop-sepia":[{"backdrop-sepia":[``,Bi,J,K]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,J,K]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Bi,`initial`,J,K]}],ease:[{ease:[`linear`,`initial`,_,J,K]}],delay:[{delay:[Bi,J,K]}],animate:[{animate:[`none`,v,J,K]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,J,K]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:H()}],"rotate-x":[{"rotate-x":H()}],"rotate-y":[{"rotate-y":H()}],"rotate-z":[{"rotate-z":H()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":[`scale-3d`],skew:[{skew:U()}],"skew-x":[{"skew-x":U()}],"skew-y":[{"skew-y":U()}],transform:[{transform:[J,K,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:W()}],"translate-x":[{"translate-x":W()}],"translate-y":[{"translate-y":W()}],"translate-z":[{"translate-z":W()}],"translate-none":[`translate-none`],zoom:[{zoom:[Vi,J,K]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,J,K]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,J,K]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Bi,ia,q,Qi]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Sa(...e){return xa(qr(e))}var Ca=Xr(`inline-flex items-center gap-1.5 rounded border px-1.5 text-[10px] leading-relaxed`,{variants:{variant:{outline:`border-line bg-zinc-800/40 text-zinc-400`,tenant:`border-sky-500/30 bg-sky-500/10 text-sky-300`,origin:`border-teal-500/30 bg-teal-500/10 text-teal-300`,"origin-unknown":`border-line bg-zinc-800/40 italic text-zinc-500`,attr:`border-indigo-500/30 bg-indigo-500/10 text-indigo-300`,danger:`border-rose-500/40 bg-rose-500/10 text-rose-300`,warn:`border-warn/40 bg-warn/10 text-warn`,status:`border-transparent px-0 uppercase tracking-wider`}},defaultVariants:{variant:`outline`}}),wa=(0,p.forwardRef)(({className:e,variant:t,...n},r)=>(0,m.jsx)(`span`,{ref:r,className:Sa(Ca({variant:t}),e),...n}));wa.displayName=`Badge`;var Ta=Xr(`inline-flex items-center justify-center gap-1.5 rounded-md border font-medium transition-colors disabled:pointer-events-none disabled:opacity-30 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,{variants:{variant:{outline:`border-line text-zinc-300 hover:bg-zinc-800 hover:text-zinc-100`,ghost:`border-transparent text-zinc-500 hover:text-zinc-200`,quiet:`border-line text-zinc-500 hover:text-zinc-200`,brand:`border-brand/30 bg-brand/10 text-brand hover:bg-brand/20`,warn:`border-warn/40 bg-warn/10 text-warn hover:bg-warn/20`,info:`border-sky-500/30 bg-sky-500/10 text-sky-300 hover:bg-sky-500/20`,alt:`border-indigo-500/30 bg-indigo-500/10 text-indigo-300 hover:bg-indigo-500/20`,danger:`border-rose-500/30 bg-rose-500/10 text-rose-300 hover:bg-rose-500/20`,chip:`border-line bg-zinc-800/40 text-zinc-400 hover:border-zinc-500`},size:{sm:`px-3 py-1.5 text-xs uppercase tracking-wide`,xs:`px-1.5 py-0.5 text-[10px]`,chip:`px-2.5 py-1 text-xs`,icon:`h-7 w-7 shrink-0 p-0`}},defaultVariants:{variant:`outline`,size:`sm`}}),Y=(0,p.forwardRef)(({className:e,variant:t,size:n,type:r,...i},a)=>(0,m.jsx)(`button`,{ref:a,type:r??`button`,className:Sa(Ta({variant:t,size:n}),e),...i}));Y.displayName=`Button`;var Ea=(0,p.forwardRef)(({className:e,...t},n)=>(0,m.jsx)(`input`,{ref:n,className:Sa(`mono w-full bg-transparent py-1.5 text-xs text-zinc-200 placeholder:text-zinc-600 focus:outline-none disabled:opacity-50`,e),...t}));Ea.displayName=`Input`;var Da=(0,p.forwardRef)(({glyph:e,onClear:t,clearLabel:n=`clear`,containerClassName:r,value:i,...a},o)=>(0,m.jsxs)(`div`,{className:Sa(`flex items-center gap-1.5 rounded-md border border-line px-2 transition-colors focus-within:border-zinc-600`,r),children:[e!==void 0&&(0,m.jsx)(`span`,{className:`shrink-0 text-zinc-600`,"aria-hidden":!0,children:e}),(0,m.jsx)(Ea,{ref:o,value:i,...a}),t&&i?(0,m.jsx)(Y,{variant:`ghost`,size:`icon`,onClick:t,title:n,"aria-label":n,className:`h-4 w-4`,children:(0,m.jsx)(Fr,{width:12,height:12})}):null]}));Da.displayName=`InputField`;var Oa={};function ka(e,t){let n=p.useRef(Oa);return n.current===Oa&&(n.current=e(t)),n}var Aa=[],ja=void 0;function Ma(){return ja}function Na(e){Aa.push(e)}function Pa(e){let t=(t,n)=>{let r=ka(Ia).current,i;try{ja=r;for(let e of Aa)e.before(r);i=e(t,n);for(let e of Aa)e.after(r);r.didInitialize=!0}finally{ja=void 0}return i};return t.displayName=e.displayName||e.name,t}function Fa(e){return p.forwardRef(Pa(e))}function Ia(){return{didInitialize:!1}}function La(){}var Ra=Object.freeze([]),za=Object.freeze({});function Ba(e){p.useEffect(e,Ra)}var Va=0,Ha=class e{static create(){return new e}currentId=Va;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Va,t()},e)}isStarted(){return this.currentId!==Va}clear=()=>{this.currentId!==Va&&(clearTimeout(this.currentId),this.currentId=Va)};disposeEffect=()=>this.clear};function Ua(){let e=ka(Ha.create).current;return Ba(e.disposeEffect),e}var X=typeof document<`u`?p.useLayoutEffect:()=>{};function Wa(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ga,platform:Ka,maxTouchPoints:qa}=Wa(),Ja=Ga.toLowerCase(),Ya=Ka.toLowerCase(),Xa=/^i(os$|p)/.test(Ya)||Ya===`macintel`&&qa>1,Za=`android`,Qa=Ya===Za||Ja.includes(Za),$a=!Xa&&Ya.startsWith(`mac`);Ya.startsWith(`win`),!Qa&&/^(linux|chrome os)/.test(Ya);var eo=$a||Xa,to=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!to&&Ja.includes(`firefox`),!to&&Ja.includes(`chrom`);var no=eo,ro=/jsdom|happydom/.test(Ja);function io(e){e.preventDefault(),e.stopPropagation()}function ao(e){return`nativeEvent`in e}function oo(e){return e.pointerType===``&&e.isTrusted?!0:Qa&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function so(e){return ro?!1:!Qa&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Qa||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function co(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function lo(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function uo(){return typeof window<`u`}function fo(e){return ho(e)?(e.nodeName||``).toLowerCase():`#document`}function po(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mo(e){return((ho(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ho(e){return uo()?e instanceof Node||e instanceof po(e).Node:!1}function go(e){return uo()?e instanceof Element||e instanceof po(e).Element:!1}function _o(e){return uo()?e instanceof HTMLElement||e instanceof po(e).HTMLElement:!1}function vo(e){return!uo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof po(e).ShadowRoot}function yo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ao(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function bo(e){return/^(table|td|th)$/.test(fo(e))}function xo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var So=/transform|translate|scale|rotate|perspective|filter/,Co=/paint|layout|strict|content/,wo=e=>!!e&&e!==`none`,To;function Eo(e){let t=go(e)?Ao(e):e;return wo(t.transform)||wo(t.translate)||wo(t.scale)||wo(t.rotate)||wo(t.perspective)||!Oo()&&(wo(t.backdropFilter)||wo(t.filter))||So.test(t.willChange||``)||Co.test(t.contain||``)}function Do(e){let t=Mo(e);for(;_o(t)&&!ko(t);){if(Eo(t))return t;if(xo(t))return null;t=Mo(t)}return null}function Oo(){return To??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),To}function ko(e){return/^(html|body|#document)$/.test(fo(e))}function Ao(e){return po(e).getComputedStyle(e)}function jo(e){return go(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mo(e){if(fo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||vo(e)&&e.host||mo(e);return vo(t)?t.host:t}function No(e){let t=Mo(e);return ko(t)?(e.ownerDocument||e).body:_o(t)&&yo(t)?t:No(t)}function Po(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=No(e),i=r===e.ownerDocument?.body,a=po(r);if(i){let e=Fo(a);return t.concat(a,a.visualViewport||[],yo(r)?r:[],e&&n?Po(e):[])}return t.concat(r,Po(r,[],n))}function Fo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Io(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&vo(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Lo(e,t){let n=e;for(;n;){if(go(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(vo(n)?n.host:null)}return null}function Ro(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var zo=`data-base-ui-focusable`,Bo=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Vo=`data-starting-style`,Ho=`data-ending-style`,Uo={[Vo]:``},Wo={[Ho]:``},Go={transitionStatus(e){return e===`starting`?Uo:e===`ending`?Wo:null}},Ko=`data-open`,qo=`data-closed`,Jo=`data-anchor-hidden`,Yo=`data-popup-open`,Xo=`data-pressed`,Zo={[Yo]:``},Qo={[Yo]:``,[Xo]:``},$o={[Ko]:``},es={[qo]:``},ts={[Jo]:``},ns={open(e){return e?Zo:null}},rs={open(e){return e?Qo:null}},is={open(e){return e?$o:es},anchorHidden(e){return e?ts:null}},as={...is,...Go},os=`data-trigger-disabled`;function ss(e,t){if(!go(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(os);for(let[,e]of t.entries())if(Z(e,n))return!e.hasAttribute(os);return!1}function cs(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function ls(e){return e.matches(`html,body`)}function us(e){return _o(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function ds(e){return Lo(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Bo}`)!=null}function fs(e){return e?e.getAttribute(`role`)===`combobox`&&us(e):!1}function ps(e){if(!e||ro)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ms(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function hs(e,t){return t!=null&&!co(t)?0:typeof e==`function`?e():e}function gs(e,t,n){let r=hs(e,n);return typeof r==`number`?r:r?.[t]}function _s(e){return typeof e==`function`?e():e}function vs(e,t){return t||e===`click`||e===`mousedown`}function ys(e){return e?.includes(`mouse`)&&e!==`mousedown`}function bs(e,t,n,r){let i=!1,a=!1,o=r??za;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var xs=`none`,Ss=`trigger-press`,Cs=`trigger-hover`,ws=`trigger-focus`,Ts=`outside-press`,Es=`close-press`,Ds=`focus-out`,Os=`escape-key`,ks=`disabled`,As=`missing`,js=`initial`,Ms=`imperative-action`,Ns=p.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ha,currentIdRef:{current:null},currentContextRef:{current:null}});function Ps(e,t){e.current=t.current}function Fs(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=p.useRef(n),a=p.useRef(n),o=p.useRef(null),s=p.useRef(null),c=Ua();return X(()=>{a.current=n,o.current?i.current={open:gs(i.current,`open`),close:gs(n,`close`)}:i.current=n},[n,o,i,a]),(0,m.jsx)(Ns.Provider,{value:p.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Is(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=p.useContext(Ns),[d,f]=p.useState(!1),m=p.useRef(n);return X(()=>{m.current=n},[n]),X(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(m.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),X(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:gs(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,bs(xs))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),X(()=>()=>{if(i.current===r){if(c.current=null,!m.current)return;i.current=null,Ps(a,s),u.clear()}},[c,i,a,r,s,u]),p.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function Ls(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Rs(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function zs(e,t,n,r){let i=ka(Vs).current;return Hs(i,e,t,n,r)&&Ws(i,[e,t,n,r]),i.callback}function Bs(e){let t=ka(Vs).current;return Us(t,e)&&Ws(t,e),t.callback}function Vs(){return{callback:null,cleanup:null,refs:[]}}function Hs(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Us(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Ws(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Gs(e){let t=ka(Ks,e).current;return t.next=e,X(t.effect),t}function Ks(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var qs={...p},Js=qs.useInsertionEffect,Ys=Js&&Js!==qs.useLayoutEffect?Js:e=>e();function Q(e){let t=ka(Xs).current;return t.next=e,Ys(t.effect),t.trampoline}function Xs(){let e={next:void 0,callback:Zs,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Zs(){}var Qs=null;globalThis.requestAnimationFrame;var $s=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},ec=class e{static create(){return new e}static request(e){return $s.request(e)}static cancel(e){return $s.cancel(e)}currentId=Qs;request(e){this.cancel(),this.currentId=$s.request(()=>{this.currentId=Qs,e()})}cancel=()=>{this.currentId!==Qs&&($s.cancel(this.currentId),this.currentId=Qs)};disposeEffect=()=>this.cancel};function tc(){let e=ka(ec.create).current;return Ba(e.disposeEffect),e}function nc(e){return e?.ownerDocument||document}var rc={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},ic={...rc,position:`fixed`,margin:0,top:0,left:0};({...rc});var ac=p.forwardRef(function(e,t){let[n,r]=p.useState();X(()=>{no&&to&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,m.jsx)(`span`,{...e,ref:t,style:ic,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),oc=Math.min,sc=Math.max,cc=Math.round,lc=Math.floor,uc=e=>({x:e,y:e}),dc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function fc(e,t,n){return sc(e,oc(t,n))}function pc(e,t){return typeof e==`function`?e(t):e}function mc(e){return e.split(`-`)[0]}function hc(e){return e.split(`-`)[1]}function gc(e){return e===`x`?`y`:`x`}function _c(e){return e===`y`?`height`:`width`}function vc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function yc(e){return gc(vc(e))}function bc(e,t,n){n===void 0&&(n=!1);let r=hc(e),i=yc(e),a=_c(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=kc(o)),[o,kc(o)]}function xc(e){let t=kc(e);return[Sc(e),t,Sc(t)]}function Sc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Cc=[`left`,`right`],wc=[`right`,`left`],Tc=[`top`,`bottom`],Ec=[`bottom`,`top`];function Dc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?wc:Cc:t?Cc:wc;case`left`:case`right`:return t?Tc:Ec;default:return[]}}function Oc(e,t,n,r){let i=hc(e),a=Dc(mc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Sc)))),a}function kc(e){let t=mc(e);return dc[t]+e.slice(t.length)}function Ac(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function jc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ac(e)}function Mc(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Nc(e,t){return t<0||t>=e.length}function Pc(e,t){return Ic(e.current,{disabledIndices:t})}function Fc(e,t){return Ic(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ic(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Lc(e,a,r));return a}function Lc(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!zc(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Rc(e){return e.visibility===`hidden`||e.visibility===`collapse`}function zc(e,t=e?Ao(e):null){return!e||!e.isConnected||!t||Rc(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Bc=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Vc(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return vo(n)?n.host:null}function Hc(e){for(let t of Array.from(e.children))if(fo(t)===`summary`)return t;return null}function Uc(e,t){let n=Hc(t);return!!n&&(e===n||Z(n,e))}function Wc(e){let t=e?fo(e):``;return e!=null&&e.matches(Bc)&&(t!==`summary`||e.parentElement!=null&&fo(e.parentElement)===`details`&&Hc(e.parentElement)===e)&&(t!==`details`||Hc(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Gc(e){if(!Wc(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Vc(t)){let n=t!==e,r=fo(t)===`slot`;if(t.hasAttribute(`inert`)||n&&fo(t)===`details`&&!t.open&&!Uc(e,t)||t.hasAttribute(`hidden`)||!r&&!Kc(t,n))return!1}return!0}function Kc(e,t){let n=Ao(e);return t?n.display!==`none`:zc(e,n)}function qc(e){let t=e.tabIndex;if(t<0){let t=fo(e);if(t===`details`||t===`audio`||t===`video`||_o(e)&&e.isContentEditable)return 0}return t}function Jc(e){if(fo(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Yc(e,t){let n=Jc(e);if(!n)return!0;let r=t.find(e=>{let t=Jc(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Jc(e);return t?.name===n.name&&t.form===n.form})===n}function Xc(e){if(_o(e)&&fo(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return _o(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Zc(e,t){Xc(e).forEach(e=>{Wc(e)&&t.push(e),Zc(e,t)})}function Qc(e,t,n){Xc(e).forEach(e=>{_o(e)&&e.matches(t)&&n.push(e),Qc(e,t,n)})}function $c(e){return Gc(e)&&qc(e)>=0}function el(e){let t=[];return Zc(e,t),t.filter(Gc)}function tl(e){let t=el(e);return t.filter(e=>qc(e)>=0&&Yc(e,t))}function nl(e,t){let n=tl(e),r=n.length;if(r===0)return;let i=Io(nc(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function rl(e){return nl(nc(e).body,1)||e}function il(e){return nl(nc(e).body,-1)||e}function al(e,t,n){if(!e)return null;let r=[];Zc(nc(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Gc);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Z(n,o)&&$c(o)&&Yc(o,a))return o}return r[i]}function ol(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z(n,r)}function sl(e){tl(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function cl(e){let t=[];Qc(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ll(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ll(e,t.id,n)])}function ul(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function dl(e){return`data-base-ui-${e}`}var fl=0;function pl(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(fl);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),La;let o=requestAnimationFrame(a);return fl=o,()=>{fl===o&&(cancelAnimationFrame(o),fl=0)}}var ml=`data-base-ui-inert`,hl=new WeakMap,gl=new WeakSet,_l=new WeakMap,vl=0;function yl(e){return e?vo(e)?e.host:yl(e.parentNode):null}var bl=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=yl(t);return e.contains(n)?n:null}).filter(e=>e!=null),xl=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Sl=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{fo(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Cl(e,t,n,{mark:r=!0}){let i=bl(t,e),a=r?Sl(t,xl(i),new Set(i)):[],o=[],s=[];if(n){let e=bl(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Sl(t,xl(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(hl.get(e)||0)+1;hl.set(e,r),o.push(e),r===1&&n&&gl.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(_l.get(e)||0)+1;_l.set(e,t),s.push(e),t===1&&e.setAttribute(ml,``)}),vl+=1,()=>{o.forEach(e=>{let t=(hl.get(e)||0)-1;hl.set(e,t),t||(gl.has(e)||e.removeAttribute(`aria-hidden`),gl.delete(e))}),r&&s.forEach(e=>{let t=(_l.get(e)||0)-1;_l.set(e,t),t||e.removeAttribute(ml)}),--vl,vl||(hl=new WeakMap,gl=new WeakSet,_l=new WeakMap)}}function wl(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=nc(e[0]).body;return Cl(e,i,n,{mark:r})}function Tl(){let[,e]=p.useState({});return p.useCallback(()=>{e({})},[])}var El=0;function Dl(e,t=`mui`){let n=p.useRef(void 0),r=Tl(),i=e??n.current;return p.useEffect(()=>{n.current??(El+=1,n.current=`${t}-${El}`,e??r())},[e,t,r]),i}var Ol=qs.useId;function kl(e,t){if(Ol!==void 0){let n=Ol();return e??(t?`${t}-${n}`:n)}return Dl(e,t)}var Al=19;function jl(e){return Al>=e}function Ml(e){if(!p.isValidElement(e))return null;let t=e,n=t.props;return(jl(19)?n?.ref:t.ref)??null}function Nl(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Pl(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Fl(e,t){return typeof e==`function`?e(t):e}function Il(e,t){return typeof e==`function`?e(t):e}var Ll={};function Rl(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Bl(t);let a=Bl(e);return t&&(a=Vl(a,t)),n&&(a=Vl(a,n)),r&&(a=Vl(a,r)),i&&(a=Vl(a,i)),a}function zl(e){if(e.length===0)return Ll;if(e.length===1)return Bl(e[0]);let t=Bl(e[0]);for(let n=1;n<e.length;n+=1)t=Vl(t,e[n]);return t}function Bl(e){return Gl(e)?{...e(Ll)}:Hl(e)}function Vl(e,t){return Gl(t)?t(e):Ul(e,t)}function Hl(e){let t={...e};for(let e in t){let n=t[e];Wl(e,n)&&(t[e]=ql(n))}return t}function Ul(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Nl(e.style,r);break;case`className`:e[n]=Yl(e.className,r);break;default:e[n]=Wl(n,r)?Kl(e[n],r):r}}return e}function Wl(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Gl(e){return typeof e==`function`}function Kl(e,t){return t?e?(...n)=>{let r=n[0];if(Xl(r)){let i=r;Jl(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:ql(t):e}function ql(e){return e&&((...t)=>{let n=t[0];return Xl(n)&&Jl(n),e(...t)})}function Jl(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Yl(e,t){return t?e?t+` `+e:t:e}function Xl(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Zl(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=tu(r));let i=Ql(t,n,r);if(n.enabled===!1)return null;let a=n.state??za;return nu(e,r,i,a)}function Ql(e,t,n){let{className:r,style:i}=e,{state:a=za,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Fl(r,a):void 0,d=l?Il(i,a):void 0,f=l?Pl(a,c):za,p=l&&s?$l(s):void 0,m=l?Nl(f,p)??{}:za;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Bs([m.ref,Ml(n),...o]):zs(m.ref,Ml(n),o):zs(null,null)),l?(u!==void 0&&(m.className=Yl(m.className,u)),d!==void 0&&(m.style=Nl(m.style,d)),m):za}function $l(e){return Array.isArray(e)?zl(e):Rl(void 0,e)}var eu=Symbol.for(`react.lazy`);function tu(e){if(e?.$$typeof!==eu)return e;let t=p.Children.toArray(e)[0];return p.isValidElement(t)?t:e}function nu(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Rl(n,t.props);return e.ref=n.ref,p.cloneElement(t,e)}return ru(e,n)}function ru(e,t){return e===`button`?(0,p.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,p.createElement)(`img`,{alt:``,...t,key:t.key}):p.createElement(e,t)}var iu={style:{transition:`none`}},au=`data-base-ui-click-trigger`,ou={fallbackAxisSide:`end`},su={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},cu=p.createContext(null),lu=()=>p.useContext(cu),uu=dl(`portal`);function du(e={}){let{ref:t,container:n,componentProps:r=za,elementProps:i}=e,a=kl(),o=lu()?.portalNode,[s,c]=p.useState(null),[l,u]=p.useState(null),d=Q(e=>{e!==null&&u(e)}),f=p.useRef(null);X(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(ho(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let m=Zl(`div`,r,{ref:[t,d],props:[{id:a,[uu]:``},i]}),h=s&&m?st.createPortal(m,s):null;return{node:l,nodeId:p.isValidElement(m)?m.props.id:void 0,subtree:h}}var fu=p.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=du({container:o,ref:t,componentProps:e,elementProps:c}),f=p.useRef(null),h=p.useRef(null),g=p.useRef(null),_=p.useRef(null),[v,y]=p.useState(null),b=p.useRef(!1),x=v?.modal,S=v?.open,C=!!v&&!v.modal&&v.open&&!!l;p.useEffect(()=>{if(!l||x)return;function e(e){l&&e.relatedTarget&&ol(e)&&(e.type===`focusin`?b.current&&=(cl(l),!1):(sl(l),b.current=!0))}return Rs(Ls(l,`focusin`,e,!0),Ls(l,`focusout`,e,!0))},[l,x]),X(()=>{l&&S===!0&&b.current&&(cl(l),b.current=!1)},[S,l]);let w=p.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:h,beforeInsideRef:g,afterInsideRef:_,portalNode:l,setFocusManagerState:y}),[l]);return(0,m.jsxs)(p.Fragment,{children:[d,(0,m.jsxs)(cu.Provider,{value:w,children:[C&&l&&(0,m.jsx)(ac,{"data-type":`outside`,ref:f,onFocus:e=>{ol(e,l)?g.current?.focus():il(v?v.domReference:null)?.focus()}}),C&&l&&(0,m.jsx)(`span`,{role:s,"aria-owns":u,style:su}),l&&st.createPortal(a,l),C&&l&&(0,m.jsx)(ac,{"data-type":`outside`,ref:h,onFocus:e=>{ol(e,l)?_.current?.focus():(rl(v?v.domReference:null)?.focus(),v?.closeOnFocusOut&&v?.onOpenChange(!1,bs(`focus-out`,e.nativeEvent)))}})]})]})});function pu(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var mu=class{nodesRef={current:[]};events=pu();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},hu=p.createContext(null),gu=p.createContext(null),_u=()=>p.useContext(hu)?.id||null,vu=e=>{let t=p.useContext(gu);return e??t};function yu(e){let t=kl(),n=vu(e),r=_u();return X(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function bu(e){let{children:t,id:n}=e,r=_u();return(0,m.jsx)(hu.Provider,{value:p.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function xu(e){let{children:t,externalTree:n}=e,r=ka(()=>n??new mu).current;return(0,m.jsx)(gu.Provider,{value:r,children:t})}function Su(e){return e==null?e:`current`in e?e.current:e}function Cu(e,t){let n=po(Ro(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(oo(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var wu=20,Tu=[];function Eu(){Tu=Tu.filter(e=>e.deref()?.isConnected)}function Du(e){Eu(),e&&fo(e)!==`body`&&(Tu.push(new WeakRef(e)),Tu.length>wu&&(Tu=Tu.slice(-20)))}function Ou(){return Eu(),Tu[Tu.length-1]?.deref()}function ku(e){return e?$c(e)?e:tl(e)[0]||e:null}function Au(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=el(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return $c(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ju(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:g,getInsideElements:_}=e,v=t.useState(`open`),y=t.useState(`domReferenceElement`),b=t.useState(`floatingElement`),{events:x,dataRef:S}=t.context,C=Q(()=>S.current.floatingContext?.nodeId),w=i===!1,T=fs(y)&&w,E=Gs(i),D=Gs(a),O=Gs(o),k=Gs(u),A=Gs(v),j=vu(g),M=lu(),N=p.useRef(!1),P=p.useRef(!1),F=p.useRef(!1),I=p.useRef(null),L=p.useRef(``),R=p.useRef(``),ee=p.useRef(null),z=p.useRef(null),te=zs(ee,h,M?.beforeInsideRef),B=zs(z,M?.afterInsideRef),ne=Ua(),re=Ua(),V=tc(),ie=M!=null,H=ms(b),ae=Q((e=H)=>e?tl(e):[]),U=Q(()=>_?.().filter(e=>e!=null)??[]);p.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Z(H,Io(nc(H)))&&ae().length===0&&!T&&io(e)}return Ls(nc(H),`keydown`,e)},[r,H,c,T,ae]),p.useEffect(()=>{if(r||!v)return;let e=nc(H);function t(){F.current=!1}function n(e){let t=Ro(e),n=U(),r=Z(b,t)||Z(y,t)||Z(M?.portalNode,t)||n.some(e=>e===t||Z(e,t));F.current=!r,R.current=e.pointerType||`keyboard`,Lo(t,`[data-base-ui-click-trigger]`)&&(P.current=!0,re.start(0,()=>{P.current=!1}))}function i(){R.current=`keyboard`}return Rs(Ls(e,`pointerdown`,n,!0),Ls(e,`pointerup`,t,!0),Ls(e,`pointercancel`,t,!0),Ls(e,`keydown`,i,!0),t)},[r,b,y,H,v,M,re,U]),p.useEffect(()=>{if(r||!l)return;let e=nc(H);function n(){P.current=!0,re.start(0,()=>{P.current=!1})}function i(e){let t=Ro(e);$c(t)&&(I.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Ro(n);c&&r==null&&a!=null&&Z(b,a)&&Du(a),queueMicrotask(()=>{let o=C(),l=t.context.triggerElements,u=U(),p=r?.hasAttribute(dl(`focus-guard`))&&[ee.current,z.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Su(f),Su(d)].includes(r),m=!(Z(y,r)||Z(b,r)||Z(r,b)||Z(M?.portalNode,r)||u.some(e=>e===r||Z(e,r))||l.hasMatchingElement(e=>Z(e,r))||p||j&&(ll(j.nodesRef.current,o).find(e=>Z(e.context?.elements.floating,r)||Z(e.context?.elements.domReference,r))||ul(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,ms(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===y&&H&&Au(H),s&&i!==y&&!zc(a)&&Io(e)===e.body){if(_o(H)&&(H.focus(),s===`popup`)){V.request(()=>{H.focus()});return}let e=ae(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||H;_o(n)&&n.focus()}S.current.insideReactTree?S.current.insideReactTree=!1:(T||!c)&&r&&m&&!P.current&&(T||r!==Ou())&&(N.current=!0,t.setOpen(!1,bs(Ds,n)))})}function o(){F.current||(S.current.insideReactTree=!0,ne.start(0,()=>{S.current.insideReactTree=!1}))}let u=_o(y)?y:null;if(b||u)return Rs(u&&Ls(u,`focusout`,a),u&&Ls(u,`pointerdown`,n),b&&Ls(b,`focusin`,i),b&&Ls(b,`focusout`,a),b&&M&&Ls(b,`focusout`,o,!0))},[r,y,b,H,c,j,M,t,l,s,ae,T,C,S,ne,re,V,d,f,U]),p.useEffect(()=>{if(r||!b||!v)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${dl(`portal`)}]`)||[]),t=(j?ul(j.nodesRef.current,C()):[]).find(e=>fs(e.context?.elements.domReference||null))?.context?.elements.domReference,n=wl([b,...e,ee.current,z.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...U(),t,Su(f),Su(d),T?y:null].filter(e=>e!=null),{ariaHidden:c||T,mark:!1}),i=wl([b,...e].filter(e=>e!=null));return()=>{i(),n()}},[v,r,y,b,c,M,T,j,C,d,f,U]),X(()=>{if(!v||r||!_o(H))return;L.current=``,R.current=``;let e=nc(H),t=Io(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||Z(H,t))return;let i=null,a=()=>(i??=ae(H),i[0]||H),o;o=r===!0||r===null?a():Su(r),o||=a();let s=Z(H,Io(e)),c=S.current.openEvent,l=c?.type===`mousedown`&&oo(c);pl(o,{sync:l,preventScroll:o===H,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=Io(e);return!(t!==o&&Z(H,t))}})})},[r,v,H,ae,E,k,A,S]);let W=p.useRef(null);X(()=>{if(r||!H){W.current=null;return}W.current&&=(W.current.cancelled=!0,null);let e=nc(H),t=Io(e),n=k.current==null;Du(t);function i(e){if(e.open||(L.current=Cu(e.nativeEvent,R.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(dl(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(N.current=!0),e.reason===`outside-press`){if(e.nested)N.current=!1;else if(oo(e.nativeEvent)||so(e.nativeEvent))N.current=!1;else{let e=!1;nc(H).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}}x.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=y?.isConnected?y:null,o=t?.isConnected&&fo(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Ou()||null,typeof i==`boolean`?s:Su(i)||s||null}return()=>{x.off(`openchange`,i);let t=Io(e),n=U(),r=Z(b,t)||n.some(e=>e===t||Z(e,t))||j&&ll(j.nodesRef.current,C(),!1).some(e=>Z(e.context?.elements.floating,t)),o=D.current,s=L.current,c=a(s),l={cancelled:!1};W.current=l,queueMicrotask(()=>{W.current===l&&(W.current=null);let n=ku(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!N.current&&_o(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,b,H,D,O,k,x,j,y,C,U]),X(()=>{if(!to||v||!b)return;let e=Io(nc(b));_o(e)&&us(e)&&Z(b,e)&&e.blur()},[v,b]),X(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:l,open:v,onOpenChange:t.setOpen,domReference:y}),()=>{M.setFocusManagerState(null)}},[r,M,c,v,t,l,y]),X(()=>{if(!r&&H)return Au(H),()=>{queueMicrotask(Eu)}},[r,H]);let oe=!r&&(!c||!T)&&(ie||c);return(0,m.jsxs)(p.Fragment,{children:[oe&&(0,m.jsx)(ac,{"data-type":`inside`,ref:te,onFocus:e=>{if(c){let e=ae();pl(e[e.length-1])}else M?.portalNode&&(N.current=!1,ol(e,M.portalNode)?rl(y)?.focus():Su(f??M.beforeOutsideRef)?.focus())}}),n,oe&&(0,m.jsx)(ac,{"data-type":`inside`,ref:B,onFocus:e=>{c?pl(ae()[0]):M?.portalNode&&(l&&(N.current=!0),ol(e,M.portalNode)?il(y)?.focus():Su(d??M.afterOutsideRef)?.focus())}})]})}function Mu(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Ss}=t,l=e.context.dataRef,u=p.useRef(void 0),d=tc(),f=Ua(),m=p.useMemo(()=>{function t(t,n,r,i){let a=bs(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=co(e.pointerType,!0)&&so(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||co(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=Ro(s),p=us(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:co(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return p.useMemo(()=>n?{reference:m}:za,[n,m])}function Nu(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Pu(e){return e!=null&&e.clientX!=null}function Fu(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=p.useRef(!1),l=p.useRef(null),[u,d]=p.useState(),[f,m]=p.useState([]),h=Q(t=>{e.set(`positionReference`,t)}),g=Q((t,n,i)=>{c.current||(!s.current.openEvent||Pu(s.current.openEvent))&&e.set(`positionReference`,Nu(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),_=Q(e=>{i?l.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=co(u)?a:i;p.useEffect(()=>{if(!n){h(o);return}if(!v)return;function e(){l.current?.(),l.current=null}let t=po(a);function r(t){let n=Ro(t);Z(a,n)?e():g(t.clientX,t.clientY)}return!s.current.openEvent||Pu(s.current.openEvent)?l.current=Ls(t,`mousemove`,r):h(o),e},[v,n,a,s,o,e,g,h,f]),p.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),p.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),p.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let y=p.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return p.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function Iu(){return!1}function Lu(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Ru(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Iu,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,m=vu(c),h=Q(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=Q(()=>a),{escapeKey:y,outsidePress:b}=Lu(s),x=p.useRef(!1),S=p.useRef(!1),C=p.useRef(!1),w=p.useRef(!1),T=p.useRef(!1),E=p.useRef(``),D=p.useRef(null),O=Ua(),k=Ua(),A=Ua(),j=Q(()=>{k.clear(),d.current.insideReactTree=!1}),M=Q(e=>{let t=d.current.floatingContext?.nodeId;return(m?ll(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Q(t=>cs(t,e.select(`floatingElement`))||cs(t,e.select(`domReferenceElement`))),P=Q(t=>{o()&&e.setOpen(!1,bs(Ss,t.nativeEvent))}),F=Q(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=ao(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=bs(Os,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=Q(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=Q(t=>{if(!l||!n||t.button!==0)return;let r=Ro(t.nativeEvent);Z(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=Q(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});p.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),p.useEffect(()=>j,[j]),p.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new Ha,i=nc(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(to?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=d.current.floatingContext?.nodeId,n=m&&ll(m.nodesRef.current,t).some(t=>cs(e,t.context?.elements.floating));return N(e)||n}function k(n){if(p(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=Ro(n),i=`[${dl(`inert`)}]`,a=go(r)?r.getRootNode():null,o=Array.from((vo(a)?a:nc(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Z(e,r))))return;let c=go(r)?r:null;for(;c&&!ko(c);){let e=Mo(c);if(ko(e)||!go(e))break;c=e}if(!(o.length&&go(r)&&!ls(r)&&!Z(r,e.select(`floatingElement`))&&o.every(e=>!Z(c,e)))){if(_o(r)&&!(`touches`in n)){let e=ko(r),t=Ao(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!h(n)){if(f()===`intentional`){if(n.detail!==0&&!oo(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof g==`function`&&!g(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,bs(Ts,n)),j())}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=Ro(e);if(!n)return;let r=Ls(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function ee(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function z(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():h(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())))}function te(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function B(e){L(e,te)}function ne(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function re(e){L(e,ne)}let V=Rs(r&&Rs(Ls(i,`keydown`,F),Ls(i,`compositionstart`,a),Ls(i,`compositionend`,o)),_&&Rs(Ls(i,`click`,ee,!0),Ls(i,`pointerdown`,ee,!0),Ls(i,`pointerup`,z,!0),Ls(i,`pointercancel`,z,!0),Ls(i,`mousedown`,ee,!0),Ls(i,`mouseup`,z,!0),Ls(i,`touchstart`,R,{capture:!0,passive:!0}),Ls(i,`touchmove`,B,{capture:!0,passive:!0}),Ls(i,`touchend`,re,{capture:!0,passive:!0})));return()=>{V(),t.clear(),c(),C.current=!1}},[d,u,r,_,g,l,n,y,b,F,j,v,M,N,m,e,O,A]);let ee=p.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),z=p.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return p.useMemo(()=>n?{reference:ee,floating:z,trigger:ee}:{},[n,ee,z])}function zu(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Bu=zu(`https://base-ui.com/production-error`,`Base UI`);function Vu(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),X(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};go(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Hu(e,t=!1,n=!1,r=!1){let[i,a]=p.useState(e&&t?`idle`:void 0),[o,s]=p.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),X(()=>{if(!e&&o&&i!==`ending`&&n){let e=ec.request(()=>{a(`ending`)});return()=>{ec.cancel(e)}}},[e,o,i,n]),X(()=>{if(!e||t||i===void 0)return;let n=ec.request(()=>{a(void 0)});return()=>{ec.cancel(n)}},[t,e,i]),X(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=ec.request(()=>{a(`idle`)});return()=>{ec.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Uu(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Wu=null;function Gu(e){if(!Wu){let e=[];Wu=e,queueMicrotask(()=>{Wu=null,st.flushSync(()=>{for(let t of e)t()})})}Wu.push(e)}function Ku(e,t=!1,n=!1){let r=tc();return Q((i,a=null)=>{r.cancel();let o=Su(e);if(o==null)return;let s=o,c=()=>{n?Gu(()=>{a?.aborted||i()}):st.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Uu(s).map(e=>e.finished.then(La))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Uu(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Vo;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function qu(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Q(a),s=Ku(r,n,i);p.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function Ju(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=Q(i),{mounted:c,setMounted:l,transitionStatus:u}=Hu(t,!1,!1,o),d=!t&&r;X(()=>{t&&s(!1)},[t,s]);let f=p.useRef(c),m=p.useRef(!1),h=Tl(),g=()=>{f.current=!1,l(!1),a()};X(()=>{f.current=c,m.current&&(m.current=!1,!t&&c&&g())});let _=Q(()=>{f.current&&(t?(m.current=!0,h()):g())});return qu({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||_()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:_}}var Yu={tabIndex:-1,[zo]:``};function Xu(e){return t=>t!==`touch`||e.current}function Zu(e,t=!1){let n=kl(),r=_u()!=null,i=ka(()=>e(n,r)).current;return Vu({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Qu({handle:e,store:t}){return X(()=>e.attachStore(t),[e,t]),null}function $u(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function ed(e,t){let n=p.useRef(null);return Q(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),$u(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),$u(t))})}function td(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function nd(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function rd(e,t,n,r={}){let i=n.reason,a=i===Cs,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=nd(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=td(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?st.flushSync(l):l()}function id(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=ed(e,n),o=Q(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Q(e=>{a(e),e&&o(e)});return X(()=>(s(t.current),()=>s(null)),[s,t,n,e]),X(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function ad(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=p.useRef(null),i=e.useState(`open`);X(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=bs(xs);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function od(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Ju({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return ka(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function sd(e,t){e.useSyncedValues(t),X(()=>()=>{e.update({activeTriggerProps:za,inactiveTriggerProps:za,popupProps:za})},[e])}function cd(e,t){X(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),X(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var ld=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},ud=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),dd=o(((e,t)=>{t.exports=ud()})),fd=o((e=>{var t=u(),n=dd();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),pd=o(((e,t)=>{t.exports=fd()})),md=dd(),hd=c(pd(),1),gd=jl(19)?yd:bd;function _d(e,t,n,r,i){return gd(e,t,n,r,i)}function vd(e,t,n,r,i){let a=p.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,md.useSyncExternalStore)(e.subscribe,a,a)}Na({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,md.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function yd(e,t,n,r,i){let a=Ma();if(!a)return vd(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function bd(e,t,n,r,i){return(0,hd.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var xd=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return _d(this,e,t,n,r)}},Sd=class extends xd{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){p.useDebugValue(e);let n=this;X(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;X(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;X(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){p.useDebugValue(e);let n=this,r=t!==void 0;X(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return p.useDebugValue(e),_d(this,this.selectors[e],t,n,r)}useContextCallback(e,t){p.useDebugValue(e);let n=Q(t??La);this.context[e]=n}useStateSetter(e){let t=p.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Cd={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},wd=class extends Sd{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:pu(),nested:n,triggerElements:i},Cd),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&lo(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Td(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new wd({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:za,inactiveTriggerProps:za,popupProps:za}}var Ed=e=>e.triggerIdProp??e.activeTriggerId,Dd=e=>e.openProp??e.open,Od=e=>(e.popupElement?.id??e.floatingId)||void 0;function kd(e,t){return t!==void 0&&Dd(e)&&Ed(e)===t}function Ad(e,t){return kd(e,t)?!0:t!==void 0&&Dd(e)&&Ed(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var jd={open:Dd,mounted:e=>e.mounted,transitionStatus:e=>Dd(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Ed,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Od,isTriggerActive:(e,t)=>t!==void 0&&Ed(e)===t,isOpenedByTrigger:(e,t)=>kd(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Ed(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Ad(e,t)?Od(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Md(e){let t=p.useCallback(t=>e===void 0?La:e.subscribeStore(t),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,md.useSyncExternalStore)(t,n,()=>e?.serverStore)}var Nd=$a&&to;function Pd(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=p.useRef(!1),s=p.useRef(null),c=p.useRef(!0),l=Ua();p.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=po(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&_o(t)&&t===Io(nc(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return Rs(Ls(r,`blur`,i),Nd&&Ls(r,`keydown`,a,!0),Nd&&Ls(r,`pointerdown`,l,!0))},[e,n]),p.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);go(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=p.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=Ro(n.nativeEvent);if(go(a)){if(Nd&&!n.relatedTarget){if(!c.current&&!us(a))return}else if(!ps(a))return}let u=ss(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,bs(ws,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,bs(ws,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=go(r)&&r.hasAttribute(dl(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=Io(nc(t));!r&&n===t||Z(a.current.floatingContext?.refs.floating.current,n)||Z(t,n)||o||ss(r??n,e.context.triggerElements)||e.setOpen(!1,bs(ws,i))})}}},[a,r,e,l]);return p.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var Fd=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Ha;restTimeout=new Ha;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Id=new WeakMap;function Ld(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Id.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Id.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Rd(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Id.get(n);a&&a!==e&&Ld(a),Ld(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Id.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function zd(e){let t=e.context.dataRef.current,n=ka(()=>t.hoverInteractionState??Fd.create()).current;return t.hoverInteractionState||=n,Ba(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Bd(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=vu(),u=_u(),d=zd(e),f=Ua(),m=Q(()=>vs(c.current.openEvent?.type,d.interactedInside)),h=Q(()=>ys(c.current.openEvent?.type)),g=Q(()=>{Ld(d)});X(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,g())},[a,d,g]),p.useEffect(()=>g,[g]),X(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&h()&&go(s)&&o){let e=s,t=o,n=nc(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??Lo(e,`[data-rootownerid]`)??n.body;return Rd(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,a,s,o,d,h,l,u,g]),p.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&ll(l.nodesRef.current,u).length>0)}function a(t){let n=gs(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,bs(Cs,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=Ro(e);ds(t)?d.interactedInside=Lo(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function p(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),g()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(ss(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&go(o)&&ll(l.nodesRef.current,r,!1).some(e=>Z(e.context?.elements.floating,o))||(d.handler?d.handler(n):(g(),h()&&!m()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,bs(Cs,n)),l.events.emit(`floating.closed`,n)})}let y=o;return Rs(y&&Ls(y,`mouseenter`,p),y&&Ls(y,`mouseleave`,_),y&&Ls(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,h,m,g,d,l,u,f])}var Vd={current:null};function Hd(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Vd,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:m,guardStaleOpen:h=!1}=t,{dataRef:g,events:_}=e.context,v=vu(l),y=zd(e),b=p.useRef(!1),x=Gs(i),S=Gs(r),C=Gs(o),w=Gs(n),T=Gs(m),E=Gs(f),D=Q(()=>vs(g.current.openEvent?.type,y.interactedInside)),O=Q(()=>T.current?.()!==!1),k=Q((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Z(t,n);if(!go(r))return!1;let a=r;return i.hasMatchingElement(e=>Z(e,a))&&(!t||!Z(t,a))}),A=Q(()=>{y.handler&&=(nc(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=Q(()=>{Ld(y)});return u&&(y.handleCloseOptions=i?.__options),p.useEffect(()=>A,[A]),p.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===Cs,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),p.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=gs(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,bs(Cs,t)),v?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,bs(Cs,t)),v?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!go(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!co(y.pointerType))return;let n=_s(C.current),r=gs(S.current,`open`,y.pointerType),i=Ro(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(go(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Z(t,i)){c=t;break}}go(o)&&go(s)&&!e.context.triggerElements.hasElement(o)&&Z(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&b.current,p=!l&&go(c)&&go(s)&&Z(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,bs(Cs,t,c)):m||(r?y.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,bs(Cs,t,c))}):g&&O()&&e.setOpen(!0,bs(Cs,t,c)))}function o(n){if(D()){j();return}A();let r=nc(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=g.current.floatingContext??d?.();if(!ss(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:v,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n)}else y.pointerType===`touch`&&Z(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){Z(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let f=h?Ls(r,`mouseout`,l):void 0;return s?Rs(Ls(r,`mousemove`,i,{once:!0}),Ls(r,`mouseenter`,i),Ls(r,`mouseleave`,o),f):Rs(Ls(r,`mouseenter`,i),Ls(r,`mouseleave`,o),f)},[A,j,g,S,e,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,h]),p.useMemo(()=>{if(!n)return;function t(e){y.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!co(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;Rd(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=_s(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,bs(Cs,n,r))}y.pointerType===`touch`?st.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}var Ud=.1,Wd=Ud*Ud,Gd=.5;function Kd(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function qd(e,t,n,r,i,a,o,s,c,l){let u=!1;return Kd(e,t,n,r,i,a)&&(u=!u),Kd(e,t,i,a,o,s)&&(u=!u),Kd(e,t,o,s,c,l)&&(u=!u),Kd(e,t,c,l,n,r)&&(u=!u),u}function Jd(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Yd(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Xd(e={}){let{blockPointerEvents:t=!1}=e,n=new Ha,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Wd;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Ro(r),g=r.type===`mouseleave`,_=Z(u,h),v=Z(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&go(r.relatedTarget)&&Z(u,r.relatedTarget))return;function y(){return!!(s&&ll(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Yd(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Yd(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Yd(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Yd(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Jd(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Gd/2:Gd*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Gd+1,o=C||T?S.bottom-Gd:S.top,s=C?T?S.bottom-Gd:S.top:S.bottom-Gd;M=qd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Gd/2:Gd*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Gd,o=C||T?S.top+Gd:S.bottom,s=C?T?S.top+Gd:S.bottom:S.top+Gd;M=qd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Gd/2:Gd*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Gd+1,o=w||E?S.right-Gd:S.left,s=w?E?S.right-Gd:S.left:S.right-Gd;M=qd(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Gd/2:Gd*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Gd,o=w||E?S.left+Gd:S.right,s=w?E?S.left+Gd:S.right:S.left+Gd;M=qd(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Zd(e,t,n){let{reference:r,floating:i}=e,a=vc(t),o=yc(t),s=_c(o),c=mc(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=hc(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Qd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=pc(t,e),p=jc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Mc(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Mc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var $d=50,ef=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Qd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Zd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<$d&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Zd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},tf=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=pc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=mc(r),_=vc(o),v=mc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[kc(o)]:xc(o)),x=p!==`none`;!d&&x&&b.push(...Oc(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=bc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===vc(t)||T.every(e=>vc(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=vc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},nf=new Set([`left`,`top`]);async function rf(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=mc(n),s=hc(n),c=vc(n)===`y`,l=nf.has(o)?-1:1,u=a&&c?-1:1,d=pc(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var af=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await rf(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},of=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=pc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=vc(i),p=gc(f),m=u[p],h=u[f],g=(e,t)=>fc(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},sf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=pc(e,t),u={x:n,y:r},d=vc(i),f=gc(d),p=u[f],m=u[d],h=pc(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=nf.has(mc(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},cf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=pc(e,t),c=await i.detectOverflow(t,s),l=mc(n),u=hc(n),d=vc(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=oc(p-c[m],g),y=oc(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*sc(c.left,c.right):S=p-2*sc(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function lf(e){let t=Ao(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=_o(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=cc(n)!==a||cc(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function uf(e){return go(e)?e:e.contextElement}function df(e){let t=uf(e);if(!_o(t))return uc(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=lf(t),o=(a?cc(n.width):n.width)/r,s=(a?cc(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var ff=uc(0);function pf(e){let t=po(e);return!Oo()||!t.visualViewport?ff:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mf(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===po(e)}function hf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=uf(e),o=uc(1);t&&(r?go(r)&&(o=df(r)):o=df(e));let s=mf(a,n,r)?pf(a):uc(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=po(a),t=go(r)?po(r):r,n=e,i=Fo(n);for(;i&&t!==n;){let e=df(i),t=i.getBoundingClientRect(),r=Ao(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=po(i),i=Fo(n)}}return Mc({width:u,height:d,x:c,y:l})}function gf(e,t){let n=jo(e).scrollLeft;return t?t.left+n:hf(mo(e)).left+n}function _f(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gf(e,n),y:n.top+t.scrollTop}}function vf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=mo(r),s=t?xo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=uc(1),u=uc(0),d=_o(r);if((d||!a)&&((fo(r)!==`body`||yo(o))&&(c=jo(r)),d)){let e=hf(r);l=df(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?_f(o,c):uc(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function yf(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bf(e){let t=jo(e),n=e.ownerDocument.body,r=sc(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=sc(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+gf(e),o=-t.scrollTop;return Ao(n).direction===`rtl`&&(a+=sc(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var xf=25;function Sf(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=po(e),a=mo(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Oo()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(gf(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=xf&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Cf(e,t){let n=hf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=df(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wf(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Sf(e,n,t);else if(t===`document`)r=bf(mo(e));else if(go(t))r=Cf(t,n);else{let n=pf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Mc(r)}function Tf(e,t){let n=t.get(e);if(n)return n;let r=Po(e,[],!1).filter(e=>go(e)&&fo(e)!==`body`),i=null,a=Ao(e).position===`fixed`,o=a?Mo(e):e;for(;go(o)&&!ko(o);){let e=Ao(o),t=Eo(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Mo(o)}return t.set(e,r),r}function Ef(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?xo(t)?[]:Tf(t,this._c):[].concat(n),r],o=wf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=wf(t,a[e],i);s=sc(n.top,s),c=oc(n.right,c),l=oc(n.bottom,l),u=sc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Df(e){let{width:t,height:n}=lf(e);return{width:t,height:n}}function Of(e,t,n){let r=_o(t),i=mo(t),a=n===`fixed`,o=hf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=uc(0);if((r||!a)&&((fo(t)!==`body`||yo(i))&&(s=jo(t)),r)){let e=hf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=gf(i));let l=i&&!r&&!a?_f(i,s):uc(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function kf(e){return Ao(e).position===`static`}function Af(e,t){if(!_o(e)||Ao(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return mo(e)===n&&(n=n.ownerDocument.body),n}function jf(e,t){let n=po(e);if(xo(e))return n;if(!_o(e)){let t=Mo(e);for(;t&&!ko(t);){if(go(t)&&!kf(t))return t;t=Mo(t)}return n}let r=Af(e,t);for(;r&&bo(r)&&kf(r);)r=Af(r,t);return r&&ko(r)&&kf(r)&&!Eo(r)?n:r||Do(e)||n}var Mf=async function(e){let t=this.getOffsetParent||jf,n=this.getDimensions,r=await n(e.floating);return{reference:Of(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nf(e){return Ao(e).direction===`rtl`}var Pf={convertOffsetParentRelativeRectToViewportRelativeRect:vf,getDocumentElement:mo,getClippingRect:Ef,getOffsetParent:jf,getElementRects:Mf,getClientRects:yf,getDimensions:Df,getScale:df,isElement:go,isRTL:Nf};function Ff(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function If(e,t,n){let r=null,i,a=mo(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=lc(d),h=lc(a.clientWidth-(u+f)),g=lc(a.clientHeight-(d+p)),_=lc(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:sc(0,oc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ff(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=po(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Lf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=uf(e),u=i||a?[...l?Po(l):[],...t?Po(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?If(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?hf(e):null;c&&g();function g(){let t=hf(e);h&&!Ff(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Rf=af,zf=of,Bf=tf,Vf=cf,Hf=sf,Uf=(e,t,n)=>{let r=new Map,i=n??{},a={...Pf,...i.platform,_c:r};return ef(e,t,{...i,platform:a})},Wf=typeof document<`u`?p.useLayoutEffect:function(){};function Gf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Gf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Gf(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Kf(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qf(e,t){let n=Kf(e);return Math.round(t*n)/n}function Jf(e){let t=p.useRef(e);return Wf(()=>{t.current=e}),t}function Yf(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=p.useState(r);Gf(f,r)||m(r);let[h,g]=p.useState(null),[_,v]=p.useState(null),y=p.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=p.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=p.useRef(null),w=p.useRef(null),T=p.useRef(u),E=c!=null,D=Jf(c),O=Jf(i),k=Jf(l),A=p.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Uf(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Gf(T.current,t)&&(T.current=t,st.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Wf(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=p.useRef(!1);Wf(()=>(j.current=!0,()=>{j.current=!1}),[]),Wf(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=p.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=p.useMemo(()=>({reference:x,floating:S}),[x,S]),P=p.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=qf(N.floating,u.x),r=qf(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Kf(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Xf=(e,t)=>{let n=Rf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zf=(e,t)=>{let n=zf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qf=(e,t)=>({fn:Hf(e).fn,options:[e,t]}),$f=(e,t)=>{let n=Bf(e);return{name:n.name,fn:n.fn,options:[e,t]}},ep=(e,t)=>{let n=Vf(e);return{name:n.name,fn:n.fn,options:[e,t]}},tp=p.createContext(void 0);function np(e){let t=p.useContext(tp);if(t===void 0&&!e)throw Error(Bu(47));return t}var rp={...jd,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!jd.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&jd.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>jd.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},ip=class extends Sd{constructor(e,t,n){let r=new ld;super(ap(e,r,t,n),op(r),rp)}setOpen=(e,t)=>{let n=t.reason===Cs,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=nd(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=td(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),st.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function ap(e,t,n,r=!1){let i={...Td(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function op(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeTriggerFocusGuardRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Ha,stickIfOpen:!0,triggerElements:e}}var sp=Pa(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=lp(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),h=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),cd(u,d),ad(u);let{forceUnmount:g}=od(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),p.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>u.setOpen(!1,bs(Ms))}),[g,u]);let _=d||f||s!=null;return(0,m.jsxs)(tp.Provider,{value:u,children:[s&&(0,m.jsx)(Qu,{handle:s,store:u}),_&&(0,m.jsx)(up,{store:u,modal:o}),typeof t==`function`?t({payload:h}):t]})});function cp(e){return np(!0)?(0,m.jsx)(sp,{props:e}):(0,m.jsx)(xu,{children:(0,m.jsx)(sp,{props:e})})}function lp(e,t){let n=Zu((e,n)=>new ip(t,e,n));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function up({store:e,modal:t}){let n=Ru(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return sd(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var dp=p.createContext(void 0);function fp(e=!1){let t=p.useContext(dp);if(t===void 0&&!e)throw Error(Bu(16));return t}function pp(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:p.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function mp(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(po(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function hp(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=p.useRef(null),s=fp(!0),c=a??s!==void 0,{props:l}=pp({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=p.useCallback(()=>{let e=o.current;gp(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return X(u,[u]),{getButtonProps:p.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Rl({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Jl(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=gp(r),s=!i&&_p(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),mp(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),mp(r,e)))},onKeyUp(e){t||(Jl(e),a?.(e),e.target===e.currentTarget&&i&&c&&gp(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),mp(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Q(e=>{o.current=e,u()})}}function gp(e){return _o(e)&&e.tagName===`BUTTON`}function _p(e){return _o(e)&&e.tagName===`A`&&!!e.href}function vp(e){return kl(e,`base-ui`)}function yp(e,t){function n(n,r,i){let a=n.currentTarget;st.flushSync(()=>{e.setOpen(!1,bs(Ds,n.nativeEvent,a))}),al(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&ol(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function bp(e){let t=p.useRef(``),n=p.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:p.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function xp(e,t){let{onClick:n,onPointerDown:r}=bp(Q((n,r)=>{(typeof e==`function`?e():e)||t(r||(Xa?`touch`:``))}));return p.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}var Sp=Fa(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...h}=e,g=np(!0),_=Md(s)??g;if(!_)throw Error(Bu(74));let v=vp(f),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`triggerPopupId`,v),C=p.useRef(null),{registerTrigger:w,isMountedByThisTrigger:T}=id(v,C,_,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),E=_.useState(`isPressOpenedByTrigger`,v),D=_.useState(`isTouchPressOpen`,l),O=_.useState(`hasTriggerFocusGuards`,v),k=Hd(b,{enabled:!a&&l&&!D,mouseOnly:!0,move:!1,handleClose:Xd(),restMs:u,delay:{close:d},triggerElementRef:C,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`}),A=Mu(b,{stickIfOpen:Q(()=>_.context.stickIfOpen)}),j=xp(()=>_.select(`open`),e=>{_.set(`openMethod`,e)}),M=_.useState(`triggerProps`,T),{getButtonProps:N,buttonRef:P}=hp({disabled:a,native:o}),F={open(e){return E?rs.open(e):ns.open(e)}},{handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=yp(_,C),R=Zl(`button`,e,{state:{disabled:a,open:x},ref:[P,t,w,C],props:[A.reference,k,M,j,{[au]:``,id:v,"aria-haspopup":`dialog`,"aria-expanded":x,"aria-controls":S},h,N],stateAttributesMapping:F}),ee=(0,m.jsx)(p.Fragment,{children:R},v);return O?(0,m.jsxs)(p.Fragment,{children:[(0,m.jsx)(ac,{ref:_.context.beforeTriggerFocusGuardRef,onFocus:I}),ee,(0,m.jsx)(ac,{ref:_.context.triggerFocusTargetRef,onFocus:L})]}):ee}),Cp=p.createContext(void 0);function wp(){let e=p.useContext(Cp);if(e===void 0)throw Error(Bu(45));return e}var Tp=p.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return np().useState(`mounted`)||n?(0,m.jsx)(Cp.Provider,{value:n,children:(0,m.jsx)(fu,{ref:t,...r})}):null});function Ep(e){return jl(19)?e:e?`true`:void 0}var Dp=p.createContext(void 0);function Op(){let e=p.useContext(Dp);if(!e)throw Error(Bu(46));return e}function kp(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=p.useState(null),d=p.useRef(null),f=vu(n),m=p.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),h=Yf({...e,elements:{...m,...l&&{reference:l}}}),g=p.useCallback(e=>{let t=go(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=p.useMemo(()=>({...h.refs,setPositionReference:g,domReference:d}),[h.refs,g]),v=p.useMemo(()=>({...h.elements,domReference:o}),[h.elements,o]),y=p.useMemo(()=>({...h,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:_,elements:v,nodeId:t,rootStore:r}),[h,_,v,t,r,s,c]);return X(()=>{o&&(d.current=o)},[o]),X(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),p.useMemo(()=>({...h,context:y,refs:_,elements:v,rootStore:r}),[h,_,v,y,r])}var Ap=p.createContext(void 0);function jp(){return p.useContext(Ap)?.direction??`ltr`}var Mp=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=pc(e,t)||{};if(l==null)return{};let d=jc(u),f={x:n,y:r},p=yc(i),m=_c(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=fc(D,k,O),j=!c.arrow&&hc(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Np=(e,t)=>{let{name:n,fn:r}=Mp(e);return{name:n,fn:r,options:[e,t]}},Pp={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Fp={sideX:`left`,sideY:`top`},Ip=`--available-width`,Lp=`--available-height`,Rp=`--anchor-width`,zp=`--anchor-height`,Bp=`--transform-origin`,Vp=Ip,Hp=Lp;function Up(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Wp(e,t,n){let{rects:r,placement:i}=e;return{side:Up(t,mc(i),n),align:hc(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Gp(e){return Kp(e,kp)}function Kp(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=Q(k),j=k?A:n,M=Gs(n),N=Gs(_),P=jp()===`rtl`,[F,I]=p.useState(null);!_&&F!==null&&I(null);let L=S===`placement`,R=F?mc(F):null,ee=F&&L?hc(F)||`center`:null,z=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],te=ee||o,B=te===`center`?z:`${z}-${te}`,ne=l;typeof ne==`number`?ne={top:ne,right:ne,bottom:ne,left:ne}:ne&&={top:ne.top||0,right:ne.right||0,bottom:ne.bottom||0,left:ne.left||0};let re=+(i===`bottom`),V=+(i===`top`),ie=+(i===`right`),H=+(i===`left`),ae={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:ne},U=p.useRef(null),W=Gs(a),oe=Gs(s),se=typeof a==`function`?0:a,G=typeof s==`function`?0:s,ce=[];m&&ce.push(m),ce.push(Xf(e=>{let t=Wp(e,i,P),n=typeof W.current==`function`?W.current(t):W.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,G,P,i]));let le=T===`none`&&w!==`shift`,ue=!le&&(u||D||w===`shift`),de=w===`none`?null:$f({...ae,padding:{top:ne.top+1+re,right:ne.right+1+H,bottom:ne.bottom+1+V,left:ne.left+1+ie},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),fe=le?null:Zf({...ae,rootBoundary:O,mainAxis:T!==`none`,crossAxis:ue,limiter:u||D?void 0:Qf(e=>{if(!U.current)return{};let{width:t,height:n}=U.current.getBoundingClientRect(),r=vc(mc(e.placement)),i=r===`y`?t:n,a=r===`y`?ne.left+ne.right:ne.top+ne.bottom;return{offset:i/2+a/2}})},[ae,u,D,O,ne,T]);w===`shift`||T===`shift`||te===`center`?ce.push(fe,de):ce.push(de,fe),ce.push(ep({...ae,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(Vp,`${t}px`),i.setProperty(Hp,`${n}px`);let a=po(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Rp,`${u}px`),i.setProperty(zp,`${d}px`)}}),Np(e=>({element:U.current||nc(e.elements.floating).createElement(`div`),padding:U.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=mc(r),u=hc(r),d=vc(l)===`y`,f=U.current,p=typeof a==`function`?a(Wp(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ue&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Bp,d?`${m} ${h}`:`${h} ${m}`),{}}},Pp,x),X(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let pe=p.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:g,open:h?_:void 0,placement:B,middleware:ce,strategy:r,whileElementsMounted:h?void 0:(...e)=>Lf(...e,pe),nodeId:b,externalTree:C}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||Fp,Ee=Se?r:`fixed`,De=p.useMemo(()=>{let e;return e=Se?x?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[Vp]=`100vw`,e[Hp]=`100vh`,Se||(e.opacity=0),e},[x,Ee,we,ge,Te,_e,Ce,Se]),Oe=p.useRef(null);X(()=>{if(!_)return;let e=M.current,t=typeof e==`function`?e():e,n=(qp(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[_,me,j,M]),p.useEffect(()=>{if(!_)return;let e=M.current;typeof e!=`function`&&qp(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[_,me,j,M]),p.useEffect(()=>{if(h&&_&&he.reference&&he.floating)return Lf(he.reference,he.floating,ye,pe)},[h,_,he,ye,pe]);let ke=mc(be),Ae=Up(i,ke,P),je=hc(be)||`center`,Me=!!ve.hide?.referenceHidden;X(()=>{S&&_&&Se&&(ke!==z||L&&je!==te)&&I(be)},[S,L,_,Se,be,ke,je,z,te]);let Ne=p.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),Pe=ve.arrow?.centerOffset!==0;return p.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:U,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Ne,U,Pe,Ae,je,ke,Me,me,xe,Se,ye])}function qp(e){return e!=null&&`current`in e}var Jp=p.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,m.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Yp(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=p.useRef(null),o=p.useRef(null),s=Ku(r);X(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),X(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function Xp(e){return e===`starting`?iu:za}function Zp(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Zl(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Xp(r),i],stateAttributesMapping:is})}var Qp={},$p={},em=``;function tm(e,t){return yo(e)?e:t}function nm(e,t,n){return/hidden|clip/.test(e.getComputedStyle(tm(t,n)).overflowY)}function rm(e){if(typeof document>`u`)return!1;let t=nc(e);return po(t).innerWidth-t.documentElement.clientWidth>0}function im(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=nc(e),n=t.documentElement,r=t.body,i=tm(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function am(e){let t=nc(e),n=t.documentElement,r=t.body,i=tm(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function om(e){let t=nc(e),n=t.documentElement,r=t.body,i=po(n),a=0,o=0,s=!1,c=ec.create();if(to&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Qp={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},em=n.style.scrollBehavior,$p={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=tm(n,r);s=im(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Qp),Object.assign(r.style,$p),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=em)}function d(){u(),c.request(l)}l();let f=Ls(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var sm=new class{lockCount=0;restore=null;timeoutLock=Ha.create();timeoutUnlock=Ha.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=nc(e),n=t.documentElement,r=t.body,i=po(n);if(nm(i,n,r)){let t=new i.MutationObserver(()=>{nm(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Xa||!rm(e);this.restore=a?am(e):om(e)}};function cm(e=!0,t=null){X(()=>{if(e)return sm.acquire(t)},[e,t])}var lm=20;function um(e,t,n,r){let[i,a]=p.useState(!1);X(()=>{if(!e||!t||n==null){a(!1);return}let r=nc(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-lm)},[e,t,n]),cm(e&&(!t||i),r)}var dm=p.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:h,disableAnchorTracking:g=!1,collisionAvoidance:_=ou,...v}=e,y=np(),b=wp(),x=yu(),S=y.useState(`floatingRootContext`),C=y.useState(`mounted`),w=y.useState(`open`),T=y.useState(`openChangeReason`),E=y.useState(`activeTriggerElement`),D=y.useState(`modal`),O=y.useState(`openMethod`),k=y.useState(`positionerElement`),A=y.useState(`instantType`),j=y.useState(`transitionStatus`),M=Gp({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:h,disableAnchorTracking:g,keepMounted:b,nodeId:x,collisionAvoidance:_,adaptiveOrigin:y.useState(`adaptiveOrigin`)});Yp({store:y,domReference:S.useState(`domReferenceElement`),positionerElement:k,open:w});let N=D===!0&&T!==`trigger-hover`;um(w&&N,O===`touch`,k,E);let P=y.useStateSetter(`positionerElement`),F=Zp(e,{open:w,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:A},{styles:M.positionerStyles,transitionStatus:j,props:v,refs:[t,P],hidden:!C,inert:!w});return(0,m.jsxs)(Dp.Provider,{value:M,children:[C&&N&&(0,m.jsx)(Jp,{inert:Ep(!w),cutout:E}),(0,m.jsx)(bu,{id:x,children:F})]})}),fm=`ArrowUp`,pm=`ArrowDown`,mm=`ArrowLeft`,hm=`ArrowRight`,gm=new Set([fm,pm,mm,hm,`Home`,`End`]),_m=[`Shift`,`Control`,`Alt`,`Meta`];function vm(e){return _o(e)&&e.tagName===`INPUT`}function ym(e){return!!(vm(e)&&e.selectionStart!=null||_o(e)&&e.tagName===`TEXTAREA`)}function bm(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=xm(e,t,`left`),a=Sm(e),o=Sm(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=xm(e,t,`top`),r=Sm(e),i=Sm(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function xm(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Sm(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var Cm=p.createContext(void 0);function wm(e){let t=p.useContext(Cm);if(t===void 0&&!e)throw Error(Bu(69));return t}var Tm=p.createContext(void 0);function Em(){let[e,t]=p.useState(0),n=Q(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var Dm=p.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=np(),l=Op(),u=wm(!0)!=null,{context:d,hasClosePart:f}=Em(),p=c.useState(`open`),h=c.useState(`openMethod`),g=c.useState(`instantType`),_=c.useState(`transitionStatus`),v=c.useState(`popupProps`),y=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);qu({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Bd(T,{enabled:O&&!D,closeDelay:k});let A=a===void 0?Xu(c.context.popupRef):a,j=x!==!1&&f;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N=Zl(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:g,transitionStatus:_},ref:[t,c.context.popupRef,M],props:[v,{id:E,role:`dialog`,...Yu,"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){u&&gm.has(e.key)&&e.stopPropagation()}},Xp(_),s],stateAttributesMapping:as});return(0,m.jsx)(ju,{context:T,openInteractionType:h,modal:j,disabled:!S||C===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:_o(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,m.jsx)(Tm.Provider,{value:d,children:N})})}),Om=cp,km=Sp,Am=(0,p.forwardRef)(({className:e,side:t=`bottom`,align:n=`end`,sideOffset:r=4,...i},a)=>(0,m.jsx)(Tp,{children:(0,m.jsx)(dm,{side:t,align:n,sideOffset:r,collisionPadding:8,className:`z-40`,children:(0,m.jsx)(Dm,{ref:a,className:Sa(`rise w-72 overflow-hidden rounded-md border border-line bg-popover/95 text-zinc-300 shadow-xl backdrop-blur focus-visible:outline-none`,e),...i})})}));Am.displayName=`PopoverContent`;var jm=48,Mm=60,Nm=24;function Pm({glyph:e,label:t,placeholder:n,value:r,onChange:i,options:a,loading:o,failed:s,search:c,onSearchChange:l,hasMore:u,loadingMore:d,onLoadMore:f,allowCustom:h=!0,title:g}){let[_,v]=(0,p.useState)(!1),[y,b]=(0,p.useState)(``),x=l!==void 0,S=x?c??``:y,C=x?l:b,w=(0,p.useMemo)(()=>{let e=S.trim().toLowerCase(),t=e&&!x?a.filter(t=>t.value.toLowerCase().includes(e)):a;return[...r.filter(e=>!t.some(t=>t.value===e)).filter(t=>!e||t.toLowerCase().includes(e)).map(e=>({value:e,count:0})),...t]},[a,S,x,r]),T=(0,p.useRef)(null),E=()=>{let e=T.current;e&&u&&!d&&f&&e.scrollTop+e.clientHeight>=e.scrollHeight-jm&&f()},D=e=>{i(r.includes(e)?r.filter(t=>t!==e):[...r,e])},O=w.length>Mm,k=Jt({count:w.length,getScrollElement:()=>T.current,estimateSize:()=>Nm,overscan:8,enabled:O}),A=e=>{let t=r.includes(e.value);return(0,m.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>D(e.value),className:Sa(`mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs hover:bg-zinc-800`,t?`text-zinc-100`:`text-zinc-400`),children:[(0,m.jsx)(`span`,{className:`w-3 shrink-0`,children:t&&(0,m.jsx)(Pr,{width:12,height:12})}),(0,m.jsx)(`span`,{className:`truncate`,children:e.value}),(0,m.jsx)(`span`,{className:`ml-auto shrink-0 text-[10px] text-zinc-600`,children:e.count})]},e.value)},j=S.trim(),M=h&&j!==``&&!w.some(e=>e.value===j)&&!r.includes(j);return(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-line px-2 py-1 transition-colors focus-within:border-zinc-600`,children:[e!==void 0&&(0,m.jsx)(`span`,{className:`shrink-0 text-zinc-600`,"aria-hidden":!0,children:e}),(0,m.jsxs)(Om,{open:_,onOpenChange:v,children:[(0,m.jsx)(km,{render:(0,m.jsx)(`button`,{type:`button`,"aria-label":t,title:g??t,className:`mono flex min-w-0 flex-1 flex-wrap items-center gap-1 py-0.5 text-left text-xs text-zinc-200 focus:outline-none`}),children:r.length===0?(0,m.jsx)(`span`,{className:`text-zinc-600`,children:n}):r.map(e=>(0,m.jsx)(wa,{className:`mono max-w-[10rem] truncate`,children:e},e))}),(0,m.jsxs)(Am,{align:`start`,className:`w-72 p-0`,children:[(0,m.jsx)(`div`,{className:`border-b border-line px-2`,children:(0,m.jsx)(Ea,{autoFocus:!0,value:S,onChange:e=>C(e.target.value),placeholder:h?`search, or type a value…`:`search…`,onKeyDown:e=>{e.key===`Enter`&&M&&(e.preventDefault(),D(j),C(``))}})}),(0,m.jsxs)(`div`,{ref:T,onScroll:E,className:`max-h-64 overflow-auto py-1`,role:`listbox`,tabIndex:-1,"aria-multiselectable":!0,"aria-label":t,children:[M&&(0,m.jsxs)(`button`,{type:`button`,"aria-label":`use ${j} as typed`,onClick:()=>{D(j),C(``)},className:`mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs text-zinc-300 hover:bg-zinc-800`,children:[(0,m.jsx)(`span`,{className:`w-3 shrink-0 text-zinc-600`,children:`+`}),(0,m.jsx)(`span`,{className:`truncate`,children:j}),(0,m.jsx)(`span`,{className:`ml-auto text-[10px] text-zinc-600`,children:`use as typed`})]}),d&&w.length>0&&(0,m.jsx)(`p`,{className:`px-2 py-1 text-[10px] text-zinc-600`,children:`loading more…`}),w.length===0&&!M&&(0,m.jsx)(`p`,{className:Sa(`px-2 py-2 text-[11px]`,s?`text-rose-300`:`text-zinc-600`),children:s?`couldn't load values — type one instead`:o?`loading…`:`no values here`}),O?(0,m.jsx)(`div`,{className:`relative w-full`,style:{height:`${k.getTotalSize()}px`},children:k.getVirtualItems().map(e=>(0,m.jsx)(`div`,{ref:k.measureElement,"data-index":e.index,className:`absolute top-0 left-0 w-full`,style:{transform:`translateY(${e.start}px)`},children:A(w[e.index])},w[e.index]?.value??e.key))}):w.map(A)]})]})]}),r.length>0&&(0,m.jsx)(Y,{variant:`ghost`,size:`icon`,onClick:()=>i([]),title:`clear ${t}`,"aria-label":`clear ${t}`,className:`h-4 w-4`,children:(0,m.jsx)(Fr,{width:12,height:12})})]})}var Fm=50,Im=200;function Lm(e,t){let[n,r]=(0,p.useState)(e);return(0,p.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function Rm(e){return e.filter(e=>e.value!==null).map(e=>({value:e.value,count:e.count}))}function zm({field:e,scope:t,value:n,onChange:r,glyph:i,label:a,placeholder:o,title:s,single:c}){let[l,u]=(0,p.useState)(``),d=Lm(l,Im),f=et({queryKey:[`run-values`,e,t,d],queryFn:({pageParam:n})=>yr.values(e,t,{limit:Fm,offset:n,search:d}),initialPageParam:0,getNextPageParam:(e,t)=>e.length<Fm?void 0:t.reduce((e,t)=>e+t.length,0),staleTime:1e4,refetchInterval:1e4}),h=(0,p.useMemo)(()=>Rm(f.data?.pages.flat()??[]),[f.data]);return(0,m.jsx)(Pm,{label:a,placeholder:o,...s!==void 0&&{title:s},...i!==void 0&&{glyph:i},value:n,onChange:e=>r(c?e.slice(-1):e),options:h,search:l,onSearchChange:u,loading:f.isLoading,failed:f.isError,hasMore:f.hasNextPage,loadingMore:f.isFetchingNextPage,onLoadMore:()=>void f.fetchNextPage()})}var Bm=[{op:`eq`,label:`is`},{op:`in`,label:`is any of`},{op:`ne`,label:`is not`},{op:`gte`,label:`≥`},{op:`gt`,label:`>`},{op:`lte`,label:`≤`},{op:`lt`,label:`<`}];function Vm(e){let[t,n,...r]=e.split(`:`);return!t||!n||r.length===0?null:{key:t,op:n,operand:r.join(`:`)}}function Hm(e){let t=Vm(e);if(!t)return e;let n=Bm.find(e=>e.op===t.op)?.label??t.op;return`${t.key} ${n} ${t.operand.split(`|`).join(`, `)}`}function Um({value:e,onChange:t,scope:n}){let[r,i]=(0,p.useState)(!1),[a,o]=(0,p.useState)(``),[s,c]=(0,p.useState)(`eq`),[l,u]=(0,p.useState)([]),[d,f]=(0,p.useState)(``),h=s===`eq`||s===`in`,g=h?l.join(`|`):d.trim(),_=a!==``&&g!==``,v=()=>{o(``),c(`eq`),u([]),f(``)},y=()=>{if(!_)return;let n=s===`in`&&l.length===1?`eq`:s;t([...e,`${a}:${n}:${g}`]),v(),i(!1)};return(0,m.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 rounded-md border border-line px-2 py-1 transition-colors focus-within:border-zinc-600`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-zinc-600`,"aria-hidden":!0,children:`⛃`}),(0,m.jsxs)(Om,{open:r,onOpenChange:e=>{i(e),e||v()},children:[(0,m.jsx)(km,{render:(0,m.jsx)(`button`,{type:`button`,"aria-label":`filter by search attribute`,title:`Typed search attributes (WorkflowRun.searchAttributes)`,className:`mono flex min-w-0 flex-1 flex-wrap items-center gap-1 py-0.5 text-left text-xs text-zinc-200 focus:outline-none`}),children:e.length===0?(0,m.jsx)(`span`,{className:`text-zinc-600`,children:`filter by attribute…`}):e.map(e=>(0,m.jsx)(wa,{variant:`attr`,className:`mono max-w-[12rem] truncate`,children:Hm(e)},e))}),(0,m.jsx)(Am,{align:`start`,className:`w-80 p-2`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e.length>0&&(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1 border-b border-line pb-1.5`,children:e.map(n=>(0,m.jsxs)(wa,{variant:`attr`,className:`mono gap-1 py-0.5`,children:[Hm(n),(0,m.jsx)(Y,{variant:`ghost`,size:`icon`,className:`h-3 w-3 text-indigo-300/70 hover:text-indigo-100`,title:`remove ${Hm(n)}`,"aria-label":`remove ${Hm(n)}`,onClick:()=>t(e.filter(e=>e!==n)),children:(0,m.jsx)(Fr,{width:10,height:10})})]},n))}),(0,m.jsx)(zm,{field:`attr`,scope:n,glyph:`⛃`,label:`attribute key`,placeholder:`key…`,single:!0,value:a?[a]:[],onChange:e=>{o(e.at(-1)??``),u([])}}),(0,m.jsx)(`select`,{"aria-label":`operator`,value:s,onChange:e=>c(e.target.value),className:`mono rounded-md border border-line bg-transparent px-2 py-1.5 text-xs text-zinc-200 focus:border-zinc-600 focus:outline-none`,children:Bm.map(e=>(0,m.jsx)(`option`,{value:e.op,className:`bg-zinc-900`,children:e.label},e.op))}),h?(0,m.jsx)(zm,{field:`attr.${a}`,scope:n,glyph:`=`,label:`attribute value`,placeholder:a?`value…`:`pick a key first`,...s!==`in`&&{single:!0},value:l,onChange:u}):(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-line px-2 focus-within:border-zinc-600`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-zinc-600`,"aria-hidden":!0,children:`=`}),(0,m.jsx)(Ea,{value:d,onChange:e=>f(e.target.value),placeholder:`value…`,"aria-label":`attribute value`,onKeyDown:e=>{e.key===`Enter`&&y()}})]}),(0,m.jsx)(Y,{variant:`brand`,size:`chip`,className:`mono self-end rounded`,disabled:!_,onClick:y,children:`add filter`})]})})]}),e.length>0&&(0,m.jsx)(Y,{variant:`ghost`,size:`icon`,onClick:()=>t([]),title:`clear attribute filters`,"aria-label":`clear attribute filters`,className:`h-4 w-4`,children:(0,m.jsx)(Fr,{width:12,height:12})})]})}var Wm=p.createContext(void 0);function Gm(e){let t=p.useContext(Wm);if(t===void 0&&!e)throw Error(Bu(72));return t}var Km={...jd,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},qm=class extends Sd{constructor(e,t,n){let r=new ld;super(Jm(e,r,t,n),Ym(r),Km)}setOpen=(e,t)=>{rd(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,bs(Ss,e))}};function Jm(e,t,n,r=!1){return{...Td(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Ym(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Xm=Pa(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,h=Zu((e,t)=>new qm({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));h.useControlledProp(`openProp`,r),h.useControlledProp(`triggerIdProp`,u),h.useContextCallback(`onOpenChange`,s),h.useContextCallback(`onOpenChangeComplete`,c);let g=h.useState(`open`),_=!t&&g,v=h.useState(`activeTriggerId`),y=h.useState(`mounted`),b=h.useState(`payload`);h.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),ad(h,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:x,transitionStatus:S}=od(_,h),C=h.useState(`isInstantPhase`),w=h.useState(`instantType`),T=h.useState(`lastOpenChangeReason`),E=p.useRef(null);X(()=>{g&&t&&h.setOpen(!1,bs(ks))},[g,t,h]),X(()=>{S===`ending`&&T===`none`||S!==`ending`&&C?(w!==`delay`&&(E.current=w),h.set(`instantType`,`delay`)):E.current!==null&&(h.set(`instantType`,E.current),E.current=null)},[S,C,T,w,h]),X(()=>{_&&(v??h.set(`payload`,void 0))},[h,v,_]),p.useImperativeHandle(o,()=>({unmount:x,close:()=>h.setOpen(!1,bs(Ms))}),[x,h]);let D=_||y||!t&&a!==`none`;return(0,m.jsxs)(Wm.Provider,{value:h,children:[l&&(0,m.jsx)(Qu,{handle:l,store:h}),D&&(0,m.jsx)(Zm,{store:h,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:b}):f]})});function Zm({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Ru(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Fu(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=p.useMemo(()=>Rl(a.reference,i.reference),[a.reference,i.reference]);return sd(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??za}),null}var Qm=p.createContext(void 0);function $m(){return p.useContext(Qm)}var eh=`data-base-ui-tooltip-trigger`;function th(e){let t=Ro(e);return go(t)?t:null}var nh=Fa(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,m=Gm(!0),h=Md(a)??m;if(!h)throw Error(Bu(82));let g=vp(d),_=h.useState(`isTriggerActive`,g),v=h.useState(`isOpenedByTrigger`,g),y=h.useState(`floatingRootContext`),b=p.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=id(g,b,h,{payload:o,closeOnClick:l,closeDelay:x}),w=$m(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=Is(y,{open:v}),k=zd(y);h.useSyncedValue(`isInstantPhase`,D);let A=h.useState(`disabled`),j=s??A,M=Gs(j),N=h.useState(`trackCursorAxis`),P=h.useState(`disableHoverablePopup`),F=p.useRef(!1),I=Ua(),L=p.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function ee(e){let t=b.current;if(!t||!e)return!1;let n=Lo(e,`[${eh}]`);return n!==null&&n!==t&&Z(t,n)}function z(e){let t=ee(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let te=Hd(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Xd():null,restMs:R,delay(){return u==null&&O?{close:gs(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),B=Pd(y,{enabled:!j}).reference,ne=e=>{let t=F.current,n=th(e),r=z(n),i=b.current,a=i&&n&&Z(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`)h.setOpen(!1,bs(Cs,e));else if(t&&!r&&a&&!M.current&&!h.select(`open`)&&i&&co(L.current)){let t=()=>{F.current||M.current||h.select(`open`)||h.setOpen(!0,bs(Cs,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},re=h.useState(`appliedTriggerProps`,C||N!==`none`);return Zl(`button`,e,{state:{open:v},ref:[t,S,b],props:[te,B,re,{onMouseOver(e){ne(e.nativeEvent)},onFocus(e){ee(th(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,h.set(`closeOnClick`,l),l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},id:g,[os]:j?``:void 0,[eh]:j?void 0:``},f],stateAttributesMapping:ns})}),rh=p.createContext(void 0);function ih(){let e=p.useContext(rh);if(e===void 0)throw Error(Bu(70));return e}var ah=p.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=du({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,m.jsxs)(p.Fragment,{children:[l,c&&st.createPortal(n,c)]})}),oh=p.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Gm().useState(`mounted`)||n?(0,m.jsx)(rh.Provider,{value:n,children:(0,m.jsx)(ah,{ref:t,...r})}):null}),sh=p.createContext(void 0);function ch(){let e=p.useContext(sh);if(e===void 0)throw Error(Bu(71));return e}var lh=p.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=ou,style:v,...y}=e,b=Gm(),x=ih(),S=b.useState(`open`),C=b.useState(`mounted`),w=b.useState(`trackCursorAxis`),T=b.useState(`disableHoverablePopup`),E=b.useState(`floatingRootContext`),D=b.useState(`instantType`),O=b.useState(`transitionStatus`),k=Gp({anchor:i,positionMethod:a,floatingRootContext:E,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:h,arrowPadding:f,disableAnchorTracking:g,keepMounted:x,collisionAvoidance:_,adaptiveOrigin:b.useState(`adaptiveOrigin`)}),A=Zp(e,p.useMemo(()=>({open:S,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:w===`none`?D:`tracking-cursor`}),[S,k.side,k.align,k.anchorHidden,w,D]),{styles:k.positionerStyles,transitionStatus:O,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!C,inert:!S||w===`both`||T});return(0,m.jsx)(sh.Provider,{value:k,children:A})}),uh=p.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Gm(),{side:s,align:c}=ch(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);qu({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Bd(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Zl(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Yu,f,Xp(d),a],stateAttributesMapping:as})}),dh=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=p.useMemo(()=>({open:t,close:n}),[t,n]);return(0,m.jsx)(Qm.Provider,{value:t,children:(0,m.jsx)(Fs,{delay:i,timeoutMs:r,children:e.children})})};function fh({children:e,...t}){return(0,m.jsx)(dh,{delay:150,closeDelay:80,...t,children:e})}var ph=Xm,mh=nh,hh=`z-50 max-w-[280px] whitespace-pre-line rounded-md border border-line bg-popover/95 px-2 py-1 text-left text-[10px] leading-relaxed text-zinc-300 shadow-xl backdrop-blur`;function gh({label:e,suppressed:t,side:n=`bottom`,align:r=`end`,children:i}){return(0,m.jsxs)(ph,{disabled:t??!1,children:[(0,m.jsx)(mh,{render:i}),(0,m.jsx)(oh,{children:(0,m.jsx)(lh,{side:n,align:r,sideOffset:4,collisionPadding:8,children:(0,m.jsx)(uh,{className:Sa(hh),children:e})})})]})}function _h(e){return e[0]===e[1]?`v${e[0]}`:`v${e[0]}–${e[1]}`}function vh(e){return e.groups.some(e=>e.incompatible)?`incompatible`:e.groups.some(e=>e.degraded)?`degraded`:`compatible`}function yh(e){return e===`incompatible`?`s-failed`:e===`degraded`?`s-suspended`:`s-completed`}function bh({pod:e}){return(0,m.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-2.5 py-1.5`,children:[(0,m.jsxs)(`div`,{className:`mono flex items-center gap-1.5 text-[10px]`,children:[(0,m.jsx)(`span`,{className:`dot ${yh(e.outcome)}`,"aria-hidden":!0}),(0,m.jsx)(`span`,{className:`truncate text-zinc-300`,children:e.instanceId}),(0,m.jsx)(`span`,{className:`tnum shrink-0 text-zinc-500`,children:_h(e.protocolRange)}),(0,m.jsx)(`span`,{className:Sa(`shrink-0 uppercase tracking-wider`,e.outcome===`incompatible`&&`text-rose-300`,e.outcome===`degraded`&&`text-amber-300`,e.outcome===`compatible`&&`text-zinc-500`),children:e.outcome})]}),e.reason&&(0,m.jsx)(`div`,{className:`mono text-[10px] text-rose-300/80`,children:e.reason}),e.missingOnRemote.length>0&&(0,m.jsxs)(`div`,{className:`mono text-[10px] text-zinc-500`,children:[`missing on worker: `,e.missingOnRemote.join(`, `)]}),e.missingOnLocal.length>0&&(0,m.jsxs)(`div`,{className:`mono text-[10px] text-zinc-500`,children:[`missing on control plane: `,e.missingOnLocal.join(`, `)]})]})}function xh({compat:e,onOpenRun:t}){let[n,r]=(0,p.useState)(void 0);if(!e)return null;let i=vh(e),a=e.groups.reduce((e,t)=>e+t.pods.length,0),o=n===`fleet`,s=n===`blocked`;return(0,m.jsxs)(m.Fragment,{children:[e.groups.length===0?(0,m.jsx)(gh,{label:`No worker has advertised a handshake descriptor yet — legacy workers are assumed compatible.`,children:(0,m.jsx)(`span`,{className:`mono text-[10px] text-zinc-600`,children:`no descriptors`})}):(0,m.jsxs)(Om,{open:o,onOpenChange:e=>r(e?`fleet`:void 0),children:[(0,m.jsx)(gh,{suppressed:o,label:`control plane ${_h(e.controlPlane.protocolRange)}\n${a} pods across ${e.groups.length} groups${e.incompatibleCount>0?` · ${e.incompatibleCount} incompatible`:``}`,children:(0,m.jsx)(km,{render:(0,m.jsxs)(Y,{variant:`chip`,size:`xs`,className:Sa(`mono gap-1`,i===`incompatible`&&`border-rose-500/50 bg-rose-500/15 text-rose-300`,i===`degraded`&&`border-warn/40 bg-warn/10 text-warn`,i===`compatible`&&o&&`border-zinc-500 bg-zinc-800 text-zinc-200`),children:[(0,m.jsx)(`span`,{className:`dot ${yh(i)}`,"aria-hidden":!0}),`fleet`,(0,m.jsxs)(`span`,{className:`tnum text-zinc-500`,children:[a,`p`,e.incompatibleCount>0?` ${e.incompatibleCount}!`:``]})]})})}),(0,m.jsxs)(Am,{children:[(0,m.jsxs)(`div`,{className:`mono flex items-center justify-between gap-2 border-b border-line px-2.5 py-1.5 text-[10px] text-zinc-500`,children:[(0,m.jsx)(`span`,{className:`truncate text-zinc-300`,children:e.controlPlane.instanceId}),(0,m.jsxs)(`span`,{className:`tnum shrink-0`,children:[`control plane `,_h(e.controlPlane.protocolRange)]})]}),(0,m.jsx)(`div`,{className:`max-h-80 divide-y divide-line-soft overflow-auto`,children:e.groups.map(e=>(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:`mono flex items-center gap-1.5 bg-zinc-900/40 px-2.5 py-1 text-[9px] uppercase tracking-wider text-zinc-600`,children:[(0,m.jsx)(`span`,{className:`truncate`,children:e.token}),e.incompatible&&(0,m.jsx)(`span`,{className:`text-rose-300`,children:`incompatible`}),!e.incompatible&&e.degraded&&(0,m.jsx)(`span`,{className:`text-amber-300`,children:`degraded`})]}),e.pods.map(e=>(0,m.jsx)(bh,{pod:e},e.instanceId))]},e.token))})]})]}),e.blockedCount>0&&(0,m.jsxs)(Om,{open:s,onOpenChange:e=>r(e?`blocked`:void 0),children:[(0,m.jsx)(gh,{suppressed:s,label:`${e.blockedCount} run${e.blockedCount===1?``:`s`} parked: no compatible worker can take ${e.blockedCount===1?`it`:`them`}`,children:(0,m.jsx)(km,{render:(0,m.jsxs)(Y,{variant:`chip`,size:`xs`,className:`mono gap-1 border-rose-500/50 bg-rose-500/15 text-rose-300`,children:[(0,m.jsx)(`span`,{className:`dot s-blocked`,"aria-hidden":!0}),(0,m.jsx)(`span`,{className:`tnum`,children:e.blockedCount}),` blocked`]})})}),(0,m.jsxs)(Am,{children:[(0,m.jsx)(`div`,{className:`mono border-b border-line px-2.5 py-1.5 text-[9px] uppercase tracking-wider text-zinc-600`,children:`blocked runs`}),(0,m.jsx)(`div`,{className:`max-h-80 divide-y divide-line-soft overflow-auto`,children:e.blocked.map(e=>(0,m.jsxs)(`button`,{type:`button`,onClick:()=>{r(void 0),t(e.id)},className:`mono flex w-full flex-col gap-0.5 px-2.5 py-1.5 text-left text-[10px] hover:bg-zinc-800/50`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`truncate text-zinc-300`,children:e.workflow}),(0,m.jsx)(`span`,{className:`truncate text-zinc-600`,children:e.id})]}),(0,m.jsx)(`span`,{className:`text-rose-300/80`,children:e.reason}),e.missingCapabilities&&e.missingCapabilities.length>0&&(0,m.jsxs)(`span`,{className:`text-zinc-500`,children:[`missing: `,e.missingCapabilities.join(`, `)]})]},e.id))})]})]})]})}function Sh(e){if(e.name.startsWith(`spawn:`))return e.name.slice(6);if(e.name.startsWith(`signal:child:`))return e.name.slice(13)}function Ch(e,t=50){let n=new Set;for(let r of e){if(n.size>=t)break;let e=Sh(r);e!==void 0&&n.add(e)}return[...n]}function wh(e,t){let n=`${t}.`;return`child ${e.startsWith(n)?e.slice(n.length):e}`}function Th(e,t,n=12){let r=e.slice(0,n);return{shown:r,more:Math.max(0,(t??e.length)-r.length)}}function Eh(e){return{...e.triggeredBy?{startedBy:{...e.triggeredBy}}:{},triggered:[...e.triggered??[]]}}var Dh=new Set([`completed`,`failed`,`cancelled`,`dead`]);function Oh(e){return Dh.has(e.run.status)?[...e.lifecycleSubscribers??[]]:[]}function kh(e){let t=`${e.started} subscriber run${e.started===1?``:`s`} started`;return e.failed.length===0?`${t}.`:`${t}, ${e.failed.length} failed: ${e.failed.map(e=>`${e.subscriber} (${e.error})`).join(`; `)}.`}function Ah(e){let t={};for(let n of e)n.data&&(t[n.data.run.id]=n.data);return t}function jh({runs:e,value:t,onChange:n}){if(!jn(e)&&t.kind===`all`)return null;let r=An(e);return(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 border-b border-line px-2 py-1.5`,children:[(0,m.jsx)(`span`,{className:`mono shrink-0 text-[10px] uppercase tracking-[0.18em] text-zinc-600`,children:`origin`}),r.map(e=>{let r=Tn(t,e.filter);return(0,m.jsxs)(Y,{variant:`ghost`,size:`chip`,"aria-pressed":r,title:e.title,onClick:()=>n(e.filter),className:Sa(`mono max-w-full gap-1 rounded-md`,e.filter.kind===`unknown`&&`italic text-zinc-500`,r&&`border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100`),children:[(0,m.jsx)(`span`,{className:`truncate`,children:e.label}),(0,m.jsx)(`span`,{className:`tnum shrink-0 text-zinc-600`,children:e.count})]},En(e.filter))})]})}var Mh=`fan:`;function Nh(e){if(!e.name.startsWith(Mh))return;let t=e.output?.values;return Array.isArray(t)?t.length:void 0}function Ph(e){let t=Nh(e);return t===void 0?e.name:`${t} child run${t===1?``:`s`}`}function Fh(e){if(e.length===0)return``;let t=e[0]??``;for(let n of e.slice(1)){let e=0;for(;e<t.length&&e<n.length&&t[e]===n[e];)e+=1;t=t.slice(0,e)}return t.replace(/[\s._:-]+$/,``)}function Ih(e){if(e.some(e=>Nh(e)!==void 0))return`child runs ×${e.reduce((e,t)=>e+(Nh(t)??1),0)}`;let t=Fh(e.map(e=>e.name));return`${t.length>=2?t:`parallel`} ×${e.length}`}function Lh(e){return e.kind===`single`?e.step.seq:e.kind===`fan`?e.steps[0]?.seq??1/0:e.fan.firstSeq}function Rh(e,t=[]){let n=zh(e);if(t.length===0)return n;let r=[...t].sort((e,t)=>e.firstSeq-t.firstSeq),i=[],a=0;for(let e of n){let t=Lh(e);for(;a<r.length&&r[a].firstSeq<t;)i.push({kind:`summary`,fan:r[a]}),a+=1;i.push(e)}for(;a<r.length;a+=1)i.push({kind:`summary`,fan:r[a]});return i}function zh(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===void 0){n+=1;continue}let i=r.parallelGroup;if(i===void 0||i===``){t.push({kind:`single`,step:r}),n+=1;continue}let a=[],o=n;for(;o<e.length&&e[o]?.parallelGroup===i;){let t=e[o];t!==void 0&&a.push(t),o+=1}a.length<=1?t.push({kind:`single`,step:a[0]??r}):t.push({kind:`fan`,group:i,steps:a,label:Ih(a)}),n=o}return t}function Bh(e,t=!1){let n=e.counts.running??0,r=e.counts.pending??0,i=e.notStarted??0;return{completed:e.counts.completed??0,failed:e.counts.failed??0,running:t?0:n,pending:t?0:r,interrupted:t?n+r:0,notStarted:t?0:i,skipped:t?i:0,started:e.size,total:e.total??e.size}}function Vh(e,t=!1){let n=Bh(e,t);return n.running>0?`running`:n.pending>0||n.notStarted>0?`pending`:n.failed>0||n.interrupted>0?`failed`:`completed`}function Hh(e){return e.started<e.total?`${e.started} of ${e.total}`:`×${e.total}`}var Uh=new Set([`completed`,`failed`,`cancelled`,`dead`]);function Wh(e){return Uh.has(e)}var Gh=2e3,Kh=3e4;function qh(e){let t=e.state.data?.run?.status;return t!==void 0&&Wh(t)?Kh:Gh}function Jh(e,t,n=100){if(e===void 0||t===void 0)return[0];let r=[];for(let i=Math.floor(e/n);i<=Math.floor(t/n);i+=1)r.push(i);return r}var Yh=[{key:`completed`,className:`bg-emerald-500/60`,text:`text-emerald-300`,label:`done`},{key:`failed`,className:`bg-red-500/70`,text:`text-red-300`,label:`failed`},{key:`running`,className:`bg-live/70`,text:`text-live`,label:`running`},{key:`pending`,className:`bg-zinc-500/60`,text:`text-zinc-300`,label:`pending`},{key:`interrupted`,className:`bg-amber-500/60`,text:`text-amber-300`,label:`interrupted`},{key:`notStarted`,className:`bg-zinc-700/70`,text:`text-zinc-400`,label:`not started`},{key:`skipped`,className:`bg-zinc-700/40`,text:`text-zinc-500`,label:`never ran`}],Xh=9e4;function Zh(e,t,n){let r=(t?.liveWorkers??[]).filter(e=>n-e.lastBeatAt<=Xh).sort((e,t)=>t.lastBeatAt-e.lastBeatAt)[0];if(r)return{kind:`working`,instanceId:r.instanceId,beatAgoS:Math.max(0,Math.round((n-r.lastBeatAt)/1e3)),inFlight:r.status?.inFlight};let i=e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime();return{kind:`lost`,minutes:Math.round((n-i)/6e4)}}var Qh=[];function $h(e){return Xe({queries:(0,p.useMemo)(()=>Ch(e),[e]).map(e=>({queryKey:[`run`,e],queryFn:()=>yr.run(e),refetchInterval:qh})),combine:Ah})}function eg(e,t,n){if(t){let e=new Date(t.run.createdAt).getTime(),r=qn(t.run.status)?n:new Date(t.run.updatedAt).getTime();return[e,Math.max(r,e)]}let{subs:r}=bn(e.events??[]),i=1/0,a=-1/0;for(let e of r){e.startedAt!==void 0&&(i=Math.min(i,e.startedAt));let t=e.terminal?.at??e.startedAt;t!==void 0&&(a=Math.max(a,t))}return i!==1/0&&a!==-1/0?[i,a]:[new Date(e.startedAt).getTime(),new Date(e.finishedAt).getTime()]}function tg(e,t,n){let r=qn(e.status),i=Date.now(),a=new Date(e.createdAt).getTime(),o=-1/0;for(let[e,n]of t)a=Math.min(a,e),o=Math.max(o,n);for(let e of n)e.startedAt&&(a=Math.min(a,new Date(e.startedAt).getTime())),e.finishedAt&&(o=Math.max(o,new Date(e.finishedAt).getTime()));return o=Math.max(o,r?i:a+1),{t0:a,span:Math.max(o-a,1),liveNow:i}}function ng(e,t,n,r=eg(e,t,n.liveNow)){let{t0:i,span:a}=n,[o,s]=r,{subs:c}=bn(e.events??[]),l=c.map(e=>{let t=e.startedAt??o,n=e.terminal?.at??t;return{key:e.id,name:e.name,status:e.status??`ok`,left:(t-i)/a*100,width:Math.max((n-t)/a*100,.8),ms:e.durationMs??Math.max(n-t,0)}});return{step:e,childId:Sh(e),childRun:t,left:(o-i)/a*100,width:Math.max((s-o)/a*100,.8),ms:s-o,subRows:l}}function rg(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}var ig={ok:`bg-emerald-500/40 ring-1 ring-emerald-500/50`,failed:`bg-red-500/40 ring-1 ring-red-500/50`,skipped:`bg-amber-500/35 ring-1 ring-amber-500/45`},ag={ok:`bg-emerald-400`,failed:`bg-red-400`,skipped:`bg-amber-400`};function og({row:e,run:t,childRuns:n,depth:r,selectedKey:i,onSelect:a,onOpenRun:o,onToggleChild:s,expanded:c,collapsedSubs:l,toggleSubs:u}){let{step:d,left:f,width:p,ms:h,subRows:g}=e,_=d.status===`failed`,v=Sh(d),y=!!v,b=y?Hr:Wr(d.kind),x=i===`${d.runId}#${d.seq}`,S=y&&v!==void 0&&c.has(v),C=g.length>0&&!y,w=l.has(d.seq),T=Kn(d,Date.now()),{data:E}=Qe({queryKey:[`workers`],queryFn:()=>yr.workers(),refetchInterval:1e4,enabled:T}),D=T?Zh(d,E?.find(e=>e.group===d.workerGroup),Date.now()):void 0;return(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>a(d,t),title:y?`Child workflow — click for its detail (↗ opens its run)`:void 0,className:`group grid w-full grid-cols-[150px_1fr] items-center gap-3 rounded-md px-2 py-1 text-left transition-colors ${x?`bg-zinc-800/60`:`hover:bg-zinc-900/60`}`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate`,children:[y&&v!==void 0&&(0,m.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s(v)},className:`shrink-0 text-indigo-400 hover:text-indigo-200 transition-colors`,title:S?`Collapse child run`:`Expand child run inline`,children:(0,m.jsx)(`span`,{className:`inline-block transition-transform`,style:{transform:S?`rotate(90deg)`:`rotate(0deg)`},children:`▸`})}),C&&(0,m.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u(d.seq)},className:`shrink-0 text-zinc-500 transition-colors hover:text-zinc-300`,title:w?`Show ${g.length} sub-process(es)`:`Hide sub-processes`,children:(0,m.jsx)(`span`,{className:`inline-block transition-transform`,style:{transform:w?`rotate(0deg)`:`rotate(90deg)`},children:`▸`})}),(0,m.jsx)(`span`,{className:_?`text-red-400`:y?`text-indigo-300`:`text-emerald-400`,children:(0,m.jsx)(b,{width:12,height:12})}),(0,m.jsx)(`span`,{className:`truncate text-[12px] text-zinc-300`,children:v===void 0?Ph(d):n[v]?.run.workflow??wh(v,t.id)}),y&&v!==void 0&&(0,m.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o(v)},title:`Open the child run`,className:`shrink-0 text-indigo-300 transition-colors hover:text-indigo-100`,children:`↗`})]}),(0,m.jsxs)(`span`,{className:`relative h-5`,children:[(0,m.jsx)(`span`,{className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft`}),(0,m.jsx)(`span`,{className:`absolute top-1/2 flex h-3.5 -translate-y-1/2 items-center rounded-[3px] transition-all duration-500 ease-out ${_?`bg-red-500/35 ring-1 ring-red-500/50`:x?`bg-emerald-400/45 ring-1 ring-emerald-400/60`:`bg-emerald-500/30 ring-1 ring-emerald-500/40`}`,style:{left:`${f}%`,width:`${p}%`}}),(0,m.jsx)(`span`,{className:`mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[10px] text-zinc-500`,style:{left:`min(${f+p}%, calc(100% - 44px))`},children:rg(h)})]})]}),D?.kind===`working`&&(0,m.jsxs)(`div`,{className:`mono ml-[18px] mb-1 flex items-center gap-1 text-[10px] text-emerald-500/80`,title:`A live worker holds this dispatch — its heartbeat is fresh. Long steps are expected to sit here; only re-dispatch if the heartbeat goes stale.`,children:[(0,m.jsx)(`span`,{"aria-hidden":!0,children:`⚙`}),`being worked by `,D.instanceId,` — heartbeat `,D.beatAgoS,`s ago`,D.inFlight===void 0?``:` · ${D.inFlight} in flight`]}),D?.kind===`lost`&&(0,m.jsxs)(`div`,{className:`mono ml-[18px] mb-1 flex items-center gap-1 text-[10px] s-stale`,title:"No live worker heartbeat on this step's group — reconcile-wake can't recover a stuck `pending` step; re-dispatch it from the run actions above",children:[(0,m.jsx)(`span`,{"aria-hidden":!0,children:`⚠`}),`awaiting worker result — dispatched `,D.minutes,`m ago, no live worker (possibly lost)`]}),g.length>0&&!w&&(0,m.jsx)(`div`,{className:`ml-[18px] mt-0.5 mb-1 space-y-0.5 border-l border-line-soft pl-2`,children:g.map(e=>(0,m.jsxs)(`div`,{className:`grid grid-cols-[130px_1fr] items-center gap-3 px-2`,title:`${e.name} — ${e.status}`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate`,children:[(0,m.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${ag[e.status]}`}),(0,m.jsx)(`span`,{className:`truncate text-[10px] text-zinc-400`,children:e.name})]}),(0,m.jsxs)(`span`,{className:`relative h-3`,children:[(0,m.jsx)(`span`,{className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft`}),(0,m.jsx)(`span`,{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-[2px] transition-all duration-500 ease-out ${ig[e.status]}`,style:{left:`${e.left}%`,width:`${e.width}%`}}),(0,m.jsx)(`span`,{className:`mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[9px] text-zinc-600`,style:{left:`min(${e.left+e.width}%, calc(100% - 38px))`},children:rg(e.ms)})]})]},e.key))}),y&&v!==void 0&&S&&(0,m.jsx)(`div`,{className:`ml-[18px] mt-0.5 mb-1 border-l border-line-soft pl-2`,children:(0,m.jsx)(pg,{id:v,depth:r+1,selectedKey:i,onSelect:a,onOpenRun:o,expanded:c,onToggleChild:s})})]})}function sg({label:e,fanFailed:t,memberRows:n,rowProps:r}){return(0,m.jsxs)(`div`,{className:`rounded-md bg-zinc-900/30 ring-1 ring-line-soft`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1`,children:[(0,m.jsx)(`span`,{className:`text-[11px] text-indigo-300/80`,title:`parallel fan-out (ctx.gather / ctx.all)`,children:`⑃`}),(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.15em] text-zinc-500`,children:`parallel`}),(0,m.jsx)(`span`,{className:`text-[11px] ${t?`text-red-400`:`text-zinc-300`}`,children:e})]}),(0,m.jsx)(`div`,{className:`ml-[10px] border-l border-line-soft pl-1`,children:n.map(e=>(0,m.jsx)(og,{row:e,...r},e.step.seq))})]})}var cg=28;function lg({fan:e,frame:t,rowProps:n}){let[r,i]=(0,p.useState)(!1),[a,o]=(0,p.useState)(!1),s=Wh(n.run.status),c=Bh(e,s),l=Vh(e,s),u=l===`running`||l===`pending`,d=qn(n.run.status),f=e.startedAt?new Date(e.startedAt).getTime():void 0,h=e.finishedAt?new Date(e.finishedAt).getTime():u&&d?t.liveNow:f,g=(0,p.useMemo)(()=>e.failures.map(e=>ng(e,void 0,t)),[e.failures,t]);return(0,m.jsxs)(`div`,{className:`rounded-md bg-zinc-900/30 ring-1 ring-line-soft`,children:[(0,m.jsxs)(`div`,{className:`grid grid-cols-[150px_1fr] items-center gap-3 px-2 py-1`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate`,children:[(0,m.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`shrink-0 text-zinc-500 transition-colors hover:text-zinc-300`,title:r?`Hide the members`:`List the ${e.size} members started`,children:(0,m.jsx)(`span`,{className:`inline-block transition-transform`,style:{transform:r?`rotate(90deg)`:`rotate(0deg)`},children:`▸`})}),(0,m.jsx)(`span`,{className:`text-[11px] text-indigo-300/80`,title:`parallel fan-out, summarized`,children:`⑃`}),(0,m.jsxs)(`span`,{className:`truncate text-[12px] ${l===`failed`?`text-red-400`:`text-zinc-300`}`,title:e.group,children:[e.label,` ×`,c.total]})]}),(0,m.jsxs)(`span`,{className:`relative h-5`,children:[(0,m.jsx)(`span`,{className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft`}),f!==void 0&&h!==void 0&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`absolute top-1/2 h-3.5 -translate-y-1/2 rounded-[3px] ${l===`failed`?`bg-red-500/25 ring-1 ring-red-500/40`:`bg-indigo-500/20 ring-1 ring-indigo-500/40`} ${u?`pulse`:``}`,style:{left:`${(f-t.t0)/t.span*100}%`,width:`${Math.max((h-f)/t.span*100,.8)}%`}}),(0,m.jsx)(`span`,{className:`mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[10px] text-zinc-500`,style:{left:`min(${(h-t.t0)/t.span*100}%, calc(100% - 44px))`},children:rg(h-f)})]})]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-3 px-2 pb-1.5 pl-[26px]`,children:[(0,m.jsx)(`span`,{className:`flex h-1.5 w-40 shrink-0 overflow-hidden rounded-full bg-zinc-800`,children:Yh.map(e=>c[e.key]>0?(0,m.jsx)(`span`,{className:e.className,style:{width:`${c[e.key]/Math.max(c.total,1)*100}%`}},e.key):null)}),(0,m.jsxs)(`span`,{className:`mono tnum flex flex-wrap gap-2 text-[10px]`,children:[c.started<c.total&&(0,m.jsxs)(`span`,{className:`text-zinc-400`,children:[Hh(c),` started`]}),Yh.map(t=>c[t.key]>0?(0,m.jsxs)(`span`,{className:t.text,children:[c[t.key],` `,t.label,t.key===`skipped`&&e.failFast?` (failFast)`:``]},t.key):null)]})]}),g.length>0&&!r&&(0,m.jsxs)(`div`,{className:`ml-[10px] border-l border-red-500/30 pl-1`,children:[(0,m.jsx)(`div`,{className:`mono px-2 text-[10px] text-red-300/70`,children:c.failed>g.length?`first ${g.length} of ${c.failed} failed`:`${g.length} failed`}),g.map(e=>(0,m.jsx)(og,{row:e,...n},e.step.seq))]}),r&&(0,m.jsxs)(`div`,{className:`ml-[10px] border-l border-line-soft pl-1`,children:[(0,m.jsx)(`div`,{className:`flex items-center gap-2 px-2 py-0.5`,children:(0,m.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`mono rounded border px-1.5 text-[10px] transition-colors ${a?`border-red-500/40 bg-red-500/15 text-red-300`:`border-line text-zinc-500 hover:text-zinc-300`}`,children:`failed only`})}),(0,m.jsx)(ug,{group:e.group,failedOnly:a,live:u&&d,frame:t,rowProps:n},a?`failed`:`all`)]})]})}function ug({group:e,failedOnly:t,live:n,frame:r,rowProps:i}){let a=i.run.id,o=(0,p.useRef)(null),[s,c]=(0,p.useState)(),l=Jt({count:s??0,getScrollElement:()=>o.current,estimateSize:()=>cg,measureElement:e=>e.getBoundingClientRect().height,overscan:10}),u=l.getVirtualItems(),d=Jh(u[0]?.index,u[u.length-1]?.index),f=Xe({queries:d.map(r=>({queryKey:[`fan`,a,e,t,r],queryFn:()=>yr.fanMembers(a,e,{offset:r*100,limit:100,failed:t}),refetchInterval:n?5e3:!1}))}),h=f.find(e=>e.data!==void 0)?.data?.total;(0,p.useEffect)(()=>{h!==void 0&&c(h)},[h]);let g=e=>{let t=d.indexOf(Math.floor(e/100));return t<0?void 0:f[t]},_=e=>g(e)?.data?.items[e%100],v=f.find(e=>e.isError);return s===void 0&&v?(0,m.jsxs)(`div`,{className:`mono px-2 py-1 text-[10px] text-red-400`,children:[`couldn't load members:`,` `,v.error instanceof Error?v.error.message:String(v.error)]}):s===void 0?(0,m.jsx)(`div`,{className:`mono px-2 py-1 text-[10px] text-zinc-600`,children:`loading members…`}):s===0?(0,m.jsx)(`div`,{className:`mono px-2 py-1 text-[10px] text-zinc-600`,children:t?`no failed members`:`no members`}):(0,m.jsx)(`div`,{ref:o,className:`max-h-[320px] overflow-auto`,children:(0,m.jsx)(`div`,{className:`relative w-full`,style:{height:l.getTotalSize()},children:u.map(e=>{let t=_(e.index);return(0,m.jsx)(`div`,{"data-index":e.index,ref:l.measureElement,className:`absolute inset-x-0 top-0`,style:{transform:`translateY(${e.start}px)`},children:t?(0,m.jsx)(og,{row:ng(t,void 0,r),...i}):(0,m.jsx)(dg,{index:e.index,page:g(e.index)})},e.key)})})})}function dg({index:e,page:t}){return t?.isError?(0,m.jsxs)(`div`,{className:`mono flex items-center gap-2 px-2 text-[10px] leading-7 text-red-400`,style:{height:cg},children:[(0,m.jsxs)(`span`,{className:`truncate`,children:[`#`,e+1,` couldn't load:`,` `,t.error instanceof Error?t.error.message:String(t.error)]}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>void t.refetch(),className:`rounded border border-red-500/40 px-1.5 text-red-300 hover:bg-red-500/15`,children:`retry`})]}):(0,m.jsxs)(`div`,{className:`mono px-2 text-[10px] leading-7 text-zinc-700`,style:{height:cg},children:[`#`,e+1,` loading…`]})}function fg({run:e,timeline:t,fans:n=Qh,depth:r,selectedKey:i,onSelect:a,onOpenRun:o,expanded:s,onToggleChild:c}){let l=$h(t),{frame:u,rows:d}=(0,p.useMemo)(()=>{let r=Date.now(),i=t.map(e=>{let t=Sh(e),n=t===void 0?void 0:l[t];return{step:e,childRun:n,window:eg(e,n,r)}}),a=tg(e,i.map(e=>e.window),n);return{frame:a,rows:i.map(e=>ng(e.step,e.childRun,a,e.window))}},[e,t,n,l]),f=(0,p.useMemo)(()=>Rh(t,n),[t,n]),h=(0,p.useMemo)(()=>{let e=new Map;for(let t of d)e.set(t.step.seq,t);return e},[d]),[g,_]=(0,p.useState)(new Set),v={run:e,childRuns:l,depth:r,selectedKey:i,onSelect:a,onOpenRun:o,onToggleChild:c,expanded:s,collapsedSubs:g,toggleSubs:e=>_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,m.jsx)(m.Fragment,{children:f.map(e=>{if(e.kind===`single`){let t=h.get(e.step.seq);return t?(0,m.jsx)(og,{row:t,...v},t.step.seq):null}if(e.kind===`summary`)return(0,m.jsx)(lg,{fan:e.fan,frame:u,rowProps:v},`fan:${e.fan.group}`);let t=e.steps.map(e=>h.get(e.seq)).filter(e=>e!==void 0);return(0,m.jsx)(sg,{label:e.label,fanFailed:e.steps.some(e=>e.status===`failed`),memberRows:t,rowProps:v},`fan:${e.group}`)})})}function pg({id:e,depth:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:a,onToggleChild:o}){let{data:s}=Qe({queryKey:[`run`,e],queryFn:()=>yr.run(e),refetchInterval:qh});return t>6?null:s?(0,m.jsxs)(`div`,{className:`my-1 rounded-md border border-line bg-black/15`,children:[(0,m.jsxs)(`div`,{className:`mono flex items-center gap-2 px-2 py-1 text-[10px] text-zinc-500`,children:[(0,m.jsxs)(`span`,{className:`text-indigo-300`,children:[`⌁ `,s.run.workflow]}),(0,m.jsx)(`span`,{className:`tnum text-zinc-600`,children:e.slice(0,8)}),(0,m.jsx)(`span`,{className:`s-${s.run.status} uppercase`,children:s.run.status}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`ml-auto rounded border border-line px-1.5 text-zinc-400 hover:text-zinc-200`,children:`open ↗`})]}),(0,m.jsx)(fg,{run:s.run,timeline:s.timeline,fans:s.fans,depth:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:a,onToggleChild:o})]}):(0,m.jsx)(`div`,{className:`mono px-2 py-1 text-[10px] text-zinc-600`,children:`loading child run…`})}function mg({run:e,timeline:t,fans:n,selectedKey:r,onSelect:i,onOpenRun:a,expanded:o,onToggleChild:s}){let c=(0,p.useMemo)(()=>tg(e,t.map(e=>[new Date(e.startedAt).getTime(),new Date(e.finishedAt).getTime()]),n??Qh).span,[e,t,n]),l=o??new Set,u=s??(()=>{});return(0,m.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-2 pt-3`,children:[(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.2em] text-zinc-500`,children:`spans`}),(0,m.jsxs)(`span`,{className:`mono tnum text-[10px] text-zinc-600`,children:[`total `,rg(c)]})]}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3`,children:(0,m.jsx)(fg,{run:e,timeline:t,fans:n,depth:0,selectedKey:r,onSelect:i,onOpenRun:a,expanded:l,onToggleChild:u})})]})}function hg(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function gg(e,t){return hg(new Date(t).getTime()-new Date(e).getTime())}function _g(e){return vg(new Date(e).getTime())}function vg(e){return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3})}var yg={ok:`border-emerald-500/25 bg-emerald-500/10 text-emerald-300`,failed:`border-red-500/25 bg-red-500/10 text-red-300`,skipped:`border-amber-500/25 bg-amber-500/10 text-amber-300`},bg={debug:`text-zinc-500`,info:`text-zinc-300`,warn:`text-amber-300`,error:`text-red-300`},xg=[`ok`,`failed`,`skipped`];function Sg({e}){return(0,m.jsxs)(`div`,{className:`flex gap-2 py-0.5`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-zinc-600 tnum`,children:vg(e.at)}),(0,m.jsx)(`span`,{className:`shrink-0 uppercase ${bg[e.level]}`,children:e.level}),(0,m.jsx)(`span`,{className:`min-w-0 break-words text-zinc-300`,children:e.message})]})}function Cg({sub:e,showGroup:t=!0}){let n=e.terminal?.message!==void 0&&e.terminal.message!==e.name,r=e.phases.length>0||e.logs.length>0||n,[i,a]=(0,p.useState)(e.status===`failed`),o=e.status?yg[e.status]:`border-amber-500/25 bg-amber-500/10 text-amber-300`;return(0,m.jsxs)(`li`,{className:`rounded-md border ${o}`,children:[(0,m.jsxs)(`button`,{type:`button`,disabled:!r,onClick:()=>a(e=>!e),className:`flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left text-[11.5px] disabled:cursor-default`,"aria-expanded":r?i:void 0,children:[(0,m.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[r&&(0,m.jsx)(`span`,{className:`text-[9px] text-zinc-500 transition-transform duration-150 ${i?``:`-rotate-90`}`,children:`▼`}),(0,m.jsx)(`span`,{className:`mono truncate text-zinc-200`,children:e.name}),t&&e.group&&(0,m.jsx)(`span`,{className:`mono shrink-0 text-[10px] uppercase tracking-wider text-zinc-500`,children:e.group})]}),(0,m.jsxs)(`span`,{className:`mono flex shrink-0 items-center gap-2 text-[10px] uppercase tracking-wider`,children:[e.durationMs!==void 0&&(0,m.jsx)(`span`,{className:`tnum text-zinc-400`,children:hg(e.durationMs)}),(0,m.jsx)(`span`,{children:e.status??`running`})]})]}),i&&(0,m.jsxs)(`div`,{className:`border-t border-line/60 px-2.5 py-2`,children:[e.phases.length>0&&(0,m.jsx)(`ul`,{className:`mono mb-2 flex flex-col gap-0.5 text-[10.5px]`,children:e.phases.map((t,n)=>(0,m.jsxs)(`li`,{className:`flex gap-2`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-zinc-600 tnum`,children:vg(t.at)}),(0,m.jsx)(`span`,{className:`text-zinc-400`,children:t.phase}),e.startedAt!==void 0&&(0,m.jsxs)(`span`,{className:`text-zinc-600 tnum`,children:[`+`,hg(t.at-e.startedAt)]})]},`${t.at}-${t.phase}-${n}`))}),e.terminal?.message&&e.terminal.message!==e.name&&(0,m.jsx)(`div`,{className:`mono mb-2 rounded border p-2 text-[11px] ${e.status===`failed`?`border-red-500/25 bg-red-500/10 text-red-200`:`border-line bg-black/20 text-zinc-300`}`,children:e.terminal.message}),e.logs.length>0&&(0,m.jsx)(`div`,{className:`mono flex flex-col gap-0.5 text-[11px]`,children:e.logs.map((e,t)=>(0,m.jsx)(Sg,{e},`${e.at}-${t}`))})]})]})}function wg({events:e}){let{subs:t,stepLogs:n}=bn(e),r=xg.map(e=>[e,t.filter(t=>t.status===e).length]).filter(([,e])=>e>0),i=t.some(e=>e.group);return(0,m.jsxs)(m.Fragment,{children:[t.length>0&&(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,m.jsxs)(`span`,{className:`mono text-[10px] uppercase tracking-[0.18em] text-zinc-500`,children:[`sub-processes · `,t.length]}),(0,m.jsx)(`span`,{className:`mono flex gap-2 text-[10px] uppercase tracking-wider`,children:r.map(([e,t])=>(0,m.jsxs)(`span`,{className:yg[e].split(` `).pop(),children:[t,` `,e]},e))})]}),i?Object.entries(t.reduce((e,t)=>{let n=t.group??`—`;return e[n]===void 0&&(e[n]=[]),e[n].push(t),e},{})).sort(([e],[t])=>e===`—`?1:t===`—`?-1:e.localeCompare(t)).map(([e,t])=>(0,m.jsxs)(`div`,{className:`mb-2`,children:[(0,m.jsx)(`div`,{className:`mono mb-1 text-[10px] uppercase tracking-wider text-zinc-500`,children:e}),(0,m.jsx)(`ul`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,m.jsx)(Cg,{sub:e,showGroup:!1},e.id))})]},e)):(0,m.jsx)(`ul`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,m.jsx)(Cg,{sub:e},e.id))})]}),n.length>0&&(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-zinc-500`,children:[`logs · `,n.length]}),(0,m.jsx)(`div`,{className:`mono max-h-64 overflow-auto rounded-lg border border-line bg-black/40 p-2.5 text-[11px] leading-relaxed`,children:n.map((e,t)=>(0,m.jsx)(Sg,{e},`${e.at}-${t}`))})]})]})}function Tg({value:e}){let[t,n]=(0,p.useState)(!1);return(0,m.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 rounded border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-zinc-500 transition-colors hover:text-zinc-200`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1200)}catch{}},children:[t?(0,m.jsx)(Pr,{width:11,height:11}):(0,m.jsx)(Ir,{width:11,height:11}),t?`copied`:`copy`]})}function Eg({label:e,value:t}){let n=typeof t==`string`?t:JSON.stringify(t,null,2);return(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.18em] text-zinc-500`,children:e}),(0,m.jsx)(Tg,{value:n})]}),(0,m.jsx)(`pre`,{className:`mono max-h-64 overflow-auto rounded-lg border border-line bg-black/40 p-3 text-[11.5px] leading-relaxed text-zinc-300`,children:n})]})}function Dg({error:e}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mono mb-1.5 flex items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-red-400/80`,children:[(0,m.jsx)(`span`,{children:`error`}),e.code&&(0,m.jsx)(`span`,{className:`rounded border border-red-500/30 px-1.5 py-px normal-case tracking-normal text-red-300`,children:e.code})]}),(0,m.jsx)(`div`,{className:`mono rounded-lg border border-red-500/25 bg-red-500/10 p-3 text-[11.5px] leading-relaxed text-red-200`,children:e.message})]}),e.details!==void 0&&(0,m.jsx)(Eg,{label:`error details`,value:e.details})]})}function Og({k:e,v:t,mono:n=!0}){return(0,m.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 py-1.5`,children:[(0,m.jsx)(`span`,{className:`mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-zinc-600`,children:e}),(0,m.jsx)(`span`,{className:`truncate text-right text-[12px] text-zinc-200 ${n?`mono tnum`:``}`,children:t})]})}function kg({id:e,onOpenRun:t}){let{data:n}=Qe({queryKey:[`run`,e],queryFn:()=>yr.run(e),refetchInterval:qh}),[r,i]=(0,p.useState)(new Set);return n?n.timeline.length===0?(0,m.jsxs)(`div`,{className:`mono px-2 py-2 text-[10px] text-zinc-600`,children:[`no steps recorded yet — child `,n.run.status]}):(0,m.jsx)(`div`,{className:`mt-2 max-h-80 space-y-1 overflow-auto rounded-md border border-line bg-black/20 p-1.5`,children:(0,m.jsx)(fg,{run:n.run,timeline:n.timeline,depth:0,onSelect:()=>{},onOpenRun:t??(()=>{}),expanded:r,onToggleChild:e=>i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})})}):(0,m.jsx)(`div`,{className:`mono px-2 py-2 text-[10px] text-zinc-600`,children:`loading child run…`})}function Ag({step:e,run:t,onClose:n,onOpenRun:r}){let i=Sh(e),[a,o]=(0,p.useState)(!1),s=e.status===`failed`,c=e.status===`pending`||e.status===`running`,l=Wr(e.kind),u=gg(t.createdAt,e.startedAt),d=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return(0,m.jsxs)(`aside`,{className:`absolute inset-y-0 right-0 z-20 flex w-[380px] max-w-[90%] flex-col border-l border-line bg-panel/95 shadow-2xl backdrop-blur-md rise`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-line px-5 py-4`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`grid h-6 w-6 shrink-0 place-items-center rounded-md ${s?`bg-red-500/15 text-red-300`:c?`bg-amber-500/15 text-amber-300`:`bg-emerald-500/15 text-emerald-300`}`,children:(0,m.jsx)(l,{width:13,height:13})}),(0,m.jsx)(`h3`,{className:`truncate text-[15px] font-semibold tracking-tight text-zinc-50`,children:e.name})]}),(0,m.jsxs)(`div`,{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status,` · `,Gr[e.kind]??e.kind]})]}),(0,m.jsx)(`button`,{type:`button`,onClick:n,className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-line text-zinc-500 transition-colors hover:text-zinc-200`,"aria-label":`Close`,children:(0,m.jsx)(Fr,{})})]}),(0,m.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4`,children:[(0,m.jsxs)(`div`,{className:`rounded-lg border border-line bg-black/20 px-3.5 py-1`,children:[(0,m.jsx)(Og,{k:`seq`,v:`#${e.seq}`}),d>=1&&(0,m.jsx)(Og,{k:`queued`,v:(0,m.jsx)(`span`,{className:`text-sky-300`,children:hg(d)})}),(0,m.jsx)(Og,{k:`duration`,v:c?(0,m.jsx)(`span`,{className:`text-amber-300`,children:`running…`}):gg(e.startedAt,e.finishedAt)}),(0,m.jsx)(Og,{k:`attempts`,v:(0,m.jsxs)(`span`,{className:e.attempts>1?`text-amber-300`:``,children:[e.attempts>1&&(0,m.jsx)(Rr,{width:11,height:11,className:`mr-1 inline`}),e.attempts]})}),e.workerGroup&&(0,m.jsx)(Og,{k:`worker`,v:`@${e.workerGroup}`}),(0,m.jsx)(Og,{k:`started`,v:_g(e.startedAt)}),!c&&(0,m.jsx)(Og,{k:`finished`,v:_g(e.finishedAt)}),(0,m.jsx)(Og,{k:`offset`,v:`+${u}`})]}),s&&e.error&&(0,m.jsx)(Dg,{error:e.error}),e.events&&e.events.length>0&&(0,m.jsx)(wg,{events:e.events}),i&&(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.18em] text-zinc-500`,children:`child run`}),r&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>r(i),className:`mono rounded border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-zinc-500 transition-colors hover:text-zinc-200`,children:`open ↗`})]}),(0,m.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`flex w-full items-center gap-2 rounded-md border border-indigo-500/30 bg-indigo-500/10 px-2.5 py-1.5 text-left transition-colors hover:bg-indigo-500/20`,title:a?`Collapse child run`:`Expand child run inline`,children:[(0,m.jsx)(`span`,{className:`inline-block text-[9px] text-indigo-300 transition-transform`,style:{transform:a?`rotate(90deg)`:`rotate(0deg)`},children:`▸`}),(0,m.jsx)(`span`,{className:`mono truncate text-[11px] text-indigo-300`,children:i})]}),a&&(0,m.jsx)(kg,{id:i,onOpenRun:r})]}),e.input!==void 0&&(0,m.jsx)(Eg,{label:`input`,value:e.input}),e.output!==void 0&&(0,m.jsx)(Eg,{label:`output`,value:e.output})]})]})}var jg=`durable:lifecycle:pending`;function Mg(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}function Ng(e,t){switch(e.state){case`started`:return`started`;case`owed`:{let n=e.owedSince===void 0?`owed`:`owed for ${Mg(t-e.owedSince)}`;return e.orphanAt===void 0?n:`${n} · orphan in ${Mg(e.orphanAt-t)}`}case`failed`:return e.error?`failed: ${e.error}`:`failed`;case`coalesced`:return`coalesced`;default:return`not started`}}var Pg="No run and nothing owed: its `where` declined the event, or it subscribed after the run settled.",Fg="Its last delivery failed: `where` threw, the input was rejected, the start failed, or the sweep dropped it as an orphan. The reason is in the run.trigger_failed event. Republish retries it.",Ig=`No live instance registers or announces this subscriber; the lifecycle sweep drops it then and reports run.trigger_failed.`;function Lg({status:e}){return e?(0,m.jsx)(wa,{variant:`status`,className:`s-${e} text-[10px]`,children:e}):null}function Rg({runId:e,onOpenRun:t}){return(0,m.jsx)(Y,{variant:`chip`,size:`xs`,onClick:()=>t(e),className:`mono max-w-[28rem] truncate px-1.5 py-0`,title:e,children:e})}function zg({source:e,onOpenRun:t}){return(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,"data-testid":`lifecycle-source`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-zinc-600`,children:`started by`}),(0,m.jsx)(Rg,{runId:e.runId,onOpenRun:t}),(0,m.jsx)(`span`,{className:`text-[10px] text-zinc-600`,children:`on`}),(0,m.jsx)(wa,{className:Sa(`text-[10px]`,e.kind===`failed`?`s-failed`:`s-completed`),children:e.kind}),(0,m.jsx)(Lg,{status:e.status}),e.traceId&&(0,m.jsxs)(`span`,{className:`ml-1 flex items-center gap-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-zinc-600`,children:`trace`}),(0,m.jsx)(`span`,{className:`mono text-[10px] text-zinc-400`,title:`The source run's trace id`,children:e.traceId}),(0,m.jsx)(Tg,{value:e.traceId})]})]})}function Bg({waitsFor:e=[],awaitedBy:t=[],onOpenRun:n}){return e.length===0&&t.length===0?null:(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1`,children:[e.map(e=>(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,"data-testid":`waits-for`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-amber-300/80`,children:`Waiting for run`}),(0,m.jsx)(Rg,{runId:e.runId,onOpenRun:n}),(0,m.jsx)(Lg,{status:e.status})]},`${e.runId}#${e.seq}`)),t.length>0&&(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,"data-testid":`awaited-by`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-zinc-600`,children:`Awaited by`}),t.map(e=>(0,m.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(Rg,{runId:e.runId,onOpenRun:n}),(0,m.jsx)(Lg,{status:e.status})]},`${e.runId}#${e.seq}`))]})]})}function Vg({deliveries:e,errors:t,now:n=Date.now(),onOpenRun:r}){return e.length===0?null:(0,m.jsxs)(`section`,{"aria-label":`Lifecycle subscribers`,className:`mt-3`,children:[(0,m.jsx)(`h3`,{className:`text-[10px] uppercase tracking-wider text-zinc-500`,children:`Lifecycle subscribers`}),(0,m.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1`,children:e.map(e=>{let i=e.state===`failed`?t?.get(e.subscriber):void 0,a=i!==void 0&&e.error===void 0?{...e,error:i}:e;return(0,m.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1.5`,"data-state":a.state,children:[(0,m.jsx)(`span`,{className:`mono text-[12px] text-zinc-200`,children:a.subscriber}),(0,m.jsx)(wa,{variant:a.state===`owed`?`warn`:a.state===`failed`?`danger`:`outline`,className:`text-[10px]`,title:a.state===`not-started`?Pg:a.state===`failed`?Fg:a.orphanAt===void 0?void 0:Ig,children:Ng(a,n)}),a.runId&&(0,m.jsx)(Rg,{runId:a.runId,onOpenRun:r}),a.state===`started`&&(0,m.jsx)(Lg,{status:a.status}),a.state===`failed`&&a.error===void 0&&(0,m.jsx)(`span`,{className:`text-[10px] text-zinc-500`,children:`see the run.trigger_failed event for the reason`})]},a.subscriber)})})]})}function Hg({tags:e,onChange:t}){let n=e.includes(jg);return(0,m.jsx)(Y,{variant:`ghost`,size:`xs`,"aria-pressed":n,title:`Settled runs whose lifecycle event is still owed to a subscriber (tag durable:lifecycle:pending)`,onClick:()=>t(n?e.filter(e=>e!==jg):[...e,jg]),className:Sa(`mono rounded-md border-line`,n&&`border-amber-500/40 bg-amber-500/10 text-amber-200 hover:text-amber-100`),children:`lifecycle pending`})}function Ug(e){let t=e.lastIndexOf(`~retry~`);return t===-1?void 0:e.slice(0,t)}function Wg(e){return(Ug(e)??e).match(/^(.*)\.(?:child\.\d+|onError\.\d+)$/)?.[1]||void 0}function Gg(e,t){if(t&&e.startsWith(`evt:`))for(let n of[`completed`,`failed`]){let r=`:${n}:${t}`;if(e.endsWith(r)&&e.length>4+r.length)return e.slice(4,-r.length)}}function Kg(e){let t=[];if(e.type===`run.triggered`&&e.triggeredRunId&&t.push({rel:`triggered`,runId:e.triggeredRunId}),e.type===`run.started`){let n=Gg(e.runId,e.workflow);n&&t.push({rel:`source`,runId:n});let r=Wg(e.runId);r&&t.push({rel:`parent`,runId:r})}if(e.type.startsWith(`step.`)&&e.name){let n=Sh({name:e.name});n&&t.push({rel:`child`,runId:n})}return t}function qg(e){let t=[];return e.name&&t.push(e.type===`run.triggered`||e.type===`run.trigger_failed`?`subscriber ${e.name}`:e.type===`run.routed`?`handler ${e.name}`:e.name),e.durationMs!==void 0&&t.push(`${e.durationMs}ms`),e.error?.message&&t.push(e.error.message),e.reason&&t.push(e.reason),t.join(` · `)}function Jg(e){let t=new Map;for(let{event:n}of e)n.type===`run.trigger_failed`&&n.name&&t.set(n.name,n.error?.message??`unknown error`),n.type===`run.triggered`&&n.name&&t.delete(n.name);return t}function Yg(e){return(0,p.useSyncExternalStore)(e.subscribe,e.snapshot,e.snapshot)}var Xg={triggered:`started`,source:`started by`,child:`child`,parent:`child of`};function Zg(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().slice(11,23)}function Qg({tail:e,onOpenRun:t}){let n=Yg(e);return(0,m.jsxs)(`section`,{"aria-label":`Events`,className:`mt-3`,"data-testid":`run-events`,children:[(0,m.jsxs)(`h3`,{className:`text-[10px] uppercase tracking-wider text-zinc-500`,children:[`Events`,n.length>0?` · ${n.length}`:``]}),n.length===0?(0,m.jsxs)(`p`,{className:`mt-1 text-[11px] text-zinc-500`,children:[`Live only: the engine events of this run show here as they arrive while the page is open (the last `,e.limit,`). Nothing is stored, so earlier events are not shown.`]}):(0,m.jsx)(`ol`,{className:`mt-1 flex max-h-72 flex-col gap-0.5 overflow-auto`,children:[...n].reverse().map(({id:e,event:n})=>(0,m.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1.5 text-[11px]`,"data-type":n.type,children:[(0,m.jsx)(`span`,{className:`mono text-zinc-500`,children:Zg(n.at)}),(0,m.jsx)(wa,{variant:n.type===`run.trigger_failed`||n.type.endsWith(`.failed`)||n.type===`run.unrouted`?`danger`:`outline`,className:`mono`,children:n.type}),(0,m.jsx)(`span`,{className:`text-zinc-300`,children:qg(n)}),Kg(n).map(e=>(0,m.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-zinc-600`,children:Xg[e.rel]}),(0,m.jsx)(Y,{variant:`chip`,size:`xs`,onClick:()=>t(e.runId),className:`mono max-w-[24rem] truncate px-1.5 py-0`,title:e.runId,children:e.runId})]},`${e.rel}:${e.runId}`))]},e))})]})}function $g({deliveries:e,tail:t,onOpenRun:n}){let r=Yg(t);return(0,m.jsx)(Vg,{deliveries:e,errors:Jg(r),onOpenRun:n})}function e_({run:e,onClose:t}){let n=e.input===void 0&&e.output===void 0&&!e.error;return(0,m.jsxs)(`aside`,{className:`absolute inset-y-0 right-0 z-30 flex w-[380px] max-w-[90%] flex-col border-l border-line bg-panel/95 shadow-2xl backdrop-blur-md rise`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-line px-5 py-4`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`h3`,{className:`truncate text-[15px] font-semibold tracking-tight text-zinc-50`,children:e.workflow}),(0,m.jsxs)(`div`,{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[`run · `,e.status]})]}),(0,m.jsx)(`button`,{type:`button`,onClick:t,className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-line text-zinc-500 transition-colors hover:text-zinc-200`,"aria-label":`Close`,children:(0,m.jsx)(Fr,{})})]}),(0,m.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4`,children:[e.error&&(0,m.jsx)(Dg,{error:e.error}),e.input!==void 0&&(0,m.jsx)(Eg,{label:`input`,value:e.input}),e.output!==void 0&&(0,m.jsx)(Eg,{label:`output`,value:e.output}),n&&(0,m.jsx)(`div`,{className:`text-sm text-zinc-600`,children:`No input/output recorded.`})]})]})}function t_(e){let t=(e,t)=>`${Number.isInteger(e)?e:e.toFixed(1)}${t}`;if(e<1e3)return`${e}ms`;let n=e/1e3;if(n<60)return t(n,`s`);let r=n/60;if(r<60)return t(r,`m`);let i=r/60;return i<24?t(i,`h`):t(i/24,`d`)}function n_(e){return e.cron?e.cron:e.everyMs==null?`—`:`every ${t_(e.everyMs)}`}function r_(e,t=Date.now()){let n=e-t;if(n<=0)return`due now`;let r=Math.round(n/1e3);if(r<60)return`in ${r}s`;let i=Math.round(r/60);if(i<60)return`in ${i}m`;let a=Math.round(i/60);return a<24?`in ${a}h`:`in ${Math.round(a/24)}d`}var i_=`grid grid-cols-[minmax(140px,1.2fr)_minmax(120px,1fr)_minmax(110px,0.9fr)_90px_90px_minmax(110px,0.9fr)_auto] items-center gap-3 px-5`;function a_({s:e,onOpenRun:t}){let n=g(),r=()=>n.invalidateQueries({queryKey:[`schedules`]}),i=$e({mutationFn:t=>yr.setSchedulePaused(e.key,t),onSuccess:r}),a=$e({mutationFn:()=>yr.triggerSchedule(e.key),onSuccess:e=>{r(),n.invalidateQueries({queryKey:[`runs`]}),t(e.runId)}}),o=e.namespace&&e.namespace!=="default"?e.namespace:void 0;return(0,m.jsxs)(`li`,{className:Sa(i_,`py-3`),children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`mono truncate text-[12px] text-zinc-200`,children:e.key}),e.overlap===`skip`&&(0,m.jsx)(`div`,{className:`mono text-[9px] uppercase tracking-wider text-zinc-600`,children:`no overlap`})]}),(0,m.jsxs)(`div`,{className:`mono flex min-w-0 items-center gap-1.5 text-[11px] text-zinc-400`,children:[(0,m.jsx)(`span`,{className:`truncate`,children:e.workflow}),o&&(0,m.jsx)(wa,{variant:`tenant`,className:`mono shrink-0 px-1 text-[9px]`,children:o})]}),(0,m.jsx)(`span`,{className:`mono truncate text-[11px] text-zinc-300`,title:n_(e),children:n_(e)}),(0,m.jsx)(`span`,{className:`mono truncate text-[10px] text-zinc-500`,children:e.timezone??`UTC`}),(0,m.jsx)(`span`,{className:Sa(`mono tnum text-[11px]`,e.paused?`text-zinc-600`:`text-zinc-400`),title:new Date(e.nextFireAt).toISOString(),children:e.paused?`—`:r_(e.nextFireAt)}),(0,m.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.lastRunStatus?(0,m.jsx)(`button`,{type:`button`,onClick:()=>t(e.currentWindowRunId),title:`Open the current window's run (${e.currentWindowRunId})`,className:`cursor-pointer`,children:(0,m.jsxs)(wa,{variant:`status`,className:`s-${e.lastRunStatus} text-[11px] hover:underline`,children:[(0,m.jsx)(`span`,{className:`dot s-${e.lastRunStatus}`,"aria-hidden":!0}),e.lastRunStatus]})}):(0,m.jsx)(`span`,{className:`mono text-[11px] text-zinc-600`,title:`The current window has no run yet`,children:`—`}),e.paused&&(0,m.jsx)(gh,{label:e.pausedAtRuntime?`Paused by a runtime override (from this console) — it survives until resumed, overriding the config.`:`Paused in the schedule config.`,children:(0,m.jsxs)(wa,{variant:`warn`,className:`mono py-0.5 uppercase tracking-wider`,children:[`paused`,e.pausedAtRuntime?` · runtime override`:``]})})]}),(0,m.jsxs)(`span`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,m.jsx)(Y,{variant:e.paused?`outline`:`warn`,size:`xs`,disabled:i.isPending,onClick:()=>i.mutate(!e.paused),className:`mono uppercase tracking-wider`,title:e.paused?`Resume this schedule fleet-wide (clears the runtime pause)`:`Pause this schedule fleet-wide, at runtime — the config stays untouched`,children:e.paused?`Resume`:`Pause`}),(0,m.jsxs)(Y,{variant:`brand`,size:`xs`,disabled:a.isPending,onClick:()=>a.mutate(),className:`mono uppercase tracking-wider`,title:`Fire the current window now and open its run`,children:[(0,m.jsx)(zr,{width:10,height:10}),`Run now`]})]}),(i.error||a.error)&&(0,m.jsx)(`div`,{role:`alert`,className:`mono col-span-full text-[11px] text-rose-300`,children:(()=>{let e=i.error??a.error;return`Action failed: ${e instanceof Error?e.message:String(e)}`})()})]})}function o_({onOpenRun:e}){let{data:t,error:n,isPending:r}=Qe({queryKey:[`schedules`],queryFn:()=>yr.schedules(),refetchInterval:5e3,retry:!1});return n?(0,m.jsx)(`div`,{className:`grid h-full place-items-center p-8 text-center`,children:(0,m.jsxs)(`div`,{className:`max-w-md`,children:[(0,m.jsx)(`p`,{className:`text-sm text-zinc-400`,children:`Schedules are not available here.`}),(0,m.jsxs)(`p`,{className:`mono mt-2 text-[11px] text-zinc-600`,children:["This deployment's server has no runtime schedule control (a tenant topology, or a server older than the endpoint) — `GET /schedules` answered: ",n.message]})]})}):r?(0,m.jsx)(`div`,{className:`p-8 text-sm text-zinc-600`,children:`Loading schedules…`}):t.length===0?(0,m.jsx)(`div`,{className:`grid h-full place-items-center text-sm text-zinc-600`,children:`No schedules registered.`}):(0,m.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,m.jsxs)(`div`,{className:`border-b border-line px-5 py-4`,children:[(0,m.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:`Schedules`}),(0,m.jsxs)(`p`,{className:`mono mt-1 text-[11px] text-zinc-600`,children:[t.length,` ticked schedule`,t.length===1?``:`s`,` · pause/resume is a fleet-wide runtime override · "Run now" fires the current window`]})]}),(0,m.jsxs)(`div`,{className:Sa(i_,`mono border-b border-line py-2 text-[9px] uppercase tracking-[0.18em] text-zinc-600`),children:[(0,m.jsx)(`span`,{children:`key`}),(0,m.jsx)(`span`,{children:`workflow`}),(0,m.jsx)(`span`,{children:`cadence`}),(0,m.jsx)(`span`,{children:`timezone`}),(0,m.jsx)(`span`,{children:`next fire`}),(0,m.jsx)(`span`,{children:`last run`}),(0,m.jsx)(`span`,{className:`text-right`,children:`actions`})]}),(0,m.jsx)(`ul`,{className:`min-h-0 flex-1 divide-y divide-line-soft overflow-auto`,children:t.map(t=>(0,m.jsx)(a_,{s:t,onOpenRun:e},t.key))})]})}var s_=p.createContext(void 0);function c_(e){let t=p.useContext(s_);if(!e&&t===void 0)throw Error(Bu(27));return t}var l_=p.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=c_(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Zl(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:as,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),u_=p.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=c_(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=hp({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,bs(Es,e.nativeEvent))}return Zl(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),d_=p.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=c_(),c=vp(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Zl(`p`,e,{ref:t,props:[{id:c},o]})}),f_=p.createContext(void 0);function p_(){let e=p.useContext(f_);if(e===void 0)throw Error(Bu(26));return e}var m_=`--nested-dialogs`,h_=`data-nested-dialog-open`,g_={...is,...Go,nestedDialogOpen(e){return e?{[h_]:``}:null}},__=p.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=c_(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),h=c.useState(`mounted`),g=c.useState(`nested`),_=c.useState(`nestedOpenDialogCount`),v=c.useState(`open`),y=c.useState(`openMethod`),b=c.useState(`titleElementId`),x=c.useState(`transitionStatus`),S=c.useState(`role`),C=d.useState(`floatingId`);p_(),qu({open:v,ref:c.context.popupRef,onComplete(){v&&c.context.onOpenChangeComplete?.(!0)}});let w=o===void 0?Xu(c.context.popupRef):o,T=_>0,E=c.useStateSetter(`popupElement`),D=Zl(`div`,e,{state:{open:v,nested:g,transitionStatus:x,nestedDialogOpen:T},props:[f,{id:C,"aria-labelledby":b,"aria-describedby":l,role:S,...Yu,hidden:!h,onKeyDown(e){gm.has(e.key)&&e.stopPropagation()},style:{[m_]:_}},s],ref:[t,c.context.popupRef,E],stateAttributesMapping:g_});return(0,m.jsx)(ju,{context:d,openInteractionType:y,disabled:!h,closeOnFocusOut:!u,initialFocus:w,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:D})}),v_=p.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=c_(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,m.jsx)(f_.Provider,{value:n,children:(0,m.jsxs)(fu,{ref:t,...r,children:[a&&o===!0&&(0,m.jsx)(Jp,{ref:i.context.internalBackdropRef,inert:Ep(!s)}),e.children]})}):null});function y_({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=p.useState(0),[d,f]=p.useState(0),m=l===0,h=Ru(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Ro(t);if(m&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Z(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return cm(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),X(()=>{!r&&!i&&(u(0),f(0))},[r,i]),X(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),sd(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var b_={...jd,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},x_=class extends Sd{constructor(e,t,n){let r=new ld,i=S_(e,r,t,n);super(i,C_(r),b_)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(td(this.state,e,t.trigger)))}};function S_(e,t,n,r=!1){return{...Td(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function C_(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function w_(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,h=e===`drawer`,g=e===`alert-dialog`,_=g?!0:c,v=g||s,y=g?`alertdialog`:`dialog`,b=c_(!0),x={modal:_,disablePointerDismissal:v,nested:b!=null,role:y},S=Zu((e,t)=>new x_({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...x},e,t),!0);S.useControlledProp(`openProp`,r),S.useControlledProp(`triggerIdProp`,d),S.useSyncedValues(x),S.useContextCallback(`onOpenChange`,a),S.useContextCallback(`onOpenChangeComplete`,o);let C=S.useState(`open`),w=S.useState(`mounted`),T=S.useState(`payload`);cd(S,C),ad(S);let{forceUnmount:E}=od(C,S);p.useImperativeHandle(l,()=>({unmount:E,close:()=>S.setOpen(!1,bs(Ms))}),[E,S]);let D=C||w||u!=null;return(0,m.jsxs)(s_.Provider,{value:S,children:[u&&(0,m.jsx)(Qu,{handle:u,store:S}),D&&(0,m.jsx)(y_,{store:S,parentContext:b?.context,isDrawer:h}),typeof n==`function`?n({payload:T}):n]})}var T_=Pa(function(e){return w_(`dialog`,e)}),E_=p.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=c_(),c=vp(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Zl(`h2`,e,{ref:t,props:[{id:c},o]})});Fa(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=c_(!0),f=Md(l)??d;if(!f)throw Error(Bu(79));let m=vp(s),h=f.useState(`floatingRootContext`),g=f.useState(`isOpenedByTrigger`,m),_=f.useState(`triggerPopupId`,m),v=p.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=id(m,v,f,{payload:c}),{getButtonProps:x,buttonRef:S}=hp({disabled:a,native:o}),C=Mu(h),w=xp(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),T={disabled:a,open:g},E=f.useState(`triggerProps`,b);return Zl(`button`,e,{state:T,ref:[S,t,y,v],props:[C.reference,E,w,{[au]:``,id:m,"aria-haspopup":`dialog`,"aria-expanded":g,"aria-controls":_},u,x],stateAttributesMapping:ns})});var D_=T_,O_=u_;function k_({open:e,onOpenChange:t,title:n,subtitle:r,footer:i,children:a,className:o}){return(0,m.jsx)(D_,{open:e,onOpenChange:t,children:(0,m.jsxs)(v_,{children:[(0,m.jsx)(l_,{className:`fixed inset-0 z-40 bg-black/60 backdrop-blur-sm`}),(0,m.jsxs)(__,{className:Sa(`rise fixed left-1/2 top-1/2 z-50 w-[min(560px,92vw)] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-line bg-panel-2 text-foreground shadow-2xl focus-visible:outline-none`,o),children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-line px-5 py-4`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(E_,{className:`truncate text-[15px] font-semibold tracking-tight text-zinc-50`,children:n}),r&&(0,m.jsx)(d_,{className:`mono mt-1 text-[11px] text-zinc-500`,children:r})]}),(0,m.jsx)(O_,{render:(0,m.jsx)(Y,{variant:`quiet`,size:`icon`,"aria-label":`Close`,children:(0,m.jsx)(Fr,{})})})]}),(0,m.jsx)(`div`,{className:`px-5 py-4`,children:a}),i&&(0,m.jsx)(`div`,{className:`flex items-center justify-end gap-2 border-t border-line px-5 py-3`,children:i})]})]})})}function A_({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=p.useRef(e!==void 0),[a,o]=p.useState(()=>t);return[i&&e!==void 0?e:a,p.useCallback(e=>{i||o(e)},[])]}var j_=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function M_(){return p.useContext(j_)}function N_(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Q(i),[,o]=p.useState(0),s=ka(F_).current,c=ka(P_).current,l=p.useRef(0),u=p.useRef(!0),d=p.useRef(null),f=p.useRef(null),h=Q(()=>{u.current||(u.current=!0,o(e=>e+1))}),g=Q((e,t)=>{c.set(e,t),h()}),_=Q(e=>{c.delete(e),h()}),v=Q(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function y(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!R_(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&z_(r,n)>0){t.disconnect(),h();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=L_(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let b=Q(()=>{let[e,t]=I_(c),n=v(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});y(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});X(()=>(!u.current&&d.current&&v(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,v]),X(()=>{u.current&&b()}),X(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let x=Q(e=>(s.add(e),()=>{s.delete(e)})),S=p.useMemo(()=>({register:g,unregister:_,subscribeMapChange:x,nextIndexRef:l}),[g,_,x,l]);return(0,m.jsx)(j_.Provider,{value:S,children:t})}function P_(){return new Map}function F_(){return new Set}function I_(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>z_(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function L_(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function R_(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function z_(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var B_=p.createContext(void 0);function V_(){let e=p.useContext(B_);if(e===void 0)throw Error(Bu(64));return e}var H_=`data-activation-direction`,U_={tabActivationDirection:e=>({[H_]:e})},W_=p.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=p.useRef([]),[f,h]=p.useState(()=>new Map),[g,_]=A_({controlled:s,default:r,name:`Tabs`,state:`value`}),v=s!==void 0,[y,b]=p.useState(()=>new Map),x=p.useRef(void 0),S=p.useCallback(e=>G_(y,e),[y]),[C,w]=p.useState(()=>({previousValue:g,tabActivationDirection:`none`})),{previousValue:T,tabActivationDirection:E}=C,D=E,O=!1;T!==g&&(D=K_(T,g,a,y),O=T!=null&&g!=null&&S(g)==null);let k=O?T:g,A=T!==k||E!==D;X(()=>{A&&w({previousValue:k,tabActivationDirection:D})},[k,A,D]);let j=Q((e,t)=>{t.activationDirection=K_(g,e,a,y),i?.(e,t),t.isCanceled||_(()=>e)}),M=Q((e,t)=>{i?.(e,bs(t,void 0,void 0,{activationDirection:`none`}))}),N=Q((e,t)=>(h(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{h(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),P=p.useCallback(e=>f.get(e),[f]),F=p.useCallback(e=>{for(let t of y.values())if(e===t.value)return t.id},[y]),I=p.useMemo(()=>({getTabElementBySelectedValue:S,getTabIdByPanelValue:F,getTabPanelIdByValue:P,onValueChange:j,orientation:a,registerMountedTabPanel:N,setTabMap:b,tabActivationDirection:D,value:g}),[S,F,P,j,a,N,b,D,g]),L=p.useMemo(()=>{for(let e of y.values())if(e.value===g)return e},[y,g]),R=p.useMemo(()=>{for(let e of y.values())if(!e.disabled)return e.value},[y]),ee=p.useRef(!u),z=p.useRef(r),te=p.useRef(u),B=p.useRef(!1);X(()=>{if(v)return;function e(e,t){_(()=>e),w({previousValue:e,tabActivationDirection:`none`}),M(e,t),ee.current=!1}if(y.size===0){B.current&&g!==null&&!x.current?.isConnected&&e(null,As);return}B.current=!0,x.current=y.keys().next().value;let t=L?.disabled,n=L==null&&g!==null;if(!t&&g===z.current&&(te.current=!1),te.current&&t&&g===z.current)return;let r=ee.current;if(t||n){let n=R??null;if(g===n){ee.current=!1;return}let i=As;r?i=js:t&&(i=ks),e(n,i)}else r&&L!=null&&(M(g,js),ee.current=!1)},[R,v,M,L,_,y,g]);let ne=Zl(`div`,e,{state:{orientation:a,tabActivationDirection:D},ref:t,props:l,stateAttributesMapping:U_});return(0,m.jsx)(B_.Provider,{value:I,children:(0,m.jsx)(N_,{elementsRef:d,children:ne})})});function G_(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function K_(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=G_(r,e),c=G_(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var q_=`data-composite-item-active`;function J_(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=M_(),u=p.useRef(-1),[d,f]=p.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),m=a??d,h=p.useRef(null),g=p.useCallback(e=>{let t=h.current;t&&s(t),h.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return X(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:g,index:m}}function Y_(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=fp(),{ref:i,index:a}=J_(e),o=n===a,s=p.useRef(null),c=zs(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}var X_=p.createContext(void 0);function Z_(){let e=p.useContext(X_);if(e===void 0)throw Error(Bu(65));return e}var Q_=p.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:m,tabActivationDirection:h}=V_(),{activateOnFocus:g,registerTabResizeObserverElement:_,tabsListElement:v}=Z_(),{highlightedIndex:y,onHighlightedIndexChange:b}=fp(),x=vp(o),{compositeProps:S,compositeRef:C,index:w}=Y_({metadata:p.useMemo(()=>({disabled:r,id:x,value:a}),[r,x,a])}),T=a===u,E=p.useRef(!1),D=p.useRef(null),O=Q(e=>{D.current?.(),D.current=e?_(e):null});X(()=>{if(E.current){E.current=!1;return}if(!(T&&w>-1&&y!==w))return;let e=v;if(e!=null){let t=Io(nc(e));if(t&&Z(e,t))return}r||b(w)},[T,w,y,b,r,v]);let{getButtonProps:k,buttonRef:A}=hp({disabled:r,native:s,focusableWhenDisabled:!0}),j=d(a),M=p.useRef(!1),N=p.useRef(!1);function P(e){f(a,bs(xs,e.nativeEvent,void 0,{activationDirection:`none`}))}function F(e){T||r||P(e)}function I(e){T||r||g&&(!M.current||N.current)&&P(e)}function L(e){if(T||r)return;M.current=!0,N.current=e.button===0;let t=nc(e.currentTarget);function n(){M.current=!1,N.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return Zl(`button`,e,{state:{disabled:r,active:T,orientation:m,tabActivationDirection:h},ref:[t,A,C,O],props:[S,{role:`tab`,"aria-controls":j,"aria-selected":T,id:x,onClick:F,onFocus:I,onPointerDown:L,[q_]:T?``:void 0,onKeyDownCapture(){E.current=!0}},l,k],stateAttributesMapping:U_})}),$_=`data-index`,ev={...U_,...Go},tv=p.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=V_(),m=vp(),{ref:h,index:g}=J_(),_=r===c,{mounted:v,transitionStatus:y,setMounted:b}=Hu(_),x=!v,S=l(r),C={hidden:x,orientation:u,tabActivationDirection:d,transitionStatus:y},w=p.useRef(null),T=Zl(`div`,e,{state:C,ref:[t,h,w],props:[{"aria-labelledby":S,hidden:x,id:m,role:`tabpanel`,tabIndex:_?0:-1,inert:Ep(!_),[$_]:g},s],stateAttributesMapping:ev});return qu({open:_,ref:w,onComplete(){_||b(!1)}}),X(()=>{if(!(m==null||x&&!a))return f(r,m)},[x,a,r,m,f]),a||v?T:null});function nv(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function rv(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=Ra}=e,[m,h]=p.useState(0),g=r!=null,_=p.useRef(null),v=zs(_,c),y=p.useRef([]),b=p.useRef(!1),x=p.useRef(null),S=o??m,C=Q((e,t=!1)=>{if(x.current=y.current[e]??null,(s??h)(e),t){let t=y.current[e];bm(_.current,t,a,n)}}),w=Q(e=>{if(e.size===0)return;if(b.current){let e=y.current,t=e.indexOf(x.current);if(t===-1){let t=e[S];!t||Lc(e,S,d)?C(iv(e,d)):x.current=t}else t!==S&&C(t);return}b.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)C(i);else if(Lc(t,S,d)){let e=Ic(t,{disabledIndices:d});Nc(t,e)||C(e)}bm(_.current,r,a,n)});X(()=>{if(d==null||o!=null||!b.current)return;let e=y.current;if(Lc(e,S,d)){let t=Ic(e,{disabledIndices:d});Nc(e,t)||C(t)}},[d,o,S,y,C]);let T=Q((e,t,n)=>i?i(e,t,n,y):n),E=Q(e=>{let o=e.key===`Home`||e.key===`End`;if(!gm.has(e.key)||!l&&o||av(e,f)||!_.current)return;let s=a===`rtl`,c=s?mm:hm,p=s?hm:mm,m=n===`vertical`?pm:c,h=n===`vertical`?fm:p,v=Ro(e.nativeEvent);if(v!=null&&ym(v)&&!nv(v)){let t=v.selectionStart,n=v.selectionEnd,r=v.value;if(t==null||e.shiftKey||t!==n||e.key!==h&&t<r.length||e.key!==m&&t>0)return}let b=S,x=Pc(y,d),w=Fc(y,d);r!=null&&(b=r({disabledIndices:d,elementsRef:y,event:e,highlightedIndex:S,loopFocus:t,maxIndex:w,minIndex:x,onLoop:T,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=x:e.key===`End`&&(b=w)),b===S&&(E||D)&&(t&&b===w&&E?(b=x,i&&(b=i(e,S,b,y))):t&&b===x&&D?(b=w,i&&(b=i(e,S,b,y))):b=Ic(y.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==S&&!Nc(y.current,b)&&(u&&e.stopPropagation(),(g||o||E||D)&&e.preventDefault(),C(b,!0),queueMicrotask(()=>{y.current[b]?.focus()}))});return{props:{ref:v,onFocus(e){let t=_.current,n=Ro(e.nativeEvent);t&&n!=null&&ym(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:S,onHighlightedIndexChange:C,elementsRef:y,onMapChange:w,relayKeyboardEvent:E}}function iv(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!Lc(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function av(e,t){for(let n of _m)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function ov(e){let{render:t,className:n,style:r,refs:i=Ra,props:a=Ra,state:o=za,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:h,enableHomeAndEndKeys:g,onMapChange:_,stopEventPropagation:v=!0,rootRef:y,disabledIndices:b,modifierKeys:x,highlightItemOnHover:S=!1,tag:C=`div`,...w}=e,{props:T,highlightedIndex:E,onHighlightedIndexChange:D,elementsRef:O,onMapChange:k,relayKeyboardEvent:A}=rv({grid:d,loopFocus:f,onLoop:h,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:y,stopEventPropagation:v,enableHomeAndEndKeys:g,direction:jp(),disabledIndices:b,modifierKeys:x}),j=Zl(C,e,{state:o,ref:i,props:[T,...a,w],stateAttributesMapping:s}),M=p.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:D,highlightItemOnHover:S,relayKeyboardEvent:A}),[E,D,S,A]);return(0,m.jsx)(dp.Provider,{value:M,children:(0,m.jsx)(N_,{elementsRef:O,onMapChange:e=>{_?.(e),k(e)},children:j})})}var sv=p.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=V_(),[d,f]=p.useState(0),[h,g]=p.useState(null),_=p.useRef(new Set),v=p.useRef(new Set),y=p.useRef(null);X(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{_.current.forEach(e=>{e()})});return y.current=e,h&&e.observe(h),v.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),y.current=null}},[h]);let b=Q(e=>(_.current.add(e),()=>{_.current.delete(e)})),x=Q(e=>(v.current.add(e),y.current?.observe(e),()=>{v.current.delete(e),y.current?.unobserve(e)})),S={orientation:c,tabActivationDirection:u},C={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},w=p.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:b,registerTabResizeObserverElement:x,tabsListElement:h}),[n,b,x,h]);return(0,m.jsx)(X_.Provider,{value:w,children:(0,m.jsx)(ov,{render:a,className:r,style:o,state:S,refs:[t,g],props:[C,s],stateAttributesMapping:U_,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:Ra})})}),cv=W_,lv=(0,p.forwardRef)(({className:e,...t},n)=>(0,m.jsx)(sv,{ref:n,className:Sa(`flex items-center gap-0.5 rounded border border-line bg-zinc-900/60 p-0.5`,e),...t}));lv.displayName=`TabsList`;var uv=(0,p.forwardRef)(({className:e,...t},n)=>(0,m.jsx)(Q_,{ref:n,className:Sa(`mono cursor-pointer rounded px-1.5 py-0.5 text-[10px] text-zinc-500 transition-colors hover:text-zinc-300 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-[active]:bg-zinc-700 data-[active]:text-zinc-100`,e),...t}));uv.displayName=`TabsTab`;var dv=(0,p.forwardRef)(({className:e,...t},n)=>(0,m.jsx)(tv,{ref:n,className:Sa(`focus-visible:outline-none`,e),...t}));dv.displayName=`TabsPanel`;function fv(e){let t=e.trim();if(t!==``)return JSON.parse(t)}var pv=`Not available on a tenant deployment — delivering signals/updates/tasks needs the control plane.`;function mv({id:e,label:t,hint:n,draft:r,onDraft:i}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`label`,{className:`mono mb-1.5 mt-3 block text-[10px] uppercase tracking-[0.18em] text-zinc-500`,htmlFor:e,children:t}),(0,m.jsx)(`textarea`,{id:e,value:r,spellCheck:!1,placeholder:n,onChange:e=>i(e.target.value),className:`mono h-40 w-full resize-y rounded-lg border border-line bg-black/40 p-3 text-[11.5px] leading-relaxed text-zinc-300 placeholder:text-zinc-700 focus:border-zinc-600 focus:outline-none`})]})}function hv({runId:e,targets:t,tenantPod:n,onDelivered:r}){let[i,a]=(0,p.useState)(void 0),[o,s]=(0,p.useState)(``),[c,l]=(0,p.useState)(``),[u,d]=(0,p.useState)(void 0),[f,h]=(0,p.useState)(void 0),g=e=>{s(e.verb===`signal`?e.token:``),l(``),d(void 0),h(void 0),a(e)},_=()=>a(void 0),v=()=>{_(),r()},y=e=>{h(hr(e)),d(e instanceof mr||e instanceof Error?e.message:`request failed`)},b=$e({mutationFn:t=>yr.signal(e,t.token,t.payload),onSuccess:v,onError:y}),x=$e({mutationFn:t=>yr.update(e,t.name,t.arg),onSuccess:v,onError:y}),S=$e({mutationFn:t=>yr.completeTask(e,t.name,t.result),onSuccess:v,onError:y}),C=$e({mutationFn:t=>yr.failTask(e,t.name,t.error),onSuccess:v,onError:y}),w=b.isPending||x.isPending||S.isPending||C.isPending;if(t.length===0)return null;let T=()=>{if(!i)return;if(i.verb===`task-fail`){C.mutate({name:i.name,error:c.trim()||`failed from console`});return}let e;try{e=fv(c)}catch(e){d(e instanceof Error?e.message:`Invalid JSON`);return}if(i.verb===`signal`){let t=o.trim();if(!t){d(`token is required`);return}b.mutate({token:t,payload:e})}else i.verb===`update`?x.mutate({name:i.name,arg:e}):S.mutate({name:i.name,result:e})},E=i?.verb===`signal`?`Deliver signal`:i?.verb===`update`?`Send update`:i?.verb===`task-complete`?`Complete task`:`Fail task`,D=i?.verb===`signal`?`resumes ${e} at its ctx.waitForSignal`:i?.verb===`update`?`delivers to ${e}'s ctx.onUpdate("${i.name}") — the workflow's validator arbitrates`:i?`settles ${e}'s external task "${i.name}"`:``;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-sky-500/30 bg-sky-500/10 px-7 py-3`,children:[(0,m.jsx)(`span`,{className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-sky-500/40 bg-sky-500/15 text-sm text-sky-300`,"aria-hidden":!0,children:`✋`}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsx)(`div`,{className:`text-[13px] font-medium text-sky-200`,children:`Waiting on a human`}),(0,m.jsxs)(`div`,{className:`mono truncate text-[11px] text-sky-300/70`,children:[`this run is suspended until someone answers the wait`,t.length===1?``:`s`,` `,`below`]})]}),(0,m.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:t.map(e=>e.kind===`task`?(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,m.jsxs)(`span`,{className:`mono max-w-[180px] truncate text-[10px] text-sky-300/80`,children:[`task `,e.name]}),(0,m.jsxs)(Y,{variant:`brand`,size:`xs`,disabled:n||w,title:n?pv:`Complete task "${e.name}" with a result`,onClick:()=>g({verb:`task-complete`,name:e.name}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(Pr,{width:10,height:10}),`Complete task`]}),(0,m.jsxs)(Y,{variant:`danger`,size:`xs`,disabled:n||w,title:n?pv:`Fail task "${e.name}" with a reason`,onClick:()=>g({verb:`task-fail`,name:e.name}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(Fr,{width:10,height:10}),`Fail task`]})]},e.token):e.kind===`update`?(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,m.jsxs)(`span`,{className:`mono max-w-[180px] truncate text-[10px] text-sky-300/80`,children:[`update `,e.name]}),(0,m.jsxs)(Y,{variant:`info`,size:`xs`,disabled:n||w,title:n?pv:`Send a validated update to "${e.name}"`,onClick:()=>g({verb:`update`,name:e.name}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(Rr,{width:10,height:10}),`Send update`]})]},e.token):(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,m.jsxs)(`span`,{className:`mono max-w-[180px] truncate text-[10px] text-sky-300/80`,children:[`signal `,e.token]}),(0,m.jsxs)(Y,{variant:`info`,size:`xs`,disabled:n||w,title:n?pv:`Deliver a payload on "${e.token}"`,onClick:()=>g({verb:`signal`,token:e.token}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(Rr,{width:10,height:10}),`Deliver signal`]})]},e.token))})]}),(0,m.jsxs)(k_,{open:i!==void 0,onOpenChange:e=>{e||_()},title:E,subtitle:D,footer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Y,{onClick:_,children:`Cancel`}),(0,m.jsx)(Y,{variant:i?.verb===`task-fail`?`danger`:`info`,disabled:w,onClick:T,children:E})]}),children:[i?.verb===`signal`&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`label`,{className:`mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-zinc-500`,htmlFor:`deliver-signal-token`,children:`token`}),(0,m.jsx)(Da,{id:`deliver-signal-token`,value:o,onChange:e=>{s(e.target.value),d(void 0)},onClear:()=>s(``),clearLabel:`clear token`,placeholder:`signal token…`,"aria-label":`signal token`}),(0,m.jsx)(mv,{id:`deliver-signal-payload`,label:`payload (json, optional)`,hint:`empty delivers no payload`,draft:c,onDraft:e=>{l(e),d(void 0)}})]}),i?.verb===`update`&&(0,m.jsx)(mv,{id:`send-update-arg`,label:`argument (json, optional)`,hint:`empty sends no argument`,draft:c,onDraft:e=>{l(e),d(void 0)}}),i?.verb===`task-complete`&&(0,m.jsx)(mv,{id:`complete-task-result`,label:`result (json, optional)`,hint:`empty completes with no result`,draft:c,onDraft:e=>{l(e),d(void 0)}}),i?.verb===`task-fail`&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`label`,{className:`mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-zinc-500`,htmlFor:`fail-task-reason`,children:`reason`}),(0,m.jsx)(Da,{id:`fail-task-reason`,value:c,onChange:e=>{l(e.target.value),d(void 0)},onClear:()=>l(``),clearLabel:`clear reason`,placeholder:`failed from console`,"aria-label":`failure reason`})]}),u&&(0,m.jsx)(`p`,{className:`mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad`,children:u}),f&&f.length>0&&(0,m.jsxs)(`div`,{className:`mt-2`,children:[(0,m.jsx)(`div`,{className:`mono mb-1 text-[10px] uppercase tracking-[0.18em] text-zinc-500`,children:`waiting on — pick one`}),(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:f.map(e=>(0,m.jsx)(Y,{variant:`chip`,size:`xs`,className:`mono`,onClick:()=>{s(e),d(void 0),h(void 0)},children:e},e))})]})]})]})}function gv(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=gv(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var _v={value:()=>{}};function vv(){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 yv(n)}function yv(e){this._=e}function bv(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}})}yv.prototype=vv.prototype={constructor:yv,on:function(e,t){var n=this._,r=bv(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=xv(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]=Sv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Sv(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 yv(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 xv(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Sv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=_v,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Cv=`http://www.w3.org/1999/xhtml`,wv={svg:`http://www.w3.org/2000/svg`,xhtml:Cv,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Tv(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),wv.hasOwnProperty(t)?{space:wv[t],local:e}:e}function Ev(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Cv&&t.documentElement.namespaceURI===Cv?t.createElement(e):t.createElementNS(n,e)}}function Dv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ov(e){var t=Tv(e);return(t.local?Dv:Ev)(t)}function kv(){}function Av(e){return e==null?kv:function(){return this.querySelector(e)}}function jv(e){typeof e!=`function`&&(e=Av(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 yb(r,this._parents)}function Mv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Nv(){return[]}function Pv(e){return e==null?Nv:function(){return this.querySelectorAll(e)}}function Fv(e){return function(){return Mv(e.apply(this,arguments))}}function Iv(e){e=typeof e==`function`?Fv(e):Pv(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 yb(r,i)}function Lv(e){return function(){return this.matches(e)}}function Rv(e){return function(t){return t.matches(e)}}var zv=Array.prototype.find;function Bv(e){return function(){return zv.call(this.children,e)}}function Vv(){return this.firstElementChild}function Hv(e){return this.select(e==null?Vv:Bv(typeof e==`function`?e:Rv(e)))}var Uv=Array.prototype.filter;function Wv(){return Array.from(this.children)}function Gv(e){return function(){return Uv.call(this.children,e)}}function Kv(e){return this.selectAll(e==null?Wv:Gv(typeof e==`function`?e:Rv(e)))}function qv(e){typeof e!=`function`&&(e=Lv(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 yb(r,this._parents)}function Jv(e){return Array(e.length)}function Yv(){return new yb(this._enter||this._groups.map(Jv),this._parents)}function Xv(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Xv.prototype={constructor:Xv,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 Zv(e){return function(){return e}}function Qv(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 Xv(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function $v(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 Xv(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function ey(e){return e.__data__}function ty(e,t){if(!arguments.length)return Array.from(this,ey);var n=t?$v:Qv,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Zv(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=ny(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 yb(o,r),o._enter=s,o._exit=c,o}function ny(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function ry(){return new yb(this._exit||this._groups.map(Jv),this._parents)}function iy(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 ay(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 yb(s,this._parents)}function oy(){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 sy(e){e||=cy;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 yb(i,this._parents).order()}function cy(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ly(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function uy(){return Array.from(this)}function dy(){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 fy(){let e=0;for(let t of this)++e;return e}function py(){return!this.node()}function my(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 hy(e){return function(){this.removeAttribute(e)}}function gy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _y(e,t){return function(){this.setAttribute(e,t)}}function vy(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function yy(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function by(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 xy(e,t){var n=Tv(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?gy:hy:typeof t==`function`?n.local?by:yy:n.local?vy:_y)(n,t))}function Sy(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Cy(e){return function(){this.style.removeProperty(e)}}function wy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ty(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ey(e,t,n){return arguments.length>1?this.each((t==null?Cy:typeof t==`function`?Ty:wy)(e,t,n??``)):Dy(this.node(),e)}function Dy(e,t){return e.style.getPropertyValue(t)||Sy(e).getComputedStyle(e,null).getPropertyValue(t)}function Oy(e){return function(){delete this[e]}}function ky(e,t){return function(){this[e]=t}}function Ay(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function jy(e,t){return arguments.length>1?this.each((t==null?Oy:typeof t==`function`?Ay:ky)(e,t)):this.node()[e]}function My(e){return e.trim().split(/^|\s+/)}function Ny(e){return e.classList||new Py(e)}function Py(e){this._node=e,this._names=My(e.getAttribute(`class`)||``)}Py.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 Fy(e,t){for(var n=Ny(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Iy(e,t){for(var n=Ny(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Ly(e){return function(){Fy(this,e)}}function Ry(e){return function(){Iy(this,e)}}function zy(e,t){return function(){(t.apply(this,arguments)?Fy:Iy)(this,e)}}function By(e,t){var n=My(e+``);if(arguments.length<2){for(var r=Ny(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?zy:t?Ly:Ry)(n,t))}function Vy(){this.textContent=``}function Hy(e){return function(){this.textContent=e}}function Uy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Wy(e){return arguments.length?this.each(e==null?Vy:(typeof e==`function`?Uy:Hy)(e)):this.node().textContent}function Gy(){this.innerHTML=``}function Ky(e){return function(){this.innerHTML=e}}function qy(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Jy(e){return arguments.length?this.each(e==null?Gy:(typeof e==`function`?qy:Ky)(e)):this.node().innerHTML}function Yy(){this.nextSibling&&this.parentNode.appendChild(this)}function Xy(){return this.each(Yy)}function Zy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Qy(){return this.each(Zy)}function $y(e){var t=typeof e==`function`?e:Ov(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function eb(){return null}function tb(e,t){var n=typeof e==`function`?e:Ov(e),r=t==null?eb:typeof t==`function`?t:Av(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function nb(){var e=this.parentNode;e&&e.removeChild(this)}function rb(){return this.each(nb)}function ib(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ab(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ob(e){return this.select(e?ab:ib)}function sb(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function cb(e){return function(t){e.call(this,t,this.__data__)}}function lb(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 ub(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 db(e,t,n){return function(){var r=this.__on,i,a=cb(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 fb(e,t,n){var r=lb(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?db:ub,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function pb(e,t,n){var r=Sy(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 mb(e,t){return function(){return pb(this,e,t)}}function hb(e,t){return function(){return pb(this,e,t.apply(this,arguments))}}function gb(e,t){return this.each((typeof t==`function`?hb:mb)(e,t))}function*_b(){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 vb=[null];function yb(e,t){this._groups=e,this._parents=t}function bb(){return new yb([[document.documentElement]],vb)}function xb(){return this}yb.prototype=bb.prototype={constructor:yb,select:jv,selectAll:Iv,selectChild:Hv,selectChildren:Kv,filter:qv,data:ty,enter:Yv,exit:ry,join:iy,merge:ay,selection:xb,order:oy,sort:sy,call:ly,nodes:uy,node:dy,size:fy,empty:py,each:my,attr:xy,style:Ey,property:jy,classed:By,text:Wy,html:Jy,raise:Xy,lower:Qy,append:$y,insert:tb,remove:rb,clone:ob,datum:sb,on:fb,dispatch:gb,[Symbol.iterator]:_b};function Sb(e){return typeof e==`string`?new yb([[document.querySelector(e)]],[document.documentElement]):new yb([[e]],vb)}var Cb=0;function wb(){return new Tb}function Tb(){this._=`@`+(++Cb).toString(36)}Tb.prototype=wb.prototype={constructor:Tb,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 Eb(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Db(e,t){if(e=Eb(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 Ob={passive:!1},kb={capture:!0,passive:!1};function Ab(e){e.stopImmediatePropagation()}function jb(e){e.preventDefault(),e.stopImmediatePropagation()}function Mb(e){var t=e.document.documentElement,n=Sb(e).on(`dragstart.drag`,jb,kb);`onselectstart`in t?n.on(`selectstart.drag`,jb,kb):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Nb(e,t){var n=e.document.documentElement,r=Sb(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,jb,kb),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 Pb=e=>()=>e;function Fb(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}})}Fb.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ib(e){return!e.ctrlKey&&!e.button}function Lb(){return this.parentNode}function Rb(e,t){return t??{x:e.x,y:e.y}}function zb(){return navigator.maxTouchPoints||`ontouchstart`in this}function Bb(){var e=Ib,t=Lb,n=Rb,r=zb,i={},a=vv(`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`,_,Ob).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&&(Sb(n.view).on(`mousemove.drag`,m,kb).on(`mouseup.drag`,h,kb),Mb(n.view),Ab(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(jb(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){Sb(e.view).on(`mousemove.drag mouseup.drag`,null),Nb(e.view,l),jb(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]))&&(Ab(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])&&(jb(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])&&(Ab(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Db(l||r,t),p,m,h;if((h=n.call(e,new Fb(`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=Db(l||a,t),_=o}u.call(r,e,new Fb(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:Pb(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Pb(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Pb(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Pb(!!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 Vb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Hb(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ub(){}var Wb=.7,Gb=1/Wb,Kb=`\\s*([+-]?\\d+)\\s*`,qb=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Jb=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Yb=/^#([0-9a-f]{3,8})$/,Xb=RegExp(`^rgb\\(${Kb},${Kb},${Kb}\\)$`),Zb=RegExp(`^rgb\\(${Jb},${Jb},${Jb}\\)$`),Qb=RegExp(`^rgba\\(${Kb},${Kb},${Kb},${qb}\\)$`),$b=RegExp(`^rgba\\(${Jb},${Jb},${Jb},${qb}\\)$`),ex=RegExp(`^hsl\\(${qb},${Jb},${Jb}\\)$`),tx=RegExp(`^hsla\\(${qb},${Jb},${Jb},${qb}\\)$`),nx={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};Vb(Ub,sx,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:rx,formatHex:rx,formatHex8:ix,formatHsl:ax,formatRgb:ox,toString:ox});function rx(){return this.rgb().formatHex()}function ix(){return this.rgb().formatHex8()}function ax(){return bx(this).formatHsl()}function ox(){return this.rgb().formatRgb()}function sx(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Yb.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?cx(t):n===3?new fx(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?lx(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?lx(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=Xb.exec(e))?new fx(t[1],t[2],t[3],1):(t=Zb.exec(e))?new fx(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Qb.exec(e))?lx(t[1],t[2],t[3],t[4]):(t=$b.exec(e))?lx(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ex.exec(e))?yx(t[1],t[2]/100,t[3]/100,1):(t=tx.exec(e))?yx(t[1],t[2]/100,t[3]/100,t[4]):nx.hasOwnProperty(e)?cx(nx[e]):e===`transparent`?new fx(NaN,NaN,NaN,0):null}function cx(e){return new fx(e>>16&255,e>>8&255,e&255,1)}function lx(e,t,n,r){return r<=0&&(e=t=n=NaN),new fx(e,t,n,r)}function ux(e){return e instanceof Ub||(e=sx(e)),e?(e=e.rgb(),new fx(e.r,e.g,e.b,e.opacity)):new fx}function dx(e,t,n,r){return arguments.length===1?ux(e):new fx(e,t,n,r??1)}function fx(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Vb(fx,dx,Hb(Ub,{brighter(e){return e=e==null?Gb:Gb**+e,new fx(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wb:Wb**+e,new fx(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fx(_x(this.r),_x(this.g),_x(this.b),gx(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:px,formatHex:px,formatHex8:mx,formatRgb:hx,toString:hx}));function px(){return`#${vx(this.r)}${vx(this.g)}${vx(this.b)}`}function mx(){return`#${vx(this.r)}${vx(this.g)}${vx(this.b)}${vx((isNaN(this.opacity)?1:this.opacity)*255)}`}function hx(){let e=gx(this.opacity);return`${e===1?`rgb(`:`rgba(`}${_x(this.r)}, ${_x(this.g)}, ${_x(this.b)}${e===1?`)`:`, ${e})`}`}function gx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _x(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vx(e){return e=_x(e),(e<16?`0`:``)+e.toString(16)}function yx(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Sx(e,t,n,r)}function bx(e){if(e instanceof Sx)return new Sx(e.h,e.s,e.l,e.opacity);if(e instanceof Ub||(e=sx(e)),!e)return new Sx;if(e instanceof Sx)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 Sx(o,s,c,e.opacity)}function xx(e,t,n,r){return arguments.length===1?bx(e):new Sx(e,t,n,r??1)}function Sx(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Vb(Sx,xx,Hb(Ub,{brighter(e){return e=e==null?Gb:Gb**+e,new Sx(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wb:Wb**+e,new Sx(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 fx(Tx(e>=240?e-240:e+120,i,r),Tx(e,i,r),Tx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Sx(Cx(this.h),wx(this.s),wx(this.l),gx(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=gx(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Cx(this.h)}, ${wx(this.s)*100}%, ${wx(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Cx(e){return e=(e||0)%360,e<0?e+360:e}function wx(e){return Math.max(0,Math.min(1,e||0))}function Tx(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 Ex=Math.PI/180,Dx=180/Math.PI,Ox=18,kx=.96422,Ax=1,jx=.82521,Mx=4/29,Nx=6/29,Px=3*Nx*Nx,Fx=Nx*Nx*Nx;function Ix(e){if(e instanceof Rx)return new Rx(e.l,e.a,e.b,e.opacity);if(e instanceof Gx)return Kx(e);e instanceof fx||(e=ux(e));var t=Hx(e.r),n=Hx(e.g),r=Hx(e.b),i=zx((.2225045*t+.7168786*n+.0606169*r)/Ax),a,o;return t===n&&n===r?a=o=i:(a=zx((.4360747*t+.3850649*n+.1430804*r)/kx),o=zx((.0139322*t+.0971045*n+.7141733*r)/jx)),new Rx(116*i-16,500*(a-i),200*(i-o),e.opacity)}function Lx(e,t,n,r){return arguments.length===1?Ix(e):new Rx(e,t,n,r??1)}function Rx(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Vb(Rx,Lx,Hb(Ub,{brighter(e){return new Rx(this.l+Ox*(e??1),this.a,this.b,this.opacity)},darker(e){return new Rx(this.l-Ox*(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=kx*Bx(t),e=Ax*Bx(e),n=jx*Bx(n),new fx(Vx(3.1338561*t-1.6168667*e-.4906146*n),Vx(-.9787684*t+1.9161415*e+.033454*n),Vx(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function zx(e){return e>Fx?e**(1/3):e/Px+Mx}function Bx(e){return e>Nx?e*e*e:Px*(e-Mx)}function Vx(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function Hx(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Ux(e){if(e instanceof Gx)return new Gx(e.h,e.c,e.l,e.opacity);if(e instanceof Rx||(e=Ix(e)),e.a===0&&e.b===0)return new Gx(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Dx;return new Gx(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Wx(e,t,n,r){return arguments.length===1?Ux(e):new Gx(e,t,n,r??1)}function Gx(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Kx(e){if(isNaN(e.h))return new Rx(e.l,0,0,e.opacity);var t=e.h*Ex;return new Rx(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Vb(Gx,Wx,Hb(Ub,{brighter(e){return new Gx(this.h,this.c,this.l+Ox*(e??1),this.opacity)},darker(e){return new Gx(this.h,this.c,this.l-Ox*(e??1),this.opacity)},rgb(){return Kx(this).rgb()}}));var qx=-.14861,Jx=1.78277,Yx=-.29227,Xx=-.90649,Zx=1.97294,Qx=Zx*Xx,$x=Zx*Jx,eS=Jx*Yx-Xx*qx;function tS(e){if(e instanceof rS)return new rS(e.h,e.s,e.l,e.opacity);e instanceof fx||(e=ux(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(eS*r+Qx*t-$x*n)/(eS+Qx-$x),a=r-i,o=(Zx*(n-i)-Yx*a)/Xx,s=Math.sqrt(o*o+a*a)/(Zx*i*(1-i)),c=s?Math.atan2(o,a)*Dx-120:NaN;return new rS(c<0?c+360:c,s,i,e.opacity)}function nS(e,t,n,r){return arguments.length===1?tS(e):new rS(e,t,n,r??1)}function rS(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Vb(rS,nS,Hb(Ub,{brighter(e){return e=e==null?Gb:Gb**+e,new rS(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wb:Wb**+e,new rS(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Ex,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new fx(255*(t+n*(qx*r+Jx*i)),255*(t+n*(Yx*r+Xx*i)),255*(t+Zx*r*n),this.opacity)}}));var iS=e=>()=>e;function aS(e,t){return function(n){return e+n*t}}function oS(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function sS(e,t){var n=t-e;return n?aS(e,n>180||n<-180?n-360*Math.round(n/360):n):iS(isNaN(e)?t:e)}function cS(e){return(e=+e)==1?lS:function(t,n){return n-t?oS(t,n,e):iS(isNaN(t)?n:t)}}function lS(e,t){var n=t-e;return n?aS(e,n):iS(isNaN(e)?t:e)}var uS=(function e(t){var n=cS(t);function r(e,t){var r=n((e=dx(e)).r,(t=dx(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=lS(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 dS(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 fS(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pS(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]=SS(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 mS(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function hS(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function gS(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]=SS(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var _S=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vS=new RegExp(_S.source,`g`);function yS(e){return function(){return e}}function bS(e){return function(t){return e(t)+``}}function xS(e,t){var n=_S.lastIndex=vS.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=_S.exec(e))&&(i=vS.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:hS(r,i)})),n=vS.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?bS(c[0].x):yS(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 SS(e,t){var n=typeof t,r;return t==null||n===`boolean`?iS(t):(n===`number`?hS:n===`string`?(r=sx(t))?(t=r,uS):xS:t instanceof sx?uS:t instanceof Date?mS:fS(t)?dS:Array.isArray(t)?pS:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?gS:hS)(e,t)}var CS=180/Math.PI,wS={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function TS(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)*CS,skewX:Math.atan(c)*CS,scaleX:o,scaleY:s}}var ES;function DS(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?wS:TS(t.a,t.b,t.c,t.d,t.e,t.f)}function OS(e){return e==null||(ES||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),ES.setAttribute(`transform`,e),!(e=ES.transform.baseVal.consolidate()))?wS:(e=e.matrix,TS(e.a,e.b,e.c,e.d,e.e,e.f))}function kS(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:hS(e,i)},{i:c-2,x:hS(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:hS(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:hS(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:hS(e,n)},{i:s-2,x:hS(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 AS=kS(DS,`px, `,`px)`,`deg)`),jS=kS(OS,`, `,`)`,`)`),MS=1e-12;function NS(e){return((e=Math.exp(e))+1/e)/2}function PS(e){return((e=Math.exp(e))-1/e)/2}function FS(e){return((e=Math.exp(2*e))-1)/(e+1)}var IS=(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<MS)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=NS(y),c=s/(n*g)*(i*FS(t*r+y)-PS(y));return[a+c*d,o+c*f,s*i/NS(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 LS(e){return(function t(n){n=+n;function r(t,r){var i=e((t=nS(t)).h,(r=nS(r)).h),a=lS(t.s,r.s),o=lS(t.l,r.l),s=lS(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)}LS(sS),LS(lS);var RS=0,zS=0,BS=0,VS=1e3,HS,US,WS=0,GS=0,KS=0,qS=typeof performance==`object`&&performance.now?performance:Date,JS=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function YS(){return GS||=(JS(XS),qS.now()+KS)}function XS(){GS=0}function ZS(){this._call=this._time=this._next=null}ZS.prototype=QS.prototype={constructor:ZS,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?YS():+n)+(t==null?0:+t),!this._next&&US!==this&&(US?US._next=this:HS=this,US=this),this._call=e,this._time=n,rC()},stop:function(){this._call&&(this._call=null,this._time=1/0,rC())}};function QS(e,t,n){var r=new ZS;return r.restart(e,t,n),r}function $S(){YS(),++RS;for(var e=HS,t;e;)(t=GS-e._time)>=0&&e._call.call(void 0,t),e=e._next;--RS}function eC(){GS=(WS=qS.now())+KS,RS=zS=0;try{$S()}finally{RS=0,nC(),GS=0}}function tC(){var e=qS.now(),t=e-WS;t>VS&&(KS-=t,WS=e)}function nC(){for(var e,t=HS,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:HS=n);US=e,rC(r)}function rC(e){RS||(zS&&=clearTimeout(zS),e-GS>24?(e<1/0&&(zS=setTimeout(eC,Math.ceil(e-qS.now()-KS)+1)),BS&&=clearInterval(BS)):(BS||=(WS=qS.now(),setInterval(tC,VS)),RS=1,JS(eC)))}function iC(e,t,n){var r=new ZS;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}function aC(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var oC=3;(function e(t){t=+t;function n(e){return e**+t}return n.exponent=e,n})(oC),(function e(t){t=+t;function n(e){return 1-(1-e)**t}return n.exponent=e,n})(oC),(function e(t){t=+t;function n(e){return((e*=2)<=1?e**+t:2-(2-e)**t)/2}return n.exponent=e,n})(oC);function sC(e){return(2**(-10*e)-.0009765625)*1.0009775171065494}var cC=4/11;1/cC/cC;var lC=1.70158;(function e(t){t=+t;function n(e){return(e=+e)*e*(t*(e-1)+e)}return n.overshoot=e,n})(lC),(function e(t){t=+t;function n(e){return--e*e*((e+1)*t+e)+1}return n.overshoot=e,n})(lC),(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})(lC);var uC=2*Math.PI,dC=1,fC=.3;(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=uC);function i(e){return t*sC(- --e)*Math.sin((r-e)/n)}return i.amplitude=function(t){return e(t,n*uC)},i.period=function(n){return e(t,n)},i})(dC,fC),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=uC);function i(e){return 1-t*sC(e=+e)*Math.sin((e+r)/n)}return i.amplitude=function(t){return e(t,n*uC)},i.period=function(n){return e(t,n)},i})(dC,fC),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=uC);function i(e){return((e=e*2-1)<0?t*sC(-e)*Math.sin((r-e)/n):2-t*sC(e)*Math.sin((r+e)/n))/2}return i.amplitude=function(t){return e(t,n*uC)},i.period=function(n){return e(t,n)},i})(dC,fC);var pC=vv(`start`,`end`,`cancel`,`interrupt`),mC=[],hC=0,gC=1,_C=2,vC=3,yC=4,bC=5,xC=6;function SC(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;EC(e,n,{name:t,index:r,group:i,on:pC,tween:mC,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:hC})}function CC(e,t){var n=TC(e,t);if(n.state>hC)throw Error(`too late; already scheduled`);return n}function wC(e,t){var n=TC(e,t);if(n.state>vC)throw Error(`too late; already running`);return n}function TC(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function EC(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=QS(a,0,n.time);function a(e){n.state=gC,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!==gC)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===vC)return iC(o);f.state===yC?(f.state=xC,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=xC,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(iC(function(){n.state===vC&&(n.state=yC,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=_C,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===_C){for(n.state=vC,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=bC,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===bC&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=xC,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function DC(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>_C&&r.state<bC,r.state=xC,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 OC(e){return this.each(function(){DC(this,e)})}function kC(e,t){var n,r;return function(){var i=wC(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 AC(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=wC(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 jC(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=TC(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?kC:AC)(n,e,t))}function MC(e,t,n){var r=e._id;return e.each(function(){var e=wC(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return TC(e,r).value[t]}}function NC(e,t){var n;return(typeof t==`number`?hS:t instanceof sx?uS:(n=sx(t))?(t=n,uS):xS)(e,t)}function PC(e){return function(){this.removeAttribute(e)}}function FC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function IC(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 LC(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 RC(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 zC(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 BC(e,t){var n=Tv(e),r=n===`transform`?jS:NC;return this.attrTween(e,typeof t==`function`?(n.local?zC:RC)(n,r,MC(this,`attr.`+e,t)):t==null?(n.local?FC:PC)(n):(n.local?LC:IC)(n,r,t))}function VC(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function HC(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function UC(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&HC(e,i)),n}return i._value=t,i}function WC(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&VC(e,i)),n}return i._value=t,i}function GC(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=Tv(e);return this.tween(n,(r.local?UC:WC)(r,t))}function KC(e,t){return function(){CC(this,e).delay=+t.apply(this,arguments)}}function qC(e,t){return t=+t,function(){CC(this,e).delay=t}}function JC(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?KC:qC)(t,e)):TC(this.node(),t).delay}function YC(e,t){return function(){wC(this,e).duration=+t.apply(this,arguments)}}function XC(e,t){return t=+t,function(){wC(this,e).duration=t}}function ZC(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?YC:XC)(t,e)):TC(this.node(),t).duration}function QC(e,t){if(typeof t!=`function`)throw Error();return function(){wC(this,e).ease=t}}function $C(e){var t=this._id;return arguments.length?this.each(QC(t,e)):TC(this.node(),t).ease}function ew(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();wC(this,e).ease=n}}function tw(e){if(typeof e!=`function`)throw Error();return this.each(ew(this._id,e))}function nw(e){typeof e!=`function`&&(e=Lv(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 jw(r,this._parents,this._name,this._id)}function rw(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 jw(o,this._parents,this._name,this._id)}function iw(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 aw(e,t,n){var r,i,a=iw(t)?CC:wC;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function ow(e,t){var n=this._id;return arguments.length<2?TC(this.node(),n).on.on(e):this.each(aw(n,e,t))}function sw(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function cw(){return this.on(`end.remove`,sw(this._id))}function lw(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Av(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,SC(l[f],t,n,f,l,TC(u,n)));return new jw(a,this._parents,t,n)}function uw(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Pv(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=TC(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&SC(p,t,n,h,f,m);a.push(f),o.push(u)}return new jw(a,o,t,n)}var dw=bb.prototype.constructor;function fw(){return new dw(this._groups,this._parents)}function pw(e,t){var n,r,i;return function(){var a=Dy(this,e),o=(this.style.removeProperty(e),Dy(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function mw(e){return function(){this.style.removeProperty(e)}}function hw(e,t,n){var r,i=n+``,a;return function(){var o=Dy(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function gw(e,t,n){var r,i,a;return function(){var o=Dy(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Dy(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function _w(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=wC(this,e),l=c.on,u=c.value[a]==null?s||=mw(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function vw(e,t,n){var r=(e+=``)==`transform`?AS:NC;return t==null?this.styleTween(e,pw(e,r)).on(`end.style.`+e,mw(e)):typeof t==`function`?this.styleTween(e,gw(e,r,MC(this,`style.`+e,t))).each(_w(this._id,e)):this.styleTween(e,hw(e,r,t),n).on(`end.style.`+e,null)}function yw(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function bw(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&yw(e,a,n)),r}return a._value=t,a}function xw(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,bw(e,t,n??``))}function Sw(e){return function(){this.textContent=e}}function Cw(e){return function(){var t=e(this);this.textContent=t??``}}function ww(e){return this.tween(`text`,typeof e==`function`?Cw(MC(this,`text`,e)):Sw(e==null?``:e+``))}function Tw(e){return function(t){this.textContent=e.call(this,t)}}function Ew(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Tw(r)),t}return r._value=e,r}function Dw(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,Ew(e))}function Ow(){for(var e=this._name,t=this._id,n=Mw(),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=TC(c,t);SC(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new jw(r,this._parents,e,n)}function kw(){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=wC(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 Aw=0;function jw(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Mw(){return++Aw}var Nw=bb.prototype;jw.prototype={constructor:jw,select:lw,selectAll:uw,selectChild:Nw.selectChild,selectChildren:Nw.selectChildren,filter:nw,merge:rw,selection:fw,transition:Ow,call:Nw.call,nodes:Nw.nodes,node:Nw.node,size:Nw.size,empty:Nw.empty,each:Nw.each,on:ow,attr:BC,attrTween:GC,style:vw,styleTween:xw,text:ww,textTween:Dw,remove:cw,tween:jC,delay:JC,duration:ZC,ease:$C,easeVarying:tw,end:kw,[Symbol.iterator]:Nw[Symbol.iterator]};var Pw={time:null,delay:0,duration:250,ease:aC};function Fw(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Iw(e){var t,n;e instanceof jw?(t=e._id,e=e._name):(t=Mw(),(n=Pw).time=YS(),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])&&SC(c,e,t,l,o,n||Fw(c,t));return new jw(r,this._parents,e,t)}bb.prototype.interrupt=OC,bb.prototype.transition=Iw;var Lw=e=>()=>e;function Rw(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 zw(e,t,n){this.k=e,this.x=t,this.y=n}zw.prototype={constructor:zw,scale:function(e){return e===1?this:new zw(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new zw(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 Bw=new zw(1,0,0);Vw.prototype=zw.prototype;function Vw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Bw;return e.__zoom}function Hw(e){e.stopImmediatePropagation()}function Uw(e){e.preventDefault(),e.stopImmediatePropagation()}function Ww(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Gw(){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 Kw(){return this.__zoom||Bw}function qw(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Jw(){return navigator.maxTouchPoints||`ontouchstart`in this}function Yw(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 Xw(){var e=Ww,t=Gw,n=Yw,r=qw,i=Jw,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=IS,l=vv(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Kw).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`,Kw),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(Bw.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 zw(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 zw(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 zw(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=Sb(this.that).datum();l.call(e,this.that,new Rw(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=Db(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)],DC(this),s.start();Uw(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=Sb(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Db(t,i),l=t.clientX,u=t.clientY;Mb(t.view),Hw(t),a.mouse=[c,this.__zoom.invert(c)],DC(this),a.start();function d(e){if(Uw(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]=Db(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Nb(e.view,a.moved),Uw(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Db(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);Uw(r),s>0?Sb(this).transition().duration(s).call(x,d,c,r):Sb(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(Hw(t),s=0;s<i;++s)c=r[s],l=Db(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)),DC(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(Uw(e),s=0;s<a;++s)c=i[s],l=Db(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(Hw(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=Db(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=Sb(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Lw(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Lw(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Lw(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Lw([[+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 Zw={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.`},Qw=[[-1/0,-1/0],[1/0,1/0]],$w=[`Enter`,` `,`Escape`],eT={"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`},tT;(function(e){e.Strict=`strict`,e.Loose=`loose`})(tT||={});var nT;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(nT||={});var rT;(function(e){e.Partial=`partial`,e.Full=`full`})(rT||={});var iT={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},aT;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(aT||={});var oT;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(oT||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var sT={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top},cT=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,lT=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),uT=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),dT=(e,t=[0,0])=>{let{width:n,height:r}=GT(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},fT=(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):uT(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,TT(e,kT(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?DT(r):{x:0,y:0,width:0,height:0}},pT=(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=TT(n,kT(e)),r=!0)}),r?DT(n):{x:0,y:0,width:0,height:0}},mT=(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=jT(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},hT=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function gT(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}=GT(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 _T({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=HT(pT(gT(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function vT({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`,Zw.error005());else{let{width:e,height:t}=GT(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&WT(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=WT(d)?xT(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,Zw.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 yT({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=hT(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var bT=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),xT=(e={x:0,y:0},t,n)=>({x:bT(e.x,t[0][0],t[1][0]-(n?.width??0)),y:bT(e.y,t[0][1],t[1][1]-(n?.height??0))});function ST(e,t,n){let{width:r,height:i}=GT(n),{x:a,y:o}=n.internals.positionAbsolute;return xT(e,[[a,o],[a+r,o+i]],t)}var CT=(e,t,n)=>e<t?bT(Math.abs(e-t),1,t)/t:e>n?-bT(Math.abs(e-n),1,t)/t:0,wT=(e,t,n=15,r=40)=>[CT(e.x,r,t.width-r)*n,CT(e.y,r,t.height-r)*n],TT=(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)}),ET=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),DT=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),OT=(e,t=[0,0])=>{let{x:n,y:r}=uT(e)?e.internals.positionAbsolute:dT(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}},kT=(e,t=[0,0])=>{let{x:n,y:r}=uT(e)?e.internals.positionAbsolute:dT(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)}},AT=(e,t)=>DT(TT(ET(e),ET(t))),jT=(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)},MT=(e,t)=>jT(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),NT=e=>PT(e.width)&&PT(e.height)&&PT(e.x)&&PT(e.y),PT=e=>!isNaN(e)&&isFinite(e),FT=(e,t)=>(e,t)=>{},IT=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),LT=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?IT(s,o):s},RT=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function zT(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);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 BT(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=zT(e,n),i=zT(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=zT(e.top??e.y??0,n),i=zT(e.bottom??e.y??0,n),a=zT(e.left??e.x??0,t),o=zT(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 VT(e,t,n,r,i,a){let{x:o,y:s}=RT(e,[t,n,r]),{x:c,y:l}=RT({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 HT=(e,t,n,r,i,a)=>{let o=BT(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=bT(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=VT(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}},UT=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function WT(e){return e!=null&&e!==`parent`}function GT(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function KT(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function qT(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 JT(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function YT(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function XT(e){return{...eT,...e||{}}}function ZT(e){return e===null?null:e?`valid`:`invalid`}function QT(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=iE(e),s=LT({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?IT(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var $T=e=>({width:e.offsetWidth,height:e.offsetHeight}),eE=e=>e?.getRootNode?.()||window?.document,tE=[`INPUT`,`SELECT`,`TEXTAREA`];function nE(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?tE.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var rE=e=>`clientX`in e,iE=(e,t)=>{let n=rE(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)}},aE=(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,...$T(t)}})};function oE({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 sE(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function cE({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-sE(t-r,a),n];case $.Right:return[t+sE(r-t,a),n];case $.Top:return[t,n-sE(n-i,a)];case $.Bottom:return[t,n+sE(i-n,a)]}}function lE({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=cE({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=cE({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=oE({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 uE({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 dE({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 fE({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=TT(kT(e),kT(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),MT({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},DT(a))>0}var pE=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,mE=(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)),hE=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,Zw.error006()),t;let r=n.getEdgeId||pE,i;return i=cT(e)?{...e}:{...e,id:r(e)},mE(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function gE({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=uE({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var _E={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},vE=({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},yE=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),bE=(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 xE({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=_E[t],c=_E[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=vE({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]=uE({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&&bE(e,n,t)&&C.pop(),C.push(t)}return[C,h,g,y,b]}function SE(e,t,n,r){let i=Math.min(yE(e,t)/2,yE(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 CE({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]=xE({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+=SE(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 wE(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function TE(e){let{sourceNode:t,targetNode:n}=e;if(!wE(t)||!wE(n))return null;let r=t.internals.handleBounds||EE(t.handles),i=n.internals.handleBounds||EE(n.handles),a=OE(r?.source??[],e.sourceHandle),o=OE(e.connectionMode===tT.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,Zw.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=DE(t,a,s),u=DE(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function EE(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function DE(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??GT(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 OE(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function kE(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function AE(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=kE(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 jE=1e3,ME=10,NE={nodeOrigin:[0,0],nodeExtent:Qw,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},PE={...NE,checkEquality:!0};function FE(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function IE(e,t,n){let r=FE(NE,n);for(let n of e.values())if(n.parentId)VE(n,e,t,r);else{let e=xT(dT(n,r.nodeOrigin),WT(n.extent)?n.extent:r.nodeExtent,GT(n));n.internals.positionAbsolute=e}}function LE(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 RE(e){return e===`manual`}function zE(e,t,n,r={}){let i=FE(PE,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!RE(i.zIndexMode)?jE:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=xT(dT(u,i.nodeOrigin),WT(u.extent)?u.extent:i.nodeExtent,GT(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:LE(u,e),z:HE(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}e.measured!==void 0&&e.measured.width!==void 0&&e.measured.height!==void 0||e.hidden||(c=!1),u.parentId&&VE(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function BE(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function VE(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=FE(NE,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}BE(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*ME),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=UE(e,u,o,s,a&&!RE(c)?jE:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function HE(e,t,n){let r=PT(e.zIndex)?e.zIndex:0;return RE(n)?r:r+(e.selected?t:0)}function UE(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=GT(e),l=dT(e,n),u=WT(e.extent)?xT(l,e.extent,c):l,d=xT({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=ST(d,c,t));let f=HE(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function WE(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=AT(a.get(n.parentId)?.expandedRect??OT(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=GT(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({id:o,type:`position`,position:{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({id:t.id,type:`position`,position:{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 GE(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=$T(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=WT(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=ST(h,s,n))}else m&&(h=xT(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:aE(`source`,r.nodeElement,p,d,e.id),target:aE(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&VE(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:OT(g,i)}))}}if(f.length>0){let e=WE(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function KE({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 qE(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function JE(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;qE(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),qE(`target`,s,c,e,i,o),t.set(r.id,r)}}function YE(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:YE(n,t):!1}function XE(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 ZE(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||!YE(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 QE({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 $E({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=IT(a,t);return{x:o.x-a.x,y:o.y-a.y}}function eD({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=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=Sb(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?ET(pT(s)):null,x=v&&l?$E({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=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:IT(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}=vT({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(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=QE({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=wT(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0;let v=!!b&&!o&&!i.get(b)?.selected;m&&y||o||!b||i.get(b)?.selected||_(),y&&m&&b&&e?.(b);let x=QT(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=x,s=ZE(i,c,x,b,v),s.size>0&&(n||h||!b&&g)){let[e,t]=QE({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=Bb().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=QT(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=iE(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=QT(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=iE(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=iE(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p)p&&s.size>0&&t().updateNodePositions(s,!1);else if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=QE({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!XE(t,`.${g}`,v))&&(!_||XE(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function tD(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())MT(i,OT(e))>0&&r.push(e);return r}var nD=250;function rD(e,t,n,r){let i=[],a=1/0,o=tD(e,n,t+nD);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}=DE(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 iD(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,...DE(o,c,c.position,!0)}:c}function aD(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function oD(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var sD=()=>!0;function cD(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:_=sD,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=eE(e.target),E=0,D,{x:O,y:k}=iE(e),A=aD(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=iD(i,A,r,c,t);if(!N)return;let P=iE(e,j),F=!1,I=null,L=!1,R=null;function ee(){if(!u||!j)return;let[e,t]=wT(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(ee)}let z={...N,nodeId:i,type:A,position:N.position},te=c.get(i),B={inProgress:!0,isValid:null,from:DE(te,z,$.Left,!0),fromHandle:z,fromPosition:z.position,fromNode:te,to:P,toHandle:null,toPosition:sT[z.position],toNode:null,pointer:P};function ne(){M=!0,y(B),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&ne();function re(e){if(!M){let{x:t,y:n}=iE(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;ne()}if(!x()||!z){V(e);return}let a=b();P=iE(e,j),D=rD(LT(P,a,!1,[1,1]),n,c,z),F||=(ee(),!0);let s=lD(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});R=s.handleDomNode,I=s.connection,L=oD(!!D,s.isValid);let u=c.get(i),f=u?DE(u,z,$.Left,!0):B.from,p={...B,from:f,isValid:L,to:s.toHandle&&L?RT({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:sT[z.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),B=p}function V(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||R)&&I&&L&&h?.(I);let{inProgress:t,...n}=B,r={...n,toPosition:B.toHandle?B.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,R=null,T.removeEventListener(`mousemove`,re),T.removeEventListener(`mouseup`,V),T.removeEventListener(`touchmove`,re),T.removeEventListener(`touchend`,V)}}T.addEventListener(`mousemove`,re),T.addEventListener(`mouseup`,V),T.addEventListener(`touchmove`,re),T.addEventListener(`touchend`,V)}function lD(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=sD,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}=iE(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=aD(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===tT.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=iD(t,e,a,u,n,!0)}return _}var uD={onPointerDown:cD,isValid:lD};function dD({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=Sb(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&UT()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=Xw().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:Db}}var fD=e=>({x:e.x,y:e.y,zoom:e.k}),pD=({x:e,y:t,zoom:n})=>Bw.translate(e,t).scale(n),mD=(e,t)=>e.target.closest(`.${t}`),hD=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),gD=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,_D=(e,t=0,n=gD,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},vD=e=>{let t=e.ctrlKey&&UT()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function yD({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(mD(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=Db(u),t=d*2**vD(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===nT.Vertical?0:u.deltaX*f,m=i===nT.Horizontal?0:u.deltaY*f;!UT()&&u.shiftKey&&i!==nT.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=fD(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 bD({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=mD(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function xD({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=fD(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function SD({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&hD(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,fD(a.transform))}}function CD({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&hD(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=fD(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function wD({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(f.button===1&&f.type===`mousedown`&&(mD(f,`${u}-flow__node`)||mD(f,`${u}-flow__edge`)||mD(f,`${u}-flow__selection`)||mD(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||mD(f,c)&&h||mD(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&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)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function TD({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},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=Xw().extent(()=>d).scaleExtent([t,n]).translateExtent(r),m=Sb(e).call(p);b({x:i.x,y:i.y,zoom:bT(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let h=m.on(`wheel.zoom`),g=m.on(`dblclick.zoom`);p.wheelDelta(vD);async function _(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?SS:IS).transform(_D(m,t?.duration,t?.ease,()=>n(!0)),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,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&p.on(`zoom`,null);let O=i&&!S&&!r;p.clickDistance(D?1/0:!PT(E)||E<0?0:E);let k=O?yD({zoomPanValues:l,noWheelClassName:e,d3Selection:m,d3Zoom:p,panOnScrollMode:d,panOnScrollSpeed:f,zoomOnPinch:v,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):bD({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:h});m.on(`wheel.zoom`,k,{passive:!1});let A=xD({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});p.on(`start`,A);let j=SD({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});p.on(`zoom`,j);let M=CD({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});p.on(`end`,M);let N=wD({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=pD(e),i=p?.constrain()(r,t,n);return i&&await _(i),i}async function x(e,t){let n=pD(e);return await _(n,t),n}function S(e){if(m){let t=pD(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?Vw(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`?SS:IS).scaleTo(_D(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function T(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?SS:IS).scaleBy(_D(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function E(e){p?.scaleExtent(e)}function D(e){p?.translateExtent(e)}function O(e){let t=!PT(e)||e<0?0:e;p?.clickDistance(t)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:C,scaleTo:w,scaleBy:T,setScaleExtent:E,setTranslateExtent:D,syncViewport:S,setClickDistance:O}}var ED;(function(e){e.Line=`line`,e.Handle=`handle`})(ED||={});function DD({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 OD(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 kD(e,t){return Math.max(0,t-e)}function AD(e,t){return Math.max(0,e-t)}function jD(e,t,n){return Math.max(0,t-e,e-n)}function MD(e,t){return e?!t:t}function ND(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=jD(E,h,g),j=jD(D,_,v);if(o){let e=0,t=0;c&&w<0?e=kD(y+w+O,o[0][0]):!c&&w>0&&(e=AD(y+E+O,o[1][0])),l&&T<0?t=kD(b+T+k,o[0][1]):!l&&T>0&&(t=AD(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=AD(y+w,s[0][0]):!c&&w<0&&(e=kD(y+E,s[1][0])),l&&T>0?t=AD(b+T,s[0][1]):!l&&T<0&&(t=kD(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=jD(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?AD(b+k+E/C,o[1][1])*C:kD(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?kD(b+E/C,s[1][1])*C:AD(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=jD(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?AD(y+D*C+O,o[1][0])/C:kD(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?kD(y+D*C,s[1][0])/C:AD(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=(MD(c,l)?-w:w)/C:w=(MD(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 PD={width:0,height:0,x:0,y:0},FD={...PD,pointerX:0,pointerY:0,aspectRatio:1};function ID(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function LD({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=Sb(e),o={controlDirection:OD(`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={...PD},h={...FD};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:OD(e)};let g,_=null,v=[],y,b,x,S=Bb().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}=QT(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=WT(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=ID(n,g,n.origin??s);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=QT(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}=ND(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=DD({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)===!1?(m=P.prevValues,h.x=P.startX,h.y=P.startY,v.forEach((e,t)=>{e.position=P.childNodes[t].position})):(d?.(e,I),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}}var RD=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)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},zD=e=>e?RD(e):RD,{useDebugValue:BD}=p.default,{useSyncExternalStoreWithSelector:VD}=hd.default,HD=e=>e;function UD(e,t=HD,n){let r=VD(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return BD(r),r}var WD=(e,t)=>{let n=zD(e),r=(e,r=t)=>UD(n,e,r);return Object.assign(r,n),r},GD=(e,t)=>e?WD(e,t):WD;function KD(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(!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}var qD=(0,p.createContext)(null),JD=qD.Provider,YD=Zw.error001(`react`);function XD(e,t){let n=(0,p.useContext)(qD);if(n===null)throw Error(YD);return UD(n,e,t)}function ZD(){let e=(0,p.useContext)(qD);if(e===null)throw Error(YD);return(0,p.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var QD={display:`none`},$D={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},eO=`react-flow__node-desc`,tO=`react-flow__edge-desc`,nO=`react-flow__aria-live`,rO=e=>e.ariaLiveMessage,iO=e=>e.ariaLabelConfig;function aO({rfId:e}){let t=XD(rO);return(0,m.jsx)(`div`,{id:`${nO}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:$D,children:t})}function oO({rfId:e,disableKeyboardA11y:t}){let n=XD(iO);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{id:`${eO}-${e}`,style:QD,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,m.jsx)(`div`,{id:`${tO}-${e}`,style:QD,children:n[`edge.a11yDescription.default`]}),!t&&(0,m.jsx)(aO,{rfId:e})]})}var sO=(0,p.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,m.jsx)(`div`,{className:gv([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});sO.displayName=`Panel`;var cO=`https://reactflow.dev?utm_source=attribution`;function lO({proOptions:e,position:t=`bottom-right`}){return(0,p.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,m.jsx)(sO,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${cO}`,children:(0,m.jsx)(`a`,{href:cO,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var uO=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},dO=e=>e.id;function fO(e,t){return KD(e.selectedNodes.map(dO),t.selectedNodes.map(dO))&&KD(e.selectedEdges.map(dO),t.selectedEdges.map(dO))}function pO({onSelectionChange:e}){let t=ZD(),{selectedNodes:n,selectedEdges:r}=XD(uO,fO);return(0,p.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var mO=e=>!!e.onSelectionChangeHandlers;function hO({onSelectionChange:e}){let t=XD(mO);return e||t?(0,m.jsx)(pO,{onSelectionChange:e}):null}var gO=[0,0],_O={x:0,y:0,zoom:1},vO=[...`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`],yO=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),bO={translateExtent:Qw,nodeOrigin:gO,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function xO(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=XD(yO,KD),l=ZD();(0,p.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=bO,s()}),[]);let u=(0,p.useRef)(bO);return(0,p.useEffect)(()=>{for(let s of vO){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:XT(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},vO.map(t=>e[t])),null}function SO(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function CO(e){let[t,n]=(0,p.useState)(e===`system`?null:e);return(0,p.useEffect)(()=>{if(e!==`system`){n(e);return}let t=SO(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?SO()?.matches?`dark`:`light`:t}var wO=typeof document<`u`?document:null;function TO(e=null,t={target:wO,actInsideInputWithModifier:!0}){let[n,r]=(0,p.useState)(!1),i=(0,p.useRef)(!1),a=(0,p.useRef)(new Set([])),[o,s]=(0,p.useMemo)(()=>{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[[],[]]},[e]);return(0,p.useEffect)(()=>{let n=t?.target??wO,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&nE(e))return!1;let n=DO(e.code,s);if(a.current.add(e[n]),EO(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=DO(e.code,s);EO(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function EO(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function DO(e,t){return t.includes(e)?`code`:`key`}var OO=()=>{let e=ZD();return(0,p.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=HT(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return LT(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=RT(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function kO(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)AO(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function AO(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function jO(e,t){return kO(e,t)}function MO(e,t){return kO(e,t)}function NO(e,t){return{id:e,type:`select`,selected:t}}function PO(e,t=new Set){let n=[];for(let[r,i]of e){let e=t.has(r);(i.selected!==void 0||e)&&i.selected!==e&&n.push(NO(i.id,e))}return n}function FO({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function IO(e){return{id:e.id,type:`remove`}}var LO=FT(`React Flow`,`https://reactflow.dev/`);function RO(e,t,n={}){return hE(e,t,{...n,onError:n.onError??LO})}var zO=e=>lT(e),BO=e=>cT(e);function VO(e){return(0,p.forwardRef)(e)}var HO=typeof window<`u`?p.useLayoutEffect:p.useEffect;function UO(e){let[t,n]=(0,p.useState)(BigInt(0)),[r]=(0,p.useState)(()=>WO(()=>n(e=>e+BigInt(1))));return HO(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function WO(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var GO=(0,p.createContext)(null);function KO({children:e}){let t=ZD(),n=UO((0,p.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=FO({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=UO((0,p.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(FO({items:s,lookup:o}))},[])),i=(0,p.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,m.jsx)(GO.Provider,{value:i,children:e})}function qO(){let e=(0,p.useContext)(GO);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var JO=e=>!!e.panZoom;function YO(){let e=OO(),t=ZD(),n=qO(),r=XD(JO),i=(0,p.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=zO(e)?e:n.get(e.id),a=i.parentId?qT(i.position,i.measured,i.parentId,n,r):i.position;return OT({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height},i.parentId?void 0:r)},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&zO(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&BO(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await yT({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(IO);o?.(f),c(e)}if(m){let e=d.map(IO);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=NT(e),o=i?e:a(e),s=r!==void 0;if(!o)return[];let{nodeOrigin:c}=t.getState();return(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let l=OT(s?r:a,c),u=MT(l,o);return n&&u>0||u>=l.width*l.height||u>=o.width*o.height})},isNodeIntersecting:(e,t,n=!0)=>{let r=NT(e)?e:a(e);if(!r)return!1;let i=MT(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return fT(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??YT();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,p.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var XO=e=>e.selected,ZO=typeof window<`u`?window:void 0;function QO({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=ZD(),{deleteElements:r}=YO(),i=TO(e,{actInsideInputWithModifier:!1}),a=TO(t,{target:ZO});(0,p.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(XO),edges:e.filter(XO)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,p.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function $O(e){let t=ZD();(0,p.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=$T(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,Zw.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t.disconnect()}}},[])}var ek={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},tk=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function nk({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=nT.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:g=!0,children:_,noWheelClassName:v,noPanClassName:y,onViewportChange:b,isControlledViewport:x,paneClickDistance:S,selectionOnDrag:C}){let w=ZD(),T=(0,p.useRef)(null),{userSelectionActive:E,lib:D,connectionInProgress:O}=XD(tk,KD),k=TO(h),A=(0,p.useRef)();$O(T);let j=(0,p.useCallback)(e=>{b?.({x:e[0],y:e[1],zoom:e[2]}),x||w.setState({transform:e})},[b,x]);return(0,p.useEffect)(()=>{if(T.current){A.current=TD({domNode:T.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>w.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=w.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=w.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=w.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=A.current.getViewport();return w.setState({panZoom:A.current,transform:[e,t,n],domNode:T.current.closest(`.react-flow`)}),()=>{A.current?.destroy()}}},[]),(0,p.useEffect)(()=>{A.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:k,preventScrolling:g,noPanClassName:y,userSelectionActive:E,noWheelClassName:v,lib:D,onTransformChange:j,connectionInProgress:O,selectionOnDrag:C,paneClickDistance:S})},[e,t,n,r,i,a,o,s,c,k,g,y,E,v,D,j,O,C,S]),(0,m.jsx)(`div`,{className:`react-flow__renderer`,ref:T,style:ek,children:_})}var rk=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ik(){let{userSelectionActive:e,userSelectionRect:t}=XD(rk,KD);return e&&t?(0,m.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var ak=(e,t)=>n=>{n.target===t.current&&e?.(n)},ok=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function sk({isSelecting:e,selectionKeyPressed:t,selectionMode:n=rT.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:h,onPaneMouseLeave:g,children:_}){let v=(0,p.useRef)(0),y=ZD(),{userSelectionActive:b,elementsSelectable:x,dragging:S,panBy:C,autoPanSpeed:w}=XD(ok,KD),T=x&&(e||b),E=(0,p.useRef)(null),D=(0,p.useRef)(),O=(0,p.useRef)(new Set),k=(0,p.useRef)(new Set),A=(0,p.useRef)(!1),j=(0,p.useRef)(!1),M=(0,p.useRef)({x:0,y:0}),N=(0,p.useRef)(!1),P=e=>{if(j.current||A.current||y.getState().connection.inProgress){j.current=!1,A.current=!1;return}let{connectionClickStartHandle:t,connection:n,onClickConnectEnd:r,resetSelectedElements:i}=y.getState();if(t){let t=structuredClone(n);delete t.inProgress,t.toPosition=t.toHandle?t.toHandle.position:null,r?.(e.nativeEvent,t),y.setState({connectionClickStartHandle:null})}l?.(e),i(),y.setState({nodesSelectionActive:!1})},F=e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},I=d?e=>d(e):void 0,L=e=>{j.current&&=(e.stopPropagation(),!1)},R=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=y.getState();if(D.current=i?.getBoundingClientRect(),!D.current)return;let s=n.target===E.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),j.current=!1;let{x:c,y:l}=iE(n.nativeEvent,D.current),u=LT({x:c,y:l},a);y.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function ee(e,t){let{userSelectionRect:r}=y.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=y.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=RT(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=O.current,g=k.current;O.current=new Set(mT(a,m,i,n===rT.Partial,!0).map(e=>e.id)),k.current=new Set;let _=u?.selectable??!0;for(let e of O.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??_)&&k.current.add(e)}}JT(h,O.current)||c(PO(a,O.current)),JT(g,k.current)||l(PO(o,k.current)),y.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function z(){if(!i||!D.current)return;let[e,t]=wT(M.current,D.current,w);C({x:e,y:t}).then(e=>{if(!j.current||!e){v.current=requestAnimationFrame(z);return}let{x:t,y:n}=M.current;ee(t,n),v.current=requestAnimationFrame(z)})}let te=()=>{cancelAnimationFrame(v.current),v.current=0,N.current=!1};(0,p.useEffect)(()=>()=>te(),[]);let B=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=y.getState();if(!D.current||!n)return;let{x:o,y:c}=iE(e.nativeEvent,D.current);M.current={x:o,y:c};let l=RT({x:n.startX,y:n.startY},r);if(!j.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}j.current=!0,N.current||=(z(),!0),ee(o,c)},ne=e=>{T?e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!b&&e.target===E.current&&y.getState().userSelectionRect&&P?.(e),y.setState({userSelectionActive:!1,userSelectionRect:null}),j.current&&(c?.(e),y.setState({nodesSelectionActive:O.current.size>0})),te()):e.target===E.current&&y.getState().connection.inProgress&&(A.current=!0)},re=e=>{e.target?.releasePointerCapture?.(e.pointerId),te()},V=r===!0||Array.isArray(r)&&r.includes(0);return(0,m.jsxs)(`div`,{className:gv([`react-flow__pane`,{draggable:V,dragging:S,selection:e}]),onClick:T?void 0:ak(P,E),onContextMenu:ak(F,E),onWheel:ak(I,E),onPointerEnter:T?void 0:f,onPointerMove:T?B:h,onPointerUp:ne,onPointerCancel:T?re:void 0,onPointerDownCapture:T?R:void 0,onClickCapture:T?L:void 0,onPointerLeave:g,ref:E,style:ek,children:[_,(0,m.jsx)(ik,{})]})}function ck({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);l?(t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])):c?.(`012`,Zw.error012(e))}function lk({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=ZD(),[c,l]=(0,p.useState)(!1),u=(0,p.useRef)();return(0,p.useEffect)(()=>{if(!t)return u.current=eD({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{ck({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,p.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var uk=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function dk(){let e=ZD();return(0,p.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=uk(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=IT(t,i));let{position:a,positionAbsolute:s}=vT({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var fk=(0,p.createContext)(null),pk=fk.Provider;fk.Consumer;var mk=()=>(0,p.useContext)(fk),hk=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),gk=(0,p.createContext)(null);function _k({children:e}){let t=XD(hk,KD);return(0,m.jsx)(gk.Provider,{value:t,children:e})}function vk(){let e=(0,p.useContext)(gk);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var yk={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},bk=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return yk;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===tT.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function xk({type:e=`source`,position:t=$.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let h=o||null,g=e===`target`,_=ZD(),v=mk(),{connectOnClick:y,noPanClassName:b,rfId:x}=vk(),{connectingFrom:S,connectingTo:C,clickConnecting:w,isPossibleEndHandle:T,connectionInProcess:E,clickConnectionInProcess:D,valid:O}=XD(bk(v,h,e),KD);v||_.getState().onError?.(`010`,Zw.error010());let k=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=_.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=_.getState();t(RO(i,e,{onError:n}))}n?.(i),s?.(i)},A=e=>{if(!v)return;let t=rE(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=_.getState();uD.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:g,handleId:h,nodeId:v,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>_.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:k,isValidConnection:n||((...e)=>_.getState().isValidConnection?.(...e)??!0),getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,m.jsx)(`div`,{"data-handleid":h,"data-nodeid":v,"data-handlepos":t,"data-id":`${x}-${v}-${h}-${e}`,className:gv([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,b,l,{source:!g,target:g,connectable:r,connectablestart:i,connectableend:a,clickconnecting:w,connectingfrom:S,connectingto:C,valid:O,connectionindicator:r&&(!E||T)&&(E||D?a:i)}]),onMouseDown:A,onTouchStart:A,onClick:y?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=_.getState();if(!v||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:v,handleId:h,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:v,type:e,id:h}});return}let p=eE(t.target),m=n||c,{connection:g,isValid:y}=uD.isValid(t.nativeEvent,{handle:{nodeId:v,id:h,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:m,flowId:u,doc:p,lib:l,nodeLookup:d});y&&g&&k(g);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),_.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var Sk=(0,p.memo)(VO(xk));function Ck({data:e,isConnectable:t,sourcePosition:n=$.Bottom}){return(0,m.jsxs)(m.Fragment,{children:[e?.label,(0,m.jsx)(Sk,{type:`source`,position:n,isConnectable:t})]})}function wk({data:e,isConnectable:t,targetPosition:n=$.Top,sourcePosition:r=$.Bottom}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Sk,{type:`target`,position:n,isConnectable:t}),e?.label,(0,m.jsx)(Sk,{type:`source`,position:r,isConnectable:t})]})}function Tk(){return null}function Ek({data:e,isConnectable:t,targetPosition:n=$.Top}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Sk,{type:`target`,position:n,isConnectable:t}),e?.label]})}var Dk={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ok={input:Ck,default:wk,output:Ek,group:Tk};function kk(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 Ak=e=>{let{width:t,height:n,x:r,y:i}=pT(e.nodeLookup,{filter:e=>!!e.selected});return{width:PT(t)?t:null,height:PT(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function jk({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=ZD(),{width:i,height:a,transformString:o,userSelectionActive:s}=XD(Ak,KD),c=dk(),l=(0,p.useRef)(null);(0,p.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(lk({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,m.jsx)(`div`,{className:gv([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,m.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(Dk,e.key)&&(e.preventDefault(),c({direction:Dk[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var Mk=typeof window<`u`?window:void 0,Nk=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Pk({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:h,panActivationKeyCode:g,zoomActivationKeyCode:_,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:x,panOnScrollSpeed:S,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:T,autoPanOnSelection:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,onSelectionContextMenu:M,noWheelClassName:N,noPanClassName:P,disableKeyboardA11y:F,onViewportChange:I,isControlledViewport:L}){let{nodesSelectionActive:R,userSelectionActive:ee}=XD(Nk,KD),z=TO(l,{target:Mk}),te=TO(g,{target:Mk}),B=te||T,ne=te||x,re=u&&B!==!0,V=z||ee||re;return QO({deleteKeyCode:c,multiSelectionKeyCode:h}),(0,m.jsx)(nk,{onPaneContextMenu:a,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:ne,panActivationKeyPressed:te,panOnScrollSpeed:S,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:!z&&B,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,zoomActivationKeyCode:_,preventScrolling:j,noWheelClassName:N,noPanClassName:P,onViewportChange:I,isControlledViewport:L,paneClickDistance:s,selectionOnDrag:re,children:(0,m.jsxs)(sk,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:B,autoPanOnSelection:E,isSelecting:!!V,selectionMode:d,selectionKeyPressed:z,paneClickDistance:s,selectionOnDrag:re,children:[e,R&&(0,m.jsx)(jk,{onSelectionContextMenu:M,noPanClassName:P,disableKeyboardA11y:F})]})})}Pk.displayName=`FlowRenderer`;var Fk=(0,p.memo)(Pk),Ik=e=>t=>e?mT(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function Lk(e){return XD((0,p.useCallback)(Ik(e),[e]),KD)}var Rk=e=>e.updateNodeInternals;function zk(){let e=XD(Rk),[t]=(0,p.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,p.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function Bk({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=ZD(),a=(0,p.useRef)(null),o=(0,p.useRef)(null),s=(0,p.useRef)(e.sourcePosition),c=(0,p.useRef)(e.targetPosition),l=(0,p.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,p.useEffect)(()=>{!a.current||e.hidden||u&&o.current===a.current||(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,p.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,p.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function Vk({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:h,rfId:g,nodeTypes:_,nodeClickDistance:v,onError:y}){let{node:b,internals:x,isParent:S}=XD(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},KD),C=b.type||`default`,w=_?.[C]||Ok[C];w===void 0&&(y?.(`003`,Zw.error003(C)),C=`default`,w=_?.default||Ok.default);let T=!!(b.draggable||s&&b.draggable===void 0),E=!!(b.selectable||c&&b.selectable===void 0),D=!!(b.connectable||l&&b.connectable===void 0),O=!!(b.focusable||u&&b.focusable===void 0),k=ZD(),A=KT(b),j=Bk({node:b,nodeType:C,hasDimensions:A,resizeObserver:d}),M=lk({nodeRef:j,disabled:b.hidden||!T,noDragClassName:f,handleSelector:b.dragHandle,nodeId:e,isSelectable:E,nodeClickDistance:v}),N=dk();if(b.hidden)return null;let P=GT(b),F=kk(b),I=E||T||t||n||r||i,L=n?e=>n(e,{...x.userNode}):void 0,R=r?e=>r(e,{...x.userNode}):void 0,ee=i?e=>i(e,{...x.userNode}):void 0,z=a?e=>a(e,{...x.userNode}):void 0,te=o?e=>o(e,{...x.userNode}):void 0,B=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=k.getState();E&&(!r||!T||i>0)&&ck({id:e,store:k,nodeRef:j}),t&&t(n,{...x.userNode})},ne=t=>{if(!(nE(t.nativeEvent)||h)){if($w.includes(t.key)&&E){let n=t.key===`Escape`;ck({id:e,store:k,unselect:n,nodeRef:j})}else if(T&&b.selected&&Object.prototype.hasOwnProperty.call(Dk,t.key)){t.preventDefault();let{ariaLabelConfig:e}=k.getState();k.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),N({direction:Dk[t.key],factor:t.shiftKey?4:1})}}},re=()=>{if(h||!j.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=k.getState();i&&(mT(new Map([[e,b]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(b.position.x+P.width/2,b.position.y+P.height/2,{zoom:t[2]}))};return(0,m.jsx)(`div`,{className:gv([`react-flow__node`,`react-flow__node-${C}`,{[p]:T},b.className,{selected:b.selected,selectable:E,parent:S,draggable:T,dragging:M}]),ref:j,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:I?`all`:`none`,visibility:A?`visible`:`hidden`,...b.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:R,onMouseLeave:ee,onContextMenu:z,onClick:B,onDoubleClick:te,onKeyDown:O?ne:void 0,tabIndex:O?0:void 0,onFocus:O?re:void 0,role:b.ariaRole??(O?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":h?void 0:`${eO}-${g}`,"aria-label":b.ariaLabel,...b.domAttributes,children:(0,m.jsx)(pk,{value:e,children:(0,m.jsx)(w,{id:e,data:b.data,type:C,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:b.selected??!1,selectable:E,draggable:T,deletable:b.deletable??!0,isConnectable:D,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:M,dragHandle:b.dragHandle,zIndex:x.z,parentId:b.parentId,...P})})})}var Hk=(0,p.memo)(Vk),Uk=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Wk(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=XD(Uk,KD),a=Lk(e.onlyRenderVisibleElements),o=zk();return(0,m.jsx)(`div`,{className:`react-flow__nodes`,style:ek,children:a.map(a=>(0,m.jsx)(Hk,{id:a,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:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}Wk.displayName=`NodeRenderer`;var Gk=(0,p.memo)(Wk);function Kk(e){return XD((0,p.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&fE({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),KD)}var qk=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,m.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},Jk=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,m.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},Yk={[oT.Arrow]:qk,[oT.ArrowClosed]:Jk};function Xk(e){let t=ZD();return(0,p.useMemo)(()=>Object.prototype.hasOwnProperty.call(Yk,e)?Yk[e]:(t.getState().onError?.(`009`,Zw.error009(e)),null),[e])}var Zk=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=Xk(t);return c?(0,m.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,m.jsx)(c,{color:n,strokeWidth:o})}):null},Qk=({defaultColor:e,rfId:t})=>{let n=XD(e=>e.edges),r=XD(e=>e.defaultEdgeOptions),i=(0,p.useMemo)(()=>AE(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,m.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,m.jsx)(`defs`,{children:i.map(e=>(0,m.jsx)(Zk,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};Qk.displayName=`MarkerDefinitions`;var $k=(0,p.memo)(Qk);function eA({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,p.useState)({x:1,y:0,width:0,height:0}),h=gv([`react-flow__edge-textwrapper`,l]),g=(0,p.useRef)(null);return(0,p.useEffect)(()=>{if(g.current){let e=g.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,m.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,m.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,m.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:g,style:r,children:n}),c]}):null}eA.displayName=`EdgeText`;var tA=(0,p.memo)(eA);function nA({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{...u,d:e,fill:`none`,className:gv([`react-flow__edge-path`,u.className])}),l?(0,m.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&PT(t)&&PT(n)?(0,m.jsx)(tA,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function rA({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$.Left||e===$.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function iA({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top}){let[o,s]=rA({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=rA({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=oE({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 aA(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:g,markerStart:_,interactionWidth:v})=>{let[y,b,x]=iA({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),S=e.isInternal?void 0:t;return(0,m.jsx)(nA,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:g,markerStart:_,interactionWidth:v})})}var oA=aA({isInternal:!1}),sA=aA({isInternal:!0});oA.displayName=`SimpleBezierEdge`,sA.displayName=`SimpleBezierEdgeInternal`;function cA(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=$.Bottom,targetPosition:h=$.Top,markerEnd:g,markerStart:_,pathOptions:v,interactionWidth:y})=>{let[b,x,S]=CE({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:h,borderRadius:v?.borderRadius,offset:v?.offset,stepPosition:v?.stepPosition}),C=e.isInternal?void 0:t;return(0,m.jsx)(nA,{id:C,path:b,labelX:x,labelY:S,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:_,interactionWidth:y})})}var lA=cA({isInternal:!1}),uA=cA({isInternal:!0});lA.displayName=`SmoothStepEdge`,uA.displayName=`SmoothStepEdgeInternal`;function dA(e){return(0,p.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,m.jsx)(lA,{...n,id:r,pathOptions:(0,p.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var fA=dA({isInternal:!1}),pA=dA({isInternal:!0});fA.displayName=`StepEdge`,pA.displayName=`StepEdgeInternal`;function mA(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:h,interactionWidth:g})=>{let[_,v,y]=gE({sourceX:n,sourceY:r,targetX:i,targetY:a}),b=e.isInternal?void 0:t;return(0,m.jsx)(nA,{id:b,path:_,labelX:v,labelY:y,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:h,interactionWidth:g})})}var hA=mA({isInternal:!1}),gA=mA({isInternal:!0});hA.displayName=`StraightEdge`,gA.displayName=`StraightEdgeInternal`;function _A(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=$.Bottom,targetPosition:s=$.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:g,markerStart:_,pathOptions:v,interactionWidth:y})=>{let[b,x,S]=lE({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:v?.curvature}),C=e.isInternal?void 0:t;return(0,m.jsx)(nA,{id:C,path:b,labelX:x,labelY:S,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:g,markerStart:_,interactionWidth:y})})}var vA=_A({isInternal:!1}),yA=_A({isInternal:!0});vA.displayName=`BezierEdge`,yA.displayName=`BezierEdgeInternal`;var bA={default:yA,straight:gA,step:pA,smoothstep:uA,simplebezier:sA},xA={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},SA=(e,t,n)=>n===$.Left?e-t:n===$.Right?e+t:e,CA=(e,t,n)=>n===$.Top?e-t:n===$.Bottom?e+t:e,wA=`react-flow__edgeupdater`;function TA({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,m.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:gv([wA,`${wA}-${s}`]),cx:SA(t,r,e),cy:CA(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function EA({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let h=ZD(),g=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:m,rfId:g,panBy:_,updateConnection:v}=h.getState(),y=t.type===`target`;uD.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:m,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>h.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>h.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle,dragThreshold:h.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},_=e=>g(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),v=e=>g(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),y=()=>p(!0),b=()=>p(!1);return(0,m.jsxs)(m.Fragment,{children:[(e===!0||e===`source`)&&(0,m.jsx)(TA,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:_,onMouseEnter:y,onMouseOut:b,type:`source`}),(e===!0||e===`target`)&&(0,m.jsx)(TA,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:v,onMouseEnter:y,onMouseOut:b,type:`target`})]})}function DA({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,rfId:g,edgeTypes:_,noPanClassName:v,onError:y,disableKeyboardA11y:b}){let x=XD(t=>t.edgeLookup.get(e)),S=XD(e=>e.defaultEdgeOptions);x=S?{...S,...x}:x;let C=x.type||`default`,w=_?.[C]||bA[C];w===void 0&&(y?.(`011`,Zw.error011(C)),C=`default`,w=_?.default||bA.default);let T=!!(x.focusable||t&&x.focusable===void 0),E=d!==void 0&&(x.reconnectable||n&&x.reconnectable===void 0),D=!!(x.selectable||r&&x.selectable===void 0),O=(0,p.useRef)(null),[k,A]=(0,p.useState)(!1),[j,M]=(0,p.useState)(!1),N=ZD(),{zIndex:P=x.zIndex,sourceX:F,sourceY:I,targetX:L,targetY:R,sourcePosition:ee,targetPosition:z}=XD((0,p.useCallback)(t=>{let n=t.nodeLookup.get(x.source),r=t.nodeLookup.get(x.target);if(!n||!r)return xA;let i=TE({id:e,sourceNode:n,targetNode:r,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:t.connectionMode,onError:y}),a=dE({selected:x.selected,zIndex:x.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||xA,zIndex:a}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex,y]),KD),te=(0,p.useMemo)(()=>x.markerStart?`url('#${kE(x.markerStart,g)}')`:void 0,[x.markerStart,g]),B=(0,p.useMemo)(()=>x.markerEnd?`url('#${kE(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||F===null||I===null||L===null||R===null)return null;let ne=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=N.getState();D&&(N.setState({nodesSelectionActive:!1}),x.selected&&a?(r({nodes:[],edges:[x]}),O.current?.blur()):n([e])),i&&i(t,x)},re=a?e=>{a(e,{...x})}:void 0,V=o?e=>{o(e,{...x})}:void 0,ie=s?e=>{s(e,{...x})}:void 0,H=c?e=>{c(e,{...x})}:void 0,ae=l?e=>{l(e,{...x})}:void 0;return(0,m.jsx)(`svg`,{style:{zIndex:P},children:(0,m.jsxs)(`g`,{className:gv([`react-flow__edge`,`react-flow__edge-${C}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!D&&!i,updating:k,selectable:D}]),onClick:ne,onDoubleClick:re,onContextMenu:V,onMouseEnter:ie,onMouseMove:H,onMouseLeave:ae,onKeyDown:T?t=>{if(!b&&$w.includes(t.key)&&D){let{unselectNodesAndEdges:n,addSelectedEdges:r}=N.getState();t.key===`Escape`?(O.current?.blur(),n({edges:[x]})):r([e])}}:void 0,tabIndex:T?0:void 0,role:x.ariaRole??(T?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":T?`${tO}-${g}`:void 0,ref:O,...x.domAttributes,children:[!j&&(0,m.jsx)(w,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:D,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:F,sourceY:I,targetX:L,targetY:R,sourcePosition:ee,targetPosition:z,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:te,markerEnd:B,pathOptions:`pathOptions`in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&(0,m.jsx)(EA,{edge:x,isReconnectable:E,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,sourceX:F,sourceY:I,targetX:L,targetY:R,sourcePosition:ee,targetPosition:z,setUpdateHover:A,setReconnecting:M})]})})}var OA=(0,p.memo)(DA),kA=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function AA({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:h,disableKeyboardA11y:g}){let{edgesFocusable:_,edgesReconnectable:v,elementsSelectable:y,onError:b}=XD(kA,KD),x=Kk(t);return(0,m.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,m.jsx)($k,{defaultColor:e,rfId:n}),x.map(e=>(0,m.jsx)(OA,{id:e,edgesFocusable:_,edgesReconnectable:v,elementsSelectable:y,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:h,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:g},e))]})}AA.displayName=`EdgeRenderer`;var jA=(0,p.memo)(AA),MA=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function NA({children:e}){let t=ZD(),n=(0,p.useRef)(null),[r]=(0,p.useState)(()=>t.getState().transform);return HO(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=MA(r)))};return r(),t.subscribe(r)},[t]),(0,m.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:MA(r)},children:e})}function PA(e){let t=YO(),n=(0,p.useRef)(!1);(0,p.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var FA=e=>e.panZoom?.syncViewport;function IA(e){let t=XD(FA),n=ZD();return(0,p.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function LA(e){return e.connection.inProgress?{...e.connection,to:LT(e.connection.to,e.transform)}:{...e.connection}}function RA(e){return e?t=>e(LA(t)):LA}function zA(e){return XD(RA(e),KD)}var BA=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function VA({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=XD(BA,KD);return a&&i&&c?(0,m.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,m.jsx)(`g`,{className:gv([`react-flow__connection`,ZT(s)]),children:(0,m.jsx)(HA,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var HA=({style:e,type:t=aT.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=zA();if(!i)return;if(n)return(0,m.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:ZT(r),toNode:u,toHandle:d,pointer:p});let h=``,g={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case aT.Bezier:[h]=lE(g);break;case aT.SimpleBezier:[h]=iA(g);break;case aT.Step:[h]=CE({...g,borderRadius:0});break;case aT.SmoothStep:[h]=CE(g);break;default:[h]=gE(g)}return(0,m.jsx)(`path`,{d:h,fill:`none`,className:`react-flow__connection-path`,style:e})};HA.displayName=`ConnectionLine`;var UA={};function WA(e=UA){(0,p.useRef)(e),ZD(),(0,p.useEffect)(()=>{},[e])}function GA(){ZD(),(0,p.useRef)(!1),(0,p.useEffect)(()=>{},[])}function KA({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:h,connectionLineStyle:g,connectionLineComponent:_,connectionLineContainerStyle:v,selectionKeyCode:y,selectionOnDrag:b,selectionMode:x,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:w,deleteKeyCode:T,onlyRenderVisibleElements:E,elementsSelectable:D,defaultViewport:O,translateExtent:k,minZoom:A,maxZoom:j,preventScrolling:M,defaultMarkerColor:N,zoomOnScroll:P,zoomOnPinch:F,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:R,zoomOnDoubleClick:ee,panOnDrag:z,autoPanOnSelection:te,onPaneClick:B,onPaneMouseEnter:ne,onPaneMouseMove:re,onPaneMouseLeave:V,onPaneScroll:ie,onPaneContextMenu:H,paneClickDistance:ae,nodeClickDistance:U,onEdgeContextMenu:W,onEdgeMouseEnter:oe,onEdgeMouseMove:se,onEdgeMouseLeave:G,reconnectRadius:ce,onReconnect:le,onReconnectStart:ue,onReconnectEnd:de,noDragClassName:fe,noWheelClassName:pe,noPanClassName:me,disableKeyboardA11y:he,nodeExtent:ge,rfId:_e,viewport:ve,onViewportChange:ye,nodesDraggable:be}){return WA(e),WA(t),GA(),PA(n),IA(ve),(0,m.jsx)(Fk,{onPaneClick:B,onPaneMouseEnter:ne,onPaneMouseMove:re,onPaneMouseLeave:V,onPaneContextMenu:H,onPaneScroll:ie,paneClickDistance:ae,deleteKeyCode:T,selectionKeyCode:y,selectionOnDrag:b,selectionMode:x,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:w,elementsSelectable:D,zoomOnScroll:P,zoomOnPinch:F,zoomOnDoubleClick:ee,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:R,panOnDrag:z,autoPanOnSelection:te,defaultViewport:O,translateExtent:k,minZoom:A,maxZoom:j,onSelectionContextMenu:d,preventScrolling:M,noDragClassName:fe,noWheelClassName:pe,noPanClassName:me,disableKeyboardA11y:he,onViewportChange:ye,isControlledViewport:!!ve,children:(0,m.jsxs)(NA,{children:[(0,m.jsx)(jA,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:le,onReconnectStart:ue,onReconnectEnd:de,onlyRenderVisibleElements:E,onEdgeContextMenu:W,onEdgeMouseEnter:oe,onEdgeMouseMove:se,onEdgeMouseLeave:G,reconnectRadius:ce,defaultMarkerColor:N,noPanClassName:me,disableKeyboardA11y:he,rfId:_e}),(0,m.jsx)(VA,{style:g,type:h,component:_,containerStyle:v}),(0,m.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,m.jsx)(Gk,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:U,onlyRenderVisibleElements:E,noPanClassName:me,noDragClassName:fe,disableKeyboardA11y:he,nodeExtent:ge,rfId:_e,nodesDraggable:be}),(0,m.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}KA.displayName=`GraphView`;var qA=(0,p.memo)(KA),JA=FT(`React Flow`,`https://reactflow.dev/`),YA=({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??Qw;JE(h,g,_);let{nodesInitialized:x}=zE(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=HT(pT(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:Qw,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:tT.Strict,domNode:null,paneDragging:!1,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,connection:{...iT},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:JA,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:eT,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,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}},XA=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>GD((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await _T({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...YA({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=zE(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();JE(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=GE(e,n,r,i,a,o,l);d&&(IE(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=DE(e,o.fromHandle,$.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=WE(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(jO(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(MO(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();t?i(e.map(e=>NO(e,!0))):(i(PO(r,new Set([...e]))),a(PO(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();t?a(e.map(e=>NO(e,!0))):(a(PO(n,new Set([...e]))),i(PO(r,new Set)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s)e.selected&&l.push(NO(e.id,!1));let u=[];for(let e of c)e.selected&&u.push(NO(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,NO(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,NO(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(zE(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return KE({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...iT}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...YA()})}},Object.is);function ZA({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:h}){let[g]=(0,p.useState)(()=>XA({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,m.jsx)(JD,{value:g,children:(0,m.jsx)(KO,{children:(0,m.jsx)(_k,{children:h})})})}function QA({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h}){return(0,p.useContext)(qD)?(0,m.jsx)(m.Fragment,{children:e}):(0,m.jsx)(ZA,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:e})}var $A={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function ej({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:g,onConnectEnd:_,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:S,onNodeContextMenu:C,onNodeDoubleClick:w,onNodeDragStart:T,onNodeDrag:E,onNodeDragStop:D,onNodesDelete:O,onEdgesDelete:k,onDelete:A,onSelectionChange:j,onSelectionDragStart:M,onSelectionDrag:N,onSelectionDragStop:P,onSelectionContextMenu:F,onSelectionStart:I,onSelectionEnd:L,onBeforeDelete:R,connectionMode:ee,connectionLineType:z=aT.Bezier,connectionLineStyle:te,connectionLineComponent:B,connectionLineContainerStyle:ne,deleteKeyCode:re=`Backspace`,selectionKeyCode:V=`Shift`,selectionOnDrag:ie=!1,selectionMode:H=rT.Full,panActivationKeyCode:ae=`Space`,multiSelectionKeyCode:U=UT()?`Meta`:`Control`,zoomActivationKeyCode:W=UT()?`Meta`:`Control`,snapToGrid:oe,snapGrid:se,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:ce,nodesDraggable:le,autoPanOnNodeFocus:ue,nodesConnectable:de,nodesFocusable:fe,nodeOrigin:pe=gO,edgesFocusable:me,edgesReconnectable:he,elementsSelectable:ge=!0,defaultViewport:_e=_O,minZoom:ve=.5,maxZoom:ye=2,translateExtent:be=Qw,preventScrolling:xe=!0,nodeExtent:Se,defaultMarkerColor:Ce=`#b1b1b7`,zoomOnScroll:we=!0,zoomOnPinch:Te=!0,panOnScroll:Ee=!1,panOnScrollSpeed:De=.5,panOnScrollMode:Oe=nT.Free,zoomOnDoubleClick:ke=!0,panOnDrag:Ae=!0,onPaneClick:je,onPaneMouseEnter:Me,onPaneMouseMove:Ne,onPaneMouseLeave:Pe,onPaneScroll:Fe,onPaneContextMenu:Ie,paneClickDistance:Le=1,nodeClickDistance:Re=0,children:ze,onReconnect:Be,onReconnectStart:Ve,onReconnectEnd:He,onEdgeContextMenu:Ue,onEdgeDoubleClick:We,onEdgeMouseEnter:Ge,onEdgeMouseMove:Ke,onEdgeMouseLeave:qe,reconnectRadius:Je=10,onNodesChange:Ye,onEdgesChange:Xe,noDragClassName:Ze=`nodrag`,noWheelClassName:Qe=`nowheel`,noPanClassName:$e=`nopan`,fitView:et,fitViewOptions:tt,connectOnClick:nt,attributionPosition:rt,proOptions:it,defaultEdgeOptions:at,elevateNodesOnSelect:ot=!0,elevateEdgesOnSelect:st=!1,disableKeyboardA11y:ct=!1,autoPanOnConnect:lt,autoPanOnNodeDrag:ut,autoPanOnSelection:dt=!0,autoPanSpeed:ft,connectionRadius:pt,isValidConnection:mt,onError:ht,style:gt,id:_t,nodeDragThreshold:vt,connectionDragThreshold:yt,viewport:bt,onViewportChange:xt,width:St,height:Ct,colorMode:wt=`light`,debug:Tt,onScroll:Et,ariaLabelConfig:Dt,zIndexMode:Ot=`basic`,...kt},At){let jt=_t||`1`,Mt=CO(wt),Nt=(0,p.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Et?.(e)},[Et]);return(0,m.jsx)(`div`,{"data-testid":`rf__wrapper`,...kt,onScroll:Nt,style:{...gt,...$A},ref:At,className:gv([`react-flow`,i,Mt]),id:_t,role:`application`,children:(0,m.jsxs)(QA,{nodes:e,edges:t,width:St,height:Ct,fitView:et,fitViewOptions:tt,minZoom:ve,maxZoom:ye,nodeOrigin:pe,nodeExtent:Se,zIndexMode:Ot,children:[(0,m.jsx)(xO,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:g,onConnectEnd:_,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:le,autoPanOnNodeFocus:ue,nodesConnectable:de,nodesFocusable:fe,edgesFocusable:me,edgesReconnectable:he,elementsSelectable:ge,elevateNodesOnSelect:ot,elevateEdgesOnSelect:st,minZoom:ve,maxZoom:ye,nodeExtent:Se,onNodesChange:Ye,onEdgesChange:Xe,snapToGrid:oe,snapGrid:se,connectionMode:ee,translateExtent:be,connectOnClick:nt,defaultEdgeOptions:at,fitView:et,fitViewOptions:tt,onNodesDelete:O,onEdgesDelete:k,onDelete:A,onNodeDragStart:T,onNodeDrag:E,onNodeDragStop:D,onSelectionDrag:N,onSelectionDragStart:M,onSelectionDragStop:P,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:$e,nodeOrigin:pe,rfId:jt,autoPanOnConnect:lt,autoPanOnNodeDrag:ut,autoPanSpeed:ft,onError:ht,connectionRadius:pt,isValidConnection:mt,selectNodesOnDrag:ce,nodeDragThreshold:vt,connectionDragThreshold:yt,onBeforeDelete:R,debug:Tt,ariaLabelConfig:Dt,zIndexMode:Ot}),(0,m.jsx)(qA,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:S,onNodeContextMenu:C,onNodeDoubleClick:w,nodeTypes:a,edgeTypes:o,connectionLineType:z,connectionLineStyle:te,connectionLineComponent:B,connectionLineContainerStyle:ne,selectionKeyCode:V,selectionOnDrag:ie,selectionMode:H,deleteKeyCode:re,multiSelectionKeyCode:U,panActivationKeyCode:ae,zoomActivationKeyCode:W,onlyRenderVisibleElements:G,defaultViewport:_e,translateExtent:be,minZoom:ve,maxZoom:ye,preventScrolling:xe,zoomOnScroll:we,zoomOnPinch:Te,zoomOnDoubleClick:ke,panOnScroll:Ee,panOnScrollSpeed:De,panOnScrollMode:Oe,panOnDrag:Ae,autoPanOnSelection:dt,onPaneClick:je,onPaneMouseEnter:Me,onPaneMouseMove:Ne,onPaneMouseLeave:Pe,onPaneScroll:Fe,onPaneContextMenu:Ie,paneClickDistance:Le,nodeClickDistance:Re,onSelectionContextMenu:F,onSelectionStart:I,onSelectionEnd:L,onReconnect:Be,onReconnectStart:Ve,onReconnectEnd:He,onEdgeContextMenu:Ue,onEdgeDoubleClick:We,onEdgeMouseEnter:Ge,onEdgeMouseMove:Ke,onEdgeMouseLeave:qe,reconnectRadius:Je,defaultMarkerColor:Ce,noDragClassName:Ze,noWheelClassName:Qe,noPanClassName:$e,rfId:jt,disableKeyboardA11y:ct,nodeExtent:Se,viewport:bt,onViewportChange:xt,nodesDraggable:le}),(0,m.jsx)(hO,{onSelectionChange:j}),ze,(0,m.jsx)(lO,{proOptions:it,position:rt}),(0,m.jsx)(oO,{rfId:jt,disableKeyboardA11y:ct})]})})}var tj=VO(ej);Zw.error014();function nj({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,m.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:gv([`react-flow__background-pattern`,n,r])})}function rj({radius:e,className:t}){return(0,m.jsx)(`circle`,{cx:e,cy:e,r:e,className:gv([`react-flow__background-pattern`,`dots`,t])})}var ij;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(ij||={});var aj={[ij.Dots]:1,[ij.Lines]:1,[ij.Cross]:6},oj=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function sj({id:e,variant:t=ij.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,p.useRef)(null),{transform:f,patternId:h}=XD(oj,KD),g=r||aj[t],_=t===ij.Dots,v=t===ij.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*f[2]||1,y[1]*f[2]||1],x=g*f[2],S=Array.isArray(a)?a:[a,a],C=v?[x,x]:b,w=[S[0]*f[2]+C[0]/2,S[1]*f[2]+C[1]/2],T=`${h}${e||``}`;return(0,m.jsxs)(`svg`,{className:gv([`react-flow__background`,l]),style:{...c,...ek,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,m.jsx)(`pattern`,{id:T,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${w[0]},-${w[1]})`,children:_?(0,m.jsx)(rj,{radius:x/2,className:u}):(0,m.jsx)(nj,{dimensions:C,lineWidth:i,variant:t,className:u})}),(0,m.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${T})`})]})}sj.displayName=`Background`;var cj=(0,p.memo)(sj);function lj(){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,m.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function uj(){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,m.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function dj(){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,m.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`})})}function fj(){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,m.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`})})}function pj(){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,m.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`})})}function mj({children:e,className:t,...n}){return(0,m.jsx)(`button`,{type:`button`,className:gv([`react-flow__controls-button`,t]),...n,children:e})}var hj=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function gj({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let h=ZD(),{isInteractive:g,minZoomReached:_,maxZoomReached:v,ariaLabelConfig:y}=XD(hj,KD),{zoomIn:b,zoomOut:x,fitView:S}=YO();return(0,m.jsxs)(sO,{className:gv([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??y[`controls.ariaLabel`],children:[t&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(mj,{onClick:()=>{b(),a?.()},className:`react-flow__controls-zoomin`,title:y[`controls.zoomIn.ariaLabel`],"aria-label":y[`controls.zoomIn.ariaLabel`],disabled:v,children:(0,m.jsx)(lj,{})}),(0,m.jsx)(mj,{onClick:()=>{x(),o?.()},className:`react-flow__controls-zoomout`,title:y[`controls.zoomOut.ariaLabel`],"aria-label":y[`controls.zoomOut.ariaLabel`],disabled:_,children:(0,m.jsx)(uj,{})})]}),n&&(0,m.jsx)(mj,{className:`react-flow__controls-fitview`,onClick:()=>{S(i),s?.()},title:y[`controls.fitView.ariaLabel`],"aria-label":y[`controls.fitView.ariaLabel`],children:(0,m.jsx)(dj,{})}),r&&(0,m.jsx)(mj,{className:`react-flow__controls-interactive`,onClick:()=>{h.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c?.(!g)},title:y[`controls.interactive.ariaLabel`],"aria-label":y[`controls.interactive.ariaLabel`],children:g?(0,m.jsx)(pj,{}):(0,m.jsx)(fj,{})}),u]})}gj.displayName=`Controls`;var _j=(0,p.memo)(gj);function vj({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:h,backgroundColor:g}=a||{},_=o||h||g;return(0,m.jsx)(`rect`,{className:gv([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:_,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var yj=(0,p.memo)(vj),bj=e=>e.nodes.map(e=>e.id),xj=e=>e instanceof Function?e:()=>e;function Sj({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=yj,onClick:o}){let s=XD(bj,KD),c=xj(t),l=xj(e),u=xj(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,m.jsx)(m.Fragment,{children:s.map(e=>(0,m.jsx)(wj,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function Cj({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=XD(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=GT(r);return{node:r,x:i,y:a,width:o,height:s}},KD);return!l||l.hidden||!KT(l)?null:(0,m.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var wj=(0,p.memo)(Cj),Tj=(0,p.memo)(Sj),Ej=200,Dj=150,Oj=e=>!e.hidden,kj=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?AT(pT(e.nodeLookup,{filter:Oj}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Aj=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,jj=(e,t)=>Aj(e.viewBB,t.viewBB)&&Aj(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,Mj=`react-flow__minimap-desc`;function Nj({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:h,onNodeClick:g,pannable:_=!1,zoomable:v=!1,ariaLabel:y,inversePan:b,zoomStep:x=1,offsetScale:S=5}){let C=ZD(),w=(0,p.useRef)(null),{boundingRect:T,panZoom:E,viewBB:D,rfId:O,translateExtent:k,flowWidth:A,flowHeight:j,ariaLabelConfig:M}=XD(kj,jj),N=e?.width??Ej,P=e?.height??Dj,F=T.width/N,I=T.height/P,L=Math.max(F,I),R=L*N,ee=L*P,z=S*L,te=T.x-(R-T.width)/2-z,B=T.y-(ee-T.height)/2-z,ne=R+z*2,re=ee+z*2,V=`${Mj}-${O}`,ie=(0,p.useRef)(0),H=(0,p.useRef)();ie.current=L,(0,p.useEffect)(()=>{let e=C.getState().panZoom;if(w.current&&e)return H.current=dD({domNode:w.current,panZoom:e,getTransform:()=>C.getState().transform,getViewScale:()=>ie.current}),()=>{H.current?.destroy()}},[E]),(0,p.useEffect)(()=>{H.current?.update({translateExtent:k,width:A,height:j,inversePan:b,pannable:_,zoomStep:x,zoomable:v})},[_,v,b,x,k,A,j]);let ae=h?e=>{let[t,n]=H.current?.pointer(e)||[0,0];h(e,{x:t,y:n})}:void 0,U=(0,p.useCallback)((e,t)=>{let n=C.getState().nodeLookup.get(t).internals.userNode;g?.(e,n)},[g]),W=g?U:void 0,oe=y??M[`minimap.ariaLabel`];return(0,m.jsx)(sO,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*L:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:gv([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,m.jsxs)(`svg`,{width:N,height:P,viewBox:`${te} ${B} ${ne} ${re}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":V,ref:w,onClick:ae,children:[oe&&(0,m.jsx)(`title`,{id:V,children:oe}),(0,m.jsx)(Tj,{onClick:W,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,m.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${te-z},${B-z}h${ne+z*2}v${re+z*2}h${-ne-z*2}z
15
+ M${D.x},${D.y}h${D.width}v${D.height}h${-D.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}Nj.displayName=`MiniMap`,(0,p.memo)(Nj);var Pj=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Fj={[ED.Line]:`right`,[ED.Handle]:`bottom-right`};function Ij({nodeId:e,position:t,variant:n=ED.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:h=!0,shouldResize:g,onResizeStart:_,onResize:v,onResizeEnd:y}){let b=mk(),x=typeof e==`string`?e:b,S=ZD(),C=(0,p.useRef)(null),w=n===ED.Handle,T=XD((0,p.useCallback)(Pj(w&&h),[w,h]),KD),E=(0,p.useRef)(null),D=t??Fj[n];(0,p.useEffect)(()=>{if(C.current&&x)return E.current||=LD({domNode:C.current,nodeId:x,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=S.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=S.getState(),o=[],s={x:e.x,y:e.y},c=r.get(x);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=WE([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...qT({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);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){let e={id:x,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:x,type:`dimensions`,resizing:!0,setAttributes:f?f===`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:({width:e,height:t})=>{let n={id:x,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};S.getState().triggerNodeChanges([n])}}),E.current.update({controlPosition:D,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:_,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{E.current?.destroy()}},[D,s,c,l,u,d,_,v,y,g]);let O=D.split(`-`);return(0,m.jsx)(`div`,{className:gv([`react-flow__resize-control`,`nodrag`,...O,n,r]),ref:C,style:{...i,scale:T,...o&&{[w?`backgroundColor`:`borderColor`]:o}},children:a})}(0,p.memo)(Ij);var Lj=new Set,Rj=[];function zj(e){return e.startsWith(`signal:child:`)}function Bj(e){let t=g();return Xe({queries:(()=>{let n=new Set(e),r=e.size+50,i=[...e];for(;i.length>0&&n.size<r;){let e=i.shift();if(e===void 0)continue;let a=t.getQueryData([`run`,e]);if(a!==void 0)for(let e of Ch(a.timeline)){if(n.size>=r)break;n.has(e)||(n.add(e),i.push(e))}}return[...n].sort()})().map(e=>({queryKey:[`run`,e],queryFn:()=>yr.run(e),refetchInterval:qh})),combine:Ah})}function Vj({data:e}){let t=e.status===`failed`,n=e.status===`pending`||e.status===`running`,r=!!e.childRunId,i=!!e.collapsed,a=r&&!i,o=a?Hr:Wr(e.kind),s=t?{rail:`bg-red-400`,badge:`bg-red-500/15 text-red-300`,pill:`bg-red-500/20 text-red-300`}:n?{rail:`bg-live`,badge:`bg-live/15 text-live`,pill:`bg-live/20 text-live`}:{rail:`bg-emerald-400`,badge:`bg-emerald-500/15 text-emerald-300`,pill:`bg-emerald-500/20 text-emerald-300`};return(0,m.jsxs)(`div`,{title:a?Gr.child:Gr[e.kind]??e.kind,className:`group relative w-[208px] cursor-pointer overflow-hidden rounded-xl border bg-panel/95 shadow-lg backdrop-blur transition-all duration-150 hover:-translate-y-0.5 ${e.selected?`border-brand/60 ring-2 ring-brand/30`:t?`border-red-500/40 hover:border-red-400/60`:a?`border-indigo-500/40 hover:border-indigo-400/60`:`border-line hover:border-zinc-600`}`,children:[(0,m.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-[3px] ${s.rail} ${n?`animate-pulse`:``}`}),(0,m.jsx)(Sk,{type:`target`,position:$.Left,className:`!border-0 !bg-zinc-600`}),(0,m.jsxs)(`div`,{className:`py-2.5 pl-3.5 pr-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${s.badge}`,children:(0,m.jsx)(o,{width:12,height:12})}),(0,m.jsx)(`span`,{className:`truncate text-[13px] font-medium text-zinc-100`,children:e.name}),(0,m.jsx)(`span`,{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${s.pill} ${n?`animate-pulse`:``}`,children:t?(0,m.jsx)(Fr,{width:9,height:9}):n?(0,m.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-current`}):(0,m.jsx)(Pr,{width:9,height:9})})]}),(0,m.jsxs)(`div`,{className:`mono mt-1.5 flex items-center gap-1.5 text-[10px] text-zinc-500`,children:[r?(0,m.jsxs)(`span`,{className:`flex items-center gap-1`,children:[!i&&(0,m.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e.childRunId&&e.onToggleChild?.(e.childRunId)},title:e.childExpanded?`Collapse child flow`:`Expand child flow inline`,className:`grid h-4 w-4 place-items-center rounded border border-indigo-500/30 bg-indigo-500/10 text-indigo-300 transition-colors hover:border-indigo-400/60 hover:bg-indigo-500/20 hover:text-indigo-200`,children:(0,m.jsx)(`span`,{className:`inline-block text-[9px] transition-transform`,style:{transform:e.childExpanded?`rotate(90deg)`:`rotate(0deg)`},children:`▸`})}),(0,m.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e.childRunId&&e.onOpenRun?.(e.childRunId)},title:`Open the child run`,className:`rounded border border-indigo-500/30 bg-indigo-500/10 px-1 text-indigo-300 transition-colors hover:border-indigo-400/60 hover:bg-indigo-500/20 hover:text-indigo-200`,children:`child ↗`})]}):(0,m.jsx)(`span`,{className:`rounded border border-line px-1 text-zinc-400`,children:e.kind}),e.attempts>1&&(0,m.jsxs)(`span`,{className:`flex items-center gap-0.5 text-amber-300`,children:[(0,m.jsx)(Rr,{width:9,height:9}),e.attempts]}),e.workerGroup&&(0,m.jsxs)(`span`,{className:`truncate`,children:[`@`,e.workerGroup]}),(0,m.jsxs)(`span`,{className:`tnum ml-auto text-zinc-400`,children:[`#`,e.seq,e.duration&&(0,m.jsxs)(`span`,{className:`text-zinc-600`,children:[` · `,e.duration]})]})]}),e.subs&&(0,m.jsxs)(`div`,{className:`mono mt-1.5 flex items-center gap-2 border-t border-line pt-1.5 text-[10px]`,children:[e.subs.ok>0&&(0,m.jsxs)(`span`,{className:`text-emerald-300`,children:[e.subs.ok,` ok`]}),e.subs.failed>0&&(0,m.jsxs)(`span`,{className:`text-red-300`,children:[e.subs.failed,` failed`]}),e.subs.skipped>0&&(0,m.jsxs)(`span`,{className:`text-amber-300`,children:[e.subs.skipped,` skipped`]})]})]}),(0,m.jsx)(Sk,{type:`source`,position:$.Right,className:`!border-0 !bg-zinc-600`})]})}function Hj({data:e}){let{fan:t}=e,n=Bh(t,e.runFinished),r=Vh(t,e.runFinished),i=r===`failed`,a=r===`pending`||r===`running`,o=i?`bg-red-400`:a?`bg-live`:`bg-emerald-400`,s=e=>`${e/Math.max(n.total,1)*100}%`;return(0,m.jsxs)(`div`,{title:`parallel fan ${t.group}`,className:`relative w-[208px] overflow-hidden rounded-xl border bg-panel/95 shadow-lg backdrop-blur ${i?`border-red-500/40`:`border-indigo-500/40`}`,children:[(0,m.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-[3px] ${o} ${a?`animate-pulse`:``}`}),(0,m.jsx)(Sk,{type:`target`,position:$.Left,className:`!border-0 !bg-zinc-600`}),(0,m.jsxs)(`div`,{className:`py-2.5 pl-3.5 pr-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`grid h-5 w-5 shrink-0 place-items-center rounded bg-indigo-500/15 text-[11px] text-indigo-300`,children:`⑃`}),(0,m.jsx)(`span`,{className:`truncate text-[13px] font-medium text-zinc-100`,children:t.label}),(0,m.jsx)(`span`,{className:`mono tnum ml-auto shrink-0 text-[11px] text-zinc-400`,children:Hh(n)})]}),(0,m.jsx)(`div`,{className:`mt-2 flex h-1.5 overflow-hidden rounded-full bg-zinc-800`,children:Yh.map(e=>(0,m.jsx)(`span`,{className:e.className,style:{width:s(n[e.key])}},e.key))}),(0,m.jsxs)(`div`,{className:`mono tnum mt-1.5 flex flex-wrap items-center gap-2 text-[10px]`,children:[Yh.map(e=>n[e.key]>0?(0,m.jsxs)(`span`,{className:e.text,children:[n[e.key],` `,e.label,e.key===`skipped`&&t.failFast?` (failFast)`:``]},e.key):null),(0,m.jsxs)(`span`,{className:`ml-auto text-zinc-500`,children:[`#`,t.firstSeq,`–`,t.lastSeq]})]})]}),(0,m.jsx)(Sk,{type:`source`,position:$.Right,className:`!border-0 !bg-zinc-600`})]})}function Uj({data:e}){let t=e.status===`running`||e.status===`awaiting`;return(0,m.jsxs)(`div`,{className:`s-${e.status} flex items-center gap-2 rounded-full border border-current/30 bg-panel px-3.5 py-1.5`,children:[(0,m.jsx)(Sk,{type:`target`,position:$.Left,className:`!border-0 !bg-zinc-600`}),(0,m.jsx)(`span`,{className:`dot ${t?`pulse`:``}`}),(0,m.jsx)(`span`,{className:`mono text-[11px] uppercase tracking-wider`,children:e.label}),(0,m.jsx)(Sk,{type:`source`,position:$.Right,className:`!border-0 !bg-zinc-600`})]})}var Wj={step:Vj,fan:Hj,terminal:Uj};function Gj(e){let t=e.events?.filter(e=>e.status);if(t&&t.length!==0)return{ok:t.filter(e=>e.status===`ok`).length,failed:t.filter(e=>e.status===`failed`).length,skipped:t.filter(e=>e.status===`skipped`).length}}function Kj({run:e,timeline:t,fans:n=Rj,endStatus:r,selectedKey:i,onSelect:a,onOpenRun:o,fmtDuration:s,expanded:c,onToggleChild:l}){let u=c??Lj,d=Bj((0,p.useMemo)(()=>{let e=new Set(u);for(let n of Ch(t))e.add(n);return e},[u,t])),{nodes:f,edges:h}=(0,p.useMemo)(()=>{let a=[],c=[],f=qn(e.status),p=(e,t,n)=>({id:`${e}->${t}`,source:e,target:t,style:{stroke:n?`#f87171`:`var(--line)`,strokeWidth:1.5}}),m=(e,t)=>({id:`${e}=>${t}`,source:e,target:t,style:{stroke:`#818cf8`,strokeWidth:1.5,strokeDasharray:`4 3`}});function h(e,t,n,r,f,p){let h=`${f}s${e.seq}`,_=Sh(e),v=_===void 0?void 0:d[_],y=v!==void 0&&v.timeline.length===1&&v.timeline[0]?{step:v.timeline[0],run:v.run}:void 0,b=y!==void 0,x=!b&&_!==void 0&&u.has(_),S=y?y.step:e,C=y?y.run:p,w=y?y.step.name:_===void 0?Ph(e):v?.run.workflow??wh(_,p.id),T=S.status===`failed`;a.push({id:h,type:`step`,draggable:!1,position:{x:t,y:n},data:{seq:S.seq,name:w,kind:S.kind,status:S.status,workerGroup:S.workerGroup,attempts:S.attempts,duration:s(S.startedAt,S.finishedAt),subs:Gj(S),selected:i===`${S.runId}#${S.seq}`,childRunId:_,onOpenRun:o,childExpanded:x,onToggleChild:l,collapsed:b,depth:r,step:S,laneRun:C}});let E=x?v:void 0;if(E){let i=g(E.timeline,E.fans??Rj,r+1,t+248,n+150,`${_}:`,E.run);for(let e of i.firstIds)c.push(m(h,e));return{id:h,exits:zj(e.name)&&i.connectors.length>0?i.connectors:[{id:h,failed:T}],nextX:Math.max(t+248,i.nextX),bottomY:Math.max(n,i.bottomY)}}return{id:h,exits:[{id:h,failed:T}],nextX:t+248,bottomY:n}}function g(e,t,n,r,i,o,s){let l=r,u=[],d=[],f=i;for(let r of Rh(e,t)){if(r.kind===`summary`){let e=`${o}fan:${r.fan.group}`;a.push({id:e,type:`fan`,draggable:!1,position:{x:l,y:i},data:{fan:r.fan,runFinished:Wh(s.status),depth:n}}),u.length===0&&u.push(e);for(let t of d)c.push(p(t.id,e,t.failed));d=[{id:e,failed:Vh(r.fan,Wh(s.status))===`failed`}],l+=248;continue}let e=r.kind===`single`?[r.step]:r.steps,t=u.length===0,m=[],g=i,_=l;for(let r of e){let e=h(r,l,g,n,o,s);t&&u.push(e.id);for(let t of d)c.push(p(t.id,e.id,t.failed));m.push(...e.exits),_=Math.max(_,e.nextX),g=e.bottomY+96}d=m,l=_,f=Math.max(f,g-96)}return{firstIds:u,connectors:d,nextX:l,bottomY:f}}a.push({id:`start`,type:`terminal`,position:{x:0,y:0},draggable:!1,data:{status:`running`,label:e.workflow}});let _=g(t,n,0,248,0,``,e);for(let e of _.firstIds)c.push({id:`start->${e}`,source:`start`,target:e});let v=r??nr(e,t);a.push({id:`end`,type:`terminal`,position:{x:Math.max(_.nextX,248),y:0},draggable:!1,data:{status:v,label:v}});let y=_.connectors.length>0?_.connectors:[{id:`start`,failed:!1}];for(let e of y)c.push({id:`${e.id}->end`,source:e.id,target:`end`,animated:f,style:{stroke:f?`var(--live)`:`var(--line)`,strokeWidth:f?2:1.5}});return{nodes:a,edges:c}},[e,t,n,r,i,o,s,u,l,d]),g=(0,p.useCallback)((e,t)=>{if(t.type!==`step`)return;let n=t.data;n.step&&n.laneRun&&a(n.step,n.laneRun)},[a]);return(0,m.jsxs)(tj,{nodes:f,edges:h,nodeTypes:Wj,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,children:[(0,m.jsx)(cj,{variant:ij.Dots,gap:22,size:1,color:`#1c1c22`}),(0,m.jsx)(_j,{showInteractive:!1,position:`bottom-right`})]})}function qj(e){return`#/workflow/${encodeURIComponent(e)}`}function Jj(e){let t=e.match(/^#\/workflow\/(.+)$/);return t?.[1]?decodeURIComponent(t[1]):void 0}function Yj(e){let t=[];return e.where&&t.push(`where`),e.input&&t.push(`input`),e.coalesce&&t.push(e.coalesce.keyed?`${e.coalesce.mode} by key`:e.coalesce.mode),e.local||t.push(`announced`),t}function Xj(e,t){let n=e?.[t];if(n)return n.failed>0?`${n.triggered} started · ${n.failed} failed`:`${n.triggered} started`}function Zj({title:e,empty:t,links:n,counts:r}){return(0,m.jsxs)(`section`,{"aria-label":e,className:`min-w-0`,children:[(0,m.jsx)(`h3`,{className:`text-[10px] uppercase tracking-wider text-zinc-500`,children:e}),n.length===0?(0,m.jsx)(`p`,{className:`mt-1 text-[11px] text-zinc-600`,children:t}):(0,m.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1`,children:n.map(e=>(0,m.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,m.jsx)(`a`,{href:qj(e.workflow),className:`mono text-[12px] text-zinc-200 underline-offset-2 hover:underline`,children:e.workflow}),(0,m.jsxs)(wa,{className:e.kind===`failed`?`s-failed`:`s-completed`,children:[`on `,e.kind]}),Yj(e).map(e=>(0,m.jsx)(wa,{children:e},e)),Xj(r,e.workflow)&&(0,m.jsx)(`span`,{className:`mono text-[10px] ${r?.[e.workflow]?.failed?`text-bad`:`text-zinc-500`}`,title:`Counted by this dashboard's server process since it started`,children:Xj(r,e.workflow)})]},`${e.workflow}:${e.kind}`))})]})}function Qj({links:e,counts:t}){return(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-6`,children:[(0,m.jsx)(Zj,{title:`Starts when it settles`,empty:`No workflow starts when it settles.`,links:e.startsOnSettle,counts:t}),(0,m.jsx)(Zj,{title:`Started by`,empty:`No workflow's settling starts it.`,links:e.startedBy})]})}function $j({workflow:e}){let{data:t,error:n,isPending:r}=Qe({queryKey:[`workflow-lifecycle`,e],queryFn:()=>yr.workflowLifecycle(e),refetchInterval:1e4});return(0,m.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,m.jsxs)(`div`,{className:`border-b border-line px-7 py-5`,children:[(0,m.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:e}),(0,m.jsx)(`p`,{className:`mt-1 text-[11px] text-zinc-500`,children:`Lifecycle events: registered here and announced by live workers.`})]}),(0,m.jsx)(`div`,{className:`px-7 py-5`,children:n?(0,m.jsx)(`p`,{className:`text-[11px] text-bad`,children:n instanceof Error?n.message:String(n)}):r||!t?(0,m.jsx)(`p`,{className:`text-[11px] text-zinc-600`,children:`Loading…`}):(0,m.jsx)(Qj,{links:t,counts:t.triggerCounts})})]})}function eM({className:e}){return(0,m.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,className:e,role:`img`,"aria-label":`durable`,children:[(0,m.jsx)(`title`,{children:`durable`}),(0,m.jsx)(`path`,{d:`M12 2.5 21.5 12 12 21.5 2.5 12z`,opacity:.35}),(0,m.jsx)(`circle`,{cx:`6.4`,cy:`12`,r:`1.7`,fill:`currentColor`,stroke:`none`}),(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.7`,fill:`currentColor`,stroke:`none`}),(0,m.jsx)(`circle`,{cx:`17.6`,cy:`12`,r:`1.7`,fill:`currentColor`,stroke:`none`}),(0,m.jsx)(`path`,{d:`M8.1 12h2.2M13.7 12h2.2`})]})}var tM=[`pending`,`running`,`suspended`,`blocked`,`cancelling`,`completed`,`failed`,`cancelled`,`dead`],nM=100;function rM(e){let t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function iM(e,t){let n=new Date(t).getTime()-new Date(e).getTime();return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${(n/6e4).toFixed(1)}m`}function aM({status:e}){return(0,m.jsx)(`span`,{className:`dot s-${e} ${e===`running`||e===`awaiting`?`pulse`:``}`,"aria-hidden":!0})}function oM({status:e}){return(0,m.jsxs)(wa,{variant:`status`,className:`s-${e} text-[11px]`,children:[(0,m.jsx)(aM,{status:e}),e]})}function sM({onOpenRun:e}){let[t,n]=(0,p.useState)(``),[r,i]=(0,p.useState)(!1),a=$e({mutationFn:e=>yr.run(e),onSuccess:t=>{n(``),i(!1),e(t.run.id)},onError:()=>i(!0)});return(0,m.jsxs)(`form`,{className:`relative`,onSubmit:e=>{e.preventDefault();let n=t.trim();n&&a.mutate(n)},children:[(0,m.jsx)(Da,{glyph:(0,m.jsx)(Br,{width:12,height:12}),value:t,onChange:e=>{n(e.target.value),i(!1)},onClear:()=>{n(``),i(!1)},clearLabel:`clear run id`,placeholder:`open run id…`,"aria-label":`open run by id`,containerClassName:`w-44`}),r&&(0,m.jsx)(`span`,{className:`mono absolute left-0 top-full z-20 mt-1 whitespace-nowrap rounded border border-bad/25 bg-panel-2 px-1.5 py-0.5 text-[10px] text-bad`,children:`no run with that id`})]})}function cM(){return(0,m.jsxs)(Om,{children:[(0,m.jsx)(km,{render:(0,m.jsx)(Y,{variant:`quiet`,size:`icon`,"aria-label":`session menu`,title:`Session`,children:(0,m.jsx)(Vr,{width:13,height:13})})}),(0,m.jsx)(Am,{className:`w-36`,children:(0,m.jsx)(`a`,{href:or(),className:`mono block px-2.5 py-2 text-[11px] text-zinc-300 hover:bg-zinc-800/50 hover:text-zinc-100`,children:`Logout`})})]})}function lM({scope:e,filter:t,onFilter:n,onOpenRun:r,view:i,onView:a}){let{data:o=[]}=Qe({queryKey:[`run-values`,`status`,e],queryFn:()=>yr.values(`status`,e),refetchInterval:5e3}),s={};for(let e of o)e.value!==null&&(s[e.value]=e.count);let c=Object.values(s).reduce((e,t)=>e+t,0),l=(e,r,i)=>(0,m.jsxs)(Y,{variant:`ghost`,size:`chip`,"aria-pressed":t===e,onClick:()=>n(e),className:Sa(`rounded-md`,t===e&&`border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100`),children:[e!==`all`&&(0,m.jsx)(aM,{status:e}),(0,m.jsx)(`span`,{className:`uppercase tracking-wide`,children:r}),(0,m.jsx)(`span`,{className:`mono tnum text-zinc-600`,children:i})]},e),{data:u}=Qe({queryKey:[`topology`],queryFn:()=>yr.topology(),staleTime:1/0,refetchInterval:!1}),d=u?.role===`tenant`,f=u?d?u.tenant?`tenant · ${u.tenant}`:`tenant`:`control plane`:``;return(0,m.jsxs)(`header`,{className:`z-10 flex items-center gap-4 border-b border-line px-5 py-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,m.jsx)(`div`,{className:`grid h-7 w-7 place-items-center rounded-md border border-brand/30 bg-brand/10`,children:(0,m.jsx)(eM,{className:`h-4 w-4 text-brand`})}),(0,m.jsxs)(`div`,{className:`leading-none`,children:[(0,m.jsx)(`div`,{className:`text-sm font-semibold tracking-tight`,children:`durable`}),(0,m.jsx)(`div`,{className:`mono text-[10px] uppercase tracking-[0.2em] ${d?`text-amber-400/80`:`text-zinc-600`}`,title:d?`Tenant deployment — partition ${u?.tenant??`(unnamed)`}`:`Control-plane deployment`,children:f})]})]}),(0,m.jsx)(`nav`,{"aria-label":`console views`,className:`ml-2 flex items-center gap-1`,children:[`runs`,...d?[]:[`schedules`]].map(e=>(0,m.jsx)(Y,{variant:`ghost`,size:`chip`,"aria-pressed":i===e,onClick:()=>a(e),className:Sa(`rounded-md uppercase tracking-wide`,i===e&&`border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100`),children:e},e))}),i===`runs`&&(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[l(`all`,`all`,c),tM.map(e=>l(e,e,s[e]??0))]}),(0,m.jsx)(sM,{onOpenRun:r}),(0,m.jsx)(pM,{onOpenRun:r}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-zinc-500`,children:[(0,m.jsx)(`span`,{className:`dot s-completed pulse`,"aria-hidden":!0}),`live`]}),(0,m.jsx)(cM,{})]})}function uM(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;let n=Math.round(t/60);if(n<60)return`${n}m ago`;let r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function dM({status:e}){let t=e?.concurrency;if(!e||!t)return(0,m.jsx)(`span`,{className:`mono text-[9px] text-zinc-600`,children:`no status`});let n=t.limit>0&&e.inFlight>=t.limit*.8;return(0,m.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,m.jsxs)(`div`,{className:`mono flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[10px] text-zinc-500`,children:[(0,m.jsx)(`span`,{className:`shrink-0 rounded border px-1 text-[9px] uppercase tracking-wider ${t.mode===`adaptive`?`border-sky-500/40 bg-sky-500/10 text-sky-300`:`border-zinc-600/50 bg-zinc-800/60 text-zinc-400`}`,children:t.mode===`adaptive`?`adaptive ${t.min??1}–${t.max??32}`:`fixed`}),(0,m.jsxs)(`span`,{className:n?`text-amber-300`:`text-zinc-400`,children:[`in-flight`,` `,(0,m.jsxs)(`span`,{className:`tnum`,children:[e.inFlight,`/`,t.limit]})]}),typeof e.rssPct==`number`&&(0,m.jsxs)(`span`,{className:e.rssPct>=85?`text-rose-300`:``,children:[`ram `,(0,m.jsxs)(`span`,{className:`tnum`,children:[Math.round(e.rssPct),`%`]})]}),typeof e.cpuPct==`number`&&(0,m.jsxs)(`span`,{children:[`cpu `,(0,m.jsxs)(`span`,{className:`tnum`,children:[Math.round(e.cpuPct),`%`]})]}),typeof e.throughputPerMin==`number`&&(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:`tnum`,children:Math.round(e.throughputPerMin)}),`/min`]}),typeof e.p95Ms==`number`&&(0,m.jsxs)(`span`,{children:[`p95 `,(0,m.jsxs)(`span`,{className:`tnum`,children:[Math.round(e.p95Ms),`ms`]})]})]}),e.lastAdjust&&(0,m.jsxs)(`div`,{className:`mono text-[10px] text-zinc-500`,children:[e.lastAdjust.reason,` `,(0,m.jsxs)(`span`,{className:`tnum text-zinc-400`,children:[e.lastAdjust.from,`→`,e.lastAdjust.to]}),` `,uM(e.lastAdjust.at)]})]})}function fM({workers:e}){return(0,m.jsx)(`div`,{className:`flex flex-col divide-y divide-line-soft`,children:e.map(e=>(0,m.jsxs)(`div`,{className:`flex flex-col gap-1 px-2.5 py-2`,children:[(0,m.jsx)(`span`,{className:`mono truncate text-[10px] text-zinc-400`,children:e.instanceId}),(0,m.jsx)(dM,{status:e.status})]},e.instanceId))})}function pM({onOpenRun:e}){let{data:t}=Qe({queryKey:[`workers`],queryFn:()=>yr.workers(),refetchInterval:1e4}),{data:n}=Qe({queryKey:[`compat`],queryFn:()=>yr.compat(),refetchInterval:15e3,retry:!1}),[r,i]=(0,p.useState)(`workers`),a=(n?.incompatibleCount??0)+(n?.blockedCount??0);if((!t||t.length===0)&&a===0)return null;let o=t??[],s=Dr(o),c={workers:`pods`,partitions:`parts`,alerts:`alerts`,compat:`compat`};return(0,m.jsxs)(cv,{value:r,onValueChange:e=>i(e),className:`ml-auto flex flex-nowrap items-center gap-1.5`,children:[(0,m.jsx)(lv,{children:[`workers`,`partitions`,`alerts`,`compat`].map(e=>(0,m.jsxs)(uv,{value:e,children:[c[e],e===`alerts`&&s.starved.length>0&&(0,m.jsx)(`span`,{className:`tnum ml-1 rounded bg-rose-500/80 px-1 text-[9px] text-white`,children:s.starved.length}),e===`compat`&&a>0&&(0,m.jsx)(`span`,{className:`tnum ml-1 rounded bg-rose-500/80 px-1 text-[9px] text-white`,children:a})]},e))}),(0,m.jsxs)(`div`,{className:`flex w-[300px] flex-nowrap items-center justify-end gap-1.5`,children:[(0,m.jsx)(dv,{value:`workers`,className:`flex flex-nowrap items-center gap-1.5`,children:(0,m.jsx)(_M,{workers:Er(o)})}),(0,m.jsx)(dv,{value:`partitions`,className:`flex flex-nowrap items-center gap-1.5`,children:(0,m.jsx)(vM,{groups:o})}),(0,m.jsx)(dv,{value:`alerts`,className:`flex flex-nowrap items-center gap-1.5`,children:(0,m.jsx)(yM,{summary:s})}),(0,m.jsx)(dv,{value:`compat`,className:`flex flex-nowrap items-center gap-1.5`,children:(0,m.jsx)(xh,{compat:n,onOpenRun:e})})]})]})}var mM=`__overflow__`;function hM(e){let t=e.status?.concurrency;return e.status&&t?`${e.status.inFlight}/${t.limit}`:void 0}function gM({w:e}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`px-2.5 py-2`,children:(0,m.jsx)(dM,{status:e.status})}),(0,m.jsxs)(`div`,{className:`max-h-48 overflow-auto border-t border-line-soft px-2.5 py-1.5`,children:[(0,m.jsxs)(`div`,{className:`mono mb-1 text-[9px] uppercase tracking-wider text-zinc-600`,children:[e.handlers.length,` handlers`]}),e.handlers.map(e=>(0,m.jsx)(`div`,{className:`mono truncate text-[10px] text-zinc-400`,children:e},e))]})]})}function _M({workers:e}){let[t,n]=(0,p.useState)(void 0),[r,i]=(0,p.useState)(void 0),a=e.slice(0,2),o=e.slice(2),s=t===mM;return(0,m.jsxs)(m.Fragment,{children:[a.map(e=>{let r=t===e.instanceId,i=hM(e);return(0,m.jsxs)(Om,{open:r,onOpenChange:t=>n(t?e.instanceId:void 0),children:[(0,m.jsx)(gh,{suppressed:r,label:`${e.instanceId}\n${e.handlers.length} handlers · ${e.partition}${i?` · ${i} in-flight`:``}`,children:(0,m.jsx)(km,{render:(0,m.jsxs)(Y,{variant:`chip`,size:`xs`,className:Sa(`mono max-w-[120px] gap-1`,r&&`border-zinc-500 bg-zinc-800 text-zinc-200`),children:[(0,m.jsx)(`span`,{className:`dot ${e.status?`s-completed`:``}`,"aria-hidden":!0}),(0,m.jsx)(`span`,{className:`truncate`,children:e.instanceId}),e.partition!=="default"&&(0,m.jsxs)(`span`,{className:`shrink-0 text-zinc-500`,children:[`@`,e.partition]}),(0,m.jsxs)(`span`,{className:`tnum shrink-0 text-zinc-500`,children:[e.handlers.length,`h`,i?` · ${i}`:``]})]})})}),(0,m.jsxs)(Am,{children:[(0,m.jsxs)(`div`,{className:`mono flex items-center justify-between gap-2 border-b border-line px-2.5 py-1.5 text-[10px] text-zinc-500`,children:[(0,m.jsx)(`span`,{className:`truncate text-zinc-300`,children:e.instanceId}),(0,m.jsxs)(`span`,{className:`shrink-0`,children:[e.runtime??`node`,` · `,e.partition]})]}),(0,m.jsx)(gM,{w:e})]})]},e.instanceId)}),o.length>0&&(0,m.jsxs)(Om,{open:s,onOpenChange:e=>{n(e?mM:void 0),i(void 0)},children:[(0,m.jsx)(km,{render:(0,m.jsxs)(Y,{variant:`chip`,size:`xs`,className:Sa(`mono shrink-0`,s&&`border-zinc-500 bg-zinc-800 text-zinc-200`),children:[`+`,o.length]})}),(0,m.jsxs)(Am,{children:[(0,m.jsxs)(`div`,{className:`mono border-b border-line px-2.5 py-1.5 text-[9px] uppercase tracking-wider text-zinc-600`,children:[o.length,` more `,o.length===1?`pod`:`pods`]}),(0,m.jsx)(`div`,{className:`max-h-80 divide-y divide-line-soft overflow-auto`,children:o.map(e=>{let t=hM(e),n=r===e.instanceId;return(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>i(n?void 0:e.instanceId),className:Sa(`mono flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left text-[10px] hover:bg-zinc-800/50`,n?`bg-zinc-800/40 text-zinc-200`:`text-zinc-300`),children:[(0,m.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,m.jsx)(`span`,{className:`dot ${e.status?`s-completed`:``}`,"aria-hidden":!0}),(0,m.jsx)(`span`,{className:`truncate`,children:e.instanceId})]}),(0,m.jsxs)(`span`,{className:`tnum shrink-0 text-zinc-500`,children:[e.partition==="default"?``:`@${e.partition} · `,e.handlers.length,`h`,t?` · ${t}`:``]})]}),n&&(0,m.jsx)(`div`,{className:`border-t border-line-soft bg-zinc-900/40`,children:(0,m.jsx)(gM,{w:e})})]},e.instanceId)})})]})]})]})}function vM({groups:e}){let[t,n]=(0,p.useState)(void 0),r=Cr(e);function i(t){let n=new Map;for(let r of e)if(xr(r.group)===t)for(let e of r.liveWorkers)n.has(e.instanceId)||n.set(e.instanceId,e);return[...n.values()]}return(0,m.jsx)(m.Fragment,{children:r.map(e=>{let r=e.starvedCount>0,a=t===e.partition;return(0,m.jsxs)(Om,{open:a&&e.workerCount>0,onOpenChange:t=>n(t?e.partition:void 0),children:[(0,m.jsx)(gh,{suppressed:a,label:`${e.partition}\n${e.workerCount} workers · ${e.handlerCount} handlers · ${e.totalDepth} queued${r?` · ${e.starvedCount} starved`:``}`,children:(0,m.jsx)(km,{render:(0,m.jsxs)(Y,{variant:`chip`,size:`xs`,disabled:e.workerCount===0,className:Sa(`mono gap-1`,r&&`border-rose-500/50 bg-rose-500/15 text-rose-300`,!r&&a&&`border-zinc-500 bg-zinc-800 text-zinc-200`,e.workerCount>0?`cursor-pointer`:`cursor-default`),children:[(0,m.jsx)(`span`,{className:`dot ${r?`s-failed`:e.workerCount>0?`s-completed`:``}`,"aria-hidden":!0}),e.partition,(0,m.jsxs)(`span`,{className:`tnum text-zinc-500`,children:[e.workerCount,`w `,e.handlerCount,`h`,e.totalDepth>0?` ${e.totalDepth}q`:``,r?` ${e.starvedCount}!`:``]})]})})}),(0,m.jsxs)(Am,{children:[(0,m.jsxs)(`div`,{className:`mono flex items-center justify-between border-b border-line px-2.5 py-1.5 text-[10px] text-zinc-500`,children:[(0,m.jsx)(`span`,{className:`text-zinc-300`,children:e.partition}),(0,m.jsxs)(`span`,{className:`tnum`,children:[e.workerCount,` worker(s) · `,e.totalDepth,` queued`]})]}),(0,m.jsx)(fM,{workers:i(e.partition)})]})]},e.partition)})})}function yM({summary:e}){let t=(e,t)=>`${e} ${e===1?t:`${t}s`}`;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(gh,{label:`Route-by-handler: each @Workflow & @Step is served as its own queue.\n${e.queueCount} queues across ${t(e.workerCount,`worker`)}.`,children:(0,m.jsxs)(`span`,{className:`mono tnum text-[10px] text-zinc-500`,children:[t(e.workflowCount,`workflow`),` · `,t(e.stepCount,`step`),` ·`,` `,t(e.workerCount,`worker`),` ·`,` `,e.allDraining?(0,m.jsx)(`span`,{className:`text-good`,children:`all draining`}):(0,m.jsxs)(`span`,{className:`text-rose-300`,children:[e.starved.length,` starved`]})]})}),e.starved.map(e=>(0,m.jsx)(gh,{label:`${e.group}\n${e.depth} queued, no worker consuming`,children:(0,m.jsxs)(wa,{variant:`danger`,className:`mono gap-1 border-rose-500/50 bg-rose-500/15 py-0.5`,children:[(0,m.jsx)(`span`,{className:`dot s-failed`,"aria-hidden":!0}),(0,m.jsx)(`span`,{className:`max-w-[180px] truncate`,children:e.group}),(0,m.jsxs)(`span`,{className:`tnum shrink-0`,children:[e.depth,`q · 0w`]})]})},e.group))]})}function bM(){return(0,m.jsx)(`ul`,{className:`divide-y divide-line-soft`,"aria-hidden":!0,children:[0,1,2,3,4,5].map(e=>(0,m.jsxs)(`li`,{className:`flex flex-col gap-2 px-4 py-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,m.jsx)(`div`,{className:`h-3.5 w-32 animate-pulse rounded bg-zinc-800`}),(0,m.jsx)(`div`,{className:`h-3 w-16 animate-pulse rounded bg-zinc-800/70`})]}),(0,m.jsx)(`div`,{className:`h-2.5 w-48 animate-pulse rounded bg-zinc-800/50`})]},e))})}function xM({r:e,allRuns:t,health:n,selected:r,onSelect:i,onSelectTag:a,onSelectNamespace:o,onSelectOrigin:s}){let c=tr(e,{runs:t,health:n}),l=e.namespace&&e.namespace!=="default"?e.namespace:void 0,u=Sn(e.origin);return(0,m.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:`flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors ${r===e.id?`bg-zinc-900`:`hover:bg-zinc-900/50`}`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,m.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`truncate text-sm font-medium text-zinc-200`,children:e.workflow}),l&&(0,m.jsx)(wa,{variant:`tenant`,className:`mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-sky-400/60 hover:text-sky-200`,title:`Tenant / worker-pool partition — click to show only ${l}`,onClick:e=>{e.stopPropagation(),o(l)},children:l}),u&&(0,m.jsx)(wa,{variant:`origin`,className:`mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-teal-400/60 hover:text-teal-200`,title:`Declared by ${u} — click to show only this library's runs`,onClick:e=>{e.stopPropagation(),s({kind:`origin`,origin:u})},children:wn(u)}),e.id.startsWith(`dlq:`)&&(0,m.jsx)(wa,{variant:`danger`,className:`mono shrink-0 px-1 text-[9px] uppercase tracking-wider`,children:`dlq`})]}),(0,m.jsx)(oM,{status:c.status})]}),c.detail&&(0,m.jsx)(`div`,{className:`mono truncate text-[11px] s-${c.status}`,children:c.detail}),(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,m.jsx)(`span`,{className:`mono truncate text-[11px] text-zinc-600`,children:e.id}),(0,m.jsx)(`span`,{className:`shrink-0 text-[11px] text-zinc-600`,children:rM(e.updatedAt)})]}),e.tags&&e.tags.length>0&&(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.tags.map(e=>(0,m.jsxs)(`span`,{onClick:t=>{t.stopPropagation(),a(e)},className:Sa(Ca({variant:`outline`}),`mono cursor-pointer hover:border-zinc-500 hover:text-zinc-200`),children:[`#`,e]},e))})]})}var SM=88;function CM({runs:e,allRuns:t,health:n,loading:r,selected:i,onSelect:a,onSelectTag:o,onSelectNamespace:s,onSelectOrigin:c,emptyNotice:l,hasMore:u,loadingMore:d,onLoadMore:f}){let h=(0,p.useRef)(null),g=(0,p.useCallback)(t=>e[t]?.id??t,[e]),_=Jt({count:e.length,getScrollElement:()=>h.current,estimateSize:()=>SM,getItemKey:g,overscan:10,initialRect:{width:340,height:480}}),v=_.getVirtualItems(),y=v.length>0?v[v.length-1]?.index??-1:-1;return(0,p.useEffect)(()=>{e.length!==0&&(y<e.length-1||u&&!d&&f?.())},[y,e.length,u,d,f]),r&&e.length===0?(0,m.jsx)(bM,{}):e.length===0?(0,m.jsxs)(`div`,{className:`flex flex-col items-start gap-2 p-6 text-sm text-zinc-600`,children:[(0,m.jsx)(`span`,{children:l.message}),l.unclassified!==void 0&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`span`,{className:`text-[11px] text-zinc-500`,children:[l.unclassified,` run`,l.unclassified===1?``:`s`,` here`,` `,l.unclassified===1?`is`:`are`,` the app's own (no package origin), so no package filter can match `,l.unclassified===1?`it`:`them`,`.`]}),(0,m.jsx)(Y,{variant:`chip`,size:`xs`,className:`mono rounded`,title:`The app's own workflows: runs with no package origin, i.e. not declared by any library.`,onClick:()=>c({kind:`unknown`}),children:`show app runs`})]})]}):(0,m.jsxs)(`div`,{ref:h,className:`h-full overflow-auto`,"data-testid":`runs-list-scroll`,children:[(0,m.jsx)(`ul`,{className:`relative divide-y divide-line-soft`,style:{height:_.getTotalSize()},children:v.map(r=>{let l=e[r.index];return l?(0,m.jsx)(`li`,{ref:_.measureElement,"data-index":r.index,className:`absolute inset-x-0 top-0`,style:{transform:`translateY(${r.start}px)`},children:(0,m.jsx)(xM,{r:l,allRuns:t,health:n,selected:i,onSelect:a,onSelectTag:o,onSelectNamespace:s,onSelectOrigin:c})},l.id):null})}),d&&(0,m.jsx)(`div`,{className:`mono px-4 py-2 text-center text-[11px] text-zinc-600`,children:`loading more…`})]})}function wM({compensations:e,selKey:t,onSelect:n}){return(0,m.jsxs)(`div`,{className:`shrink-0 border-t border-amber-500/20 bg-black/20 px-7 py-3`,children:[(0,m.jsx)(`div`,{className:`mono mb-2 text-[10px] uppercase tracking-[0.18em] text-amber-400/80`,children:`compensation · unwind order`}),(0,m.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map(e=>{let r=`${e.runId}#${e.seq}`;return(0,m.jsx)(`li`,{children:(0,m.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:`mono flex w-full items-center gap-2 rounded-md border px-2.5 py-1.5 text-left text-[11.5px] transition-colors ${r===t?`border-amber-500/50 bg-amber-500/15`:`border-amber-500/20 bg-amber-500/5 hover:border-amber-500/40`}`,children:[(0,m.jsx)(aM,{status:e.status}),(0,m.jsx)(`span`,{className:`truncate text-amber-100`,children:Pn(e.name)}),(0,m.jsx)(`span`,{className:`ml-auto shrink-0 text-[10px] uppercase tracking-wider text-amber-400/70`,children:e.status})]})},r)})})]})}var TM=[];function EM({id:e,onOpenRun:t}){let n=g(),{data:r}=Qe({queryKey:[`run`,e],queryFn:async()=>wr(n.getQueryData([`run`,e]),await yr.run(e)),refetchInterval:e=>{let t=e.state.data?.run.status;return t===`running`||t===`suspended`||t===`cancelling`?1500:!1}}),{data:i=[]}=Qe({queryKey:[`workers`],queryFn:()=>yr.workers(),refetchInterval:5e3}),{data:a=[]}=Qe({queryKey:[`runs`,``,``],queryFn:()=>yr.runs(),refetchInterval:3e3}),{data:o}=Qe({queryKey:[`topology`],queryFn:()=>yr.topology(),staleTime:1/0,refetchInterval:!1}),s=o?.role===`tenant`,c=r?.run.status===`dead`?`dlq:${e}`:void 0,{data:l}=Qe({queryKey:[`run`,c],queryFn:()=>yr.run(c),enabled:!!c,retry:!1,refetchInterval:e=>!e.state.data&&1e4}),u=()=>{n.invalidateQueries({queryKey:[`run`,e]}),n.invalidateQueries({queryKey:[`runs`]})},d=(0,p.useRef)(null);d.current?.runId!==e&&(d.current={runId:e,tail:new br});let f=d.current.tail;(0,p.useEffect)(()=>{let t=Or(()=>n.invalidateQueries({queryKey:[`run`,e]}),1500),r=yr.streamRun(e,r=>{if(f.push(r),r.type===`step.progress`&&r.event&&r.seq!=null){let t=r.seq,i=r.event;n.setQueryData([`run`,e],e=>Tr(e,t,i))}else t.call()});return()=>{t.cancel(),r()}},[e,n,f]);let h=$e({mutationFn:()=>yr.retry(e),onSuccess:u}),_=$e({mutationFn:t=>yr.cancel(e,t===void 0?{}:{compensate:t}),onSuccess:u}),v=$e({mutationFn:()=>yr.continue(e),onSuccess:u}),y=$e({mutationFn:()=>yr.redispatch(e),onSuccess:u}),[b,x]=(0,p.useState)(!1),S=$e({mutationFn:()=>yr.republishLifecycle(e),onSuccess:u}),C=$e({mutationFn:t=>yr.retryWithInput(e,t),onSuccess:e=>{n.invalidateQueries({queryKey:[`runs`]}),t(e.runId)}}),[w,T]=(0,p.useState)(!1),[E,D]=(0,p.useState)(``),[O,k]=(0,p.useState)(),A=()=>{D(JSON.stringify(r?.run.input??{},null,2)),k(void 0),T(!0)},j=()=>{let e;try{e=JSON.parse(E)}catch(e){k(e instanceof Error?e.message:`Invalid JSON`);return}T(!1),C.mutate(e)},[M,N]=(0,p.useState)(),[P,F]=(0,p.useState)(!1),[I,L]=(0,p.useState)(new Set),[R,ee]=(0,p.useState)(240);function z(e){e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId);let t=e=>ee(t=>Math.max(120,Math.min(720,t-e.movementY))),n=()=>{window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerup`,n)};window.addEventListener(`pointermove`,t),window.addEventListener(`pointerup`,n)}function te(e){L(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}if(!r)return(0,m.jsx)(`div`,{className:`p-8 text-sm text-zinc-600`,children:`Loading run…`});let{run:B,timeline:ne}=r,{body:re,compensations:V}=Fn(ne),ie=r.fans??TM,H=ie.reduce((e,t)=>e+t.size,re.length),ae=re.length>0||ie.length>0,U=Th(r.children??[],r.childCount),W=Eh(r),oe=W.startedBy,se=Oh(r),G=In(V),ce=B.id.startsWith(`dlq:`),le=ce?{id:B.id.slice(4),title:`Dead-letter handler`,subtitle:`started because run ${B.id.slice(4)} was dead-lettered`,cta:`open dead run →`}:l?{id:`dlq:${B.id}`,title:`Dead-lettered`,subtitle:`this run exceeded recovery and was routed to a DLQ handler`,cta:`open DLQ handler →`}:void 0,ue=V.length>0||B.status===`cancelling`?(()=>{let e=G.failed>0?` ${G.failed} undo${G.failed===1?``:`s`} failed after retries — check ${G.failed===1?`it`:`them`} below.`:``;return B.status===`cancelling`?{title:`Cancelling`,subtitle:V.length>0?`undoing completed steps in reverse before cancelling (${G.done} of ${G.total} done).${e}`:`a compensating cancel is undoing the saga; the run becomes cancelled when it is done.`}:G.pending>0?{title:`Compensating`,subtitle:`undoing completed steps in reverse (${G.done} of ${G.total} done).${e}`}:B.status===`cancelled`?{title:`Cancelled with compensation`,subtitle:`completed steps were undone before cancelling.${e}`}:{title:`Saga compensated`,subtitle:`the run failed and its ${G.total} completed step${G.total===1?``:`s`} were undone in reverse.${e}`}})():void 0,de=B.status===`failed`||B.status===`suspended`,fe=B.status===`running`||B.status===`suspended`,pe=B.status===`suspended`||B.status===`running`,me=re.some(e=>e.status===`pending`&&e.kind===`signal`&&e.name.startsWith(`breakpoint`)),he=M?`${M.step.runId}#${M.step.seq}`:void 0,ge=tr(B,{runs:a,health:i,timeline:re}),_e=B.namespace&&B.namespace!=="default"?B.namespace:void 0,ve=Sn(B.origin),ye=B.waiting??a.find(e=>e.id===B.id)?.waiting,be=B.status===`suspended`?Wn(re,ye):[],xe=[h,_,v,y,C].find(e=>e.error)?.error;return(0,m.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-line px-7 py-5`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,m.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:(0,m.jsx)(`a`,{href:qj(B.workflow),className:`underline-offset-4 hover:underline`,title:`Open this workflow's page: who starts when it settles, and who starts it`,children:B.workflow})}),Wg(B.id)!==void 0&&(0,m.jsx)(Y,{variant:`alt`,size:`xs`,onClick:()=>t(Wg(B.id)),className:`mono uppercase tracking-wider`,title:`Open the parent run (${Wg(B.id)}) — the macro view this child belongs to`,children:`↑ parent`}),Ug(B.id)!==void 0&&(0,m.jsx)(Y,{variant:`chip`,size:`xs`,onClick:()=>t(Ug(B.id)),className:`mono uppercase tracking-wider text-zinc-300`,title:`This is a retry-with-input of ${Ug(B.id)} — open the original run`,children:`↩ original`}),ce&&(0,m.jsx)(wa,{variant:`danger`,className:`mono py-0.5 uppercase tracking-wider`,children:`dlq`}),(0,m.jsx)(oM,{status:ge.status}),ge.detail&&(0,m.jsx)(`span`,{className:`mono text-[11px] s-${ge.status}`,children:ge.detail}),_e&&(0,m.jsx)(wa,{variant:`tenant`,className:`mono py-0.5`,title:`Tenant / worker-pool partition this run belongs to`,children:_e}),ve?(0,m.jsx)(wa,{variant:`origin`,className:`mono py-0.5`,title:`Declared by ${ve}`,children:wn(ve)}):(0,m.jsxs)(wa,{variant:`origin-unknown`,className:`mono py-0.5`,title:kn,children:[`origin `,`app`]}),V.length>0&&(0,m.jsx)(wa,{variant:`warn`,className:Sa(`mono py-0.5 uppercase tracking-wider`,G.pending>0&&`pulse`),title:G.pending>0?`compensating: ${G.done} of ${G.total} undone`:`${G.total} step${G.total===1?``:`s`} compensated`,children:G.pending>0?`compensating`:`compensated`}),(0,m.jsxs)(wa,{className:`mono bg-transparent py-0.5 text-zinc-500`,children:[`v`,B.workflowVersion]}),(0,m.jsxs)(`span`,{className:`mono tnum text-[11px] text-zinc-600`,children:[H,` `,H===1?`step`:`steps`]})]}),(0,m.jsx)(`div`,{className:`mono mt-1 truncate text-[11px] text-zinc-600`,children:B.id}),B.tags&&B.tags.length>0&&(0,m.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:B.tags.map(e=>(0,m.jsxs)(wa,{className:`mono`,children:[`#`,e]},e))}),B.searchAttributes&&Object.keys(B.searchAttributes).length>0&&(0,m.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:Object.entries(B.searchAttributes).map(([e,t])=>(0,m.jsxs)(wa,{variant:`attr`,className:`mono`,title:`search attribute`,children:[e,`=`,String(t)]},e))}),U.shown.length>0?(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-zinc-600`,children:`children:`}),U.shown.map(e=>(0,m.jsx)(Y,{variant:`chip`,size:`xs`,onClick:()=>t(e),className:`mono px-1.5 py-0`,children:e},e)),U.more>0&&(0,m.jsxs)(`span`,{className:`mono text-[10px] text-zinc-500`,children:[`+`,U.more,` more`]})]}):null,oe?(0,m.jsx)(zg,{source:oe,onOpenRun:t}):null,(0,m.jsx)(Bg,{waitsFor:r.waitsFor,awaitedBy:r.awaitedBy,onOpenRun:t}),W.triggered.length>0&&!r.lifecycleDeliveries?(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-zinc-600`,children:`triggered:`}),W.triggered.map(e=>(0,m.jsx)(Y,{variant:`chip`,size:`xs`,onClick:()=>t(e),className:`mono px-1.5 py-0`,children:e},e))]}):null,r.lifecycleDeliveries?(0,m.jsx)($g,{deliveries:r.lifecycleDeliveries,tail:f,onOpenRun:t}):null,r.workflowLifecycle?(0,m.jsx)(`div`,{className:`mt-3`,children:(0,m.jsx)(Qj,{links:r.workflowLifecycle})}):null,(0,m.jsx)(Qg,{tail:f,onOpenRun:t})]}),(0,m.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,m.jsx)(Y,{onClick:()=>F(!0),className:`mono px-2.5 normal-case tracking-normal text-zinc-400`,title:`Run input / output`,children:`{ }`}),me&&(0,m.jsxs)(Y,{variant:`warn`,disabled:v.isPending||s,onClick:()=>v.mutate(),title:s?`Not available on a tenant deployment — resuming a breakpoint needs the control plane.`:void 0,children:[(0,m.jsx)(zr,{width:12,height:12}),`Continue`]}),(0,m.jsxs)(Y,{variant:`brand`,disabled:!de||h.isPending,onClick:()=>h.mutate(),children:[(0,m.jsx)(Lr,{width:12,height:12}),`Retry`]}),pe&&(0,m.jsxs)(Y,{variant:`info`,disabled:y.isPending,onClick:()=>y.mutate(),title:"Re-dispatch stuck `pending` remote steps — recovery for a lost step dispatch (crashed worker or dropped job)",children:[(0,m.jsx)(Rr,{width:12,height:12}),`Re-dispatch`]}),se.length>0&&(0,m.jsxs)(Y,{variant:`info`,disabled:S.isPending,onClick:()=>{S.reset(),x(!0)},title:`Publish this run's lifecycle event again, to the subscribers it has not started yet`,children:[(0,m.jsx)(Rr,{width:12,height:12}),`Republish lifecycle event`]}),(B.status===`dead`||B.status===`failed`)&&(0,m.jsxs)(Y,{variant:`alt`,disabled:C.isPending||s,onClick:A,title:s?`Not available on a tenant deployment — fix & replay needs the control plane.`:`Edit the input and re-run as a fresh linked run`,children:[(0,m.jsx)(Lr,{width:12,height:12}),`Fix & replay`]}),fe&&(0,m.jsxs)(Y,{variant:`warn`,disabled:_.isPending,onClick:()=>_.mutate(!0),title:`Cancel and run saga compensations (undo completed steps in reverse)`,className:`bg-transparent`,children:[(0,m.jsx)(Lr,{width:12,height:12}),`Cancel + Undo`]}),(0,m.jsxs)(Y,{className:`border-zinc-700`,disabled:!fe||_.isPending,onClick:()=>_.mutate(!1),children:[(0,m.jsx)(Fr,{width:12,height:12}),`Cancel`]})]})]}),le&&(0,m.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-rose-500/30 bg-rose-500/10 px-7 py-3`,children:[(0,m.jsx)(`span`,{className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-rose-500/40 bg-rose-500/15 text-sm text-rose-300`,"aria-hidden":!0,children:`⚠`}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsx)(`div`,{className:`text-[13px] font-medium text-rose-200`,children:le.title}),(0,m.jsx)(`div`,{className:`mono truncate text-[11px] text-rose-300/70`,children:le.subtitle})]}),(0,m.jsx)(Y,{variant:`danger`,onClick:()=>t(le.id),className:`mono shrink-0 border-rose-500/40 bg-rose-500/15 px-2.5 text-[11px] normal-case tracking-normal text-rose-200 enabled:hover:bg-rose-500/25`,children:le.cta})]}),xe&&(0,m.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-3 border-b border-rose-500/30 bg-rose-500/10 px-7 py-3 text-[12px] text-rose-200`,children:[(0,m.jsx)(`span`,{className:`font-medium`,children:`Action failed:`}),(0,m.jsx)(`span`,{className:`mono min-w-0 flex-1 truncate`,children:xe instanceof Error?xe.message:String(xe)})]}),be.length>0&&(0,m.jsx)(hv,{runId:B.id,targets:be,tenantPod:s,onDelivered:u}),ue&&(0,m.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-amber-500/30 bg-amber-500/10 px-7 py-3`,children:[(0,m.jsx)(`span`,{className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-amber-500/40 bg-amber-500/15 text-sm text-amber-300`,"aria-hidden":!0,children:`↺`}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsx)(`div`,{className:`text-[13px] font-medium text-amber-200`,children:ue.title}),(0,m.jsx)(`div`,{className:`mono truncate text-[11px] text-amber-300/70`,children:ue.subtitle})]})]}),(0,m.jsxs)(`div`,{className:`relative grid min-h-0 flex-1`,style:{gridTemplateRows:ae?`1fr ${R}px`:`1fr`},children:[(0,m.jsxs)(`div`,{className:`relative min-h-0`,children:[ae?(0,m.jsx)(Kj,{run:B,timeline:re,fans:ie,endStatus:ge.status,selectedKey:he,onSelect:(e,t)=>N({step:e,run:t}),onOpenRun:t,fmtDuration:iM,expanded:I,onToggleChild:te}):(0,m.jsx)(`div`,{className:`grid h-full place-items-center text-sm text-zinc-600`,children:`No steps recorded yet.`}),(B.status===`failed`||B.status===`cancelled`)&&B.error&&(0,m.jsx)(`div`,{className:`mono absolute inset-x-6 bottom-6 rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2 text-xs text-red-300 backdrop-blur`,children:B.error.message})]}),ae&&(0,m.jsxs)(`div`,{className:`relative min-h-0 overflow-hidden border-t border-line bg-black/20`,children:[(0,m.jsx)(`div`,{onPointerDown:z,className:`absolute inset-x-0 top-0 z-10 h-1.5 -translate-y-1/2 cursor-row-resize hover:bg-brand/40`,title:`Drag to resize`}),(0,m.jsx)(mg,{run:B,timeline:re,fans:ie,selectedKey:he,onSelect:(e,t)=>N({step:e,run:t}),onOpenRun:t,expanded:I,onToggleChild:te})]}),M&&(0,m.jsx)(Ag,{step:M.step,run:M.run,onClose:()=>N(void 0),onOpenRun:t}),P&&(0,m.jsx)(e_,{run:B,onClose:()=>F(!1)})]}),V.length>0&&(0,m.jsx)(wM,{compensations:V,selKey:he,onSelect:e=>N({step:e,run:B})}),(0,m.jsxs)(k_,{open:b,onOpenChange:x,title:`Republish lifecycle event`,subtitle:`publishes ${B.id}'s ${B.status===`completed`?`completed`:`failed`} event again`,footer:S.isSuccess?(0,m.jsx)(Y,{onClick:()=>x(!1),children:`Close`}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Y,{onClick:()=>x(!1),children:`Cancel`}),(0,m.jsx)(Y,{variant:`info`,disabled:S.isPending,onClick:()=>S.mutate(),children:`Republish`})]}),children:[S.isSuccess?(0,m.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-zinc-300`,children:kh(S.data)}):(0,m.jsxs)(`p`,{className:`text-[12.5px] leading-relaxed text-zinc-400`,children:[`Starts the subscribers of this run's lifecycle event that it has not started yet:`,` `,(0,m.jsx)(`span`,{className:`mono text-zinc-300`,children:se.join(`, `)}),`. A subscriber run that already exists is not started again.`]}),S.isError&&(0,m.jsx)(`p`,{className:`mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad`,children:S.error instanceof Error?S.error.message:`Republish failed`})]}),(0,m.jsxs)(k_,{open:w,onOpenChange:T,title:`Fix & replay`,subtitle:`re-runs ${B.id} as a fresh linked run`,footer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Y,{onClick:()=>T(!1),children:`Cancel`}),(0,m.jsx)(Y,{variant:`alt`,disabled:C.isPending,onClick:j,children:`Replay`})]}),children:[(0,m.jsx)(`label`,{className:`mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-zinc-500`,htmlFor:`fix-replay-input`,children:`input`}),(0,m.jsx)(`textarea`,{id:`fix-replay-input`,value:E,spellCheck:!1,onChange:e=>{D(e.target.value),k(void 0)},className:`mono h-64 w-full resize-y rounded-lg border border-line bg-black/40 p-3 text-[11.5px] leading-relaxed text-zinc-300 focus:border-zinc-600 focus:outline-none`}),O&&(0,m.jsx)(`p`,{className:`mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad`,children:O})]})]})}function DM(){if(typeof window<`u`)return Jj(window.location.hash)}function OM(){if(typeof window>`u`)return;let e=window.location.hash.match(/^#\/run\/(.+)$/)?.[1];return e?decodeURIComponent(e):void 0}function kM(){let[e,t]=(0,p.useState)(`all`),[n,r]=(0,p.useState)([]),[i,a]=(0,p.useState)([]),[o,s]=(0,p.useState)([]),[c,l]=(0,p.useState)([]),[u,d]=(0,p.useState)(xn),[f,h]=(0,p.useState)(()=>OM()),[_,v]=(0,p.useState)(`runs`),[y,b]=(0,p.useState)(()=>DM()),x=(0,p.useCallback)(e=>{if(h(e),b(void 0),typeof window>`u`)return;let t=e?`#/run/${encodeURIComponent(e)}`:``,n=t||window.location.pathname+window.location.search;window.location.hash!==t&&window.history.pushState(null,``,n)},[]),S=(0,p.useCallback)(e=>{v(`runs`),x(e)},[x]),C=(0,p.useCallback)(e=>{y!==void 0&&x(void 0),v(e)},[y,x]);(0,p.useEffect)(()=>{let e=()=>{h(OM()),b(DM())};return window.addEventListener(`hashchange`,e),window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`hashchange`,e),window.removeEventListener(`popstate`,e)}},[]);let w=g(),T=o,{data:E,dataUpdatedAt:D,isPending:O,fetchNextPage:k,hasNextPage:A,isFetchingNextPage:j}=et({queryKey:[`runs`,e,n,i,T.join(`|`),c],queryFn:({pageParam:t})=>yr.runsPage(e===`all`?void 0:e,i.length?i:void 0,T.length?T:void 0,{namespace:c.length?c:void 0,workflow:n.length?n:void 0},{page:t,size:nM}),initialPageParam:1,getNextPageParam:e=>{let{page:t,size:n,count:r}=e.meta;return r===n?t+1:void 0},refetchInterval:3e3}),M=(0,p.useMemo)(()=>E?.pages.flatMap(e=>e.runs)??[],[E]);(0,p.useEffect)(()=>{D>0&&w.invalidateQueries({queryKey:[`run-values`,`status`]})},[D,w]);let{data:N=[]}=Qe({queryKey:[`workers`],queryFn:()=>yr.workers(),refetchInterval:5e3}),[P,F]=(0,p.useState)(void 0),[I,L]=(0,p.useState)(void 0),R=$e({mutationFn:t=>yr.bulk(t,{status:e===`all`?void 0:e,workflow:n.length?n:void 0,tag:i.length?i:void 0,attr:T.length?T:void 0,namespace:c.length?c:void 0,origin:u.kind===`origin`?u.origin:void 0}),onSuccess:(e,t)=>{L({action:t,...e}),w.invalidateQueries({queryKey:[`runs`]})}});(0,p.useEffect)(()=>{if(!I||I.matched>=500)return;let e=setTimeout(()=>L(void 0),6e3);return()=>clearTimeout(e)},[I]);let ee=On(M,u),z=Mn(M),te=e!==`all`||n.length>0||i.length>0||c.length>0||T.length>0||u.kind!==`all`,B=e===`all`?void 0:e,ne=(0,p.useMemo)(()=>({status:B,tag:i,namespace:c,attr:o}),[B,i,c,o]),re=(0,p.useMemo)(()=>({status:B,workflow:n,namespace:c,attr:o}),[B,n,c,o]),V=(0,p.useMemo)(()=>({status:B,workflow:n,tag:i,attr:o}),[B,n,i,o]),ie=(0,p.useMemo)(()=>({status:B,workflow:n,tag:i,namespace:c}),[B,n,i,c]),H=(0,p.useMemo)(()=>({workflow:n,tag:i,namespace:c,attr:o}),[n,i,c,o]),ae=(0,p.useCallback)(e=>{a(t=>t.includes(e)?t:[...t,e])},[]),U=(0,p.useCallback)(e=>{l(t=>t.includes(e)?t:[...t,e])},[]),W=u.kind===`unknown`?`Bulk actions cannot be scoped to the app's own runs — runs with no package origin have no server-side filter. Retry or cancel them from their own run view.`:void 0,oe=(0,p.useMemo)(()=>[...new Set(M.filter(e=>tr(e,{runs:M,health:N}).status===`no-worker`).map(e=>e.workflow))],[M,N]),se=`${e}|${n.join(`|`)}|${i.join(`|`)}|${T.join(`,`)}|${c.join(`|`)}|${En(u)}`,G=[e===`all`?void 0:`status ${e}`,n.length>0?`workflow ${n.join(`, `)}`:void 0,i.length>0?`tag ${i.join(`, `)}`:void 0,c.length>0?`tenant ${c.join(`, `)}`:void 0,T.length>0?`attr ${T.join(` · `)}`:void 0,u.kind===`origin`?`origin ${wn(u.origin)}`:void 0].filter(e=>e!==void 0).join(` · `)||`no filter — every run`;return(0,m.jsxs)(fh,{children:[(0,m.jsx)(`div`,{className:`app-bg`}),(0,m.jsxs)(`div`,{className:`relative z-10 flex h-full flex-col`,children:[(0,m.jsx)(lM,{scope:H,filter:e,onFilter:t,onOpenRun:S,view:_,onView:C}),oe.length>0&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-amber-500/30 bg-amber-500/10 px-4 py-1.5 text-[11px] text-amber-200`,children:[(0,m.jsx)(`span`,{className:`s-no-worker inline-flex items-center gap-1.5`,children:(0,m.jsx)(`span`,{className:`dot s-no-worker`,"aria-hidden":!0})}),(0,m.jsxs)(`span`,{children:[`Runs waiting on handlers with no live worker:`,` `,(0,m.jsx)(`span`,{className:`mono text-amber-100`,children:oe.join(`, `)}),`. Start a worker to unblock.`]})]}),y===void 0?_===`schedules`?(0,m.jsx)(`main`,{className:`min-h-0 flex-1`,children:(0,m.jsx)(o_,{onOpenRun:S})}):(0,m.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]`,children:[(0,m.jsxs)(`aside`,{className:`flex min-h-0 flex-col border-r border-line`,children:[(0,m.jsxs)(`div`,{className:`border-b border-line p-2`,children:[(0,m.jsx)(zm,{field:`workflow`,scope:ne,glyph:`ƒ`,label:`filter by workflow`,placeholder:`filter by workflow…`,value:n,onChange:r,title:`Workflow handler names (WorkflowRun.workflow). Several match ANY of them.`}),(0,m.jsx)(`div`,{className:`mt-1.5`,children:(0,m.jsx)(zm,{field:`tag`,scope:re,glyph:`#`,label:`filter by tag`,placeholder:`filter by tag…`,value:i,onChange:a,title:`Tags carried by a run (WorkflowRun.tags). Several match ANY of them.`})}),(0,m.jsx)(`div`,{className:`mt-1.5 flex`,children:(0,m.jsx)(Hg,{tags:i,onChange:a})}),(0,m.jsx)(`div`,{className:`mt-1.5`,children:(0,m.jsx)(zm,{field:`namespace`,scope:V,glyph:`@`,label:`filter by tenant`,placeholder:`filter by tenant / namespace…`,value:c,onChange:l,title:`Tenant / worker-pool partition (WorkflowRun.namespace). None selected shows every tenant.`})}),(0,m.jsx)(Um,{value:o,onChange:s,scope:ie})]}),(0,m.jsx)(jh,{runs:M,value:u,onChange:d}),te&&ee.length>0&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line px-3 py-1.5`,children:[(0,m.jsxs)(`span`,{className:`mono text-[10px] text-zinc-500`,children:[ee.length,` `,e===`all`?``:e,` `,n.length>0&&`ƒ${n.join(`, `)}`,i.length>0&&` #${i.join(`, `)}`,c.length>0&&` @${c.join(`, `)}`,u.kind===`origin`&&` ⬡${wn(u.origin)}`,u.kind===`unknown`&&` ⬡app`,T.length>0&&` ⛃${T.length}`]}),(0,m.jsx)(Y,{variant:`brand`,size:`xs`,disabled:R.isPending||W!==void 0,title:W,onClick:()=>F(`retry`),className:`mono ml-auto rounded`,children:`retry all`}),(0,m.jsx)(Y,{variant:`danger`,size:`xs`,disabled:R.isPending||W!==void 0,title:W,onClick:()=>F(`cancel`),className:`mono rounded`,children:`cancel all`})]}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,m.jsx)(CM,{runs:ee,allRuns:M,health:N,loading:O,selected:f,onSelect:x,onSelectTag:ae,onSelectNamespace:U,onSelectOrigin:d,hasMore:A,loadingMore:j,onLoadMore:k,emptyNotice:Nn({anyFilter:te,origin:u,unknownCount:z})},se)})]}),(0,m.jsx)(`main`,{className:`min-h-0`,children:f?(0,m.jsx)(EM,{id:f,onOpenRun:S},f):(0,m.jsx)(`div`,{className:`grid h-full place-items-center text-center`,children:(0,m.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,m.jsx)(eM,{className:`h-10 w-10 text-zinc-800`}),(0,m.jsx)(`p`,{className:`mt-3 text-sm text-zinc-600`,children:`Select a run to see its timeline.`})]})})})]}):(0,m.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,m.jsx)($j,{workflow:y})})]}),(0,m.jsx)(k_,{open:P!==void 0,onOpenChange:e=>{e||F(void 0)},title:P===`cancel`?`Cancel all matching runs`:`Retry all matching runs`,subtitle:G,footer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Y,{onClick:()=>F(void 0),children:`Back`}),(0,m.jsx)(Y,{variant:P===`cancel`?`danger`:`brand`,disabled:R.isPending,onClick:()=>{P&&R.mutate(P),F(void 0)},children:P===`cancel`?`cancel all`:`retry all`})]}),children:(0,m.jsxs)(`p`,{className:`text-[12.5px] leading-relaxed text-zinc-400`,children:[`This `,P===`cancel`?`cancels`:`retries`,` `,(0,m.jsx)(`em`,{children:`every`}),` run matching the filter above on the server — including matches beyond the rows loaded on screen. The server acts on at most `,(0,m.jsx)(`span`,{className:`mono tnum text-zinc-300`,children:500}),` `,`matches per call.`]})}),R.error&&(0,m.jsxs)(`div`,{role:`alert`,className:`fixed bottom-4 left-1/2 z-50 -translate-x-1/2 rounded-md border border-rose-500/40 bg-rose-500/15 px-4 py-2 text-[12px] text-rose-200`,children:[`Bulk action failed:`,` `,R.error instanceof Error?R.error.message:String(R.error)]}),I&&(0,m.jsxs)(`output`,{className:`rise fixed bottom-4 right-4 z-50 flex max-w-sm items-start gap-3 rounded-lg border border-line bg-panel-2 px-4 py-3 text-left shadow-2xl`,children:[(0,m.jsxs)(`div`,{className:`min-w-0 flex-1 text-[12px]`,children:[(0,m.jsxs)(`div`,{className:`text-zinc-200`,children:[`Bulk `,I.action,`: `,(0,m.jsx)(`span`,{className:`mono tnum`,children:I.applied}),` of`,` `,(0,m.jsx)(`span`,{className:`mono tnum`,children:I.matched}),` matched`,` `,I.matched===1?`run`:`runs`,` `,I.action===`cancel`?`cancelled`:`retried`,`.`]}),I.matched>=500&&(0,m.jsxs)(`div`,{className:`mt-1 text-[11px] text-amber-300`,children:[`Matched the `,500,`-run server cap — only the first `,500,` were affected. Run the action again to continue.`]})]}),(0,m.jsx)(Y,{variant:`ghost`,size:`icon`,"aria-label":`dismiss`,onClick:()=>L(void 0),className:`h-5 w-5`,children:(0,m.jsx)(Fr,{width:12,height:12})})]})]})}var AM=new Re({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});(0,ct.createRoot)(document.getElementById(`root`)).render((0,m.jsx)(p.StrictMode,{children:(0,m.jsx)(_,{client:AM,children:(0,m.jsx)(kM,{})})}));
16
+ //# sourceMappingURL=index-BvIomPnC.js.map