@dudousxd/nestjs-durable-dashboard 0.56.0 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,66 +0,0 @@
1
- var qN=Object.defineProperty;var T0=e=>{throw TypeError(e)};var KN=(e,t,n)=>t in e?qN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ge=(e,t,n)=>KN(e,typeof t!="symbol"?t+"":t,n),Jd=(e,t,n)=>t.has(e)||T0("Cannot "+n);var D=(e,t,n)=>(Jd(e,t,"read from private field"),n?n.call(e):t.get(e)),oe=(e,t,n)=>t.has(e)?T0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),te=(e,t,n,r)=>(Jd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pe=(e,t,n)=>(Jd(e,t,"access private method"),n);var Fa=(e,t,n,r)=>({set _(s){te(e,t,s,n)},get _(){return D(e,t,r)}});function YN(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Rw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tw={exports:{}},Zu={},Pw={exports:{}},Ne={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var va=Symbol.for("react.element"),GN=Symbol.for("react.portal"),QN=Symbol.for("react.fragment"),XN=Symbol.for("react.strict_mode"),ZN=Symbol.for("react.profiler"),JN=Symbol.for("react.provider"),eR=Symbol.for("react.context"),tR=Symbol.for("react.forward_ref"),nR=Symbol.for("react.suspense"),rR=Symbol.for("react.memo"),sR=Symbol.for("react.lazy"),P0=Symbol.iterator;function oR(e){return e===null||typeof e!="object"?null:(e=P0&&e[P0]||e["@@iterator"],typeof e=="function"?e:null)}var Iw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},jw=Object.assign,_w={};function $i(e,t,n){this.props=e,this.context=t,this.refs=_w,this.updater=n||Iw}$i.prototype.isReactComponent={};$i.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): 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")};$i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ow(){}Ow.prototype=$i.prototype;function sm(e,t,n){this.props=e,this.context=t,this.refs=_w,this.updater=n||Iw}var om=sm.prototype=new Ow;om.constructor=sm;jw(om,$i.prototype);om.isPureReactComponent=!0;var I0=Array.isArray,Mw=Object.prototype.hasOwnProperty,im={current:null},Aw={key:!0,ref:!0,__self:!0,__source:!0};function zw(e,t,n){var r,s={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)Mw.call(t,r)&&!Aw.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var a=Array(l),c=0;c<l;c++)a[c]=arguments[c+2];s.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:va,type:e,key:o,ref:i,props:s,_owner:im.current}}function iR(e,t){return{$$typeof:va,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function lm(e){return typeof e=="object"&&e!==null&&e.$$typeof===va}function lR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var j0=/\/+/g;function ef(e,t){return typeof e=="object"&&e!==null&&e.key!=null?lR(""+e.key):t.toString(36)}function Tc(e,t,n,r,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case va:case GN:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+ef(i,0):r,I0(s)?(n="",e!=null&&(n=e.replace(j0,"$&/")+"/"),Tc(s,t,n,"",function(c){return c})):s!=null&&(lm(s)&&(s=iR(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(j0,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",I0(e))for(var l=0;l<e.length;l++){o=e[l];var a=r+ef(o,l);i+=Tc(o,t,n,a,s)}else if(a=oR(e),typeof a=="function")for(e=a.call(e),l=0;!(o=e.next()).done;)o=o.value,a=r+ef(o,l++),i+=Tc(o,t,n,a,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function La(e,t,n){if(e==null)return e;var r=[],s=0;return Tc(e,r,"","",function(o){return t.call(n,o,s++)}),r}function aR(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Vt={current:null},Pc={transition:null},cR={ReactCurrentDispatcher:Vt,ReactCurrentBatchConfig:Pc,ReactCurrentOwner:im};function Dw(){throw Error("act(...) is not supported in production builds of React.")}Ne.Children={map:La,forEach:function(e,t,n){La(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return La(e,function(){t++}),t},toArray:function(e){return La(e,function(t){return t})||[]},only:function(e){if(!lm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ne.Component=$i;Ne.Fragment=QN;Ne.Profiler=ZN;Ne.PureComponent=sm;Ne.StrictMode=XN;Ne.Suspense=nR;Ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cR;Ne.act=Dw;Ne.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=jw({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=im.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)Mw.call(t,a)&&!Aw.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:va,type:e.type,key:s,ref:o,props:r,_owner:i}};Ne.createContext=function(e){return e={$$typeof:eR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:JN,_context:e},e.Consumer=e};Ne.createElement=zw;Ne.createFactory=function(e){var t=zw.bind(null,e);return t.type=e,t};Ne.createRef=function(){return{current:null}};Ne.forwardRef=function(e){return{$$typeof:tR,render:e}};Ne.isValidElement=lm;Ne.lazy=function(e){return{$$typeof:sR,_payload:{_status:-1,_result:e},_init:aR}};Ne.memo=function(e,t){return{$$typeof:rR,type:e,compare:t===void 0?null:t}};Ne.startTransition=function(e){var t=Pc.transition;Pc.transition={};try{e()}finally{Pc.transition=t}};Ne.unstable_act=Dw;Ne.useCallback=function(e,t){return Vt.current.useCallback(e,t)};Ne.useContext=function(e){return Vt.current.useContext(e)};Ne.useDebugValue=function(){};Ne.useDeferredValue=function(e){return Vt.current.useDeferredValue(e)};Ne.useEffect=function(e,t){return Vt.current.useEffect(e,t)};Ne.useId=function(){return Vt.current.useId()};Ne.useImperativeHandle=function(e,t,n){return Vt.current.useImperativeHandle(e,t,n)};Ne.useInsertionEffect=function(e,t){return Vt.current.useInsertionEffect(e,t)};Ne.useLayoutEffect=function(e,t){return Vt.current.useLayoutEffect(e,t)};Ne.useMemo=function(e,t){return Vt.current.useMemo(e,t)};Ne.useReducer=function(e,t,n){return Vt.current.useReducer(e,t,n)};Ne.useRef=function(e){return Vt.current.useRef(e)};Ne.useState=function(e){return Vt.current.useState(e)};Ne.useSyncExternalStore=function(e,t,n){return Vt.current.useSyncExternalStore(e,t,n)};Ne.useTransition=function(){return Vt.current.useTransition()};Ne.version="18.3.1";Pw.exports=Ne;var S=Pw.exports;const $w=Rw(S),uR=YN({__proto__:null,default:$w},[S]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var dR=S,fR=Symbol.for("react.element"),hR=Symbol.for("react.fragment"),pR=Object.prototype.hasOwnProperty,mR=dR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,gR={key:!0,ref:!0,__self:!0,__source:!0};function Fw(e,t,n){var r,s={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)pR.call(t,r)&&!gR.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:fR,type:e,key:o,ref:i,props:s,_owner:mR.current}}Zu.Fragment=hR;Zu.jsx=Fw;Zu.jsxs=Fw;Tw.exports=Zu;var h=Tw.exports;const Lw=S.createContext(void 0),mo=e=>{const t=S.useContext(Lw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},A6=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(Lw.Provider,{value:e,children:t})),xR={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var Jr,rm,pw,yR=(pw=class{constructor(){oe(this,Jr,xR);oe(this,rm,!1)}setTimeoutProvider(e){te(this,Jr,e)}setTimeout(e,t){return D(this,Jr).setTimeout(e,t)}clearTimeout(e){D(this,Jr).clearTimeout(e)}setInterval(e,t){return D(this,Jr).setInterval(e,t)}clearInterval(e){D(this,Jr).clearInterval(e)}},Jr=new WeakMap,rm=new WeakMap,pw);const Ds=new yR;function vR(e){setTimeout(e,0)}const wR=typeof window>"u"||"Deno"in globalThis;function _t(){}function bR(e,t){return typeof e=="function"?e(t):e}function Hw(e){return typeof e=="number"&&e>=0&&e!==1/0}function Bw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function tt(e,t){return typeof e=="function"?e(t):e}function _0(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==am(i,t.options))return!1}else if(!xi(t.queryKey,i))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||o&&!o(t))}function O0(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ro(t.options.mutationKey)!==ro(o))return!1}else if(!xi(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function am(e,t){return((t==null?void 0:t.queryKeyHashFn)||ro)(e)}function ro(e){return JSON.stringify(e,(t,n)=>nh(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function xi(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)){for(let r=0;r<t.length;r++)if(!xi(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!xi(e[r],t[r]))return!1;return!0}return!1}const SR=Object.prototype.hasOwnProperty;function cm(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=M0(e)&&M0(t);if(!r&&!(nh(e)&&nh(t)))return t;const s=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),i=o.length,l=r?new Array(i):{};let a=0;for(let c=0;c<i;c++){const u=r?c:o[c],d=e[u],f=t[u];if(d===f){l[u]=d,(r?c<s:SR.call(e,u))&&a++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){l[u]=f;continue}const p=cm(d,f,n+1);l[u]=p,p===d&&a++}return s===i&&a===s?e:l}function gl(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function M0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nh(e){if(!A0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!A0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function A0(e){return Object.prototype.toString.call(e)==="[object Object]"}function ER(e){return new Promise(t=>{Ds.setTimeout(t,e)})}function rh(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?cm(e,t):t}function kR(e){return e}function CR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function NR(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const um=Symbol();function Vw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===um?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function dm(e,t){return typeof e=="function"?e(...t):!!e}function RR(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}let TR=()=>wR;const fm=()=>TR();var go=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(){}},Bs,es,ni,mw,PR=(mw=class extends go{constructor(){super();oe(this,Bs);oe(this,es);oe(this,ni);te(this,ni,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){D(this,es)||this.setEventListener(D(this,ni))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,es))==null||t.call(this),te(this,es,void 0))}setEventListener(t){var n;te(this,ni,t),(n=D(this,es))==null||n.call(this),te(this,es,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){D(this,Bs)!==t&&(te(this,Bs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof D(this,Bs)=="boolean"?D(this,Bs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Bs=new WeakMap,es=new WeakMap,ni=new WeakMap,mw);const hm=new PR,IR=vR;function jR(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=IR;const o=l=>{t?e.push(l):s(()=>{n(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||i()}return a},batchCalls:l=>(...a)=>{o(()=>{l(...a)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const rt=jR();var ri,ts,si,gw,_R=(gw=class extends go{constructor(){super();oe(this,ri,!0);oe(this,ts);oe(this,si);te(this,si,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){D(this,ts)||this.setEventListener(D(this,si))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,ts))==null||t.call(this),te(this,ts,void 0))}setEventListener(t){var n;te(this,si,t),(n=D(this,ts))==null||n.call(this),te(this,ts,t(this.setOnline.bind(this)))}setOnline(t){D(this,ri)!==t&&(te(this,ri,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return D(this,ri)}},ri=new WeakMap,ts=new WeakMap,si=new WeakMap,gw);const Gc=new _R;function OR(e){return Math.min(1e3*2**e,3e4)}function Ww(e){return(e??"online")==="online"?Gc.isOnline():!0}var sh=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Uw(e){let t=!1,n=0,r,s="pending",o,i;const l=new Promise((m,x)=>{o=m,i=x});l.catch(_t);const a=()=>s!=="pending",c=m=>{var x;if(!a()){const w=new sh(m);v(w),(x=e.onCancel)==null||x.call(e,w)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>hm.isFocused()&&(e.networkMode==="always"||Gc.isOnline())&&e.canRun(),p=()=>Ww(e.networkMode)&&e.canRun(),y=m=>{a()||(r==null||r(),s="resolved",o(m))},v=m=>{a()||(r==null||r(),s="rejected",i(m))},b=()=>new Promise(m=>{var x;r=w=>{(a()||f())&&m(w)},(x=e.onPause)==null||x.call(e)}).then(()=>{var m;r=void 0,a()||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(a())return;let m;const x=n===0?e.initialPromise:void 0;try{m=x??e.fn()}catch(w){m=Promise.reject(w)}Promise.resolve(m).then(y).catch(w=>{var P;if(a())return;const E=e.retry??(fm()?0:3),N=e.retryDelay??OR,k=typeof N=="function"?N(n,w):N,C=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,w);if(t||!C){v(w);return}n++,(P=e.onFail)==null||P.call(e,n,w),ER(k).then(()=>f()?void 0:b()).then(()=>{t?v(w):g()})})};return{promise:l,status:()=>s,cancel:c,continue:()=>(r==null||r(),l),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?g():b().then(g),l)}}var Vs,xw,qw=(xw=class{constructor(){oe(this,Vs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hw(this.gcTime)&&te(this,Vs,Ds.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fm()?1/0:3e5))}clearGcTimeout(){D(this,Vs)!==void 0&&(Ds.clearTimeout(D(this,Vs)),te(this,Vs,void 0))}},Vs=new WeakMap,xw);function MR(e){return{onFetch:(t,n)=>{var u,d,f,p,y;const r=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],i=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const c=async()=>{let v=!1;const b=x=>{RR(x,()=>t.signal,()=>v=!0)},g=Vw(t.options,t.fetchOptions),m=async(x,w,E)=>{if(v)return Promise.reject(t.signal.reason);if(w==null&&x.pages.length)return Promise.resolve(x);const k=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:w,direction:E?"backward":"forward",meta:t.options.meta};return b(z),z})(),C=await g(k),{maxPages:P}=t.options,I=E?NR:CR;return{pages:I(x.pages,C,P),pageParams:I(x.pageParams,w,P)}};if(s&&o.length){const x=s==="backward",w=x?Kw:oh,E={pages:o,pageParams:i};l=await m(E,w(r,E),x)}else{const x=e??o.length;do{const w=a===0?i[0]??r.initialPageParam:oh(r,l);if(a>0&&w==null)break;l=await m(l,w),a++}while(a<x)}return l};t.options.persister?t.fetchFn=()=>{var v,b;return(b=(v=t.options).persister)==null?void 0:b.call(v,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function oh(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Kw(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function AR(e,t){return t?oh(e,t)!=null:!1}function zR(e,t){return!t||!e.getPreviousPageParam?!1:Kw(e,t)!=null}var oi,Ws,ii,yn,Us,pt,ua,qs,Mn,hr,yw,DR=(yw=class extends qw{constructor(t){super();oe(this,Mn);oe(this,oi);oe(this,Ws);oe(this,ii);oe(this,yn);oe(this,Us);oe(this,pt);oe(this,ua);oe(this,qs);te(this,qs,!1),te(this,ua,t.defaultOptions),this.setOptions(t.options),this.observers=[],te(this,Us,t.client),te(this,yn,D(this,Us).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,te(this,Ws,D0(this.options)),this.state=t.state??D(this,Ws),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return D(this,oi)}get promise(){var t;return(t=D(this,pt))==null?void 0:t.promise}setOptions(t){if(this.options={...D(this,ua),...t},t!=null&&t._type&&te(this,oi,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=D0(this.options);n.data!==void 0&&(this.setState(z0(n.data,n.dataUpdatedAt)),te(this,Ws,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,yn).remove(this)}setData(t,n){const r=rh(this.state.data,t,this.options);return pe(this,Mn,hr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){pe(this,Mn,hr).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=D(this,pt))==null?void 0:r.promise;return(s=D(this,pt))==null||s.cancel(t),n?n.then(_t).catch(_t):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return D(this,Ws)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>tt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===um||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>tt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Bw(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=D(this,pt))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=D(this,pt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,yn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(D(this,pt)&&(D(this,qs)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?D(this,pt).cancel({revert:!0}):D(this,pt).cancelRetry()),this.scheduleGc()),D(this,yn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pe(this,Mn,hr).call(this,{type:"invalidate"})}async fetch(t,n){var c,u,d,f,p,y,v,b,g,m,x,w;if(this.state.fetchStatus!=="idle"&&((c=D(this,pt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(D(this,pt))return D(this,pt).continueRetry(),D(this,pt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(te(this,qs,!0),r.signal)})},o=()=>{const E=Vw(this.options,n),k=(()=>{const C={client:D(this,Us),queryKey:this.queryKey,meta:this.meta};return s(C),C})();return te(this,qs,!1),this.options.persister?this.options.persister(E,k,this):E(k)},l=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:D(this,Us),state:this.state,fetchFn:o};return s(E),E})();(u=D(this,oi)==="infinite"?MR(this.options.pages):this.options.behavior)==null||u.onFetch(l,this),te(this,ii,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&pe(this,Mn,hr).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const a=te(this,pt,Uw({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:E=>{E instanceof sh&&E.revert&&this.setState({...D(this,ii),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{pe(this,Mn,hr).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{pe(this,Mn,hr).call(this,{type:"pause"})},onContinue:()=>{pe(this,Mn,hr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const E=await a.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(y=(p=D(this,yn).config).onSuccess)==null||y.call(p,E,this),(b=(v=D(this,yn).config).onSettled)==null||b.call(v,E,this.state.error,this),E}catch(E){if(E instanceof sh){if(E.silent)return D(this,pt).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw pe(this,Mn,hr).call(this,{type:"error",error:E}),(m=(g=D(this,yn).config).onError)==null||m.call(g,E,this),(w=(x=D(this,yn).config).onSettled)==null||w.call(x,this.state.data,E,this),E}finally{D(this,pt)===a&&te(this,pt,void 0),this.scheduleGc()}}},oi=new WeakMap,Ws=new WeakMap,ii=new WeakMap,yn=new WeakMap,Us=new WeakMap,pt=new WeakMap,ua=new WeakMap,qs=new WeakMap,Mn=new WeakSet,hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Yw(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...z0(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return te(this,ii,t.manual?s:void 0),s;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),rt.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),D(this,yn).notify({query:this,type:"updated",action:t})})},yw);function Yw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ww(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function z0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function D0(e){const 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 Dt,Te,da,$t,Ks,li,yr,fa,ai,ci,Ys,Gs,ns,ui,Ae,ll,ih,lh,ah,ch,uh,dh,fh,hh,vw,Ju=(vw=class extends go{constructor(t,n){super();oe(this,Ae);oe(this,Dt);oe(this,Te);oe(this,da);oe(this,$t);oe(this,Ks);oe(this,li);oe(this,yr);oe(this,fa);oe(this,ai);oe(this,ci);oe(this,Ys);oe(this,Gs);oe(this,ns);oe(this,ui,new Set);this.options=n,te(this,Dt,t),te(this,yr,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(D(this,Te).addObserver(this),$0(D(this,Te),this.options)?pe(this,Ae,ll).call(this):this.updateResult(),pe(this,Ae,uh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ph(D(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ph(D(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pe(this,Ae,dh).call(this),pe(this,Ae,fh).call(this),D(this,Te).removeObserver(this)}setOptions(t){const n=this.options,r=D(this,Te);if(this.options=D(this,Dt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof tt(this.options.enabled,D(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pe(this,Ae,hh).call(this),D(this,Te).setOptions(this.options),n._defaulted&&!gl(this.options,n)&&D(this,Dt).getQueryCache().notify({type:"observerOptionsUpdated",query:D(this,Te),observer:this});const s=this.hasListeners();s&&F0(D(this,Te),r,this.options,n)&&pe(this,Ae,ll).call(this),this.updateResult(),s&&(D(this,Te)!==r||tt(this.options.enabled,D(this,Te))!==tt(n.enabled,D(this,Te))||tt(this.options.staleTime,D(this,Te))!==tt(n.staleTime,D(this,Te)))&&pe(this,Ae,lh).call(this);const o=pe(this,Ae,ah).call(this);s&&(D(this,Te)!==r||tt(this.options.enabled,D(this,Te))!==tt(n.enabled,D(this,Te))||o!==D(this,ns))&&pe(this,Ae,ch).call(this,o)}getOptimisticResult(t){const n=D(this,Dt).getQueryCache().build(D(this,Dt),t),r=this.createResult(n,t);return gl(this.getCurrentResult(),r)||(te(this,$t,r),te(this,li,this.options),te(this,Ks,D(this,Te).state)),r}getCurrentResult(){return D(this,$t)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(t){D(this,ui).add(t)}getCurrentQuery(){return D(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=D(this,Dt).defaultQueryOptions(t),r=D(this,Dt).getQueryCache().build(D(this,Dt),n);let s=()=>{},o;const i=new Promise(l=>{o=l,s=D(this,Dt).getQueryCache().subscribe(a=>{a.type==="updated"&&a.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const l=this.createResult(r,n);return o==null||o(l),l}).finally(()=>{s()}),i])}fetch(t){return pe(this,Ae,ll).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),D(this,$t)))}createResult(t,n){var N;const r=D(this,Te),s=this.options,o=D(this,$t),i=D(this,Ks),l=D(this,li),a=t!==r?t.state:D(this,da),{state:c}=t;let u={...c},d=!1,f;if(n._optimisticResults){const k=this.hasListeners(),C=!k&&$0(t,n),P=k&&F0(t,r,n,s);(C||P)&&(u={...u,...Yw(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:p,errorUpdatedAt:y,status:v}=u;f=u.data;let b=!1;if(n.placeholderData!==void 0&&f===void 0&&v==="pending"){let k;o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(k=o.data,b=!0):k=typeof n.placeholderData=="function"?n.placeholderData((N=D(this,ci))==null?void 0:N.state.data,D(this,ci)):n.placeholderData,k!==void 0&&(v="success",f=rh(o==null?void 0:o.data,k,n),d=!0)}if(n.select&&f!==void 0&&!b)if(o&&f===(i==null?void 0:i.data)&&n.select===D(this,fa))f=D(this,ai);else try{te(this,fa,n.select),f=n.select(f),f=rh(o==null?void 0:o.data,f,n),te(this,ai,f),te(this,yr,null)}catch(k){te(this,yr,k)}else f===void 0&&te(this,yr,null);D(this,yr)&&(p=D(this,yr),f=D(this,ai),y=Date.now(),v="error",d=!1);const g=u.fetchStatus==="fetching",m=v==="pending",x=v==="error",w=m&&g,E=f!==void 0;return{status:v,fetchStatus:u.fetchStatus,isPending:m,isSuccess:v==="success",isError:x,isInitialLoading:w,isLoading:w,data:f,dataUpdatedAt:u.dataUpdatedAt,error:p,errorUpdatedAt:y,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:g,isRefetching:g&&!m,isLoadingError:x&&!E,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:x&&E,isStale:pm(t,n),refetch:this.refetch,isEnabled:tt(n.enabled,t)!==!1}}updateResult(){const t=D(this,$t),n=this.createResult(D(this,Te),this.options);if(te(this,Ks,D(this,Te).state),te(this,li,this.options),D(this,Ks).data!==void 0&&te(this,ci,D(this,Te)),gl(n,t))return;te(this,$t,n);const s=(()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!D(this,ui).size)return!0;const l=new Set(i??D(this,ui));return this.options.throwOnError&&l.add("error"),Object.keys(D(this,$t)).some(a=>{const c=a;return D(this,$t)[c]!==t[c]&&l.has(c)})})();rt.batch(()=>{s&&this.listeners.forEach(o=>{o(D(this,$t))}),D(this,Dt).getQueryCache().notify({query:D(this,Te),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pe(this,Ae,uh).call(this)}},Dt=new WeakMap,Te=new WeakMap,da=new WeakMap,$t=new WeakMap,Ks=new WeakMap,li=new WeakMap,yr=new WeakMap,fa=new WeakMap,ai=new WeakMap,ci=new WeakMap,Ys=new WeakMap,Gs=new WeakMap,ns=new WeakMap,ui=new WeakMap,Ae=new WeakSet,ll=function(t){pe(this,Ae,hh).call(this);let n=D(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(_t)),n},ih=function(t){return!fm()&&tt(this.options.enabled,D(this,Te))!==!1&&Hw(t)},lh=function(){pe(this,Ae,dh).call(this);const t=tt(this.options.staleTime,D(this,Te));if(D(this,$t).isStale||!pe(this,Ae,ih).call(this,t))return;const n=Bw(D(this,$t).dataUpdatedAt,t)+1;te(this,Ys,Ds.setTimeout(()=>{D(this,$t).isStale||this.updateResult()},n))},ah=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(D(this,Te)):this.options.refetchInterval)??!1},ch=function(t){pe(this,Ae,fh).call(this),te(this,ns,t),!(D(this,ns)===0||!pe(this,Ae,ih).call(this,D(this,ns)))&&te(this,Gs,Ds.setInterval(()=>{(this.options.refetchIntervalInBackground||hm.isFocused())&&pe(this,Ae,ll).call(this)},D(this,ns)))},uh=function(){pe(this,Ae,lh).call(this),pe(this,Ae,ch).call(this,pe(this,Ae,ah).call(this))},dh=function(){D(this,Ys)!==void 0&&(Ds.clearTimeout(D(this,Ys)),te(this,Ys,void 0))},fh=function(){D(this,Gs)!==void 0&&(Ds.clearInterval(D(this,Gs)),te(this,Gs,void 0))},hh=function(){const t=D(this,Dt).getQueryCache().build(D(this,Dt),this.options);if(t===D(this,Te))return;const n=D(this,Te);te(this,Te,t),te(this,da,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},vw);function $R(e,t){return tt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&tt(t.retryOnMount,e)===!1)}function $0(e,t){return $R(e,t)||e.state.data!==void 0&&ph(e,t,t.refetchOnMount)}function ph(e,t,n){if(tt(t.enabled,e)!==!1&&tt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&pm(e,t)}return!1}function F0(e,t,n,r){return(e!==t||tt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&pm(e,n)}function pm(e,t){return tt(t.enabled,e)!==!1&&e.isStaleByTime(tt(t.staleTime,e))}var FR=class extends Ju{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){var p,y;const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:o,isError:i,isRefetchError:l}=r,a=(y=(p=n.fetchMeta)==null?void 0:p.fetchMore)==null?void 0:y.direction,c=i&&a==="forward",u=s&&a==="forward",d=i&&a==="backward",f=s&&a==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:AR(t,n.data),hasPreviousPage:zR(t,n.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:l&&!c&&!d,isRefetching:o&&!u&&!f}}},ha,Zn,It,Qs,Jn,qr,ww,LR=(ww=class extends qw{constructor(t){super();oe(this,Jn);oe(this,ha);oe(this,Zn);oe(this,It);oe(this,Qs);te(this,ha,t.client),this.mutationId=t.mutationId,te(this,It,t.mutationCache),te(this,Zn,[]),this.state=t.state||Gw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,Zn).includes(t)||(D(this,Zn).push(t),this.clearGcTimeout(),D(this,It).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){te(this,Zn,D(this,Zn).filter(n=>n!==t)),this.scheduleGc(),D(this,It).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,Zn).length||(this.state.status==="pending"?this.scheduleGc():D(this,It).remove(this))}continue(){var t;return((t=D(this,Qs))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var l,a,c,u,d,f,p,y,v,b,g,m,x,w,E,N,k,C;const n=()=>{pe(this,Jn,qr).call(this,{type:"continue"})},r={client:D(this,ha),meta:this.options.meta,mutationKey:this.options.mutationKey},s=te(this,Qs,Uw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(P,I)=>{pe(this,Jn,qr).call(this,{type:"failed",failureCount:P,error:I})},onPause:()=>{pe(this,Jn,qr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,It).canRun(this)})),o=this.state.status==="pending",i=!s.canStart();try{if(o)n();else{pe(this,Jn,qr).call(this,{type:"pending",variables:t,isPaused:i}),D(this,It).config.onMutate&&await D(this,It).config.onMutate(t,this,r);const I=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,r));I!==this.state.context&&pe(this,Jn,qr).call(this,{type:"pending",context:I,variables:t,isPaused:i})}const P=await s.start();return await((u=(c=D(this,It).config).onSuccess)==null?void 0:u.call(c,P,t,this.state.context,this,r)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,P,t,this.state.context,r)),await((y=(p=D(this,It).config).onSettled)==null?void 0:y.call(p,P,null,this.state.variables,this.state.context,this,r)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,P,null,t,this.state.context,r)),pe(this,Jn,qr).call(this,{type:"success",data:P}),P}catch(P){try{await((m=(g=D(this,It).config).onError)==null?void 0:m.call(g,P,t,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((w=(x=this.options).onError)==null?void 0:w.call(x,P,t,this.state.context,r))}catch(I){Promise.reject(I)}try{await((N=(E=D(this,It).config).onSettled)==null?void 0:N.call(E,void 0,P,this.state.variables,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((C=(k=this.options).onSettled)==null?void 0:C.call(k,void 0,P,t,this.state.context,r))}catch(I){Promise.reject(I)}throw pe(this,Jn,qr).call(this,{type:"error",error:P}),P}finally{D(this,Qs)===s&&te(this,Qs,void 0),D(this,It).runNext(this)}}},ha=new WeakMap,Zn=new WeakMap,It=new WeakMap,Qs=new WeakMap,Jn=new WeakSet,qr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),rt.batch(()=>{D(this,Zn).forEach(r=>{r.onMutationUpdate(t)}),D(this,It).notify({mutation:this,type:"updated",action:t})})},ww);function Gw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vr,An,pa,bw,HR=(bw=class extends go{constructor(t={}){super();oe(this,vr);oe(this,An);oe(this,pa);this.config=t,te(this,vr,new Set),te(this,An,new Map),te(this,pa,0)}build(t,n,r){const s=new LR({client:t,mutationCache:this,mutationId:++Fa(this,pa)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){D(this,vr).add(t);const n=Ha(t);if(typeof n=="string"){const r=D(this,An).get(n);r?r.push(t):D(this,An).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(D(this,vr).delete(t)){const n=Ha(t);if(typeof n=="string"){const r=D(this,An).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&D(this,An).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=Ha(t);if(typeof n=="string"){const s=(r=D(this,An).get(n))==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r,s;const n=Ha(t);return typeof n=="string"?((s=(r=D(this,An).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){rt.batch(()=>{D(this,vr).forEach(t=>{this.notify({type:"removed",mutation:t})}),D(this,vr).clear(),D(this,An).clear()})}getAll(){return Array.from(D(this,vr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>O0(n,r))}findAll(t={}){return this.getAll().filter(n=>O0(t,n))}notify(t){rt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return rt.batch(()=>Promise.all(t.map(n=>n.continue().catch(_t))))}},vr=new WeakMap,An=new WeakMap,pa=new WeakMap,bw);function Ha(e){var t;return(t=e.options.scope)==null?void 0:t.id}var wr,rs,jt,br,rr,al,mh,Sw,BR=(Sw=class extends go{constructor(n,r){super();oe(this,rr);oe(this,wr);oe(this,rs);oe(this,jt);oe(this,br);te(this,wr,n),this.setOptions(r),this.bindMethods(),pe(this,rr,al).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=D(this,wr).defaultMutationOptions(n),gl(this.options,r)||D(this,wr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:D(this,jt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ro(r.mutationKey)!==ro(this.options.mutationKey)?this.reset():((s=D(this,jt))==null?void 0:s.state.status)==="pending"&&D(this,jt).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&D(this,jt)&&(D(this,jt).addObserver(this),pe(this,rr,al).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=D(this,jt))==null||n.removeObserver(this)}onMutationUpdate(n){pe(this,rr,al).call(this),pe(this,rr,mh).call(this,n)}getCurrentResult(){return D(this,rs)}reset(){var n;(n=D(this,jt))==null||n.removeObserver(this),te(this,jt,void 0),pe(this,rr,al).call(this),pe(this,rr,mh).call(this)}mutate(n,r){var s;return te(this,br,r),(s=D(this,jt))==null||s.removeObserver(this),te(this,jt,D(this,wr).getMutationCache().build(D(this,wr),this.options)),D(this,jt).addObserver(this),D(this,jt).execute(n)}},wr=new WeakMap,rs=new WeakMap,jt=new WeakMap,br=new WeakMap,rr=new WeakSet,al=function(){var r;const n=((r=D(this,jt))==null?void 0:r.state)??Gw();te(this,rs,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},mh=function(n){rt.batch(()=>{var r,s,o,i,l,a,c,u;if(D(this,br)&&this.hasListeners()){const d=D(this,rs).variables,f=D(this,rs).context,p={client:D(this,wr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=D(this,br)).onSuccess)==null||s.call(r,n.data,d,f,p)}catch(y){Promise.reject(y)}try{(i=(o=D(this,br)).onSettled)==null||i.call(o,n.data,null,d,f,p)}catch(y){Promise.reject(y)}}else if((n==null?void 0:n.type)==="error"){try{(a=(l=D(this,br)).onError)==null||a.call(l,n.error,d,f,p)}catch(y){Promise.reject(y)}try{(u=(c=D(this,br)).onSettled)==null||u.call(c,void 0,n.error,d,f,p)}catch(y){Promise.reject(y)}}}this.listeners.forEach(d=>{d(D(this,rs))})})},Sw);function L0(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}var di,Ft,fi,Xs,sn,Zs,ma,ga,xa,ya,xt,gh,xh,Qw,yh,vh,wh,Ew,VR=(Ew=class extends go{constructor(t,n,r){super();oe(this,xt);oe(this,di);oe(this,Ft);oe(this,fi);oe(this,Xs);oe(this,sn);oe(this,Zs);oe(this,ma);oe(this,ga);oe(this,xa);oe(this,ya,[]);te(this,di,t),te(this,Xs,r),te(this,fi,[]),te(this,sn,[]),te(this,Ft,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&D(this,sn).forEach(t=>{t.subscribe(n=>{pe(this,xt,vh).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,D(this,sn).forEach(t=>{t.destroy()})}setQueries(t,n){te(this,fi,t),te(this,Xs,n),rt.batch(()=>{const r=D(this,sn),s=pe(this,xt,yh).call(this,D(this,fi));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const o=s.map(d=>d.observer),i=o.map(d=>d.getCurrentResult()),l=r.length!==o.length,a=o.some((d,f)=>d!==r[f]),c=l||a,u=c?!0:i.some((d,f)=>{const p=D(this,Ft)[f];return!p||!gl(d,p)});!c&&!u||(c&&(te(this,ya,s),te(this,sn,o)),te(this,Ft,i),this.hasListeners()&&(c&&(L0(r,o).forEach(d=>{d.destroy()}),L0(o,r).forEach(d=>{d.subscribe(f=>{pe(this,xt,vh).call(this,d,f)})})),pe(this,xt,wh).call(this)))})}getCurrentResult(){return D(this,Ft)}getQueries(){return D(this,sn).map(t=>t.getCurrentQuery())}getObservers(){return D(this,sn)}getOptimisticResult(t,n){const r=pe(this,xt,yh).call(this,t),s=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions)),o=r.map(i=>i.defaultedQueryOptions.queryHash);return[s,i=>pe(this,xt,xh).call(this,i??s,n,o),()=>pe(this,xt,gh).call(this,s,r)]}},di=new WeakMap,Ft=new WeakMap,fi=new WeakMap,Xs=new WeakMap,sn=new WeakMap,Zs=new WeakMap,ma=new WeakMap,ga=new WeakMap,xa=new WeakMap,ya=new WeakMap,xt=new WeakSet,gh=function(t,n){const r=new Set;return n.map((s,o)=>{const i=t[o];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,l=>{r.has(l)||(r.add(l),n.forEach(a=>{a.observer.trackProp(l)}))})})},xh=function(t,n,r){if(n){const s=D(this,xa),o=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((i,l)=>i!==s[l]));return(D(this,Ft)!==D(this,ga)||o||n!==D(this,ma))&&(te(this,ma,n),te(this,ga,D(this,Ft)),r!==void 0&&te(this,xa,r),te(this,Zs,cm(D(this,Zs),n(t)))),D(this,Zs)}return t},Qw=function(){var t;return!((t=D(this,Xs))!=null&&t.combine)||D(this,sn).some((n,r)=>{var s;return n.options.suspense&&((s=D(this,Ft)[r])==null?void 0:s.data)===void 0})},yh=function(t){const n=new Map;D(this,sn).forEach(s=>{const o=s.options.queryHash;if(!o)return;const i=n.get(o);i?i.push(s):n.set(o,[s])});const r=[];return t.forEach(s=>{var l;const o=D(this,di).defaultQueryOptions(s),i=((l=n.get(o.queryHash))==null?void 0:l.shift())??new Ju(D(this,di),o);r.push({defaultedQueryOptions:o,observer:i})}),r},vh=function(t,n){const r=D(this,sn).indexOf(t);r!==-1&&(te(this,Ft,D(this,Ft).slice()),D(this,Ft)[r]=n,pe(this,xt,wh).call(this))},wh=function(){var t;if(this.hasListeners()){const n=pe(this,xt,Qw).call(this),r=D(this,Zs),s=n?r:pe(this,xt,xh).call(this,pe(this,xt,gh).call(this,D(this,Ft),D(this,ya)),(t=D(this,Xs))==null?void 0:t.combine);(n||r!==s)&&rt.batch(()=>{this.listeners.forEach(o=>{o(D(this,Ft))})})}},Ew),er,kw,WR=(kw=class extends go{constructor(t={}){super();oe(this,er);this.config=t,te(this,er,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??am(s,n);let i=this.get(o);return i||(i=new DR({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){D(this,er).has(t.queryHash)||(D(this,er).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=D(this,er).get(t.queryHash);n&&(t.destroy(),n===t&&D(this,er).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){rt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,er).get(t)}getAll(){return[...D(this,er).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>_0(t,r)):n}notify(t){rt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){rt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){rt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},er=new WeakMap,kw),Ge,ss,os,hi,pi,is,mi,gi,Cw,D6=(Cw=class{constructor(e={}){oe(this,Ge);oe(this,ss);oe(this,os);oe(this,hi);oe(this,pi);oe(this,is);oe(this,mi);oe(this,gi);te(this,Ge,e.queryCache||new WR),te(this,ss,e.mutationCache||new HR),te(this,os,e.defaultOptions||{}),te(this,hi,new Map),te(this,pi,new Map),te(this,is,0)}mount(){Fa(this,is)._++,D(this,is)===1&&(te(this,mi,hm.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,Ge).onFocus())})),te(this,gi,Gc.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,Ge).onOnline())})))}unmount(){var e,t;Fa(this,is)._--,D(this,is)===0&&((e=D(this,mi))==null||e.call(this),te(this,mi,void 0),(t=D(this,gi))==null||t.call(this),te(this,gi,void 0))}isFetching(e){return D(this,Ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,ss).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,Ge).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=D(this,Ge).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(tt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return D(this,Ge).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var i;const r=this.defaultQueryOptions({queryKey:e}),s=(i=D(this,Ge).get(r.queryHash))==null?void 0:i.state.data,o=bR(t,s);if(o!==void 0)return D(this,Ge).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return rt.batch(()=>D(this,Ge).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,Ge).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=D(this,Ge);rt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=D(this,Ge);return rt.batch(()=>{const r=n.findAll(e),s=new Set(r);return r.forEach(o=>{o.reset()}),this.refetchQueries({type:"active",predicate:o=>s.has(o)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=rt.batch(()=>D(this,Ge).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(_t).catch(_t)}invalidateQueries(e,t={}){return rt.batch(()=>(D(this,Ge).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=rt.batch(()=>D(this,Ge).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(_t)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(_t)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,Ge).build(this,t),r=n.isStaleByTime(tt(t.staleTime,n))?await n.fetch(t):n.state.data,s=t.select;return s?s(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,Ge).build(this,t);return n.isStaleByTime(tt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(_t).catch(_t)}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(_t).catch(_t)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Gc.isOnline()?D(this,ss).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,Ge)}getMutationCache(){return D(this,ss)}getDefaultOptions(){return D(this,os)}setDefaultOptions(e){te(this,os,e)}setQueryDefaults(e,t){D(this,hi).set(ro(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,hi).values()],n={};return t.forEach(r=>{xi(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){D(this,pi).set(ro(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,pi).values()],n={};return t.forEach(r=>{xi(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,os).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=am(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===um&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,os).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){D(this,Ge).clear(),D(this,ss).clear()}},Ge=new WeakMap,ss=new WeakMap,os=new WeakMap,hi=new WeakMap,pi=new WeakMap,is=new WeakMap,mi=new WeakMap,gi=new WeakMap,Cw);const Xw=S.createContext(!1),Zw=()=>S.useContext(Xw);Xw.Provider;function UR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const qR=S.createContext(UR()),Jw=()=>S.useContext(qR),eb=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?dm(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},tb=e=>{S.useEffect(()=>{e.clearReset()},[e])},nb=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||dm(n,[e.error,r])),rb=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},bh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,sb=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function mm({queries:e,...t},n){const r=mo(),s=Zw(),o=Jw(),i=t.subscribed!==!1,l=S.useMemo(()=>e.map(v=>{const b=r.defaultQueryOptions(v);return b._optimisticResults=s?"isRestoring":i?"optimistic":void 0,b}),[e,r,s,i]);l.forEach(v=>{rb(v);const b=r.getQueryCache().get(v.queryHash);eb(v,o,b)}),tb(o);const[a]=S.useState(()=>new VR(r,l,t)),[c,u,d]=a.getOptimisticResult(l,t.combine),f=!s&&i;S.useSyncExternalStore(S.useCallback(v=>f?a.subscribe(rt.batchCalls(v)):_t,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),S.useEffect(()=>{a.setQueries(l,t)},[l,t,a]);const p=c.some((v,b)=>bh(l[b],v))?c.flatMap((v,b)=>{const g=l[b];if(g&&bh(g,v)){const m=new Ju(r,g);return sb(g,m,o)}return[]}):[];if(p.length>0)throw Promise.all(p);const y=c.find((v,b)=>{const g=l[b];return g&&nb({result:v,errorResetBoundary:o,throwOnError:g.throwOnError,query:r.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(y)throw y.error;return u(d())}function ob(e,t,n){const r=Zw(),s=Jw(),o=mo(),i=o.defaultQueryOptions(e),l=o.getQueryCache().get(i.queryHash),a=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":a?"optimistic":void 0,rb(i),eb(i,s,l),tb(s);const[c]=S.useState(()=>new t(o,i)),u=c.getOptimisticResult(i),d=!r&&a;if(S.useSyncExternalStore(S.useCallback(f=>{const p=d?c.subscribe(rt.batchCalls(f)):_t;return c.updateResult(),p},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),S.useEffect(()=>{c.setOptions(i)},[i,c]),bh(i,u))throw sb(i,c,s);if(nb({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw u.error;return i.notifyOnChangeProps?u:c.trackResult(u)}function Xt(e,t){return ob(e,Ju)}function mr(e,t){const n=mo(),[r]=S.useState(()=>new BR(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);const s=S.useSyncExternalStore(S.useCallback(i=>r.subscribe(rt.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=S.useCallback((...i)=>{r.mutate(i[0],i[1]).catch(_t)},[r]);if(s.error&&dm(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}function KR(e,t){return ob(e,FR)}var ib={exports:{}},pn={},lb={exports:{}},ab={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(T,M){var O=T.length;T.push(M);e:for(;0<O;){var U=O-1>>>1,L=T[U];if(0<s(L,M))T[U]=M,T[O]=L,O=U;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var M=T[0],O=T.pop();if(O!==M){T[0]=O;e:for(var U=0,L=T.length,K=L>>>1;U<K;){var W=2*(U+1)-1,q=T[W],H=W+1,G=T[H];if(0>s(q,O))H<L&&0>s(G,q)?(T[U]=G,T[H]=O,U=H):(T[U]=q,T[W]=O,U=W);else if(H<L&&0>s(G,O))T[U]=G,T[H]=O,U=H;else break e}}return M}function s(T,M){var O=T.sortIndex-M.sortIndex;return O!==0?O:T.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var a=[],c=[],u=1,d=null,f=3,p=!1,y=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(T){for(var M=n(c);M!==null;){if(M.callback===null)r(c);else if(M.startTime<=T)r(c),M.sortIndex=M.expirationTime,t(a,M);else break;M=n(c)}}function w(T){if(v=!1,x(T),!y)if(n(a)!==null)y=!0,_(E);else{var M=n(c);M!==null&&F(w,M.startTime-T)}}function E(T,M){y=!1,v&&(v=!1,g(C),C=-1),p=!0;var O=f;try{for(x(M),d=n(a);d!==null&&(!(d.expirationTime>M)||T&&!z());){var U=d.callback;if(typeof U=="function"){d.callback=null,f=d.priorityLevel;var L=U(d.expirationTime<=M);M=e.unstable_now(),typeof L=="function"?d.callback=L:d===n(a)&&r(a),x(M)}else r(a);d=n(a)}if(d!==null)var K=!0;else{var W=n(c);W!==null&&F(w,W.startTime-M),K=!1}return K}finally{d=null,f=O,p=!1}}var N=!1,k=null,C=-1,P=5,I=-1;function z(){return!(e.unstable_now()-I<P)}function $(){if(k!==null){var T=e.unstable_now();I=T;var M=!0;try{M=k(!0,T)}finally{M?A():(N=!1,k=null)}}else N=!1}var A;if(typeof m=="function")A=function(){m($)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,j=R.port2;R.port1.onmessage=$,A=function(){j.postMessage(null)}}else A=function(){b($,0)};function _(T){k=T,N||(N=!0,A())}function F(T,M){C=b(function(){T(e.unstable_now())},M)}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(T){T.callback=null},e.unstable_continueExecution=function(){y||p||(y=!0,_(E))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(T){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var O=f;f=M;try{return T()}finally{f=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,M){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var O=f;f=T;try{return M()}finally{f=O}},e.unstable_scheduleCallback=function(T,M,O){var U=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?U+O:U):O=U,T){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=O+L,T={id:u++,callback:M,priorityLevel:T,startTime:O,expirationTime:L,sortIndex:-1},O>U?(T.sortIndex=O,t(c,T),n(a)===null&&T===n(c)&&(v?(g(C),C=-1):v=!0,F(w,O-U))):(T.sortIndex=L,t(a,T),y||p||(y=!0,_(E))),T},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(T){var M=f;return function(){var O=f;f=M;try{return T.apply(this,arguments)}finally{f=O}}}})(ab);lb.exports=ab;var YR=lb.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var GR=S,un=YR;function J(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var cb=new Set,jl={};function xo(e,t){yi(e,t),yi(e+"Capture",t)}function yi(e,t){for(jl[e]=t,e=0;e<t.length;e++)cb.add(t[e])}var Ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sh=Object.prototype.hasOwnProperty,QR=/^[: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]*$/,H0={},B0={};function XR(e){return Sh.call(B0,e)?!0:Sh.call(H0,e)?!1:QR.test(e)?B0[e]=!0:(H0[e]=!0,!1)}function ZR(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function JR(e,t,n,r){if(t===null||typeof t>"u"||ZR(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Wt(e,t,n,r,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var Ct={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ct[e]=new Wt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ct[t]=new Wt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ct[e]=new Wt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ct[e]=new Wt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ct[e]=new Wt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ct[e]=new Wt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ct[e]=new Wt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ct[e]=new Wt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ct[e]=new Wt(e,5,!1,e.toLowerCase(),null,!1,!1)});var gm=/[\-:]([a-z])/g;function xm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(gm,xm);Ct[t]=new Wt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(gm,xm);Ct[t]=new Wt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(gm,xm);Ct[t]=new Wt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ct[e]=new Wt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ct.xlinkHref=new Wt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ct[e]=new Wt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ym(e,t,n,r){var s=Ct.hasOwnProperty(t)?Ct[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(JR(t,n,s,r)&&(n=null),r||s===null?XR(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Dr=GR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ba=Symbol.for("react.element"),jo=Symbol.for("react.portal"),_o=Symbol.for("react.fragment"),vm=Symbol.for("react.strict_mode"),Eh=Symbol.for("react.profiler"),ub=Symbol.for("react.provider"),db=Symbol.for("react.context"),wm=Symbol.for("react.forward_ref"),kh=Symbol.for("react.suspense"),Ch=Symbol.for("react.suspense_list"),bm=Symbol.for("react.memo"),Kr=Symbol.for("react.lazy"),fb=Symbol.for("react.offscreen"),V0=Symbol.iterator;function Ki(e){return e===null||typeof e!="object"?null:(e=V0&&e[V0]||e["@@iterator"],typeof e=="function"?e:null)}var Je=Object.assign,tf;function cl(e){if(tf===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);tf=t&&t[1]||""}return`
34
- `+tf+e}var nf=!1;function rf(e,t){if(!e||nf)return"";nf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
35
- `),o=r.stack.split(`
36
- `),i=s.length-1,l=o.length-1;1<=i&&0<=l&&s[i]!==o[l];)l--;for(;1<=i&&0<=l;i--,l--)if(s[i]!==o[l]){if(i!==1||l!==1)do if(i--,l--,0>l||s[i]!==o[l]){var a=`
37
- `+s[i].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=i&&0<=l);break}}}finally{nf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?cl(e):""}function eT(e){switch(e.tag){case 5:return cl(e.type);case 16:return cl("Lazy");case 13:return cl("Suspense");case 19:return cl("SuspenseList");case 0:case 2:case 15:return e=rf(e.type,!1),e;case 11:return e=rf(e.type.render,!1),e;case 1:return e=rf(e.type,!0),e;default:return""}}function Nh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _o:return"Fragment";case jo:return"Portal";case Eh:return"Profiler";case vm:return"StrictMode";case kh:return"Suspense";case Ch:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case db:return(e.displayName||"Context")+".Consumer";case ub:return(e._context.displayName||"Context")+".Provider";case wm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case bm:return t=e.displayName||null,t!==null?t:Nh(e.type)||"Memo";case Kr:t=e._payload,e=e._init;try{return Nh(e(t))}catch{}}return null}function tT(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Nh(t);case 8:return t===vm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ws(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function hb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function nT(e){var t=hb(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Va(e){e._valueTracker||(e._valueTracker=nT(e))}function pb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=hb(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Qc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Rh(e,t){var n=t.checked;return Je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function W0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ws(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function mb(e,t){t=t.checked,t!=null&&ym(e,"checked",t,!1)}function Th(e,t){mb(e,t);var n=ws(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ph(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ph(e,t.type,ws(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function U0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ph(e,t,n){(t!=="number"||Qc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ul=Array.isArray;function qo(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ws(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Ih(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return Je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function q0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(J(92));if(ul(n)){if(1<n.length)throw Error(J(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ws(n)}}function gb(e,t){var n=ws(t.value),r=ws(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function K0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function xb(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?xb(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Wa,yb=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Wa=Wa||document.createElement("div"),Wa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Wa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _l(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var xl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rT=["Webkit","ms","Moz","O"];Object.keys(xl).forEach(function(e){rT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xl[t]=xl[e]})});function vb(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||xl.hasOwnProperty(e)&&xl[e]?(""+t).trim():t+"px"}function wb(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=vb(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var sT=Je({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _h(e,t){if(t){if(sT[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function Oh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Mh=null;function Sm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ah=null,Ko=null,Yo=null;function Y0(e){if(e=Sa(e)){if(typeof Ah!="function")throw Error(J(280));var t=e.stateNode;t&&(t=sd(t),Ah(e.stateNode,e.type,t))}}function bb(e){Ko?Yo?Yo.push(e):Yo=[e]:Ko=e}function Sb(){if(Ko){var e=Ko,t=Yo;if(Yo=Ko=null,Y0(e),t)for(e=0;e<t.length;e++)Y0(t[e])}}function Eb(e,t){return e(t)}function kb(){}var sf=!1;function Cb(e,t,n){if(sf)return e(t,n);sf=!0;try{return Eb(e,t,n)}finally{sf=!1,(Ko!==null||Yo!==null)&&(kb(),Sb())}}function Ol(e,t){var n=e.stateNode;if(n===null)return null;var r=sd(n);if(r===null)return null;n=r[t];e: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 e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(J(231,t,typeof n));return n}var zh=!1;if(Ir)try{var Yi={};Object.defineProperty(Yi,"passive",{get:function(){zh=!0}}),window.addEventListener("test",Yi,Yi),window.removeEventListener("test",Yi,Yi)}catch{zh=!1}function oT(e,t,n,r,s,o,i,l,a){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var yl=!1,Xc=null,Zc=!1,Dh=null,iT={onError:function(e){yl=!0,Xc=e}};function lT(e,t,n,r,s,o,i,l,a){yl=!1,Xc=null,oT.apply(iT,arguments)}function aT(e,t,n,r,s,o,i,l,a){if(lT.apply(this,arguments),yl){if(yl){var c=Xc;yl=!1,Xc=null}else throw Error(J(198));Zc||(Zc=!0,Dh=c)}}function yo(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Nb(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 G0(e){if(yo(e)!==e)throw Error(J(188))}function cT(e){var t=e.alternate;if(!t){if(t=yo(e),t===null)throw Error(J(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return G0(s),e;if(o===r)return G0(s),t;o=o.sibling}throw Error(J(188))}if(n.return!==r.return)n=s,r=o;else{for(var i=!1,l=s.child;l;){if(l===n){i=!0,n=s,r=o;break}if(l===r){i=!0,r=s,n=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===n){i=!0,n=o,r=s;break}if(l===r){i=!0,r=o,n=s;break}l=l.sibling}if(!i)throw Error(J(189))}}if(n.alternate!==r)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?e:t}function Rb(e){return e=cT(e),e!==null?Tb(e):null}function Tb(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Tb(e);if(t!==null)return t;e=e.sibling}return null}var Pb=un.unstable_scheduleCallback,Q0=un.unstable_cancelCallback,uT=un.unstable_shouldYield,dT=un.unstable_requestPaint,ct=un.unstable_now,fT=un.unstable_getCurrentPriorityLevel,Em=un.unstable_ImmediatePriority,Ib=un.unstable_UserBlockingPriority,Jc=un.unstable_NormalPriority,hT=un.unstable_LowPriority,jb=un.unstable_IdlePriority,ed=null,sr=null;function pT(e){if(sr&&typeof sr.onCommitFiberRoot=="function")try{sr.onCommitFiberRoot(ed,e,void 0,(e.current.flags&128)===128)}catch{}}var Hn=Math.clz32?Math.clz32:xT,mT=Math.log,gT=Math.LN2;function xT(e){return e>>>=0,e===0?32:31-(mT(e)/gT|0)|0}var Ua=64,qa=4194304;function dl(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function eu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~s;l!==0?r=dl(l):(o&=i,o!==0&&(r=dl(o)))}else i=n&~s,i!==0?r=dl(i):o!==0&&(r=dl(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Hn(t),s=1<<n,r|=e[n],t&=~s;return r}function yT(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vT(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Hn(o),l=1<<i,a=s[i];a===-1?(!(l&n)||l&r)&&(s[i]=yT(l,t)):a<=t&&(e.expiredLanes|=l),o&=~l}}function $h(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function _b(){var e=Ua;return Ua<<=1,!(Ua&4194240)&&(Ua=64),e}function of(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function wa(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Hn(t),e[t]=n}function wT(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Hn(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function km(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Hn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var Le=0;function Ob(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Mb,Cm,Ab,zb,Db,Fh=!1,Ka=[],us=null,ds=null,fs=null,Ml=new Map,Al=new Map,Qr=[],bT="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 submit".split(" ");function X0(e,t){switch(e){case"focusin":case"focusout":us=null;break;case"dragenter":case"dragleave":ds=null;break;case"mouseover":case"mouseout":fs=null;break;case"pointerover":case"pointerout":Ml.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Al.delete(t.pointerId)}}function Gi(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=Sa(t),t!==null&&Cm(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function ST(e,t,n,r,s){switch(t){case"focusin":return us=Gi(us,e,t,n,r,s),!0;case"dragenter":return ds=Gi(ds,e,t,n,r,s),!0;case"mouseover":return fs=Gi(fs,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return Ml.set(o,Gi(Ml.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,Al.set(o,Gi(Al.get(o)||null,e,t,n,r,s)),!0}return!1}function $b(e){var t=$s(e.target);if(t!==null){var n=yo(t);if(n!==null){if(t=n.tag,t===13){if(t=Nb(n),t!==null){e.blockedOn=t,Db(e.priority,function(){Ab(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 Ic(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Lh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Mh=r,n.target.dispatchEvent(r),Mh=null}else return t=Sa(n),t!==null&&Cm(t),e.blockedOn=n,!1;t.shift()}return!0}function Z0(e,t,n){Ic(e)&&n.delete(t)}function ET(){Fh=!1,us!==null&&Ic(us)&&(us=null),ds!==null&&Ic(ds)&&(ds=null),fs!==null&&Ic(fs)&&(fs=null),Ml.forEach(Z0),Al.forEach(Z0)}function Qi(e,t){e.blockedOn===t&&(e.blockedOn=null,Fh||(Fh=!0,un.unstable_scheduleCallback(un.unstable_NormalPriority,ET)))}function zl(e){function t(s){return Qi(s,e)}if(0<Ka.length){Qi(Ka[0],e);for(var n=1;n<Ka.length;n++){var r=Ka[n];r.blockedOn===e&&(r.blockedOn=null)}}for(us!==null&&Qi(us,e),ds!==null&&Qi(ds,e),fs!==null&&Qi(fs,e),Ml.forEach(t),Al.forEach(t),n=0;n<Qr.length;n++)r=Qr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Qr.length&&(n=Qr[0],n.blockedOn===null);)$b(n),n.blockedOn===null&&Qr.shift()}var Go=Dr.ReactCurrentBatchConfig,tu=!0;function kT(e,t,n,r){var s=Le,o=Go.transition;Go.transition=null;try{Le=1,Nm(e,t,n,r)}finally{Le=s,Go.transition=o}}function CT(e,t,n,r){var s=Le,o=Go.transition;Go.transition=null;try{Le=4,Nm(e,t,n,r)}finally{Le=s,Go.transition=o}}function Nm(e,t,n,r){if(tu){var s=Lh(e,t,n,r);if(s===null)gf(e,t,r,nu,n),X0(e,r);else if(ST(s,e,t,n,r))r.stopPropagation();else if(X0(e,r),t&4&&-1<bT.indexOf(e)){for(;s!==null;){var o=Sa(s);if(o!==null&&Mb(o),o=Lh(e,t,n,r),o===null&&gf(e,t,r,nu,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else gf(e,t,r,null,n)}}var nu=null;function Lh(e,t,n,r){if(nu=null,e=Sm(r),e=$s(e),e!==null)if(t=yo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Nb(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 nu=e,null}function Fb(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(fT()){case Em:return 1;case Ib:return 4;case Jc:case hT:return 16;case jb:return 536870912;default:return 16}default:return 16}}var ls=null,Rm=null,jc=null;function Lb(){if(jc)return jc;var e,t=Rm,n=t.length,r,s="value"in ls?ls.value:ls.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===s[o-r];r++);return jc=s.slice(e,1<r?1-r:void 0)}function _c(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 Ya(){return!0}function J0(){return!1}function mn(e){function t(n,r,s,o,i){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ya:J0,this.isPropagationStopped=J0,this}return Je(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ya)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ya)},persist:function(){},isPersistent:Ya}),t}var Fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tm=mn(Fi),ba=Je({},Fi,{view:0,detail:0}),NT=mn(ba),lf,af,Xi,td=Je({},ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pm,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!==Xi&&(Xi&&e.type==="mousemove"?(lf=e.screenX-Xi.screenX,af=e.screenY-Xi.screenY):af=lf=0,Xi=e),lf)},movementY:function(e){return"movementY"in e?e.movementY:af}}),ex=mn(td),RT=Je({},td,{dataTransfer:0}),TT=mn(RT),PT=Je({},ba,{relatedTarget:0}),cf=mn(PT),IT=Je({},Fi,{animationName:0,elapsedTime:0,pseudoElement:0}),jT=mn(IT),_T=Je({},Fi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),OT=mn(_T),MT=Je({},Fi,{data:0}),tx=mn(MT),AT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zT={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"},DT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $T(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=DT[e])?!!t[e]:!1}function Pm(){return $T}var FT=Je({},ba,{key:function(e){if(e.key){var t=AT[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=_c(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zT[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pm,charCode:function(e){return e.type==="keypress"?_c(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_c(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),LT=mn(FT),HT=Je({},td,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nx=mn(HT),BT=Je({},ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pm}),VT=mn(BT),WT=Je({},Fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),UT=mn(WT),qT=Je({},td,{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}),KT=mn(qT),YT=[9,13,27,32],Im=Ir&&"CompositionEvent"in window,vl=null;Ir&&"documentMode"in document&&(vl=document.documentMode);var GT=Ir&&"TextEvent"in window&&!vl,Hb=Ir&&(!Im||vl&&8<vl&&11>=vl),rx=" ",sx=!1;function Bb(e,t){switch(e){case"keyup":return YT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Oo=!1;function QT(e,t){switch(e){case"compositionend":return Vb(t);case"keypress":return t.which!==32?null:(sx=!0,rx);case"textInput":return e=t.data,e===rx&&sx?null:e;default:return null}}function XT(e,t){if(Oo)return e==="compositionend"||!Im&&Bb(e,t)?(e=Lb(),jc=Rm=ls=null,Oo=!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 Hb&&t.locale!=="ko"?null:t.data;default:return null}}var ZT={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 ox(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ZT[e.type]:t==="textarea"}function Wb(e,t,n,r){bb(r),t=ru(t,"onChange"),0<t.length&&(n=new Tm("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var wl=null,Dl=null;function JT(e){t1(e,0)}function nd(e){var t=zo(e);if(pb(t))return e}function eP(e,t){if(e==="change")return t}var Ub=!1;if(Ir){var uf;if(Ir){var df="oninput"in document;if(!df){var ix=document.createElement("div");ix.setAttribute("oninput","return;"),df=typeof ix.oninput=="function"}uf=df}else uf=!1;Ub=uf&&(!document.documentMode||9<document.documentMode)}function lx(){wl&&(wl.detachEvent("onpropertychange",qb),Dl=wl=null)}function qb(e){if(e.propertyName==="value"&&nd(Dl)){var t=[];Wb(t,Dl,e,Sm(e)),Cb(JT,t)}}function tP(e,t,n){e==="focusin"?(lx(),wl=t,Dl=n,wl.attachEvent("onpropertychange",qb)):e==="focusout"&&lx()}function nP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return nd(Dl)}function rP(e,t){if(e==="click")return nd(t)}function sP(e,t){if(e==="input"||e==="change")return nd(t)}function oP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vn=typeof Object.is=="function"?Object.is:oP;function $l(e,t){if(Vn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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 s=n[r];if(!Sh.call(t,s)||!Vn(e[s],t[s]))return!1}return!0}function ax(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cx(e,t){var n=ax(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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ax(n)}}function Kb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yb(){for(var e=window,t=Qc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qc(e.document)}return t}function jm(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")}function iP(e){var t=Yb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Kb(n.ownerDocument.documentElement,n)){if(r!==null&&jm(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=cx(n,o);var i=cx(n,r);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var lP=Ir&&"documentMode"in document&&11>=document.documentMode,Mo=null,Hh=null,bl=null,Bh=!1;function ux(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bh||Mo==null||Mo!==Qc(r)||(r=Mo,"selectionStart"in r&&jm(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}),bl&&$l(bl,r)||(bl=r,r=ru(Hh,"onSelect"),0<r.length&&(t=new Tm("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Mo)))}function Ga(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ao={animationend:Ga("Animation","AnimationEnd"),animationiteration:Ga("Animation","AnimationIteration"),animationstart:Ga("Animation","AnimationStart"),transitionend:Ga("Transition","TransitionEnd")},ff={},Gb={};Ir&&(Gb=document.createElement("div").style,"AnimationEvent"in window||(delete Ao.animationend.animation,delete Ao.animationiteration.animation,delete Ao.animationstart.animation),"TransitionEvent"in window||delete Ao.transitionend.transition);function rd(e){if(ff[e])return ff[e];if(!Ao[e])return e;var t=Ao[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Gb)return ff[e]=t[n];return e}var Qb=rd("animationend"),Xb=rd("animationiteration"),Zb=rd("animationstart"),Jb=rd("transitionend"),e1=new Map,dx="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Rs(e,t){e1.set(e,t),xo(t,[e])}for(var hf=0;hf<dx.length;hf++){var pf=dx[hf],aP=pf.toLowerCase(),cP=pf[0].toUpperCase()+pf.slice(1);Rs(aP,"on"+cP)}Rs(Qb,"onAnimationEnd");Rs(Xb,"onAnimationIteration");Rs(Zb,"onAnimationStart");Rs("dblclick","onDoubleClick");Rs("focusin","onFocus");Rs("focusout","onBlur");Rs(Jb,"onTransitionEnd");yi("onMouseEnter",["mouseout","mouseover"]);yi("onMouseLeave",["mouseout","mouseover"]);yi("onPointerEnter",["pointerout","pointerover"]);yi("onPointerLeave",["pointerout","pointerover"]);xo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xo("onBeforeInput",["compositionend","keypress","textInput","paste"]);xo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fl="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(" "),uP=new Set("cancel close invalid load scroll toggle".split(" ").concat(fl));function fx(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,aT(r,t,void 0,e),e.currentTarget=null}function t1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==o&&s.isPropagationStopped())break e;fx(s,l,c),o=a}else for(i=0;i<r.length;i++){if(l=r[i],a=l.instance,c=l.currentTarget,l=l.listener,a!==o&&s.isPropagationStopped())break e;fx(s,l,c),o=a}}}if(Zc)throw e=Dh,Zc=!1,Dh=null,e}function Ue(e,t){var n=t[Kh];n===void 0&&(n=t[Kh]=new Set);var r=e+"__bubble";n.has(r)||(n1(t,e,2,!1),n.add(r))}function mf(e,t,n){var r=0;t&&(r|=4),n1(n,e,r,t)}var Qa="_reactListening"+Math.random().toString(36).slice(2);function Fl(e){if(!e[Qa]){e[Qa]=!0,cb.forEach(function(n){n!=="selectionchange"&&(uP.has(n)||mf(n,!1,e),mf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qa]||(t[Qa]=!0,mf("selectionchange",!1,t))}}function n1(e,t,n,r){switch(Fb(t)){case 1:var s=kT;break;case 4:s=CT;break;default:s=Nm}n=s.bind(null,t,n,e),s=void 0,!zh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function gf(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(i===4)for(i=r.return;i!==null;){var a=i.tag;if((a===3||a===4)&&(a=i.stateNode.containerInfo,a===s||a.nodeType===8&&a.parentNode===s))return;i=i.return}for(;l!==null;){if(i=$s(l),i===null)return;if(a=i.tag,a===5||a===6){r=o=i;continue e}l=l.parentNode}}r=r.return}Cb(function(){var c=o,u=Sm(n),d=[];e:{var f=e1.get(e);if(f!==void 0){var p=Tm,y=e;switch(e){case"keypress":if(_c(n)===0)break e;case"keydown":case"keyup":p=LT;break;case"focusin":y="focus",p=cf;break;case"focusout":y="blur",p=cf;break;case"beforeblur":case"afterblur":p=cf;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=ex;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=TT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=VT;break;case Qb:case Xb:case Zb:p=jT;break;case Jb:p=UT;break;case"scroll":p=NT;break;case"wheel":p=KT;break;case"copy":case"cut":case"paste":p=OT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=nx}var v=(t&4)!==0,b=!v&&e==="scroll",g=v?f!==null?f+"Capture":null:f;v=[];for(var m=c,x;m!==null;){x=m;var w=x.stateNode;if(x.tag===5&&w!==null&&(x=w,g!==null&&(w=Ol(m,g),w!=null&&v.push(Ll(m,w,x)))),b)break;m=m.return}0<v.length&&(f=new p(f,y,null,n,u),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Mh&&(y=n.relatedTarget||n.fromElement)&&($s(y)||y[jr]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(y=n.relatedTarget||n.toElement,p=c,y=y?$s(y):null,y!==null&&(b=yo(y),y!==b||y.tag!==5&&y.tag!==6)&&(y=null)):(p=null,y=c),p!==y)){if(v=ex,w="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=nx,w="onPointerLeave",g="onPointerEnter",m="pointer"),b=p==null?f:zo(p),x=y==null?f:zo(y),f=new v(w,m+"leave",p,n,u),f.target=b,f.relatedTarget=x,w=null,$s(u)===c&&(v=new v(g,m+"enter",y,n,u),v.target=x,v.relatedTarget=b,w=v),b=w,p&&y)t:{for(v=p,g=y,m=0,x=v;x;x=Po(x))m++;for(x=0,w=g;w;w=Po(w))x++;for(;0<m-x;)v=Po(v),m--;for(;0<x-m;)g=Po(g),x--;for(;m--;){if(v===g||g!==null&&v===g.alternate)break t;v=Po(v),g=Po(g)}v=null}else v=null;p!==null&&hx(d,f,p,v,!1),y!==null&&b!==null&&hx(d,b,y,v,!0)}}e:{if(f=c?zo(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var E=eP;else if(ox(f))if(Ub)E=sP;else{E=nP;var N=tP}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=rP);if(E&&(E=E(e,c))){Wb(d,E,n,u);break e}N&&N(e,f,c),e==="focusout"&&(N=f._wrapperState)&&N.controlled&&f.type==="number"&&Ph(f,"number",f.value)}switch(N=c?zo(c):window,e){case"focusin":(ox(N)||N.contentEditable==="true")&&(Mo=N,Hh=c,bl=null);break;case"focusout":bl=Hh=Mo=null;break;case"mousedown":Bh=!0;break;case"contextmenu":case"mouseup":case"dragend":Bh=!1,ux(d,n,u);break;case"selectionchange":if(lP)break;case"keydown":case"keyup":ux(d,n,u)}var k;if(Im)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Oo?Bb(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Hb&&n.locale!=="ko"&&(Oo||C!=="onCompositionStart"?C==="onCompositionEnd"&&Oo&&(k=Lb()):(ls=u,Rm="value"in ls?ls.value:ls.textContent,Oo=!0)),N=ru(c,C),0<N.length&&(C=new tx(C,e,null,n,u),d.push({event:C,listeners:N}),k?C.data=k:(k=Vb(n),k!==null&&(C.data=k)))),(k=GT?QT(e,n):XT(e,n))&&(c=ru(c,"onBeforeInput"),0<c.length&&(u=new tx("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=k))}t1(d,t)})}function Ll(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ru(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Ol(e,n),o!=null&&r.unshift(Ll(e,o,s)),o=Ol(e,t),o!=null&&r.push(Ll(e,o,s))),e=e.return}return r}function Po(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function hx(e,t,n,r,s){for(var o=t._reactName,i=[];n!==null&&n!==r;){var l=n,a=l.alternate,c=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&c!==null&&(l=c,s?(a=Ol(n,o),a!=null&&i.unshift(Ll(n,a,l))):s||(a=Ol(n,o),a!=null&&i.push(Ll(n,a,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var dP=/\r\n?/g,fP=/\u0000|\uFFFD/g;function px(e){return(typeof e=="string"?e:""+e).replace(dP,`
38
- `).replace(fP,"")}function Xa(e,t,n){if(t=px(t),px(e)!==t&&n)throw Error(J(425))}function su(){}var Vh=null,Wh=null;function Uh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qh=typeof setTimeout=="function"?setTimeout:void 0,hP=typeof clearTimeout=="function"?clearTimeout:void 0,mx=typeof Promise=="function"?Promise:void 0,pP=typeof queueMicrotask=="function"?queueMicrotask:typeof mx<"u"?function(e){return mx.resolve(null).then(e).catch(mP)}:qh;function mP(e){setTimeout(function(){throw e})}function xf(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),zl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);zl(t)}function hs(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==="$?")break;if(t==="/$")return null}}return e}function gx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Li=Math.random().toString(36).slice(2),nr="__reactFiber$"+Li,Hl="__reactProps$"+Li,jr="__reactContainer$"+Li,Kh="__reactEvents$"+Li,gP="__reactListeners$"+Li,xP="__reactHandles$"+Li;function $s(e){var t=e[nr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[jr]||n[nr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gx(e);e!==null;){if(n=e[nr])return n;e=gx(e)}return t}e=n,n=e.parentNode}return null}function Sa(e){return e=e[nr]||e[jr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function zo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(J(33))}function sd(e){return e[Hl]||null}var Yh=[],Do=-1;function Ts(e){return{current:e}}function qe(e){0>Do||(e.current=Yh[Do],Yh[Do]=null,Do--)}function We(e,t){Do++,Yh[Do]=e.current,e.current=t}var bs={},At=Ts(bs),Zt=Ts(!1),so=bs;function vi(e,t){var n=e.type.contextTypes;if(!n)return bs;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Jt(e){return e=e.childContextTypes,e!=null}function ou(){qe(Zt),qe(At)}function xx(e,t,n){if(At.current!==bs)throw Error(J(168));We(At,t),We(Zt,n)}function r1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(J(108,tT(e)||"Unknown",s));return Je({},n,r)}function iu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bs,so=At.current,We(At,e),We(Zt,Zt.current),!0}function yx(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=r1(e,t,so),r.__reactInternalMemoizedMergedChildContext=e,qe(Zt),qe(At),We(At,e)):qe(Zt),We(Zt,n)}var xr=null,od=!1,yf=!1;function s1(e){xr===null?xr=[e]:xr.push(e)}function yP(e){od=!0,s1(e)}function Ps(){if(!yf&&xr!==null){yf=!0;var e=0,t=Le;try{var n=xr;for(Le=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}xr=null,od=!1}catch(s){throw xr!==null&&(xr=xr.slice(e+1)),Pb(Em,Ps),s}finally{Le=t,yf=!1}}return null}var $o=[],Fo=0,lu=null,au=0,wn=[],bn=0,oo=null,Sr=1,Er="";function Ms(e,t){$o[Fo++]=au,$o[Fo++]=lu,lu=e,au=t}function o1(e,t,n){wn[bn++]=Sr,wn[bn++]=Er,wn[bn++]=oo,oo=e;var r=Sr;e=Er;var s=32-Hn(r)-1;r&=~(1<<s),n+=1;var o=32-Hn(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,Sr=1<<32-Hn(t)+s|n<<s|r,Er=o+e}else Sr=1<<o|n<<s|r,Er=e}function _m(e){e.return!==null&&(Ms(e,1),o1(e,1,0))}function Om(e){for(;e===lu;)lu=$o[--Fo],$o[Fo]=null,au=$o[--Fo],$o[Fo]=null;for(;e===oo;)oo=wn[--bn],wn[bn]=null,Er=wn[--bn],wn[bn]=null,Sr=wn[--bn],wn[bn]=null}var cn=null,an=null,Ke=!1,$n=null;function i1(e,t){var n=En(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function vx(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,cn=e,an=hs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,cn=e,an=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=oo!==null?{id:Sr,overflow:Er}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=En(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,cn=e,an=null,!0):!1;default:return!1}}function Gh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qh(e){if(Ke){var t=an;if(t){var n=t;if(!vx(e,t)){if(Gh(e))throw Error(J(418));t=hs(n.nextSibling);var r=cn;t&&vx(e,t)?i1(r,n):(e.flags=e.flags&-4097|2,Ke=!1,cn=e)}}else{if(Gh(e))throw Error(J(418));e.flags=e.flags&-4097|2,Ke=!1,cn=e}}}function wx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;cn=e}function Za(e){if(e!==cn)return!1;if(!Ke)return wx(e),Ke=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Uh(e.type,e.memoizedProps)),t&&(t=an)){if(Gh(e))throw l1(),Error(J(418));for(;t;)i1(e,t),t=hs(t.nextSibling)}if(wx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){an=hs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}an=null}}else an=cn?hs(e.stateNode.nextSibling):null;return!0}function l1(){for(var e=an;e;)e=hs(e.nextSibling)}function wi(){an=cn=null,Ke=!1}function Mm(e){$n===null?$n=[e]:$n.push(e)}var vP=Dr.ReactCurrentBatchConfig;function Zi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(J(309));var r=n.stateNode}if(!r)throw Error(J(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(i){var l=s.refs;i===null?delete l[o]:l[o]=i},t._stringRef=o,t)}if(typeof e!="string")throw Error(J(284));if(!n._owner)throw Error(J(290,e))}return e}function Ja(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function bx(e){var t=e._init;return t(e._payload)}function a1(e){function t(g,m){if(e){var x=g.deletions;x===null?(g.deletions=[m],g.flags|=16):x.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function r(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function s(g,m){return g=xs(g,m),g.index=0,g.sibling=null,g}function o(g,m,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<m?(g.flags|=2,m):x):(g.flags|=2,m)):(g.flags|=1048576,m)}function i(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,m,x,w){return m===null||m.tag!==6?(m=Cf(x,g.mode,w),m.return=g,m):(m=s(m,x),m.return=g,m)}function a(g,m,x,w){var E=x.type;return E===_o?u(g,m,x.props.children,w,x.key):m!==null&&(m.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Kr&&bx(E)===m.type)?(w=s(m,x.props),w.ref=Zi(g,m,x),w.return=g,w):(w=Fc(x.type,x.key,x.props,null,g.mode,w),w.ref=Zi(g,m,x),w.return=g,w)}function c(g,m,x,w){return m===null||m.tag!==4||m.stateNode.containerInfo!==x.containerInfo||m.stateNode.implementation!==x.implementation?(m=Nf(x,g.mode,w),m.return=g,m):(m=s(m,x.children||[]),m.return=g,m)}function u(g,m,x,w,E){return m===null||m.tag!==7?(m=eo(x,g.mode,w,E),m.return=g,m):(m=s(m,x),m.return=g,m)}function d(g,m,x){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Cf(""+m,g.mode,x),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ba:return x=Fc(m.type,m.key,m.props,null,g.mode,x),x.ref=Zi(g,null,m),x.return=g,x;case jo:return m=Nf(m,g.mode,x),m.return=g,m;case Kr:var w=m._init;return d(g,w(m._payload),x)}if(ul(m)||Ki(m))return m=eo(m,g.mode,x,null),m.return=g,m;Ja(g,m)}return null}function f(g,m,x,w){var E=m!==null?m.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return E!==null?null:l(g,m,""+x,w);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ba:return x.key===E?a(g,m,x,w):null;case jo:return x.key===E?c(g,m,x,w):null;case Kr:return E=x._init,f(g,m,E(x._payload),w)}if(ul(x)||Ki(x))return E!==null?null:u(g,m,x,w,null);Ja(g,x)}return null}function p(g,m,x,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(x)||null,l(m,g,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ba:return g=g.get(w.key===null?x:w.key)||null,a(m,g,w,E);case jo:return g=g.get(w.key===null?x:w.key)||null,c(m,g,w,E);case Kr:var N=w._init;return p(g,m,x,N(w._payload),E)}if(ul(w)||Ki(w))return g=g.get(x)||null,u(m,g,w,E,null);Ja(m,w)}return null}function y(g,m,x,w){for(var E=null,N=null,k=m,C=m=0,P=null;k!==null&&C<x.length;C++){k.index>C?(P=k,k=null):P=k.sibling;var I=f(g,k,x[C],w);if(I===null){k===null&&(k=P);break}e&&k&&I.alternate===null&&t(g,k),m=o(I,m,C),N===null?E=I:N.sibling=I,N=I,k=P}if(C===x.length)return n(g,k),Ke&&Ms(g,C),E;if(k===null){for(;C<x.length;C++)k=d(g,x[C],w),k!==null&&(m=o(k,m,C),N===null?E=k:N.sibling=k,N=k);return Ke&&Ms(g,C),E}for(k=r(g,k);C<x.length;C++)P=p(k,g,C,x[C],w),P!==null&&(e&&P.alternate!==null&&k.delete(P.key===null?C:P.key),m=o(P,m,C),N===null?E=P:N.sibling=P,N=P);return e&&k.forEach(function(z){return t(g,z)}),Ke&&Ms(g,C),E}function v(g,m,x,w){var E=Ki(x);if(typeof E!="function")throw Error(J(150));if(x=E.call(x),x==null)throw Error(J(151));for(var N=E=null,k=m,C=m=0,P=null,I=x.next();k!==null&&!I.done;C++,I=x.next()){k.index>C?(P=k,k=null):P=k.sibling;var z=f(g,k,I.value,w);if(z===null){k===null&&(k=P);break}e&&k&&z.alternate===null&&t(g,k),m=o(z,m,C),N===null?E=z:N.sibling=z,N=z,k=P}if(I.done)return n(g,k),Ke&&Ms(g,C),E;if(k===null){for(;!I.done;C++,I=x.next())I=d(g,I.value,w),I!==null&&(m=o(I,m,C),N===null?E=I:N.sibling=I,N=I);return Ke&&Ms(g,C),E}for(k=r(g,k);!I.done;C++,I=x.next())I=p(k,g,C,I.value,w),I!==null&&(e&&I.alternate!==null&&k.delete(I.key===null?C:I.key),m=o(I,m,C),N===null?E=I:N.sibling=I,N=I);return e&&k.forEach(function($){return t(g,$)}),Ke&&Ms(g,C),E}function b(g,m,x,w){if(typeof x=="object"&&x!==null&&x.type===_o&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ba:e:{for(var E=x.key,N=m;N!==null;){if(N.key===E){if(E=x.type,E===_o){if(N.tag===7){n(g,N.sibling),m=s(N,x.props.children),m.return=g,g=m;break e}}else if(N.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Kr&&bx(E)===N.type){n(g,N.sibling),m=s(N,x.props),m.ref=Zi(g,N,x),m.return=g,g=m;break e}n(g,N);break}else t(g,N);N=N.sibling}x.type===_o?(m=eo(x.props.children,g.mode,w,x.key),m.return=g,g=m):(w=Fc(x.type,x.key,x.props,null,g.mode,w),w.ref=Zi(g,m,x),w.return=g,g=w)}return i(g);case jo:e:{for(N=x.key;m!==null;){if(m.key===N)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){n(g,m.sibling),m=s(m,x.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=Nf(x,g.mode,w),m.return=g,g=m}return i(g);case Kr:return N=x._init,b(g,m,N(x._payload),w)}if(ul(x))return y(g,m,x,w);if(Ki(x))return v(g,m,x,w);Ja(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(n(g,m.sibling),m=s(m,x),m.return=g,g=m):(n(g,m),m=Cf(x,g.mode,w),m.return=g,g=m),i(g)):n(g,m)}return b}var bi=a1(!0),c1=a1(!1),cu=Ts(null),uu=null,Lo=null,Am=null;function zm(){Am=Lo=uu=null}function Dm(e){var t=cu.current;qe(cu),e._currentValue=t}function Xh(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Qo(e,t){uu=e,Am=Lo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Gt=!0),e.firstContext=null)}function Rn(e){var t=e._currentValue;if(Am!==e)if(e={context:e,memoizedValue:t,next:null},Lo===null){if(uu===null)throw Error(J(308));Lo=e,uu.dependencies={lanes:0,firstContext:e}}else Lo=Lo.next=e;return t}var Fs=null;function $m(e){Fs===null?Fs=[e]:Fs.push(e)}function u1(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,$m(t)):(n.next=s.next,s.next=n),t.interleaved=n,_r(e,r)}function _r(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Yr=!1;function Fm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function d1(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Cr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ps(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,_e&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,_r(e,n)}return s=r.interleaved,s===null?(t.next=t,$m(r)):(t.next=s.next,s.next=t),r.interleaved=t,_r(e,n)}function Oc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,km(e,n)}}function Sx(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function du(e,t,n,r){var s=e.updateQueue;Yr=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var a=l,c=a.next;a.next=null,i===null?o=c:i.next=c,i=a;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==i&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(o!==null){var d=s.baseState;i=0,u=c=a=null,l=o;do{var f=l.lane,p=l.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,v=l;switch(f=t,p=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(p,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(p,d,f):y,f==null)break e;d=Je({},d,f);break e;case 2:Yr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=p,a=d):u=u.next=p,i|=f;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;f=l,l=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(u===null&&(a=d),s.baseState=a,s.firstBaseUpdate=c,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);lo|=i,e.lanes=i,e.memoizedState=d}}function Ex(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(J(191,s));s.call(r)}}}var Ea={},or=Ts(Ea),Bl=Ts(Ea),Vl=Ts(Ea);function Ls(e){if(e===Ea)throw Error(J(174));return e}function Lm(e,t){switch(We(Vl,t),We(Bl,e),We(or,Ea),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jh(t,e)}qe(or),We(or,t)}function Si(){qe(or),qe(Bl),qe(Vl)}function f1(e){Ls(Vl.current);var t=Ls(or.current),n=jh(t,e.type);t!==n&&(We(Bl,e),We(or,n))}function Hm(e){Bl.current===e&&(qe(or),qe(Bl))}var Qe=Ts(0);function fu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 vf=[];function Bm(){for(var e=0;e<vf.length;e++)vf[e]._workInProgressVersionPrimary=null;vf.length=0}var Mc=Dr.ReactCurrentDispatcher,wf=Dr.ReactCurrentBatchConfig,io=0,Ze=null,mt=null,vt=null,hu=!1,Sl=!1,Wl=0,wP=0;function Tt(){throw Error(J(321))}function Vm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vn(e[n],t[n]))return!1;return!0}function Wm(e,t,n,r,s,o){if(io=o,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Mc.current=e===null||e.memoizedState===null?kP:CP,e=n(r,s),Sl){o=0;do{if(Sl=!1,Wl=0,25<=o)throw Error(J(301));o+=1,vt=mt=null,t.updateQueue=null,Mc.current=NP,e=n(r,s)}while(Sl)}if(Mc.current=pu,t=mt!==null&&mt.next!==null,io=0,vt=mt=Ze=null,hu=!1,t)throw Error(J(300));return e}function Um(){var e=Wl!==0;return Wl=0,e}function Xn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Ze.memoizedState=vt=e:vt=vt.next=e,vt}function Tn(){if(mt===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var t=vt===null?Ze.memoizedState:vt.next;if(t!==null)vt=t,mt=e;else{if(e===null)throw Error(J(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},vt===null?Ze.memoizedState=vt=e:vt=vt.next=e}return vt}function Ul(e,t){return typeof t=="function"?t(e):t}function bf(e){var t=Tn(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=mt,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var i=s.next;s.next=o.next,o.next=i}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var l=i=null,a=null,c=o;do{var u=c.lane;if((io&u)===u)a!==null&&(a=a.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=d,i=r):a=a.next=d,Ze.lanes|=u,lo|=u}c=c.next}while(c!==null&&c!==o);a===null?i=r:a.next=l,Vn(r,t.memoizedState)||(Gt=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,Ze.lanes|=o,lo|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Sf(e){var t=Tn(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var i=s=s.next;do o=e(o,i.action),i=i.next;while(i!==s);Vn(o,t.memoizedState)||(Gt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function h1(){}function p1(e,t){var n=Ze,r=Tn(),s=t(),o=!Vn(r.memoizedState,s);if(o&&(r.memoizedState=s,Gt=!0),r=r.queue,qm(x1.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||vt!==null&&vt.memoizedState.tag&1){if(n.flags|=2048,ql(9,g1.bind(null,n,r,s,t),void 0,null),wt===null)throw Error(J(349));io&30||m1(n,t,s)}return s}function m1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ze.updateQueue,t===null?(t={lastEffect:null,stores:null},Ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function g1(e,t,n,r){t.value=n,t.getSnapshot=r,y1(t)&&v1(e)}function x1(e,t,n){return n(function(){y1(t)&&v1(e)})}function y1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vn(e,n)}catch{return!0}}function v1(e){var t=_r(e,1);t!==null&&Bn(t,e,1,-1)}function kx(e){var t=Xn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ul,lastRenderedState:e},t.queue=e,e=e.dispatch=EP.bind(null,Ze,e),[t.memoizedState,e]}function ql(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ze.updateQueue,t===null?(t={lastEffect:null,stores:null},Ze.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function w1(){return Tn().memoizedState}function Ac(e,t,n,r){var s=Xn();Ze.flags|=e,s.memoizedState=ql(1|t,n,void 0,r===void 0?null:r)}function id(e,t,n,r){var s=Tn();r=r===void 0?null:r;var o=void 0;if(mt!==null){var i=mt.memoizedState;if(o=i.destroy,r!==null&&Vm(r,i.deps)){s.memoizedState=ql(t,n,o,r);return}}Ze.flags|=e,s.memoizedState=ql(1|t,n,o,r)}function Cx(e,t){return Ac(8390656,8,e,t)}function qm(e,t){return id(2048,8,e,t)}function b1(e,t){return id(4,2,e,t)}function S1(e,t){return id(4,4,e,t)}function E1(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function k1(e,t,n){return n=n!=null?n.concat([e]):null,id(4,4,E1.bind(null,t,e),n)}function Km(){}function C1(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Vm(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function N1(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Vm(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function R1(e,t,n){return io&21?(Vn(n,t)||(n=_b(),Ze.lanes|=n,lo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Gt=!0),e.memoizedState=n)}function bP(e,t){var n=Le;Le=n!==0&&4>n?n:4,e(!0);var r=wf.transition;wf.transition={};try{e(!1),t()}finally{Le=n,wf.transition=r}}function T1(){return Tn().memoizedState}function SP(e,t,n){var r=gs(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},P1(e))I1(t,n);else if(n=u1(e,t,n,r),n!==null){var s=Bt();Bn(n,e,r,s),j1(n,t,r)}}function EP(e,t,n){var r=gs(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(P1(e))I1(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,n);if(s.hasEagerState=!0,s.eagerState=l,Vn(l,i)){var a=t.interleaved;a===null?(s.next=s,$m(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}n=u1(e,t,s,r),n!==null&&(s=Bt(),Bn(n,e,r,s),j1(n,t,r))}}function P1(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function I1(e,t){Sl=hu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function j1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,km(e,n)}}var pu={readContext:Rn,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useInsertionEffect:Tt,useLayoutEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useMutableSource:Tt,useSyncExternalStore:Tt,useId:Tt,unstable_isNewReconciler:!1},kP={readContext:Rn,useCallback:function(e,t){return Xn().memoizedState=[e,t===void 0?null:t],e},useContext:Rn,useEffect:Cx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ac(4194308,4,E1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ac(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ac(4,2,e,t)},useMemo:function(e,t){var n=Xn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Xn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=SP.bind(null,Ze,e),[r.memoizedState,e]},useRef:function(e){var t=Xn();return e={current:e},t.memoizedState=e},useState:kx,useDebugValue:Km,useDeferredValue:function(e){return Xn().memoizedState=e},useTransition:function(){var e=kx(!1),t=e[0];return e=bP.bind(null,e[1]),Xn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ze,s=Xn();if(Ke){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),wt===null)throw Error(J(349));io&30||m1(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,Cx(x1.bind(null,r,o,e),[e]),r.flags|=2048,ql(9,g1.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Xn(),t=wt.identifierPrefix;if(Ke){var n=Er,r=Sr;n=(r&~(1<<32-Hn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Wl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=wP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},CP={readContext:Rn,useCallback:C1,useContext:Rn,useEffect:qm,useImperativeHandle:k1,useInsertionEffect:b1,useLayoutEffect:S1,useMemo:N1,useReducer:bf,useRef:w1,useState:function(){return bf(Ul)},useDebugValue:Km,useDeferredValue:function(e){var t=Tn();return R1(t,mt.memoizedState,e)},useTransition:function(){var e=bf(Ul)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:h1,useSyncExternalStore:p1,useId:T1,unstable_isNewReconciler:!1},NP={readContext:Rn,useCallback:C1,useContext:Rn,useEffect:qm,useImperativeHandle:k1,useInsertionEffect:b1,useLayoutEffect:S1,useMemo:N1,useReducer:Sf,useRef:w1,useState:function(){return Sf(Ul)},useDebugValue:Km,useDeferredValue:function(e){var t=Tn();return mt===null?t.memoizedState=e:R1(t,mt.memoizedState,e)},useTransition:function(){var e=Sf(Ul)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:h1,useSyncExternalStore:p1,useId:T1,unstable_isNewReconciler:!1};function On(e,t){if(e&&e.defaultProps){t=Je({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Zh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ld={isMounted:function(e){return(e=e._reactInternals)?yo(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Bt(),s=gs(e),o=Cr(r,s);o.payload=t,n!=null&&(o.callback=n),t=ps(e,o,s),t!==null&&(Bn(t,e,s,r),Oc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Bt(),s=gs(e),o=Cr(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=ps(e,o,s),t!==null&&(Bn(t,e,s,r),Oc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Bt(),r=gs(e),s=Cr(n,r);s.tag=2,t!=null&&(s.callback=t),t=ps(e,s,r),t!==null&&(Bn(t,e,r,n),Oc(t,e,r))}};function Nx(e,t,n,r,s,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,i):t.prototype&&t.prototype.isPureReactComponent?!$l(n,r)||!$l(s,o):!0}function _1(e,t,n){var r=!1,s=bs,o=t.contextType;return typeof o=="object"&&o!==null?o=Rn(o):(s=Jt(t)?so:At.current,r=t.contextTypes,o=(r=r!=null)?vi(e,s):bs),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ld,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function Rx(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&&ld.enqueueReplaceState(t,t.state,null)}function Jh(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Fm(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=Rn(o):(o=Jt(t)?so:At.current,s.context=vi(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Zh(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&ld.enqueueReplaceState(s,s.state,null),du(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ei(e,t){try{var n="",r=t;do n+=eT(r),r=r.return;while(r);var s=n}catch(o){s=`
39
- Error generating stack: `+o.message+`
40
- `+o.stack}return{value:e,source:t,stack:s,digest:null}}function Ef(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ep(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var RP=typeof WeakMap=="function"?WeakMap:Map;function O1(e,t,n){n=Cr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){gu||(gu=!0,up=r),ep(e,t)},n}function M1(e,t,n){n=Cr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){ep(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ep(e,t),typeof r!="function"&&(ms===null?ms=new Set([this]):ms.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Tx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new RP;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=HP.bind(null,e,t,n),t.then(e,e))}function Px(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ix(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Cr(-1,1),t.tag=2,ps(n,t,1))),n.lanes|=1),e)}var TP=Dr.ReactCurrentOwner,Gt=!1;function Lt(e,t,n,r){t.child=e===null?c1(t,null,n,r):bi(t,e.child,n,r)}function jx(e,t,n,r,s){n=n.render;var o=t.ref;return Qo(t,s),r=Wm(e,t,n,r,o,s),n=Um(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Or(e,t,s)):(Ke&&n&&_m(t),t.flags|=1,Lt(e,t,r,s),t.child)}function _x(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!tg(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,A1(e,t,o,r,s)):(e=Fc(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:$l,n(i,r)&&e.ref===t.ref)return Or(e,t,s)}return t.flags|=1,e=xs(o,r),e.ref=t.ref,e.return=t,t.child=e}function A1(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if($l(o,r)&&e.ref===t.ref)if(Gt=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Gt=!0);else return t.lanes=e.lanes,Or(e,t,s)}return tp(e,t,n,r,s)}function z1(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},We(Bo,on),on|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,We(Bo,on),on|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,We(Bo,on),on|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,We(Bo,on),on|=r;return Lt(e,t,s,n),t.child}function D1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function tp(e,t,n,r,s){var o=Jt(n)?so:At.current;return o=vi(t,o),Qo(t,s),n=Wm(e,t,n,r,o,s),r=Um(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Or(e,t,s)):(Ke&&r&&_m(t),t.flags|=1,Lt(e,t,n,s),t.child)}function Ox(e,t,n,r,s){if(Jt(n)){var o=!0;iu(t)}else o=!1;if(Qo(t,s),t.stateNode===null)zc(e,t),_1(t,n,r),Jh(t,n,r,s),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var a=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=Rn(c):(c=Jt(n)?so:At.current,c=vi(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||a!==c)&&Rx(t,i,r,c),Yr=!1;var f=t.memoizedState;i.state=f,du(t,r,i,s),a=t.memoizedState,l!==r||f!==a||Zt.current||Yr?(typeof u=="function"&&(Zh(t,n,u,r),a=t.memoizedState),(l=Yr||Nx(t,n,l,r,f,a,c))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),i.props=r,i.state=a,i.context=c,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,d1(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:On(t.type,l),i.props=c,d=t.pendingProps,f=i.context,a=n.contextType,typeof a=="object"&&a!==null?a=Rn(a):(a=Jt(n)?so:At.current,a=vi(t,a));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==d||f!==a)&&Rx(t,i,r,a),Yr=!1,f=t.memoizedState,i.state=f,du(t,r,i,s);var y=t.memoizedState;l!==d||f!==y||Zt.current||Yr?(typeof p=="function"&&(Zh(t,n,p,r),y=t.memoizedState),(c=Yr||Nx(t,n,c,r,f,y,a)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,y,a),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,y,a)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),i.props=r,i.state=y,i.context=a,r=c):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return np(e,t,n,r,o,s)}function np(e,t,n,r,s,o){D1(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&yx(t,n,!1),Or(e,t,o);r=t.stateNode,TP.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=bi(t,e.child,null,o),t.child=bi(t,null,l,o)):Lt(e,t,l,o),t.memoizedState=r.state,s&&yx(t,n,!0),t.child}function $1(e){var t=e.stateNode;t.pendingContext?xx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&xx(e,t.context,!1),Lm(e,t.containerInfo)}function Mx(e,t,n,r,s){return wi(),Mm(s),t.flags|=256,Lt(e,t,n,r),t.child}var rp={dehydrated:null,treeContext:null,retryLane:0};function sp(e){return{baseLanes:e,cachePool:null,transitions:null}}function F1(e,t,n){var r=t.pendingProps,s=Qe.current,o=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),We(Qe,s&1),e===null)return Qh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=ud(i,r,0,null),e=eo(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=sp(n),t.memoizedState=rp,e):Ym(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return PP(e,t,i,r,l,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,l=s.sibling;var a={mode:"hidden",children:r.children};return!(i&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=xs(s,a),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=xs(l,o):(o=eo(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?sp(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=rp,r}return o=e.child,e=o.sibling,r=xs(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ym(e,t){return t=ud({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ec(e,t,n,r){return r!==null&&Mm(r),bi(t,e.child,null,n),e=Ym(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function PP(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=Ef(Error(J(422))),ec(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=ud({mode:"visible",children:r.children},s,0,null),o=eo(o,s,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&bi(t,e.child,null,i),t.child.memoizedState=sp(i),t.memoizedState=rp,o);if(!(t.mode&1))return ec(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(J(419)),r=Ef(o,r,void 0),ec(e,t,i,r)}if(l=(i&e.childLanes)!==0,Gt||l){if(r=wt,r!==null){switch(i&-i){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,_r(e,s),Bn(r,e,s,-1))}return eg(),r=Ef(Error(J(421))),ec(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=BP.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,an=hs(s.nextSibling),cn=t,Ke=!0,$n=null,e!==null&&(wn[bn++]=Sr,wn[bn++]=Er,wn[bn++]=oo,Sr=e.id,Er=e.overflow,oo=t),t=Ym(t,r.children),t.flags|=4096,t)}function Ax(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xh(e.return,t,n)}function kf(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function L1(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Lt(e,t,r.children,n),r=Qe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ax(e,n,t);else if(e.tag===19)Ax(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(We(Qe,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&fu(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),kf(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&fu(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}kf(t,!0,n,null,o);break;case"together":kf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Or(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),lo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(J(153));if(t.child!==null){for(e=t.child,n=xs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function IP(e,t,n){switch(t.tag){case 3:$1(t),wi();break;case 5:f1(t);break;case 1:Jt(t.type)&&iu(t);break;case 4:Lm(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;We(cu,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(We(Qe,Qe.current&1),t.flags|=128,null):n&t.child.childLanes?F1(e,t,n):(We(Qe,Qe.current&1),e=Or(e,t,n),e!==null?e.sibling:null);We(Qe,Qe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return L1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),We(Qe,Qe.current),r)break;return null;case 22:case 23:return t.lanes=0,z1(e,t,n)}return Or(e,t,n)}var H1,op,B1,V1;H1=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};op=function(){};B1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Ls(or.current);var o=null;switch(n){case"input":s=Rh(e,s),r=Rh(e,r),o=[];break;case"select":s=Je({},s,{value:void 0}),r=Je({},r,{value:void 0}),o=[];break;case"textarea":s=Ih(e,s),r=Ih(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=su)}_h(n,r);var i;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var l=s[c];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(jl.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var a=r[c];if(l=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&a!==l&&(a!=null||l!=null))if(c==="style")if(l){for(i in l)!l.hasOwnProperty(i)||a&&a.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in a)a.hasOwnProperty(i)&&l[i]!==a[i]&&(n||(n={}),n[i]=a[i])}else n||(o||(o=[]),o.push(c,n)),n=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(o=o||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(jl.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&Ue("scroll",e),o||l===a||(o=[])):(o=o||[]).push(c,a))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};V1=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ji(e,t){if(!Ke)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function jP(e,t,n){var r=t.pendingProps;switch(Om(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(t),null;case 1:return Jt(t.type)&&ou(),Pt(t),null;case 3:return r=t.stateNode,Si(),qe(Zt),qe(At),Bm(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Za(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$n!==null&&(hp($n),$n=null))),op(e,t),Pt(t),null;case 5:Hm(t);var s=Ls(Vl.current);if(n=t.type,e!==null&&t.stateNode!=null)B1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(J(166));return Pt(t),null}if(e=Ls(or.current),Za(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[nr]=t,r[Hl]=o,e=(t.mode&1)!==0,n){case"dialog":Ue("cancel",r),Ue("close",r);break;case"iframe":case"object":case"embed":Ue("load",r);break;case"video":case"audio":for(s=0;s<fl.length;s++)Ue(fl[s],r);break;case"source":Ue("error",r);break;case"img":case"image":case"link":Ue("error",r),Ue("load",r);break;case"details":Ue("toggle",r);break;case"input":W0(r,o),Ue("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Ue("invalid",r);break;case"textarea":q0(r,o),Ue("invalid",r)}_h(n,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&Xa(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&Xa(r.textContent,l,e),s=["children",""+l]):jl.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&Ue("scroll",r)}switch(n){case"input":Va(r),U0(r,o,!0);break;case"textarea":Va(r),K0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=su)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=xb(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[nr]=t,e[Hl]=r,H1(e,t,!1,!1),t.stateNode=e;e:{switch(i=Oh(n,r),n){case"dialog":Ue("cancel",e),Ue("close",e),s=r;break;case"iframe":case"object":case"embed":Ue("load",e),s=r;break;case"video":case"audio":for(s=0;s<fl.length;s++)Ue(fl[s],e);s=r;break;case"source":Ue("error",e),s=r;break;case"img":case"image":case"link":Ue("error",e),Ue("load",e),s=r;break;case"details":Ue("toggle",e),s=r;break;case"input":W0(e,r),s=Rh(e,r),Ue("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Je({},r,{value:void 0}),Ue("invalid",e);break;case"textarea":q0(e,r),s=Ih(e,r),Ue("invalid",e);break;default:s=r}_h(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var a=l[o];o==="style"?wb(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&yb(e,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&_l(e,a):typeof a=="number"&&_l(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(jl.hasOwnProperty(o)?a!=null&&o==="onScroll"&&Ue("scroll",e):a!=null&&ym(e,o,a,i))}switch(n){case"input":Va(e),U0(e,r,!1);break;case"textarea":Va(e),K0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ws(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?qo(e,!!r.multiple,o,!1):r.defaultValue!=null&&qo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=su)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Pt(t),null;case 6:if(e&&t.stateNode!=null)V1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(n=Ls(Vl.current),Ls(or.current),Za(t)){if(r=t.stateNode,n=t.memoizedProps,r[nr]=t,(o=r.nodeValue!==n)&&(e=cn,e!==null))switch(e.tag){case 3:Xa(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Xa(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[nr]=t,t.stateNode=r}return Pt(t),null;case 13:if(qe(Qe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ke&&an!==null&&t.mode&1&&!(t.flags&128))l1(),wi(),t.flags|=98560,o=!1;else if(o=Za(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(J(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(J(317));o[nr]=t}else wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pt(t),o=!1}else $n!==null&&(hp($n),$n=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Qe.current&1?gt===0&&(gt=3):eg())),t.updateQueue!==null&&(t.flags|=4),Pt(t),null);case 4:return Si(),op(e,t),e===null&&Fl(t.stateNode.containerInfo),Pt(t),null;case 10:return Dm(t.type._context),Pt(t),null;case 17:return Jt(t.type)&&ou(),Pt(t),null;case 19:if(qe(Qe),o=t.memoizedState,o===null)return Pt(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Ji(o,!1);else{if(gt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=fu(e),i!==null){for(t.flags|=128,Ji(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return We(Qe,Qe.current&1|2),t.child}e=e.sibling}o.tail!==null&&ct()>ki&&(t.flags|=128,r=!0,Ji(o,!1),t.lanes=4194304)}else{if(!r)if(e=fu(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ji(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Ke)return Pt(t),null}else 2*ct()-o.renderingStartTime>ki&&n!==1073741824&&(t.flags|=128,r=!0,Ji(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ct(),t.sibling=null,n=Qe.current,We(Qe,r?n&1|2:n&1),t):(Pt(t),null);case 22:case 23:return Jm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?on&1073741824&&(Pt(t),t.subtreeFlags&6&&(t.flags|=8192)):Pt(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function _P(e,t){switch(Om(t),t.tag){case 1:return Jt(t.type)&&ou(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Si(),qe(Zt),qe(At),Bm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Hm(t),null;case 13:if(qe(Qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe(Qe),null;case 4:return Si(),null;case 10:return Dm(t.type._context),null;case 22:case 23:return Jm(),null;case 24:return null;default:return null}}var tc=!1,Ot=!1,OP=typeof WeakSet=="function"?WeakSet:Set,ae=null;function Ho(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nt(e,t,r)}else n.current=null}function ip(e,t,n){try{n()}catch(r){nt(e,t,r)}}var zx=!1;function MP(e,t){if(Vh=tu,e=Yb(),jm(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,l=-1,a=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==n||s!==0&&d.nodeType!==3||(l=i+s),d!==o||r!==0&&d.nodeType!==3||(a=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++c===s&&(l=i),f===o&&++u===r&&(a=i),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wh={focusedElem:e,selectionRange:n},tu=!1,ae=t;ae!==null;)if(t=ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ae=e;else for(;ae!==null;){t=ae;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,b=y.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:On(t.type,v),b);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(w){nt(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ae=e;break}ae=t.return}return y=zx,zx=!1,y}function El(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&ip(t,n,o)}s=s.next}while(s!==r)}}function ad(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function lp(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function W1(e){var t=e.alternate;t!==null&&(e.alternate=null,W1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nr],delete t[Hl],delete t[Kh],delete t[gP],delete t[xP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function U1(e){return e.tag===5||e.tag===3||e.tag===4}function Dx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||U1(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ap(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=su));else if(r!==4&&(e=e.child,e!==null))for(ap(e,t,n),e=e.sibling;e!==null;)ap(e,t,n),e=e.sibling}function cp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(cp(e,t,n),e=e.sibling;e!==null;)cp(e,t,n),e=e.sibling}var bt=null,zn=!1;function Br(e,t,n){for(n=n.child;n!==null;)q1(e,t,n),n=n.sibling}function q1(e,t,n){if(sr&&typeof sr.onCommitFiberUnmount=="function")try{sr.onCommitFiberUnmount(ed,n)}catch{}switch(n.tag){case 5:Ot||Ho(n,t);case 6:var r=bt,s=zn;bt=null,Br(e,t,n),bt=r,zn=s,bt!==null&&(zn?(e=bt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):bt.removeChild(n.stateNode));break;case 18:bt!==null&&(zn?(e=bt,n=n.stateNode,e.nodeType===8?xf(e.parentNode,n):e.nodeType===1&&xf(e,n),zl(e)):xf(bt,n.stateNode));break;case 4:r=bt,s=zn,bt=n.stateNode.containerInfo,zn=!0,Br(e,t,n),bt=r,zn=s;break;case 0:case 11:case 14:case 15:if(!Ot&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&ip(n,t,i),s=s.next}while(s!==r)}Br(e,t,n);break;case 1:if(!Ot&&(Ho(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){nt(n,t,l)}Br(e,t,n);break;case 21:Br(e,t,n);break;case 22:n.mode&1?(Ot=(r=Ot)||n.memoizedState!==null,Br(e,t,n),Ot=r):Br(e,t,n);break;default:Br(e,t,n)}}function $x(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new OP),t.forEach(function(r){var s=VP.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function _n(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:bt=l.stateNode,zn=!1;break e;case 3:bt=l.stateNode.containerInfo,zn=!0;break e;case 4:bt=l.stateNode.containerInfo,zn=!0;break e}l=l.return}if(bt===null)throw Error(J(160));q1(o,i,s),bt=null,zn=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(c){nt(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)K1(t,e),t=t.sibling}function K1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(_n(t,e),Gn(e),r&4){try{El(3,e,e.return),ad(3,e)}catch(v){nt(e,e.return,v)}try{El(5,e,e.return)}catch(v){nt(e,e.return,v)}}break;case 1:_n(t,e),Gn(e),r&512&&n!==null&&Ho(n,n.return);break;case 5:if(_n(t,e),Gn(e),r&512&&n!==null&&Ho(n,n.return),e.flags&32){var s=e.stateNode;try{_l(s,"")}catch(v){nt(e,e.return,v)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=n!==null?n.memoizedProps:o,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&mb(s,o),Oh(l,i);var c=Oh(l,o);for(i=0;i<a.length;i+=2){var u=a[i],d=a[i+1];u==="style"?wb(s,d):u==="dangerouslySetInnerHTML"?yb(s,d):u==="children"?_l(s,d):ym(s,u,d,c)}switch(l){case"input":Th(s,o);break;case"textarea":gb(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?qo(s,!!o.multiple,p,!1):f!==!!o.multiple&&(o.defaultValue!=null?qo(s,!!o.multiple,o.defaultValue,!0):qo(s,!!o.multiple,o.multiple?[]:"",!1))}s[Hl]=o}catch(v){nt(e,e.return,v)}}break;case 6:if(_n(t,e),Gn(e),r&4){if(e.stateNode===null)throw Error(J(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(v){nt(e,e.return,v)}}break;case 3:if(_n(t,e),Gn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zl(t.containerInfo)}catch(v){nt(e,e.return,v)}break;case 4:_n(t,e),Gn(e);break;case 13:_n(t,e),Gn(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Xm=ct())),r&4&&$x(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Ot=(c=Ot)||u,_n(t,e),Ot=c):_n(t,e),Gn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(ae=e,u=e.child;u!==null;){for(d=ae=u;ae!==null;){switch(f=ae,p=f.child,f.tag){case 0:case 11:case 14:case 15:El(4,f,f.return);break;case 1:Ho(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){nt(r,n,v)}}break;case 5:Ho(f,f.return);break;case 22:if(f.memoizedState!==null){Lx(d);continue}}p!==null?(p.return=f,ae=p):Lx(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=d.stateNode,a=d.memoizedProps.style,i=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=vb("display",i))}catch(v){nt(e,e.return,v)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(v){nt(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:_n(t,e),Gn(e),r&4&&$x(e);break;case 21:break;default:_n(t,e),Gn(e)}}function Gn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(U1(n)){var r=n;break e}n=n.return}throw Error(J(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(_l(s,""),r.flags&=-33);var o=Dx(e);cp(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=Dx(e);ap(e,l,i);break;default:throw Error(J(161))}}catch(a){nt(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function AP(e,t,n){ae=e,Y1(e)}function Y1(e,t,n){for(var r=(e.mode&1)!==0;ae!==null;){var s=ae,o=s.child;if(s.tag===22&&r){var i=s.memoizedState!==null||tc;if(!i){var l=s.alternate,a=l!==null&&l.memoizedState!==null||Ot;l=tc;var c=Ot;if(tc=i,(Ot=a)&&!c)for(ae=s;ae!==null;)i=ae,a=i.child,i.tag===22&&i.memoizedState!==null?Hx(s):a!==null?(a.return=i,ae=a):Hx(s);for(;o!==null;)ae=o,Y1(o),o=o.sibling;ae=s,tc=l,Ot=c}Fx(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,ae=o):Fx(e)}}function Fx(e){for(;ae!==null;){var t=ae;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ot||ad(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ot)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:On(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Ex(t,o,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ex(t,i,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&zl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}Ot||t.flags&512&&lp(t)}catch(f){nt(t,t.return,f)}}if(t===e){ae=null;break}if(n=t.sibling,n!==null){n.return=t.return,ae=n;break}ae=t.return}}function Lx(e){for(;ae!==null;){var t=ae;if(t===e){ae=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ae=n;break}ae=t.return}}function Hx(e){for(;ae!==null;){var t=ae;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ad(4,t)}catch(a){nt(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(a){nt(t,s,a)}}var o=t.return;try{lp(t)}catch(a){nt(t,o,a)}break;case 5:var i=t.return;try{lp(t)}catch(a){nt(t,i,a)}}}catch(a){nt(t,t.return,a)}if(t===e){ae=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ae=l;break}ae=t.return}}var zP=Math.ceil,mu=Dr.ReactCurrentDispatcher,Gm=Dr.ReactCurrentOwner,Cn=Dr.ReactCurrentBatchConfig,_e=0,wt=null,ut=null,kt=0,on=0,Bo=Ts(0),gt=0,Kl=null,lo=0,cd=0,Qm=0,kl=null,Yt=null,Xm=0,ki=1/0,gr=null,gu=!1,up=null,ms=null,nc=!1,as=null,xu=0,Cl=0,dp=null,Dc=-1,$c=0;function Bt(){return _e&6?ct():Dc!==-1?Dc:Dc=ct()}function gs(e){return e.mode&1?_e&2&&kt!==0?kt&-kt:vP.transition!==null?($c===0&&($c=_b()),$c):(e=Le,e!==0||(e=window.event,e=e===void 0?16:Fb(e.type)),e):1}function Bn(e,t,n,r){if(50<Cl)throw Cl=0,dp=null,Error(J(185));wa(e,n,r),(!(_e&2)||e!==wt)&&(e===wt&&(!(_e&2)&&(cd|=n),gt===4&&Xr(e,kt)),en(e,r),n===1&&_e===0&&!(t.mode&1)&&(ki=ct()+500,od&&Ps()))}function en(e,t){var n=e.callbackNode;vT(e,t);var r=eu(e,e===wt?kt:0);if(r===0)n!==null&&Q0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Q0(n),t===1)e.tag===0?yP(Bx.bind(null,e)):s1(Bx.bind(null,e)),pP(function(){!(_e&6)&&Ps()}),n=null;else{switch(Ob(r)){case 1:n=Em;break;case 4:n=Ib;break;case 16:n=Jc;break;case 536870912:n=jb;break;default:n=Jc}n=nS(n,G1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function G1(e,t){if(Dc=-1,$c=0,_e&6)throw Error(J(327));var n=e.callbackNode;if(Xo()&&e.callbackNode!==n)return null;var r=eu(e,e===wt?kt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=yu(e,r);else{t=r;var s=_e;_e|=2;var o=X1();(wt!==e||kt!==t)&&(gr=null,ki=ct()+500,Js(e,t));do try{FP();break}catch(l){Q1(e,l)}while(!0);zm(),mu.current=o,_e=s,ut!==null?t=0:(wt=null,kt=0,t=gt)}if(t!==0){if(t===2&&(s=$h(e),s!==0&&(r=s,t=fp(e,s))),t===1)throw n=Kl,Js(e,0),Xr(e,r),en(e,ct()),n;if(t===6)Xr(e,r);else{if(s=e.current.alternate,!(r&30)&&!DP(s)&&(t=yu(e,r),t===2&&(o=$h(e),o!==0&&(r=o,t=fp(e,o))),t===1))throw n=Kl,Js(e,0),Xr(e,r),en(e,ct()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(J(345));case 2:As(e,Yt,gr);break;case 3:if(Xr(e,r),(r&130023424)===r&&(t=Xm+500-ct(),10<t)){if(eu(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Bt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=qh(As.bind(null,e,Yt,gr),t);break}As(e,Yt,gr);break;case 4:if(Xr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-Hn(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=ct()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zP(r/1960))-r,10<r){e.timeoutHandle=qh(As.bind(null,e,Yt,gr),r);break}As(e,Yt,gr);break;case 5:As(e,Yt,gr);break;default:throw Error(J(329))}}}return en(e,ct()),e.callbackNode===n?G1.bind(null,e):null}function fp(e,t){var n=kl;return e.current.memoizedState.isDehydrated&&(Js(e,t).flags|=256),e=yu(e,t),e!==2&&(t=Yt,Yt=n,t!==null&&hp(t)),e}function hp(e){Yt===null?Yt=e:Yt.push.apply(Yt,e)}function DP(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],o=s.getSnapshot;s=s.value;try{if(!Vn(o(),s))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 Xr(e,t){for(t&=~Qm,t&=~cd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Hn(t),r=1<<n;e[n]=-1,t&=~r}}function Bx(e){if(_e&6)throw Error(J(327));Xo();var t=eu(e,0);if(!(t&1))return en(e,ct()),null;var n=yu(e,t);if(e.tag!==0&&n===2){var r=$h(e);r!==0&&(t=r,n=fp(e,r))}if(n===1)throw n=Kl,Js(e,0),Xr(e,t),en(e,ct()),n;if(n===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,As(e,Yt,gr),en(e,ct()),null}function Zm(e,t){var n=_e;_e|=1;try{return e(t)}finally{_e=n,_e===0&&(ki=ct()+500,od&&Ps())}}function ao(e){as!==null&&as.tag===0&&!(_e&6)&&Xo();var t=_e;_e|=1;var n=Cn.transition,r=Le;try{if(Cn.transition=null,Le=1,e)return e()}finally{Le=r,Cn.transition=n,_e=t,!(_e&6)&&Ps()}}function Jm(){on=Bo.current,qe(Bo)}function Js(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,hP(n)),ut!==null)for(n=ut.return;n!==null;){var r=n;switch(Om(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ou();break;case 3:Si(),qe(Zt),qe(At),Bm();break;case 5:Hm(r);break;case 4:Si();break;case 13:qe(Qe);break;case 19:qe(Qe);break;case 10:Dm(r.type._context);break;case 22:case 23:Jm()}n=n.return}if(wt=e,ut=e=xs(e.current,null),kt=on=t,gt=0,Kl=null,Qm=cd=lo=0,Yt=kl=null,Fs!==null){for(t=0;t<Fs.length;t++)if(n=Fs[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var i=o.next;o.next=s,r.next=i}n.pending=r}Fs=null}return e}function Q1(e,t){do{var n=ut;try{if(zm(),Mc.current=pu,hu){for(var r=Ze.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}hu=!1}if(io=0,vt=mt=Ze=null,Sl=!1,Wl=0,Gm.current=null,n===null||n.return===null){gt=1,Kl=t,ut=null;break}e:{var o=e,i=n.return,l=n,a=t;if(t=kt,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,u=l,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=Px(i);if(p!==null){p.flags&=-257,Ix(p,i,l,o,t),p.mode&1&&Tx(o,c,t),t=p,a=c;var y=t.updateQueue;if(y===null){var v=new Set;v.add(a),t.updateQueue=v}else y.add(a);break e}else{if(!(t&1)){Tx(o,c,t),eg();break e}a=Error(J(426))}}else if(Ke&&l.mode&1){var b=Px(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Ix(b,i,l,o,t),Mm(Ei(a,l));break e}}o=a=Ei(a,l),gt!==4&&(gt=2),kl===null?kl=[o]:kl.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=O1(o,a,t);Sx(o,g);break e;case 1:l=a;var m=o.type,x=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ms===null||!ms.has(x)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=M1(o,l,t);Sx(o,w);break e}}o=o.return}while(o!==null)}J1(n)}catch(E){t=E,ut===n&&n!==null&&(ut=n=n.return);continue}break}while(!0)}function X1(){var e=mu.current;return mu.current=pu,e===null?pu:e}function eg(){(gt===0||gt===3||gt===2)&&(gt=4),wt===null||!(lo&268435455)&&!(cd&268435455)||Xr(wt,kt)}function yu(e,t){var n=_e;_e|=2;var r=X1();(wt!==e||kt!==t)&&(gr=null,Js(e,t));do try{$P();break}catch(s){Q1(e,s)}while(!0);if(zm(),_e=n,mu.current=r,ut!==null)throw Error(J(261));return wt=null,kt=0,gt}function $P(){for(;ut!==null;)Z1(ut)}function FP(){for(;ut!==null&&!uT();)Z1(ut)}function Z1(e){var t=tS(e.alternate,e,on);e.memoizedProps=e.pendingProps,t===null?J1(e):ut=t,Gm.current=null}function J1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=_P(n,t),n!==null){n.flags&=32767,ut=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{gt=6,ut=null;return}}else if(n=jP(n,t,on),n!==null){ut=n;return}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);gt===0&&(gt=5)}function As(e,t,n){var r=Le,s=Cn.transition;try{Cn.transition=null,Le=1,LP(e,t,n,r)}finally{Cn.transition=s,Le=r}return null}function LP(e,t,n,r){do Xo();while(as!==null);if(_e&6)throw Error(J(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(J(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(wT(e,o),e===wt&&(ut=wt=null,kt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||nc||(nc=!0,nS(Jc,function(){return Xo(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Cn.transition,Cn.transition=null;var i=Le;Le=1;var l=_e;_e|=4,Gm.current=null,MP(e,n),K1(n,e),iP(Wh),tu=!!Vh,Wh=Vh=null,e.current=n,AP(n),dT(),_e=l,Le=i,Cn.transition=o}else e.current=n;if(nc&&(nc=!1,as=e,xu=s),o=e.pendingLanes,o===0&&(ms=null),pT(n.stateNode),en(e,ct()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(gu)throw gu=!1,e=up,up=null,e;return xu&1&&e.tag!==0&&Xo(),o=e.pendingLanes,o&1?e===dp?Cl++:(Cl=0,dp=e):Cl=0,Ps(),null}function Xo(){if(as!==null){var e=Ob(xu),t=Cn.transition,n=Le;try{if(Cn.transition=null,Le=16>e?16:e,as===null)var r=!1;else{if(e=as,as=null,xu=0,_e&6)throw Error(J(331));var s=_e;for(_e|=4,ae=e.current;ae!==null;){var o=ae,i=o.child;if(ae.flags&16){var l=o.deletions;if(l!==null){for(var a=0;a<l.length;a++){var c=l[a];for(ae=c;ae!==null;){var u=ae;switch(u.tag){case 0:case 11:case 15:El(8,u,o)}var d=u.child;if(d!==null)d.return=u,ae=d;else for(;ae!==null;){u=ae;var f=u.sibling,p=u.return;if(W1(u),u===c){ae=null;break}if(f!==null){f.return=p,ae=f;break}ae=p}}}var y=o.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}ae=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,ae=i;else e:for(;ae!==null;){if(o=ae,o.flags&2048)switch(o.tag){case 0:case 11:case 15:El(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,ae=g;break e}ae=o.return}}var m=e.current;for(ae=m;ae!==null;){i=ae;var x=i.child;if(i.subtreeFlags&2064&&x!==null)x.return=i,ae=x;else e:for(i=m;ae!==null;){if(l=ae,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ad(9,l)}}catch(E){nt(l,l.return,E)}if(l===i){ae=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,ae=w;break e}ae=l.return}}if(_e=s,Ps(),sr&&typeof sr.onPostCommitFiberRoot=="function")try{sr.onPostCommitFiberRoot(ed,e)}catch{}r=!0}return r}finally{Le=n,Cn.transition=t}}return!1}function Vx(e,t,n){t=Ei(n,t),t=O1(e,t,1),e=ps(e,t,1),t=Bt(),e!==null&&(wa(e,1,t),en(e,t))}function nt(e,t,n){if(e.tag===3)Vx(e,e,n);else for(;t!==null;){if(t.tag===3){Vx(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ms===null||!ms.has(r))){e=Ei(n,e),e=M1(t,e,1),t=ps(t,e,1),e=Bt(),t!==null&&(wa(t,1,e),en(t,e));break}}t=t.return}}function HP(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Bt(),e.pingedLanes|=e.suspendedLanes&n,wt===e&&(kt&n)===n&&(gt===4||gt===3&&(kt&130023424)===kt&&500>ct()-Xm?Js(e,0):Qm|=n),en(e,t)}function eS(e,t){t===0&&(e.mode&1?(t=qa,qa<<=1,!(qa&130023424)&&(qa=4194304)):t=1);var n=Bt();e=_r(e,t),e!==null&&(wa(e,t,n),en(e,n))}function BP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),eS(e,n)}function VP(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(J(314))}r!==null&&r.delete(t),eS(e,n)}var tS;tS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Zt.current)Gt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Gt=!1,IP(e,t,n);Gt=!!(e.flags&131072)}else Gt=!1,Ke&&t.flags&1048576&&o1(t,au,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zc(e,t),e=t.pendingProps;var s=vi(t,At.current);Qo(t,n),s=Wm(null,t,r,e,s,n);var o=Um();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jt(r)?(o=!0,iu(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Fm(t),s.updater=ld,t.stateNode=s,s._reactInternals=t,Jh(t,r,e,n),t=np(null,t,r,!0,o,n)):(t.tag=0,Ke&&o&&_m(t),Lt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zc(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=UP(r),e=On(r,e),s){case 0:t=tp(null,t,r,e,n);break e;case 1:t=Ox(null,t,r,e,n);break e;case 11:t=jx(null,t,r,e,n);break e;case 14:t=_x(null,t,r,On(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:On(r,s),tp(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:On(r,s),Ox(e,t,r,s,n);case 3:e:{if($1(t),e===null)throw Error(J(387));r=t.pendingProps,o=t.memoizedState,s=o.element,d1(e,t),du(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Ei(Error(J(423)),t),t=Mx(e,t,r,n,s);break e}else if(r!==s){s=Ei(Error(J(424)),t),t=Mx(e,t,r,n,s);break e}else for(an=hs(t.stateNode.containerInfo.firstChild),cn=t,Ke=!0,$n=null,n=c1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wi(),r===s){t=Or(e,t,n);break e}Lt(e,t,r,n)}t=t.child}return t;case 5:return f1(t),e===null&&Qh(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,Uh(r,s)?i=null:o!==null&&Uh(r,o)&&(t.flags|=32),D1(e,t),Lt(e,t,i,n),t.child;case 6:return e===null&&Qh(t),null;case 13:return F1(e,t,n);case 4:return Lm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bi(t,null,r,n):Lt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:On(r,s),jx(e,t,r,s,n);case 7:return Lt(e,t,t.pendingProps,n),t.child;case 8:return Lt(e,t,t.pendingProps.children,n),t.child;case 12:return Lt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,We(cu,r._currentValue),r._currentValue=i,o!==null)if(Vn(o.value,i)){if(o.children===s.children&&!Zt.current){t=Or(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){i=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=Cr(-1,n&-n),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?a.next=a:(a.next=u.next,u.next=a),c.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Xh(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(J(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Xh(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}Lt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Qo(t,n),s=Rn(s),r=r(s),t.flags|=1,Lt(e,t,r,n),t.child;case 14:return r=t.type,s=On(r,t.pendingProps),s=On(r.type,s),_x(e,t,r,s,n);case 15:return A1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:On(r,s),zc(e,t),t.tag=1,Jt(r)?(e=!0,iu(t)):e=!1,Qo(t,n),_1(t,r,s),Jh(t,r,s,n),np(null,t,r,!0,e,n);case 19:return L1(e,t,n);case 22:return z1(e,t,n)}throw Error(J(156,t.tag))};function nS(e,t){return Pb(e,t)}function WP(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.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 En(e,t,n,r){return new WP(e,t,n,r)}function tg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function UP(e){if(typeof e=="function")return tg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===wm)return 11;if(e===bm)return 14}return 2}function xs(e,t){var n=e.alternate;return n===null?(n=En(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&14680064,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}function Fc(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")tg(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case _o:return eo(n.children,s,o,t);case vm:i=8,s|=8;break;case Eh:return e=En(12,n,t,s|2),e.elementType=Eh,e.lanes=o,e;case kh:return e=En(13,n,t,s),e.elementType=kh,e.lanes=o,e;case Ch:return e=En(19,n,t,s),e.elementType=Ch,e.lanes=o,e;case fb:return ud(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ub:i=10;break e;case db:i=9;break e;case wm:i=11;break e;case bm:i=14;break e;case Kr:i=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=En(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function eo(e,t,n,r){return e=En(7,e,r,t),e.lanes=n,e}function ud(e,t,n,r){return e=En(22,e,r,t),e.elementType=fb,e.lanes=n,e.stateNode={isHidden:!1},e}function Cf(e,t,n){return e=En(6,e,null,t),e.lanes=n,e}function Nf(e,t,n){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qP(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=of(0),this.expirationTimes=of(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=of(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ng(e,t,n,r,s,o,i,l,a){return e=new qP(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=En(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fm(o),e}function KP(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:jo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function rS(e){if(!e)return bs;e=e._reactInternals;e:{if(yo(e)!==e||e.tag!==1)throw Error(J(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(J(171))}if(e.tag===1){var n=e.type;if(Jt(n))return r1(e,n,t)}return t}function sS(e,t,n,r,s,o,i,l,a){return e=ng(n,r,!0,e,s,o,i,l,a),e.context=rS(null),n=e.current,r=Bt(),s=gs(n),o=Cr(r,s),o.callback=t??null,ps(n,o,s),e.current.lanes=s,wa(e,s,r),en(e,r),e}function dd(e,t,n,r){var s=t.current,o=Bt(),i=gs(s);return n=rS(n),t.context===null?t.context=n:t.pendingContext=n,t=Cr(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ps(s,t,i),e!==null&&(Bn(e,s,i,o),Oc(e,s,i)),i}function vu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Wx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function rg(e,t){Wx(e,t),(e=e.alternate)&&Wx(e,t)}function YP(){return null}var oS=typeof reportError=="function"?reportError:function(e){console.error(e)};function sg(e){this._internalRoot=e}fd.prototype.render=sg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));dd(e,t,null,null)};fd.prototype.unmount=sg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ao(function(){dd(null,e,null,null)}),t[jr]=null}};function fd(e){this._internalRoot=e}fd.prototype.unstable_scheduleHydration=function(e){if(e){var t=zb();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Qr.length&&t!==0&&t<Qr[n].priority;n++);Qr.splice(n,0,e),n===0&&$b(e)}};function og(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function hd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ux(){}function GP(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=vu(i);o.call(c)}}var i=sS(t,r,e,0,null,!1,!1,"",Ux);return e._reactRootContainer=i,e[jr]=i.current,Fl(e.nodeType===8?e.parentNode:e),ao(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var c=vu(a);l.call(c)}}var a=ng(e,0,!1,null,null,!1,!1,"",Ux);return e._reactRootContainer=a,e[jr]=a.current,Fl(e.nodeType===8?e.parentNode:e),ao(function(){dd(t,a,n,r)}),a}function pd(e,t,n,r,s){var o=n._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var l=s;s=function(){var a=vu(i);l.call(a)}}dd(t,i,e,s)}else i=GP(n,t,e,s,r);return vu(i)}Mb=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dl(t.pendingLanes);n!==0&&(km(t,n|1),en(t,ct()),!(_e&6)&&(ki=ct()+500,Ps()))}break;case 13:ao(function(){var r=_r(e,1);if(r!==null){var s=Bt();Bn(r,e,1,s)}}),rg(e,1)}};Cm=function(e){if(e.tag===13){var t=_r(e,134217728);if(t!==null){var n=Bt();Bn(t,e,134217728,n)}rg(e,134217728)}};Ab=function(e){if(e.tag===13){var t=gs(e),n=_r(e,t);if(n!==null){var r=Bt();Bn(n,e,t,r)}rg(e,t)}};zb=function(){return Le};Db=function(e,t){var n=Le;try{return Le=e,t()}finally{Le=n}};Ah=function(e,t,n){switch(t){case"input":if(Th(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=sd(r);if(!s)throw Error(J(90));pb(r),Th(r,s)}}}break;case"textarea":gb(e,n);break;case"select":t=n.value,t!=null&&qo(e,!!n.multiple,t,!1)}};Eb=Zm;kb=ao;var QP={usingClientEntryPoint:!1,Events:[Sa,zo,sd,bb,Sb,Zm]},el={findFiberByHostInstance:$s,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},XP={bundleType:el.bundleType,version:el.version,rendererPackageName:el.rendererPackageName,rendererConfig:el.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Dr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Rb(e),e===null?null:e.stateNode},findFiberByHostInstance:el.findFiberByHostInstance||YP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{ed=rc.inject(XP),sr=rc}catch{}}pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QP;pn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!og(t))throw Error(J(200));return KP(e,t,null,n)};pn.createRoot=function(e,t){if(!og(e))throw Error(J(299));var n=!1,r="",s=oS;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=ng(e,1,!1,null,null,n,!1,r,s),e[jr]=t.current,Fl(e.nodeType===8?e.parentNode:e),new sg(t)};pn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=Rb(t),e=e===null?null:e.stateNode,e};pn.flushSync=function(e){return ao(e)};pn.hydrate=function(e,t,n){if(!hd(t))throw Error(J(200));return pd(null,e,t,!0,n)};pn.hydrateRoot=function(e,t,n){if(!og(e))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=oS;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=sS(t,null,e,1,n??null,s,!1,o,i),e[jr]=t.current,Fl(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new fd(t)};pn.render=function(e,t,n){if(!hd(t))throw Error(J(200));return pd(null,e,t,!1,n)};pn.unmountComponentAtNode=function(e){if(!hd(e))throw Error(J(40));return e._reactRootContainer?(ao(function(){pd(null,null,e,!1,function(){e._reactRootContainer=null,e[jr]=null})}),!0):!1};pn.unstable_batchedUpdates=Zm;pn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!hd(n))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return pd(e,t,n,!1,r)};pn.version="18.3.1-next-f1338f8080-20240426";function iS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iS)}catch(e){console.error(e)}}iS(),ib.exports=pn;var dn=ib.exports,ZP,qx=dn;ZP=qx.createRoot,qx.hydrateRoot;function JP(e){return typeof e=="object"?e.key:e}function eI(e,t){const n=e.length;return new Proxy(e,{get(r,s,o){if(typeof s=="string"){const i=s.charCodeAt(0);if(i>=48&&i<=57){const l=+s;if(Number.isInteger(l)&&l>=0&&l<n){let a=r[l];if(typeof a!="object"){const c=t[l*2];a=r[l]={index:l,key:a,start:c,size:t[l*2+1],end:c+t[l*2+1],lane:0}}return a}}if(s==="length")return n}return Reflect.get(r,s,o)}})}function Io(e,t,n){let r=n.initialDeps??[],s,o=!0;function i(){const l=e();return(l.length!==r.length||l.some((c,u)=>r[u]!==c))&&(r=l,s=t(...l),n!=null&&n.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(s),o=!1),s}return i.updateDeps=l=>{r=l},i}function Kx(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Yx=(e,t)=>Math.abs(e-t)<1.01,tI=(e,t,n)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)},{cancel:()=>{e.clearTimeout(r)}})};let tl;const Rf=()=>{if(tl!==void 0)return tl;if(typeof navigator>"u")return tl=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return tl=!0;const e=navigator.maxTouchPoints;return tl=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Gx=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},nI=e=>e,rI=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,s=new Array(r);for(let o=0;o<r;o++)s[o]=t+o;return s},sI=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=i=>{const{width:l,height:a}=i;t({width:Math.round(l),height:Math.round(a)})};if(s(Gx(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const l=()=>{const a=i[0];if(a!=null&&a.borderBoxSize){const c=a.borderBoxSize[0];if(c){s({width:c.inlineSize,height:c.blockSize});return}}s(Gx(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},wu={passive:!0},oI=typeof window>"u"?!0:"onscrollend"in window,iI=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const o=e.options.useScrollendEvent&&oI;let i=0;const l=o?null:tI(s,()=>t(n(r),!1),e.options.isScrollingResetDelay),a=d=>()=>{i=n(r),l==null||l(),t(i,d)},c=a(!0),u=a(!1);return r.addEventListener("scroll",c,wu),o&&r.addEventListener("scrollend",u,wu),()=>{r.removeEventListener("scroll",c),o&&r.removeEventListener("scrollend",u),l==null||l.cancel()}},lI=(e,t)=>iI(e,t,n=>{const{horizontal:r,isRtl:s}=e.options;return r?n.scrollLeft*(s&&-1||1):n.scrollTop}),aI=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),s=n.options.getItemKey(r);return n.itemSizeCache.get(s)??n.options.estimateSize(r)}if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),s=n.options.getItemKey(r),o=n.itemSizeCache.get(s);if(o!==void 0)return o}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},cI=(e,{adjustments:t=0,behavior:n},r)=>{var s,o;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},uI=cI;function dI(e,t,n,r){if(t===0)return!1;const s=r(0),o=new Set;let i=0;for(;i<e;){const a=n(i);if(a===s)break;o.add(a),i++}const l=e-i;if(l===0||l>=t)return!1;for(let a=0;a<l;a++)if(r(a)!==n(i+a))return!1;for(let a=l;a<t;a++)if(o.has(r(a)))return!1;return!0}class fI{constructor(t){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.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var n,r,s;return((s=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{const l=o.target,a=this.indexFromElement(l);if(!l.isConnected){this.observer.unobserve(l);for(const[c,u]of this.elementsCache)if(u===l){this.elementsCache.delete(c);break}return}this.isIndexInRange(a)&&this.shouldMeasureDuringScroll(a)&&this.resizeItem(a,this.options.measureElement(l,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{var r;const s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:nI,rangeExtractor:rI,onChange:()=>{},measureElement:aI,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const d in n){const f=n[d];f!==void 0&&(s[d]=f)}const o=this.options;let i=null,l=null,a=!1;if(o!==void 0&&o.enabled&&s.enabled&&s.anchorTo==="end"&&this.scrollElement!==null){const d=o.count,f=s.count,p=this.getMeasurements(),y=((r=this._singleLaneMeasurements)==null?void 0:r.items)??p,v=w=>JP(y[w]),b=d>0?v(0):null,g=d>0?v(d-1):null;if(f!==d||d>0&&f>0&&(s.getItemKey(0)!==b||s.getItemKey(f-1)!==g)){a=!0;const w=d>0?this.getVirtualItemForOffset(this.getScrollOffset())??p[0]:null;w&&(i=[w.key,this.getScrollOffset()-w.start]);const E=s.followOnAppend===!0?"auto":s.followOnAppend||null;E&&f>0&&this.isAtEnd(o.scrollEndThreshold)&&(d===0||s.getItemKey(f-1)!==g)&&(f>d||dI(d,f,v,s.getItemKey))&&(l=E)}}this.options=s,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=!1,u=0;if(i&&this.scrollOffset!==null){const[d,f]=i,p=this.getMeasurements(),{count:y,getItemKey:v}=this.options;let b=0;for(;b<y&&v(b)!==d;)b++;if(b<y){const g=p[b];if(g){const m=Math.max(0,g.start+f);!l&&m!==this.scrollOffset&&(u=m-this.scrollOffset,this.scrollOffset=m,c=!0)}}}(c||l)&&(this.pendingScrollAnchor=[c?i[0]:null,c?i[1]:0,l,u])},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=Io(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n,r;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}if(this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,l)=>{if(l&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const a=this.getScrollOffset();this.scrollDirection=l?a===i?this.scrollDirection:a<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!Rf()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",l,wu),i.addEventListener("touchend",a,wu),this.unsubs.push(()=>{i.removeEventListener("touchstart",l),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[i,l,a,c]=o;i!==null&&!a&&(Rf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?c!==0&&(this._iosDeferredAdjustment+=c):((r=this.scrollState)==null?void 0:r.behavior)==="smooth"&&!Yx(this.getScrollOffset()-c,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:n,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=n>s+.5?{target:n,maxAtWrite:s}:null,this._scrollToOffset(n,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Io(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,s,o,i,l,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:a,gap:c}),{key:!1}),this.isIndexInRange=n=>n>=0&&n<this.options.count,this.getMeasurements=Io(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:a,gap:c},u)=>{var d;const f=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const m of this.laneAssignments.keys())m>=n&&this.laneAssignments.delete(m);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(m=>{this.itemSizeCache.set(m.key,m.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),l===1){const m=n*2;let x=(d=this._singleLaneMeasurements)==null?void 0:d.flat;if(!x||x.length<m){const k=new Float64Array(m);x&&p>0&&k.set(x.subarray(0,p*2)),x=k}const w=p===0?new Array(n):this._singleLaneMeasurements.items.slice();let E;if(p===0)E=r+s;else{const k=p-1;E=x[k*2]+x[k*2+1]+c}for(let k=p;k<n;k++){const C=o(k);w[k]=C;const P=f.get(C),I=typeof P=="number"?P:this.options.estimateSize(k);x[k*2]=E,x[k*2+1]=I,E+=I+c}this._singleLaneMeasurements={flat:x,items:w};const N=eI(w,x);return this.measurementsCache=N,N}const y=this.measurementsCache.slice(0,p),v=new Array(l).fill(void 0),b=new Float64Array(l);let g=0;for(let m=0;m<p;m++){const x=y[m];x&&(v[x.lane]===void 0&&g++,v[x.lane]=m,b[x.lane]=x.end)}for(let m=p;m<n;m++){const x=o(m),w=this.laneAssignments.get(m);let E,N;const k=a==="estimate"||f.has(x);if(w!==void 0&&this.options.lanes>1){E=w;const z=v[E],$=z!==void 0?y[z]:void 0;N=$?$.end+c:r+s}else if(g===l){let z=0,$=b[0],A=v[0];for(let R=1;R<l;R++){const j=b[R];(j<$||j===$&&v[R]<A)&&(z=R,$=j,A=v[R])}E=z,N=$+c,k&&this.laneAssignments.set(m,E)}else E=m%this.options.lanes,N=r+s,k&&this.laneAssignments.set(m,E);const C=f.get(x),P=typeof C=="number"?C:this.options.estimateSize(m),I=N+P;y[m]={index:m,start:N,size:P,end:I,key:x,lane:E},v[E]===void 0&&g++,v[E]=m,b[E]=I}return this.measurementsCache=y,y},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Io(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,o)=>n.length===0||r===0?(this.range=null,null):(this.range=pI(n,r,s,o,o===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Io(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,o,i)=>o===null||i===null?[]:n({startIndex:o,endIndex:i,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,s-o),l=Math.min(this.options.count-1,s+o);return n>=i&&n<=l}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,l)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(l))});return}const r=this.indexFromElement(n);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),o=this.elementsCache.get(s);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var s,o,i;if(!this.isIndexInRange(n))return;let l,a,c;const u=(s=this._singleLaneMeasurements)==null?void 0:s.flat;if(this.options.lanes===1&&u!=null)c=this.options.getItemKey(n),a=u[n*2],l=u[n*2+1];else{const p=this.measurementsCache[n];if(!p)return;c=p.key,a=p.start,l=p.size}const d=this.itemSizeCache.get(c)??l,f=r-d;if(f!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,y=p?this.getTotalSize():0,v=this.getScrollOffset()+this.scrollAdjustments,g=!this.itemSizeCache.has(c)?a<v:a+d<=v&&this.scrollDirection!=="backward",m=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:c,start:a,size:l,end:a+l,lane:0},f,this):g);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(c,r),this.itemSizeCacheVersion++;let x=!1;p?x=this.applyScrollAdjustment(this.getTotalSize()-y):m&&(x=this.applyScrollAdjustment(f)),this.notify(x),this._retryClampedAdjustment()}},this.getVirtualItems=Io(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let o=0,i=n.length;o<i;o++){const l=n[o],a=r[l];s.push(a)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{var r;const s=this.getMeasurements();if(s.length===0)return;const o=(r=this._singleLaneMeasurements)==null?void 0:r.flat,i=this.options.lanes===1&&o!=null,l=lS(0,s.length-1,i?a=>o[a*2]:a=>Kx(s[a]).start,n);return Kx(s[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+o?"end":"start"),r==="center"?n+=(s-o)/2:r==="end"&&(n-=o);const l=this.getMaxScrollOffset();return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),o=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=o+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const l=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const o=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,r);if(!o)return;const[i,l]=o,a=this.now();this.scrollState={index:n,align:l,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:o,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n,r;const s=this.getMeasurements();let o;if(s.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const i=s.length-1,l=(n=this._singleLaneMeasurements)==null?void 0:n.flat;l!=null?o=l[i*2]+l[i*2+1]:o=((r=s[i])==null?void 0:r.end)??0}else{const i=Array(this.options.lanes).fill(null);let l=s.length-1;for(;l>=0&&i.some(a=>a===null);){const a=s[l];i[a.lane]===null&&(i[a.lane]=a.end),l--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&n.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){if(t===0)return!1;if(Rf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=t,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+t,s=this.scrollElement,o=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=o!==null&&r>o+.5?{target:r,maxAtWrite:o}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,o=1,i=s!==this.scrollState.lastTargetOffset;if(!i&&Yx(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,i){const l=this.getSize()||600,a=Math.abs(s-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&a>l;this.scrollState.lastTargetOffset=s,c||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const lS=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,o=n(s);if(o<r)e=s+1;else if(o>r)t=s-1;else return s}return e>0?e-1:0};function hI(e,t,n){let r=0;for(;r<=t;){const s=(r+t)/2|0,o=e[s*2];if(o<n)r=s+1;else if(o>n)t=s-1;else return s}return r>0?r-1:0}function pI(e,t,n,r,s){const o=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:o};if(r===1&&s!==null){const c=hI(s,o,n);let u=c;const d=n+t;for(;u<o&&s[u*2]+s[u*2+1]<d;)u++;return{startIndex:c,endIndex:u}}let l=lS(0,o,c=>e[c].start,n),a=l;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const c=Array(r).fill(0);for(;a<o&&c.some(d=>d<n+t);){const d=e[a];c[d.lane]=d.end,a++}const u=Array(r).fill(n+t);for(;l>=0&&u.some(d=>d>=n);){const d=e[l];u[d.lane]=d.start,l--}l=Math.max(0,l-l%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:l,endIndex:a}}const Tf=typeof document<"u"?S.useLayoutEffect:S.useEffect;function mI({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const s=S.useReducer(d=>d+1,0)[1],o=S.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=n;const i=S.useRef(!1),l=d=>{const f=o.current;if(!f.enabled||!f.container)return;const p=d.getTotalSize();if(p!==f.lastSize){f.lastSize=p;const y=d.options.horizontal?"width":"height";f.container.style[y]=`${p}px`}},a=d=>{const f=o.current;if(!f.enabled||!f.container)return;l(d);const p=!!d.options.horizontal,y=f.mode==="transform",v=p?"left":"top",b=d.options.scrollMargin,g=d.getVirtualItems();for(const m of g){const x=m.start-b,w=d.elementsCache.get(m.key);w&&f.lastPositions.get(w)!==x&&(f.lastPositions.set(w,x),y?w.style.transform=p?`translate3d(${x}px, 0, 0)`:`translate3d(0, ${x}px, 0)`:w.style[v]=`${x}px`)}},c={...r,onChange:(d,f)=>{var p;const y=o.current;let v=!0;if(y.enabled){a(d);const b=d.range,g=y.prevRange;v=!g||g.isScrolling!==d.isScrolling||g.startIndex!==(b==null?void 0:b.startIndex)||g.endIndex!==(b==null?void 0:b.endIndex),v&&(y.prevRange=b?{startIndex:b.startIndex,endIndex:b.endIndex,isScrolling:d.isScrolling}:null)}v&&(e&&f&&!i.current?dn.flushSync(s):s()),(p=r.onChange)==null||p.call(r,d,f)}},[u]=S.useState(()=>{const d=new fI(c),f=d.measureElement;return d.measureElement=p=>{i.current=!0;try{f(p)}finally{i.current=!1}},Object.assign(d,{containerRef:p=>{const y=o.current;if(y.container=p,y.lastSize=null,p&&y.enabled){const v=d.getTotalSize();y.lastSize=v;const b=d.options.horizontal?"width":"height";p.style[b]=`${v}px`}}})});return u.setOptions(c),Tf(()=>u._didMount(),[]),Tf(()=>(l(u),u._willUpdate())),Tf(()=>{a(u)}),u}function ig(e){return mI({observeElementRect:sI,observeElementOffset:lI,scrollToFn:uI,...e})}function Sn(e){return encodeURIComponent(String(e))}function Vo(e,t){const n=[],r=s=>t!=null&&t.prefix?`${t.prefix}[${Sn(s)}]`:Sn(s);for(const[s,o]of Object.entries(e))if(o!=null)if(Array.isArray(o))for(const i of o)n.push(`${r(s)}[]=${Sn(i)}`);else if(typeof o=="object")for(const[i,l]of Object.entries(o))l!=null&&n.push(`${r(s)}[${Sn(i)}]=${Sn(l)}`);else n.push(`${r(s)}=${Sn(o)}`);return n.join("&")}function aS(e,t){const n=[];return pp(e,(t==null?void 0:t.prefix)??"where",n),n.join("&")}function gI(e){var s;const t=[],{where:n,...r}=e.filter??{};if(n!=null&&n.length&&t.push(aS(n,{prefix:"filter[where]"})),t.push(Vo(r,{prefix:"filter"})),e.search&&t.push(`search=${Sn(e.search)}`),(s=e.sort)!=null&&s.length){const o=e.sort.map(i=>`${i.direction==="desc"?"-":""}${i.field}`).join(",");t.push(`sort=${Sn(o)}`)}for(const o of["include","distinct","extent"]){const i=e[o];i!=null&&i.length&&t.push(Vo({[o]:i}))}return e.groupByCount&&t.push(Vo({groupByCount:e.groupByCount})),e.paginate&&t.push(Vo({paginate:e.paginate})),t.filter(Boolean).join("&")}function pp(e,t,n){for(let r=0;r<e.length;r++){const s=e[r],o=`${t}[${r}]`;if(s.field!==void 0&&n.push(`${o}[field]=${Sn(s.field)}`),s.operator!==void 0&&n.push(`${o}[operator]=${Sn(s.operator)}`),s.value!==void 0)if(Array.isArray(s.value))for(let i=0;i<s.value.length;i++)n.push(`${o}[value][${i}]=${Sn(s.value[i])}`);else n.push(`${o}[value]=${Sn(s.value)}`);s.AND&&s.AND.length>0&&pp(s.AND,`${o}[AND]`,n),s.OR&&s.OR.length>0&&pp(s.OR,`${o}[OR]`,n)}}const xI=["equals","notEquals","contains","notContains","iContains","startsWith","endsWith","gt","gte","lt","lte","between","notBetween","in","notIn","isAnyOf","isEmpty","isNotEmpty","isNull","isNotNull","exists","notExists"],yI=["equals","notEquals","gt","gte","lt","lte"],vI=["contains","notContains","iContains","startsWith","endsWith"],wI=["in","notIn","isAnyOf"],bI=["between","notBetween"],SI=["isNull","isNotNull","isEmpty","isNotEmpty","exists","notExists"],EI=["gt","gte","lt","lte"],kI=new Set(yI),CI=new Set(vI),NI=new Set(wI),RI=new Set(bI),mp=new Set(SI),TI=new Set(EI);function sc(e,t){if(!mp.has(e)){if(CI.has(e)){if(typeof t!="string")throw new Error(`Operator "${e}" expects a string value.`);return}if(RI.has(e)){if(!Array.isArray(t)||t.length!==2)throw new Error(`Operator "${e}" expects [low, high] tuple.`);return}if(NI.has(e)){if(!Array.isArray(t))throw new Error(`Operator "${e}" expects an array value.`);return}if(kI.has(e)){if(Array.isArray(t))throw new Error(`Operator "${e}" expects a scalar value, not an array. Use "in" for arrays.`);return}}}function PI(e){if(!TI.has(e))throw new Error(`Operator "${e}" should use where() (replace), not add(). add() is for range operators (gt, gte, lt, lte) on the same field.`)}class bu{constructor(){ge(this,"conditions",[]);ge(this,"groups",[]);ge(this,"extra",{});ge(this,"includes",[]);ge(this,"searchTerm");ge(this,"sorts",[]);ge(this,"distinctFields",[]);ge(this,"extentFields",[]);ge(this,"groupByCountSpec");ge(this,"pagination");ge(this,"version",0);ge(this,"snapshot",null);ge(this,"listeners",new Set);ge(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));ge(this,"getSnapshot",()=>(this.snapshot===null&&(this.snapshot=this.build()),this.snapshot))}where(t,n,r){if(this.conditions=this.conditions.filter(s=>s.field!==t),r!==void 0){const s=n;sc(s,r),this.conditions.push({field:t,operator:s,value:mp.has(s)?void 0:r})}else Array.isArray(n)?this.conditions.push({field:t,operator:"in",value:n}):typeof n=="string"&&["isNull","isNotNull","isEmpty","isNotEmpty","exists","notExists"].includes(n)?(sc(n,void 0),this.conditions.push({field:t,operator:n,value:void 0})):this.conditions.push({field:t,operator:"equals",value:n});return this.notify(),this}whereDynamic(t,n,r){if(!xI.includes(n))throw new Error(`Unknown filter operator "${String(n)}".`);return sc(n,r),this.conditions=this.conditions.filter(s=>s.field!==t),this.conditions.push({field:t,operator:n,value:mp.has(n)?void 0:r}),this.notify(),this}fromFilters(t,n){for(const r of t)r.field&&((n==null?void 0:n.skip)!==void 0&&r.field===n.skip||this.whereDynamic(r.field,r.operator,r.value));return this}add(t,n,r){return PI(n),sc(n,r),this.conditions.push({field:t,operator:n,value:r}),this.notify(),this}remove(t){return this.conditions=this.conditions.filter(n=>n.field!==t),this.notify(),this}clear(){return this.conditions=[],this.groups.length=0,this.extra={},this.includes=[],this.searchTerm=void 0,this.sorts=[],this.distinctFields=[],this.extentFields=[],this.groupByCountSpec=void 0,this.pagination=void 0,this.notify(),this}or(t){const n=new bu;return t(n),this.groups.push({type:"OR",conditions:n.conditions}),this.notify(),this}and(t){const n=new bu;return t(n),this.groups.push({type:"AND",conditions:n.conditions}),this.notify(),this}equals(t,n){return this.where(t,"equals",n)}notEquals(t,n){return this.where(t,"notEquals",n)}contains(t,n){return this.where(t,"contains",n)}in(t,n){return this.where(t,"in",n)}notIn(t,n){return this.where(t,"notIn",n)}between(t,n,r){return this.where(t,"between",[n,r])}gt(t,n){return this.where(t,"gt",n)}gte(t,n){return this.where(t,"gte",n)}lt(t,n){return this.where(t,"lt",n)}lte(t,n){return this.where(t,"lte",n)}isNull(t){return this.where(t,"isNull")}isNotNull(t){return this.where(t,"isNotNull")}isEmpty(t){return this.where(t,"isEmpty")}isNotEmpty(t){return this.where(t,"isNotEmpty")}startsWith(t,n){return this.where(t,"startsWith",n)}endsWith(t,n){return this.where(t,"endsWith",n)}addGte(t,n){return this.add(t,"gte",n)}addLte(t,n){return this.add(t,"lte",n)}addGt(t,n){return this.add(t,"gt",n)}addLt(t,n){return this.add(t,"lt",n)}set(t,n){return this.extra[t]=n,this.notify(),this}include(...t){for(const n of t)typeof n=="string"&&(this.includes.includes(n)||this.includes.push(n));return this.notify(),this}search(t){return typeof t!="string"?this:(this.searchTerm=t,this.notify(),this)}distinct(...t){for(const n of t)typeof n=="string"&&(this.distinctFields.includes(n)||this.distinctFields.push(n));return this.notify(),this}extent(...t){for(const n of t)typeof n=="string"&&(this.extentFields.includes(n)||this.extentFields.push(n));return this.notify(),this}groupByCount(t,n){return this.groupByCountSpec={field:t,...(n==null?void 0:n.bucket)!==void 0&&{bucket:n.bucket},...(n==null?void 0:n.limit)!==void 0&&{limit:n.limit},...(n==null?void 0:n.offset)!==void 0&&{offset:n.offset},...(n==null?void 0:n.search)!==void 0&&{search:n.search}},this.notify(),this}sort(t,n="asc"){return this.sorts=this.sorts.filter(r=>r.field!==t),this.sorts.push({field:t,direction:n}),this.notify(),this}sortDesc(t){return this.sort(t,"desc")}sortAsc(t){return this.sort(t,"asc")}sortDynamic(t,n){return this.sort(t,n)}page(t,n=25){return this.pagination={page:t,size:n},this.notify(),this}notify(){this.version++,this.snapshot=null;for(const t of this.listeners)t()}getVersion(){return this.version}build(){const t=[];for(const r of this.conditions)t.push({field:r.field,operator:r.operator,value:r.value});for(const r of this.groups){const s=r.conditions.map(o=>({field:o.field,operator:o.operator,value:o.value}));r.type==="OR"?t.push({field:"",operator:"equals",value:void 0,OR:s}):t.push({field:"",operator:"equals",value:void 0,AND:s})}const n={...this.extra,filter:{where:t}};return this.includes.length>0&&(n.include=[...this.includes]),this.searchTerm!==void 0&&(n.search=this.searchTerm),this.sorts.length>0&&(n.sort=[...this.sorts]),this.distinctFields.length>0&&(n.distinct=[...this.distinctFields]),this.extentFields.length>0&&(n.extent=[...this.extentFields]),this.groupByCountSpec!==void 0&&(n.groupByCount={...this.groupByCountSpec}),this.pagination!==void 0&&(n.paginate={...this.pagination}),n}toQueryString(){const t=[];let n;if(this.groups.length===0){const s=this.toFlatObject();n=Vo(Object.fromEntries(Object.entries(s).map(([o,i])=>[`filter[${o}]`,i])))}else n=aS(this.build().filter.where);if(n&&t.push(n),this.includes.length>0&&t.push(`include=${encodeURIComponent(this.includes.join(","))}`),this.searchTerm!==void 0&&t.push(`search=${encodeURIComponent(this.searchTerm)}`),this.sorts.length>0){const s=this.sorts.map(o=>o.direction==="desc"?`-${o.field}`:o.field).join(",");t.push(`sort=${encodeURIComponent(s)}`)}this.distinctFields.length>0&&t.push(`distinct=${encodeURIComponent(this.distinctFields.join(","))}`),this.extentFields.length>0&&t.push(`extent=${encodeURIComponent(this.extentFields.join(","))}`),this.pagination!==void 0&&(t.push(`page=${encodeURIComponent(String(this.pagination.page))}`),t.push(`size=${encodeURIComponent(String(this.pagination.size))}`));const r=Vo(this.extra);return r&&t.push(r),t.join("&")}toFlatObject(){const t={};for(const n of this.conditions)if(n.operator==="equals")t[n.field]=n.value;else if(n.operator==="in")t[n.field]=n.value;else{const r=t[n.field];r!=null&&typeof r=="object"&&!Array.isArray(r)?r[n.operator]=n.value:t[n.field]={[n.operator]:n.value}}return t}}function II(){return new bu}const jI={eq:"equals",ne:"notEquals",gt:"gt",gte:"gte",lt:"lt",lte:"lte",in:"in"};function Qx(e){return e==="true"?!0:e==="false"?!1:e!==""&&!Number.isNaN(Number(e))?Number(e):e}function oc(e,t={},n){const r=II(),s=(i,l)=>{if(l!==void 0){if(Array.isArray(l)){if(l.length===0)return;l.length===1?r.where(i,"equals",l[0]):r.where(i,"in",l);return}l!==""&&r.where(i,"equals",l)}};s("status",e.status),s("workflow",e.workflow),s("tag",e.tag),s("namespace",e.namespace),e.origin===null?r.where("origin","isNull",!0):e.origin&&r.where("origin","equals",e.origin);for(const i of e.attr??[]){const[l,a,...c]=i.split(":"),u=a?jI[a]:void 0;if(!l||!u||c.length===0)continue;const d=c.join(":");r.where(`attr.${l}`,u,a==="in"?d.split("|").filter(Boolean).map(Qx):Qx(d))}const o=r.build();return gI({...o,filter:{...o.filter,...t.limit!==void 0&&{limit:t.limit},...t.offset!==void 0&&{offset:t.offset}},...n&&{groupByCount:n}})}function _I(e){if(typeof e=="object"&&e!==null&&"durationMs"in e){const t=e.durationMs;if(typeof t=="number")return t}}function lg(e){const t=new Map,n=[];for(const s of e){const o=s.subId??s.name??s.process;if(o===void 0){n.push(s);continue}const i=t.get(o),l=i??{id:o,name:s.name??o,phases:[],logs:[]};i||t.set(o,l),s.name!==void 0&&(l.name=s.name),s.group!==void 0&&(l.group=s.group),s.status!==void 0?(l.terminal=s,l.status=s.status):s.phase!==void 0?l.phases.push(s):l.logs.push(s)}return{subs:[...t.values()].map(s=>{var u;const o=[...s.phases,...s.logs],i=[...o,...s.terminal?[s.terminal]:[]].map(d=>d.at),l=i.length?i.reduce((d,f)=>f<d?f:d,Number.POSITIVE_INFINITY):void 0,c=_I((u=s.terminal)==null?void 0:u.data)??(s.terminal&&l!==void 0&&o.length>0?s.terminal.at-l:void 0);return{...s,startedAt:l,durationMs:c}}),stepLogs:n}}const cS={kind:"all"},md="app";function Hi(e){const t=e==null?void 0:e.trim();return t||void 0}function OI(e){return Hi(e)===void 0}function ka(e){const t=Hi(e);if(t===void 0)return md;const n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)||t}function MI(e,t){return e.kind!==t.kind?!1:e.kind==="origin"&&t.kind==="origin"?e.origin===t.origin:!0}function uS(e){return e.kind==="origin"?`origin:${e.origin}`:e.kind}function AI(e,t){if(t.kind==="all")return!0;const n=Hi(e.origin);return t.kind==="unknown"?n===void 0:n===t.origin}const ag="The app's own workflows: runs with no package origin, i.e. not declared by any library (e.g. registerRemote, convention routing, or runs from before origins were stamped).";function zI(e){const t=new Map;let n=0,r=0;for(const o of e){r+=o.count;const i=Hi(o.origin??void 0);if(i===void 0){n+=o.count;continue}t.set(i,(t.get(i)??0)+o.count)}const s=[{filter:cS,label:"all",title:"Every origin, including runs that have none",count:r}];for(const o of[...t.keys()].sort())s.push({filter:{kind:"origin",origin:o},label:ka(o),title:o,count:t.get(o)??0});return n>0&&s.push({filter:{kind:"unknown"},label:md,title:ag,count:n}),s}function DI(e){return e.some(t=>t.filter.kind==="origin")}function $I(e){return e.reduce((t,n)=>t+(OI(n.origin??void 0)?n.count:0),0)}function FI(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 ${ka(e.origin.origin)} match these filters.`,unclassified:e.unknownCount}:{message:"No runs match these filters."}:{message:"No runs yet."}}const Xx="compensate:";function LI(e){return e.startsWith(Xx)?e.slice(Xx.length):e}function HI(e){const t=[],n=[];for(const r of e)r.seq<0?n.push(r):t.push(r);return n.sort((r,s)=>s.seq-r.seq),{body:t,compensations:n}}function BI(e){let t=0,n=0,r=0;for(const s of e)s.status==="completed"?t++:s.status==="failed"?n++:r++;return{total:e.length,done:t,failed:n,pending:r}}const VI=10*60*1e3;function WI(e,t){if(e.kind!=="remote"||e.status!=="pending")return!1;const n=e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime();return t-n>VI}const dS=["running","suspended","cancelling"],UI=new Set(dS);function gp(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function Pf(e,t){const n=gp(e),r=t.filter(i=>gp(i.group)===n),s=r.some(i=>i.depth>0),o=r.some(i=>i.liveWorkers.length>0);return s&&!o}function qI(e){var n;const t=(n=e.match(/^runwait:(.+)#[^#]*#\d+$/))==null?void 0:n[1];return t?`run ${t}`:e.startsWith("wh:")?`webhook ${e}`:e.startsWith("child:")?`child ${e.slice(6)}`:`signal ${e}`}function KI(e,t){var s;const n=(s=e.tags)==null?void 0:s.find(o=>o.startsWith("singleton:"));return n?t.filter(o=>{var i;return UI.has(o.status)&&((i=o.tags)==null?void 0:i.includes(n))}).sort((o,i)=>o.createdAt.localeCompare(i.createdAt)||o.id.localeCompare(i.id))[0]:void 0}function YI(e){return`${e.on} ${e.name}`}function fS(e,t){var s,o;if(e.status!=="suspended")return e.status==="pending"&&Pf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:e.status==="blocked"?{status:"no-worker",detail:e.workflow}:{status:e.status};const n=KI(e,t.runs);if(n&&n.id!==e.id)return{status:"queued",detail:`behind leader ${n.id.slice(0,8)}`};const r=(s=t.timeline)==null?void 0:s.find(i=>i.status==="pending"||i.status==="running");if(r){if(r.name.startsWith(`signal:child:${e.id}.onError.`)){const i=(o=r.input)==null?void 0:o.workflow;return{status:"awaiting",detail:typeof i=="string"?`failure handler ${i}`:"failure handler"}}return r.kind==="signal"?{status:"awaiting",detail:qI(r.name)}:r.kind==="sleep"?{status:"sleeping"}:r.workerGroup&&Pf(r.workerGroup,t.health)?{status:"no-worker",detail:gp(r.workerGroup)}:{status:"running"}}return e.waiting?{status:"awaiting",detail:YI(e.waiting)}:Pf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:{status:"running"}}function GI(e,t){return e.status!=="suspended"?e.status:t!=null&&t.some(n=>n.status==="pending"||n.status==="running")?"running":e.wakeAt!=null?"sleeping":t?"awaiting":"running"}function QI(){return typeof window<"u"&&window.__DURABLE_BASE__||"/durable"}function hS(){return typeof window<"u"&&window.__DURABLE_API__?window.__DURABLE_API__:`${QI()}/api`}const xp=new Set;function $6(e){return xp.add(e),()=>xp.delete(e)}class XI extends Error{constructor(t){super(t===401?"Not signed in to the console.":"No access to the console."),this.status=t,this.name="ConsoleAccessError"}}async function ZI(e){const t=e.status,n=await e.json().catch(()=>{});if(t===401&&typeof(n==null?void 0:n.redirectTo)=="string"&&typeof window<"u")window.location.href=n.redirectTo;else for(const r of xp)r({status:t});throw new XI(t)}async function ft(e,t){const n=await fetch(hS()+e,t);if(n.status===401||n.status===403)return ZI(n);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return await n.json()}const $e={runs(e,t,n,r){const s=oc({status:e??(r==null?void 0:r.statuses),tag:t,attr:n,namespace:r==null?void 0:r.namespace,origin:r==null?void 0:r.origin},{limit:r==null?void 0:r.limit,offset:r==null?void 0:r.offset});return ft(s?`/runs?${s}`:"/runs")},facets(e,t,n){const r=oc({tag:e,attr:t,namespace:n});return ft(r?`/runs/facets?${r}`:"/runs/facets")},values(e,t={},n){var s;const r=oc(t,{},{field:e,...(n==null?void 0:n.limit)&&{limit:n.limit},...(n==null?void 0:n.offset)&&{offset:n.offset},...((s=n==null?void 0:n.search)==null?void 0:s.trim())&&{search:n.search.trim()}});return ft(`/runs/values?${r}`)},run(e){return ft(`/runs/${encodeURIComponent(e)}`)},fanMembers(e,t,n={}){const 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");const s=r.toString(),o=`/runs/${encodeURIComponent(e)}/fans/${encodeURIComponent(t)}`;return ft(s?`${o}?${s}`:o)},workers(){return ft("/workers")},schedules(){return ft("/schedules")},pauseSchedule(e){return ft(`/schedules/${encodeURIComponent(e)}/pause`,{method:"POST"})},resumeSchedule(e){return ft(`/schedules/${encodeURIComponent(e)}/resume`,{method:"POST"})},triggerSchedule(e){return ft(`/schedules/${encodeURIComponent(e)}/trigger`,{method:"POST"})},topology(){return ft("/topology")},retry(e){return ft(`/runs/${encodeURIComponent(e)}/retry`,{method:"POST"})},retryWithInput(e,t){return ft(`/runs/${encodeURIComponent(e)}/retry-with-input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:t})})},bulk(e,t){const n=oc(t);return ft(`/bulk/${e}${n?`?${n}`:""}`,{method:"POST"})},cancel(e,t){const n=t!=null&&t.compensate?"?compensate=true":"";return ft(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:"POST"})},workflowLifecycle(e){return ft(`/workflows/${encodeURIComponent(e)}/lifecycle`)},republishLifecycle(e,t){return ft(`/runs/${encodeURIComponent(e)}/republish-lifecycle`,{method:"POST",...t!==void 0?{headers:{"Content-Type":"application/json"},body:JSON.stringify({subscriber:t})}:{}})},continue(e){return ft(`/runs/${encodeURIComponent(e)}/continue`,{method:"POST"})},redispatch(e){return ft(`/runs/${encodeURIComponent(e)}/redispatch`,{method:"POST"})},streamRun(e,t){const n=new EventSource(`${hS()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=r=>{try{t(JSON.parse(r.data))}catch{}},()=>n.close()}},JI=200;class ej{constructor(t=JI){ge(this,"events",[]);ge(this,"pushed",0);ge(this,"listeners",new Set);ge(this,"snapshot",()=>this.events);ge(this,"subscribe",t=>(this.listeners.add(t),()=>this.listeners.delete(t)));this.limit=t}push(t){this.pushed+=1;const n=[...this.events,{id:this.pushed,event:t}];this.events=n.length>this.limit?n.slice(n.length-this.limit):n;for(const r of this.listeners)r()}}function Su(e){const t=e.lastIndexOf("@");return t===-1?"default":e.slice(t+1)}function Eu(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function tj(e){const t=new Map;for(const r of e){const s=Su(r.group),o=t.get(s);o?o.push(r):t.set(s,[r])}return[...t.entries()].map(([r,s])=>{const o=new Set;let i=0,l=0;for(const a of s){i+=a.depth,a.depth>0&&a.liveWorkers.length===0&&(l+=1);for(const c of a.liveWorkers)o.add(c.instanceId)}return{partition:r,workerCount:o.size,handlerCount:s.length,totalDepth:i,starvedCount:l}}).sort((r,s)=>r.partition==="default"?-1:s.partition==="default"?1:r.partition.localeCompare(s.partition))}function nj(e,t){if(!e)return t;const n=new Map(e.timeline.map(r=>[r.seq,r]));return{...t,timeline:t.timeline.map(r=>{var o,i;if((r.status==="pending"||r.status==="running")&&(((o=r.events)==null?void 0:o.length)??0)===0){const l=(i=n.get(r.seq))==null?void 0:i.events;if(l!=null&&l.length)return{...r,events:l}}return r})}}function rj(e,t,n){if(!e)return e;const r=e.timeline.findIndex(i=>i.seq===t),s=e.timeline[r];if(s===void 0)return e;const o=[...e.timeline];return o[r]={...s,events:[...s.events??[],n]},{...e,timeline:o}}function sj(e){var n,r;const t=new Map;for(const s of e)for(const o of s.liveWorkers){const i=Eu(o.group),l=t.get(o.instanceId);if(l===void 0){t.set(o.instanceId,{instanceId:o.instanceId,partition:Su(o.group),runtime:(n=o.status)==null?void 0:n.runtime,handlers:new Set([i]),status:o.status,lastBeatAt:o.lastBeatAt});continue}l.handlers.add(i),o.lastBeatAt>=l.lastBeatAt&&(l.lastBeatAt=o.lastBeatAt,l.partition=Su(o.group),l.runtime=(r=o.status)==null?void 0:r.runtime,l.status=o.status)}return[...t.values()].map(s=>({instanceId:s.instanceId,partition:s.partition,runtime:s.runtime,handlers:[...s.handlers].sort((o,i)=>o.localeCompare(i)),status:s.status,lastBeatAt:s.lastBeatAt})).sort((s,o)=>s.partition!==o.partition?s.partition==="default"?-1:o.partition==="default"?1:s.partition.localeCompare(o.partition):s.instanceId.localeCompare(o.instanceId))}function oj(e){const t=new Set,n=new Set;for(const r of e){if(r.kind!=="workflow")continue;const s=Eu(r.group);r.depth>0&&t.add(s),r.liveWorkers.length>0&&n.add(s)}return[...t].filter(r=>!n.has(r)).sort()}function ij(e){const t=new Set,n=new Set,r=new Set;for(const o of e){for(const i of o.liveWorkers)t.add(i.instanceId);o.kind==="workflow"?n.add(Eu(o.group)):o.kind==="step"&&r.add(Eu(o.group))}const s=e.filter(o=>o.depth>0&&o.liveWorkers.length===0).sort((o,i)=>i.depth-o.depth);return{queueCount:e.length,workflowCount:n.size,stepCount:r.size,workerCount:t.size,starved:s,allDraining:s.length===0}}function lj(e,t,n=Date.now){let r=Number.NEGATIVE_INFINITY,s;const o=()=>{s=void 0,r=n(),e()};return{call(){if(s!==void 0)return;const i=r+t-n();i<=0?o():s=setTimeout(o,i)},cancel(){s!==void 0&&clearTimeout(s),s=void 0}}}const Wn={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function pS(e){return h.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[h.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"}),h.jsx("path",{d:"M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2"})]})}function aj(e){return h.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})}function cj(e){return h.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"13",r:"8"}),h.jsx("path",{d:"M12 13V9M9 2h6"})]})}function uj(e){return h.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"2"}),h.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 cg(e){return h.jsx("svg",{...Wn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"m4 12 5 5L20 6"})})}function Ss(e){return h.jsx("svg",{...Wn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function dj(e){return h.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[h.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),h.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h8"})]})}function If(e){return h.jsx("svg",{...Wn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function ku(e){return h.jsx("svg",{...Wn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}function fj(e){return h.jsx("svg",{...Wn,...e,"aria-hidden":"true",children:h.jsx("path",{d:"M6 4l14 8-14 8z"})})}function ug(e){return h.jsxs("svg",{...Wn,...e,"aria-hidden":"true",children:[h.jsx("circle",{cx:"6",cy:"5",r:"2"}),h.jsx("path",{d:"M6 7v6a4 4 0 004 4h4"}),h.jsx("circle",{cx:"18",cy:"17",r:"2"})]})}const hj={local:pS,remote:aj,sleep:cj,signal:uj,child:ug};function dg(e){return hj[e]??pS}const yp={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal",child:"Child workflow — click to open its run"};function mS(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=mS(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=mS(e))&&(r&&(r+=" "),r+=t);return r}const Zx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Jx=gS,xS=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Jx(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const u=n==null?void 0:n[c],d=o==null?void 0:o[c];if(u===null)return null;const f=Zx(u)||Zx(d);return s[c][f]}),l=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(y=>{let[v,b]=y;return Array.isArray(b)?b.includes({...o,...l}[v]):{...o,...l}[v]===b})?[...c,d,f]:c},[]);return Jx(e,i,a,n==null?void 0:n.class,n==null?void 0:n.className)},pj=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},mj=(e,t)=>({classGroupId:e,validator:t}),yS=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Cu="-",ey=[],gj="arbitrary..",xj=e=>{const t=vj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return yj(i);const l=i.split(Cu),a=l[0]===""&&l.length>1?1:0;return vS(l,a,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const a=r[i],c=n[i];return a?c?pj(c,a):a:c||ey}return n[i]||ey}}},vS=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const c=vS(e,t+1,o);if(c)return c}const i=n.validators;if(i===null)return;const l=t===0?e.join(Cu):e.slice(t).join(Cu),a=i.length;for(let c=0;c<a;c++){const u=i[c];if(u.validator(l))return u.classGroupId}},yj=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?gj+r:void 0})(),vj=e=>{const{theme:t,classGroups:n}=e;return wj(n,t)},wj=(e,t)=>{const n=yS();for(const r in e){const s=e[r];fg(s,n,r,t)}return n},fg=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];bj(i,t,n,r)}},bj=(e,t,n,r)=>{if(typeof e=="string"){Sj(e,t,n);return}if(typeof e=="function"){Ej(e,t,n,r);return}kj(e,t,n,r)},Sj=(e,t,n)=>{const r=e===""?t:wS(t,e);r.classGroupId=n},Ej=(e,t,n,r)=>{if(Cj(e)){fg(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mj(n,e))},kj=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[l,a]=s[i];fg(a,wS(t,l),n,r)}},wS=(e,t)=>{let n=e;const r=t.split(Cu),s=r.length;for(let o=0;o<s;o++){const i=r[o];let l=n.nextPart.get(i);l||(l=yS(),n.nextPart.set(i,l)),n=l}return n},Cj=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Nj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let i=n[o];if(i!==void 0)return i;if((i=r[o])!==void 0)return s(o,i),i},set(o,i){o in n?n[o]=i:s(o,i)}}},vp="!",ty=":",Rj=[],ny=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Tj=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,l=0,a=0,c;const u=s.length;for(let v=0;v<u;v++){const b=s[v];if(i===0&&l===0){if(b===ty){o.push(s.slice(a,v)),a=v+1;continue}if(b==="/"){c=v;continue}}b==="["?i++:b==="]"?i--:b==="("?l++:b===")"&&l--}const d=o.length===0?s:s.slice(a);let f=d,p=!1;d.endsWith(vp)?(f=d.slice(0,-1),p=!0):d.startsWith(vp)&&(f=d.slice(1),p=!0);const y=c&&c>a?c-a:void 0;return ny(o,p,f,y)};if(t){const s=t+ty,o=r;r=i=>i.startsWith(s)?o(i.slice(s.length)):ny(Rj,!1,i,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},Pj=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let o=0;o<n.length;o++){const i=n[o],l=i[0]==="[",a=t.has(i);l||a?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},Ij=e=>({cache:Nj(e.cacheSize),parseClassName:Tj(e),sortModifiers:Pj(e),postfixLookupClassGroupIds:jj(e),...xj(e)}),jj=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},_j=/\s+/,Oj=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o,postfixLookupClassGroupIds:i}=t,l=[],a=e.trim().split(_j);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:f,modifiers:p,hasImportantModifier:y,baseClassName:v,maybePostfixModifierPosition:b}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let g=!!b,m;if(g){const k=v.substring(0,b);m=r(k);const C=m&&i[m]?r(v):void 0;C&&C!==m&&(m=C,g=!1)}else m=r(v);if(!m){if(!g){c=d+(c.length>0?" "+c:c);continue}if(m=r(v),!m){c=d+(c.length>0?" "+c:c);continue}g=!1}const x=p.length===0?"":p.length===1?p[0]:o(p).join(":"),w=y?x+vp:x,E=w+m;if(l.indexOf(E)>-1)continue;l.push(E);const N=s(m,g);for(let k=0;k<N.length;++k){const C=N[k];l.push(w+C)}c=d+(c.length>0?" "+c:c)}return c},Mj=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=bS(n))&&(s&&(s+=" "),s+=r);return s},bS=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=bS(e[r]))&&(n&&(n+=" "),n+=t);return n},Aj=(e,...t)=>{let n,r,s,o;const i=a=>{const c=t.reduce((u,d)=>d(u),e());return n=Ij(c),r=n.cache.get,s=n.cache.set,o=l,l(a)},l=a=>{const c=r(a);if(c)return c;const u=Oj(a,n);return s(a,u),u};return o=i,(...a)=>o(Mj(...a))},zj=[],ht=e=>{const t=n=>n[e]||zj;return t.isThemeGetter=!0,t},SS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ES=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,$j=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fj=/\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$/,Lj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Hj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vr=e=>Dj.test(e),be=e=>!!e&&!Number.isNaN(Number(e)),Qn=e=>!!e&&Number.isInteger(Number(e)),jf=e=>e.endsWith("%")&&be(e.slice(0,-1)),ur=e=>$j.test(e),kS=()=>!0,Vj=e=>Fj.test(e)&&!Lj.test(e),hg=()=>!1,Wj=e=>Hj.test(e),Uj=e=>Bj.test(e),qj=e=>!ie(e)&&!le(e),Kj=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)),Yj=e=>Is(e,RS,hg),ie=e=>SS.test(e),_s=e=>Is(e,TS,Vj),ry=e=>Is(e,n_,be),Gj=e=>Is(e,IS,kS),Qj=e=>Is(e,PS,hg),sy=e=>Is(e,CS,hg),Xj=e=>Is(e,NS,Uj),ic=e=>Is(e,jS,Wj),le=e=>ES.test(e),nl=e=>vo(e,TS),Zj=e=>vo(e,PS),oy=e=>vo(e,CS),Jj=e=>vo(e,RS),e_=e=>vo(e,NS),lc=e=>vo(e,jS,!0),t_=e=>vo(e,IS,!0),Is=(e,t,n)=>{const r=SS.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},vo=(e,t,n=!1)=>{const r=ES.exec(e);return r?r[1]?t(r[1]):n:!1},CS=e=>e==="position"||e==="percentage",NS=e=>e==="image"||e==="url",RS=e=>e==="length"||e==="size"||e==="bg-size",TS=e=>e==="length",n_=e=>e==="number",PS=e=>e==="family-name",IS=e=>e==="number"||e==="weight",jS=e=>e==="shadow",r_=()=>{const e=ht("color"),t=ht("font"),n=ht("text"),r=ht("font-weight"),s=ht("tracking"),o=ht("leading"),i=ht("breakpoint"),l=ht("container"),a=ht("spacing"),c=ht("radius"),u=ht("shadow"),d=ht("inset-shadow"),f=ht("text-shadow"),p=ht("drop-shadow"),y=ht("blur"),v=ht("perspective"),b=ht("aspect"),g=ht("ease"),m=ht("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...w(),le,ie],N=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],C=()=>[le,ie,a],P=()=>[Vr,"full","auto",...C()],I=()=>[Qn,"none","subgrid",le,ie],z=()=>["auto",{span:["full",Qn,le,ie]},Qn,le,ie],$=()=>[Qn,"auto",le,ie],A=()=>["auto","min","max","fr",le,ie],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],j=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...C()],F=()=>[Vr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],T=()=>[Vr,"screen","full","dvw","lvw","svw","min","max","fit",...C()],M=()=>[Vr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],O=()=>[e,le,ie],U=()=>[...w(),oy,sy,{position:[le,ie]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",Jj,Yj,{size:[le,ie]}],W=()=>[jf,nl,_s],q=()=>["","none","full",c,le,ie],H=()=>["",be,nl,_s],G=()=>["solid","dashed","dotted","double"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[be,jf,oy,sy],Q=()=>["","none",y,le,ie],Z=()=>["none",be,le,ie],V=()=>["none",be,le,ie],X=()=>[be,le,ie],ee=()=>[Vr,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ur],breakpoint:[ur],color:[kS],container:[ur],"drop-shadow":[ur],ease:["in","out","in-out"],font:[qj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ur],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ur],shadow:[ur],spacing:["px",be],text:[ur],"text-shadow":[ur],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vr,ie,le,b]}],container:["container"],"container-type":[{"@container":["","normal","size",le,ie]}],"container-named":[Kj],columns:[{columns:[be,ie,le,l]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Qn,"auto",le,ie]}],basis:[{basis:[Vr,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[be,Vr,"auto","initial","none",ie]}],grow:[{grow:["",be,le,ie]}],shrink:[{shrink:["",be,le,ie]}],order:[{order:[Qn,"first","last","none",le,ie]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mbs:[{mbs:_()}],mbe:[{mbe:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...T()]}],"min-inline-size":[{"min-inline":["auto",...T()]}],"max-inline-size":[{"max-inline":["none",...T()]}],"block-size":[{block:["auto",...M()]}],"min-block-size":[{"min-block":["auto",...M()]}],"max-block-size":[{"max-block":["none",...M()]}],w:[{w:[l,"screen",...F()]}],"min-w":[{"min-w":[l,"screen","none",...F()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,nl,_s]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,t_,Gj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",jf,ie]}],"font-family":[{font:[Zj,Qj,t]}],"font-features":[{"font-features":[ie]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,le,ie]}],"line-clamp":[{"line-clamp":[be,"none",le,ry]}],leading:[{leading:[o,...C()]}],"list-image":[{"list-image":["none",le,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",le,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[be,"from-font","auto",le,_s]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[be,"auto",le,ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[Qn,le,ie]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le,ie]}],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",le,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qn,le,ie],radial:["",le,ie],conic:[Qn,le,ie]},e_,Xj]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[be,le,ie]}],"outline-w":[{outline:["",be,nl,_s]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",u,lc,ic]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",d,lc,ic]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[be,_s]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",f,lc,ic]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[be,le,ie]}],"mix-blend":[{"mix-blend":[...B(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":B()}],"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":[be]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[le,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[be]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,ie]}],filter:[{filter:["","none",le,ie]}],blur:[{blur:Q()}],brightness:[{brightness:[be,le,ie]}],contrast:[{contrast:[be,le,ie]}],"drop-shadow":[{"drop-shadow":["","none",p,lc,ic]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",be,le,ie]}],"hue-rotate":[{"hue-rotate":[be,le,ie]}],invert:[{invert:["",be,le,ie]}],saturate:[{saturate:[be,le,ie]}],sepia:[{sepia:["",be,le,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",le,ie]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[be,le,ie]}],"backdrop-contrast":[{"backdrop-contrast":[be,le,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",be,le,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[be,le,ie]}],"backdrop-invert":[{"backdrop-invert":["",be,le,ie]}],"backdrop-opacity":[{"backdrop-opacity":[be,le,ie]}],"backdrop-saturate":[{"backdrop-saturate":[be,le,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",be,le,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",le,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[be,"initial",le,ie]}],ease:[{ease:["linear","initial",g,le,ie]}],delay:[{delay:[be,le,ie]}],animate:[{animate:["none",m,le,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,le,ie]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":["scale-3d"],skew:[{skew:X()}],"skew-x":[{"skew-x":X()}],"skew-y":[{"skew-y":X()}],transform:[{transform:[le,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ee()}],"translate-x":[{"translate-x":ee()}],"translate-y":[{"translate-y":ee()}],"translate-z":[{"translate-z":ee()}],"translate-none":["translate-none"],zoom:[{zoom:[Qn,le,ie]}],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"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",le,ie]}],"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":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",le,ie]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[be,nl,_s,ry]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},s_=Aj(r_);function st(...e){return s_(gS(e))}const _S=xS("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"}}),Xe=S.forwardRef(({className:e,variant:t,...n},r)=>h.jsx("span",{ref:r,className:st(_S({variant:t}),e),...n}));Xe.displayName="Badge";const o_=xS("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"}}),Se=S.forwardRef(({className:e,variant:t,size:n,type:r,...s},o)=>h.jsx("button",{ref:o,type:r??"button",className:st(o_({variant:t,size:n}),e),...s}));Se.displayName="Button";const pg=S.forwardRef(({className:e,...t},n)=>h.jsx("input",{ref:n,className:st("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}));pg.displayName="Input";const iy={};function Pn(e,t){const n=S.useRef(iy);return n.current===iy&&(n.current=e(t)),n}const wp=[];let bp;function i_(){return bp}function l_(e){wp.push(e)}function gd(e){const t=(n,r)=>{const s=Pn(a_).current;let o;try{bp=s;for(const i of wp)i.before(s);o=e(n,r);for(const i of wp)i.after(s);s.didInitialize=!0}finally{bp=void 0}return o};return t.displayName=e.displayName||e.name,t}function OS(e){return S.forwardRef(gd(e))}function a_(){return{didInitialize:!1}}function mg(){}const Yl=Object.freeze([]),Et=Object.freeze({});function gg(e){S.useEffect(e,Yl)}const rl=0;class In{constructor(){ge(this,"currentId",rl);ge(this,"clear",()=>{this.currentId!==rl&&(clearTimeout(this.currentId),this.currentId=rl)});ge(this,"disposeEffect",()=>this.clear)}static create(){return new In}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=rl,n()},t)}isStarted(){return this.currentId!==rl}}function Mr(){const e=Pn(In.create).current;return gg(e.disposeEffect),e}const c_=()=>{},fe=typeof document<"u"?S.useLayoutEffect:c_;function u_(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:d_,platform:f_,maxTouchPoints:h_}=u_(),xd=d_.toLowerCase(),Gl=f_.toLowerCase(),yd=/^i(os$|p)/.test(Gl)||Gl==="macintel"&&h_>1,ly="android",Sp=Gl===ly||xd.includes(ly),MS=!yd&&Gl.startsWith("mac");Gl.startsWith("win");const p_=MS||yd;var Nw;const wo=typeof CSS<"u"&&!!((Nw=CSS.supports)!=null&&Nw.call(CSS,"-webkit-backdrop-filter:none"));!wo&&xd.includes("firefox");!wo&&xd.includes("chrom");const m_=p_,AS=/jsdom|happydom/.test(xd);function g_(e){e.preventDefault(),e.stopPropagation()}function x_(e){return"nativeEvent"in e}function zS(e){return e.pointerType===""&&e.isTrusted?!0:Sp&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function DS(e){return AS?!1:!Sp&&e.width===0&&e.height===0||Sp&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ys(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function y_(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function vd(){return typeof window<"u"}function Nt(e){return xg(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $r(e){var t;return(t=(xg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xg(e){return vd()?e instanceof Node||e instanceof ot(e).Node:!1}function Ce(e){return vd()?e instanceof Element||e instanceof ot(e).Element:!1}function Ve(e){return vd()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function Ci(e){return!vd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}function Ca(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=fn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function v_(e){return/^(table|td|th)$/.test(Nt(e))}function wd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const w_=/transform|translate|scale|rotate|perspective|filter/,b_=/paint|layout|strict|content/,Os=e=>!!e&&e!=="none";let _f;function yg(e){const t=Ce(e)?fn(e):e;return Os(t.transform)||Os(t.translate)||Os(t.scale)||Os(t.rotate)||Os(t.perspective)||!vg()&&(Os(t.backdropFilter)||Os(t.filter))||w_.test(t.willChange||"")||b_.test(t.contain||"")}function S_(e){let t=Es(e);for(;Ve(t)&&!vs(t);){if(yg(t))return t;if(wd(t))return null;t=Es(t)}return null}function vg(){return _f==null&&(_f=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_f}function vs(e){return/^(html|body|#document)$/.test(Nt(e))}function fn(e){return ot(e).getComputedStyle(e)}function bd(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Es(e){if(Nt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ci(e)&&e.host||$r(e);return Ci(t)?t.host:t}function $S(e){const t=Es(e);return vs(t)?(e.ownerDocument||e).body:Ve(t)&&Ca(t)?t:$S(t)}function Ql(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=$S(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=ot(s);if(o){const l=Ep(i);return t.concat(i,i.visualViewport||[],Ca(s)?s:[],l&&n?Ql(l):[])}else return t.concat(s,Ql(s,[],n))}function Ep(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vn(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function xe(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&Ci(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Mt(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const kp="data-base-ui-focusable",FS="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",LS="data-starting-style",E_="data-ending-style",k_={[LS]:""},C_={[E_]:""},wg={transitionStatus(e){return e==="starting"?k_:e==="ending"?C_:null}},N_="data-open",R_="data-closed",T_="data-anchor-hidden",HS="data-popup-open",P_="data-pressed",I_={[HS]:""},j_={[HS]:"",[P_]:""},__={[N_]:""},O_={[R_]:""},M_={[T_]:""},BS={open(e){return e?I_:null}},A_={open(e){return e?j_:null}},bg={open(e){return e?__:O_},anchorHidden(e){return e?M_:null}},Sg={...bg,...wg},Cp="data-trigger-disabled";function Nu(e,t){if(!Ce(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(Cp);for(const[,r]of t.entries())if(xe(r,n))return!r.hasAttribute(Cp);return!1}function Of(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function z_(e){return e.matches("html,body")}function Sd(e){return Ve(e)&&e.matches(FS)}function D_(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${FS}`))!=null}function ay(e){return e?e.getAttribute("role")==="combobox"&&Sd(e):!1}function $_(e){if(!e||AS)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function cy(e){return e?e.hasAttribute(kp)?e:e.querySelector(`[${kp}]`)||e:null}function F_(e,t){return t!=null&&!ys(t)?0:typeof e=="function"?e():e}function co(e,t,n){const r=F_(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function uy(e){return typeof e=="function"?e():e}function VS(e,t){return t||e==="click"||e==="mousedown"}function L_(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const Ed="none",ks="trigger-press",St="trigger-hover",Lc="trigger-focus",WS="outside-press",US="close-press",Xl="focus-out",kd="escape-key",qS="disabled",dy="missing",fy="initial",Eg="imperative-action";function Me(e,t,n,r){let s=!1,o=!1;const i=r??Et;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...i}}const KS=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new In,currentIdRef:{current:null},currentContextRef:{current:null}});function H_(e,t){e.current=t.current}function B_(e){const{children:t,delay:n,timeoutMs:r=0}=e,s=S.useRef(n),o=S.useRef(n),i=S.useRef(null),l=S.useRef(null),a=Mr();return fe(()=>{if(o.current=n,!i.current){s.current=n;return}s.current={open:co(s.current,"open"),close:co(n,"close")}},[n,i,s,o]),h.jsx(KS.Provider,{value:S.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:o,currentIdRef:i,timeoutMs:r,currentContextRef:l,timeout:a}),[r,a]),children:t})}function V_(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),o=S.useContext(KS),{currentIdRef:i,delayRef:l,timeoutMs:a,initialDelayRef:c,currentContextRef:u,hasProvider:d,timeout:f}=o,[p,y]=S.useState(!1),v=S.useRef(n);return fe(()=>{v.current=n},[n]),fe(()=>{function b(){var g;(g=u.current)==null||g.setIsInstantPhase(!1),i.current=null,u.current=null,l.current=c.current,f.clear()}if(i.current&&!n&&i.current===s){if(y(!1),a){const g=s;return f.start(a,()=>{r.select("open")||i.current&&i.current!==g||b()}),()=>{(v.current||i.current!==g)&&f.clear()}}b()}},[n,s,i,l,a,c,u,f,r]),fe(()=>{if(!n)return;const b=u.current,g=i.current;f.clear(),u.current={onOpenChange:r.setOpen,setIsInstantPhase:y},i.current=s,l.current={open:0,close:co(c.current,"close")},g!==null&&g!==s?(y(!0),b==null||b.setIsInstantPhase(!0),b==null||b.onOpenChange(!1,Me(Ed))):(y(!1),b==null||b.setIsInstantPhase(!1))},[n,s,r,i,l,c,u,f]),fe(()=>()=>{if(i.current===s){if(u.current=null,!v.current)return;i.current=null,H_(l,c),f.clear()}},[u,i,l,s,c,f]),S.useMemo(()=>({activeIdRef:i,hasProvider:d,delayRef:l,isInstantPhase:p}),[i,d,l,p])}function Ee(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function ir(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Ni(e,t,n,r){const s=Pn(YS).current;return U_(s,e,t,n,r)&&GS(s,[e,t,n,r]),s.callback}function W_(e){const t=Pn(YS).current;return q_(t,e)&&GS(t,e),t.callback}function YS(){return{callback:null,cleanup:null,refs:[]}}function U_(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function q_(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function GS(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(r[s]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=r[s];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}function Ht(e){const t=Pn(K_,e).current;return t.next=e,fe(t.effect),t}function K_(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const kg={...uR},Mf=kg.useInsertionEffect,Y_=Mf&&Mf!==kg.useLayoutEffect?Mf:e=>e();function me(e){const t=Pn(G_).current;return t.next=e,Y_(t.effect),t.trampoline}function G_(){const e={next:void 0,callback:Q_,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Q_(){}const ac=null;class X_{constructor(){ge(this,"callbacks",[]);ge(this,"callbacksCount",0);ge(this,"nextId",1);ge(this,"startId",1);ge(this,"isScheduled",!1);ge(this,"tick",t=>{var s;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(s=n[o])==null||s.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let cc=new X_;class tr{constructor(){ge(this,"currentId",ac);ge(this,"cancel",()=>{this.currentId!==ac&&(cc.cancel(this.currentId),this.currentId=ac)});ge(this,"disposeEffect",()=>this.cancel)}static create(){return new tr}static request(t){return cc.request(t)}static cancel(t){return cc.cancel(t)}request(t){this.cancel(),this.currentId=cc.request(()=>{this.currentId=ac,t()})}}function Cg(){const e=Pn(tr.create).current;return gg(e.disposeEffect),e}function Fe(e){return(e==null?void 0:e.ownerDocument)||document}const Z_={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},J_={...Z_,position:"fixed",top:0,left:0},Ri=S.forwardRef(function(t,n){const[r,s]=S.useState();fe(()=>{m_&&wo&&s("button")},[]);const o={tabIndex:0,role:r};return h.jsx("span",{...t,ref:n,style:J_,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Ti=Math.min,Nr=Math.max,Ru=Math.round,uc=Math.floor,Rr=e=>({x:e,y:e}),eO={left:"right",right:"left",bottom:"top",top:"bottom"};function QS(e,t,n){return Nr(e,Ti(t,n))}function Cs(e,t){return typeof e=="function"?e(t):e}function Nn(e){return e.split("-")[0]}function Ar(e){return e.split("-")[1]}function Ng(e){return e==="x"?"y":"x"}function Rg(e){return e==="y"?"height":"width"}function kn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Tg(e){return Ng(kn(e))}function tO(e,t,n){n===void 0&&(n=!1);const r=Ar(e),s=Tg(e),o=Rg(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Tu(i)),[i,Tu(i)]}function nO(e){const t=Tu(e);return[Np(e),t,Np(t)]}function Np(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const hy=["left","right"],py=["right","left"],rO=["top","bottom"],sO=["bottom","top"];function oO(e,t,n){switch(e){case"top":case"bottom":return n?t?py:hy:t?hy:py;case"left":case"right":return t?rO:sO;default:return[]}}function iO(e,t,n,r){const s=Ar(e);let o=oO(Nn(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Np)))),o}function Tu(e){const t=Nn(e);return eO[t]+e.slice(t.length)}function lO(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function XS(e){return typeof e!="number"?lO(e):{top:e,right:e,bottom:e,left:e}}function Pu(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Af(e,t){return t<0||t>=e.length}function aO(e,t){return Nl(e.current,{disabledIndices:t})}function cO(e,t){return Nl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Nl(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:s=1}={}){let o=t;do o+=n?-s:s;while(o>=0&&o<=e.length-1&&Rl(e,o,r));return o}function Rl(e,t,n){if(typeof n=="function"?n(t):(n==null?void 0:n.includes(t))??!1)return!0;const s=e[t];return s?!Pg(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function uO(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Pg(e,t=e?fn(e):null){return!e||!e.isConnected||!t||uO(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const dO='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function fO(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Ci(n)?n.host:null}function Rp(e){for(const t of Array.from(e.children))if(Nt(t)==="summary")return t;return null}function hO(e,t){const n=Rp(t);return!!n&&(e===n||xe(n,e))}function ZS(e){const t=e?Nt(e):"";return e!=null&&e.matches(dO)&&(t!=="summary"||e.parentElement!=null&&Nt(e.parentElement)==="details"&&Rp(e.parentElement)===e)&&(t!=="details"||Rp(e)==null)&&(t!=="input"||e.type!=="hidden")}function JS(e){if(!ZS(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=fO(t)){const n=t!==e,r=Nt(t)==="slot";if(t.hasAttribute("inert")||n&&Nt(t)==="details"&&!t.open&&!hO(e,t)||t.hasAttribute("hidden")||!r&&!pO(t,n))return!1}return!0}function pO(e,t){const n=fn(e);return t?n.display!=="none":Pg(e,n)}function eE(e){const t=e.tabIndex;if(t<0){const n=Nt(e);if(n==="details"||n==="audio"||n==="video"||Ve(e)&&e.isContentEditable)return 0}return t}function zf(e){if(Nt(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function mO(e,t){const n=zf(e);if(!n)return!0;const r=t.find(s=>{const o=zf(s);return(o==null?void 0:o.name)===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(s=>{const o=zf(s);return(o==null?void 0:o.name)===n.name&&o.form===n.form})===n}function tE(e){if(Ve(e)&&Nt(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ve(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function nE(e,t){tE(e).forEach(n=>{ZS(n)&&t.push(n),nE(n,t)})}function rE(e,t,n){tE(e).forEach(r=>{Ve(r)&&r.matches(t)&&n.push(r),rE(r,t,n)})}function Ig(e){return JS(e)&&eE(e)>=0}function sE(e){const t=[];return nE(e,t),t.filter(JS)}function Na(e){const t=sE(e);return t.filter(n=>eE(n)>=0&&mO(n,t))}function oE(e,t){const n=Na(e),r=n.length;if(r===0)return;const s=vn(Fe(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function jg(e){return oE(Fe(e).body,1)||e}function iE(e){return oE(Fe(e).body,-1)||e}function lE(e,t){if(!e)return null;const n=Na(Fe(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const o=(s+t+r)%r;return n[o]}function gO(e){return lE(e,1)}function xO(e){return lE(e,-1)}function Zo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!xe(n,r)}function yO(e){Na(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function my(e){const t=[];rE(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Ns(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>{var o;return[...!n||(o=s.context)!=null&&o.open?[s]:[],...Ns(e,s.id,n)]})}function gy(e,t){var s;let n=[],r=(s=e.find(o=>o.id===t))==null?void 0:s.parentId;for(;r;){const o=e.find(i=>i.id===r);r=o==null?void 0:o.parentId,o&&(n=n.concat(o))}return n}function Zl(e){return`data-base-ui-${e}`}let dc=0;function Df(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(dc);function o(){s&&!s()||e==null||e.focus({preventScroll:n})}if(r)return o(),mg;const i=requestAnimationFrame(o);return dc=i,()=>{dc===i&&(cancelAnimationFrame(i),dc=0)}}const $f={inert:new WeakMap,"aria-hidden":new WeakMap},xy="data-base-ui-inert",Tp={inert:new WeakSet,"aria-hidden":new WeakSet};let sl=new WeakMap,Ff=0;function vO(e){return Tp[e]}function aE(e){return e?Ci(e)?e.host:aE(e.parentNode):null}const yy=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=aE(n);return e.contains(r)?r:null}).filter(n=>n!=null),vy=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},wy=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{Nt(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function wO(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,l=null;const a=yy(t,e),c=s?wy(t,vy(a),new Set(a)):[],u=[],d=[];if(o){const f=$f[o],p=vO(o);l=p,i=f;const y=yy(t,Array.from(t.querySelectorAll("[aria-live]"))),v=a.concat(y);wy(t,vy(v),new Set(v)).forEach(g=>{const m=g.getAttribute(o),x=m!==null&&m!=="false",w=(f.get(g)||0)+1;f.set(g,w),u.push(g),w===1&&x&&p.add(g),x||g.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(f=>{const p=(sl.get(f)||0)+1;sl.set(f,p),d.push(f),p===1&&f.setAttribute(xy,"")}),Ff+=1,()=>{i&&u.forEach(f=>{const y=(i.get(f)||0)-1;i.set(f,y),y||(!(l!=null&&l.has(f))&&o&&f.removeAttribute(o),l==null||l.delete(f))}),s&&d.forEach(f=>{const p=(sl.get(f)||0)-1;sl.set(f,p),p||f.removeAttribute(xy)}),Ff-=1,Ff||($f.inert=new WeakMap,$f["aria-hidden"]=new WeakMap,Tp.inert=new WeakSet,Tp["aria-hidden"]=new WeakSet,sl=new WeakMap)}}function by(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=Fe(e[0]).body;return wO(e,o,n,r,{mark:s})}let Sy=0;function bO(e,t="mui"){const[n,r]=S.useState(e),s=e||n;return S.useEffect(()=>{n==null&&(Sy+=1,r(`${t}-${Sy}`))},[n,t]),s}const Ey=kg.useId;function Cd(e,t){if(Ey!==void 0){const n=Ey();return e??(t?`${t}-${n}`:n)}return bO(e,t)}function SO(e,t){return function(r,...s){const o=new URL(e);return o.searchParams.set("code",r.toString()),s.forEach(i=>o.searchParams.append("args[]",i)),`${t} error #${r}; visit ${o} for the full message.`}}const tn=SO("https://base-ui.com/production-error","Base UI"),EO=parseInt(S.version,10);function _g(e){return EO>=e}function ky(e){if(!S.isValidElement(e))return null;const t=e,n=t.props;return(_g(19)?n==null?void 0:n.ref:t.ref)??null}function Pp(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function kO(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function CO(e,t){return typeof e=="function"?e(t):e}function NO(e,t){return typeof e=="function"?e(t):e}const Og={};function Nd(e,t,n,r,s){if(!n&&!r&&!e)return Iu(t);let o=Iu(e);return t&&(o=Hc(o,t)),n&&(o=Hc(o,n)),r&&(o=Hc(o,r)),o}function RO(e){if(e.length===0)return Og;if(e.length===1)return Iu(e[0]);let t=Iu(e[0]);for(let n=1;n<e.length;n+=1)t=Hc(t,e[n]);return t}function Iu(e){return Mg(e)?{...uE(e,Og)}:TO(e)}function Hc(e,t){return Mg(t)?uE(t,e):PO(e,t)}function TO(e){const t={...e};for(const n in t){const r=t[n];cE(n,r)&&(t[n]=dE(r))}return t}function PO(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Pp(e.style,r);break}case"className":{e[n]=fE(e.className,r);break}default:cE(n,r)?e[n]=IO(e[n],r):e[n]=r}}return e}function cE(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function Mg(e){return typeof e=="function"}function uE(e,t){return Mg(e)?e(t):e??Og}function IO(e,t){return t?e?(...n)=>{const r=n[0];if(hE(r)){const o=r;ju(o);const i=t(...n);return o.baseUIHandlerPrevented||e==null||e(...n),i}const s=t(...n);return e==null||e(...n),s}:dE(t):e}function dE(e){return e&&((...t)=>{const n=t[0];return hE(n)&&ju(n),e(...t)})}function ju(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function fE(e,t){return t?e?t+" "+e:t:e}function hE(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ut(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=MO(r));const s=jO(t,n,r);if(n.enabled===!1)return null;const o=n.state??Et;return AO(e,r,s,o)}function jO(e,t,n){const{className:r,style:s}=e,{state:o=Et,ref:i,props:l,stateAttributesMapping:a,enabled:c=!0}=t,u=c?CO(r,o):void 0,d=c?NO(s,o):void 0,f=c?kO(o,a):Et,p=c&&l?_O(l):void 0,y=c?Pp(f,p)??{}:Et;return typeof document<"u"&&(c?Array.isArray(i)?y.ref=W_([y.ref,ky(n),...i]):y.ref=Ni(y.ref,ky(n),i):Ni(null,null)),c?(u!==void 0&&(y.className=fE(y.className,u)),d!==void 0&&(y.style=Pp(y.style,d)),y):Et}function _O(e){return Array.isArray(e)?RO(e):Nd(void 0,e)}const OO=Symbol.for("react.lazy");function MO(e){if((e==null?void 0:e.$$typeof)!==OO)return e;const t=S.Children.toArray(e)[0];return S.isValidElement(t)?t:e}function AO(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Nd(n,t.props);return s.ref=n.ref,S.cloneElement(t,s)}if(e&&typeof e=="string")return zO(e,n);throw new Error(tn(8))}function zO(e,t){return e==="button"?S.createElement("button",{type:"button",...t,key:t.key}):e==="img"?S.createElement("img",{alt:"",...t,key:t.key}):S.createElement(e,t)}const DO=500,$O={style:{transition:"none"}},pE="data-base-ui-click-trigger",mE={fallbackAxisSide:"end"},FO={clipPath:"inset(50%)",position:"fixed",top:0,left:0},gE=S.createContext(null),xE=()=>S.useContext(gE),LO=Zl("portal");function yE(e={}){const{ref:t,container:n,componentProps:r=Et,elementProps:s}=e,o=Cd(),i=xE(),l=i==null?void 0:i.portalNode,[a,c]=S.useState(null),[u,d]=S.useState(null),f=me(b=>{b!==null&&d(b)}),p=S.useRef(null);fe(()=>{if(n===null){p.current&&(p.current=null,d(null),c(null));return}const b=(n&&(xg(n)?n:n.current))??l??document.body;if(b==null){p.current&&(p.current=null,d(null),c(null));return}p.current!==b&&(p.current=b,d(null),c(b))},[n,l]);const y=Ut("div",r,{ref:[t,f],props:[{id:o,[LO]:""},s]}),v=a&&y?dn.createPortal(y,a):null;return{node:u,nodeId:S.isValidElement(y)?y.props.id:void 0,subtree:v}}const vE=S.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:l,portalOwnerRole:a,...c}=t,{node:u,nodeId:d,subtree:f}=yE({container:l,ref:n,componentProps:t,elementProps:c}),p=S.useRef(null),y=S.useRef(null),v=S.useRef(null),b=S.useRef(null),[g,m]=S.useState(null),x=S.useRef(!1),w=g==null?void 0:g.modal,E=g==null?void 0:g.open,N=!!g&&!g.modal&&g.open&&!!u;S.useEffect(()=>{if(!u||w)return;function C(P){u&&P.relatedTarget&&Zo(P)&&(P.type==="focusin"?x.current&&(my(u),x.current=!1):(yO(u),x.current=!0))}return ir(Ee(u,"focusin",C,!0),Ee(u,"focusout",C,!0))},[u,w]),fe(()=>{!u||E!==!0||!x.current||(my(u),x.current=!1)},[E,u]);const k=S.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:y,beforeInsideRef:v,afterInsideRef:b,portalNode:u,setFocusManagerState:m}),[u]);return h.jsxs(S.Fragment,{children:[f,h.jsxs(gE.Provider,{value:k,children:[N&&u&&h.jsx(Ri,{"data-type":"outside",ref:p,onFocus:C=>{var P;if(Zo(C,u))(P=v.current)==null||P.focus();else{const I=g?g.domReference:null,z=iE(I);z==null||z.focus()}}}),N&&u&&h.jsx("span",{role:a,"aria-owns":d,style:FO}),u&&dn.createPortal(i,u),N&&u&&h.jsx(Ri,{"data-type":"outside",ref:y,onFocus:C=>{var P;if(Zo(C,u))(P=b.current)==null||P.focus();else{const I=g?g.domReference:null,z=jg(I);z==null||z.focus(),g!=null&&g.closeOnFocusOut&&(g==null||g.onOpenChange(!1,Me(Xl,C.nativeEvent)))}}})]})]})});function wE(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class HO{constructor(){ge(this,"nodesRef",{current:[]});ge(this,"events",wE())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const bE=S.createContext(null),SE=S.createContext(null),Rd=()=>{var e;return((e=S.useContext(bE))==null?void 0:e.id)||null},Bi=e=>{const t=S.useContext(SE);return e??t};function BO(e){const t=Cd(),n=Bi(e),r=Rd();return fe(()=>{if(!t)return;const s={id:t,parentId:r};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,r]),t}function VO(e){const{children:t,id:n}=e,r=Rd();return h.jsx(bE.Provider,{value:S.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function WO(e){const{children:t,externalTree:n}=e,r=Pn(()=>n??new HO).current;return h.jsx(SE.Provider,{value:r,children:t})}function pr(e){return e==null?e:"current"in e?e.current:e}function UO(e,t){const n=ot(Mt(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Cy=20;let cs=[];function Ag(){cs=cs.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function Ny(e){Ag(),e&&Nt(e)!=="body"&&(cs.push(new WeakRef(e)),cs.length>Cy&&(cs=cs.slice(-Cy)))}function Ry(){var e;return Ag(),(e=cs[cs.length-1])==null?void 0:e.deref()}function qO(e){return e?Ig(e)?e:Na(e)[0]||e:null}function Ty(e){var s;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((s=e.getAttribute("role"))!=null&&s.includes("dialog")))return;const n=sE(e).filter(o=>{const i=o.getAttribute("data-tabindex")||"";return Ig(o)||o.hasAttribute("data-tabindex")&&!i.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function EE(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:l=!0,closeOnFocusOut:a=!0,openInteractionType:c="",nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:y}=e,v="rootStore"in t?t.rootStore:t,b=v.useState("open"),g=v.useState("domReferenceElement"),m=v.useState("floatingElement"),{events:x,dataRef:w}=v.context,E=me(()=>{var V;return(V=w.current.floatingContext)==null?void 0:V.nodeId}),N=s===!1,k=ay(g)&&N,C=Ht(s),P=Ht(o),I=Ht(c),z=Ht(b),$=Bi(p),A=xE(),R=S.useRef(!1),j=S.useRef(!1),_=S.useRef(!1),F=S.useRef(null),T=S.useRef(""),M=S.useRef(""),O=S.useRef(null),U=S.useRef(null),L=Ni(O,f,A==null?void 0:A.beforeInsideRef),K=Ni(U,A==null?void 0:A.afterInsideRef),W=Mr(),q=Mr(),H=Cg(),G=A!=null,B=cy(m),Y=me((V=B)=>V?Na(V):[]),Q=me(()=>(y==null?void 0:y().filter(V=>V!=null))??[]);S.useEffect(()=>{if(r||!l)return;function V(ee){ee.key==="Tab"&&xe(B,vn(Fe(B)))&&Y().length===0&&!k&&g_(ee)}const X=Fe(B);return Ee(X,"keydown",V)},[r,B,l,k,Y]),S.useEffect(()=>{if(r||!b)return;const V=Fe(B);function X(){_.current=!1}function ee(Pe){const ce=Mt(Pe),ve=Q(),ue=xe(m,ce)||xe(g,ce)||xe(A==null?void 0:A.portalNode,ce)||ve.some(Re=>Re===ce||xe(Re,ce));_.current=!ue,M.current=Pe.pointerType||"keyboard",ce!=null&&ce.closest(`[${pE}]`)&&(j.current=!0,q.start(0,()=>{j.current=!1}))}function he(){M.current="keyboard"}return ir(Ee(V,"pointerdown",ee,!0),Ee(V,"pointerup",X,!0),Ee(V,"pointercancel",X,!0),Ee(V,"keydown",he,!0),X)},[r,m,g,B,b,A,q,Q]),S.useEffect(()=>{if(r||!a)return;const V=Fe(B);function X(){j.current=!0,q.start(0,()=>{j.current=!1})}function ee(ve){const ue=Mt(ve);Ig(ue)&&(F.current=ue)}function he(ve){const ue=ve.relatedTarget,Re=ve.currentTarget,ye=Mt(ve);l&&ue==null&&ye!=null&&xe(m,ye)&&Ny(ye),queueMicrotask(()=>{const ze=E(),Ie=v.context.triggerElements,et=Q(),lt=(ue==null?void 0:ue.hasAttribute(Zl("focus-guard")))&&[O.current,U.current,A==null?void 0:A.beforeInsideRef.current,A==null?void 0:A.afterInsideRef.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,pr(d),pr(u)].includes(ue),re=!(xe(g,ue)||xe(m,ue)||xe(ue,m)||xe(A==null?void 0:A.portalNode,ue)||et.some(se=>se===ue||xe(se,ue))||Ie.hasMatchingElement(se=>xe(se,ue))||lt||$&&(Ns($.nodesRef.current,ze).find(se=>{var De,we;return xe((De=se.context)==null?void 0:De.elements.floating,ue)||xe((we=se.context)==null?void 0:we.elements.domReference,ue)})||gy($.nodesRef.current,ze).find(se=>{var De,we,at;return[(De=se.context)==null?void 0:De.elements.floating,cy((we=se.context)==null?void 0:we.elements.floating)].includes(ue)||((at=se.context)==null?void 0:at.elements.domReference)===ue})));if(Re===g&&B&&Ty(B),i&&Re!==g&&!Pg(ye)&&vn(V)===V.body){if(Ve(B)&&(B.focus(),i==="popup")){H.request(()=>{B.focus()});return}const se=Y(),De=F.current,we=(De&&se.includes(De)?De:null)||se[se.length-1]||B;Ve(we)&&we.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(k||!l)&&ue&&re&&!j.current&&(k||ue!==Ry())&&(R.current=!0,v.setOpen(!1,Me(Xl,ve)))})}function Pe(){_.current||(w.current.insideReactTree=!0,W.start(0,()=>{w.current.insideReactTree=!1}))}const ce=Ve(g)?g:null;if(!(!m&&!ce))return ir(ce&&Ee(ce,"focusout",he),ce&&Ee(ce,"pointerdown",X),m&&Ee(m,"focusin",ee),m&&Ee(m,"focusout",he),m&&A&&Ee(m,"focusout",Pe,!0))},[r,g,m,B,l,$,A,v,a,i,Y,k,E,w,W,q,H,u,d,Q]),S.useEffect(()=>{var Re,ye,ze;if(r||!m||!b)return;const V=Array.from(((Re=A==null?void 0:A.portalNode)==null?void 0:Re.querySelectorAll(`[${Zl("portal")}]`))||[]),ee=(ze=(ye=($?gy($.nodesRef.current,E()):[]).find(Ie=>{var et;return ay(((et=Ie.context)==null?void 0:et.elements.domReference)||null)}))==null?void 0:ye.context)==null?void 0:ze.elements.domReference,Pe=[...[m,...V,O.current,U.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,...Q()],ee,pr(d),pr(u),k?g:null].filter(Ie=>Ie!=null),ce=by(Pe,{ariaHidden:l||k,mark:!1}),ve=[m,...V].filter(Ie=>Ie!=null),ue=by(ve);return()=>{ue(),ce()}},[b,r,g,m,l,A,k,$,E,u,d,Q]),fe(()=>{if(!b||r||!Ve(B))return;T.current="",M.current="";const V=Fe(B),X=vn(V);queueMicrotask(()=>{const ee=C.current,he=typeof ee=="function"?ee(I.current||""):ee;if(he===void 0||he===!1||xe(B,X))return;let ce=null;const ve=()=>(ce==null&&(ce=Y(B)),ce[0]||B);let ue;he===!0||he===null?ue=ve():ue=pr(he),ue=ue||ve();const Re=xe(B,vn(V));Df(ue,{preventScroll:ue===B,shouldFocus(){if(!z.current)return!1;if(Re)return!0;const ye=vn(V);return!(ye!==ue&&xe(B,ye))}})})},[r,b,B,Y,C,I,z]),fe(()=>{if(r||!B)return;const V=Fe(B),X=vn(V),ee=I.current==null;Ny(X);function he(ce){if(ce.open||(T.current=UO(ce.nativeEvent,M.current)),ce.reason===St&&ce.nativeEvent.type==="mouseleave"&&(R.current=!0),ce.reason===WS)if(ce.nested)R.current=!1;else if(zS(ce.nativeEvent)||DS(ce.nativeEvent))R.current=!1;else{let ve=!1;Fe(B).createElement("div").focus({get preventScroll(){return ve=!0,!1}}),ve?R.current=!1:R.current=!0}}x.on("openchange",he);function Pe(ce){const ve=P.current;let ue=typeof ve=="function"?ve(ce):ve;if(ue===void 0||ue===!1)return null;ue===null&&(ue=!0);const Re=g!=null&&g.isConnected?g:null,ye=X!=null&&X.isConnected&&Nt(X)!=="body"?X:null;let ze=ee?ye||Re:Re||ye;return ze||(ze=Ry()||null),typeof ue=="boolean"?ze:pr(ue)||ze||null}return()=>{x.off("openchange",he);const ce=vn(V),ve=Q(),ue=xe(m,ce)||ve.some(Ie=>Ie===ce||xe(Ie,ce))||$&&Ns($.nodesRef.current,E(),!1).some(Ie=>{var et;return xe((et=Ie.context)==null?void 0:et.elements.floating,ce)}),Re=P.current,ye=T.current,ze=Pe(ye);queueMicrotask(()=>{const Ie=qO(ze),et=typeof Re!="boolean";if(Re&&!R.current&&Ve(Ie)&&(!(!et&&Ie!==ce&&ce!==V.body)||ue)){const lt={preventScroll:!0};ye==="keyboard"&&(lt.focusVisible=!0),Ie.focus(lt)}R.current=!1})}},[r,m,B,P,I,x,$,g,E,Q]),fe(()=>{if(!wo||b||!m)return;const V=vn(Fe(m));!Ve(V)||!Sd(V)||xe(m,V)&&V.blur()},[b,m]),fe(()=>{if(!(r||!A))return A.setFocusManagerState({modal:l,closeOnFocusOut:a,open:b,onOpenChange:v.setOpen,domReference:g}),()=>{A.setFocusManagerState(null)}},[r,A,l,b,v,a,g]),fe(()=>{if(!(r||!B))return Ty(B),()=>{queueMicrotask(Ag)}},[r,B]);const Z=!r&&(l?!k:!0)&&(G||l);return h.jsxs(S.Fragment,{children:[Z&&h.jsx(Ri,{"data-type":"inside",ref:L,onFocus:V=>{var X;if(l){const ee=Y();Df(ee[ee.length-1])}else if(A!=null&&A.portalNode)if(R.current=!1,Zo(V,A.portalNode)){const ee=jg(g);ee==null||ee.focus()}else(X=pr(d??A.beforeOutsideRef))==null||X.focus()}}),n,Z&&h.jsx(Ri,{"data-type":"inside",ref:K,onFocus:V=>{var X;if(l)Df(Y()[0]);else if(A!=null&&A.portalNode)if(a&&(R.current=!0),Zo(V,A.portalNode)){const ee=iE(g);ee==null||ee.focus()}else(X=pr(u??A.afterOutsideRef))==null||X.focus()}})]})}function KO(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:o=!1,stickIfOpen:i=!0,touchOpenDelay:l=0,reason:a=ks}=t,c="rootStore"in e?e.rootStore:e,u=c.context.dataRef,d=S.useRef(void 0),f=Cg(),p=Mr(),y=S.useMemo(()=>{function v(g,m,x,w){const E=Me(a,m,x);g&&w==="touch"&&l>0?p.start(l,()=>{c.setOpen(!0,E)}):c.setOpen(g,E)}function b(g,m,x){const w=u.current.openEvent,E=c.select("domReferenceElement")!==m;return g&&E||!g||!s?!0:w&&i?!x(w.type):!1}return{onPointerDown(g){d.current=ys(g.pointerType,!0)&&DS(g.nativeEvent)?"virtual":g.pointerType},onMouseDown(g){const m=d.current,x=g.nativeEvent,w=c.select("open");if(g.button!==0||r==="click"||ys(m,!0)&&o)return;const E=b(w,g.currentTarget,C=>C==="click"||C==="mousedown"),N=Mt(x);if(Sd(N)){v(E,x,N,m);return}const k=g.currentTarget;f.request(()=>{v(E,x,k,m)})},onClick(g){if(r==="mousedown-only")return;const m=d.current;if(r==="mousedown"&&m){d.current=void 0;return}if(ys(m,!0)&&o)return;const x=c.select("open"),w=b(x,g.currentTarget,E=>E==="click"||E==="mousedown"||E==="keydown"||E==="keyup");v(w,g.nativeEvent,g.currentTarget,m)},onKeyDown(){d.current=void 0}}},[u,r,o,a,c,i,s,f,p,l]);return S.useMemo(()=>n?{reference:y}:Et,[n,y])}function YO(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var p;const o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",l=t.axis==="y"||t.axis==="both",a=["mouseenter","mousemove"].includes(((p=t.dataRef.current.openEvent)==null?void 0:p.type)||"")&&t.pointerType!=="touch";let c=o.width,u=o.height,d=o.x,f=o.y;return n==null&&t.x&&i&&(n=o.x-t.x),r==null&&t.y&&l&&(r=o.y-t.y),d-=n||0,f-=r||0,c=0,u=0,!s||a?(c=t.axis==="y"?o.width:0,u=t.axis==="x"?o.height:0,d=i&&t.x!=null?t.x:d,f=l&&t.y!=null?t.y:f):s&&!a&&(u=t.axis==="x"?o.height:u,c=t.axis==="y"?o.width:c),s=!0,{width:c,height:u,x:d,y:f,top:f,right:d+c,bottom:f+u,left:d}}}}function Py(e){return e!=null&&e.clientX!=null}function GO(e,t={}){const{enabled:n=!0,axis:r="both"}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),i=s.useState("floatingElement"),l=s.useState("domReferenceElement"),a=s.context.dataRef,c=S.useRef(!1),u=S.useRef(null),[d,f]=S.useState(),[p,y]=S.useState([]),v=me(w=>{s.set("positionReference",w)}),b=me((w,E,N)=>{c.current||a.current.openEvent&&!Py(a.current.openEvent)||s.set("positionReference",YO(N??l,{x:w,y:E,axis:r,dataRef:a,pointerType:d}))}),g=me(w=>{o?u.current||(b(w.clientX,w.clientY,w.currentTarget),y([])):b(w.clientX,w.clientY,w.currentTarget)}),m=ys(d)?i:o;S.useEffect(()=>{if(!n){v(l);return}if(!m)return;function w(){var k;(k=u.current)==null||k.call(u),u.current=null}const E=ot(i);function N(k){const C=Mt(k);xe(i,C)?w():b(k.clientX,k.clientY)}return!a.current.openEvent||Py(a.current.openEvent)?u.current=Ee(E,"mousemove",N):v(l),w},[m,n,i,a,l,s,b,v,p]),S.useEffect(()=>()=>{s.set("positionReference",null)},[s]),S.useEffect(()=>{n&&!i&&(c.current=!1)},[n,i]),S.useEffect(()=>{!n&&o&&(c.current=!0)},[n,o]);const x=S.useMemo(()=>{function w(E){f(E.pointerType)}return{onPointerDown:w,onPointerEnter:w,onMouseMove:g,onMouseEnter:g}},[g]);return S.useMemo(()=>n?{reference:x,trigger:x}:{},[n,x])}function QO(){return!1}function XO(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function zg(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=QO,bubbles:l,externalTree:a}=t,c="rootStore"in e?e.rootStore:e,u=c.useState("open"),d=c.useState("floatingElement"),{dataRef:f,events:p}=c.context,y=Bi(a),v=me(typeof s=="function"?s:()=>!1),b=typeof s=="function"?v:s,g=b!==!1,m=me(()=>o),{escapeKey:x,outsidePress:w}=XO(l),E=S.useRef(!1),N=S.useRef(!1),k=S.useRef(!1),C=S.useRef(!1),P=S.useRef(!1),I=S.useRef(""),z=S.useRef(null),$=Mr(),A=Mr(),R=me(()=>{A.clear(),f.current.insideReactTree=!1}),j=me(W=>{var G;const q=(G=f.current.floatingContext)==null?void 0:G.nodeId;return(y?Ns(y.nodesRef.current,q):[]).some(B=>{var Y;return((Y=B.context)==null?void 0:Y.open)&&!B.context.dataRef.current[W]})}),_=me(W=>Of(W,c.select("floatingElement"))||Of(W,c.select("domReferenceElement"))),F=me(W=>{i()&&c.setOpen(!1,Me(ks,W.nativeEvent))}),T=me(W=>{if(!u||!n||!r||W.key!=="Escape"||P.current||!x&&j("__escapeKeyBubbles"))return;const q=x_(W)?W.nativeEvent:W,H=Me(kd,q);c.setOpen(!1,H),H.isCanceled||W.preventDefault(),!x&&!H.isPropagationAllowed&&W.stopPropagation()}),M=me(()=>{f.current.insideReactTree=!0,A.start(0,R)}),O=me(W=>{if(!u||!n||W.button!==0)return;const q=Mt(W.nativeEvent);xe(c.select("floatingElement"),q)&&(E.current||(E.current=!0,N.current=!1))}),U=me(W=>{!u||!n||(W.defaultPrevented||W.nativeEvent.defaultPrevented)&&E.current&&(N.current=!0)});S.useEffect(()=>{function W(q){q.open||(C.current=!1)}return p.on("openchange",W),()=>{p.off("openchange",W)}},[p]),S.useEffect(()=>{if(!u||!n)return u||(C.current=!1),R;f.current.__escapeKeyBubbles=x,f.current.__outsidePressBubbles=w;const W=new In,q=new In,H=Fe(d);function G(){W.clear(),P.current=!0}function B(){W.start(wo?5:0,()=>{P.current=!1})}function Y(){k.current=!0,q.start(0,()=>{k.current=!1})}function Q(){E.current=!1,N.current=!1}function Z(){const re=I.current,se=re==="pen"||!re?"mouse":re,De=m(),we=typeof De=="function"?De():De;return typeof we=="string"?we:we[se]}function V(re){const se=Z();return se==="intentional"&&re.type!=="click"||se==="sloppy"&&re.type==="click"}function X(re){var we;const se=(we=f.current.floatingContext)==null?void 0:we.nodeId,De=y&&Ns(y.nodesRef.current,se).some(at=>{var nn;return Of(re,(nn=at.context)==null?void 0:nn.elements.floating)});return _(re)||De}function ee(re){if(V(re)){re.type!=="click"&&!_(re)&&(q.clear(),k.current=!1),R();return}if(f.current.insideReactTree){R();return}const se=Mt(re),De=`[${Zl("inert")}]`,we=Ce(se)?se.getRootNode():null,at=Array.from((Ci(we)?we:Fe(c.select("floatingElement"))).querySelectorAll(De)),nn=c.context.triggerElements;if(se&&(nn.hasElement(se)||nn.hasMatchingElement(ne=>xe(ne,se))))return;let qt=Ce(se)?se:null;for(;qt&&!vs(qt);){const ne=Es(qt);if(vs(ne)||!Ce(ne))break;qt=ne}if(!(at.length&&Ce(se)&&!z_(se)&&!xe(se,c.select("floatingElement"))&&at.every(ne=>!xe(qt,ne)))){if(Ve(se)&&!("touches"in re)){const ne=vs(se),Be=fn(se),je=/auto|scroll/,zt=ne||je.test(Be.overflowX),gn=ne||je.test(Be.overflowY),qn=zt&&se.clientWidth>0&&se.scrollWidth>se.clientWidth,Kn=gn&&se.clientHeight>0&&se.scrollHeight>se.clientHeight,Eo=Be.direction==="rtl",ko=Kn&&(Eo?re.offsetX<=se.offsetWidth-se.clientWidth:re.offsetX>se.clientWidth),Co=qn&&re.offsetY>se.clientHeight;if(ko||Co)return}if(!X(re)){if(Z()==="intentional"){if(re.detail!==0&&!zS(re)&&!C.current)return;if(k.current){q.clear(),k.current=!1;return}}typeof b=="function"&&!b(re)||j("__outsidePressBubbles")||(c.setOpen(!1,Me(WS,re)),R())}}}function he(re){Z()!=="sloppy"||re.pointerType==="touch"||!c.select("open")||!n||_(re)||ee(re)}function Pe(re){if(Z()!=="sloppy"||!c.select("open")||!n||_(re))return;const se=re.touches[0];se&&(z.current={startTime:Date.now(),startX:se.clientX,startY:se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},$.start(1e3,()=>{z.current&&(z.current.dismissOnTouchEnd=!1,z.current.dismissOnMouseDown=!1)}))}function ce(re,se){const De=Mt(re);if(!De)return;const we=Ee(De,re.type,()=>{se(re),we()})}function ve(re){I.current="touch",ce(re,Pe)}function ue(re){$.clear(),re.type==="pointerdown"&&(re.button===0&&(C.current=!0),I.current=re.pointerType),!(re.type==="mousedown"&&z.current&&!z.current.dismissOnMouseDown)&&ce(re,se=>{se.type==="pointerdown"?he(se):ee(se)})}function Re(re){if(re.type==="pointercancel"&&(C.current=!1),!E.current)return;const se=N.current;if(Q(),Z()==="intentional"){if(re.type==="pointercancel"){se&&Y();return}if(!X(re)){if(se){Y();return}typeof b=="function"&&!b(re)||(q.clear(),k.current=!0,R())}}}function ye(re){if(Z()!=="sloppy"||!z.current||_(re))return;const se=re.touches[0];if(!se)return;const De=Math.abs(se.clientX-z.current.startX),we=Math.abs(se.clientY-z.current.startY),at=Math.sqrt(De*De+we*we);at>5&&(z.current.dismissOnTouchEnd=!0),at>10&&(ee(re),$.clear(),z.current=null)}function ze(re){ce(re,ye)}function Ie(re){Z()!=="sloppy"||!z.current||_(re)||(z.current.dismissOnTouchEnd&&ee(re),$.clear(),z.current=null)}function et(re){ce(re,Ie)}const lt=ir(r&&ir(Ee(H,"keydown",T),Ee(H,"compositionstart",G),Ee(H,"compositionend",B)),g&&ir(Ee(H,"click",ue,!0),Ee(H,"pointerdown",ue,!0),Ee(H,"pointerup",Re,!0),Ee(H,"pointercancel",Re,!0),Ee(H,"mousedown",ue,!0),Ee(H,"mouseup",Re,!0),Ee(H,"touchstart",ve,{capture:!0,passive:!0}),Ee(H,"touchmove",ze,{capture:!0,passive:!0}),Ee(H,"touchend",et,{capture:!0,passive:!0})));return()=>{lt(),W.clear(),q.clear(),Q(),k.current=!1,R()}},[f,d,r,g,b,u,n,x,w,T,R,m,j,_,y,c,$]);const L=S.useMemo(()=>({onKeyDown:T,onPointerDown:F,onClick:F}),[T,F]),K=S.useMemo(()=>({onKeyDown:T,onPointerDown:U,onMouseDown:U,onClickCapture:M,onMouseDownCapture(W){M(),O(W)},onPointerDownCapture(W){M(),O(W)},onMouseUpCapture:M,onTouchEndCapture:M,onTouchMoveCapture:M}),[T,M,O,U]);return S.useMemo(()=>n?{reference:L,floating:K,trigger:L}:{},[n,L,K])}function Iy(e,t,n){let{reference:r,floating:s}=e;const o=kn(t),i=Tg(t),l=Rg(i),a=Nn(t),c=o==="y",u=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=r[l]/2-s[l]/2;let p;switch(a){case"top":p={x:u,y:r.y-s.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-s.width,y:d};break;default:p={x:r.x,y:r.y}}const y=Ar(t);return y&&(p[i]+=f*(y==="end"?1:-1)*(n&&c?-1:1)),p}async function ZO(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Cs(t,e),y=XS(p),b=l[f?d==="floating"?"reference":"floating":d],g=Pu(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),m=d==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),w=await(o.isElement==null?void 0:o.isElement(x))&&await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1},E=Pu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:m,offsetParent:x,strategy:a}):m);return{top:(g.top-E.top+y.top)/w.y,bottom:(E.bottom-g.bottom+y.bottom)/w.y,left:(g.left-E.left+y.left)/w.x,right:(E.right-g.right+y.right)/w.x}}const JO=50,e2=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:ZO},a=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=Iy(c,r,a),f=r,p=0;const y={};for(let v=0;v<o.length;v++){const b=o[v];if(!b)continue;const{name:g,fn:m}=b,{x,y:w,data:E,reset:N}=await m({x:u,y:d,initialPlacement:r,placement:f,strategy:s,middlewareData:y,rects:c,platform:l,elements:{reference:e,floating:t}});u=x??u,d=w??d,y[g]={...y[g],...E},N&&p<JO&&(p++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(c=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:u,y:d}=Iy(c,f,a)),v=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:y}},t2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...b}=Cs(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const g=Nn(s),m=kn(l),x=Nn(l)===l,w=await(a.isRTL==null?void 0:a.isRTL(c.floating)),E=f||(x||!v?[Tu(l)]:nO(l)),N=y!=="none";!f&&N&&E.push(...iO(l,v,y,w));const k=[l,...E],C=await a.detectOverflow(t,b),P=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&P.push(C[g]),d){const R=tO(s,i,w);P.push(C[R[0]],C[R[1]])}if(I=[...I,{placement:s,overflows:P}],!P.every(R=>R<=0)){var z,$;const R=(((z=o.flip)==null?void 0:z.index)||0)+1,j=k[R];if(j&&(!(d==="alignment"?m!==kn(j):!1)||I.every(T=>kn(T.placement)===m?T.overflows[0]>0:!0)))return{data:{index:R,overflows:I},reset:{placement:j}};let _=($=I.filter(F=>F.overflows[0]<=0).sort((F,T)=>F.overflows[1]-T.overflows[1])[0])==null?void 0:$.placement;if(!_)switch(p){case"bestFit":{var A;const F=(A=I.filter(T=>{if(N){const M=kn(T.placement);return M===m||M==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(M=>M>0).reduce((M,O)=>M+O,0)]).sort((T,M)=>T[1]-M[1])[0])==null?void 0:A[0];F&&(_=F);break}case"initialPlacement":_=l;break}if(s!==_)return{reset:{placement:_}}}return{}}}},kE=new Set(["left","top"]);async function n2(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=Nn(n),l=Ar(n),a=kn(n)==="y",c=kE.has(i)?-1:1,u=o&&a?-1:1,d=Cs(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof y=="number"&&(p=l==="end"?y*-1:y),a?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const r2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:l}=t,a=await n2(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+a.x,y:o+a.y,data:{...a,placement:i}}}}},s2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:m=>{let{x,y:w}=m;return{x,y:w}}},...c}=Cs(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),f=kn(s),p=Ng(f);let y=u[p],v=u[f];const b=(m,x)=>QS(x+d[m==="y"?"top":"left"],x,x-d[m==="y"?"bottom":"right"]);i&&(y=b(p,y)),l&&(v=b(f,v));const g=a.fn({...t,[p]:y,[f]:v});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[f]:l}}}}}},o2=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:o,placement:i,rects:l,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Cs(e,t),f={x:s,y:o},p=kn(i),y=Ng(p);let v=f[y],b=f[p];const g=Cs(c,t),m=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(r=g.crossAxis)!=null?r:0};if(u){const E=y==="y"?"height":"width",N=l.reference[y]-l.floating[E]+m.mainAxis,k=l.reference[y]+l.reference[E]-m.mainAxis;v<N?v=N:v>k&&(v=k)}if(d){var x,w;const E=y==="y"?"width":"height",N=kE.has(Nn(i)),k=l.reference[p]-l.floating[E]+(N&&((x=a.offset)==null?void 0:x[p])||0)+(N?0:m.crossAxis),C=l.reference[p]+l.reference[E]+(N?0:((w=a.offset)==null?void 0:w[p])||0)-(N?m.crossAxis:0);b<k?b=k:b>C&&(b=C)}return{[y]:v,[p]:b}}}},i2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:o}=t,{apply:i=()=>{},...l}=Cs(e,t),a=await s.detectOverflow(t,l),c=Nn(n),u=Ar(n),d=kn(n)==="y",{width:f,height:p}=r.floating;let y,v;c==="top"||c==="bottom"?(y=c,v=u===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(v=c,y=u==="end"?"top":"bottom");const b=p-a.top-a.bottom,g=f-a.left-a.right,m=Ti(p-a[y],b),x=Ti(f-a[v],g),w=t.middlewareData.shift,E=!w;let N=m,k=x;w!=null&&w.enabled.x&&(k=g),w!=null&&w.enabled.y&&(N=b),E&&!u&&(d?k=f-2*Nr(a.left,a.right):N=p-2*Nr(a.top,a.bottom)),await i({...t,availableWidth:k,availableHeight:N});const C=await s.getDimensions(o.floating);return f!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function CE(e){const t=fn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Ve(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,l=Ru(n)!==o||Ru(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function Dg(e){return Ce(e)?e:e.contextElement}function Jo(e){const t=Dg(e);if(!Ve(t))return Rr(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=CE(t);let i=(o?Ru(n.width):n.width)/r,l=(o?Ru(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const l2=Rr(0);function NE(e){const t=ot(e);return!vg()||!t.visualViewport?l2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function a2(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ot(e)}function uo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Dg(e);let i=Rr(1);t&&(r?Ce(r)&&(i=Jo(r)):i=Jo(e));const l=a2(o,n,r)?NE(o):Rr(0);let a=(s.left+l.x)/i.x,c=(s.top+l.y)/i.y,u=s.width/i.x,d=s.height/i.y;if(o&&r){const f=ot(o),p=Ce(r)?ot(r):r;let y=f,v=Ep(y);for(;v&&p!==y;){const b=Jo(v),g=v.getBoundingClientRect(),m=fn(v),x=g.left+(v.clientLeft+parseFloat(m.paddingLeft))*b.x,w=g.top+(v.clientTop+parseFloat(m.paddingTop))*b.y;a*=b.x,c*=b.y,u*=b.x,d*=b.y,a+=x,c+=w,y=ot(v),v=Ep(y)}}return Pu({width:u,height:d,x:a,y:c})}function Td(e,t){const n=bd(e).scrollLeft;return t?t.left+n:uo($r(e)).left+n}function RE(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Td(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function c2(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=$r(r),l=t?wd(t.floating):!1;if(r===i||l&&o)return n;let a={scrollLeft:0,scrollTop:0},c=Rr(1);const u=Rr(0),d=Ve(r);if((d||!o)&&((Nt(r)!=="body"||Ca(i))&&(a=bd(r)),d)){const p=uo(r);c=Jo(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=i&&!d&&!o?RE(i,a):Rr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-a.scrollTop*c.y+u.y+f.y}}function u2(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function d2(e){const t=bd(e),n=e.ownerDocument.body,r=Nr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Nr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+Td(e);const i=-t.scrollTop;return fn(n).direction==="rtl"&&(o+=Nr(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:o,y:i}}const f2=25;function h2(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=ot(e),o=$r(e),i=s.visualViewport;let l=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){const f=!vg()||t==="fixed";r?f||(c=-i.offsetLeft,u=-i.offsetTop):(l=i.width,a=i.height,f&&(c=i.offsetLeft,u=i.offsetTop))}if(Td(o)<=0){const f=o.ownerDocument,p=f.body,y=getComputedStyle(p),v=f.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,b=Math.abs(o.clientWidth-p.clientWidth-v),g=getComputedStyle(o).scrollbarGutter==="stable both-edges"?b/2:b;g<=f2&&(l-=g)}return{width:l,height:a,x:c,y:u}}function p2(e,t){const n=uo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Jo(e),i=e.clientWidth*o.x,l=e.clientHeight*o.y,a=s*o.x,c=r*o.y;return{width:i,height:l,x:a,y:c}}function jy(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=h2(e,n,t);else if(t==="document")r=d2($r(e));else if(Ce(t))r=p2(t,n);else{const s=NE(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Pu(r)}function m2(e,t){const n=t.get(e);if(n)return n;let r=Ql(e,[],!1).filter(l=>Ce(l)&&Nt(l)!=="body"),s=null;const o=fn(e).position==="fixed";let i=o?Es(e):e;for(;Ce(i)&&!vs(i);){const l=fn(i),a=yg(i),c=s?s.position:o?"fixed":"";!a&&(c==="fixed"||c==="absolute"&&l.position==="static")?r=r.filter(d=>d!==i):s=l,i=Es(i)}return t.set(e,r),r}function g2(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?wd(t)?[]:m2(t,this._c):[].concat(n),r],l=jy(t,i[0],s);let a=l.top,c=l.right,u=l.bottom,d=l.left;for(let f=1;f<i.length;f++){const p=jy(t,i[f],s);a=Nr(p.top,a),c=Ti(p.right,c),u=Ti(p.bottom,u),d=Nr(p.left,d)}return{width:c-d,height:u-a,x:d,y:a}}function x2(e){const{width:t,height:n}=CE(e);return{width:t,height:n}}function y2(e,t,n){const r=Ve(t),s=$r(t),o=n==="fixed",i=uo(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const a=Rr(0);if((r||!o)&&((Nt(t)!=="body"||Ca(s))&&(l=bd(t)),r)){const f=uo(t,!0,o,t);a.x=f.x+t.clientLeft,a.y=f.y+t.clientTop}!r&&s&&(a.x=Td(s));const c=s&&!r&&!o?RE(s,l):Rr(0),u=i.left+l.scrollLeft-a.x-c.x,d=i.top+l.scrollTop-a.y-c.y;return{x:u,y:d,width:i.width,height:i.height}}function Lf(e){return fn(e).position==="static"}function _y(e,t){if(!Ve(e)||fn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $r(e)===n&&(n=n.ownerDocument.body),n}function TE(e,t){const n=ot(e);if(wd(e))return n;if(!Ve(e)){let s=Es(e);for(;s&&!vs(s);){if(Ce(s)&&!Lf(s))return s;s=Es(s)}return n}let r=_y(e,t);for(;r&&v_(r)&&Lf(r);)r=_y(r,t);return r&&vs(r)&&Lf(r)&&!yg(r)?n:r||S_(e)||n}const v2=async function(e){const t=this.getOffsetParent||TE,n=this.getDimensions,r=await n(e.floating);return{reference:y2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function w2(e){return fn(e).direction==="rtl"}const b2={convertOffsetParentRelativeRectToViewportRelativeRect:c2,getDocumentElement:$r,getClippingRect:g2,getOffsetParent:TE,getElementRects:v2,getClientRects:u2,getDimensions:x2,getScale:Jo,isElement:Ce,isRTL:w2};function PE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function S2(e,t,n){let r=null,s;const o=$r(e);function i(){var u;clearTimeout(s),(u=r)==null||u.disconnect(),r=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:p,top:y,width:v,height:b}=f;if(u||t(),!v||!b)return;const g=uc(y),m=uc(o.clientWidth-(p+v)),x=uc(o.clientHeight-(y+b)),w=uc(p),N={rootMargin:-g+"px "+-m+"px "+-x+"px "+-w+"px",threshold:Nr(0,Ti(1,d))||1};let k=!0;function C(P){const I=P[0].intersectionRatio;if(!PE(f,e.getBoundingClientRect()))return l();if(I!==d){if(!k)return l();I?l(!1,I):s=setTimeout(()=>{l(!1,1e-7)},1e3)}k=!1}try{r=new IntersectionObserver(C,{...N,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,N)}r.observe(e)}const a=ot(e),c=()=>l(n);return a.addEventListener("resize",c),l(!0),()=>{a.removeEventListener("resize",c),i()}}function Oy(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=Dg(e),u=s||o?[...c?Ql(c):[],...t?Ql(t):[]]:[];u.forEach(g=>{s&&g.addEventListener("scroll",n),o&&g.addEventListener("resize",n)});const d=c&&l?S2(c,n,o):null;let f=-1,p=null;i&&(p=new ResizeObserver(g=>{let[m]=g;m&&m.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),c&&!a&&p.observe(c),t&&p.observe(t));let y,v=a?uo(e):null;a&&b();function b(){const g=uo(e);v&&!PE(v,g)&&n(),v=g,y=requestAnimationFrame(b)}return n(),()=>{var g;u.forEach(m=>{s&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),d==null||d(),(g=p)==null||g.disconnect(),p=null,a&&cancelAnimationFrame(y)}}const E2=r2,k2=s2,C2=t2,N2=i2,R2=o2,T2=(e,t,n)=>{const r=new Map,s=n??{},o={...b2,...s.platform,_c:r};return e2(e,t,{...s,platform:o})};var P2=typeof document<"u",I2=function(){},Bc=P2?S.useLayoutEffect:I2;function _u(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_u(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!_u(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function IE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function My(e,t){const n=IE(e);return Math.round(t*n)/n}function Hf(e){const t=S.useRef(e);return Bc(()=>{t.current=e}),t}function j2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:l=!0,whileElementsMounted:a,open:c}=e,[u,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=S.useState(r);_u(f,r)||p(r);const[y,v]=S.useState(null),[b,g]=S.useState(null),m=S.useCallback(T=>{T!==N.current&&(N.current=T,v(T))},[]),x=S.useCallback(T=>{T!==k.current&&(k.current=T,g(T))},[]),w=o||y,E=i||b,N=S.useRef(null),k=S.useRef(null),C=S.useRef(u),P=a!=null,I=Hf(a),z=Hf(s),$=Hf(c),A=S.useCallback(()=>{if(!N.current||!k.current)return;const T={placement:t,strategy:n,middleware:f};z.current&&(T.platform=z.current),T2(N.current,k.current,T).then(M=>{const O={...M,isPositioned:$.current!==!1};R.current&&!_u(C.current,O)&&(C.current=O,dn.flushSync(()=>{d(O)}))})},[f,t,n,z,$]);Bc(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[c]);const R=S.useRef(!1);Bc(()=>(R.current=!0,()=>{R.current=!1}),[]),Bc(()=>{if(w&&(N.current=w),E&&(k.current=E),w&&E){if(I.current)return I.current(w,E,A);A()}},[w,E,A,I,P]);const j=S.useMemo(()=>({reference:N,floating:k,setReference:m,setFloating:x}),[m,x]),_=S.useMemo(()=>({reference:w,floating:E}),[w,E]),F=S.useMemo(()=>{const T={position:n,left:0,top:0};if(!_.floating)return T;const M=My(_.floating,u.x),O=My(_.floating,u.y);return l?{...T,transform:"translate("+M+"px, "+O+"px)",...IE(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:O}},[n,l,_.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:A,refs:j,elements:_,floatingStyles:F}),[u,A,j,_,F])}const _2=(e,t)=>{const n=E2(e);return{name:n.name,fn:n.fn,options:[e,t]}},O2=(e,t)=>{const n=k2(e);return{name:n.name,fn:n.fn,options:[e,t]}},M2=(e,t)=>({fn:R2(e).fn,options:[e,t]}),A2=(e,t)=>{const n=C2(e);return{name:n.name,fn:n.fn,options:[e,t]}},z2=(e,t)=>{const n=N2(e);return{name:n.name,fn:n.fn,options:[e,t]}};var jE={exports:{}},_E={};/**
41
- * @license React
42
- * use-sync-external-store-shim.production.js
43
- *
44
- * Copyright (c) Meta Platforms, Inc. and affiliates.
45
- *
46
- * This source code is licensed under the MIT license found in the
47
- * LICENSE file in the root directory of this source tree.
48
- */var Pi=S;function D2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $2=typeof Object.is=="function"?Object.is:D2,F2=Pi.useState,L2=Pi.useEffect,H2=Pi.useLayoutEffect,B2=Pi.useDebugValue;function V2(e,t){var n=t(),r=F2({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return H2(function(){s.value=n,s.getSnapshot=t,Bf(s)&&o({inst:s})},[e,n,t]),L2(function(){return Bf(s)&&o({inst:s}),e(function(){Bf(s)&&o({inst:s})})},[e]),B2(n),n}function Bf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$2(e,n)}catch{return!0}}function W2(e,t){return t()}var U2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?W2:V2;_E.useSyncExternalStore=Pi.useSyncExternalStore!==void 0?Pi.useSyncExternalStore:U2;jE.exports=_E;var Pd=jE.exports,OE={exports:{}},ME={};/**
49
- * @license React
50
- * use-sync-external-store-shim/with-selector.production.js
51
- *
52
- * Copyright (c) Meta Platforms, Inc. and affiliates.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE file in the root directory of this source tree.
56
- */var Id=S,q2=Pd;function K2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Y2=typeof Object.is=="function"?Object.is:K2,G2=q2.useSyncExternalStore,Q2=Id.useRef,X2=Id.useEffect,Z2=Id.useMemo,J2=Id.useDebugValue;ME.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=Q2(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=Z2(function(){function a(p){if(!c){if(c=!0,u=p,p=r(p),s!==void 0&&i.hasValue){var y=i.value;if(s(y,p))return d=y}return d=p}if(y=d,Y2(u,p))return y;var v=r(p);return s!==void 0&&s(y,v)?(u=p,y):(u=p,d=v)}var c=!1,u,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,s]);var l=G2(e,o[0],o[1]);return X2(function(){i.hasValue=!0,i.value=l},[l]),J2(l),l};OE.exports=ME;var AE=OE.exports;const eM=Rw(AE),tM=_g(19),nM=tM?sM:oM;function zE(e,t,n,r,s){return nM(e,t,n,r,s)}function rM(e,t,n,r,s){const o=S.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return Pd.useSyncExternalStore(e.subscribe,o,o)}l_({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),Pd.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function sM(e,t,n,r,s){const o=i_();if(!o)return rM(e,t,n,r,s);const i=o.syncIndex;o.syncIndex+=1;let l;return o.didInitialize?(l=o.syncHooks[i],(l.store!==e||l.selector!==t||!Object.is(l.a1,n)||!Object.is(l.a2,r)||!Object.is(l.a3,s))&&(l.store!==e&&(o.didChangeStore=!0),l.store=e,l.selector=t,l.a1=n,l.a2=r,l.a3=s,l.value=t(e.getSnapshot(),n,r,s))):(l={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},o.syncHooks.push(l)),l.value}function oM(e,t,n,r,s){return AE.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class iM{constructor(t){ge(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));ge(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new this(t)}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return zE(this,t,n,r,s)}}class jd extends iM{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){S.useDebugValue(t);const r=this;fe(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;fe(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);fe(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){S.useDebugValue(t);const r=this,s=n!==void 0;fe(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const o=this.selectors[t];return o(this.state,n,r,s)}useState(t,n,r,s){return S.useDebugValue(t),zE(this,this.selectors[t],n,r,s)}useContextCallback(t,n){S.useDebugValue(t);const r=me(n??mg);this.context[t]=r}useStateSetter(t){const n=S.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const i=r(o);if(!Object.is(s,i)){const l=s;s=i,n(i,l,this)}})}}const lM={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};class DE extends jd{constructor(n){const{syncOnly:r,nested:s,onOpenChange:o,triggerElements:i,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:wE(),nested:s,triggerElements:i},lM);ge(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&y_(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});ge(this,"dispatchOpenChange",(n,r)=>{this.syncOpenEvent(n,r.event);const s={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",s)});ge(this,"setOpen",(n,r)=>{var s,o,i,l;if(this.syncOnly){(o=(s=this.context).onOpenChange)==null||o.call(s,n,r);return}this.dispatchOpenChange(n,r),(l=(i=this.context).onOpenChange)==null||l.call(i,n,r)});this.syncOnly=r}}function aM(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,l=t.useState("open"),a=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),u=t.context.triggerElements,d=i,f=S.useRef(null);r===void 0&&f.current===null&&(f.current=new DE({open:l,transitionStatus:void 0,referenceElement:a,floatingElement:c,triggerElements:u,onOpenChange:d,floatingId:s,syncOnly:!0,nested:o}));const p=r??f.current;return t.useSyncedValue("floatingId",s),fe(()=>{const y={open:l,floatingId:s,referenceElement:a,floatingElement:c};Ce(a)&&(y.domReferenceElement=a),p.state.positionReference===p.state.referenceElement&&(y.positionReference=a),p.update(y)},[l,s,a,c,p]),p.context.onOpenChange=d,p.context.nested=o,p}function $E(e,t=!1,n=!1,r=!1){const[s,o]=S.useState(e&&t?"idle":void 0),[i,l]=S.useState(e&&!r);return e&&!i&&(l(!0),o("starting")),!e&&i&&s!=="ending"&&!n&&o("ending"),!e&&!i&&s==="ending"&&o(void 0),fe(()=>{if(!e&&i&&s!=="ending"&&n){const a=tr.request(()=>{o("ending")});return()=>{tr.cancel(a)}}},[e,i,s,n]),fe(()=>{if(!e||t)return;const a=tr.request(()=>{o(void 0)});return()=>{tr.cancel(a)}},[t,e]),fe(()=>{if(!e||!t)return;e&&i&&s!=="idle"&&o("starting");const a=tr.request(()=>{o("idle")});return()=>{tr.cancel(a)}},[t,e,i,s]),{mounted:i,setMounted:l,transitionStatus:s}}let fc=null;function cM(e){if(!fc){const t=[];fc=t,queueMicrotask(()=>{fc=null,dn.flushSync(()=>{for(const n of t)n()})})}fc.push(e)}function FE(e,t=!1,n=!1){const r=Cg();return me((s,o=null)=>{r.cancel();const i=pr(e);if(i==null)return;const l=i,a=()=>{if(!n){dn.flushSync(s);return}cM(()=>{o!=null&&o.aborted||s()})};if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function c(){Promise.all(l.getAnimations().map(u=>u.finished)).then(()=>{o!=null&&o.aborted||a()},()=>{if(o!=null&&o.aborted)return;if(l.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}a()})}if(t){const u=LS;if(!l.hasAttribute(u)){r.request(c);return}const d=new MutationObserver(()=>{l.hasAttribute(u)||(d.disconnect(),c())});d.observe(l,{attributes:!0,attributeFilter:[u]}),o==null||o.addEventListener("abort",()=>d.disconnect(),{once:!0});return}r.request(c)})}function Ra(e){const{enabled:t=!0,open:n,ref:r,batch:s=!1,onComplete:o}=e,i=me(o),l=FE(r,n,s);S.useEffect(()=>{if(!t)return;const a=new AbortController;return l(i,a.signal),()=>{a.abort()}},[t,n,i,l])}const $g={tabIndex:-1,[kp]:""};function LE(e){return t=>t==="touch"?e.current:!0}function Fg(e,t=!1){const n=Cd(),r=Rd()!=null,s=Pn(()=>e(n,r)).current;return aM({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Lg({handle:e,store:t}){return fe(()=>e.attachStore(t),[e,t]),null}function Ay(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function uM(e,t){const n=S.useRef(null);return me(r=>{const s=n.current;if(s!==null){if(s.element===r&&s.store===t&&s.id===e)return;n.current=null;const o=s.store;o.context.triggerElements.getById(s.id)===s.element&&(o.context.triggerElements.delete(s.id),Ay(o))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Ay(t))})}function Hg(e,t,n,r=!1){let s=e.preventUnmountingOnClose;t?s=!1:r&&(s=!0);const o=(n==null?void 0:n.id)??null;let i=e.activeTriggerId,l=e.activeTriggerElement;return(o||t)&&(i=o,l=n??null),{open:t,preventUnmountingOnClose:s,activeTriggerId:i,activeTriggerElement:l}}function HE(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function dM(e,t,n,r={}){var u,d,f;const s=n.reason,o=s===St,i=t&&s===Lc,l=!t&&(s===ks||s===kd),a=HE(n);if((d=(u=e.context).onOpenChange)==null||d.call(u,t,n),n.isCanceled)return;(f=r.onBeforeDispatch)==null||f.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const p=Hg(e.state,t,n.trigger,a()),y={...r.extraState,...p};i?y.instantType="focus":l?y.instantType="dismiss":o&&(y.instantType=void 0),e.update(y)};o?dn.flushSync(c):c()}function BE(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=uM(e,n),i=me(a=>{const c=n.select("open"),u=n.select("activeTriggerId");if(u===e){const d={activeTriggerElement:a,...c?r:null};n.update(d);return}if(u==null&&c){const d={activeTriggerId:e??null,activeTriggerElement:a,...r};n.update(d)}}),l=me(a=>{o(a),a&&i(a)});return fe(()=>(l(t.current),()=>l(null)),[l,t,n,e]),fe(()=>{if(s){const a={activeTriggerElement:t.current,...r};n.update(a)}},[s,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:s}}function Bg(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=S.useRef(null),s=e.useState("open"),o=e.useState("triggerCount"),i=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");fe(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const a=e.context.triggerElements.size,c={};e.state.triggerCount!==a&&(c.triggerCount=a);const u=e.select("activeTriggerId");let d=null;if(u){const f=e.context.triggerElements.getById(u);if(f)r.current=u,f!==e.state.activeTriggerElement&&(c.activeTriggerElement=f);else{for(const[p,y]of e.context.triggerElements.entries())if(y===e.state.activeTriggerElement){c.activeTriggerId=p,c.activeTriggerElement=y,r.current=p;break}c.activeTriggerId===void 0&&(r.current===u?d=u:r.current=null)}}else r.current=null;if(!d&&!u&&a===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[p,y]=f.value;c.activeTriggerId=p,c.activeTriggerElement=y,r.current=p}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),d&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===d&&!e.context.triggerElements.getById(d)){const f=Me(Ed);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,l,n])}function Vg(e,t,n,r){const{mounted:s,setMounted:o,transitionStatus:i}=$E(e,!1,!1,r),l=t.useState("preventUnmountingOnClose"),a=e?!1:l;t.useSyncedValues({mounted:s,transitionStatus:i,preventUnmountingOnClose:a});const c=me(()=>{var u,d;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(d=(u=t.context).onOpenChangeComplete)==null||d.call(u,!1)});return Ra({enabled:s&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:i}}function Wg(e,t){e.useSyncedValues(t),fe(()=>()=>{e.update({activeTriggerProps:Et,inactiveTriggerProps:Et,popupProps:Et})},[e])}function VE(e,t){fe(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),fe(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Ug{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function qg(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new DE({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,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Et,inactiveTriggerProps:Et,popupProps:Et}}const Tl=e=>e.triggerIdProp??e.activeTriggerId,Kg=e=>e.openProp??e.open,zy=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function WE(e,t){return t!==void 0&&Kg(e)&&Tl(e)===t}function fM(e,t){return WE(e,t)?!0:t!==void 0&&Kg(e)&&Tl(e)==null&&e.triggerCount===1}const Yg={open:Kg,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Tl,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:zy,isTriggerActive:(e,t)=>t!==void 0&&Tl(e)===t,isOpenedByTrigger:(e,t)=>WE(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Tl(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>fM(e,t)?zy(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function UE(e){const t=S.useCallback(r=>e===void 0?mg:e.subscribeStore(r),[e]),n=S.useCallback(()=>e===void 0?void 0:e.store,[e]);return Pd.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function hM(e){return pM(e,e.rootContext)}function pM(e,t){const{nodeId:n,externalTree:r}=e,s=t.useState("referenceElement"),o=t.useState("floatingElement"),i=t.useState("domReferenceElement"),l=t.useState("open"),a=t.useState("floatingId"),[c,u]=S.useState(null),[d,f]=S.useState(void 0),[p,y]=S.useState(void 0),v=S.useRef(null),b=Bi(r),g=S.useMemo(()=>({reference:s,floating:o,domReference:i}),[s,o,i]),m=j2({...e,elements:{...g,...c&&{reference:c}}}),x=Ce(d)?d:null,w=p===void 0?t.state.floatingElement:p;t.useSyncedValue("referenceElement",d??null),t.useSyncedValue("domReferenceElement",d===void 0?i:x),t.useSyncedValue("floatingElement",w);const E=S.useCallback(z=>{const $=Ce(z)?{getBoundingClientRect:()=>z.getBoundingClientRect(),getClientRects:()=>z.getClientRects(),contextElement:z}:z;u($),m.refs.setReference($)},[m.refs]),N=S.useCallback(z=>{(Ce(z)||z===null)&&(v.current=z,f(z)),(Ce(m.refs.reference.current)||m.refs.reference.current===null||z!==null&&!Ce(z))&&m.refs.setReference(z)},[m.refs,f]),k=S.useCallback(z=>{y(z),m.refs.setFloating(z)},[m.refs]),C=S.useMemo(()=>({...m.refs,setReference:N,setFloating:k,setPositionReference:E,domReference:v}),[m.refs,N,k,E]),P=S.useMemo(()=>({...m.elements,domReference:i}),[m.elements,i]),I=S.useMemo(()=>({...m,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:a,refs:C,elements:P,nodeId:n,rootStore:t}),[m,C,P,n,t,l,a]);return fe(()=>{i&&(v.current=i)},[i]),fe(()=>{t.context.dataRef.current.floatingContext=I;const z=b==null?void 0:b.nodesRef.current.find($=>$.id===n);z&&(z.context=I)}),S.useMemo(()=>({...m,context:I,refs:C,elements:P,rootStore:t}),[m,C,P,I,t])}const Vf=MS&&wo;function mM(e,t={}){const{enabled:n=!0,delay:r}=t,s="rootStore"in e?e.rootStore:e,{events:o,dataRef:i}=s.context,l=S.useRef(!1),a=S.useRef(null),c=S.useRef(!0),u=Mr();S.useEffect(()=>{const f=s.select("domReferenceElement");if(!n)return;const p=ot(f);function y(){const g=s.select("domReferenceElement");!s.select("open")&&Ve(g)&&g===vn(Fe(g))&&(l.current=!0,a.current=g)}function v(){c.current=!0}function b(){c.current=!1}return ir(Ee(p,"blur",y),Vf&&Ee(p,"keydown",v,!0),Vf&&Ee(p,"pointerdown",b,!0))},[s,n]),S.useEffect(()=>{if(!n)return;function f(p){if(p.reason===ks||p.reason===kd){const y=s.select("domReferenceElement");Ce(y)&&(a.current=y,l.current=!0)}}return o.on("openchange",f),()=>{o.off("openchange",f)}},[o,n,s]);const d=S.useMemo(()=>{function f(){l.current=!1,a.current=null}return{onMouseLeave(){f()},onFocus(p){const y=p.currentTarget;if(l.current){if(a.current===y)return;f()}const v=Mt(p.nativeEvent);if(Ce(v)){if(Vf&&!p.relatedTarget){if(!c.current&&!Sd(v))return}else if(!$_(v))return}const b=Nu(p.relatedTarget,s.context.triggerElements),{nativeEvent:g,currentTarget:m}=p,x=typeof r=="function"?r():r;if(s.select("open")&&b||x===0||x===void 0){s.setOpen(!0,Me(Lc,g,m));return}u.start(x,()=>{l.current||s.setOpen(!0,Me(Lc,g,m))})},onBlur(p){f();const y=p.relatedTarget,v=p.nativeEvent,b=Ce(y)&&y.hasAttribute(Zl("focus-guard"))&&y.getAttribute("data-type")==="outside";u.start(0,()=>{var w;const g=s.select("domReferenceElement"),m=vn(Fe(g));!y&&m===g||xe((w=i.current.floatingContext)==null?void 0:w.refs.floating.current,m)||xe(g,m)||b||Nu(y??m,s.context.triggerElements)||s.setOpen(!1,Me(Lc,v))})}}},[i,r,s,u]);return S.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}class Gg{constructor(){ge(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});ge(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new In,this.restTimeout=new In,this.handleCloseOptions=void 0}static create(){return new Gg}}const Ou=new WeakMap;function Mu(e){var n,r,s;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Ou.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty("pointer-events"),(s=e.pointerEventsFloatingElement)==null||s.style.removeProperty("pointer-events"),Ou.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function qE(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,o=Ou.get(n);o&&o!==e&&Mu(o),Mu(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,Ou.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function Qg(e){const t=e.context.dataRef.current,n=Pn(()=>t.hoverInteractionState??Gg.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),gg(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function KE(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:s}=t,o="rootStore"in e?e.rootStore:e,i=o.useState("open"),l=o.useState("floatingElement"),a=o.useState("domReferenceElement"),{dataRef:c}=o.context,u=Bi(),d=Rd(),f=Qg(o),p=Mr(),y=me(()=>{var g;return VS((g=c.current.openEvent)==null?void 0:g.type,f.interactedInside)}),v=me(()=>{var g;return L_((g=c.current.openEvent)==null?void 0:g.type)}),b=me(()=>{Mu(f)});fe(()=>{i||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,b())},[i,f,b]),S.useEffect(()=>b,[b]),fe(()=>{var g,m,x,w,E;if(n&&i&&(g=f.handleCloseOptions)!=null&&g.blockPointerEvents&&v()&&Ce(a)&&l){const N=a,k=l,C=Fe(l),P=(x=(m=u==null?void 0:u.nodesRef.current.find(A=>A.id===d))==null?void 0:m.context)==null?void 0:x.elements.floating;P&&(P.style.pointerEvents="");const I=f.pointerEventsScopeElement!==k?f.pointerEventsScopeElement:null,z=P!==k?P:null,$=((E=(w=f.handleCloseOptions)==null?void 0:w.getScope)==null?void 0:E.call(w))??I??z??N.closest("[data-rootownerid]")??C.body;return qE(f,{scopeElement:$,referenceElement:N,floatingElement:k}),()=>{b()}}},[n,i,a,l,f,v,u,d,b]),S.useEffect(()=>{if(!n)return;function g(){return!!(u&&d&&Ns(u.nodesRef.current,d).length>0)}function m(C){const P=co(r,"close",f.pointerType),I=()=>{o.setOpen(!1,Me(St,C)),u==null||u.events.emit("floating.closed",C)};P?f.openChangeTimeout.start(P,I):(f.openChangeTimeout.clear(),I())}function x(C){const P=Mt(C);if(!D_(P)){f.interactedInside=!1;return}f.interactedInside=(P==null?void 0:P.closest("[aria-haspopup]"))!=null}function w(){f.openChangeTimeout.clear(),p.clear(),u==null||u.events.off("floating.closed",N),b()}function E(C){var $;if(g()&&u){u.events.on("floating.closed",N);return}if(Nu(C.relatedTarget,o.context.triggerElements))return;const P=(($=c.current.floatingContext)==null?void 0:$.nodeId)??s,I=C.relatedTarget;if(!(u&&P&&Ce(I)&&Ns(u.nodesRef.current,P,!1).some(A=>{var R;return xe((R=A.context)==null?void 0:R.elements.floating,I)}))){if(f.handler){f.handler(C);return}b(),v()&&!y()&&m(C)}}function N(C){!u||!d||g()||p.start(0,()=>{u.events.off("floating.closed",N),o.setOpen(!1,Me(St,C)),u.events.emit("floating.closed",C)})}const k=l;return ir(k&&Ee(k,"mouseenter",w),k&&Ee(k,"mouseleave",E),k&&Ee(k,"pointerdown",x,!0),()=>{u==null||u.events.off("floating.closed",N)})},[n,l,o,c,r,s,v,y,b,f,u,d,p])}const gM={current:null};function YE(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:o=!1,restMs:i=0,move:l=!0,triggerElementRef:a=gM,externalTree:c,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:y=!1}=t,v="rootStore"in e?e.rootStore:e,{dataRef:b,events:g}=v.context,m=Bi(c),x=Qg(v),w=S.useRef(!1),E=Ht(s),N=Ht(r),k=Ht(i),C=Ht(n),P=Ht(p),I=Ht(f),z=me(()=>{var _;return VS((_=b.current.openEvent)==null?void 0:_.type,x.interactedInside)}),$=me(()=>{var _;return((_=P.current)==null?void 0:_.call(P))!==!1}),A=me((_,F,T)=>{const M=v.context.triggerElements;if(M.hasElement(F))return!_||!xe(_,F);if(!Ce(T))return!1;const O=T;return M.hasMatchingElement(U=>xe(U,O))&&(!_||!xe(_,O))}),R=me(()=>{if(!x.handler)return;Fe(v.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),j=me(()=>{Mu(x)});return u&&(x.handleCloseOptions=s==null?void 0:s.__options),S.useEffect(()=>R,[R]),S.useEffect(()=>{if(!n)return;function _(F){F.open?w.current=!1:(w.current=F.reason===St,R(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return g.on("openchange",_),()=>{g.off("openchange",_)}},[n,g,x,R]),S.useEffect(()=>{if(!n)return;function _(L,K=!0){const W=co(N.current,"close",x.pointerType);W?x.openChangeTimeout.start(W,()=>{v.setOpen(!1,Me(St,L)),m==null||m.events.emit("floating.closed",L)}):K&&(x.openChangeTimeout.clear(),v.setOpen(!1,Me(St,L)),m==null||m.events.emit("floating.closed",L))}const F=a.current??(u?v.select("domReferenceElement"):null);if(!Ce(F))return;function T(L){var ce;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,o&&!ys(x.pointerType))return;const K=uy(k.current),W=co(N.current,"open",x.pointerType),q=Mt(L),H=L.currentTarget??null,G=v.select("domReferenceElement");let B=H;if(Ce(q)&&!v.context.triggerElements.hasElement(q)){for(const ve of v.context.triggerElements.elements())if(xe(ve,q)){B=ve;break}}Ce(H)&&Ce(G)&&!v.context.triggerElements.hasElement(H)&&xe(H,G)&&(B=G);const Y=B==null?!1:A(G,B,q),Q=v.select("open"),Z=((ce=I.current)==null?void 0:ce.call(I))??v.select("transitionStatus")==="ending",V=!Q&&Z&&w.current,X=!Y&&Ce(B)&&Ce(G)&&xe(G,B)&&V,ee=K>0&&!W,he=Y&&(Q||V)||X,Pe=!Q||Y;if(he){$()&&v.setOpen(!0,Me(St,L,B));return}ee||(W?x.openChangeTimeout.start(W,()=>{Pe&&$()&&v.setOpen(!0,Me(St,L,B))}):Pe&&$()&&v.setOpen(!0,Me(St,L,B)))}function M(L){if(z()){j();return}R();const K=v.select("domReferenceElement"),W=Fe(K);x.restTimeout.clear(),x.restTimeoutPending=!1;const q=b.current.floatingContext??(d==null?void 0:d());if(Nu(L.relatedTarget,v.context.triggerElements))return;if(E.current&&q){v.select("open")||x.openChangeTimeout.clear();const G=a.current;x.handler=E.current({...q,tree:m,x:L.clientX,y:L.clientY,onClose(){j(),R(),C.current&&!z()&&G===v.select("domReferenceElement")&&_(L,!0)}}),W.addEventListener("mousemove",x.handler),x.handler(L);return}(x.pointerType==="touch"?!xe(v.select("floatingElement"),L.relatedTarget):!0)&&_(L)}function O(L){xe(F,L.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const U=y?Ee(F,"mouseout",O):void 0;return l?ir(Ee(F,"mousemove",T,{once:!0}),Ee(F,"mouseenter",T),Ee(F,"mouseleave",M),U):ir(Ee(F,"mouseenter",T),Ee(F,"mouseleave",M),U)},[R,j,b,N,v,n,E,x,u,A,z,o,l,k,a,m,C,d,I,$,y]),S.useMemo(()=>{if(!n)return;function _(F){x.pointerType=F.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(F){var q,H,G;const{nativeEvent:T}=F,M=F.currentTarget,O=v.select("domReferenceElement"),U=v.select("open"),L=A(O,M,F.target);if(o&&!ys(x.pointerType))return;if(U&&L&&((q=x.handleCloseOptions)!=null&&q.blockPointerEvents)){const B=v.select("floatingElement");if(B){const Y=((G=(H=x.handleCloseOptions)==null?void 0:H.getScope)==null?void 0:G.call(H))??M.ownerDocument.body;qE(x,{scopeElement:Y,referenceElement:M,floatingElement:B})}}const K=uy(k.current);if(U&&!L||K===0||!L&&x.restTimeoutPending&&F.movementX**2+F.movementY**2<2)return;x.restTimeout.clear();function W(){if(x.restTimeoutPending=!1,z())return;const B=v.select("open");!x.blockMouseMove&&(!B||L)&&$()&&v.setOpen(!0,Me(St,T,M))}x.pointerType==="touch"?dn.flushSync(()=>{W()}):L&&U?W():(x.restTimeoutPending=!0,x.restTimeout.start(K,W))}}},[n,x,z,A,o,v,k,$])}const Dy=.1,xM=Dy*Dy,He=.5;function hc(e,t,n,r,s,o){return r>=t!=o>=t&&e<=(s-n)*(t-r)/(o-r)+n}function pc(e,t,n,r,s,o,i,l,a,c){let u=!1;return hc(e,t,n,r,s,o)&&(u=!u),hc(e,t,s,o,i,l)&&(u=!u),hc(e,t,i,l,a,c)&&(u=!u),hc(e,t,a,c,n,r)&&(u=!u),u}function yM(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function mc(e,t,n,r,s,o){const i=Math.min(n,s),l=Math.max(n,s),a=Math.min(r,o),c=Math.max(r,o);return e>=i&&e<=l&&t>=a&&t<=c}function GE(e={}){const{blockPointerEvents:t=!1}=e,n=new In,r=({x:s,y:o,placement:i,elements:l,onClose:a,nodeId:c,tree:u})=>{const d=i==null?void 0:i.split("-")[0];let f=!1,p=null,y=null,v=typeof performance<"u"?performance.now():0;function b(m,x){const w=performance.now(),E=w-v;if(p===null||y===null||E===0)return p=m,y=x,v=w,!1;const N=m-p,k=x-y,C=N*N+k*k,P=E*E*xM;return p=m,y=x,v=w,C<P}function g(){n.clear(),a()}return function(x){n.clear();const w=l.domReference,E=l.floating;if(!w||!E||d==null||s==null||o==null)return;const{clientX:N,clientY:k}=x,C=Mt(x),P=x.type==="mouseleave",I=xe(E,C),z=xe(w,C);if(I&&(f=!0,!P))return;if(z&&(f=!1,!P)){f=!0;return}if(P&&Ce(x.relatedTarget)&&xe(E,x.relatedTarget))return;function $(){return!!(u&&Ns(u.nodesRef.current,c).length>0)}function A(){$()||g()}if($())return;const R=w.getBoundingClientRect(),j=E.getBoundingClientRect(),_=s>j.right-j.width/2,F=o>j.bottom-j.height/2,T=j.width>R.width,M=j.height>R.height,O=(T?R:j).left,U=(T?R:j).right,L=(M?R:j).top,K=(M?R:j).bottom;if(d==="top"&&o>=R.bottom-1||d==="bottom"&&o<=R.top+1||d==="left"&&s>=R.right-1||d==="right"&&s<=R.left+1){A();return}let W=!1;switch(d){case"top":W=mc(N,k,O,R.top+1,U,j.bottom-1);break;case"bottom":W=mc(N,k,O,j.top+1,U,R.bottom-1);break;case"left":W=mc(N,k,j.right-1,K,R.left+1,L);break;case"right":W=mc(N,k,R.right-1,K,j.left+1,L);break}if(W)return;if(f&&!yM(N,k,R)){A();return}if(!P&&b(N,k)){A();return}let q=!1;switch(d){case"top":{const H=T?He/2:He*4,G=T||_?s+H:s-H,B=T?s-H:_?s+H:s-H,Y=o+He+1,Q=_||T?j.bottom-He:j.top,Z=_?T?j.bottom-He:j.top:j.bottom-He;q=pc(N,k,G,Y,B,Y,j.left,Q,j.right,Z);break}case"bottom":{const H=T?He/2:He*4,G=T||_?s+H:s-H,B=T?s-H:_?s+H:s-H,Y=o-He,Q=_||T?j.top+He:j.bottom,Z=_?T?j.top+He:j.bottom:j.top+He;q=pc(N,k,G,Y,B,Y,j.left,Q,j.right,Z);break}case"left":{const H=M?He/2:He*4,G=M||F?o+H:o-H,B=M?o-H:F?o+H:o-H,Y=s+He+1,Q=F||M?j.right-He:j.left,Z=F?M?j.right-He:j.left:j.right-He;q=pc(N,k,Q,j.top,Z,j.bottom,Y,G,Y,B);break}case"right":{const H=M?He/2:He*4,G=M||F?o+H:o-H,B=M?o-H:F?o+H:o-H,Y=s-He,Q=F||M?j.left+He:j.right,Z=F?M?j.left+He:j.right:j.left+He;q=pc(N,k,Y,G,Y,B,Q,j.top,Z,j.bottom);break}}q?f||n.start(40,A):A()}};return r.__options={...e,blockPointerEvents:t},r}const QE=S.createContext(void 0);function Ta(e){const t=S.useContext(QE);if(t===void 0&&!e)throw new Error(tn(47));return t}const vM={...Yg,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class wM extends jd{constructor(n,r,s){const o=new Ug;super(bM(n,o,r,s),SM(o),vM);ge(this,"setOpen",(n,r)=>{var d,f;const s=r.reason===St,o=r.reason===ks&&r.event.detail===0,i=!n&&(r.reason===kd||r.reason==null),l=HE(r),a=this.select("activeTriggerId");if(!n&&r.reason===US&&r.trigger==null&&a!=null&&(r.trigger=this.context.triggerElements.getById(a)??this.select("activeTriggerElement")??void 0),(f=(d=this.context).onOpenChange)==null||f.call(d,n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const c=()=>{const p=Hg(this.state,n,r.trigger,l());p.openChangeReason=r.reason,this.update(p)};s?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(DO,()=>{this.set("stickIfOpen",!1)}),dn.flushSync(c)):c();let u;o?u="click":i?u="dismiss":r.reason===Xl&&(u="focus"),this.set("instantType",u)})}}function bM(e,t,n,r=!1){const s={...qg(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return s.open&&(e==null?void 0:e.mounted)===void 0&&(s.mounted=!0),s}function SM(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),stickIfOpenTimeout:new In,triggerElements:e}}const $y=gd(function({props:t}){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:i,modal:l=!1,handle:a,triggerId:c,defaultTriggerId:u=null}=t,d=kM(a,{modal:l,open:s,openProp:r,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",r),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),p=d.useState("mounted"),y=d.useState("payload");d.useContextCallback("onOpenChange",o),d.useContextCallback("onOpenChangeComplete",i),VE(d,f),Bg(d);const{forceUnmount:v}=Vg(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:l}),S.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),S.useImperativeHandle(t.actionsRef,()=>({unmount:v,close:()=>d.setOpen(!1,Me(Eg))}),[v,d]);const b=f||p;return h.jsxs(QE.Provider,{value:d,children:[a&&h.jsx(Lg,{handle:a,store:d}),b&&h.jsx(CM,{store:d,modal:l}),typeof n=="function"?n({payload:y}):n]})});function EM(e){return Ta(!0)?h.jsx($y,{props:e}):h.jsx(WO,{children:h.jsx($y,{props:e})})}function kM(e,t){const n=Fg((r,s)=>new wM(t,r,s));return S.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function CM({store:e,modal:t}){const n=e.useState("floatingRootContext"),r=zg(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=r.reference,o=r.floating;return Wg(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:o}),null}const XE=S.createContext(void 0);function Xg(e=!1){const t=S.useContext(XE);if(t===void 0&&!e)throw new Error(tn(16));return t}function NM(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,i=r&&t!==!1,l=r&&t===!1;return{props:S.useMemo(()=>{const c={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return r||(c.tabIndex=s,!o&&n&&(c.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(c["aria-disabled"]=n),o&&(!t||l)&&(c.disabled=n),c},[r,n,t,i,l,o,s])}}function Wf(e,t,{detail:n=0}={}){e.dispatchEvent(new(ot(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Zg(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=S.useRef(null),l=Xg(!0),a=o??l!==void 0,{props:c}=NM({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:r,isNativeButton:s}),u=S.useCallback(()=>{const p=i.current;Uf(p)&&a&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,a]);fe(u,[u]);const d=S.useCallback((p={})=>{const{onClick:y,onMouseDown:v,onKeyUp:b,onKeyDown:g,onPointerDown:m,...x}=p;return Nd({onClick(w){if(t){w.preventDefault();return}y==null||y(w)},onMouseDown(w){t||v==null||v(w)},onKeyDown(w){if(t||(ju(w),g==null||g(w),w.baseUIHandlerPrevented))return;const E=w.target===w.currentTarget,N=w.currentTarget,k=Uf(N),C=!s&&RM(N),P=E&&(s?k:!C),I=w.key==="Enter",z=w.key===" ",$=N.getAttribute("role"),A=($==null?void 0:$.startsWith("menuitem"))||$==="option"||$==="gridcell";if(E&&a&&z){if(w.defaultPrevented&&A)return;w.preventDefault(),(!s||k)&&(w.preventBaseUIHandler(),Wf(N,w));return}if(!P||s||!z&&!I){E&&C&&z&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),I&&(w.preventBaseUIHandler(),Wf(N,w)))},onKeyUp(w){if(!t){if(ju(w),b==null||b(w),w.target===w.currentTarget&&s&&a&&Uf(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!s&&!a&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),Wf(w.currentTarget,w))}},onPointerDown(w){if(t){w.preventDefault();return}m==null||m(w)}},s?{type:"button"}:{role:"button"},c,x)},[t,c,a,s]),f=me(p=>{i.current=p,u()});return{getButtonProps:d,buttonRef:f}}function Uf(e){return Ve(e)&&e.tagName==="BUTTON"}function RM(e){return Ve(e)&&e.tagName==="A"&&!!e.href}const TM=300;function Vi(e){return Cd(e,"base-ui")}function PM(e,t){const n=S.useRef(null);function r(o){dn.flushSync(()=>{e.setOpen(!1,Me(Xl,o.nativeEvent,o.currentTarget))});const i=xO(n.current);i==null||i.focus()}function s(o){var l;const i=e.select("positionerElement");if(i&&Zo(o,i))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{dn.flushSync(()=>{e.setOpen(!1,Me(Xl,o.nativeEvent,o.currentTarget))});let a=gO(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&xe(i,a);){const c=a;if(a=jg(a),a===c)break}a==null||a.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}function IM(e){const t=S.useRef(""),n=S.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:S.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function jM(e,t){const n=me((o,i)=>{(typeof e=="function"?e():e)||t(i||(yd?"touch":""))}),{onClick:r,onPointerDown:s}=IM(n);return S.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}const _M=OS(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,handle:a,payload:c,openOnHover:u=!1,delay:d=TM,closeDelay:f=0,id:p,...y}=t,v=Ta(!0),g=UE(a)??v;if(!g)throw new Error(tn(74));const m=Vi(p),x=g.useState("isTriggerActive",m),w=g.useState("floatingRootContext"),E=g.useState("isOpenedByTrigger",m),N=g.useState("triggerPopupId",m),k=S.useRef(null),{registerTrigger:C,isMountedByThisTrigger:P}=BE(m,k,g,{payload:c,disabled:i,openOnHover:u,closeDelay:f}),I=g.useState("openChangeReason"),z=g.useState("stickIfOpen"),$=g.useState("openMethod"),A=g.useState("focusManagerModal"),R=YE(w,{enabled:!i&&u&&($!=="touch"||I!==ks),mouseOnly:!0,move:!1,handleClose:GE(),restMs:d,delay:{close:f},triggerElementRef:k,isActiveTrigger:x,isClosing:()=>g.select("transitionStatus")==="ending"}),j=KO(w,{stickIfOpen:z}),_=jM(()=>g.select("open"),G=>{g.set("openMethod",G)}),F=g.useState("triggerProps",P),{getButtonProps:T,buttonRef:M}=Zg({disabled:i,native:l}),O={open(G){return G&&I===ks?A_.open(G):BS.open(G)}},{preFocusGuardRef:U,handlePreFocusGuardFocus:L,handleFocusTargetFocus:K}=PM(g,k),q=Ut("button",t,{state:{disabled:i,open:E},ref:[M,n,C,k],props:[j.reference,R,F,_,{[pE]:"",id:m,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":N},y,T],stateAttributesMapping:O}),H=h.jsx(S.Fragment,{children:q},m);return P&&!A?h.jsxs(S.Fragment,{children:[h.jsx(Ri,{ref:U,onFocus:L}),H,h.jsx(Ri,{ref:g.context.triggerFocusTargetRef,onFocus:K})]}):H}),ZE=S.createContext(void 0);function OM(){const e=S.useContext(ZE);if(e===void 0)throw new Error(tn(45));return e}const MM=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Ta().useState("mounted")||r?h.jsx(ZE.Provider,{value:r,children:h.jsx(vE,{ref:n,...s})}):null});function Jg(e){return _g(19)?e:e?"true":void 0}const JE=S.createContext(void 0);function AM(){const e=S.useContext(JE);if(!e)throw new Error(tn(46));return e}const zM=S.createContext(void 0);function ek(){const e=S.useContext(zM);return(e==null?void 0:e.direction)??"ltr"}const DM=e=>({name:"arrow",options:e,async fn(t){var M,O;const{x:n,y:r,placement:s,rects:o,platform:i,elements:l,middlewareData:a}=t,{element:c,padding:u=0,offsetParent:d="real"}=Cs(e,t)||{};if(c==null)return{};const f=XS(u),p={x:n,y:r},y=Tg(s),v=Rg(y),b=await i.getDimensions(c),g=y==="y",m=g?"top":"left",x=g?"bottom":"right",w=g?"clientHeight":"clientWidth",E=o.reference[v]+o.reference[y]-p[y]-o.floating[v],N=p[y]-o.reference[y],k=d==="real"?await((M=i.getOffsetParent)==null?void 0:M.call(i,c)):l.floating;let C=l.floating[w]||o.floating[v];(!C||!await((O=i.isElement)==null?void 0:O.call(i,k)))&&(C=l.floating[w]||o.floating[v]);const P=E/2-N/2,I=C/2-b[v]/2-1,z=Math.min(f[m],I),$=Math.min(f[x],I),A=z,R=C-b[v]-$,j=C/2-b[v]/2+P,_=QS(A,j,R),F=!a.arrow&&Ar(s)!=null&&j!==_&&o.reference[v]/2-(j<A?z:$)-b[v]/2<0,T=F?j<A?j-A:j-R:0;return{[y]:p[y]+T,data:{[y]:_,centerOffset:j-_-T,...F&&{alignmentOffset:T}},reset:F}}}),$M=(e,t)=>{const{name:n,fn:r}=DM(e);return{name:n,fn:r,options:[e,t]}},FM={name:"hide",async fn(e){const{width:t,height:n,x:r,y:s}=e.rects.reference,o=t===0&&n===0&&r===0&&s===0,i=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:i.top-n>=0||i.right-t>=0||i.bottom-n>=0||i.left-t>=0||o}}}},LM={sideX:"left",sideY:"top"},HM="--available-width",BM="--available-height",VM="--anchor-width",WM="--anchor-height",UM="--transform-origin",Fy=HM,Ly=BM;function tk(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function Hy(e,t,n){const{rects:r,placement:s}=e;return{side:tk(t,Nn(s),n),align:Ar(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function nk(e){return qM(e,hM)}function qM(e,t){var Co,Ma;const{anchor:n,positionMethod:r="absolute",side:s="bottom",sideOffset:o=0,align:i="center",alignOffset:l=0,collisionBoundary:a,collisionPadding:c=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:y=!1,floatingRootContext:v,mounted:b,collisionAvoidance:g,shift:m,nodeId:x,adaptiveOrigin:w,lazyFlip:E=!1,externalTree:N}=e,[k,C]=S.useState(null);!b&&k!==null&&C(null);const P=g.side||"flip",I=g.align||"flip",z=g.fallbackAxisSide||"end",$=(m==null?void 0:m.crossAxis)??!1,A=m==null?void 0:m.rootBoundary,R=typeof n=="function"?n:void 0,j=me(R),_=R?j:n,F=Ht(n),T=Ht(b),O=ek()==="rtl",U=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":O?"left":"right","inline-start":O?"right":"left"}[s],L=i==="center"?U:`${U}-${i}`;let K=c;typeof K=="number"?K={top:K,right:K,bottom:K,left:K}:K&&(K={top:K.top||0,right:K.right||0,bottom:K.bottom||0,left:K.left||0});const W=1,q=s==="bottom"?W:0,H=s==="top"?W:0,G=s==="right"?W:0,B=s==="left"?W:0,Y={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:K},Q=S.useRef(null),Z=Ht(o),V=Ht(l),X=typeof o!="function"?o:0,ee=typeof l!="function"?l:0,he=[];p&&he.push(p),he.push(_2(ke=>{const yt=Hy(ke,s,O),Kt=typeof Z.current=="function"?Z.current(yt):Z.current,Rt=typeof V.current=="function"?V.current(yt):V.current;return{mainAxis:Kt,crossAxis:Rt,alignmentAxis:Rt}},[X,ee,O,s]));const Pe=I==="none"&&P!=="shift",ce=!Pe&&(u||$||P==="shift"),ve=P==="none"?null:A2({...Y,padding:{top:K.top+W+q,right:K.right+W+B,bottom:K.bottom+W+H,left:K.left+W+G},mainAxis:!$&&P==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:z}),ue=Pe?null:O2({...Y,rootBoundary:A,mainAxis:I!=="none",crossAxis:ce,limiter:u||$?void 0:M2(ke=>{if(!Q.current)return{};const{width:yt,height:Kt}=Q.current.getBoundingClientRect(),Rt=kn(Nn(ke.placement)),xn=Rt==="y"?yt:Kt,rn=Rt==="y"?K.left+K.right:K.top+K.bottom;return{offset:xn/2+rn/2}})},[Y,u,$,A,K,I]);P==="shift"||I==="shift"||i==="center"?he.push(ue,ve):he.push(ve,ue),he.push(z2({...Y,apply({elements:{floating:ke},availableWidth:yt,availableHeight:Kt,rects:Rt}){if(!T.current)return;const xn=ke.style;xn.setProperty(Fy,`${yt}px`),xn.setProperty(Ly,`${Kt}px`);const rn=ot(ke).devicePixelRatio||1,{x:No,y:Hr,width:Ro,height:Yn}=Rt.reference,jn=(Math.round((No+Ro)*rn)-Math.round(No*rn))/rn,js=(Math.round((Hr+Yn)*rn)-Math.round(Hr*rn))/rn;xn.setProperty(VM,`${jn}px`),xn.setProperty(WM,`${js}px`)}}),$M(ke=>({element:Q.current||Fe(ke.elements.floating).createElement("div"),padding:Q.current?d:0,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(ke){var Aa,za,Ui,qi,Da,$a;const{elements:{floating:yt},middlewareData:Kt,placement:Rt,platform:xn,rects:rn,y:No}=ke,Hr=Nn(Rt),Ro=Ar(Rt),Yn=kn(Hr)==="y",jn=Q.current,js=typeof o=="function"?o(Hy(ke,s,O)):o;let To;if(!jn&&Ro&&Math.abs(Yn?((Aa=Kt.shift)==null?void 0:Aa.x)||0:((za=Kt.shift)==null?void 0:za.y)||0)<=1)To=Ro==="start"===(Yn&&((Ui=xn.isRTL)==null?void 0:Ui.call(xn,yt))===!0)?"100%":"0%";else{const Qd=Yn?((qi=Kt.arrow)==null?void 0:qi.x)||0:((Da=Kt.arrow)==null?void 0:Da.y)||0,Xd=Yn?(jn==null?void 0:jn.clientWidth)||0:(jn==null?void 0:jn.clientHeight)||0;To=`${Qd+Xd/2}px`}let Wi=Hr==="top"||Hr==="left"?`calc(100% + ${js}px)`:`${-js}px`;return ce&&Yn&&Math.abs((($a=Kt.shift)==null?void 0:$a.y)||0)>js&&(Wi=`${rn.reference.y+rn.reference.height/2-No}px`),yt.style.setProperty(UM,Yn?`${To} ${Wi}`:`${Wi} ${To}`),{}}},FM,w),fe(()=>{!b&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[b,v]);const Re=S.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:ye,elements:ze,x:Ie,y:et,middlewareData:lt,update:re,placement:se,context:De,isPositioned:we,floatingStyles:at}=t({rootContext:v,open:y?b:void 0,placement:L,middleware:he,strategy:r,whileElementsMounted:y?void 0:(...ke)=>Oy(...ke,Re),nodeId:x,externalTree:N}),{sideX:nn,sideY:qt}=lt.adaptiveOrigin||LM,ne=we?r:"fixed",Be=S.useMemo(()=>{let ke;return we?w?ke={position:ne,[nn]:Ie,[qt]:et}:ke={...at,position:ne}:ke={position:ne,top:0,left:0},ke[Fy]="100vw",ke[Ly]="100vh",we||(ke.opacity=0),ke},[w,ne,nn,Ie,qt,et,at,we]),je=S.useRef(null);fe(()=>{if(!b)return;const ke=F.current,yt=typeof ke=="function"?ke():ke,Rt=(By(yt)?yt.current:yt)||null||null;Rt!==je.current&&(ye.setPositionReference(Rt),je.current=Rt)},[b,ye,_,F]),S.useEffect(()=>{if(!b)return;const ke=F.current;typeof ke!="function"&&By(ke)&&ke.current!==je.current&&(ye.setPositionReference(ke.current),je.current=ke.current)},[b,ye,_,F]),S.useEffect(()=>{if(y&&b&&ze.reference&&ze.floating)return Oy(ze.reference,ze.floating,re,Re)},[y,b,ze,re,Re]);const zt=Nn(se),gn=tk(s,zt,O),qn=Ar(se)||"center",Kn=!!((Co=lt.hide)!=null&&Co.referenceHidden);fe(()=>{E&&b&&we&&zt!==U&&C(zt)},[E,b,we,zt,U]);const Eo=S.useMemo(()=>{var ke,yt;return{position:"absolute",top:(ke=lt.arrow)==null?void 0:ke.y,left:(yt=lt.arrow)==null?void 0:yt.x}},[lt.arrow]),ko=((Ma=lt.arrow)==null?void 0:Ma.centerOffset)!==0;return S.useMemo(()=>({positionerStyles:Be,arrowStyles:Eo,arrowRef:Q,arrowUncentered:ko,side:gn,align:qn,physicalSide:zt,anchorHidden:Kn,refs:ye,context:De,isPositioned:we,update:re}),[Be,Eo,Q,ko,gn,qn,zt,Kn,ye,De,we,re])}function By(e){return e!=null&&"current"in e}const rk=S.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function e0(e){return e==="starting"?$O:Et}function sk(e,t,{styles:n,transitionStatus:r,props:s,refs:o,hidden:i,inert:l=!1}){const a={...n};return l&&(a.pointerEvents="none"),Ut("div",e,{state:t,ref:o,props:[{role:"presentation",hidden:i,style:a},e0(r),s],stateAttributesMapping:bg})}let Vy={},Wy={},Uy="";function _d(e,t){return Ca(e)?e:t}function qy(e,t,n){return/hidden|clip/.test(e.getComputedStyle(_d(t,n)).overflowY)}function KM(e){if(typeof document>"u")return!1;const t=Fe(e);return ot(t).innerWidth-t.documentElement.clientWidth>0}function YM(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Fe(e),r=n.documentElement,s=n.body,o=_d(r,s),i=o.style.overflowY,l=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const a=o.offsetWidth;o.style.overflowY="hidden";const c=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=l,a===c}function GM(e){const t=Fe(e),n=t.documentElement,r=t.body,s=_d(n,r),o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function QM(e){var p;const t=Fe(e),n=t.documentElement,r=t.body,s=ot(n);let o=0,i=0,l=!1;const a=tr.create();if(wo&&(((p=s.visualViewport)==null?void 0:p.scale)??1)!==1)return()=>{};function c(){const y=s.getComputedStyle(n),v=s.getComputedStyle(r),m=(y.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Vy={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Uy=n.style.scrollBehavior,Wy={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,w=n.scrollWidth>n.clientWidth,E=y.overflowY==="scroll"||v.overflowY==="scroll",N=y.overflowX==="scroll"||v.overflowX==="scroll",k=Math.max(0,s.innerWidth-r.clientWidth),C=Math.max(0,s.innerHeight-r.clientHeight),P=parseFloat(v.marginTop)+parseFloat(v.marginBottom),I=parseFloat(v.marginLeft)+parseFloat(v.marginRight),z=_d(n,r);if(l=YM(e),l){n.style.scrollbarGutter=m,z.style.overflowY="hidden",z.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:m,overflowY:"hidden",overflowX:"hidden"}),(x||E)&&(n.style.overflowY="scroll"),(w||N)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:P||C?`calc(100dvh - ${P+C}px)`:"100dvh",width:I||k?`calc(100vw - ${I+k}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,Vy),Object.assign(r.style,Wy),l||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Uy)}function d(){u(),a.request(c)}c();const f=Ee(s,"resize",d);return()=>{a.cancel(),u(),typeof s.removeEventListener=="function"&&f()}}class XM{constructor(){ge(this,"lockCount",0);ge(this,"restore",null);ge(this,"timeoutLock",In.create());ge(this,"timeoutUnlock",In.create());ge(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});ge(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=Fe(t),r=n.documentElement,s=n.body,o=ot(r);if(qy(o,r,s)){const l=new o.MutationObserver(()=>{qy(o,r,s)||(l.disconnect(),this.restore=null,this.lock(t))}),a={attributes:!0};l.observe(r,a),l.observe(s,a),this.restore=()=>l.disconnect();return}const i=yd||!KM(t);this.restore=i?GM(t):QM(t)}}const ZM=new XM;function ok(e=!0,t=null){fe(()=>{if(e)return ZM.acquire(t)},[e,t])}const JM=20;function eA(e,t,n,r){const[s,o]=S.useState(!1);fe(()=>{if(!e||!t||n==null){o(!1);return}const i=Fe(n).documentElement.clientWidth,l=n.offsetWidth;o(i>0&&l>0&&l>=i-JM)},[e,t,n]),ok(e&&(!t||s),r)}const tA=S.forwardRef(function(t,n){const{render:r,className:s,style:o,anchor:i,positionMethod:l,side:a,align:c,sideOffset:u,alignOffset:d,collisionBoundary:f="clipping-ancestors",collisionPadding:p,arrowPadding:y,sticky:v,disableAnchorTracking:b=!1,collisionAvoidance:g=mE,...m}=t,x=Ta(),w=OM(),E=BO(),N=x.useState("floatingRootContext"),k=x.useState("mounted"),C=x.useState("open"),P=x.useState("openChangeReason"),I=x.useState("activeTriggerElement"),z=x.useState("modal"),$=x.useState("openMethod"),A=x.useState("positionerElement"),R=x.useState("instantType"),j=x.useState("transitionStatus"),_=x.useState("adaptiveOrigin"),F=S.useRef(null),T=FE(A),M=nk({anchor:i,floatingRootContext:N,positionMethod:l,mounted:k,side:a,sideOffset:u,align:c,alignOffset:d,arrowPadding:y,collisionBoundary:f,collisionPadding:p,sticky:v,disableAnchorTracking:b,keepMounted:w,nodeId:E,collisionAvoidance:g,adaptiveOrigin:_}),O=N.useState("domReferenceElement");fe(()=>{const q=O,H=F.current;if(q&&(F.current=q),H&&q&&q!==H){x.set("instantType",void 0);const G=new AbortController;return T(()=>{x.set("instantType","trigger-change")},G.signal),()=>{G.abort()}}},[O,T,x]);const U=z===!0&&P!==St;eA(C&&U,$==="touch",A,I);const L=x.useStateSetter("positionerElement"),K={open:C,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:R},W=sk(t,K,{styles:M.positionerStyles,transitionStatus:j,props:m,refs:[n,L],hidden:!k,inert:!C});return h.jsxs(JE.Provider,{value:M,children:[k&&U&&h.jsx(rk,{inert:Jg(!C),cutout:I}),h.jsx(VO,{id:E,children:W})]})}),Ip="ArrowUp",jp="ArrowDown",_p="ArrowLeft",Op="ArrowRight",Mp="Home",Ap="End",t0=new Set([Ip,jp,_p,Op,Mp,Ap]),nA="Shift",rA=[nA,"Control","Alt","Meta"];function sA(e){return Ve(e)&&e.tagName==="INPUT"}function Ky(e){return!!(sA(e)&&e.selectionStart!=null||Ve(e)&&e.tagName==="TEXTAREA")}function Yy(e,t,n,r){if(!e||!t||!t.scrollTo)return;let s=e.scrollLeft,o=e.scrollTop;const i=e.clientWidth<e.scrollWidth,l=e.clientHeight<e.scrollHeight;if(i&&r!=="vertical"){const a=Gy(e,t,"left"),c=gc(e),u=gc(t);n==="ltr"&&(a+t.offsetWidth+u.scrollMarginRight>e.scrollLeft+e.clientWidth-c.scrollPaddingRight?s=a+t.offsetWidth+u.scrollMarginRight-e.clientWidth+c.scrollPaddingRight:a-u.scrollMarginLeft<e.scrollLeft+c.scrollPaddingLeft&&(s=a-u.scrollMarginLeft-c.scrollPaddingLeft)),n==="rtl"&&(a-u.scrollMarginLeft<e.scrollLeft+c.scrollPaddingLeft?s=a-u.scrollMarginLeft-c.scrollPaddingLeft:a+t.offsetWidth+u.scrollMarginRight>e.scrollLeft+e.clientWidth-c.scrollPaddingRight&&(s=a+t.offsetWidth+u.scrollMarginRight-e.clientWidth+c.scrollPaddingRight))}if(l&&r!=="horizontal"){const a=Gy(e,t,"top"),c=gc(e),u=gc(t);a-u.scrollMarginTop<e.scrollTop+c.scrollPaddingTop?o=a-u.scrollMarginTop-c.scrollPaddingTop:a+t.offsetHeight+u.scrollMarginBottom>e.scrollTop+e.clientHeight-c.scrollPaddingBottom&&(o=a+t.offsetHeight+u.scrollMarginBottom-e.clientHeight+c.scrollPaddingBottom)}e.scrollTo({left:s,top:o,behavior:"auto"})}function Gy(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let s=0;for(;t.offsetParent&&(s+=t[r],t.offsetParent!==e);)t=t.offsetParent;return s}function gc(e){const 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}}const oA=S.createContext(void 0);function iA(e){return S.useContext(oA)}const lA=S.createContext(void 0);function aA(){const[e,t]=S.useState(0),n=me(()=>(t(s=>s+1),()=>{t(s=>Math.max(0,s-1))}));return{context:S.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const cA=S.forwardRef(function(t,n){const{render:r,className:s,style:o,initialFocus:i,finalFocus:l,...a}=t,c=Ta(),u=AM(),d=iA()!=null,{context:f,hasClosePart:p}=aA(),y=c.useState("open"),v=c.useState("openMethod"),b=c.useState("instantType"),g=c.useState("transitionStatus"),m=c.useState("popupProps"),x=c.useState("titleElementId"),w=c.useState("descriptionElementId"),E=c.useState("modal"),N=c.useState("mounted"),k=c.useState("openChangeReason"),C=c.useState("activeTriggerElement"),P=c.useState("floatingRootContext"),I=P.useState("floatingId"),z=c.useState("disabled"),$=c.useState("openOnHover"),A=c.useState("closeDelay");Ra({open:y,ref:c.context.popupRef,onComplete(){var M,O;y&&((O=(M=c.context).onOpenChangeComplete)==null||O.call(M,!0))}}),KE(P,{enabled:$&&!z,closeDelay:A});const R=i===void 0?LE(c.context.popupRef):i,j=E!==!1&&p;c.useSyncedValue("focusManagerModal",j);const _=c.useStateSetter("popupElement"),F={open:y,side:u.side,align:u.align,instant:b,transitionStatus:g},T=Ut("div",t,{state:F,ref:[n,c.context.popupRef,_],props:[m,{id:I,role:"dialog",...$g,"aria-labelledby":x,"aria-describedby":w,onKeyDown(M){d&&t0.has(M.key)&&M.stopPropagation()}},e0(g),a],stateAttributesMapping:Sg});return h.jsx(EE,{context:P,openInteractionType:v,modal:j,disabled:!N||k===St,initialFocus:R,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Ve(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:h.jsx(lA.Provider,{value:f,children:T})})}),Ii=EM,ji=_M,fo=S.forwardRef(({className:e,side:t="bottom",align:n="end",sideOffset:r=4,...s},o)=>h.jsx(MM,{children:h.jsx(tA,{side:t,align:n,sideOffset:r,collisionPadding:8,className:"z-40",children:h.jsx(cA,{ref:o,className:st("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),...s})})}));fo.displayName="PopoverContent";const uA=48,dA=60,fA=24;function hA({glyph:e,label:t,placeholder:n,value:r,onChange:s,options:o,loading:i,failed:l,search:a,onSearchChange:c,hasMore:u,loadingMore:d,onLoadMore:f,allowCustom:p=!0,title:y}){const[v,b]=S.useState(!1),[g,m]=S.useState(""),x=c!==void 0,w=x?a??"":g,E=x?c:m,N=S.useMemo(()=>{const j=w.trim().toLowerCase(),_=j&&!x?o.filter(T=>T.value.toLowerCase().includes(j)):o;return[...r.filter(T=>!_.some(M=>M.value===T)).filter(T=>!j||T.toLowerCase().includes(j)).map(T=>({value:T,count:0})),..._]},[o,w,x,r]),k=S.useRef(null),C=()=>{const j=k.current;!j||!u||d||!f||j.scrollTop+j.clientHeight>=j.scrollHeight-uA&&f()},P=j=>{s(r.includes(j)?r.filter(_=>_!==j):[...r,j])},I=N.length>dA,z=ig({count:N.length,getScrollElement:()=>k.current,estimateSize:()=>fA,overscan:8,enabled:I}),$=j=>{const _=r.includes(j.value);return h.jsxs("button",{type:"button",role:"option","aria-selected":_,onClick:()=>P(j.value),className:st("mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs hover:bg-zinc-800",_?"text-zinc-100":"text-zinc-400"),children:[h.jsx("span",{className:"w-3 shrink-0",children:_&&h.jsx(cg,{width:12,height:12})}),h.jsx("span",{className:"truncate",children:j.value}),h.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-zinc-600",children:j.count})]},j.value)},A=w.trim(),R=p&&A!==""&&!N.some(j=>j.value===A)&&!r.includes(A);return h.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&&h.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:e}),h.jsxs(Ii,{open:v,onOpenChange:b,children:[h.jsx(ji,{render:h.jsx("button",{type:"button","aria-label":t,title:y??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?h.jsx("span",{className:"text-zinc-600",children:n}):r.map(j=>h.jsx(Xe,{className:"mono max-w-[10rem] truncate",children:j},j))}),h.jsxs(fo,{align:"start",className:"w-72 p-0",children:[h.jsx("div",{className:"border-b border-line px-2",children:h.jsx(pg,{autoFocus:!0,value:w,onChange:j=>E(j.target.value),placeholder:p?"search, or type a value…":"search…",onKeyDown:j=>{j.key!=="Enter"||!R||(j.preventDefault(),P(A),E(""))}})}),h.jsxs("div",{ref:k,onScroll:C,className:"max-h-64 overflow-auto py-1",role:"listbox",tabIndex:-1,"aria-multiselectable":!0,"aria-label":t,children:[R&&h.jsxs("button",{type:"button","aria-label":`use ${A} as typed`,onClick:()=>{P(A),E("")},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:[h.jsx("span",{className:"w-3 shrink-0 text-zinc-600",children:"+"}),h.jsx("span",{className:"truncate",children:A}),h.jsx("span",{className:"ml-auto text-[10px] text-zinc-600",children:"use as typed"})]}),d&&N.length>0&&h.jsx("p",{className:"px-2 py-1 text-[10px] text-zinc-600",children:"loading more…"}),N.length===0&&!R&&h.jsx("p",{className:st("px-2 py-2 text-[11px]",l?"text-rose-300":"text-zinc-600"),children:l?"couldn't load values — type one instead":i?"loading…":"no values here"}),I?h.jsx("div",{className:"relative w-full",style:{height:`${z.getTotalSize()}px`},children:z.getVirtualItems().map(j=>{var _;return h.jsx("div",{ref:z.measureElement,"data-index":j.index,className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${j.start}px)`},children:$(N[j.index])},((_=N[j.index])==null?void 0:_.value)??j.key)})}):N.map($)]})]})]}),r.length>0&&h.jsx(Se,{variant:"ghost",size:"icon",onClick:()=>s([]),title:`clear ${t}`,"aria-label":`clear ${t}`,className:"h-4 w-4",children:h.jsx(Ss,{width:12,height:12})})]})}const Qy=50,pA=200;function mA(e,t){const[n,r]=S.useState(e);return S.useEffect(()=>{const s=setTimeout(()=>r(e),t);return()=>clearTimeout(s)},[e,t]),n}function gA(e){return e.filter(t=>t.value!==null).map(t=>({value:t.value,count:t.count}))}function Au({field:e,scope:t,value:n,onChange:r,glyph:s,label:o,placeholder:i,title:l,single:a}){const[c,u]=S.useState(""),d=mA(c,pA),f=KR({queryKey:["run-values",e,t,d],queryFn:({pageParam:y})=>$e.values(e,t,{limit:Qy,offset:y,search:d}),initialPageParam:0,getNextPageParam:(y,v)=>y.length<Qy?void 0:v.reduce((b,g)=>b+g.length,0),staleTime:1e4}),p=S.useMemo(()=>{var y;return gA(((y=f.data)==null?void 0:y.pages.flat())??[])},[f.data]);return h.jsx(hA,{label:o,placeholder:i,...l!==void 0&&{title:l},...s!==void 0&&{glyph:s},value:n,onChange:y=>r(a?y.slice(-1):y),options:p,search:c,onSearchChange:u,loading:f.isLoading,failed:f.isError,hasMore:f.hasNextPage,loadingMore:f.isFetchingNextPage,onLoadMore:()=>void f.fetchNextPage()})}const ik=[{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 xA(e){const[t,n,...r]=e.split(":");return!t||!n||r.length===0?null:{key:t,op:n,operand:r.join(":")}}function xc(e){var r;const t=xA(e);if(!t)return e;const n=((r=ik.find(s=>s.op===t.op))==null?void 0:r.label)??t.op;return`${t.key} ${n} ${t.operand.split("|").join(", ")}`}function yA({value:e,onChange:t,scope:n}){const[r,s]=S.useState(!1),[o,i]=S.useState(""),[l,a]=S.useState("eq"),[c,u]=S.useState([]),[d,f]=S.useState(""),p=l==="eq"||l==="in",y=p?c.join("|"):d.trim(),v=o!==""&&y!=="",b=()=>{i(""),a("eq"),u([]),f("")},g=()=>{if(!v)return;const m=l==="in"&&c.length===1?"eq":l;t([...e,`${o}:${m}:${y}`]),b(),s(!1)};return h.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:[h.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:"⛃"}),h.jsxs(Ii,{open:r,onOpenChange:m=>{s(m),m||b()},children:[h.jsx(ji,{render:h.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?h.jsx("span",{className:"text-zinc-600",children:"filter by attribute…"}):e.map(m=>h.jsx(Xe,{variant:"attr",className:"mono max-w-[12rem] truncate",children:xc(m)},m))}),h.jsx(fo,{align:"start",className:"w-80 p-2",children:h.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1 border-b border-line pb-1.5",children:e.map(m=>h.jsxs(Xe,{variant:"attr",className:"mono gap-1 py-0.5",children:[xc(m),h.jsx(Se,{variant:"ghost",size:"icon",className:"h-3 w-3 text-indigo-300/70 hover:text-indigo-100",title:`remove ${xc(m)}`,"aria-label":`remove ${xc(m)}`,onClick:()=>t(e.filter(x=>x!==m)),children:h.jsx(Ss,{width:10,height:10})})]},m))}),h.jsx(Au,{field:"attr",scope:n,glyph:"⛃",label:"attribute key",placeholder:"key…",single:!0,value:o?[o]:[],onChange:m=>{i(m.at(-1)??""),u([])}}),h.jsx("select",{"aria-label":"operator",value:l,onChange:m=>a(m.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:ik.map(m=>h.jsx("option",{value:m.op,className:"bg-zinc-900",children:m.label},m.op))}),p?h.jsx(Au,{field:`attr.${o}`,scope:n,glyph:"=",label:"attribute value",placeholder:o?"value…":"pick a key first",...l!=="in"&&{single:!0},value:c,onChange:u}):h.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-line px-2 focus-within:border-zinc-600",children:[h.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:"="}),h.jsx(pg,{value:d,onChange:m=>f(m.target.value),placeholder:"value…","aria-label":"attribute value",onKeyDown:m=>{m.key==="Enter"&&g()}})]}),h.jsx(Se,{variant:"brand",size:"chip",className:"mono self-end rounded",disabled:!v,onClick:g,children:"add filter"})]})})]}),e.length>0&&h.jsx(Se,{variant:"ghost",size:"icon",onClick:()=>t([]),title:"clear attribute filters","aria-label":"clear attribute filters",className:"h-4 w-4",children:h.jsx(Ss,{width:12,height:12})})]})}function vA({facets:e,value:t,onChange:n}){return e.length===0||!DI(e)&&t.kind==="all"?null:h.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-line px-2 py-1.5",children:[h.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.18em] text-zinc-600",children:"origin"}),e.map(r=>{const s=MI(t,r.filter);return h.jsxs(Se,{variant:"ghost",size:"chip","aria-pressed":s,title:r.title,onClick:()=>n(r.filter),className:st("mono max-w-full gap-1 rounded-md",r.filter.kind==="unknown"&&"italic text-zinc-500",s&&"border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100"),children:[h.jsx("span",{className:"truncate",children:r.label}),h.jsx("span",{className:"tnum shrink-0 text-zinc-600",children:r.count})]},uS(r.filter))})]})}function Od(e){return`#/workflow/${encodeURIComponent(e)}`}function Xy(e){const t=e.match(/^#\/workflow\/(.+)$/);return t!=null&&t[1]?decodeURIComponent(t[1]):void 0}function wA(e){const 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 Zy(e,t){const n=e==null?void 0:e[t];if(n)return n.failed>0?`${n.triggered} started · ${n.failed} failed`:`${n.triggered} started`}function Jy({title:e,empty:t,links:n,counts:r}){return h.jsxs("section",{"aria-label":e,className:"min-w-0",children:[h.jsx("h3",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:e}),n.length===0?h.jsx("p",{className:"mt-1 text-[11px] text-zinc-600",children:t}):h.jsx("ul",{className:"mt-1 flex flex-col gap-1",children:n.map(s=>{var o;return h.jsxs("li",{className:"flex flex-wrap items-center gap-1.5",children:[h.jsx("a",{href:Od(s.workflow),className:"mono text-[12px] text-zinc-200 underline-offset-2 hover:underline",children:s.workflow}),h.jsxs(Xe,{className:s.kind==="failed"?"s-failed":"s-completed",children:["on ",s.kind]}),wA(s).map(i=>h.jsx(Xe,{children:i},i)),Zy(r,s.workflow)&&h.jsx("span",{className:`mono text-[10px] ${(o=r==null?void 0:r[s.workflow])!=null&&o.failed?"text-bad":"text-zinc-500"}`,title:"Counted by this dashboard's server process since it started",children:Zy(r,s.workflow)})]},`${s.workflow}:${s.kind}`)})})]})}function lk({links:e,counts:t}){return h.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[h.jsx(Jy,{title:"Starts when it settles",empty:"No workflow starts when it settles.",links:e.startsOnSettle,counts:t}),h.jsx(Jy,{title:"Started by",empty:"No workflow's settling starts it.",links:e.startedBy})]})}function bA({workflow:e}){const{data:t,error:n,isPending:r}=Xt({queryKey:["workflow-lifecycle",e],queryFn:()=>$e.workflowLifecycle(e),refetchInterval:1e4});return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"border-b border-line px-7 py-5",children:[h.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:e}),h.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Lifecycle events: registered here and announced by live workers."})]}),h.jsx("div",{className:"px-7 py-5",children:n?h.jsx("p",{className:"text-[11px] text-bad",children:n instanceof Error?n.message:String(n)}):r||!t?h.jsx("p",{className:"text-[11px] text-zinc-600",children:"Loading…"}):h.jsx(lk,{links:t,counts:t.triggerCounts})})]})}function bo(e){const t="spawn:",n="signal:child:";if(e.name.startsWith(t))return e.name.slice(t.length);if(e.name.startsWith(n))return e.name.slice(n.length)}function SA(e){const t="signal:runwait:",n="timeout:run:";if(e.name.startsWith(n))return e.name.slice(n.length)||void 0;if(!e.name.startsWith(t))return;const r=e.name.slice(t.length),s=`#${e.runId}#`,o=r.lastIndexOf(s);return o>0?r.slice(0,o):void 0}const ak=50;function n0(e,t=ak){const n=new Set;for(const r of e){if(n.size>=t)break;const s=bo(r);s!==void 0&&n.add(s)}return[...n]}function ck(e,t){const n=`${t}.`;return`child ${e.startsWith(n)?e.slice(n.length):e}`}const EA=12;function kA(e,t,n=EA){const r=e.slice(0,n);return{shown:r,more:Math.max(0,(t??e.length)-r.length)}}function CA(e){return{...e.triggeredBy?{startedBy:{...e.triggeredBy}}:{},triggered:[...e.triggered??[]]}}function uk(e){const t={};for(const n of e)n.data&&(t[n.data.run.id]=n.data);return t}function NA(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString().slice(11,23)}function RA(e,t){if(e.type==="run.triggered")return e.triggeredRunId?[{label:"started",runId:e.triggeredRunId}]:[];if(e.type.startsWith("step.")&&e.name){const n=bo({name:e.name});return n?[{label:"child",runId:n}]:[]}return e.type==="run.started"?[...t.sourceRunId?[{label:"started by",runId:t.sourceRunId}]:[],...t.parentRunId?[{label:"parent",runId:t.parentRunId}]:[]]:[]}function TA(e){return e==="run.failed"||e==="step.failed"||e==="run.trigger_failed"?"text-bad":e==="run.completed"||e==="step.completed"||e==="run.triggered"?"text-emerald-300":"text-zinc-300"}function PA({tail:e,sourceRunId:t,parentRunId:n,onOpenRun:r}){const s=S.useSyncExternalStore(e.subscribe,e.snapshot,e.snapshot);return h.jsxs("section",{"aria-label":"Events",className:"mt-3",children:[h.jsxs("h3",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:["Events ",h.jsx("span",{className:"normal-case tracking-normal text-zinc-600",children:"(live)"})]}),s.length===0?h.jsxs("p",{className:"mt-1 text-[11px] text-zinc-600","data-testid":"events-empty",children:["No events yet. This shows the engine events of this run that arrive while the page is open (the last ",e.limit,"); they are not stored."]}):h.jsx("ol",{className:"mt-1 flex max-h-60 flex-col gap-0.5 overflow-y-auto",children:[...s].reverse().map(({id:o,event:i})=>{var l;return h.jsxs("li",{className:"flex flex-wrap items-center gap-1.5 text-[11px]","data-type":i.type,children:[h.jsx("span",{className:"mono text-zinc-600",title:i.at,children:NA(i.at)}),h.jsx("span",{className:`mono ${TA(i.type)}`,children:i.type}),i.name&&(i.type==="run.triggered"||i.type==="run.trigger_failed"?h.jsx("a",{href:Od(i.name),className:"mono text-zinc-200 underline-offset-2 hover:underline",children:i.name}):h.jsx("span",{className:"mono text-zinc-400",children:i.name})),i.seq!=null&&h.jsxs(Xe,{className:"text-[10px]",children:["#",i.seq]}),RA(i,{sourceRunId:t,parentRunId:n}).map(a=>h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:a.label}),h.jsx(Se,{variant:"chip",size:"xs",onClick:()=>r(a.runId),className:"mono max-w-[24rem] truncate px-1.5 py-0",title:a.runId,children:a.runId})]},`${a.label}:${a.runId}`)),((l=i.error)==null?void 0:l.message)&&h.jsx("span",{className:"text-bad",children:i.error.message}),i.reason&&h.jsx("span",{className:"text-zinc-500",children:i.reason})]},o)})})]})}const hl=100;function IA(e,t,n=hl){if(e===void 0||t===void 0)return[0];const r=[];for(let s=Math.floor(e/n);s<=Math.floor(t/n);s+=1)r.push(s);return r}const jA="fan:";function zp(e){var n;if(!e.name.startsWith(jA))return;const t=(n=e.output)==null?void 0:n.values;return Array.isArray(t)?t.length:void 0}function dk(e){const t=zp(e);return t===void 0?e.name:`${t} child run${t===1?"":"s"}`}function _A(e){if(e.length===0)return"";let t=e[0]??"";for(const n of e.slice(1)){let r=0;for(;r<t.length&&r<n.length&&t[r]===n[r];)r+=1;t=t.slice(0,r)}return t.replace(/[\s._:-]+$/,"")}function OA(e){if(e.some(n=>zp(n)!==void 0))return`child runs ×${e.reduce((r,s)=>r+(zp(s)??1),0)}`;const t=_A(e.map(n=>n.name));return`${t.length>=2?t:"parallel"} ×${e.length}`}function MA(e){var t;return e.kind==="single"?e.step.seq:e.kind==="fan"?((t=e.steps[0])==null?void 0:t.seq)??Number.POSITIVE_INFINITY:e.fan.firstSeq}function fk(e,t=[]){const n=AA(e);if(t.length===0)return n;const r=[...t].sort((i,l)=>i.firstSeq-l.firstSeq),s=[];let o=0;for(const i of n){const l=MA(i);for(;o<r.length&&r[o].firstSeq<l;)s.push({kind:"summary",fan:r[o]}),o+=1;s.push(i)}for(;o<r.length;o+=1)s.push({kind:"summary",fan:r[o]});return s}function AA(e){var r;const t=[];let n=0;for(;n<e.length;){const s=e[n];if(s===void 0){n+=1;continue}const o=s.parallelGroup;if(o===void 0||o===""){t.push({kind:"single",step:s}),n+=1;continue}const i=[];let l=n;for(;l<e.length&&((r=e[l])==null?void 0:r.parallelGroup)===o;){const a=e[l];a!==void 0&&i.push(a),l+=1}i.length<=1?t.push({kind:"single",step:i[0]??s}):t.push({kind:"fan",group:o,steps:i,label:OA(i)}),n=l}return t}function r0(e,t=!1){const n=e.counts.running??0,r=e.counts.pending??0,s=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:s,skipped:t?s:0,started:e.size,total:e.total??e.size}}function s0(e,t=!1){const n=r0(e,t);return n.running>0?"running":n.pending>0||n.notStarted>0?"pending":n.failed>0||n.interrupted>0?"failed":"completed"}function hk(e){return e.started<e.total?`${e.started} of ${e.total}`:`×${e.total}`}const zA=new Set(["completed","failed","cancelled","dead"]);function Dp(e){return zA.has(e)}const zu=[{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"}],DA=9e4;function $A(e,t,n){var o;const r=((t==null?void 0:t.liveWorkers)??[]).filter(i=>n-i.lastBeatAt<=DA).sort((i,l)=>l.lastBeatAt-i.lastBeatAt)[0];if(r)return{kind:"working",instanceId:r.instanceId,beatAgoS:Math.max(0,Math.round((n-r.lastBeatAt)/1e3)),inFlight:(o=r.status)==null?void 0:o.inFlight};const s=e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime();return{kind:"lost",minutes:Math.round((n-s)/6e4)}}const pk=[];function FA(e){const t=S.useMemo(()=>n0(e),[e]);return mm({queries:t.map(n=>({queryKey:["run",n],queryFn:()=>$e.run(n)})),combine:uk})}function mk(e,t,n){var i;if(t){const l=new Date(t.run.createdAt).getTime(),c=t.run.status==="running"||t.run.status==="suspended"?n:new Date(t.run.updatedAt).getTime();return[l,Math.max(c,l)]}const{subs:r}=lg(e.events??[]);let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(const l of r){l.startedAt!==void 0&&(s=Math.min(s,l.startedAt));const a=((i=l.terminal)==null?void 0:i.at)??l.startedAt;a!==void 0&&(o=Math.max(o,a))}return s!==Number.POSITIVE_INFINITY&&o!==Number.NEGATIVE_INFINITY?[s,o]:[new Date(e.startedAt).getTime(),new Date(e.finishedAt).getTime()]}function gk(e,t,n){const r=e.status==="running"||e.status==="suspended",s=Date.now();let o=new Date(e.createdAt).getTime(),i=Number.NEGATIVE_INFINITY;for(const[l,a]of t)o=Math.min(o,l),i=Math.max(i,a);for(const l of n)l.startedAt&&(o=Math.min(o,new Date(l.startedAt).getTime())),l.finishedAt&&(i=Math.max(i,new Date(l.finishedAt).getTime()));return i=Math.max(i,r?s:o+1),{t0:o,span:Math.max(i-o,1),liveNow:s}}function o0(e,t,n,r=mk(e,t,n.liveNow)){const{t0:s,span:o}=n,[i,l]=r,{subs:a}=lg(e.events??[]),c=a.map(u=>{var p;const d=u.startedAt??i,f=((p=u.terminal)==null?void 0:p.at)??d;return{key:u.id,name:u.name,status:u.status??"ok",left:(d-s)/o*100,width:Math.max((f-d)/o*100,.8),ms:u.durationMs??Math.max(f-d,0)}});return{step:e,childId:bo(e),childRun:t,left:(i-s)/o*100,width:Math.max((l-i)/o*100,.8),ms:l-i,subRows:c}}function Du(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}const LA={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"},HA={ok:"bg-emerald-400",failed:"bg-red-400",skipped:"bg-amber-400"};function Md({row:e,run:t,childRuns:n,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,onToggleChild:l,expanded:a,collapsedSubs:c,toggleSubs:u}){var z;const{step:d,left:f,width:p,ms:y,subRows:v}=e,b=d.status==="failed",g=bo(d),m=!!g,x=m?ug:dg(d.kind),w=s===`${d.runId}#${d.seq}`,E=m&&g!==void 0&&a.has(g),N=v.length>0&&!m,k=c.has(d.seq),C=WI(d,Date.now()),{data:P}=Xt({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:1e4,enabled:C}),I=C?$A(d,P==null?void 0:P.find($=>$.group===d.workerGroup),Date.now()):void 0;return h.jsxs("div",{children:[h.jsxs("button",{type:"button",onClick:()=>o(d,t),title:m?"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 ${w?"bg-zinc-800/60":"hover:bg-zinc-900/60"}`,children:[h.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[m&&g!==void 0&&h.jsx("button",{type:"button",onClick:$=>{$.stopPropagation(),l(g)},className:"shrink-0 text-indigo-400 hover:text-indigo-200 transition-colors",title:E?"Collapse child run":"Expand child run inline",children:h.jsx("span",{className:"inline-block transition-transform",style:{transform:E?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),N&&h.jsx("button",{type:"button",onClick:$=>{$.stopPropagation(),u(d.seq)},className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:k?`Show ${v.length} sub-process(es)`:"Hide sub-processes",children:h.jsx("span",{className:"inline-block transition-transform",style:{transform:k?"rotate(0deg)":"rotate(90deg)"},children:"▸"})}),h.jsx("span",{className:b?"text-red-400":m?"text-indigo-300":"text-emerald-400",children:h.jsx(x,{width:12,height:12})}),h.jsx("span",{className:"truncate text-[12px] text-zinc-300",children:g!==void 0?((z=n[g])==null?void 0:z.run.workflow)??ck(g,d.runId):dk(d)}),m&&g!==void 0&&h.jsx("button",{type:"button",onClick:$=>{$.stopPropagation(),i(g)},title:"Open the child run",className:"shrink-0 text-indigo-300 transition-colors hover:text-indigo-100",children:"↗"})]}),h.jsxs("span",{className:"relative h-5",children:[h.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),h.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 ${b?"bg-red-500/35 ring-1 ring-red-500/50":w?"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}%`}}),h.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:Du(y)})]})]}),(I==null?void 0:I.kind)==="working"&&h.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:[h.jsx("span",{"aria-hidden":!0,children:"⚙"}),"being worked by ",I.instanceId," — heartbeat ",I.beatAgoS,"s ago",I.inFlight!==void 0?` · ${I.inFlight} in flight`:""]}),(I==null?void 0:I.kind)==="lost"&&h.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:[h.jsx("span",{"aria-hidden":!0,children:"⚠"}),"awaiting worker result — dispatched ",I.minutes,"m ago, no live worker (possibly lost)"]}),v.length>0&&!k&&h.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 space-y-0.5 border-l border-line-soft pl-2",children:v.map($=>h.jsxs("div",{className:"grid grid-cols-[130px_1fr] items-center gap-3 px-2",title:`${$.name} — ${$.status}`,children:[h.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[h.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${HA[$.status]}`}),h.jsx("span",{className:"truncate text-[10px] text-zinc-400",children:$.name})]}),h.jsxs("span",{className:"relative h-3",children:[h.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),h.jsx("span",{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-[2px] transition-all duration-500 ease-out ${LA[$.status]}`,style:{left:`${$.left}%`,width:`${$.width}%`}}),h.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(${$.left+$.width}%, calc(100% - 38px))`},children:Du($.ms)})]})]},$.key))}),m&&g!==void 0&&E&&h.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 border-l border-line-soft pl-2",children:h.jsx(UA,{id:g,depth:r+1,selectedKey:s,onSelect:o,onOpenRun:i,expanded:a,onToggleChild:l})})]})}function BA({label:e,fanFailed:t,memberRows:n,rowProps:r}){return h.jsxs("div",{className:"rounded-md bg-zinc-900/30 ring-1 ring-line-soft",children:[h.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[h.jsx("span",{className:"text-[11px] text-indigo-300/80",title:"parallel fan-out (ctx.gather / ctx.all)",children:"⑃"}),h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.15em] text-zinc-500",children:"parallel"}),h.jsx("span",{className:`text-[11px] ${t?"text-red-400":"text-zinc-300"}`,children:e})]}),h.jsx("div",{className:"ml-[10px] border-l border-line-soft pl-1",children:n.map(s=>h.jsx(Md,{row:s,...r},s.step.seq))})]})}const ev=28;function VA({fan:e,frame:t,rowProps:n}){const[r,s]=S.useState(!1),[o,i]=S.useState(!1),l=Dp(n.run.status),a=r0(e,l),c=s0(e,l),u=c==="running"||c==="pending",d=n.run.status==="running"||n.run.status==="suspended",f=e.startedAt?new Date(e.startedAt).getTime():void 0,p=e.finishedAt?new Date(e.finishedAt).getTime():u&&d?t.liveNow:f,y=S.useMemo(()=>e.failures.map(v=>o0(v,void 0,t)),[e.failures,t]);return h.jsxs("div",{className:"rounded-md bg-zinc-900/30 ring-1 ring-line-soft",children:[h.jsxs("div",{className:"grid grid-cols-[150px_1fr] items-center gap-3 px-2 py-1",children:[h.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[h.jsx("button",{type:"button",onClick:()=>s(v=>!v),className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:r?"Hide the members":`List the ${e.size} members started`,children:h.jsx("span",{className:"inline-block transition-transform",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),h.jsx("span",{className:"text-[11px] text-indigo-300/80",title:"parallel fan-out, summarized",children:"⑃"}),h.jsxs("span",{className:`truncate text-[12px] ${c==="failed"?"text-red-400":"text-zinc-300"}`,title:e.group,children:[e.label," ×",a.total]})]}),h.jsxs("span",{className:"relative h-5",children:[h.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),f!==void 0&&p!==void 0&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:`absolute top-1/2 h-3.5 -translate-y-1/2 rounded-[3px] ${c==="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((p-f)/t.span*100,.8)}%`}}),h.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(${(p-t.t0)/t.span*100}%, calc(100% - 44px))`},children:Du(p-f)})]})]})]}),h.jsxs("div",{className:"flex items-center gap-3 px-2 pb-1.5 pl-[26px]",children:[h.jsx("span",{className:"flex h-1.5 w-40 shrink-0 overflow-hidden rounded-full bg-zinc-800",children:zu.map(v=>a[v.key]>0?h.jsx("span",{className:v.className,style:{width:`${a[v.key]/Math.max(a.total,1)*100}%`}},v.key):null)}),h.jsxs("span",{className:"mono tnum flex flex-wrap gap-2 text-[10px]",children:[a.started<a.total&&h.jsxs("span",{className:"text-zinc-400",children:[hk(a)," started"]}),zu.map(v=>a[v.key]>0?h.jsxs("span",{className:v.text,children:[a[v.key]," ",v.label,v.key==="skipped"&&e.failFast?" (failFast)":""]},v.key):null)]})]}),y.length>0&&!r&&h.jsxs("div",{className:"ml-[10px] border-l border-red-500/30 pl-1",children:[h.jsx("div",{className:"mono px-2 text-[10px] text-red-300/70",children:a.failed>y.length?`first ${y.length} of ${a.failed} failed`:`${y.length} failed`}),y.map(v=>h.jsx(Md,{row:v,...n},v.step.seq))]}),r&&h.jsxs("div",{className:"ml-[10px] border-l border-line-soft pl-1",children:[h.jsx("div",{className:"flex items-center gap-2 px-2 py-0.5",children:h.jsx("button",{type:"button",onClick:()=>i(v=>!v),className:`mono rounded border px-1.5 text-[10px] transition-colors ${o?"border-red-500/40 bg-red-500/15 text-red-300":"border-line text-zinc-500 hover:text-zinc-300"}`,children:"failed only"})}),h.jsx(WA,{group:e.group,failedOnly:o,live:u&&d,frame:t,rowProps:n},o?"failed":"all")]})]})}function WA({group:e,failedOnly:t,live:n,frame:r,rowProps:s}){var b,g,m,x;const o=s.run.id,i=S.useRef(null),[l,a]=S.useState(),c=ig({count:l??0,getScrollElement:()=>i.current,estimateSize:()=>ev,measureElement:w=>w.getBoundingClientRect().height,overscan:10}),u=c.getVirtualItems(),d=IA((b=u[0])==null?void 0:b.index,(g=u[u.length-1])==null?void 0:g.index),f=mm({queries:d.map(w=>({queryKey:["fan",o,e,t,w],queryFn:()=>$e.fanMembers(o,e,{offset:w*hl,limit:hl,failed:t}),refetchInterval:n?5e3:!1}))}),p=(x=(m=f.find(w=>w.data!==void 0))==null?void 0:m.data)==null?void 0:x.total;S.useEffect(()=>{p!==void 0&&a(p)},[p]);const y=w=>{var k,C;const E=Math.floor(w/hl),N=d.indexOf(E);return N<0||(C=(k=f[N])==null?void 0:k.data)==null?void 0:C.items[w%hl]},v=f.find(w=>w.isError);return l===void 0&&v?h.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)]}):l===void 0?h.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading members…"}):l===0?h.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:t?"no failed members":"no members"}):h.jsx("div",{ref:i,className:"max-h-[320px] overflow-auto",children:h.jsx("div",{className:"relative w-full",style:{height:c.getTotalSize()},children:u.map(w=>{const E=y(w.index);return h.jsx("div",{"data-index":w.index,ref:c.measureElement,className:"absolute inset-x-0 top-0",style:{transform:`translateY(${w.start}px)`},children:E?h.jsx(Md,{row:o0(E,void 0,r),...s}):h.jsxs("div",{className:"mono px-2 text-[10px] leading-7 text-zinc-700",style:{height:ev},children:["#",w.index+1," loading…"]})},w.key)})})})}function i0({run:e,timeline:t,fans:n=pk,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,expanded:l,onToggleChild:a}){const c=FA(t),{frame:u,rows:d}=S.useMemo(()=>{const m=Date.now(),x=t.map(N=>{const k=bo(N),C=k!==void 0?c[k]:void 0;return{step:N,childRun:C,window:mk(N,C,m)}}),w=gk(e,x.map(N=>N.window),n),E=x.map(N=>o0(N.step,N.childRun,w,N.window));return{frame:w,rows:E}},[e,t,n,c]),f=S.useMemo(()=>fk(t,n),[t,n]),p=S.useMemo(()=>{const m=new Map;for(const x of d)m.set(x.step.seq,x);return m},[d]),[y,v]=S.useState(new Set),g={run:e,childRuns:c,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,onToggleChild:a,expanded:l,collapsedSubs:y,toggleSubs:m=>v(x=>{const w=new Set(x);return w.has(m)?w.delete(m):w.add(m),w})};return h.jsx(h.Fragment,{children:f.map(m=>{if(m.kind==="single"){const w=p.get(m.step.seq);return w?h.jsx(Md,{row:w,...g},w.step.seq):null}if(m.kind==="summary")return h.jsx(VA,{fan:m.fan,frame:u,rowProps:g},`fan:${m.fan.group}`);const x=m.steps.map(w=>p.get(w.seq)).filter(w=>w!==void 0);return h.jsx(BA,{label:m.label,fanFailed:m.steps.some(w=>w.status==="failed"),memberRows:x,rowProps:g},`fan:${m.group}`)})})}function UA({id:e,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i}){const{data:l}=Xt({queryKey:["run",e],queryFn:()=>$e.run(e)});return t>6?null:l?h.jsxs("div",{className:"my-1 rounded-md border border-line bg-black/15",children:[h.jsxs("div",{className:"mono flex items-center gap-2 px-2 py-1 text-[10px] text-zinc-500",children:[h.jsxs("span",{className:"text-indigo-300",children:["⌁ ",l.run.workflow]}),h.jsx("span",{className:"tnum text-zinc-600",children:e.slice(0,8)}),h.jsx("span",{className:`s-${l.run.status} uppercase`,children:l.run.status}),h.jsx("button",{type:"button",onClick:()=>s(e),className:"ml-auto rounded border border-line px-1.5 text-zinc-400 hover:text-zinc-200",children:"open ↗"})]}),h.jsx(i0,{run:l.run,timeline:l.timeline,fans:l.fans,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i})]}):h.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading child run…"})}const qA=S.memo(function({run:t,timeline:n,fans:r,selectedKey:s,onSelect:o,onOpenRun:i,expanded:l,onToggleChild:a}){const c=S.useMemo(()=>gk(t,n.map(f=>[new Date(f.startedAt).getTime(),new Date(f.finishedAt).getTime()]),r??pk).span,[t,n,r]),u=l??new Set,d=a??(()=>{});return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-500",children:"spans"}),h.jsxs("span",{className:"mono tnum text-[10px] text-zinc-600",children:["total ",Du(c)]})]}),h.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:h.jsx(i0,{run:t,timeline:n,fans:r,depth:0,selectedKey:s,onSelect:o,onOpenRun:i,expanded:u,onToggleChild:d})})]})});function $u(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function tv(e,t){return $u(new Date(t).getTime()-new Date(e).getTime())}function nv(e){return l0(new Date(e).getTime())}function l0(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}const xk={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"},KA={debug:"text-zinc-500",info:"text-zinc-300",warn:"text-amber-300",error:"text-red-300"},YA=["ok","failed","skipped"];function yk({e}){return h.jsxs("div",{className:"flex gap-2 py-0.5",children:[h.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:l0(e.at)}),h.jsx("span",{className:`shrink-0 uppercase ${KA[e.level]}`,children:e.level}),h.jsx("span",{className:"min-w-0 break-words text-zinc-300",children:e.message})]})}function rv({sub:e,showGroup:t=!0}){var l,a;const n=((l=e.terminal)==null?void 0:l.message)!==void 0&&e.terminal.message!==e.name,r=e.phases.length>0||e.logs.length>0||n,[s,o]=S.useState(e.status==="failed"),i=e.status?xk[e.status]:"border-amber-500/25 bg-amber-500/10 text-amber-300";return h.jsxs("li",{className:`rounded-md border ${i}`,children:[h.jsxs("button",{type:"button",disabled:!r,onClick:()=>o(c=>!c),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?s:void 0,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r&&h.jsx("span",{className:`text-[9px] text-zinc-500 transition-transform duration-150 ${s?"":"-rotate-90"}`,children:"▼"}),h.jsx("span",{className:"mono truncate text-zinc-200",children:e.name}),t&&e.group&&h.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-wider text-zinc-500",children:e.group})]}),h.jsxs("span",{className:"mono flex shrink-0 items-center gap-2 text-[10px] uppercase tracking-wider",children:[e.durationMs!==void 0&&h.jsx("span",{className:"tnum text-zinc-400",children:$u(e.durationMs)}),h.jsx("span",{children:e.status??"running"})]})]}),s&&h.jsxs("div",{className:"border-t border-line/60 px-2.5 py-2",children:[e.phases.length>0&&h.jsx("ul",{className:"mono mb-2 flex flex-col gap-0.5 text-[10.5px]",children:e.phases.map((c,u)=>h.jsxs("li",{className:"flex gap-2",children:[h.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:l0(c.at)}),h.jsx("span",{className:"text-zinc-400",children:c.phase}),e.startedAt!==void 0&&h.jsxs("span",{className:"text-zinc-600 tnum",children:["+",$u(c.at-e.startedAt)]})]},`${c.at}-${c.phase}-${u}`))}),((a=e.terminal)==null?void 0:a.message)&&e.terminal.message!==e.name&&h.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&&h.jsx("div",{className:"mono flex flex-col gap-0.5 text-[11px]",children:e.logs.map((c,u)=>h.jsx(yk,{e:c},`${c.at}-${u}`))})]})]})}function GA({events:e}){const{subs:t,stepLogs:n}=lg(e),r=YA.map(o=>[o,t.filter(i=>i.status===o).length]).filter(([,o])=>o>0),s=t.some(o=>o.group);return h.jsxs(h.Fragment,{children:[t.length>0&&h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[h.jsxs("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["sub-processes · ",t.length]}),h.jsx("span",{className:"mono flex gap-2 text-[10px] uppercase tracking-wider",children:r.map(([o,i])=>h.jsxs("span",{className:xk[o].split(" ").pop(),children:[i," ",o]},o))})]}),s?Object.entries(t.reduce((o,i)=>{const l=i.group??"—";return o[l]===void 0&&(o[l]=[]),o[l].push(i),o},{})).sort(([o],[i])=>o==="—"?1:i==="—"?-1:o.localeCompare(i)).map(([o,i])=>h.jsxs("div",{className:"mb-2",children:[h.jsx("div",{className:"mono mb-1 text-[10px] uppercase tracking-wider text-zinc-500",children:o}),h.jsx("ul",{className:"flex flex-col gap-1",children:i.map(l=>h.jsx(rv,{sub:l,showGroup:!1},l.id))})]},o)):h.jsx("ul",{className:"flex flex-col gap-1",children:t.map(o=>h.jsx(rv,{sub:o},o.id))})]}),n.length>0&&h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["logs · ",n.length]}),h.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((o,i)=>h.jsx(yk,{e:o},`${o.at}-${i}`))})]})]})}function vk({value:e}){const[t,n]=S.useState(!1);return h.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?h.jsx(cg,{width:11,height:11}):h.jsx(dj,{width:11,height:11}),t?"copied":"copy"]})}function Jl({label:e,value:t}){const n=typeof t=="string"?t:JSON.stringify(t,null,2);return h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:e}),h.jsx(vk,{value:n})]}),h.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 wk({error:e}){return h.jsxs(h.Fragment,{children:[h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mono mb-1.5 flex items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:[h.jsx("span",{children:"error"}),e.code&&h.jsx("span",{className:"rounded border border-red-500/30 px-1.5 py-px normal-case tracking-normal text-red-300",children:e.code})]}),h.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&&h.jsx(Jl,{label:"error details",value:e.details})]})}function dr({k:e,v:t,mono:n=!0}){return h.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",children:[h.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-zinc-600",children:e}),h.jsx("span",{className:`truncate text-right text-[12px] text-zinc-200 ${n?"mono tnum":""}`,children:t})]})}function QA({id:e,onOpenRun:t}){const{data:n}=Xt({queryKey:["run",e],queryFn:()=>$e.run(e)}),[r,s]=S.useState(new Set),o=i=>s(l=>{const a=new Set(l);return a.has(i)?a.delete(i):a.add(i),a});return n?n.timeline.length===0?h.jsxs("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:["no steps recorded yet — child ",n.run.status]}):h.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:h.jsx(i0,{run:n.run,timeline:n.timeline,depth:0,onSelect:()=>{},onOpenRun:t??(()=>{}),expanded:r,onToggleChild:o})}):h.jsx("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:"loading child run…"})}function XA({step:e,run:t,onClose:n,onOpenRun:r}){const s=bo(e),o=SA(e),[i,l]=S.useState(!1),a=e.status==="failed",c=e.status==="pending"||e.status==="running",u=dg(e.kind),d=tv(t.createdAt,e.startedAt),f=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return h.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:[h.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`grid h-6 w-6 shrink-0 place-items-center rounded-md ${a?"bg-red-500/15 text-red-300":c?"bg-amber-500/15 text-amber-300":"bg-emerald-500/15 text-emerald-300"}`,children:h.jsx(u,{width:13,height:13})}),h.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.name})]}),h.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status," · ",yp[e.kind]??e.kind]})]}),h.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:h.jsx(Ss,{})})]}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[h.jsxs("div",{className:"rounded-lg border border-line bg-black/20 px-3.5 py-1",children:[h.jsx(dr,{k:"seq",v:`#${e.seq}`}),f>=1&&h.jsx(dr,{k:"queued",v:h.jsx("span",{className:"text-sky-300",children:$u(f)})}),h.jsx(dr,{k:"duration",v:c?h.jsx("span",{className:"text-amber-300",children:"running…"}):tv(e.startedAt,e.finishedAt)}),h.jsx(dr,{k:"attempts",v:h.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&h.jsx(ku,{width:11,height:11,className:"mr-1 inline"}),e.attempts]})}),e.workerGroup&&h.jsx(dr,{k:"worker",v:`@${e.workerGroup}`}),o&&h.jsx(dr,{k:"waited for run",v:r?h.jsx("button",{type:"button",onClick:()=>r(o),className:"mono text-sky-300 underline-offset-2 hover:underline",children:o}):h.jsx("span",{className:"mono",children:o})}),h.jsx(dr,{k:"started",v:nv(e.startedAt)}),!c&&h.jsx(dr,{k:"finished",v:nv(e.finishedAt)}),h.jsx(dr,{k:"offset",v:`+${d}`})]}),a&&e.error&&h.jsx(wk,{error:e.error}),e.events&&e.events.length>0&&h.jsx(GA,{events:e.events}),s&&h.jsxs("section",{className:"rise",children:[h.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[h.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:"child run"}),r&&h.jsx("button",{type:"button",onClick:()=>r(s),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 ↗"})]}),h.jsxs("button",{type:"button",onClick:()=>l(p=>!p),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:i?"Collapse child run":"Expand child run inline",children:[h.jsx("span",{className:"inline-block text-[9px] text-indigo-300 transition-transform",style:{transform:i?"rotate(90deg)":"rotate(0deg)"},children:"▸"}),h.jsx("span",{className:"mono truncate text-[11px] text-indigo-300",children:s})]}),i&&h.jsx(QA,{id:s,onOpenRun:r})]}),e.input!==void 0&&h.jsx(Jl,{label:"input",value:e.input}),e.output!==void 0&&h.jsx(Jl,{label:"output",value:e.output})]})]})}function ZA({run:e,onClose:t}){const n=e.input===void 0&&e.output===void 0&&!e.error;return h.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:[h.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.workflow}),h.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:["run · ",e.status]})]}),h.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:h.jsx(Ss,{})})]}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[e.error&&h.jsx(wk,{error:e.error}),e.input!==void 0&&h.jsx(Jl,{label:"input",value:e.input}),e.output!==void 0&&h.jsx(Jl,{label:"output",value:e.output}),n&&h.jsx("div",{className:"text-sm text-zinc-600",children:"No input/output recorded."})]})]})}const qf="durable:lifecycle:pending";function sv(e){const t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;const n=Math.round(t/60);if(n<60)return`${n}m`;const r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}function JA(e,t){switch(e.state){case"started":return"started";case"owed":{const n=e.owedSince!==void 0?`owed for ${sv(t-e.owedSince)}`:"owed";return e.orphanAt!==void 0?`${n} · orphan in ${sv(e.orphanAt-t)}`:n}case"coalesced":return"coalesced";case"failed":return"failed";default:return"not started"}}const ez="No run and nothing owed: its `where` declined the event, or it subscribed after the run settled.",tz="Its start failed: its `where` threw, its input was rejected, its start threw, or no live instance had it. The run.trigger_failed event carries the reason; republish to retry.",nz="No live instance registers or announces this subscriber; the lifecycle sweep drops it then and reports run.trigger_failed.";function Fu({status:e}){return e?h.jsx(Xe,{variant:"status",className:`s-${e} text-[10px]`,children:e}):null}function Lu({runId:e,onOpenRun:t}){return h.jsx(Se,{variant:"chip",size:"xs",onClick:()=>t(e),className:"mono max-w-[28rem] truncate px-1.5 py-0",title:e,children:e})}function rz({source:e,onOpenRun:t}){return h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1","data-testid":"lifecycle-source",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:"started by"}),h.jsx(Lu,{runId:e.runId,onOpenRun:t}),h.jsx("span",{className:"text-[10px] text-zinc-600",children:"on"}),h.jsx(Xe,{className:st("text-[10px]",e.kind==="failed"?"s-failed":"s-completed"),children:e.kind}),h.jsx(Fu,{status:e.status}),e.traceId&&h.jsxs("span",{className:"ml-1 flex items-center gap-1",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:"trace"}),h.jsx("span",{className:"mono text-[10px] text-zinc-400",title:"The source run's trace id",children:e.traceId}),h.jsx(vk,{value:e.traceId})]})]})}function sz({waitsFor:e=[],awaitedBy:t=[],onOpenRun:n}){return e.length===0&&t.length===0?null:h.jsxs("div",{className:"mt-1.5 flex flex-col gap-1",children:[e.map(r=>h.jsxs("div",{className:"flex flex-wrap items-center gap-1","data-testid":"waits-for",children:[h.jsx("span",{className:"text-[10px] text-amber-300/80",children:"Waiting for run"}),h.jsx(Lu,{runId:r.runId,onOpenRun:n}),h.jsx(Fu,{status:r.status})]},`${r.runId}#${r.seq}`)),t.length>0&&h.jsxs("div",{className:"flex flex-wrap items-center gap-1","data-testid":"awaited-by",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:"Awaited by"}),t.map(r=>h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(Lu,{runId:r.runId,onOpenRun:n}),h.jsx(Fu,{status:r.status})]},`${r.runId}#${r.seq}`))]})]})}function oz({deliveries:e,now:t=Date.now(),onOpenRun:n,onRepublish:r,republishing:s=!1}){return e.length===0?null:h.jsxs("section",{"aria-label":"Lifecycle subscribers",className:"mt-3",children:[h.jsx("h3",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"Lifecycle subscribers"}),h.jsx("ul",{className:"mt-1 flex flex-col gap-1",children:e.map(o=>h.jsxs("li",{className:"flex flex-wrap items-center gap-1.5","data-state":o.state,children:[h.jsx("a",{href:Od(o.subscriber),className:"mono text-[12px] text-zinc-200 underline-offset-2 hover:underline",children:o.subscriber}),h.jsx(Xe,{variant:o.state==="owed"?"warn":o.state==="failed"?"danger":"outline",className:"text-[10px]",title:o.state==="not-started"?ez:o.state==="failed"&&o.error===void 0?tz:o.orphanAt!==void 0?nz:void 0,children:JA(o,t)}),o.runId&&h.jsx(Lu,{runId:o.runId,onOpenRun:n}),o.state==="started"&&h.jsx(Fu,{status:o.status}),o.state==="failed"&&o.error!==void 0&&h.jsx("span",{className:"mono text-[11px] text-bad",children:o.error}),o.state==="failed"&&r&&h.jsx(Se,{variant:"info",size:"xs",disabled:s,onClick:()=>r(o.subscriber),title:`Start ${o.subscriber} from this run again`,children:"Republish"})]},o.subscriber))})]})}function iz(e,t){return e.some(n=>n.state==="failed"&&!n.error&&t[n.subscriber])?e.map(n=>{const r=t[n.subscriber];return n.state==="failed"&&!n.error&&r?{...n,error:r}:n}):e}function lz({tags:e,onChange:t}){const n=e.includes(qf);return h.jsx(Se,{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(r=>r!==qf):[...e,qf]),className:st("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 az(e){if(e.cron)return e.timezone&&e.timezone!=="UTC"?`${e.cron} · ${e.timezone}`:e.cron;const t=e.everyMs??0;return t%864e5===0?`every ${t/864e5}d`:t%36e5===0?`every ${t/36e5}h`:t%6e4===0?`every ${t/6e4}m`:t%1e3===0?`every ${t/1e3}s`:`every ${t}ms`}function ov(e,t=Date.now()){const n=Date.parse(e)-t,r=Math.round(Math.abs(n)/1e3),s=r<60?`${r}s`:r<3600?`${Math.round(r/60)}m`:r<86400?`${Math.round(r/3600)}h`:`${Math.round(r/86400)}d`;return n>=0?`in ${s}`:`${s} ago`}function cz(){const e=mo(),{data:t}=Xt({queryKey:["schedules"],queryFn:()=>$e.schedules(),refetchInterval:1e4}),n=mr({mutationFn:({id:s,action:o})=>o==="pause"?$e.pauseSchedule(s):o==="resume"?$e.resumeSchedule(s):$e.triggerSchedule(s),onSettled:()=>{e.invalidateQueries({queryKey:["schedules"]}),e.invalidateQueries({queryKey:["runs"]})}});if(!t||t.length===0)return null;const r=t.filter(s=>s.paused).length;return h.jsxs(Ii,{children:[h.jsx(ji,{render:h.jsxs(Se,{variant:"chip",size:"xs",className:"mono gap-1",children:[h.jsx("span",{className:"uppercase tracking-wide",children:"schedules"}),h.jsxs("span",{className:"tnum text-zinc-500",children:[t.length,r?` · ${r} paused`:""]})]})}),h.jsx(fo,{className:"w-[34rem] max-h-[60vh] overflow-y-auto",children:h.jsxs("table",{className:"mono w-full text-[10px]",children:[h.jsx("thead",{className:"sticky top-0 bg-popover text-left text-zinc-500",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"schedule"}),h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"cadence"}),h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"next"}),h.jsx("th",{className:"px-2 py-1.5 font-normal",children:"last"}),h.jsx("th",{className:"px-2 py-1.5"})]})}),h.jsx("tbody",{children:t.map(s=>h.jsxs("tr",{className:"border-t border-line align-top",children:[h.jsxs("td",{className:"max-w-[10rem] px-2 py-1.5",children:[h.jsx("div",{className:"truncate text-zinc-200",title:s.id,children:s.id}),h.jsxs("div",{className:"truncate text-zinc-500",title:s.workflow,children:[s.workflow,s.namespace!=="default"?` @${s.namespace}`:""]})]}),h.jsx("td",{className:"px-2 py-1.5 text-zinc-400",children:az(s)}),h.jsx("td",{className:st("px-2 py-1.5",s.paused?"text-amber-400/80":"text-zinc-300"),children:s.paused?"paused":s.nextFireAt?ov(s.nextFireAt):"—"}),h.jsxs("td",{className:"max-w-[9rem] px-2 py-1.5 text-zinc-500",children:[s.lastFireAt?ov(s.lastFireAt):"never",s.lastError&&h.jsx("div",{className:"truncate text-red-400/80",title:s.lastError,children:s.lastError})]}),h.jsxs("td",{className:"whitespace-nowrap px-2 py-1.5 text-right",children:[h.jsx(Se,{variant:"ghost",size:"xs",disabled:n.isPending,onClick:()=>n.mutate({id:s.id,action:s.paused?"resume":"pause"}),children:s.paused?"resume":"pause"}),h.jsx(Se,{variant:"ghost",size:"xs",disabled:n.isPending,onClick:()=>n.mutate({id:s.id,action:"trigger"}),children:"run now"})]})]},s.id))})]})})]})}function dt(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=dt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var uz={value:()=>{}};function Ad(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Vc(n)}function Vc(e){this._=e}function dz(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Vc.prototype=Ad.prototype={constructor:Vc,on:function(e,t){var n=this._,r=dz(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=fz(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<i;)if(s=(e=r[o]).type)n[s]=iv(n[s],e.name,t);else if(t==null)for(s in n)n[s]=iv(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Vc(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function fz(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function iv(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=uz,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var $p="http://www.w3.org/1999/xhtml";const lv={svg:"http://www.w3.org/2000/svg",xhtml:$p,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),lv.hasOwnProperty(t)?{space:lv[t],local:e}:e}function hz(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===$p&&t.documentElement.namespaceURI===$p?t.createElement(e):t.createElementNS(n,e)}}function pz(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function bk(e){var t=zd(e);return(t.local?pz:hz)(t)}function mz(){}function a0(e){return e==null?mz:function(){return this.querySelector(e)}}function gz(e){typeof e!="function"&&(e=a0(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=new Array(i),a,c,u=0;u<i;++u)(a=o[u])&&(c=e.call(a,a.__data__,u,o))&&("__data__"in a&&(c.__data__=a.__data__),l[u]=c);return new hn(r,this._parents)}function xz(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function yz(){return[]}function Sk(e){return e==null?yz:function(){return this.querySelectorAll(e)}}function vz(e){return function(){return xz(e.apply(this,arguments))}}function wz(e){typeof e=="function"?e=vz(e):e=Sk(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],l=i.length,a,c=0;c<l;++c)(a=i[c])&&(r.push(e.call(a,a.__data__,c,i)),s.push(a));return new hn(r,s)}function Ek(e){return function(){return this.matches(e)}}function kk(e){return function(t){return t.matches(e)}}var bz=Array.prototype.find;function Sz(e){return function(){return bz.call(this.children,e)}}function Ez(){return this.firstElementChild}function kz(e){return this.select(e==null?Ez:Sz(typeof e=="function"?e:kk(e)))}var Cz=Array.prototype.filter;function Nz(){return Array.from(this.children)}function Rz(e){return function(){return Cz.call(this.children,e)}}function Tz(e){return this.selectAll(e==null?Nz:Rz(typeof e=="function"?e:kk(e)))}function Pz(e){typeof e!="function"&&(e=Ek(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],a,c=0;c<i;++c)(a=o[c])&&e.call(a,a.__data__,c,o)&&l.push(a);return new hn(r,this._parents)}function Ck(e){return new Array(e.length)}function Iz(){return new hn(this._enter||this._groups.map(Ck),this._parents)}function Hu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Hu.prototype={constructor:Hu,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 jz(e){return function(){return e}}function _z(e,t,n,r,s,o){for(var i=0,l,a=t.length,c=o.length;i<c;++i)(l=t[i])?(l.__data__=o[i],r[i]=l):n[i]=new Hu(e,o[i]);for(;i<a;++i)(l=t[i])&&(s[i]=l)}function Oz(e,t,n,r,s,o,i){var l,a,c=new Map,u=t.length,d=o.length,f=new Array(u),p;for(l=0;l<u;++l)(a=t[l])&&(f[l]=p=i.call(a,a.__data__,l,t)+"",c.has(p)?s[l]=a:c.set(p,a));for(l=0;l<d;++l)p=i.call(e,o[l],l,o)+"",(a=c.get(p))?(r[l]=a,a.__data__=o[l],c.delete(p)):n[l]=new Hu(e,o[l]);for(l=0;l<u;++l)(a=t[l])&&c.get(f[l])===a&&(s[l]=a)}function Mz(e){return e.__data__}function Az(e,t){if(!arguments.length)return Array.from(this,Mz);var n=t?Oz:_z,r=this._parents,s=this._groups;typeof e!="function"&&(e=jz(e));for(var o=s.length,i=new Array(o),l=new Array(o),a=new Array(o),c=0;c<o;++c){var u=r[c],d=s[c],f=d.length,p=zz(e.call(u,u&&u.__data__,c,r)),y=p.length,v=l[c]=new Array(y),b=i[c]=new Array(y),g=a[c]=new Array(f);n(u,d,v,b,g,p,t);for(var m=0,x=0,w,E;m<y;++m)if(w=v[m]){for(m>=x&&(x=m+1);!(E=b[x])&&++x<y;);w._next=E||null}}return i=new hn(i,r),i._enter=l,i._exit=a,i}function zz(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Dz(){return new hn(this._exit||this._groups.map(Ck),this._parents)}function $z(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function Fz(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,i=Math.min(s,o),l=new Array(s),a=0;a<i;++a)for(var c=n[a],u=r[a],d=c.length,f=l[a]=new Array(d),p,y=0;y<d;++y)(p=c[y]||u[y])&&(f[y]=p);for(;a<s;++a)l[a]=n[a];return new hn(l,this._parents)}function Lz(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],i;--s>=0;)(i=r[s])&&(o&&i.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(i,o),o=i);return this}function Hz(e){e||(e=Bz);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var i=n[o],l=i.length,a=s[o]=new Array(l),c,u=0;u<l;++u)(c=i[u])&&(a[u]=c);a.sort(t)}return new hn(s,this._parents).order()}function Bz(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Vz(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Wz(){return Array.from(this)}function Uz(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var i=r[s];if(i)return i}return null}function qz(){let e=0;for(const t of this)++e;return e}function Kz(){return!this.node()}function Yz(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,i=s.length,l;o<i;++o)(l=s[o])&&e.call(l,l.__data__,o,s);return this}function Gz(e){return function(){this.removeAttribute(e)}}function Qz(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xz(e,t){return function(){this.setAttribute(e,t)}}function Zz(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Jz(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function e5(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 t5(e,t){var n=zd(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?Qz:Gz:typeof t=="function"?n.local?e5:Jz:n.local?Zz:Xz)(n,t))}function Nk(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function n5(e){return function(){this.style.removeProperty(e)}}function r5(e,t,n){return function(){this.style.setProperty(e,t,n)}}function s5(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function o5(e,t,n){return arguments.length>1?this.each((t==null?n5:typeof t=="function"?s5:r5)(e,t,n??"")):_i(this.node(),e)}function _i(e,t){return e.style.getPropertyValue(t)||Nk(e).getComputedStyle(e,null).getPropertyValue(t)}function i5(e){return function(){delete this[e]}}function l5(e,t){return function(){this[e]=t}}function a5(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function c5(e,t){return arguments.length>1?this.each((t==null?i5:typeof t=="function"?a5:l5)(e,t)):this.node()[e]}function Rk(e){return e.trim().split(/^|\s+/)}function c0(e){return e.classList||new Tk(e)}function Tk(e){this._node=e,this._names=Rk(e.getAttribute("class")||"")}Tk.prototype={add:function(e){var t=this._names.indexOf(e);t<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 Pk(e,t){for(var n=c0(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function Ik(e,t){for(var n=c0(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function u5(e){return function(){Pk(this,e)}}function d5(e){return function(){Ik(this,e)}}function f5(e,t){return function(){(t.apply(this,arguments)?Pk:Ik)(this,e)}}function h5(e,t){var n=Rk(e+"");if(arguments.length<2){for(var r=c0(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?f5:t?u5:d5)(n,t))}function p5(){this.textContent=""}function m5(e){return function(){this.textContent=e}}function g5(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function x5(e){return arguments.length?this.each(e==null?p5:(typeof e=="function"?g5:m5)(e)):this.node().textContent}function y5(){this.innerHTML=""}function v5(e){return function(){this.innerHTML=e}}function w5(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function b5(e){return arguments.length?this.each(e==null?y5:(typeof e=="function"?w5:v5)(e)):this.node().innerHTML}function S5(){this.nextSibling&&this.parentNode.appendChild(this)}function E5(){return this.each(S5)}function k5(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function C5(){return this.each(k5)}function N5(e){var t=typeof e=="function"?e:bk(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function R5(){return null}function T5(e,t){var n=typeof e=="function"?e:bk(e),r=t==null?R5:typeof t=="function"?t:a0(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function P5(){var e=this.parentNode;e&&e.removeChild(this)}function I5(){return this.each(P5)}function j5(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function _5(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function O5(e){return this.select(e?_5:j5)}function M5(e){return arguments.length?this.property("__data__",e):this.node().__data__}function A5(e){return function(t){e.call(this,t,this.__data__)}}function z5(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function D5(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function $5(e,t,n){return function(){var r=this.__on,s,o=A5(t);if(r){for(var i=0,l=r.length;i<l;++i)if((s=r[i]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function F5(e,t,n){var r=z5(e+""),s,o=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,c=l.length,u;a<c;++a)for(s=0,u=l[a];s<o;++s)if((i=r[s]).type===u.type&&i.name===u.name)return u.value}return}for(l=t?$5:D5,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function jk(e,t,n){var r=Nk(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function L5(e,t){return function(){return jk(this,e,t)}}function H5(e,t){return function(){return jk(this,e,t.apply(this,arguments))}}function B5(e,t){return this.each((typeof t=="function"?H5:L5)(e,t))}function*V5(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,i;s<o;++s)(i=r[s])&&(yield i)}var _k=[null];function hn(e,t){this._groups=e,this._parents=t}function Pa(){return new hn([[document.documentElement]],_k)}function W5(){return this}hn.prototype=Pa.prototype={constructor:hn,select:gz,selectAll:wz,selectChild:kz,selectChildren:Tz,filter:Pz,data:Az,enter:Iz,exit:Dz,join:$z,merge:Fz,selection:W5,order:Lz,sort:Hz,call:Vz,nodes:Wz,node:Uz,size:qz,empty:Kz,each:Yz,attr:t5,style:o5,property:c5,classed:h5,text:x5,html:b5,raise:E5,lower:C5,append:N5,insert:T5,remove:I5,clone:O5,datum:M5,on:F5,dispatch:B5,[Symbol.iterator]:V5};function ln(e){return typeof e=="string"?new hn([[document.querySelector(e)]],[document.documentElement]):new hn([[e]],_k)}function U5(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Dn(e,t){if(e=U5(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 s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const q5={passive:!1},ea={capture:!0,passive:!1};function Kf(e){e.stopImmediatePropagation()}function ei(e){e.preventDefault(),e.stopImmediatePropagation()}function Ok(e){var t=e.document.documentElement,n=ln(e).on("dragstart.drag",ei,ea);"onselectstart"in t?n.on("selectstart.drag",ei,ea):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Mk(e,t){var n=e.document.documentElement,r=ln(e).on("dragstart.drag",null);t&&(r.on("click.drag",ei,ea),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const yc=e=>()=>e;function Fp(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,y:l,dx:a,dy:c,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:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}Fp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function K5(e){return!e.ctrlKey&&!e.button}function Y5(){return this.parentNode}function G5(e,t){return t??{x:e.x,y:e.y}}function Q5(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ak(){var e=K5,t=Y5,n=G5,r=Q5,s={},o=Ad("start","drag","end"),i=0,l,a,c,u,d=0;function f(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",b).on("touchmove.drag",g,q5).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,E){if(!(u||!e.call(this,w,E))){var N=x(this,t.call(this,w,E),w,E,"mouse");N&&(ln(w.view).on("mousemove.drag",y,ea).on("mouseup.drag",v,ea),Ok(w.view),Kf(w),c=!1,l=w.clientX,a=w.clientY,N("start",w))}}function y(w){if(ei(w),!c){var E=w.clientX-l,N=w.clientY-a;c=E*E+N*N>d}s.mouse("drag",w)}function v(w){ln(w.view).on("mousemove.drag mouseup.drag",null),Mk(w.view,c),ei(w),s.mouse("end",w)}function b(w,E){if(e.call(this,w,E)){var N=w.changedTouches,k=t.call(this,w,E),C=N.length,P,I;for(P=0;P<C;++P)(I=x(this,k,w,E,N[P].identifier,N[P]))&&(Kf(w),I("start",w,N[P]))}}function g(w){var E=w.changedTouches,N=E.length,k,C;for(k=0;k<N;++k)(C=s[E[k].identifier])&&(ei(w),C("drag",w,E[k]))}function m(w){var E=w.changedTouches,N=E.length,k,C;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),k=0;k<N;++k)(C=s[E[k].identifier])&&(Kf(w),C("end",w,E[k]))}function x(w,E,N,k,C,P){var I=o.copy(),z=Dn(P||N,E),$,A,R;if((R=n.call(w,new Fp("beforestart",{sourceEvent:N,target:f,identifier:C,active:i,x:z[0],y:z[1],dx:0,dy:0,dispatch:I}),k))!=null)return $=R.x-z[0]||0,A=R.y-z[1]||0,function j(_,F,T){var M=z,O;switch(_){case"start":s[C]=j,O=i++;break;case"end":delete s[C],--i;case"drag":z=Dn(T||F,E),O=i;break}I.call(_,w,new Fp(_,{sourceEvent:F,subject:R,target:f,identifier:C,active:O,x:z[0]+$,y:z[1]+A,dx:z[0]-M[0],dy:z[1]-M[1],dispatch:I}),k)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:yc(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:yc(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:yc(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:yc(!!w),f):r},f.on=function(){var w=o.on.apply(o,arguments);return w===o?f:w},f.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,f):Math.sqrt(d)},f}function u0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ia(){}var ta=.7,Bu=1/ta,ti="\\s*([+-]?\\d+)\\s*",na="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",lr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",X5=/^#([0-9a-f]{3,8})$/,Z5=new RegExp(`^rgb\\(${ti},${ti},${ti}\\)$`),J5=new RegExp(`^rgb\\(${lr},${lr},${lr}\\)$`),eD=new RegExp(`^rgba\\(${ti},${ti},${ti},${na}\\)$`),tD=new RegExp(`^rgba\\(${lr},${lr},${lr},${na}\\)$`),nD=new RegExp(`^hsl\\(${na},${lr},${lr}\\)$`),rD=new RegExp(`^hsla\\(${na},${lr},${lr},${na}\\)$`),av={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};u0(Ia,ra,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:cv,formatHex:cv,formatHex8:sD,formatHsl:oD,formatRgb:uv,toString:uv});function cv(){return this.rgb().formatHex()}function sD(){return this.rgb().formatHex8()}function oD(){return Dk(this).formatHsl()}function uv(){return this.rgb().formatRgb()}function ra(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=X5.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?dv(t):n===3?new Qt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vc(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=Z5.exec(e))?new Qt(t[1],t[2],t[3],1):(t=J5.exec(e))?new Qt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=eD.exec(e))?vc(t[1],t[2],t[3],t[4]):(t=tD.exec(e))?vc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nD.exec(e))?pv(t[1],t[2]/100,t[3]/100,1):(t=rD.exec(e))?pv(t[1],t[2]/100,t[3]/100,t[4]):av.hasOwnProperty(e)?dv(av[e]):e==="transparent"?new Qt(NaN,NaN,NaN,0):null}function dv(e){return new Qt(e>>16&255,e>>8&255,e&255,1)}function vc(e,t,n,r){return r<=0&&(e=t=n=NaN),new Qt(e,t,n,r)}function iD(e){return e instanceof Ia||(e=ra(e)),e?(e=e.rgb(),new Qt(e.r,e.g,e.b,e.opacity)):new Qt}function Lp(e,t,n,r){return arguments.length===1?iD(e):new Qt(e,t,n,r??1)}function Qt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}u0(Qt,Lp,zk(Ia,{brighter(e){return e=e==null?Bu:Math.pow(Bu,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ta:Math.pow(ta,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qt(to(this.r),to(this.g),to(this.b),Vu(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:fv,formatHex:fv,formatHex8:lD,formatRgb:hv,toString:hv}));function fv(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}`}function lD(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}${Hs((isNaN(this.opacity)?1:this.opacity)*255)}`}function hv(){const e=Vu(this.opacity);return`${e===1?"rgb(":"rgba("}${to(this.r)}, ${to(this.g)}, ${to(this.b)}${e===1?")":`, ${e})`}`}function Vu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function to(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Hs(e){return e=to(e),(e<16?"0":"")+e.toString(16)}function pv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fn(e,t,n,r)}function Dk(e){if(e instanceof Fn)return new Fn(e.h,e.s,e.l,e.opacity);if(e instanceof Ia||(e=ra(e)),!e)return new Fn;if(e instanceof Fn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),i=NaN,l=o-s,a=(o+s)/2;return l?(t===o?i=(n-r)/l+(n<r)*6:n===o?i=(r-t)/l+2:i=(t-n)/l+4,l/=a<.5?o+s:2-o-s,i*=60):l=a>0&&a<1?0:i,new Fn(i,l,a,e.opacity)}function aD(e,t,n,r){return arguments.length===1?Dk(e):new Fn(e,t,n,r??1)}function Fn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}u0(Fn,aD,zk(Ia,{brighter(e){return e=e==null?Bu:Math.pow(Bu,e),new Fn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ta:Math.pow(ta,e),new Fn(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,s=2*n-r;return new Qt(Yf(e>=240?e-240:e+120,s,r),Yf(e,s,r),Yf(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Fn(mv(this.h),wc(this.s),wc(this.l),Vu(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(){const e=Vu(this.opacity);return`${e===1?"hsl(":"hsla("}${mv(this.h)}, ${wc(this.s)*100}%, ${wc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function mv(e){return e=(e||0)%360,e<0?e+360:e}function wc(e){return Math.max(0,Math.min(1,e||0))}function Yf(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const $k=e=>()=>e;function cD(e,t){return function(n){return e+n*t}}function uD(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function dD(e){return(e=+e)==1?Fk:function(t,n){return n-t?uD(t,n,e):$k(isNaN(t)?n:t)}}function Fk(e,t){var n=t-e;return n?cD(e,n):$k(isNaN(e)?t:e)}const gv=function e(t){var n=dD(t);function r(s,o){var i=n((s=Lp(s)).r,(o=Lp(o)).r),l=n(s.g,o.g),a=n(s.b,o.b),c=Fk(s.opacity,o.opacity);return function(u){return s.r=i(u),s.g=l(u),s.b=a(u),s.opacity=c(u),s+""}}return r.gamma=e,r}(1);function Gr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Hp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gf=new RegExp(Hp.source,"g");function fD(e){return function(){return e}}function hD(e){return function(t){return e(t)+""}}function pD(e,t){var n=Hp.lastIndex=Gf.lastIndex=0,r,s,o,i=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Hp.exec(e))&&(s=Gf.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),l[i]?l[i]+=o:l[++i]=o),(r=r[0])===(s=s[0])?l[i]?l[i]+=s:l[++i]=s:(l[++i]=null,a.push({i,x:Gr(r,s)})),n=Gf.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?a[0]?hD(a[0].x):fD(t):(t=a.length,function(c){for(var u=0,d;u<t;++u)l[(d=a[u]).i]=d.x(c);return l.join("")})}var xv=180/Math.PI,Bp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Lk(e,t,n,r,s,o){var i,l,a;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,i=-i),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*xv,skewX:Math.atan(a)*xv,scaleX:i,scaleY:l}}var bc;function mD(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Bp:Lk(t.a,t.b,t.c,t.d,t.e,t.f)}function gD(e){return e==null||(bc||(bc=document.createElementNS("http://www.w3.org/2000/svg","g")),bc.setAttribute("transform",e),!(e=bc.transform.baseVal.consolidate()))?Bp:(e=e.matrix,Lk(e.a,e.b,e.c,e.d,e.e,e.f))}function Hk(e,t,n,r){function s(c){return c.length?c.pop()+" ":""}function o(c,u,d,f,p,y){if(c!==d||u!==f){var v=p.push("translate(",null,t,null,n);y.push({i:v-4,x:Gr(c,d)},{i:v-2,x:Gr(u,f)})}else(d||f)&&p.push("translate("+d+t+f+n)}function i(c,u,d,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:d.push(s(d)+"rotate(",null,r)-2,x:Gr(c,u)})):u&&d.push(s(d)+"rotate("+u+r)}function l(c,u,d,f){c!==u?f.push({i:d.push(s(d)+"skewX(",null,r)-2,x:Gr(c,u)}):u&&d.push(s(d)+"skewX("+u+r)}function a(c,u,d,f,p,y){if(c!==d||u!==f){var v=p.push(s(p)+"scale(",null,",",null,")");y.push({i:v-4,x:Gr(c,d)},{i:v-2,x:Gr(u,f)})}else(d!==1||f!==1)&&p.push(s(p)+"scale("+d+","+f+")")}return function(c,u){var d=[],f=[];return c=e(c),u=e(u),o(c.translateX,c.translateY,u.translateX,u.translateY,d,f),i(c.rotate,u.rotate,d,f),l(c.skewX,u.skewX,d,f),a(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,f),c=u=null,function(p){for(var y=-1,v=f.length,b;++y<v;)d[(b=f[y]).i]=b.x(p);return d.join("")}}}var xD=Hk(mD,"px, ","px)","deg)"),yD=Hk(gD,", ",")",")"),vD=1e-12;function yv(e){return((e=Math.exp(e))+1/e)/2}function wD(e){return((e=Math.exp(e))-1/e)/2}function bD(e){return((e=Math.exp(2*e))-1)/(e+1)}const SD=function e(t,n,r){function s(o,i){var l=o[0],a=o[1],c=o[2],u=i[0],d=i[1],f=i[2],p=u-l,y=d-a,v=p*p+y*y,b,g;if(v<vD)g=Math.log(f/c)/t,b=function(k){return[l+k*p,a+k*y,c*Math.exp(t*k*g)]};else{var m=Math.sqrt(v),x=(f*f-c*c+r*v)/(2*c*n*m),w=(f*f-c*c-r*v)/(2*f*n*m),E=Math.log(Math.sqrt(x*x+1)-x),N=Math.log(Math.sqrt(w*w+1)-w);g=(N-E)/t,b=function(k){var C=k*g,P=yv(E),I=c/(n*m)*(P*bD(t*C+E)-wD(E));return[l+I*p,a+I*y,c*P/yv(t*C+E)]}}return b.duration=g*1e3*t/Math.SQRT2,b}return s.rho=function(o){var i=Math.max(.001,+o),l=i*i,a=l*l;return e(i,l,a)},s}(Math.SQRT2,2,4);var Oi=0,pl=0,ol=0,Bk=1e3,Wu,ml,Uu=0,ho=0,Dd=0,sa=typeof performance=="object"&&performance.now?performance:Date,Vk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function d0(){return ho||(Vk(ED),ho=sa.now()+Dd)}function ED(){ho=0}function qu(){this._call=this._time=this._next=null}qu.prototype=Wk.prototype={constructor:qu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?d0():+n)+(t==null?0:+t),!this._next&&ml!==this&&(ml?ml._next=this:Wu=this,ml=this),this._call=e,this._time=n,Vp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Vp())}};function Wk(e,t,n){var r=new qu;return r.restart(e,t,n),r}function kD(){d0(),++Oi;for(var e=Wu,t;e;)(t=ho-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Oi}function vv(){ho=(Uu=sa.now())+Dd,Oi=pl=0;try{kD()}finally{Oi=0,ND(),ho=0}}function CD(){var e=sa.now(),t=e-Uu;t>Bk&&(Dd-=t,Uu=e)}function ND(){for(var e,t=Wu,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:Wu=n);ml=e,Vp(r)}function Vp(e){if(!Oi){pl&&(pl=clearTimeout(pl));var t=e-ho;t>24?(e<1/0&&(pl=setTimeout(vv,e-sa.now()-Dd)),ol&&(ol=clearInterval(ol))):(ol||(Uu=sa.now(),ol=setInterval(CD,Bk)),Oi=1,Vk(vv))}}function wv(e,t,n){var r=new qu;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var RD=Ad("start","end","cancel","interrupt"),TD=[],Uk=0,bv=1,Wp=2,Wc=3,Sv=4,Up=5,Uc=6;function $d(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;PD(e,n,{name:t,index:r,group:s,on:RD,tween:TD,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Uk})}function f0(e,t){var n=Un(e,t);if(n.state>Uk)throw new Error("too late; already scheduled");return n}function cr(e,t){var n=Un(e,t);if(n.state>Wc)throw new Error("too late; already running");return n}function Un(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function PD(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=Wk(o,0,n.time);function o(c){n.state=bv,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var u,d,f,p;if(n.state!==bv)return a();for(u in r)if(p=r[u],p.name===n.name){if(p.state===Wc)return wv(i);p.state===Sv?(p.state=Uc,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=Uc,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(wv(function(){n.state===Wc&&(n.state=Sv,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Wp,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Wp){for(n.state=Wc,s=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(s[++d]=p);s.length=d+1}}function l(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(a),n.state=Up,1),d=-1,f=s.length;++d<f;)s[d].call(e,u);n.state===Up&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Uc,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function qc(e,t){var n=e.__transition,r,s,o=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){o=!1;continue}s=r.state>Wp&&r.state<Up,r.state=Uc,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function ID(e){return this.each(function(){qc(this,e)})}function jD(e,t){var n,r;return function(){var s=cr(this,e),o=s.tween;if(o!==n){r=n=o;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}s.tween=r}}function _D(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=cr(this,e),i=o.tween;if(i!==r){s=(r=i).slice();for(var l={name:t,value:n},a=0,c=s.length;a<c;++a)if(s[a].name===t){s[a]=l;break}a===c&&s.push(l)}o.tween=s}}function OD(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Un(this.node(),n).tween,s=0,o=r.length,i;s<o;++s)if((i=r[s]).name===e)return i.value;return null}return this.each((t==null?jD:_D)(n,e,t))}function h0(e,t,n){var r=e._id;return e.each(function(){var s=cr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Un(s,r).value[t]}}function qk(e,t){var n;return(typeof t=="number"?Gr:t instanceof ra?gv:(n=ra(t))?(t=n,gv):pD)(e,t)}function MD(e){return function(){this.removeAttribute(e)}}function AD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function zD(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttribute(e);return i===s?null:i===r?o:o=t(r=i,n)}}function DD(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttributeNS(e.space,e.local);return i===s?null:i===r?o:o=t(r=i,n)}}function $D(e,t,n){var r,s,o;return function(){var i,l=n(this),a;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),a=l+"",i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l)))}}function FD(e,t,n){var r,s,o;return function(){var i,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),a=l+"",i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l)))}}function LD(e,t){var n=zd(e),r=n==="transform"?yD:qk;return this.attrTween(e,typeof t=="function"?(n.local?FD:$D)(n,r,h0(this,"attr."+e,t)):t==null?(n.local?AD:MD)(n):(n.local?DD:zD)(n,r,t))}function HD(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function BD(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function VD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&BD(e,o)),n}return s._value=t,s}function WD(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&HD(e,o)),n}return s._value=t,s}function UD(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 new Error;var r=zd(e);return this.tween(n,(r.local?VD:WD)(r,t))}function qD(e,t){return function(){f0(this,e).delay=+t.apply(this,arguments)}}function KD(e,t){return t=+t,function(){f0(this,e).delay=t}}function YD(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qD:KD)(t,e)):Un(this.node(),t).delay}function GD(e,t){return function(){cr(this,e).duration=+t.apply(this,arguments)}}function QD(e,t){return t=+t,function(){cr(this,e).duration=t}}function XD(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?GD:QD)(t,e)):Un(this.node(),t).duration}function ZD(e,t){if(typeof t!="function")throw new Error;return function(){cr(this,e).ease=t}}function JD(e){var t=this._id;return arguments.length?this.each(ZD(t,e)):Un(this.node(),t).ease}function e$(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;cr(this,e).ease=n}}function t$(e){if(typeof e!="function")throw new Error;return this.each(e$(this._id,e))}function n$(e){typeof e!="function"&&(e=Ek(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],a,c=0;c<i;++c)(a=o[c])&&e.call(a,a.__data__,c,o)&&l.push(a);return new zr(r,this._parents,this._name,this._id)}function r$(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),i=new Array(r),l=0;l<o;++l)for(var a=t[l],c=n[l],u=a.length,d=i[l]=new Array(u),f,p=0;p<u;++p)(f=a[p]||c[p])&&(d[p]=f);for(;l<r;++l)i[l]=t[l];return new zr(i,this._parents,this._name,this._id)}function s$(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function o$(e,t,n){var r,s,o=s$(t)?f0:cr;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function i$(e,t){var n=this._id;return arguments.length<2?Un(this.node(),n).on.on(e):this.each(o$(n,e,t))}function l$(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function a$(){return this.on("end.remove",l$(this._id))}function c$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=a0(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var l=r[i],a=l.length,c=o[i]=new Array(a),u,d,f=0;f<a;++f)(u=l[f])&&(d=e.call(u,u.__data__,f,l))&&("__data__"in u&&(d.__data__=u.__data__),c[f]=d,$d(c[f],t,n,f,c,Un(u,n)));return new zr(o,this._parents,t,n)}function u$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Sk(e));for(var r=this._groups,s=r.length,o=[],i=[],l=0;l<s;++l)for(var a=r[l],c=a.length,u,d=0;d<c;++d)if(u=a[d]){for(var f=e.call(u,u.__data__,d,a),p,y=Un(u,n),v=0,b=f.length;v<b;++v)(p=f[v])&&$d(p,t,n,v,f,y);o.push(f),i.push(u)}return new zr(o,i,t,n)}var d$=Pa.prototype.constructor;function f$(){return new d$(this._groups,this._parents)}function h$(e,t){var n,r,s;return function(){var o=_i(this,e),i=(this.style.removeProperty(e),_i(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function Kk(e){return function(){this.style.removeProperty(e)}}function p$(e,t,n){var r,s=n+"",o;return function(){var i=_i(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function m$(e,t,n){var r,s,o;return function(){var i=_i(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),_i(this,e))),i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l))}}function g$(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var a=cr(this,e),c=a.on,u=a.value[o]==null?l||(l=Kk(t)):void 0;(c!==n||s!==u)&&(r=(n=c).copy()).on(i,s=u),a.on=r}}function x$(e,t,n){var r=(e+="")=="transform"?xD:qk;return t==null?this.styleTween(e,h$(e,r)).on("end.style."+e,Kk(e)):typeof t=="function"?this.styleTween(e,m$(e,r,h0(this,"style."+e,t))).each(g$(this._id,e)):this.styleTween(e,p$(e,r,t),n).on("end.style."+e,null)}function y$(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function v$(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&y$(e,i,n)),r}return o._value=t,o}function w$(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 new Error;return this.tween(r,v$(e,t,n??""))}function b$(e){return function(){this.textContent=e}}function S$(e){return function(){var t=e(this);this.textContent=t??""}}function E$(e){return this.tween("text",typeof e=="function"?S$(h0(this,"text",e)):b$(e==null?"":e+""))}function k$(e){return function(t){this.textContent=e.call(this,t)}}function C$(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&k$(s)),t}return r._value=e,r}function N$(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 new Error;return this.tween(t,C$(e))}function R$(){for(var e=this._name,t=this._id,n=Yk(),r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,a,c=0;c<l;++c)if(a=i[c]){var u=Un(a,t);$d(a,e,n,c,i,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new zr(r,this._parents,e,n)}function T$(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,i){var l={value:i},a={value:function(){--s===0&&o()}};n.each(function(){var c=cr(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),c.on=t}),s===0&&o()})}var P$=0;function zr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Yk(){return++P$}var fr=Pa.prototype;zr.prototype={constructor:zr,select:c$,selectAll:u$,selectChild:fr.selectChild,selectChildren:fr.selectChildren,filter:n$,merge:r$,selection:f$,transition:R$,call:fr.call,nodes:fr.nodes,node:fr.node,size:fr.size,empty:fr.empty,each:fr.each,on:i$,attr:LD,attrTween:UD,style:x$,styleTween:w$,text:E$,textTween:N$,remove:a$,tween:OD,delay:YD,duration:XD,ease:JD,easeVarying:t$,end:T$,[Symbol.iterator]:fr[Symbol.iterator]};function I$(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var j$={time:null,delay:0,duration:250,ease:I$};function _$(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function O$(e){var t,n;e instanceof zr?(t=e._id,e=e._name):(t=Yk(),(n=j$).time=d0(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,a,c=0;c<l;++c)(a=i[c])&&$d(a,e,t,c,i,n||_$(a,t));return new zr(r,this._parents,e,t)}Pa.prototype.interrupt=ID;Pa.prototype.transition=O$;const Sc=e=>()=>e;function M$(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){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:s}})}function kr(e,t,n){this.k=e,this.x=t,this.y=n}kr.prototype={constructor:kr,scale:function(e){return e===1?this:new kr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new kr(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 Fd=new kr(1,0,0);Gk.prototype=kr.prototype;function Gk(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fd;return e.__zoom}function Qf(e){e.stopImmediatePropagation()}function il(e){e.preventDefault(),e.stopImmediatePropagation()}function A$(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function z$(){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 Ev(){return this.__zoom||Fd}function D$(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function $$(){return navigator.maxTouchPoints||"ontouchstart"in this}function F$(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i))}function Qk(){var e=A$,t=z$,n=F$,r=D$,s=$$,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,a=SD,c=Ad("start","zoom","end"),u,d,f,p=500,y=150,v=0,b=10;function g(R){R.property("__zoom",Ev).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",z).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(R,j,_,F){var T=R.selection?R.selection():R;T.property("__zoom",Ev),R!==T?E(R,j,_,F):T.interrupt().each(function(){N(this,arguments).event(F).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},g.scaleBy=function(R,j,_,F){g.scaleTo(R,function(){var T=this.__zoom.k,M=typeof j=="function"?j.apply(this,arguments):j;return T*M},_,F)},g.scaleTo=function(R,j,_,F){g.transform(R,function(){var T=t.apply(this,arguments),M=this.__zoom,O=_==null?w(T):typeof _=="function"?_.apply(this,arguments):_,U=M.invert(O),L=typeof j=="function"?j.apply(this,arguments):j;return n(x(m(M,L),O,U),T,i)},_,F)},g.translateBy=function(R,j,_,F){g.transform(R,function(){return n(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),i)},null,F)},g.translateTo=function(R,j,_,F,T){g.transform(R,function(){var M=t.apply(this,arguments),O=this.__zoom,U=F==null?w(M):typeof F=="function"?F.apply(this,arguments):F;return n(Fd.translate(U[0],U[1]).scale(O.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof _=="function"?-_.apply(this,arguments):-_),M,i)},F,T)};function m(R,j){return j=Math.max(o[0],Math.min(o[1],j)),j===R.k?R:new kr(j,R.x,R.y)}function x(R,j,_){var F=j[0]-_[0]*R.k,T=j[1]-_[1]*R.k;return F===R.x&&T===R.y?R:new kr(R.k,F,T)}function w(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function E(R,j,_,F){R.on("start.zoom",function(){N(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(F).end()}).tween("zoom",function(){var T=this,M=arguments,O=N(T,M).event(F),U=t.apply(T,M),L=_==null?w(U):typeof _=="function"?_.apply(T,M):_,K=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),W=T.__zoom,q=typeof j=="function"?j.apply(T,M):j,H=a(W.invert(L).concat(K/W.k),q.invert(L).concat(K/q.k));return function(G){if(G===1)G=q;else{var B=H(G),Y=K/B[2];G=new kr(Y,L[0]-B[0]*Y,L[1]-B[1]*Y)}O.zoom(null,G)}})}function N(R,j,_){return!_&&R.__zooming||new k(R,j)}function k(R,j){this.that=R,this.args=j,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,j),this.taps=0}k.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,j){return this.mouse&&R!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var j=ln(this.that).datum();c.call(R,this.that,new M$(R,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),j)}};function C(R,...j){if(!e.apply(this,arguments))return;var _=N(this,j).event(R),F=this.__zoom,T=Math.max(o[0],Math.min(o[1],F.k*Math.pow(2,r.apply(this,arguments)))),M=Dn(R);if(_.wheel)(_.mouse[0][0]!==M[0]||_.mouse[0][1]!==M[1])&&(_.mouse[1]=F.invert(_.mouse[0]=M)),clearTimeout(_.wheel);else{if(F.k===T)return;_.mouse=[M,F.invert(M)],qc(this),_.start()}il(R),_.wheel=setTimeout(O,y),_.zoom("mouse",n(x(m(F,T),_.mouse[0],_.mouse[1]),_.extent,i));function O(){_.wheel=null,_.end()}}function P(R,...j){if(f||!e.apply(this,arguments))return;var _=R.currentTarget,F=N(this,j,!0).event(R),T=ln(R.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",K,!0),M=Dn(R,_),O=R.clientX,U=R.clientY;Ok(R.view),Qf(R),F.mouse=[M,this.__zoom.invert(M)],qc(this),F.start();function L(W){if(il(W),!F.moved){var q=W.clientX-O,H=W.clientY-U;F.moved=q*q+H*H>v}F.event(W).zoom("mouse",n(x(F.that.__zoom,F.mouse[0]=Dn(W,_),F.mouse[1]),F.extent,i))}function K(W){T.on("mousemove.zoom mouseup.zoom",null),Mk(W.view,F.moved),il(W),F.event(W).end()}}function I(R,...j){if(e.apply(this,arguments)){var _=this.__zoom,F=Dn(R.changedTouches?R.changedTouches[0]:R,this),T=_.invert(F),M=_.k*(R.shiftKey?.5:2),O=n(x(m(_,M),F,T),t.apply(this,j),i);il(R),l>0?ln(this).transition().duration(l).call(E,O,F,R):ln(this).call(g.transform,O,F,R)}}function z(R,...j){if(e.apply(this,arguments)){var _=R.touches,F=_.length,T=N(this,j,R.changedTouches.length===F).event(R),M,O,U,L;for(Qf(R),O=0;O<F;++O)U=_[O],L=Dn(U,this),L=[L,this.__zoom.invert(L),U.identifier],T.touch0?!T.touch1&&T.touch0[2]!==L[2]&&(T.touch1=L,T.taps=0):(T.touch0=L,M=!0,T.taps=1+!!u);u&&(u=clearTimeout(u)),M&&(T.taps<2&&(d=L[0],u=setTimeout(function(){u=null},p)),qc(this),T.start())}}function $(R,...j){if(this.__zooming){var _=N(this,j).event(R),F=R.changedTouches,T=F.length,M,O,U,L;for(il(R),M=0;M<T;++M)O=F[M],U=Dn(O,this),_.touch0&&_.touch0[2]===O.identifier?_.touch0[0]=U:_.touch1&&_.touch1[2]===O.identifier&&(_.touch1[0]=U);if(O=_.that.__zoom,_.touch1){var K=_.touch0[0],W=_.touch0[1],q=_.touch1[0],H=_.touch1[1],G=(G=q[0]-K[0])*G+(G=q[1]-K[1])*G,B=(B=H[0]-W[0])*B+(B=H[1]-W[1])*B;O=m(O,Math.sqrt(G/B)),U=[(K[0]+q[0])/2,(K[1]+q[1])/2],L=[(W[0]+H[0])/2,(W[1]+H[1])/2]}else if(_.touch0)U=_.touch0[0],L=_.touch0[1];else return;_.zoom("touch",n(x(O,U,L),_.extent,i))}}function A(R,...j){if(this.__zooming){var _=N(this,j).event(R),F=R.changedTouches,T=F.length,M,O;for(Qf(R),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),M=0;M<T;++M)O=F[M],_.touch0&&_.touch0[2]===O.identifier?delete _.touch0:_.touch1&&_.touch1[2]===O.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(O=Dn(O,this),Math.hypot(d[0]-O[0],d[1]-O[1])<b)){var U=ln(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return g.wheelDelta=function(R){return arguments.length?(r=typeof R=="function"?R:Sc(+R),g):r},g.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Sc(!!R),g):e},g.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Sc(!!R),g):s},g.extent=function(R){return arguments.length?(t=typeof R=="function"?R:Sc([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),g):t},g.scaleExtent=function(R){return arguments.length?(o[0]=+R[0],o[1]=+R[1],g):[o[0],o[1]]},g.translateExtent=function(R){return arguments.length?(i[0][0]=+R[0][0],i[1][0]=+R[1][0],i[0][1]=+R[0][1],i[1][1]=+R[1][1],g):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},g.constrain=function(R){return arguments.length?(n=R,g):n},g.duration=function(R){return arguments.length?(l=+R,g):l},g.interpolate=function(R){return arguments.length?(a=R,g):a},g.on=function(){var R=c.on.apply(c,arguments);return R===c?g:R},g.clickDistance=function(R){return arguments.length?(v=(R=+R)*R,g):Math.sqrt(v)},g.tapDistance=function(R){return arguments.length?(b=+R,g):b},g}const Fr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.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 React Flow 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.`},oa=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Xk=["Enter"," ","Escape"];var Mi;(function(e){e.Strict="strict",e.Loose="loose"})(Mi||(Mi={}));var no;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(no||(no={}));var ia;(function(e){e.Partial="partial",e.Full="full"})(ia||(ia={}));const Zk={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Zr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Zr||(Zr={}));var Ku;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ku||(Ku={}));var de;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(de||(de={}));const kv={[de.Left]:de.Right,[de.Right]:de.Left,[de.Top]:de.Bottom,[de.Bottom]:de.Top};function Jk(e){return e===null?null:e?"valid":"invalid"}const eC=e=>"id"in e&&"source"in e&&"target"in e,L$=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),p0=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ja=(e,t=[0,0])=>{const{width:n,height:r}=Lr(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},H$=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const o=typeof s=="string";let i=!t.nodeLookup&&!o?s:void 0;t.nodeLookup&&(i=o?t.nodeLookup.get(s):p0(s)?s:t.nodeLookup.get(s.id));const l=i?Yu(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ld(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hd(n)},_a=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const s=Yu(r);n=Ld(n,s)}}),Hd(n)},tC=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l={...Oa(t,[n,r,s]),width:t.width/s,height:t.height/s},a=[];for(const c of e.values()){const{measured:u,selectable:d=!0,hidden:f=!1}=c;if(i&&!d||f)continue;const p=u.width??c.width??c.initialWidth??null,y=u.height??c.height??c.initialHeight??null,v=la(l,zi(c)),b=(p??0)*(y??0),g=o&&v>0;(!c.internals.handleBounds||g||v>=b||c.dragging)&&a.push(c)}return a},B$=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function qp(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function Kp({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return Promise.resolve(!1);const l=_a(e),a=m0(l,t,n,(i==null?void 0:i.minZoom)??s,(i==null?void 0:i.maxZoom)??o,(i==null?void 0:i.padding)??.1);return await r.setViewport(a,{duration:i==null?void 0:i.duration}),Promise.resolve(!0)}function nC({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:a,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},u=i.origin??r;let d=s;if(i.extent==="parent"&&!i.expandParent)if(!l)o==null||o("005",Fr.error005());else{const p=l.measured.width,y=l.measured.height;p&&y&&(d=[[a,c],[a+p,c+y]])}else l&&Di(i.extent)&&(d=[[i.extent[0][0]+a,i.extent[0][1]+c],[i.extent[1][0]+a,i.extent[1][1]+c]]);const f=Di(d)?po(t,d,i.measured):t;return{position:{x:f.x-a+i.measured.width*u[0],y:f.y-c+i.measured.height*u[1]},positionAbsolute:f}}async function V$({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(f=>f.id)),i=[];for(const f of n){if(f.deletable===!1)continue;const p=o.has(f.id),y=!p&&f.parentId&&i.find(v=>v.id===f.parentId);(p||y)&&i.push(f)}const l=new Set(t.map(f=>f.id)),a=r.filter(f=>f.deletable!==!1),u=B$(i,a);for(const f of a)l.has(f.id)&&!u.find(y=>y.id===f.id)&&u.push(f);if(!s)return{edges:u,nodes:i};const d=await s({nodes:i,edges:u});return typeof d=="boolean"?d?{edges:u,nodes:i}:{edges:[],nodes:[]}:d}const Ai=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),po=(e={x:0,y:0},t,n)=>({x:Ai(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ai(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function rC(e,t,n){const{width:r,height:s}=Lr(n),{x:o,y:i}=n.internals.positionAbsolute;return po(e,[[o,i],[o+r,i+s]],t)}const Cv=(e,t,n)=>e<t?Ai(Math.abs(e-t),1,t)/t:e>n?-Ai(Math.abs(e-n),1,t)/t:0,sC=(e,t,n=15,r=40)=>{const s=Cv(e.x,r,t.width-r)*n,o=Cv(e.y,r,t.height-r)*n;return[s,o]},Ld=(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)}),Yp=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Hd=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),zi=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=p0(e)?e.internals.positionAbsolute:ja(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Yu=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=p0(e)?e.internals.positionAbsolute:ja(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},oC=(e,t)=>Hd(Ld(Yp(e),Yp(t))),la=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Nv=e=>Ln(e.width)&&Ln(e.height)&&Ln(e.x)&&Ln(e.y),Ln=e=>!isNaN(e)&&isFinite(e),W$=(e,t)=>{},Bd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Oa=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?Bd(l,i):l},iC=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r}),m0=(e,t,n,r,s,o)=>{const i=t/(e.width*(1+o)),l=n/(e.height*(1+o)),a=Math.min(i,l),c=Ai(a,r,s),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*c,p=n/2-d*c;return{x:f,y:p,zoom:c}},Gu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Di(e){return e!==void 0&&e!=="parent"}function Lr(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function lC(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function aC(e,t={width:0,height:0},n,r,s){const o={...e},i=r.get(n);if(i){const l=i.origin||s;o.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function Pl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Tr(e),l=Oa({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:a,y:c}=n?Bd(l,t):l;return{xSnapped:a,ySnapped:c,...l}}const Vd=e=>({width:e.offsetWidth,height:e.offsetHeight}),cC=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},U$=["INPUT","SELECT","TEXTAREA"];function Gp(e){var r,s,o;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return U$.includes(t==null?void 0:t.nodeName)||((o=t==null?void 0:t.hasAttribute)==null?void 0:o.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const uC=e=>"clientX"in e,Tr=(e,t)=>{var o,i;const n=uC(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},Rv=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(i=>{const l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:s,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Vd(i)}})};function dC({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:l}){const a=e*.125+s*.375+i*.375+n*.125,c=t*.125+o*.375+l*.375+r*.125,u=Math.abs(a-e),d=Math.abs(c-t);return[a,c,u,d]}function Ec(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Tv({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case de.Left:return[t-Ec(t-r,o),n];case de.Right:return[t+Ec(r-t,o),n];case de.Top:return[t,n-Ec(n-s,o)];case de.Bottom:return[t,n+Ec(s-n,o)]}}function fC({sourceX:e,sourceY:t,sourcePosition:n=de.Bottom,targetX:r,targetY:s,targetPosition:o=de.Top,curvature:i=.25}){const[l,a]=Tv({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,u]=Tv({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[d,f,p,y]=dC({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:u});return[`M${e},${t} C${l},${a} ${c},${u} ${r},${s}`,d,f,p,y]}function hC({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,i=Math.abs(r-t)/2,l=r<t?r+i:r-i;return[o,l,s,i]}function q$({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1}){if(!s)return r;const o=n||t.selected||e.selected,i=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(o?i:0)}function K$({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=Ld(Yu(e),Yu(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const i={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return la(i,Hd(o))>0}const Y$=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,G$=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Q$=(e,t)=>{if(!e.source||!e.target)return t;let n;return eC(e)?n={...e}:n={...e,id:Y$(e)},G$(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function pC({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=hC({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const Pv={[de.Left]:{x:-1,y:0},[de.Right]:{x:1,y:0},[de.Top]:{x:0,y:-1},[de.Bottom]:{x:0,y:1}},X$=({source:e,sourcePosition:t=de.Bottom,target:n})=>t===de.Left||t===de.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},Iv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Z$({source:e,sourcePosition:t=de.Bottom,target:n,targetPosition:r=de.Top,center:s,offset:o}){const i=Pv[t],l=Pv[r],a={x:e.x+i.x*o,y:e.y+i.y*o},c={x:n.x+l.x*o,y:n.y+l.y*o},u=X$({source:a,sourcePosition:t,target:c}),d=u.x!==0?"x":"y",f=u[d];let p=[],y,v;const b={x:0,y:0},g={x:0,y:0},[m,x,w,E]=hC({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[d]*l[d]===-1){y=s.x??m,v=s.y??x;const k=[{x:y,y:a.y},{x:y,y:c.y}],C=[{x:a.x,y:v},{x:c.x,y:v}];i[d]===f?p=d==="x"?k:C:p=d==="x"?C:k}else{const k=[{x:a.x,y:c.y}],C=[{x:c.x,y:a.y}];if(d==="x"?p=i.x===f?C:k:p=i.y===f?k:C,t===r){const A=Math.abs(e[d]-n[d]);if(A<=o){const R=Math.min(o-1,o-A);i[d]===f?b[d]=(a[d]>e[d]?-1:1)*R:g[d]=(c[d]>n[d]?-1:1)*R}}if(t!==r){const A=d==="x"?"y":"x",R=i[d]===l[A],j=a[A]>c[A],_=a[A]<c[A];(i[d]===1&&(!R&&j||R&&_)||i[d]!==1&&(!R&&_||R&&j))&&(p=d==="x"?k:C)}const P={x:a.x+b.x,y:a.y+b.y},I={x:c.x+g.x,y:c.y+g.y},z=Math.max(Math.abs(P.x-p[0].x),Math.abs(I.x-p[0].x)),$=Math.max(Math.abs(P.y-p[0].y),Math.abs(I.y-p[0].y));z>=$?(y=(P.x+I.x)/2,v=p[0].y):(y=p[0].x,v=(P.y+I.y)/2)}return[[e,{x:a.x+b.x,y:a.y+b.y},...p,{x:c.x+g.x,y:c.y+g.y},n],y,v,w,E]}function J$(e,t,n,r){const s=Math.min(Iv(e,t)/2,Iv(t,n)/2,r),{x:o,y:i}=t;if(e.x===o&&o===n.x||e.y===i&&i===n.y)return`L${o} ${i}`;if(e.y===i){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${o+s*c},${i}Q ${o},${i} ${o},${i+s*u}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${o},${i+s*a}Q ${o},${i} ${o+s*l},${i}`}function Qp({sourceX:e,sourceY:t,sourcePosition:n=de.Bottom,targetX:r,targetY:s,targetPosition:o=de.Top,borderRadius:i=5,centerX:l,centerY:a,offset:c=20}){const[u,d,f,p,y]=Z$({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:l,y:a},offset:c});return[u.reduce((b,g,m)=>{let x="";return m>0&&m<u.length-1?x=J$(u[m-1],g,u[m+1],i):x=`${m===0?"M":"L"}${g.x} ${g.y}`,b+=x,b},""),d,f,p,y]}function jv(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function eF(e){var d;const{sourceNode:t,targetNode:n}=e;if(!jv(t)||!jv(n))return null;const r=t.internals.handleBounds||_v(t.handles),s=n.internals.handleBounds||_v(n.handles),o=Ov((r==null?void 0:r.source)??[],e.sourceHandle),i=Ov(e.connectionMode===Mi.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!i)return(d=e.onError)==null||d.call(e,"008",Fr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||de.Bottom,a=(i==null?void 0:i.position)||de.Top,c=aa(t,o,l),u=aa(n,i,a);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:l,targetPosition:a}}function _v(e){if(!e)return null;const t=[],n=[];for(const 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 aa(e,t,n=de.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??Lr(e);if(r)return{x:s+i/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case de.Top:return{x:s+i/2,y:o};case de.Right:return{x:s+i,y:o+l/2};case de.Bottom:return{x:s+i/2,y:o+l};case de.Left:return{x:s,y:o+l/2}}}function Ov(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Xp(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function tF(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((i,l)=>([l.markerStart||r,l.markerEnd||s].forEach(a=>{if(a&&typeof a=="object"){const c=Xp(a,t);o.has(c)||(i.push({id:c,color:a.color||n,...a}),o.add(c))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const g0={nodeOrigin:[0,0],nodeExtent:oa,elevateNodesOnSelect:!0,defaults:{}},nF={...g0,checkEquality:!0};function x0(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function rF(e,t,n){const r=x0(g0,n);for(const s of e.values())if(s.parentId)y0(s,e,t,r);else{const o=ja(s,r.nodeOrigin),i=Di(s.extent)?s.extent:r.nodeExtent,l=po(o,i,Lr(s));s.internals.positionAbsolute=l}}function Zp(e,t,n,r){var l,a;const s=x0(nF,r),o=new Map(t),i=s!=null&&s.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let u=o.get(c.id);if(s.checkEquality&&c===(u==null?void 0:u.internals.userNode))t.set(c.id,u);else{const d=ja(c,s.nodeOrigin),f=Di(c.extent)?c.extent:s.nodeExtent,p=po(d,f,Lr(c));u={...s.defaults,...c,measured:{width:(l=c.measured)==null?void 0:l.width,height:(a=c.measured)==null?void 0:a.height},internals:{positionAbsolute:p,handleBounds:c.measured?u==null?void 0:u.internals.handleBounds:void 0,z:mC(c,i),userNode:c}},t.set(c.id,u)}c.parentId&&y0(u,t,n,r)}}function sF(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function y0(e,t,n,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:i}=x0(g0,r),l=e.parentId,a=t.get(l);if(!a){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}sF(e,n);const c=s?1e3:0,{x:u,y:d,z:f}=oF(e,a,o,i,c),{positionAbsolute:p}=e.internals,y=u!==p.x||d!==p.y;(y||f!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:y?{x:u,y:d}:p,z:f})}function mC(e,t){return(Ln(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function oF(e,t,n,r,s){const{x:o,y:i}=t.internals.positionAbsolute,l=Lr(e),a=ja(e,n),c=Di(e.extent)?po(a,e.extent,l):a;let u=po({x:o+c.x,y:i+c.y},r,l);e.extent==="parent"&&(u=rC(u,l,t));const d=mC(e,s),f=t.internals.z??0;return{x:u.x,y:u.y,z:f>d?f:d}}function v0(e,t,n,r=[0,0]){var i;const s=[],o=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const c=((i=o.get(l.parentId))==null?void 0:i.expandedRect)??zi(a),u=oC(c,l.rect);o.set(l.parentId,{expandedRect:u,parent:a})}return o.size>0&&o.forEach(({expandedRect:l,parent:a},c)=>{var x;const u=a.internals.positionAbsolute,d=Lr(a),f=a.origin??r,p=l.x<u.x?Math.round(Math.abs(u.x-l.x)):0,y=l.y<u.y?Math.round(Math.abs(u.y-l.y)):0,v=Math.max(d.width,Math.round(l.width)),b=Math.max(d.height,Math.round(l.height)),g=(v-d.width)*f[0],m=(b-d.height)*f[1];(p>0||y>0||g||m)&&(s.push({id:c,type:"position",position:{x:a.position.x-p+g,y:a.position.y-y+m}}),(x=n.get(c))==null||x.forEach(w=>{e.some(E=>E.id===w.id)||s.push({id:w.id,type:"position",position:{x:w.position.x+p,y:w.position.y+y}})})),(d.width<l.width||d.height<l.height||p||y)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:v+(p?f[0]*p-g:0),height:b+(y?f[1]*y-m:0)}})}),s}function iF(e,t,n,r,s,o){const i=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!i)return{changes:[],updatedInternals:l};const a=[],c=window.getComputedStyle(i),{m22:u}=new window.DOMMatrixReadOnly(c.transform),d=[];for(const f of e.values()){const p=t.get(f.id);if(p)if(p.hidden)p.internals={...p.internals,handleBounds:void 0},l=!0;else{const y=Vd(f.nodeElement),v=p.measured.width!==y.width||p.measured.height!==y.height;if(!!(y.width&&y.height&&(v||!p.internals.handleBounds||f.force))){const g=f.nodeElement.getBoundingClientRect(),m=Di(p.extent)?p.extent:o;let{positionAbsolute:x}=p.internals;p.parentId&&p.extent==="parent"?x=rC(x,y,t.get(p.parentId)):m&&(x=po(x,m,y)),p.measured=y,p.internals={...p.internals,positionAbsolute:x,handleBounds:{source:Rv("source",f.nodeElement,g,u,p.id),target:Rv("target",f.nodeElement,g,u,p.id)}},p.parentId&&y0(p,t,n,{nodeOrigin:s}),l=!0,v&&(a.push({id:p.id,type:"dimensions",dimensions:y}),p.expandParent&&p.parentId&&d.push({id:p.id,parentId:p.parentId,rect:zi(p,s)}))}}}if(d.length>0){const f=v0(d,t,n,s);a.push(...f)}return{changes:a,updatedInternals:l}}async function lF({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r),l=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(l)}function gC(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:i=null,targetHandle:l=null}=r,a=`${s}-source-${i}`,c=`${o}-target-${l}`,u=e.get(a)||new Map,d=e.get(c)||new Map,f={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l};t.set(r.id,r),e.set(a,u.set(`${o}-${l}`,f)),e.set(c,d.set(`${s}-${i}`,f))}}function xC(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:xC(n,t):!1}function Mv(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function aF(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!xC(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const l=e.get(o);l&&s.set(o,{id:o,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function Xf({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,a;const s=[];for(const[c,u]of t){const d=(i=n.get(c))==null?void 0:i.internals.userNode;d&&s.push({...d,position:u.position,dragging:r})}if(!e)return[s[0],s];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((a=t.get(e))==null?void 0:a.position)||o.position,dragging:r}:s[0],s]}function cF({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},i=0,l=new Map,a=!1,c={x:0,y:0},u=null,d=!1,f=null,p=!1;function y({noDragClassName:b,handleSelector:g,domNode:m,isSelectable:x,nodeId:w,nodeClickDistance:E=0}){f=ln(m);function N({x:I,y:z},$){const{nodeLookup:A,nodeExtent:R,snapGrid:j,snapToGrid:_,nodeOrigin:F,onNodeDrag:T,onSelectionDrag:M,onError:O,updateNodePositions:U}=t();o={x:I,y:z};let L=!1,K={x:0,y:0,x2:0,y2:0};if(l.size>1&&R){const W=_a(l);K=Yp(W)}for(const[W,q]of l){if(!A.has(W))continue;let H={x:I-q.distance.x,y:z-q.distance.y};_&&(H=Bd(H,j));let G=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(l.size>1&&R&&!q.extent){const{positionAbsolute:Q}=q.internals,Z=Q.x-K.x+R[0][0],V=Q.x+q.measured.width-K.x2+R[1][0],X=Q.y-K.y+R[0][1],ee=Q.y+q.measured.height-K.y2+R[1][1];G=[[Z,X],[V,ee]]}const{position:B,positionAbsolute:Y}=nC({nodeId:W,nextPosition:H,nodeLookup:A,nodeExtent:G,nodeOrigin:F,onError:O});L=L||q.position.x!==B.x||q.position.y!==B.y,q.position=B,q.internals.positionAbsolute=Y}if(L&&(U(l,!0),$&&(r||T||!w&&M))){const[W,q]=Xf({nodeId:w,dragItems:l,nodeLookup:A});r==null||r($,l,W,q),T==null||T($,W,q),w||M==null||M($,q)}}async function k(){if(!u)return;const{transform:I,panBy:z,autoPanSpeed:$}=t(),[A,R]=sC(c,u,$);(A!==0||R!==0)&&(o.x=(o.x??0)-A/I[2],o.y=(o.y??0)-R/I[2],await z({x:A,y:R})&&N(o,null)),i=requestAnimationFrame(k)}function C(I){var L;const{nodeLookup:z,multiSelectionActive:$,nodesDraggable:A,transform:R,snapGrid:j,snapToGrid:_,selectNodesOnDrag:F,onNodeDragStart:T,onSelectionDragStart:M,unselectNodesAndEdges:O}=t();d=!0,(!F||!x)&&!$&&w&&((L=z.get(w))!=null&&L.selected||O()),x&&F&&w&&(e==null||e(w));const U=Pl(I.sourceEvent,{transform:R,snapGrid:j,snapToGrid:_,containerBounds:u});if(o=U,l=aF(z,A,U,w),l.size>0&&(n||T||!w&&M)){const[K,W]=Xf({nodeId:w,dragItems:l,nodeLookup:z});n==null||n(I.sourceEvent,l,K,W),T==null||T(I.sourceEvent,K,W),w||M==null||M(I.sourceEvent,W)}}const P=Ak().clickDistance(E).on("start",I=>{const{domNode:z,nodeDragThreshold:$,transform:A,snapGrid:R,snapToGrid:j}=t();u=(z==null?void 0:z.getBoundingClientRect())||null,p=!1,$===0&&C(I),o=Pl(I.sourceEvent,{transform:A,snapGrid:R,snapToGrid:j,containerBounds:u}),c=Tr(I.sourceEvent,u)}).on("drag",I=>{const{autoPanOnNodeDrag:z,transform:$,snapGrid:A,snapToGrid:R,nodeDragThreshold:j,nodeLookup:_}=t(),F=Pl(I.sourceEvent,{transform:$,snapGrid:A,snapToGrid:R,containerBounds:u});if((I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||w&&!_.has(w))&&(p=!0),!p){if(!a&&z&&d&&(a=!0,k()),!d){const T=F.xSnapped-(o.x??0),M=F.ySnapped-(o.y??0);Math.sqrt(T*T+M*M)>j&&C(I)}(o.x!==F.xSnapped||o.y!==F.ySnapped)&&l&&d&&(c=Tr(I.sourceEvent,u),N(F,I.sourceEvent))}}).on("end",I=>{if(!(!d||p)&&(a=!1,d=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:z,updateNodePositions:$,onNodeDragStop:A,onSelectionDragStop:R}=t();if($(l,!1),s||A||!w&&R){const[j,_]=Xf({nodeId:w,dragItems:l,nodeLookup:z,dragging:!1});s==null||s(I.sourceEvent,l,j,_),A==null||A(I.sourceEvent,j,_),w||R==null||R(I.sourceEvent,_)}}}).filter(I=>{const z=I.target;return!I.button&&(!b||!Mv(z,`.${b}`,m))&&(!g||Mv(z,g,m))});f.call(P)}function v(){f==null||f.on(".drag",null)}return{update:y,destroy:v}}function uF(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())la(s,zi(o))>0&&r.push(o);return r}const dF=250;function fF(e,t,n,r){var l,a;let s=[],o=1/0;const i=uF(e,n,t+dF);for(const c of i){const u=[...((l=c.internals.handleBounds)==null?void 0:l.source)??[],...((a=c.internals.handleBounds)==null?void 0:a.target)??[]];for(const d of u){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:p}=aa(c,d,d.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(p-e.y,2));y>t||(y<o?(s=[{...d,x:f,y:p}],o=y):y===o&&s.push({...d,x:f,y:p}))}}if(!s.length)return null;if(s.length>1){const c=r.type==="source"?"target":"source";return s.find(u=>u.type===c)??s[0]}return s[0]}function yC(e,t,n,r,s,o=!1){var c,u,d;const i=r.get(e);if(!i)return null;const l=s==="strict"?(c=i.internals.handleBounds)==null?void 0:c[t]:[...((u=i.internals.handleBounds)==null?void 0:u.source)??[],...((d=i.internals.handleBounds)==null?void 0:d.target)??[]],a=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return a&&o?{...a,...aa(i,a,a.position,!0)}:a}function vC(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function hF(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const wC=()=>!0;function pF(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:a,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:y,onConnect:v,onConnectEnd:b,isValidConnection:g=wC,onReconnectEnd:m,updateConnection:x,getTransform:w,getFromHandle:E,autoPanSpeed:N}){const k=cC(e.target);let C=0,P;const{x:I,y:z}=Tr(e),$=k==null?void 0:k.elementFromPoint(I,z),A=vC(o,$),R=l==null?void 0:l.getBoundingClientRect();if(!R||!A)return;const j=yC(s,A,r,a,t);if(!j)return;let _=Tr(e,R),F=!1,T=null,M=!1,O=null;function U(){if(!u||!R)return;const[Y,Q]=sC(_,R,N);f({x:Y,y:Q}),C=requestAnimationFrame(U)}const L={...j,nodeId:s,type:A,position:j.position},K=a.get(s),q={inProgress:!0,isValid:null,from:aa(K,L,de.Left,!0),fromHandle:L,fromPosition:L.position,fromNode:K,to:_,toHandle:null,toPosition:kv[L.position],toNode:null};x(q);let H=q;y==null||y(e,{nodeId:s,handleId:r,handleType:A});function G(Y){if(!E()||!L){B(Y);return}const Q=w();_=Tr(Y,R),P=fF(Oa(_,Q,!1,[1,1]),n,a,L),F||(U(),F=!0);const Z=bC(Y,{handle:P,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:g,doc:k,lib:c,flowId:d,nodeLookup:a});O=Z.handleDomNode,T=Z.connection,M=hF(!!P,Z.isValid);const V={...H,isValid:M,to:P&&M?iC({x:P.x,y:P.y},Q):_,toHandle:Z.toHandle,toPosition:M&&Z.toHandle?Z.toHandle.position:kv[L.position],toNode:Z.toHandle?a.get(Z.toHandle.nodeId):null};M&&P&&H.toHandle&&V.toHandle&&H.toHandle.type===V.toHandle.type&&H.toHandle.nodeId===V.toHandle.nodeId&&H.toHandle.id===V.toHandle.id&&H.to.x===V.to.x&&H.to.y===V.to.y||(x(V),H=V)}function B(Y){(P||O)&&T&&M&&(v==null||v(T));const{inProgress:Q,...Z}=H,V={...Z,toPosition:H.toHandle?H.toPosition:null};b==null||b(Y,V),o&&(m==null||m(Y,V)),p(),cancelAnimationFrame(C),F=!1,M=!1,T=null,O=null,k.removeEventListener("mousemove",G),k.removeEventListener("mouseup",B),k.removeEventListener("touchmove",G),k.removeEventListener("touchend",B)}k.addEventListener("mousemove",G),k.addEventListener("mouseup",B),k.addEventListener("touchmove",G),k.addEventListener("touchend",B)}function bC(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:a,isValidConnection:c=wC,nodeLookup:u}){const d=o==="target",f=t?i.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y}=Tr(e),v=i.elementFromPoint(p,y),b=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,g={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const m=vC(void 0,b),x=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),E=b.classList.contains("connectable"),N=b.classList.contains("connectableend");if(!x||!m)return g;const k={source:d?x:r,sourceHandle:d?w:s,target:d?r:x,targetHandle:d?s:w};g.connection=k;const P=E&&N&&(n===Mi.Strict?d&&m==="source"||!d&&m==="target":x!==r||w!==s);g.isValid=P&&c(k),g.toHandle=yC(x,m,w,u,n,!1)}return g}const Jp={onPointerDown:pF,isValid:bC};function mF({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=ln(e);function o({translateExtent:l,width:a,height:c,zoomStep:u=10,pannable:d=!0,zoomable:f=!0,inversePan:p=!1}){const y=x=>{const w=n();if(x.sourceEvent.type!=="wheel"||!t)return;const E=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*u,N=w[2]*Math.pow(2,E);t.scaleTo(N)};let v=[0,0];const b=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(v=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},g=x=>{const w=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const E=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],N=[E[0]-v[0],E[1]-v[1]];v=E;const k=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),C={x:w[0]-N[0]*k,y:w[1]-N[1]*k},P=[[0,0],[a,c]];t.setViewportConstrained({x:C.x,y:C.y,zoom:w[2]},P,l)},m=Qk().on("start",b).on("zoom",d?g:null).on("zoom.wheel",f?y:null);s.call(m,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:Dn}}const gF=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Wd=e=>({x:e.x,y:e.y,zoom:e.k}),Zf=({x:e,y:t,zoom:n})=>Fd.translate(e,t).scale(n),Wo=(e,t)=>e.target.closest(`.${t}`),SC=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Jf=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},EC=e=>{const t=e.ctrlKey&&Gu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function xF({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}){return u=>{if(Wo(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&i){const b=Dn(u),g=EC(u),m=d*Math.pow(2,g);r.scaleTo(n,m,b,u);return}const f=u.deltaMode===1?20:1;let p=s===no.Vertical?0:u.deltaX*f,y=s===no.Horizontal?0:u.deltaY*f;!Gu()&&u.shiftKey&&s!==no.Vertical&&(p=u.deltaY*f,y=0),r.translateBy(n,-(p/d)*o,-(y/d)*o,{internal:!0});const v=Wd(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(u,v)),e.isPanScrolling&&(a==null||a(u,v),e.panScrollTimeout=setTimeout(()=>{c==null||c(u,v),e.isPanScrolling=!1},150))}}function yF({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){if(!t&&r.type==="wheel"&&!r.ctrlKey||Wo(r,e))return null;r.preventDefault(),n.call(this,r,s)}}function vF({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Wd(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function wF({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&SC(t,e.mouseButton??0)),(i=o.sourceEvent)!=null&&i.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((l=o.sourceEvent)!=null&&l.internal)&&(s==null||s(o.sourceEvent,Wd(o.transform)))}}function bF({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return i=>{var l;if(!((l=i.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&SC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s&&gF(e.prevViewport,i.transform))){const a=Wd(i.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,a)},n?150:0)}}}function SF({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:i,noWheelClassName:l,noPanClassName:a,lib:c}){return u=>{var y;const d=e||t,f=n&&u.ctrlKey;if(u.button===1&&u.type==="mousedown"&&(Wo(u,`${c}-flow__node`)||Wo(u,`${c}-flow__edge`)))return!0;if(!r&&!d&&!s&&!o&&!n||i||Wo(u,l)&&u.type==="wheel"||Wo(u,a)&&(u.type!=="wheel"||s&&u.type==="wheel"&&!e)||!n&&u.ctrlKey&&u.type==="wheel")return!1;if(!n&&u.type==="touchstart"&&((y=u.touches)==null?void 0:y.length)>1)return u.preventDefault(),!1;if(!d&&!s&&!f&&u.type==="wheel"||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const p=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type==="wheel")&&p}}function EF({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:s,viewport:o,onPanZoom:i,onPanZoomStart:l,onPanZoomEnd:a,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=Qk().clickDistance(!Ln(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(s),p=ln(e).call(f);x({x:o.x,y:o.y,zoom:Ai(o.zoom,t,n)},[[0,0],[d.width,d.height]],s);const y=p.on("wheel.zoom"),v=p.on("dblclick.zoom");f.wheelDelta(EC);function b($,A){return p?new Promise(R=>{f==null||f.transform(Jf(p,A==null?void 0:A.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function g({noWheelClassName:$,noPanClassName:A,onPaneContextMenu:R,userSelectionActive:j,panOnScroll:_,panOnDrag:F,panOnScrollMode:T,panOnScrollSpeed:M,preventScrolling:O,zoomOnPinch:U,zoomOnScroll:L,zoomOnDoubleClick:K,zoomActivationKeyPressed:W,lib:q,onTransformChange:H}){j&&!u.isZoomingOrPanning&&m();const B=_&&!W&&!j?xF({zoomPanValues:u,noWheelClassName:$,d3Selection:p,d3Zoom:f,panOnScrollMode:T,panOnScrollSpeed:M,zoomOnPinch:U,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:a}):yF({noWheelClassName:$,preventScrolling:O,d3ZoomHandler:y});if(p.on("wheel.zoom",B,{passive:!1}),!j){const Q=vF({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:l});f.on("start",Q);const Z=wF({zoomPanValues:u,panOnDrag:F,onPaneContextMenu:!!R,onPanZoom:i,onTransformChange:H});f.on("zoom",Z);const V=bF({zoomPanValues:u,panOnDrag:F,panOnScroll:_,onPaneContextMenu:R,onPanZoomEnd:a,onDraggingChange:c});f.on("end",V)}const Y=SF({zoomActivationKeyPressed:W,panOnDrag:F,zoomOnScroll:L,panOnScroll:_,zoomOnDoubleClick:K,zoomOnPinch:U,userSelectionActive:j,noPanClassName:A,noWheelClassName:$,lib:q});f.filter(Y),K?p.on("dblclick.zoom",v):p.on("dblclick.zoom",null)}function m(){f.on("zoom",null)}async function x($,A,R){const j=Zf($),_=f==null?void 0:f.constrain()(j,A,R);return _&&await b(_),new Promise(F=>F(_))}async function w($,A){const R=Zf($);return await b(R,A),new Promise(j=>j(R))}function E($){if(p){const A=Zf($),R=p.property("__zoom");(R.k!==$.zoom||R.x!==$.x||R.y!==$.y)&&(f==null||f.transform(p,A,null,{sync:!0}))}}function N(){const $=p?Gk(p.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function k($,A){return p?new Promise(R=>{f==null||f.scaleTo(Jf(p,A==null?void 0:A.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function C($,A){return p?new Promise(R=>{f==null||f.scaleBy(Jf(p,A==null?void 0:A.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function P($){f==null||f.scaleExtent($)}function I($){f==null||f.translateExtent($)}function z($){const A=!Ln($)||$<0?0:$;f==null||f.clickDistance(A)}return{update:g,destroy:m,setViewport:w,setViewportConstrained:x,getViewport:N,scaleTo:k,scaleBy:C,setScaleExtent:P,setTranslateExtent:I,syncViewport:E,setClickDistance:z}}var Il;(function(e){e.Line="line",e.Handle="handle"})(Il||(Il={}));function kF({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const i=e-t,l=n-r,a=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&s&&(a[0]=a[0]*-1),l&&o&&(a[1]=a[1]*-1),a}function CF(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function Wr(e,t){return Math.max(0,t-e)}function Ur(e,t){return Math.max(0,e-t)}function kc(e,t,n){return Math.max(0,t-e,e-n)}function Av(e,t){return e?!t:t}function NF(e,t,n,r,s,o,i,l){let{affectsX:a,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:y}=n,{minWidth:v,maxWidth:b,minHeight:g,maxHeight:m}=r,{x,y:w,width:E,height:N,aspectRatio:k}=e;let C=Math.floor(u?p-e.pointerX:0),P=Math.floor(d?y-e.pointerY:0);const I=E+(a?-C:C),z=N+(c?-P:P),$=-o[0]*E,A=-o[1]*N;let R=kc(I,v,b),j=kc(z,g,m);if(i){let T=0,M=0;a&&C<0?T=Wr(x+C+$,i[0][0]):!a&&C>0&&(T=Ur(x+I+$,i[1][0])),c&&P<0?M=Wr(w+P+A,i[0][1]):!c&&P>0&&(M=Ur(w+z+A,i[1][1])),R=Math.max(R,T),j=Math.max(j,M)}if(l){let T=0,M=0;a&&C>0?T=Ur(x+C,l[0][0]):!a&&C<0&&(T=Wr(x+I,l[1][0])),c&&P>0?M=Ur(w+P,l[0][1]):!c&&P<0&&(M=Wr(w+z,l[1][1])),R=Math.max(R,T),j=Math.max(j,M)}if(s){if(u){const T=kc(I/k,g,m)*k;if(R=Math.max(R,T),i){let M=0;!a&&!c||a&&!c&&f?M=Ur(w+A+I/k,i[1][1])*k:M=Wr(w+A+(a?C:-C)/k,i[0][1])*k,R=Math.max(R,M)}if(l){let M=0;!a&&!c||a&&!c&&f?M=Wr(w+I/k,l[1][1])*k:M=Ur(w+(a?C:-C)/k,l[0][1])*k,R=Math.max(R,M)}}if(d){const T=kc(z*k,v,b)/k;if(j=Math.max(j,T),i){let M=0;!a&&!c||c&&!a&&f?M=Ur(x+z*k+$,i[1][0])/k:M=Wr(x+(c?P:-P)*k+$,i[0][0])/k,j=Math.max(j,M)}if(l){let M=0;!a&&!c||c&&!a&&f?M=Wr(x+z*k,l[1][0])/k:M=Ur(x+(c?P:-P)*k,l[0][0])/k,j=Math.max(j,M)}}}P=P+(P<0?j:-j),C=C+(C<0?R:-R),s&&(f?I>z*k?P=(Av(a,c)?-C:C)/k:C=(Av(a,c)?-P:P)*k:u?(P=C/k,c=a):(C=P*k,a=c));const _=a?x+C:x,F=c?w+P:w;return{width:E+(a?-C:C),height:N+(c?-P:P),x:o[0]*C*(a?-1:1)+_,y:o[1]*P*(c?-1:1)+F}}const kC={width:0,height:0,x:0,y:0},RF={...kC,pointerX:0,pointerY:0,aspectRatio:1};function TF(e){return[[0,0],[e.measured.width,e.measured.height]]}function PF(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,i=e.measured.height??0,l=n[0]*o,a=n[1]*i;return[[r-l,s-a],[r+o-l,s+i-a]]}function IF({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=ln(e);function i({controlPosition:a,boundaries:c,keepAspectRatio:u,onResizeStart:d,onResize:f,onResizeEnd:p,shouldResize:y}){let v={...kC},b={...RF};const g=CF(a);let m,x=null,w=[],E,N,k;const C=Ak().on("start",P=>{const{nodeLookup:I,transform:z,snapGrid:$,snapToGrid:A,nodeOrigin:R,paneDomNode:j}=n();if(m=I.get(t),!m)return;x=(j==null?void 0:j.getBoundingClientRect())??null;const{xSnapped:_,ySnapped:F}=Pl(P.sourceEvent,{transform:z,snapGrid:$,snapToGrid:A,containerBounds:x});v={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},b={...v,pointerX:_,pointerY:F,aspectRatio:v.width/v.height},E=void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(E=I.get(m.parentId),N=E&&m.extent==="parent"?TF(E):void 0),w=[],k=void 0;for(const[T,M]of I)if(M.parentId===t&&(w.push({id:T,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const O=PF(M,m,M.origin??R);k?k=[[Math.min(O[0][0],k[0][0]),Math.min(O[0][1],k[0][1])],[Math.max(O[1][0],k[1][0]),Math.max(O[1][1],k[1][1])]]:k=O}d==null||d(P,{...v})}).on("drag",P=>{const{transform:I,snapGrid:z,snapToGrid:$,nodeOrigin:A}=n(),R=Pl(P.sourceEvent,{transform:I,snapGrid:z,snapToGrid:$,containerBounds:x}),j=[];if(!m)return;const{x:_,y:F,width:T,height:M}=v,O={},U=m.origin??A,{width:L,height:K,x:W,y:q}=NF(b,g,R,c,u,U,N,k),H=L!==T,G=K!==M,B=W!==_&&H,Y=q!==F&&G;if(!B&&!Y&&!H&&!G)return;if((B||Y||U[0]===1||U[1]===1)&&(O.x=B?W:v.x,O.y=Y?q:v.y,v.x=O.x,v.y=O.y,w.length>0)){const X=W-_,ee=q-F;for(const he of w)he.position={x:he.position.x-X+U[0]*(L-T),y:he.position.y-ee+U[1]*(K-M)},j.push(he)}if((H||G)&&(O.width=H?L:v.width,O.height=G?K:v.height,v.width=O.width,v.height=O.height),E&&m.expandParent){const X=U[0]*(O.width??0);O.x&&O.x<X&&(v.x=X,b.x=b.x-(O.x-X));const ee=U[1]*(O.height??0);O.y&&O.y<ee&&(v.y=ee,b.y=b.y-(O.y-ee))}const Q=kF({width:v.width,prevWidth:T,height:v.height,prevHeight:M,affectsX:g.affectsX,affectsY:g.affectsY}),Z={...v,direction:Q};(y==null?void 0:y(P,Z))!==!1&&(f==null||f(P,Z),r(O,j))}).on("end",P=>{p==null||p(P,{...v}),s==null||s()});o.call(C)}function l(){o.on(".drag",null)}return{update:i,destroy:l}}const jF={},zv=e=>{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,p))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(jF?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,s,a);return a},_F=e=>e?zv(e):zv,{useDebugValue:OF}=$w,{useSyncExternalStoreWithSelector:MF}=eM,AF=e=>e;function CC(e,t=AF,n){const r=MF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return OF(r),r}const Dv=(e,t)=>{const n=_F(e),r=(s,o=t)=>CC(n,s,o);return Object.assign(r,n),r},zF=(e,t)=>e?Dv(e,t):Dv;function it(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Ud=S.createContext(null),DF=Ud.Provider,NC=Fr.error001();function Oe(e,t){const n=S.useContext(Ud);if(n===null)throw new Error(NC);return CC(n,e,t)}function Ye(){const e=S.useContext(Ud);if(e===null)throw new Error(NC);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const $v={display:"none"},$F={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},RC="react-flow__node-desc",TC="react-flow__edge-desc",FF="react-flow__aria-live",LF=e=>e.ariaLiveMessage;function HF({rfId:e}){const t=Oe(LF);return h.jsx("div",{id:`${FF}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:$F,children:t})}function BF({rfId:e,disableKeyboardA11y:t}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{id:`${RC}-${e}`,style:$v,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),h.jsx("div",{id:`${TC}-${e}`,style:$v,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&h.jsx(HF,{rfId:e})]})}const VF=e=>e.userSelectionActive?"none":"all",w0=S.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=Oe(VF),l=`${e}`.split("-");return h.jsx("div",{className:dt(["react-flow__panel",n,...l]),style:{...r,pointerEvents:i},ref:o,...s,children:t})});function WF({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(w0,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:h.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const UF=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Cc=e=>e.id;function qF(e,t){return it(e.selectedNodes.map(Cc),t.selectedNodes.map(Cc))&&it(e.selectedEdges.map(Cc),t.selectedEdges.map(Cc))}function KF({onSelectionChange:e}){const t=Ye(),{selectedNodes:n,selectedEdges:r}=Oe(UF,qF);return S.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const YF=e=>!!e.onSelectionChangeHandlers;function GF({onSelectionChange:e}){const t=Oe(YF);return e||t?h.jsx(KF,{onSelectionChange:e}):null}const PC=[0,0],QF={x:0,y:0,zoom:1},XF=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","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","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],Fv=[...XF,"rfId"],ZF=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,setPaneClickDistance:e.setPaneClickDistance}),Lv={translateExtent:oa,nodeOrigin:PC,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function JF(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:a,setPaneClickDistance:c}=Oe(ZF,it),u=Ye();S.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{d.current=Lv,l()}),[]);const d=S.useRef(Lv);return S.useEffect(()=>{for(const f of Fv){const p=e[f],y=d.current[f];p!==y&&(typeof e[f]>"u"||(f==="nodes"?t(p):f==="edges"?n(p):f==="minZoom"?r(p):f==="maxZoom"?s(p):f==="translateExtent"?o(p):f==="nodeExtent"?i(p):f==="paneClickDistance"?c(p):f==="fitView"?u.setState({fitViewOnInit:p}):f==="fitViewOptions"?u.setState({fitViewOnInitOptions:p}):u.setState({[f]:p})))}d.current=e},Fv.map(f=>e[f])),null}function Hv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function eL(e){var r;const[t,n]=S.useState(e==="system"?null:e);return S.useEffect(()=>{if(e!=="system"){n(e);return}const s=Hv(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=Hv())!=null&&r.matches?"dark":"light"}const Bv=typeof document<"u"?document:null;function ca(e=null,t={target:Bv,actInsideInputWithModifier:!0}){const[n,r]=S.useState(!1),s=S.useRef(!1),o=S.useRef(new Set([])),[i,l]=S.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
57
- `).replace(`
58
-
59
- `,`
60
- +`).split(`
61
- `)),u=c.reduce((d,f)=>d.concat(...f),[]);return[c,u]}return[[],[]]},[e]);return S.useEffect(()=>{const a=(t==null?void 0:t.target)||Bv;if(e!==null){const c=f=>{if(s.current=f.ctrlKey||f.metaKey||f.shiftKey,(!s.current||s.current&&!t.actInsideInputWithModifier)&&Gp(f))return!1;const y=Wv(f.code,l);o.current.add(f[y]),Vv(i,o.current,!1)&&(f.preventDefault(),r(!0))},u=f=>{if((!s.current||s.current&&!t.actInsideInputWithModifier)&&Gp(f))return!1;const y=Wv(f.code,l);Vv(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(f[y]),f.key==="Meta"&&o.current.clear(),s.current=!1},d=()=>{o.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",u),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",u),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function Vv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function Wv(e,t){return t.includes(e)?"code":"key"}const tL=()=>{const e=Ye();return S.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{const{nodeLookup:n,minZoom:r,maxZoom:s,panZoom:o,domNode:i}=e.getState();if(!o||!i)return Promise.resolve(!1);const l=qp(n,t),{width:a,height:c}=Vd(i);return Kp({nodes:l,width:a,height:c,minZoom:r,maxZoom:s,panZoom:o},t)},setCenter:async(t,n,r)=>{const{width:s,height:o,maxZoom:i,panZoom:l}=e.getState(),a=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:i,c=s/2-t*a,u=o/2-n*a;return l?(await l.setViewport({x:c,y:u,zoom:a},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:i,panZoom:l}=e.getState(),a=m0(t,r,s,o,i,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:r,snapGrid:s,domNode:o}=e.getState();if(!o)return t;const{x:i,y:l}=o.getBoundingClientRect(),a={x:t.x-i,y:t.y-l};return Oa(a,r,n.snapToGrid,s)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),i=iC(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function IC(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const i=r.get(o.id);i?i.push(o):r.set(o.id,[o])}for(const o of t){const i=r.get(o.id);if(!i){n.push(o);continue}if(i[0].type==="remove")continue;if(i[0].type==="replace"){n.push({...i[0].item});continue}const l={...o};for(const a of i)nL(a,l);n.push(l)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function nL(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function rL(e,t){return IC(e,t)}function sL(e,t){return IC(e,t)}function zs(e,t){return{id:e,type:"select",selected:t}}function Uo(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const i=t.has(s);!(o.selected===void 0&&!i)&&o.selected!==i&&(n&&(o.selected=i),r.push(zs(o.id,i)))}return r}function Uv({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,i]of e.entries()){const l=t.get(i.id),a=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function qv(e){return{id:e.id,type:"remove"}}const Kv=e=>L$(e),oL=e=>eC(e);function jC(e){return S.forwardRef(e)}const iL=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Yv(e){const[t,n]=S.useState(BigInt(0)),[r]=S.useState(()=>lL(()=>n(s=>s+BigInt(1))));return iL(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function lL(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const _C=S.createContext(null);function aL({children:e}){const t=Ye(),n=S.useCallback(l=>{const{nodes:a=[],setNodes:c,hasDefaultNodes:u,onNodesChange:d,nodeLookup:f}=t.getState();let p=a;for(const y of l)p=typeof y=="function"?y(p):y;u?c(p):d&&d(Uv({items:p,lookup:f}))},[]),r=Yv(n),s=S.useCallback(l=>{const{edges:a=[],setEdges:c,hasDefaultEdges:u,onEdgesChange:d,edgeLookup:f}=t.getState();let p=a;for(const y of l)p=typeof y=="function"?y(p):y;u?c(p):d&&d(Uv({items:p,lookup:f}))},[]),o=Yv(s),i=S.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return h.jsx(_C.Provider,{value:i,children:e})}function cL(){const e=S.useContext(_C);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const uL=e=>!!e.panZoom;function b0(){const e=tL(),t=Ye(),n=cL(),r=Oe(uL),s=S.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),i=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},a=d=>{var g,m;const{nodeLookup:f,nodeOrigin:p}=t.getState(),y=Kv(d)?d:f.get(d.id),v=y.parentId?aC(y.position,y.measured,y.parentId,f,p):y.position,b={...y,position:v,width:((g=y.measured)==null?void 0:g.width)??y.width,height:((m=y.measured)==null?void 0:m.height)??y.height};return zi(b)},c=(d,f,p={replace:!1})=>{i(y=>y.map(v=>{if(v.id===d){const b=typeof f=="function"?f(v):f;return p.replace&&Kv(b)?b:{...v,...b}}return v}))},u=(d,f,p={replace:!1})=>{l(y=>y.map(v=>{if(v.id===d){const b=typeof f=="function"?f(v):f;return p.replace&&oL(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=o(d))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:i,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(p=>[...p,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(p=>[...p,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:p}=t.getState(),[y,v,b]=p;return{nodes:d.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x:y,y:v,zoom:b}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:p,edges:y,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:g,triggerEdgeChanges:m,onDelete:x,onBeforeDelete:w}=t.getState(),{nodes:E,edges:N}=await V$({nodesToRemove:d,edgesToRemove:f,nodes:p,edges:y,onBeforeDelete:w}),k=N.length>0,C=E.length>0;if(k){const P=N.map(qv);b==null||b(N),m(P)}if(C){const P=E.map(qv);v==null||v(E),g(P)}return(C||k)&&(x==null||x({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,f=!0,p)=>{const y=Nv(d),v=y?d:a(d),b=p!==void 0;return v?(p||t.getState().nodes).filter(g=>{const m=t.getState().nodeLookup.get(g.id);if(m&&!y&&(g.id===d.id||!m.internals.positionAbsolute))return!1;const x=zi(b?g:m),w=la(x,v);return f&&w>0||w>=v.width*v.height}):[]},isNodeIntersecting:(d,f,p=!0)=>{const v=Nv(d)?d:a(d);if(!v)return!1;const b=la(v,f);return p&&b>0||b>=v.width*v.height},updateNode:c,updateNodeData:(d,f,p={replace:!1})=>{c(d,y=>{const v=typeof f=="function"?f(y):f;return p.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},p)},updateEdge:u,updateEdgeData:(d,f,p={replace:!1})=>{u(d,y=>{const v=typeof f=="function"?f(y):f;return p.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},p)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:p}=t.getState();return H$(d,{nodeLookup:f,nodeOrigin:p})},getHandleConnections:({type:d,id:f,nodeId:p})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${p}-${d}-${f??null}`))==null?void 0:y.values())??[])}}},[]);return S.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const Gv=e=>e.selected,dL={actInsideInputWithModifier:!1},fL=typeof window<"u"?window:void 0;function hL({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ye(),{deleteElements:r}=b0(),s=ca(e,dL),o=ca(t,{target:fL});S.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter(Gv),edges:i.filter(Gv)}),n.setState({nodesSelectionActive:!1})}},[s]),S.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function pL(e){const t=Ye();S.useEffect(()=>{const n=()=>{var s,o;if(!e.current)return!1;const r=Vd(e.current);(r.height===0||r.width===0)&&((o=(s=t.getState()).onError)==null||o.call(s,"004",Fr.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const qd={position:"absolute",width:"100%",height:"100%",top:0,left:0},mL=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function gL({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=no.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:a,translateExtent:c,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:y,noWheelClassName:v,noPanClassName:b,onViewportChange:g,isControlledViewport:m,paneClickDistance:x}){const w=Ye(),E=S.useRef(null),{userSelectionActive:N,lib:k}=Oe(mL,it),C=ca(f),P=S.useRef();pL(E);const I=S.useCallback(z=>{g==null||g({x:z[0],y:z[1],zoom:z[2]}),m||w.setState({transform:z})},[g,m]);return S.useEffect(()=>{if(E.current){P.current=EF({domNode:E.current,minZoom:u,maxZoom:d,translateExtent:c,viewport:a,paneClickDistance:x,onDraggingChange:R=>w.setState({paneDragging:R}),onPanZoomStart:(R,j)=>{const{onViewportChangeStart:_,onMoveStart:F}=w.getState();F==null||F(R,j),_==null||_(j)},onPanZoom:(R,j)=>{const{onViewportChange:_,onMove:F}=w.getState();F==null||F(R,j),_==null||_(j)},onPanZoomEnd:(R,j)=>{const{onViewportChangeEnd:_,onMoveEnd:F}=w.getState();F==null||F(R,j),_==null||_(j)}});const{x:z,y:$,zoom:A}=P.current.getViewport();return w.setState({panZoom:P.current,transform:[z,$,A],domNode:E.current.closest(".react-flow")}),()=>{var R;(R=P.current)==null||R.destroy()}}},[]),S.useEffect(()=>{var z;(z=P.current)==null||z.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:C,preventScrolling:p,noPanClassName:b,userSelectionActive:N,noWheelClassName:v,lib:k,onTransformChange:I})},[e,t,n,r,s,o,i,l,C,p,b,N,v,k,I]),h.jsx("div",{className:"react-flow__renderer",ref:E,style:qd,children:y})}const xL=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function yL(){const{userSelectionActive:e,userSelectionRect:t}=Oe(xL,it);return e&&t?h.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}const eh=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},vL=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function wL({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ia.Full,panOnDrag:r,selectionOnDrag:s,onSelectionStart:o,onSelectionEnd:i,onPaneClick:l,onPaneContextMenu:a,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p}){const y=S.useRef(null),v=Ye(),b=S.useRef(0),g=S.useRef(0),m=S.useRef(),x=S.useRef(new Map),{userSelectionActive:w,elementsSelectable:E,dragging:N}=Oe(vL,it),k=E&&(e||w),C=S.useRef(!1),P=S.useRef(!1),I=()=>{v.setState({userSelectionActive:!1,userSelectionRect:null}),b.current=0,g.current=0},z=T=>{if(C.current){C.current=!1;return}l==null||l(T),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},$=T=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){T.preventDefault();return}a==null||a(T)},A=c?T=>c(T):void 0,R=T=>{var W,q,H,G;const{resetSelectedElements:M,domNode:O,edgeLookup:U}=v.getState();if(m.current=O==null?void 0:O.getBoundingClientRect(),!E||!e||T.button!==0||T.target!==y.current||!m.current)return;(q=(W=T.target)==null?void 0:W.setPointerCapture)==null||q.call(W,T.pointerId),P.current=!0,C.current=!1,x.current=new Map;for(const[B,Y]of U)x.current.set(Y.source,((H=x.current.get(Y.source))==null?void 0:H.add(B))||new Set([B])),x.current.set(Y.target,((G=x.current.get(Y.target))==null?void 0:G.add(B))||new Set([B]));const{x:L,y:K}=Tr(T.nativeEvent,m.current);M(),v.setState({userSelectionRect:{width:0,height:0,startX:L,startY:K,x:L,y:K}}),o==null||o(T)},j=T=>{const{userSelectionRect:M,edgeLookup:O,transform:U,nodeLookup:L,triggerNodeChanges:K,triggerEdgeChanges:W}=v.getState();if(!m.current||!M)return;C.current=!0;const{x:q,y:H}=Tr(T.nativeEvent,m.current),{startX:G,startY:B}=M,Y={startX:G,startY:B,x:q<G?q:G,y:H<B?H:B,width:Math.abs(q-G),height:Math.abs(H-B)},Q=tC(L,Y,U,n===ia.Partial,!0),Z=new Set,V=new Set;for(const X of Q){V.add(X.id);const ee=x.current.get(X.id);if(ee)for(const he of ee)Z.add(he)}if(b.current!==V.size){b.current=V.size;const X=Uo(L,V,!0);K(X)}if(g.current!==Z.size){g.current=Z.size;const X=Uo(O,Z);W(X)}v.setState({userSelectionRect:Y,userSelectionActive:!0,nodesSelectionActive:!1})},_=T=>{var O,U;if(T.button!==0||!P.current)return;(U=(O=T.target)==null?void 0:O.releasePointerCapture)==null||U.call(O,T.pointerId);const{userSelectionRect:M}=v.getState();!w&&M&&T.target===y.current&&(z==null||z(T)),b.current>0&&v.setState({nodesSelectionActive:!0}),I(),i==null||i(T),(t||s)&&(C.current=!1),P.current=!1},F=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:dt(["react-flow__pane",{draggable:F,dragging:N,selection:e}]),onClick:k?void 0:eh(z,y),onContextMenu:eh($,y),onWheel:eh(A,y),onPointerEnter:k?void 0:u,onPointerDown:k?R:d,onPointerMove:k?j:d,onPointerUp:k?_:void 0,onPointerLeave:f,ref:y,style:qd,children:[p,h.jsx(yL,{})]})}function em({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:i,nodeLookup:l,onError:a}=t.getState(),c=l.get(e);if(!c){a==null||a("012",Fr.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):s([e])}function OC({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const l=Ye(),[a,c]=S.useState(!1),u=S.useRef();return S.useEffect(()=>{u.current=cF({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{em({id:d,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),S.useEffect(()=>{var d,f;if(t)(d=u.current)==null||d.destroy();else if(e.current)return(f=u.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:i}),()=>{var p;(p=u.current)==null||p.destroy()}},[n,r,t,o,e,s]),a}const bL=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function MC(){const e=Ye();return S.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:l,updateNodePositions:a,nodeLookup:c,nodeOrigin:u}=e.getState(),d=new Map,f=bL(i),p=s?o[0]:5,y=s?o[1]:5,v=n.direction.x*p*n.factor,b=n.direction.y*y*n.factor;for(const[,g]of c){if(!f(g))continue;let m={x:g.internals.positionAbsolute.x+v,y:g.internals.positionAbsolute.y+b};s&&(m=Bd(m,o));const{position:x,positionAbsolute:w}=nC({nodeId:g.id,nextPosition:m,nodeLookup:c,nodeExtent:r,nodeOrigin:u,onError:l});g.position=x,g.internals.positionAbsolute=w,d.set(g.id,g)}a(d)},[])}const S0=S.createContext(null),SL=S0.Provider;S0.Consumer;const AC=()=>S.useContext(S0),EL=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),kL=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:l,toHandle:a,isValid:c}=i,u=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:u,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===Mi.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,valid:u&&c}};function CL({type:e="source",position:t=de.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:l,children:a,className:c,onMouseDown:u,onTouchStart:d,...f},p){var R,j;const y=i||null,v=e==="target",b=Ye(),g=AC(),{connectOnClick:m,noPanClassName:x,rfId:w}=Oe(EL,it),{connectingFrom:E,connectingTo:N,clickConnecting:k,isPossibleEndHandle:C,connectionInProcess:P,valid:I}=Oe(kL(g,y,e),it);g||(j=(R=b.getState()).onError)==null||j.call(R,"010",Fr.error010());const z=_=>{const{defaultEdgeOptions:F,onConnect:T,hasDefaultEdges:M}=b.getState(),O={...F,..._};if(M){const{edges:U,setEdges:L}=b.getState();L(Q$(O,U))}T==null||T(O),l==null||l(O)},$=_=>{if(!g)return;const F=uC(_.nativeEvent);if(s&&(F&&_.button===0||!F)){const T=b.getState();Jp.onPointerDown(_.nativeEvent,{autoPanOnConnect:T.autoPanOnConnect,connectionMode:T.connectionMode,connectionRadius:T.connectionRadius,domNode:T.domNode,nodeLookup:T.nodeLookup,lib:T.lib,isTarget:v,handleId:y,nodeId:g,flowId:T.rfId,panBy:T.panBy,cancelConnection:T.cancelConnection,onConnectStart:T.onConnectStart,onConnectEnd:T.onConnectEnd,updateConnection:T.updateConnection,onConnect:z,isValidConnection:n||T.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:T.autoPanSpeed})}F?u==null||u(_):d==null||d(_)},A=_=>{const{onClickConnectStart:F,onClickConnectEnd:T,connectionClickStartHandle:M,connectionMode:O,isValidConnection:U,lib:L,rfId:K,nodeLookup:W,connection:q}=b.getState();if(!g||!M&&!s)return;if(!M){F==null||F(_.nativeEvent,{nodeId:g,handleId:y,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:g,type:e,id:y}});return}const H=cC(_.target),G=n||U,{connection:B,isValid:Y}=Jp.isValid(_.nativeEvent,{handle:{nodeId:g,id:y,type:e},connectionMode:O,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:G,flowId:K,doc:H,lib:L,nodeLookup:W});Y&&B&&z(B);const Q=structuredClone(q);delete Q.inProgress,Q.toPosition=Q.toHandle?Q.toHandle.position:null,T==null||T(_,Q),b.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":y,"data-nodeid":g,"data-handlepos":t,"data-id":`${w}-${g}-${y}-${e}`,className:dt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,c,{source:!v,target:v,connectable:r,connectablestart:s,connectableend:o,clickconnecting:k,connectingfrom:E,connectingto:N,valid:I,connectionindicator:r&&(!P||C)&&(P?o:s)}]),onMouseDown:$,onTouchStart:$,onClick:m?A:void 0,ref:p,...f,children:a})}const ar=S.memo(jC(CL));function NL({data:e,isConnectable:t,sourcePosition:n=de.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(ar,{type:"source",position:n,isConnectable:t})]})}function RL({data:e,isConnectable:t,targetPosition:n=de.Top,sourcePosition:r=de.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(ar,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(ar,{type:"source",position:r,isConnectable:t})]})}function TL(){return null}function PL({data:e,isConnectable:t,targetPosition:n=de.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(ar,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Qu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Qv={input:NL,default:RL,output:PL,group:TL};function IL(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const jL=e=>{const{width:t,height:n,x:r,y:s}=_a(e.nodeLookup,{filter:o=>!!o.selected});return{width:Ln(t)?t:null,height:Ln(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function _L({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ye(),{width:s,height:o,transformString:i,userSelectionActive:l}=Oe(jL,it),a=MC(),c=S.useRef(null);if(S.useEffect(()=>{var f;n||(f=c.current)==null||f.focus({preventScroll:!0})},[n]),OC({nodeRef:c}),l||!s||!o)return null;const u=e?f=>{const p=r.getState().nodes.filter(y=>y.selected);e(f,p)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(Qu,f.key)&&(f.preventDefault(),a({direction:Qu[f.key],factor:f.shiftKey?4:1}))};return h.jsx("div",{className:dt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:h.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:s,height:o}})})}const Xv=typeof window<"u"?window:void 0,OL=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function zC({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:c,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:g,zoomOnScroll:m,zoomOnPinch:x,panOnScroll:w,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:k,panOnDrag:C,defaultViewport:P,translateExtent:I,minZoom:z,maxZoom:$,preventScrolling:A,onSelectionContextMenu:R,noWheelClassName:j,noPanClassName:_,disableKeyboardA11y:F,onViewportChange:T,isControlledViewport:M}){const{nodesSelectionActive:O,userSelectionActive:U}=Oe(OL),L=ca(c,{target:Xv}),K=ca(v,{target:Xv}),W=K||C,q=K||w,H=u&&W!==!0,G=L||U||H;return hL({deleteKeyCode:a,multiSelectionKeyCode:y}),h.jsx(gL,{onPaneContextMenu:o,elementsSelectable:g,zoomOnScroll:m,zoomOnPinch:x,panOnScroll:q,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:k,panOnDrag:!L&&W,defaultViewport:P,translateExtent:I,minZoom:z,maxZoom:$,zoomActivationKeyCode:b,preventScrolling:A,noWheelClassName:j,noPanClassName:_,onViewportChange:T,isControlledViewport:M,paneClickDistance:l,children:h.jsxs(wL,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:W,isSelecting:!!G,selectionMode:d,selectionKeyPressed:L,selectionOnDrag:H,children:[e,O&&h.jsx(_L,{onSelectionContextMenu:R,noPanClassName:_,disableKeyboardA11y:F})]})})}zC.displayName="FlowRenderer";const ML=S.memo(zC),AL=e=>t=>e?tC(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function zL(e){return Oe(S.useCallback(AL(e),[e]),it)}const DL=e=>e.updateNodeInternals;function $L(){const e=Oe(DL),[t]=S.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return S.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function FL({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Ye(),o=S.useRef(null),i=S.useRef(null),l=S.useRef(e.sourcePosition),a=S.useRef(e.targetPosition),c=S.useRef(t),u=n&&!!e.internals.handleBounds;return S.useEffect(()=>{o.current&&!e.hidden&&(!u||i.current!==o.current)&&(i.current&&(r==null||r.unobserve(i.current)),r==null||r.observe(o.current),i.current=o.current)},[u,e.hidden]),S.useEffect(()=>()=>{i.current&&(r==null||r.unobserve(i.current),i.current=null)},[]),S.useEffect(()=>{if(o.current){const d=c.current!==t,f=l.current!==e.sourcePosition,p=a.current!==e.targetPosition;(d||f||p)&&(c.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function LL({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:a,nodesConnectable:c,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:y,rfId:v,nodeTypes:b,nodeExtent:g,nodeClickDistance:m,onError:x}){const{node:w,internals:E,isParent:N}=Oe(B=>{const Y=B.nodeLookup.get(e),Q=B.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:Q}},it);let k=w.type||"default",C=(b==null?void 0:b[k])||Qv[k];C===void 0&&(x==null||x("003",Fr.error003(k)),k="default",C=Qv.default);const P=!!(w.draggable||l&&typeof w.draggable>"u"),I=!!(w.selectable||a&&typeof w.selectable>"u"),z=!!(w.connectable||c&&typeof w.connectable>"u"),$=!!(w.focusable||u&&typeof w.focusable>"u"),A=Ye(),R=lC(w),j=FL({node:w,nodeType:k,hasDimensions:R,resizeObserver:d}),_=OC({nodeRef:j,disabled:w.hidden||!P,noDragClassName:f,handleSelector:w.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:m}),F=MC();if(w.hidden)return null;const T=Lr(w),M=IL(w),O=I||P||t||n||r||s,U=n?B=>n(B,{...E.userNode}):void 0,L=r?B=>r(B,{...E.userNode}):void 0,K=s?B=>s(B,{...E.userNode}):void 0,W=o?B=>o(B,{...E.userNode}):void 0,q=i?B=>i(B,{...E.userNode}):void 0,H=B=>{const{selectNodesOnDrag:Y,nodeDragThreshold:Q}=A.getState();I&&(!Y||!P||Q>0)&&em({id:e,store:A,nodeRef:j}),t&&t(B,{...E.userNode})},G=B=>{if(!(Gp(B.nativeEvent)||y))if(Xk.includes(B.key)&&I){const Y=B.key==="Escape";em({id:e,store:A,unselect:Y,nodeRef:j})}else P&&w.selected&&Object.prototype.hasOwnProperty.call(Qu,B.key)&&(B.preventDefault(),A.setState({ariaLiveMessage:`Moved selected node ${B.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~E.positionAbsolute.x}, y: ${~~E.positionAbsolute.y}`}),F({direction:Qu[B.key],factor:B.shiftKey?4:1}))};return h.jsx("div",{className:dt(["react-flow__node",`react-flow__node-${k}`,{[p]:P},w.className,{selected:w.selected,selectable:I,parent:N,draggable:P,dragging:_}]),ref:j,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:O?"all":"none",visibility:R?"visible":"hidden",...w.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:U,onMouseMove:L,onMouseLeave:K,onContextMenu:W,onClick:H,onDoubleClick:q,onKeyDown:$?G:void 0,tabIndex:$?0:void 0,role:$?"button":void 0,"aria-describedby":y?void 0:`${RC}-${v}`,"aria-label":w.ariaLabel,children:h.jsx(SL,{value:e,children:h.jsx(C,{id:e,data:w.data,type:k,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:w.selected,selectable:I,draggable:P,deletable:w.deletable??!0,isConnectable:z,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:_,dragHandle:w.dragHandle,zIndex:E.z,parentId:w.parentId,...T})})})}const HL=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function DC(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=Oe(HL,it),i=zL(e.onlyRenderVisibleElements),l=$L();return h.jsx("div",{className:"react-flow__nodes",style:qd,children:i.map(a=>h.jsx(LL,{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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},a))})}DC.displayName="NodeRenderer";const BL=S.memo(DC);function VL(e){return Oe(S.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const o=n.nodeLookup.get(s.source),i=n.nodeLookup.get(s.target);o&&i&&K$({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),it)}const WL=({color:e="none",strokeWidth:t=1})=>h.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),UL=({color:e="none",strokeWidth:t=1})=>h.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Zv={[Ku.Arrow]:WL,[Ku.ArrowClosed]:UL};function qL(e){const t=Ye();return S.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(Zv,e)?Zv[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",Fr.error009(e)),null)},[e])}const KL=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const a=qL(t);return a?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:h.jsx(a,{color:n,strokeWidth:i})}):null},$C=({defaultColor:e,rfId:t})=>{const n=Oe(o=>o.edges),r=Oe(o=>o.defaultEdgeOptions),s=S.useMemo(()=>tF(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?h.jsx("svg",{className:"react-flow__marker",children:h.jsx("defs",{children:s.map(o=>h.jsx(KL,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};$C.displayName="MarkerDefinitions";var YL=S.memo($C);function FC({x:e,y:t,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:o={},labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:a,className:c,...u}){const[d,f]=S.useState({x:1,y:0,width:0,height:0}),p=dt(["react-flow__edge-textwrapper",c]),y=S.useRef(null);return S.useEffect(()=>{if(y.current){const v=y.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:h.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...u,children:[s&&h.jsx("rect",{width:d.width+2*i[0],x:-i[0],y:-i[1],height:d.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:y,style:r,children:n}),a]})}FC.displayName="EdgeText";const GL=S.memo(FC);function Kd({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:c=20,...u}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...u,d:e,fill:"none",className:dt(["react-flow__edge-path",u.className])}),c&&h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}),r&&Ln(t)&&Ln(n)?h.jsx(GL,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Jv({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===de.Left||e===de.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function LC({sourceX:e,sourceY:t,sourcePosition:n=de.Bottom,targetX:r,targetY:s,targetPosition:o=de.Top}){const[i,l]=Jv({pos:n,x1:e,y1:t,x2:r,y2:s}),[a,c]=Jv({pos:o,x1:r,y1:s,x2:e,y2:t}),[u,d,f,p]=dC({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:l,targetControlX:a,targetControlY:c});return[`M${e},${t} C${i},${l} ${a},${c} ${r},${s}`,u,d,f,p]}function HC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=de.Bottom,targetPosition:l=de.Top,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:v,markerStart:b,interactionWidth:g})=>{const[m,x,w]=LC({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),E=e.isInternal?void 0:t;return h.jsx(Kd,{id:E,path:m,labelX:x,labelY:w,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:v,markerStart:b,interactionWidth:g})})}const QL=HC({isInternal:!1}),BC=HC({isInternal:!0});QL.displayName="SimpleBezierEdge";BC.displayName="SimpleBezierEdgeInternal";function VC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=de.Bottom,targetPosition:y=de.Top,markerEnd:v,markerStart:b,pathOptions:g,interactionWidth:m})=>{const[x,w,E]=Qp({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:o,targetPosition:y,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset}),N=e.isInternal?void 0:t;return h.jsx(Kd,{id:N,path:x,labelX:w,labelY:E,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:v,markerStart:b,interactionWidth:m})})}const WC=VC({isInternal:!1}),UC=VC({isInternal:!0});WC.displayName="SmoothStepEdge";UC.displayName="SmoothStepEdgeInternal";function qC(e){return S.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return h.jsx(WC,{...n,id:r,pathOptions:S.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const XL=qC({isInternal:!1}),KC=qC({isInternal:!0});XL.displayName="StepEdge";KC.displayName="StepEdgeInternal";function YC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:y,interactionWidth:v})=>{const[b,g,m]=pC({sourceX:n,sourceY:r,targetX:s,targetY:o}),x=e.isInternal?void 0:t;return h.jsx(Kd,{id:x,path:b,labelX:g,labelY:m,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:y,interactionWidth:v})})}const ZL=YC({isInternal:!1}),GC=YC({isInternal:!0});ZL.displayName="StraightEdge";GC.displayName="StraightEdgeInternal";function QC(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=de.Bottom,targetPosition:l=de.Top,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:v,markerStart:b,pathOptions:g,interactionWidth:m})=>{const[x,w,E]=fC({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l,curvature:g==null?void 0:g.curvature}),N=e.isInternal?void 0:t;return h.jsx(Kd,{id:N,path:x,labelX:w,labelY:E,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:v,markerStart:b,interactionWidth:m})})}const JL=QC({isInternal:!1}),XC=QC({isInternal:!0});JL.displayName="BezierEdge";XC.displayName="BezierEdgeInternal";const ew={default:XC,straight:GC,step:KC,smoothstep:UC,simplebezier:BC},tw={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},e3=(e,t,n)=>n===de.Left?e-t:n===de.Right?e+t:e,t3=(e,t,n)=>n===de.Top?e-t:n===de.Bottom?e+t:e,nw="react-flow__edgeupdater";function rw({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:l}){return h.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:dt([nw,`${nw}-${l}`]),cx:e3(t,r,e),cy:t3(n,r,e),r,stroke:"transparent",fill:"transparent"})}function n3({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:a,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){const y=Ye(),v=(w,E)=>{if(w.button!==0)return;const{autoPanOnConnect:N,domNode:k,isValidConnection:C,connectionMode:P,connectionRadius:I,lib:z,onConnectStart:$,onConnectEnd:A,cancelConnection:R,nodeLookup:j,rfId:_,panBy:F,updateConnection:T}=y.getState(),M=E.type==="target";f(!0),u==null||u(w,n,E.type);const O=(L,K)=>{f(!1),d==null||d(L,n,E.type,K)},U=L=>c==null?void 0:c(n,L);Jp.onPointerDown(w.nativeEvent,{autoPanOnConnect:N,connectionMode:P,connectionRadius:I,domNode:k,handleId:E.id,nodeId:E.nodeId,nodeLookup:j,isTarget:M,edgeUpdaterType:E.type,lib:z,flowId:_,cancelConnection:R,panBy:F,isValidConnection:C,onConnect:U,onConnectStart:$,onConnectEnd:A,onReconnectEnd:O,updateConnection:T,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle})},b=w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),m=()=>p(!0),x=()=>p(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(rw,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:b,onMouseEnter:m,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&h.jsx(rw,{position:a,centerX:o,centerY:i,radius:t,onMouseDown:g,onMouseEnter:m,onMouseOut:x,type:"target"})]})}function r3({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:y,edgeTypes:v,noPanClassName:b,onError:g,disableKeyboardA11y:m}){let x=Oe(V=>V.edgeLookup.get(e));const w=Oe(V=>V.defaultEdgeOptions);x=w?{...w,...x}:x;let E=x.type||"default",N=(v==null?void 0:v[E])||ew[E];N===void 0&&(g==null||g("011",Fr.error011(E)),E="default",N=ew.default);const k=!!(x.focusable||t&&typeof x.focusable>"u"),C=typeof d<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),P=!!(x.selectable||r&&typeof x.selectable>"u"),I=S.useRef(null),[z,$]=S.useState(!1),[A,R]=S.useState(!1),j=Ye(),{zIndex:_,sourceX:F,sourceY:T,targetX:M,targetY:O,sourcePosition:U,targetPosition:L}=Oe(S.useCallback(V=>{const X=V.nodeLookup.get(x.source),ee=V.nodeLookup.get(x.target);if(!X||!ee)return{zIndex:x.zIndex,...tw};const he=eF({id:e,sourceNode:X,targetNode:ee,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:V.connectionMode,onError:g});return{zIndex:q$({selected:x.selected,zIndex:x.zIndex,sourceNode:X,targetNode:ee,elevateOnSelect:V.elevateEdgesOnSelect}),...he||tw}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),it),K=S.useMemo(()=>x.markerStart?`url('#${Xp(x.markerStart,y)}')`:void 0,[x.markerStart,y]),W=S.useMemo(()=>x.markerEnd?`url('#${Xp(x.markerEnd,y)}')`:void 0,[x.markerEnd,y]);if(x.hidden||F===null||T===null||M===null||O===null)return null;const q=V=>{var Pe;const{addSelectedEdges:X,unselectNodesAndEdges:ee,multiSelectionActive:he}=j.getState();P&&(j.setState({nodesSelectionActive:!1}),x.selected&&he?(ee({nodes:[],edges:[x]}),(Pe=I.current)==null||Pe.blur()):X([e])),s&&s(V,x)},H=o?V=>{o(V,{...x})}:void 0,G=i?V=>{i(V,{...x})}:void 0,B=l?V=>{l(V,{...x})}:void 0,Y=a?V=>{a(V,{...x})}:void 0,Q=c?V=>{c(V,{...x})}:void 0,Z=V=>{var X;if(!m&&Xk.includes(V.key)&&P){const{unselectNodesAndEdges:ee,addSelectedEdges:he}=j.getState();V.key==="Escape"?((X=I.current)==null||X.blur(),ee({edges:[x]})):he([e])}};return h.jsx("svg",{style:{zIndex:_},children:h.jsxs("g",{className:dt(["react-flow__edge",`react-flow__edge-${E}`,x.className,b,{selected:x.selected,animated:x.animated,inactive:!P&&!s,updating:z,selectable:P}]),onClick:q,onDoubleClick:H,onContextMenu:G,onMouseEnter:B,onMouseMove:Y,onMouseLeave:Q,onKeyDown:k?Z:void 0,tabIndex:k?0:void 0,role:k?"button":"img","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":k?`${TC}-${y}`:void 0,ref:I,children:[!A&&h.jsx(N,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:P,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:T,targetX:M,targetY:O,sourcePosition:U,targetPosition:L,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:K,markerEnd:W,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),C&&h.jsx(n3,{edge:x,isReconnectable:C,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:F,sourceY:T,targetX:M,targetY:O,sourcePosition:U,targetPosition:L,setUpdateHover:$,setReconnecting:R})]})})}const s3=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ZC({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:y,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:g,elementsSelectable:m,onError:x}=Oe(s3,it),w=VL(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(YL,{defaultColor:e,rfId:n}),w.map(E=>h.jsx(r3,{id:E,edgesFocusable:b,edgesReconnectable:g,elementsSelectable:m,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:y,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:v},E))]})}ZC.displayName="EdgeRenderer";const o3=S.memo(ZC),i3=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function l3({children:e}){const t=Oe(i3);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function a3(e){const t=b0(),n=S.useRef(!1);S.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const c3=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function u3(e){const t=Oe(c3),n=Ye();return S.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function d3(e){return e.connection.inProgress?{...e.connection,to:Oa(e.connection.to,e.transform)}:{...e.connection}}function f3(e){return d3}function h3(e){const t=f3();return Oe(t,it)}const p3=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function m3({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:a}=Oe(p3,it);return!(o&&s&&a)?null:h.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:dt(["react-flow__connection",Jk(l)]),children:h.jsx(JC,{style:t,type:n,CustomComponent:r,isValid:l})})})}const JC=({style:e,type:t=Zr.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:a,to:c,toNode:u,toHandle:d,toPosition:f}=h3();if(!s)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:a,toPosition:f,connectionStatus:Jk(r),toNode:u,toHandle:d});let p="";const y={sourceX:o.x,sourceY:o.y,sourcePosition:a,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case Zr.Bezier:[p]=fC(y);break;case Zr.SimpleBezier:[p]=LC(y);break;case Zr.Step:[p]=Qp({...y,borderRadius:0});break;case Zr.SmoothStep:[p]=Qp(y);break;default:[p]=pC(y)}return h.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};JC.displayName="ConnectionLine";const g3={};function sw(e=g3){S.useRef(e),Ye(),S.useEffect(()=>{},[e])}function x3(){Ye(),S.useRef(!1),S.useEffect(()=>{},[])}function eN({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:y,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:g,selectionKeyCode:m,selectionOnDrag:x,selectionMode:w,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:k,deleteKeyCode:C,onlyRenderVisibleElements:P,elementsSelectable:I,defaultViewport:z,translateExtent:$,minZoom:A,maxZoom:R,preventScrolling:j,defaultMarkerColor:_,zoomOnScroll:F,zoomOnPinch:T,panOnScroll:M,panOnScrollSpeed:O,panOnScrollMode:U,zoomOnDoubleClick:L,panOnDrag:K,onPaneClick:W,onPaneMouseEnter:q,onPaneMouseMove:H,onPaneMouseLeave:G,onPaneScroll:B,onPaneContextMenu:Y,paneClickDistance:Q,nodeClickDistance:Z,onEdgeContextMenu:V,onEdgeMouseEnter:X,onEdgeMouseMove:ee,onEdgeMouseLeave:he,reconnectRadius:Pe,onReconnect:ce,onReconnectStart:ve,onReconnectEnd:ue,noDragClassName:Re,noWheelClassName:ye,noPanClassName:ze,disableKeyboardA11y:Ie,nodeExtent:et,rfId:lt,viewport:re,onViewportChange:se}){return sw(e),sw(t),x3(),a3(n),u3(re),h.jsx(ML,{onPaneClick:W,onPaneMouseEnter:q,onPaneMouseMove:H,onPaneMouseLeave:G,onPaneContextMenu:Y,onPaneScroll:B,paneClickDistance:Q,deleteKeyCode:C,selectionKeyCode:m,selectionOnDrag:x,selectionMode:w,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:k,elementsSelectable:I,zoomOnScroll:F,zoomOnPinch:T,zoomOnDoubleClick:L,panOnScroll:M,panOnScrollSpeed:O,panOnScrollMode:U,panOnDrag:K,defaultViewport:z,translateExtent:$,minZoom:A,maxZoom:R,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:Re,noWheelClassName:ye,noPanClassName:ze,disableKeyboardA11y:Ie,onViewportChange:se,isControlledViewport:!!re,children:h.jsxs(l3,{children:[h.jsx(o3,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:ce,onReconnectStart:ve,onReconnectEnd:ue,onlyRenderVisibleElements:P,onEdgeContextMenu:V,onEdgeMouseEnter:X,onEdgeMouseMove:ee,onEdgeMouseLeave:he,reconnectRadius:Pe,defaultMarkerColor:_,noPanClassName:ze,disableKeyboardA11y:Ie,rfId:lt}),h.jsx(m3,{style:v,type:y,component:b,containerStyle:g}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(BL,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:Z,onlyRenderVisibleElements:P,noPanClassName:ze,noDragClassName:Re,disableKeyboardA11y:Ie,nodeExtent:et,rfId:lt}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}eN.displayName="GraphView";const y3=S.memo(eN),ow=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a}={})=>{const c=new Map,u=new Map,d=new Map,f=new Map,p=r??t??[],y=n??e??[],v=l??[0,0],b=a??oa;gC(d,f,p),Zp(y,c,u,{nodeOrigin:v,nodeExtent:b,elevateNodesOnSelect:!1});let g=[0,0,1];if(i&&s&&o){const m=_a(c,{filter:N=>!!((N.width||N.initialWidth)&&(N.height||N.initialHeight))}),{x,y:w,zoom:E}=m0(m,s,o,.5,2,.1);g=[x,w,E]}return{rfId:"1",width:0,height:0,transform:g,nodes:y,nodeLookup:c,parentLookup:u,edges:p,edgeLookup:f,connectionLookup:d,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:oa,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Mi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...Zk},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:W$,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},v3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a})=>zF((c,u)=>({...ow({nodes:e,edges:t,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a,defaultNodes:n,defaultEdges:r}),setNodes:d=>{const{nodeLookup:f,parentLookup:p,nodeOrigin:y,elevateNodesOnSelect:v}=u();Zp(d,f,p,{nodeOrigin:y,nodeExtent:a,elevateNodesOnSelect:v,checkEquality:!0}),c({nodes:d})},setEdges:d=>{const{connectionLookup:f,edgeLookup:p}=u();gC(f,p,d),c({edges:d})},setDefaultNodesAndEdges:(d,f)=>{if(d){const{setNodes:p}=u();p(d),c({hasDefaultNodes:!0})}if(f){const{setEdges:p}=u();p(f),c({hasDefaultEdges:!0})}},updateNodeInternals:(d,f={triggerFitView:!0})=>{const{triggerNodeChanges:p,nodeLookup:y,parentLookup:v,fitViewOnInit:b,fitViewDone:g,fitViewOnInitOptions:m,domNode:x,nodeOrigin:w,nodeExtent:E,debug:N,fitViewSync:k}=u(),{changes:C,updatedInternals:P}=iF(d,y,v,x,w,E);if(P){if(rF(y,v,{nodeOrigin:w,nodeExtent:E}),f.triggerFitView){let I=g;!g&&b&&(I=k({...m,nodes:m==null?void 0:m.nodes})),c({fitViewDone:I})}else c({});(C==null?void 0:C.length)>0&&(N&&console.log("React Flow: trigger node changes",C),p==null||p(C))}},updateNodePositions:(d,f=!1)=>{const p=[],y=[];for(const[v,b]of d){const g=!!(b!=null&&b.expandParent&&(b!=null&&b.parentId)&&(b!=null&&b.position)),m={id:v,type:"position",position:g?{x:Math.max(0,b.position.x),y:Math.max(0,b.position.y)}:b.position,dragging:f};g&&p.push({id:v,parentId:b.parentId,rect:{...b.internals.positionAbsolute,width:b.measured.width,height:b.measured.height}}),y.push(m)}if(p.length>0){const{nodeLookup:v,parentLookup:b,nodeOrigin:g}=u(),m=v0(p,v,b,g);y.push(...m)}u().triggerNodeChanges(y)},triggerNodeChanges:d=>{const{onNodesChange:f,setNodes:p,nodes:y,hasDefaultNodes:v,debug:b}=u();if(d!=null&&d.length){if(v){const g=rL(d,y);p(g)}b&&console.log("React Flow: trigger node changes",d),f==null||f(d)}},triggerEdgeChanges:d=>{const{onEdgesChange:f,setEdges:p,edges:y,hasDefaultEdges:v,debug:b}=u();if(d!=null&&d.length){if(v){const g=sL(d,y);p(g)}b&&console.log("React Flow: trigger edge changes",d),f==null||f(d)}},addSelectedNodes:d=>{const{multiSelectionActive:f,edgeLookup:p,nodeLookup:y,triggerNodeChanges:v,triggerEdgeChanges:b}=u();if(f){const g=d.map(m=>zs(m,!0));v(g);return}v(Uo(y,new Set([...d]),!0)),b(Uo(p))},addSelectedEdges:d=>{const{multiSelectionActive:f,edgeLookup:p,nodeLookup:y,triggerNodeChanges:v,triggerEdgeChanges:b}=u();if(f){const g=d.map(m=>zs(m,!0));b(g);return}b(Uo(p,new Set([...d]))),v(Uo(y,new Set,!0))},unselectNodesAndEdges:({nodes:d,edges:f}={})=>{const{edges:p,nodes:y,nodeLookup:v,triggerNodeChanges:b,triggerEdgeChanges:g}=u(),m=d||y,x=f||p,w=m.map(N=>{const k=v.get(N.id);return k&&(k.selected=!1),zs(N.id,!1)}),E=x.map(N=>zs(N.id,!1));b(w),g(E)},setMinZoom:d=>{const{panZoom:f,maxZoom:p}=u();f==null||f.setScaleExtent([d,p]),c({minZoom:d})},setMaxZoom:d=>{const{panZoom:f,minZoom:p}=u();f==null||f.setScaleExtent([p,d]),c({maxZoom:d})},setTranslateExtent:d=>{var f;(f=u().panZoom)==null||f.setTranslateExtent(d),c({translateExtent:d})},setPaneClickDistance:d=>{var f;(f=u().panZoom)==null||f.setClickDistance(d)},resetSelectedElements:()=>{const{edges:d,nodes:f,triggerNodeChanges:p,triggerEdgeChanges:y}=u(),v=f.reduce((g,m)=>m.selected?[...g,zs(m.id,!1)]:g,[]),b=d.reduce((g,m)=>m.selected?[...g,zs(m.id,!1)]:g,[]);p(v),y(b)},setNodeExtent:d=>{const{nodes:f,nodeLookup:p,parentLookup:y,nodeOrigin:v,elevateNodesOnSelect:b,nodeExtent:g}=u();d[0][0]===g[0][0]&&d[0][1]===g[0][1]&&d[1][0]===g[1][0]&&d[1][1]===g[1][1]||(Zp(f,p,y,{nodeOrigin:v,nodeExtent:d,elevateNodesOnSelect:b,checkEquality:!1}),c({nodeExtent:d}))},panBy:d=>{const{transform:f,width:p,height:y,panZoom:v,translateExtent:b}=u();return lF({delta:d,panZoom:v,transform:f,translateExtent:b,width:p,height:y})},fitView:d=>{const{panZoom:f,width:p,height:y,minZoom:v,maxZoom:b,nodeLookup:g}=u();if(!f)return Promise.resolve(!1);const m=qp(g,d);return Kp({nodes:m,width:p,height:y,panZoom:f,minZoom:v,maxZoom:b},d)},fitViewSync:d=>{const{panZoom:f,width:p,height:y,minZoom:v,maxZoom:b,nodeLookup:g}=u();if(!f)return!1;const m=qp(g,d);return Kp({nodes:m,width:p,height:y,panZoom:f,minZoom:v,maxZoom:b},d),m.size>0},cancelConnection:()=>{c({connection:{...Zk}})},updateConnection:d=>{c({connection:d})},reset:()=>c({...ow()})}),Object.is);function w3({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:i,nodeOrigin:l,nodeExtent:a,children:c}){const[u]=S.useState(()=>v3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,nodeOrigin:l,nodeExtent:a}));return h.jsx(DF,{value:u,children:h.jsx(aL,{children:c})})}function b3({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,nodeOrigin:a,nodeExtent:c}){return S.useContext(Ud)?h.jsx(h.Fragment,{children:e}):h.jsx(w3,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,nodeOrigin:a,nodeExtent:c,children:e})}const S3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function E3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:a,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:y,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:g,onNodeMouseEnter:m,onNodeMouseMove:x,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:P,onNodesDelete:I,onEdgesDelete:z,onDelete:$,onSelectionChange:A,onSelectionDragStart:R,onSelectionDrag:j,onSelectionDragStop:_,onSelectionContextMenu:F,onSelectionStart:T,onSelectionEnd:M,onBeforeDelete:O,connectionMode:U,connectionLineType:L=Zr.Bezier,connectionLineStyle:K,connectionLineComponent:W,connectionLineContainerStyle:q,deleteKeyCode:H="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:B=!1,selectionMode:Y=ia.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:Z=Gu()?"Meta":"Control",zoomActivationKeyCode:V=Gu()?"Meta":"Control",snapToGrid:X,snapGrid:ee,onlyRenderVisibleElements:he=!1,selectNodesOnDrag:Pe,nodesDraggable:ce,nodesConnectable:ve,nodesFocusable:ue,nodeOrigin:Re=PC,edgesFocusable:ye,edgesReconnectable:ze,elementsSelectable:Ie=!0,defaultViewport:et=QF,minZoom:lt=.5,maxZoom:re=2,translateExtent:se=oa,preventScrolling:De=!0,nodeExtent:we,defaultMarkerColor:at="#b1b1b7",zoomOnScroll:nn=!0,zoomOnPinch:qt=!0,panOnScroll:ne=!1,panOnScrollSpeed:Be=.5,panOnScrollMode:je=no.Free,zoomOnDoubleClick:zt=!0,panOnDrag:gn=!0,onPaneClick:qn,onPaneMouseEnter:Kn,onPaneMouseMove:Eo,onPaneMouseLeave:ko,onPaneScroll:Co,onPaneContextMenu:Ma,paneClickDistance:ke=0,nodeClickDistance:yt=0,children:Kt,onReconnect:Rt,onReconnectStart:xn,onReconnectEnd:rn,onEdgeContextMenu:No,onEdgeDoubleClick:Hr,onEdgeMouseEnter:Ro,onEdgeMouseMove:Yn,onEdgeMouseLeave:jn,reconnectRadius:js=10,onNodesChange:To,onEdgesChange:Wi,noDragClassName:Aa="nodrag",noWheelClassName:za="nowheel",noPanClassName:Ui="nopan",fitView:qi,fitViewOptions:Da,connectOnClick:$a,attributionPosition:Qd,proOptions:Xd,defaultEdgeOptions:NN,elevateNodesOnSelect:RN,elevateEdgesOnSelect:TN,disableKeyboardA11y:N0=!1,autoPanOnConnect:PN,autoPanOnNodeDrag:IN,autoPanSpeed:jN,connectionRadius:_N,isValidConnection:ON,onError:MN,style:AN,id:R0,nodeDragThreshold:zN,viewport:DN,onViewportChange:$N,width:FN,height:LN,colorMode:HN="light",debug:BN,...VN},WN){const Zd=R0||"1",UN=eL(HN);return h.jsx("div",{"data-testid":"rf__wrapper",...VN,style:{...AN,...S3},ref:WN,className:dt(["react-flow",s,UN]),id:R0,children:h.jsxs(b3,{nodes:e,edges:t,width:FN,height:LN,fitView:qi,nodeOrigin:Re,nodeExtent:we,children:[h.jsx(y3,{onInit:c,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:m,onNodeMouseMove:x,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:o,edgeTypes:i,connectionLineType:L,connectionLineStyle:K,connectionLineComponent:W,connectionLineContainerStyle:q,selectionKeyCode:G,selectionOnDrag:B,selectionMode:Y,deleteKeyCode:H,multiSelectionKeyCode:Z,panActivationKeyCode:Q,zoomActivationKeyCode:V,onlyRenderVisibleElements:he,defaultViewport:et,translateExtent:se,minZoom:lt,maxZoom:re,preventScrolling:De,zoomOnScroll:nn,zoomOnPinch:qt,zoomOnDoubleClick:zt,panOnScroll:ne,panOnScrollSpeed:Be,panOnScrollMode:je,panOnDrag:gn,onPaneClick:qn,onPaneMouseEnter:Kn,onPaneMouseMove:Eo,onPaneMouseLeave:ko,onPaneScroll:Co,onPaneContextMenu:Ma,paneClickDistance:ke,nodeClickDistance:yt,onSelectionContextMenu:F,onSelectionStart:T,onSelectionEnd:M,onReconnect:Rt,onReconnectStart:xn,onReconnectEnd:rn,onEdgeContextMenu:No,onEdgeDoubleClick:Hr,onEdgeMouseEnter:Ro,onEdgeMouseMove:Yn,onEdgeMouseLeave:jn,reconnectRadius:js,defaultMarkerColor:at,noDragClassName:Aa,noWheelClassName:za,noPanClassName:Ui,rfId:Zd,disableKeyboardA11y:N0,nodeExtent:we,viewport:DN,onViewportChange:$N}),h.jsx(JF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:y,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:g,nodesDraggable:ce,nodesConnectable:ve,nodesFocusable:ue,edgesFocusable:ye,edgesReconnectable:ze,elementsSelectable:Ie,elevateNodesOnSelect:RN,elevateEdgesOnSelect:TN,minZoom:lt,maxZoom:re,nodeExtent:we,onNodesChange:To,onEdgesChange:Wi,snapToGrid:X,snapGrid:ee,connectionMode:U,translateExtent:se,connectOnClick:$a,defaultEdgeOptions:NN,fitView:qi,fitViewOptions:Da,onNodesDelete:I,onEdgesDelete:z,onDelete:$,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:P,onSelectionDrag:j,onSelectionDragStart:R,onSelectionDragStop:_,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:Ui,nodeOrigin:Re,rfId:Zd,autoPanOnConnect:PN,autoPanOnNodeDrag:IN,autoPanSpeed:jN,onError:MN,connectionRadius:_N,isValidConnection:ON,selectNodesOnDrag:Pe,nodeDragThreshold:zN,onBeforeDelete:O,paneClickDistance:ke,debug:BN}),h.jsx(GF,{onSelectionChange:A}),Kt,h.jsx(WF,{proOptions:Xd,position:Qd}),h.jsx(BF,{rfId:Zd,disableKeyboardA11y:N0})]})})}var k3=jC(E3);function C3({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:dt(["react-flow__background-pattern",n,r])})}function N3({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:dt(["react-flow__background-pattern","dots",t])})}var Pr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Pr||(Pr={}));const R3={[Pr.Dots]:1,[Pr.Lines]:1,[Pr.Cross]:6},T3=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function tN({id:e,variant:t=Pr.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:a,className:c,patternClassName:u}){const d=S.useRef(null),{transform:f,patternId:p}=Oe(T3,it),y=r||R3[t],v=t===Pr.Dots,b=t===Pr.Cross,g=Array.isArray(n)?n:[n,n],m=[g[0]*f[2]||1,g[1]*f[2]||1],x=y*f[2],w=Array.isArray(o)?o:[o,o],E=b?[x,x]:m,N=[w[0]*f[2]||1+E[0]/2,w[1]*f[2]||1+E[1]/2],k=`${p}${e||""}`;return h.jsxs("svg",{className:dt(["react-flow__background",c]),style:{...a,...qd,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[h.jsx("pattern",{id:k,x:f[0]%m[0],y:f[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:v?h.jsx(N3,{radius:x/2,className:u}):h.jsx(C3,{dimensions:E,lineWidth:s,variant:t,className:u})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}tN.displayName="Background";const P3=S.memo(tN);function I3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function j3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function _3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 O3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 M3(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 Nc({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:dt(["react-flow__controls-button",t]),...n,children:e})}const A3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function nN({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:l,onInteractiveChange:a,className:c,children:u,position:d="bottom-left",orientation:f="vertical","aria-label":p="React Flow controls"}){const y=Ye(),{isInteractive:v,minZoomReached:b,maxZoomReached:g}=Oe(A3,it),{zoomIn:m,zoomOut:x,fitView:w}=b0(),E=()=>{m(),o==null||o()},N=()=>{x(),i==null||i()},k=()=>{w(s),l==null||l()},C=()=>{y.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),a==null||a(!v)},P=f==="horizontal"?"horizontal":"vertical";return h.jsxs(w0,{className:dt(["react-flow__controls",P,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":p,children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Nc,{onClick:E,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:g,children:h.jsx(I3,{})}),h.jsx(Nc,{onClick:N,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b,children:h.jsx(j3,{})})]}),n&&h.jsx(Nc,{className:"react-flow__controls-fitview",onClick:k,title:"fit view","aria-label":"fit view",children:h.jsx(_3,{})}),r&&h.jsx(Nc,{className:"react-flow__controls-interactive",onClick:C,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?h.jsx(M3,{}):h.jsx(O3,{})}),u]})}nN.displayName="Controls";const z3=S.memo(nN);function D3({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:a,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){const{background:y,backgroundColor:v}=o||{},b=i||y||v;return h.jsx("rect",{className:dt(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:r,height:s,style:{fill:b,stroke:l,strokeWidth:a},shapeRendering:d,onClick:p?g=>p(g,e):void 0})}const $3=S.memo(D3),F3=e=>e.nodes.map(t=>t.id),th=e=>e instanceof Function?e:()=>e;function L3({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=$3,onClick:i}){const l=Oe(F3,it),a=th(t),c=th(e),u=th(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(f=>h.jsx(B3,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:d},f))})}function H3({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:a}){const{node:c,x:u,y:d,width:f,height:p}=Oe(y=>{const v=y.nodeLookup.get(e),{x:b,y:g}=v.internals.positionAbsolute,{width:m,height:x}=Lr(v);return{node:v,x:b,y:g,width:m,height:x}},it);return!c||c.hidden||!lC(c)?null:h.jsx(l,{x:u,y:d,width:f,height:p,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:s,strokeColor:n(c),strokeWidth:o,shapeRendering:i,onClick:a,id:c.id})}const B3=S.memo(H3);var V3=S.memo(L3);const W3=200,U3=150,q3=e=>{const 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]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?oC(_a(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},K3="react-flow__minimap-desc";function rN({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:a,maskColor:c,maskStrokeColor:u,maskStrokeWidth:d,position:f="bottom-right",onClick:p,onNodeClick:y,pannable:v=!1,zoomable:b=!1,ariaLabel:g="React Flow mini map",inversePan:m,zoomStep:x=10,offsetScale:w=5}){const E=Ye(),N=S.useRef(null),{boundingRect:k,viewBB:C,rfId:P,panZoom:I,translateExtent:z,flowWidth:$,flowHeight:A}=Oe(q3,it),R=(e==null?void 0:e.width)??W3,j=(e==null?void 0:e.height)??U3,_=k.width/R,F=k.height/j,T=Math.max(_,F),M=T*R,O=T*j,U=w*T,L=k.x-(M-k.width)/2-U,K=k.y-(O-k.height)/2-U,W=M+U*2,q=O+U*2,H=`${K3}-${P}`,G=S.useRef(0),B=S.useRef();G.current=T,S.useEffect(()=>{if(N.current&&I)return B.current=mF({domNode:N.current,panZoom:I,getTransform:()=>E.getState().transform,getViewScale:()=>G.current}),()=>{var Z;(Z=B.current)==null||Z.destroy()}},[I]),S.useEffect(()=>{var Z;(Z=B.current)==null||Z.update({translateExtent:z,width:$,height:A,inversePan:m,pannable:v,zoomStep:x,zoomable:b})},[v,b,m,x,z,$,A]);const Y=p?Z=>{var ee;const[V,X]=((ee=B.current)==null?void 0:ee.pointer(Z))||[0,0];p(Z,{x:V,y:X})}:void 0,Q=y?S.useCallback((Z,V)=>{const X=E.getState().nodeLookup.get(V);y(Z,X)},[]):void 0;return h.jsx(w0,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*T: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 i=="string"?i:void 0},className:dt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:R,height:j,viewBox:`${L} ${K} ${W} ${q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":H,ref:N,onClick:Y,children:[g&&h.jsx("title",{id:H,children:g}),h.jsx(V3,{onClick:Q,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${L-U},${K-U}h${W+U*2}v${q+U*2}h${-W-U*2}z
62
- M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}rN.displayName="MiniMap";S.memo(rN);function Y3({nodeId:e,position:t,variant:n=Il.Handle,className:r,style:s={},children:o,color:i,minWidth:l=10,minHeight:a=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,shouldResize:f,onResizeStart:p,onResize:y,onResizeEnd:v}){const b=AC(),g=typeof e=="string"?e:b,m=Ye(),x=S.useRef(null),w=n===Il.Line?"right":"bottom-right",E=t??w,N=S.useRef(null);S.useEffect(()=>{if(!(!x.current||!g))return N.current||(N.current=IF({domNode:x.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:I,transform:z,snapGrid:$,snapToGrid:A,nodeOrigin:R,domNode:j}=m.getState();return{nodeLookup:I,transform:z,snapGrid:$,snapToGrid:A,nodeOrigin:R,paneDomNode:j}},onChange:(I,z)=>{const{triggerNodeChanges:$,nodeLookup:A,parentLookup:R,nodeOrigin:j}=m.getState(),_=[],F={x:I.x,y:I.y},T=A.get(g);if(T&&T.expandParent&&T.parentId){const M=T.origin??j,O=I.width??T.measured.width,U=I.height??T.measured.height,L={id:T.id,parentId:T.parentId,rect:{width:O,height:U,...aC({x:I.x??T.position.x,y:I.y??T.position.y},{width:O,height:U},T.parentId,A,M)}},K=v0([L],A,R,j);_.push(...K),F.x=I.x?Math.max(M[0]*O,I.x):void 0,F.y=I.y?Math.max(M[1]*U,I.y):void 0}if(F.x!==void 0&&F.y!==void 0){const M={id:g,type:"position",position:{...F}};_.push(M)}if(I.width!==void 0&&I.height!==void 0){const M={id:g,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:I.width,height:I.height}};_.push(M)}for(const M of z){const O={...M,type:"position"};_.push(O)}$(_)},onEnd:()=>{const I={id:g,type:"dimensions",resizing:!1};m.getState().triggerNodeChanges([I])}})),N.current.update({controlPosition:E,boundaries:{minWidth:l,minHeight:a,maxWidth:c,maxHeight:u},keepAspectRatio:d,onResizeStart:p,onResize:y,onResizeEnd:v,shouldResize:f}),()=>{var I;(I=N.current)==null||I.destroy()}},[E,l,a,c,u,d,p,y,v,f]);const k=E.split("-"),C=n===Il.Line?"borderColor":"backgroundColor",P=i?{...s,[C]:i}:s;return h.jsx("div",{className:dt(["react-flow__resize-control","nodrag",...k,n,r]),ref:x,style:P,children:o})}S.memo(Y3);const G3=new Set,iw=[];function Q3(e){return e.startsWith("signal:child:")}function X3(e){const t=mo(),n=(()=>{const r=new Set(e),s=e.size+ak,o=[...e];for(;o.length>0&&r.size<s;){const i=o.shift();if(i===void 0)continue;const l=t.getQueryData(["run",i]);if(l!==void 0)for(const a of n0(l.timeline)){if(r.size>=s)break;r.has(a)||(r.add(a),o.push(a))}}return[...r].sort()})();return mm({queries:n.map(r=>({queryKey:["run",r],queryFn:()=>$e.run(r)})),combine:uk})}function Z3({data:e}){const t=e.status==="failed",n=e.status==="pending"||e.status==="running",r=!!e.childRunId,s=!!e.collapsed,o=r&&!s,i=o?ug:dg(e.kind),l=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 h.jsxs("div",{title:o?yp.child:yp[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":o?"border-indigo-500/40 hover:border-indigo-400/60":"border-line hover:border-zinc-600"}`,children:[h.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${l.rail} ${n?"animate-pulse":""}`}),h.jsx(ar,{type:"target",position:de.Left,className:"!border-0 !bg-zinc-600"}),h.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${l.badge}`,children:h.jsx(i,{width:12,height:12})}),h.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:e.name}),h.jsx("span",{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${l.pill} ${n?"animate-pulse":""}`,children:t?h.jsx(Ss,{width:9,height:9}):n?h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}):h.jsx(cg,{width:9,height:9})})]}),h.jsxs("div",{className:"mono mt-1.5 flex items-center gap-1.5 text-[10px] text-zinc-500",children:[r?h.jsxs("span",{className:"flex items-center gap-1",children:[!s&&h.jsx("button",{type:"button",onClick:a=>{var c;a.stopPropagation(),e.childRunId&&((c=e.onToggleChild)==null||c.call(e,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:h.jsx("span",{className:"inline-block text-[9px] transition-transform",style:{transform:e.childExpanded?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),h.jsx("button",{type:"button",onClick:a=>{var c;a.stopPropagation(),e.childRunId&&((c=e.onOpenRun)==null||c.call(e,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 ↗"})]}):h.jsx("span",{className:"rounded border border-line px-1 text-zinc-400",children:e.kind}),e.attempts>1&&h.jsxs("span",{className:"flex items-center gap-0.5 text-amber-300",children:[h.jsx(ku,{width:9,height:9}),e.attempts]}),e.workerGroup&&h.jsxs("span",{className:"truncate",children:["@",e.workerGroup]}),h.jsxs("span",{className:"tnum ml-auto text-zinc-400",children:["#",e.seq,e.duration&&h.jsxs("span",{className:"text-zinc-600",children:[" · ",e.duration]})]})]}),e.subs&&h.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&&h.jsxs("span",{className:"text-emerald-300",children:[e.subs.ok," ok"]}),e.subs.failed>0&&h.jsxs("span",{className:"text-red-300",children:[e.subs.failed," failed"]}),e.subs.skipped>0&&h.jsxs("span",{className:"text-amber-300",children:[e.subs.skipped," skipped"]})]})]}),h.jsx(ar,{type:"source",position:de.Right,className:"!border-0 !bg-zinc-600"})]})}function J3({data:e}){const{fan:t}=e,n=r0(t,e.runFinished),r=s0(t,e.runFinished),s=r==="failed",o=r==="pending"||r==="running",i=s?"bg-red-400":o?"bg-live":"bg-emerald-400",l=a=>`${a/Math.max(n.total,1)*100}%`;return h.jsxs("div",{title:`parallel fan ${t.group}`,className:`relative w-[208px] overflow-hidden rounded-xl border bg-panel/95 shadow-lg backdrop-blur ${s?"border-red-500/40":"border-indigo-500/40"}`,children:[h.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${i} ${o?"animate-pulse":""}`}),h.jsx(ar,{type:"target",position:de.Left,className:"!border-0 !bg-zinc-600"}),h.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"grid h-5 w-5 shrink-0 place-items-center rounded bg-indigo-500/15 text-[11px] text-indigo-300",children:"⑃"}),h.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:t.label}),h.jsx("span",{className:"mono tnum ml-auto shrink-0 text-[11px] text-zinc-400",children:hk(n)})]}),h.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-full bg-zinc-800",children:zu.map(a=>h.jsx("span",{className:a.className,style:{width:l(n[a.key])}},a.key))}),h.jsxs("div",{className:"mono tnum mt-1.5 flex flex-wrap items-center gap-2 text-[10px]",children:[zu.map(a=>n[a.key]>0?h.jsxs("span",{className:a.text,children:[n[a.key]," ",a.label,a.key==="skipped"&&t.failFast?" (failFast)":""]},a.key):null),h.jsxs("span",{className:"ml-auto text-zinc-500",children:["#",t.firstSeq,"–",t.lastSeq]})]})]}),h.jsx(ar,{type:"source",position:de.Right,className:"!border-0 !bg-zinc-600"})]})}function e4({data:e}){const t=e.status==="running"||e.status==="awaiting";return h.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:[h.jsx(ar,{type:"target",position:de.Left,className:"!border-0 !bg-zinc-600"}),h.jsx("span",{className:`dot ${t?"pulse":""}`}),h.jsx("span",{className:"mono text-[11px] uppercase tracking-wider",children:e.label}),h.jsx(ar,{type:"source",position:de.Right,className:"!border-0 !bg-zinc-600"})]})}const t4={step:Z3,fan:J3,terminal:e4};function n4(e){var n;const t=(n=e.events)==null?void 0:n.filter(r=>r.status);if(!(!t||t.length===0))return{ok:t.filter(r=>r.status==="ok").length,failed:t.filter(r=>r.status==="failed").length,skipped:t.filter(r=>r.status==="skipped").length}}const r4=S.memo(function({run:t,timeline:n,fans:r=iw,endStatus:s,selectedKey:o,onSelect:i,onOpenRun:l,fmtDuration:a,expanded:c,onToggleChild:u}){const d=c??G3,f=S.useMemo(()=>{const g=new Set(d);for(const m of n0(n))g.add(m);return g},[d,n]),p=X3(f),{nodes:y,edges:v}=S.useMemo(()=>{const w=[],E=[],N=t.status==="running"||t.status==="suspended",k=(j,_,F)=>({id:`${j}->${_}`,source:j,target:_,style:{stroke:F?"#f87171":"var(--line)",strokeWidth:1.5}}),C=(j,_)=>({id:`${j}=>${_}`,source:j,target:_,style:{stroke:"#818cf8",strokeWidth:1.5,strokeDasharray:"4 3"}});function P(j,_,F,T,M,O){const U=`${M}s${j.seq}`,L=bo(j),K=L!==void 0?p[L]:void 0,W=K!==void 0&&K.timeline.length===1&&K.timeline[0]?{step:K.timeline[0],run:K.run}:void 0,q=W!==void 0,H=!q&&L!==void 0&&d.has(L),G=W?W.step:j,B=W?W.run:O,Y=W?W.step.name:L!==void 0?(K==null?void 0:K.run.workflow)??ck(L,j.runId):dk(j),Q=G.status==="failed";w.push({id:U,type:"step",draggable:!1,position:{x:_,y:F},data:{seq:G.seq,name:Y,kind:G.kind,status:G.status,workerGroup:G.workerGroup,attempts:G.attempts,duration:a(G.startedAt,G.finishedAt),subs:n4(G),selected:o===`${G.runId}#${G.seq}`,childRunId:L,onOpenRun:l,childExpanded:H,onToggleChild:u,collapsed:q,depth:T,step:G,laneRun:B}});const Z=H?K:void 0;if(Z){const V=I(Z.timeline,Z.fans??iw,T+1,_+248,F+150,`${L}:`,Z.run);for(const ee of V.firstIds)E.push(C(U,ee));const X=Q3(j.name)&&V.connectors.length>0?V.connectors:[{id:U,failed:Q}];return{id:U,exits:X,nextX:Math.max(_+248,V.nextX),bottomY:Math.max(F,V.bottomY)}}return{id:U,exits:[{id:U,failed:Q}],nextX:_+248,bottomY:F}}function I(j,_,F,T,M,O,U){let L=T;const K=[];let W=[],q=M;for(const H of fk(j,_)){if(H.kind==="summary"){const V=`${O}fan:${H.fan.group}`;w.push({id:V,type:"fan",draggable:!1,position:{x:L,y:M},data:{fan:H.fan,runFinished:Dp(U.status),depth:F}}),K.length===0&&K.push(V);for(const X of W)E.push(k(X.id,V,X.failed));W=[{id:V,failed:s0(H.fan,Dp(U.status))==="failed"}],L+=248;continue}const G=H.kind==="single"?[H.step]:H.steps,B=K.length===0,Y=[];let Q=M,Z=L;for(const V of G){const X=P(V,L,Q,F,O,U);B&&K.push(X.id);for(const ee of W)E.push(k(ee.id,X.id,ee.failed));Y.push(...X.exits),Z=Math.max(Z,X.nextX),Q=X.bottomY+96}W=Y,L=Z,q=Math.max(q,Q-96)}return{firstIds:K,connectors:W,nextX:L,bottomY:q}}const z=248;w.push({id:"start",type:"terminal",position:{x:0,y:0},draggable:!1,data:{status:"running",label:t.workflow}});const $=I(n,r,0,z,0,"",t);for(const j of $.firstIds)E.push({id:`start->${j}`,source:"start",target:j});const A=s??GI(t,n);w.push({id:"end",type:"terminal",position:{x:Math.max($.nextX,z),y:0},draggable:!1,data:{status:A,label:A}});const R=$.connectors.length>0?$.connectors:[{id:"start",failed:!1}];for(const j of R)E.push({id:`${j.id}->end`,source:j.id,target:"end",animated:N,style:{stroke:N?"var(--live)":"var(--line)",strokeWidth:N?2:1.5}});return{nodes:w,edges:E}},[t,n,r,s,o,l,a,d,u,p]),b=S.useCallback((g,m)=>{if(m.type!=="step")return;const x=m.data;x.step&&x.laneRun&&i(x.step,x.laneRun)},[i]);return h.jsxs(k3,{nodes:y,edges:v,nodeTypes:t4,onNodeClick:b,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,onlyRenderVisibleElements:!0,children:[h.jsx(P3,{variant:Pr.Dots,gap:22,size:1,color:"#1c1c22"}),h.jsx(z3,{showInteractive:!1,position:"bottom-right"})]})});function tm(e,t){var n;return((n=e==null?void 0:e.capabilities)==null?void 0:n[t])!==!1}function sN(){const{data:e}=Xt({queryKey:["topology"],queryFn:()=>$e.topology(),staleTime:Number.POSITIVE_INFINITY});return e}function oN(){const e=sN();return t=>tm(e,t)}function s4(e){return!e.hasMore||e.loading||e.requestedAtCount===e.loadedCount?!1:e.lastRenderedIndex>=e.loadedCount-1-e.loadAhead}function Kc(e){const t=e.lastIndexOf("~retry~");return t===-1?void 0:e.slice(0,t)}function Rc(e){const n=(Kc(e)??e).match(/^(.*)\.(?:child\.\d+|onError\.\d+)$/);return(n==null?void 0:n[1])||void 0}function o4(e,t){var n;return((n=e[t])==null?void 0:n.id)??t}function i4(e){return JSON.stringify([e.status,e.tag,e.attrs,e.namespace,e.origin])}const iN=S.createContext(void 0);function So(e){const t=S.useContext(iN);if(!e&&t===void 0)throw new Error(tn(27));return t}const l4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,forceRender:i=!1,...l}=t,a=So(),c=a.useState("open"),u=a.useState("nested"),d=a.useState("mounted"),f=a.useState("transitionStatus");return Ut("div",t,{state:{open:c,transitionStatus:f},ref:[a.context.backdropRef,n],stateAttributesMapping:Sg,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:i||!u})}),a4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,...a}=t,c=So(),u=c.useState("open"),{getButtonProps:d,buttonRef:f}=Zg({disabled:i,native:l}),p={disabled:i};function y(v){u&&c.setOpen(!1,Me(US,v.nativeEvent))}return Ut("button",t,{state:p,ref:[n,f],props:[{onClick:y},a,d]})}),c4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=So(),c=Vi(i);return a.useSyncedValueWithCleanup("descriptionElementId",c),Ut("p",t,{ref:n,props:[{id:c},l]})}),lN=S.createContext(void 0);function u4(){const e=S.useContext(lN);if(e===void 0)throw new Error(tn(26));return e}const d4="--nested-dialogs",f4="data-nested-dialog-open",h4={...bg,...wg,nestedDialogOpen(e){return e?{[f4]:""}:null}},p4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,finalFocus:i,initialFocus:l,...a}=t,c=So(),u=c.useState("descriptionElementId"),d=c.useState("disablePointerDismissal"),f=c.useState("floatingRootContext"),p=c.useState("popupProps"),y=c.useState("modal"),v=c.useState("mounted"),b=c.useState("nested"),g=c.useState("nestedOpenDialogCount"),m=c.useState("open"),x=c.useState("openMethod"),w=c.useState("titleElementId"),E=c.useState("transitionStatus"),N=c.useState("role"),k=f.useState("floatingId");u4(),Ra({open:m,ref:c.context.popupRef,onComplete(){var A,R;m&&((R=(A=c.context).onOpenChangeComplete)==null||R.call(A,!0))}});const C=l===void 0?LE(c.context.popupRef):l,P=g>0,I=c.useStateSetter("popupElement"),$=Ut("div",t,{state:{open:m,nested:b,transitionStatus:E,nestedDialogOpen:P},props:[p,{id:k,"aria-labelledby":w,"aria-describedby":u,role:N,...$g,hidden:!v,onKeyDown(A){t0.has(A.key)&&A.stopPropagation()},style:{[d4]:g}},a],ref:[n,c.context.popupRef,I],stateAttributesMapping:h4});return h.jsx(EE,{context:f,openInteractionType:x,disabled:!v,closeOnFocusOut:!d,initialFocus:C,returnFocus:i,modal:y!==!1,restoreFocus:"popup",children:$})}),m4=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,o=So(),i=o.useState("mounted"),l=o.useState("modal"),a=o.useState("open");return i||r?h.jsx(lN.Provider,{value:r,children:h.jsxs(vE,{ref:n,...s,children:[i&&l===!0&&h.jsx(rk,{ref:o.context.internalBackdropRef,inert:Jg(!a)}),t.children]})}):null});function g4({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),o=e.useState("modal"),i=e.useState("popupElement"),l=e.useState("floatingRootContext"),[a,c]=S.useState(0),[u,d]=S.useState(0),f=a===0,p=zg(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(y){if(!e.context.outsidePressEnabledRef.current||"button"in y&&y.button!==0)return!1;if("touches"in y){if(y.type==="touchend"){if(y.changedTouches.length!==1||y.touches.length!==0)return!1}else if(y.touches.length!==1)return!1}const v=Mt(y);if(f&&!s){if(o){const b=e.context.internalBackdropRef.current,g=e.context.backdropRef.current;return b||g?b===v||g===v||xe(v,i)&&!(v!=null&&v.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:f});return ok(r&&o===!0,i),e.useContextCallback("onNestedDialogOpen",(y,v)=>{c(y),d(v)}),fe(()=>(t!=null&&t.onNestedDialogOpen&&(r?t.onNestedDialogOpen(a+1,u+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,a,u,t]),Wg(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:a,nestedOpenDrawerCount:u}),null}const x4={...Yg,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};class y4 extends jd{constructor(n,r,s){const o=new Ug,i=v4(n,o,r,s);super(i,w4(o),x4);ge(this,"setOpen",(n,r)=>{var s,o;r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,r),!r.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(n,r),this.update(Hg(this.state,n,r.trigger)))})}}function v4(e,t,n,r=!1){return{...qg(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 w4(e){return{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function b4(e,t){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:i,disablePointerDismissal:l=!1,modal:a=!0,actionsRef:c,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e==="drawer",y=a,v=l,b="dialog",g=So(!0),m=g!=null,x={modal:y,disablePointerDismissal:v,nested:m,role:b},w=Fg((I,z)=>new y4({open:s,openProp:r,activeTriggerId:f,triggerIdProp:d,...x},I,z),!0);w.useControlledProp("openProp",r),w.useControlledProp("triggerIdProp",d),w.useSyncedValues(x),w.useContextCallback("onOpenChange",o),w.useContextCallback("onOpenChangeComplete",i);const E=w.useState("open"),N=w.useState("mounted"),k=w.useState("payload");VE(w,E),Bg(w);const{forceUnmount:C}=Vg(E,w);S.useImperativeHandle(c,()=>({unmount:C,close:()=>w.setOpen(!1,Me(Eg))}),[C,w]);const P=E||N;return h.jsxs(iN.Provider,{value:w,children:[u&&h.jsx(Lg,{handle:u,store:w}),P&&h.jsx(g4,{store:w,parentContext:g==null?void 0:g.context,isDrawer:p}),typeof n=="function"?n({payload:k}):n]})}const S4=gd(function(t){return b4("dialog",t)}),E4=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=So(),c=Vi(i);return a.useSyncedValueWithCleanup("titleElementId",c),Ut("h2",t,{ref:n,props:[{id:c},l]})}),k4=S4,C4=a4;function lw({open:e,onOpenChange:t,title:n,subtitle:r,footer:s,children:o,className:i}){return h.jsx(k4,{open:e,onOpenChange:t,children:h.jsxs(m4,{children:[h.jsx(l4,{className:"fixed inset-0 z-40 bg-black/60 backdrop-blur-sm"}),h.jsxs(p4,{className:st("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",i),children:[h.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx(E4,{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:n}),r&&h.jsx(c4,{className:"mono mt-1 text-[11px] text-zinc-500",children:r})]}),h.jsx(C4,{render:h.jsx(Se,{variant:"quiet",size:"icon","aria-label":"Close",children:h.jsx(Ss,{})})})]}),h.jsx("div",{className:"px-5 py-4",children:o}),s&&h.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:s})]})]})})}function N4({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=S.useRef(e!==void 0),[o,i]=S.useState(t),l=s&&e!==void 0?e:o,a=S.useCallback(c=>{s||i(c)},[]);return[l,a]}const aN=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function R4(){return S.useContext(aN)}function cN(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,o=me(s),[,i]=S.useState(!1),l=Pn(P4).current,a=Pn(T4).current,c=S.useRef(0),u=S.useRef(!0),d=S.useRef(null),f=S.useRef(null),p=me(()=>{u.current||(u.current=!0,i(E=>!E))}),y=me((E,N)=>{a.set(E,N),p()}),v=me(E=>{a.delete(E),p()}),b=me(E=>{const N=new Map;return n.current.length=0,r&&(r.current.length=0),E.forEach(k=>{var C,P;N.set(k.element,{...k.registration.metadata??{},index:k.index}),n.current[k.index]=k.element,r&&(r.current[k.index]=k.registration.label!==void 0?k.registration.label:((P=(C=k.registration.textRef)==null?void 0:C.current)==null?void 0:P.textContent)??k.element.textContent)}),c.current=n.current.length,N});function g(E){var C;if((C=f.current)==null||C.disconnect(),f.current=null,typeof MutationObserver!="function"||E.length<2)return;const N=new MutationObserver(P=>{if(!_4(P))return;let I=null;for(const z of E)if(z.isConnected){if(I&&uN(I,z)>0){N.disconnect(),p();return}I=z}});f.current=N;const k=new Set;for(let P=1;P<E.length;P+=1){const I=j4(E[P-1],E[P]);I&&k.add(I)}k.forEach(P=>N.observe(P,{childList:!0}))}const m=me(()=>{const[E,N]=I4(a),k=b(E),C=d.current,P=!C||C.length!==E.length||E.some((I,z)=>{const $=C[z];return I.index!==$.index||I.element!==$.element||I.registration.index!==$.registration.index||I.registration.metadata!==$.registration.metadata});g(N),d.current=E,u.current=!1,P&&(l.forEach(I=>I(k)),o(k))});fe(()=>(!u.current&&d.current&&b(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,b]),fe(()=>{u.current&&m()}),fe(()=>()=>{var E;(E=f.current)==null||E.disconnect(),u.current=!0},[]);const x=me(E=>(l.add(E),()=>{l.delete(E)})),w=S.useMemo(()=>({register:y,unregister:v,subscribeMapChange:x,nextIndexRef:c}),[y,v,x,c]);return h.jsx(aN.Provider,{value:w,children:t})}function T4(){return new Map}function P4(){return new Set}function I4(e){const t=new Set,n=[],r=[];e.forEach((o,i)=>{if(!i.isConnected)return;const l=o.index,a={index:l??-1,element:i,registration:o};l===null?r.push(a):l>=0&&(t.add(l),n.push(a))});let s=0;return r.sort((o,i)=>uN(o.element,i.element)),r.forEach(o=>{for(;t.has(s);)s+=1;o.index=s,n.push(o),s+=1}),t.size>0&&n.sort((o,i)=>o.index-i.index),[n,r.map(o=>o.element)]}function j4(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function _4(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function uN(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const dN=S.createContext(void 0);function E0(){const e=S.useContext(dN);if(e===void 0)throw new Error(tn(64));return e}const O4="data-activation-direction",Yd={tabActivationDirection:e=>({[O4]:e})},M4=S.forwardRef(function(t,n){const{className:r,defaultValue:s=0,onValueChange:o,orientation:i="horizontal",render:l,value:a,style:c,...u}=t,d=t.defaultValue!==void 0,f=S.useRef([]),[p,y]=S.useState(()=>new Map),[v,b]=N4({controlled:a,default:s,name:"Tabs",state:"value"}),g=a!==void 0,[m,x]=S.useState(()=>new Map),w=S.useRef(void 0),E=S.useCallback(B=>nm(m,B),[m]),[N,k]=S.useState(()=>({previousValue:v,tabActivationDirection:"none"})),{previousValue:C,tabActivationDirection:P}=N;let I=P,z=!1;C!==v&&(I=aw(C,v,i,m),z=C!=null&&v!=null&&E(v)==null);const $=z?C:v,A=C!==$||P!==I;fe(()=>{A&&k({previousValue:$,tabActivationDirection:I})},[$,A,I]);const R=me((B,Y)=>{const Q=aw(v,B,i,m);Y.activationDirection=Q,o==null||o(B,Y),!Y.isCanceled&&b(B)}),j=me((B,Y)=>{o==null||o(B,Me(Y,void 0,void 0,{activationDirection:"none"}))}),_=me((B,Y)=>(y(Q=>{const Z=new Map(Q);return Z.set(B,Y),Z}),()=>{y(Q=>{if(Q.get(B)!==Y)return Q;const Z=new Map(Q);return Z.delete(B),Z})})),F=S.useCallback(B=>p.get(B),[p]),T=S.useCallback(B=>{for(const Y of m.values())if(B===Y.value)return Y.id},[m]),M=S.useMemo(()=>({getTabElementBySelectedValue:E,getTabIdByPanelValue:T,getTabPanelIdByValue:F,onValueChange:R,orientation:i,registerMountedTabPanel:_,setTabMap:x,tabActivationDirection:I,value:v}),[E,T,F,R,i,_,x,I,v]),O=S.useMemo(()=>{for(const B of m.values())if(B.value===v)return B},[m,v]),U=S.useMemo(()=>{for(const B of m.values())if(!B.disabled)return B.value},[m]),L=S.useRef(!d),K=S.useRef(s),W=S.useRef(d),q=S.useRef(!1);fe(()=>{var V;if(g)return;function B(X,ee){b(X),k({previousValue:X,tabActivationDirection:"none"}),j(X,ee),L.current=!1}if(m.size===0){q.current&&v!==null&&!((V=w.current)!=null&&V.isConnected)&&B(null,dy);return}q.current=!0,w.current=m.keys().next().value;const Y=O==null?void 0:O.disabled,Q=O==null&&v!==null;if(!Y&&v===K.current&&(W.current=!1),W.current&&Y&&v===K.current)return;const Z=L.current;if(Y||Q){const X=U??null;if(v===X){L.current=!1;return}let ee=dy;Z?ee=fy:Y&&(ee=qS),B(X,ee);return}Z&&O!=null&&(j(v,fy),L.current=!1)},[U,g,j,O,b,m,v]);const G=Ut("div",t,{state:{orientation:i,tabActivationDirection:I},ref:n,props:u,stateAttributesMapping:Yd});return h.jsx(dN.Provider,{value:M,children:h.jsx(cN,{elementsRef:f,children:G})})});function nm(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function aw(e,t,n,r){if(e==null||t==null)return"none";const[s,o,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],l=nm(r,e),a=nm(r,t);if(l==null||a==null)return l!==a&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?i:o:"none";const c=l.getBoundingClientRect()[s],u=a.getBoundingClientRect()[s];return u<c?o:u>c?i:"none"}const k0="data-composite-item-active";function fN(e={}){const{guess:t,label:n,metadata:r,textRef:s,index:o}=e,{register:i,unregister:l,subscribeMapChange:a,nextIndexRef:c}=R4(),u=S.useRef(-1),[d,f]=S.useState(o==null&&t?()=>{if(u.current===-1){const b=c.current;c.current+=1,u.current=b}return u.current}:-1),p=o??d,y=S.useRef(null),v=S.useCallback(b=>{const g=y.current;g&&l(g),y.current=b,b&&i(b,{metadata:r??null,index:o??null,label:n,textRef:s})},[o,i,l,r,n,s]);return fe(()=>{if(o==null)return a(b=>{var m;const g=y.current?(m=b.get(y.current))==null?void 0:m.index:null;g!=null&&f(g)})},[o,a]),{ref:v,index:p}}function A4(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Xg(),{ref:s,index:o}=fN(e),i=n===o,l=S.useRef(null),a=Ni(s,l);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(o)},onMouseMove(){const u=l.current;if(!t||!u)return;const d=u.hasAttribute("disabled")||u.ariaDisabled==="true";!i&&!d&&u.focus()}},compositeRef:a,index:o}}const hN=S.createContext(void 0);function z4(){const e=S.useContext(hN);if(e===void 0)throw new Error(tn(65));return e}const D4=S.forwardRef(function(t,n){const{className:r,disabled:s=!1,render:o,value:i,id:l,nativeButton:a=!0,style:c,...u}=t,{value:d,getTabPanelIdByValue:f,onValueChange:p,orientation:y,tabActivationDirection:v}=E0(),{activateOnFocus:b,registerTabResizeObserverElement:g,tabsListElement:m}=z4(),{highlightedIndex:x,onHighlightedIndexChange:w}=Xg(),E=Vi(l),N=S.useMemo(()=>({disabled:s,id:E,value:i}),[s,E,i]),{compositeProps:k,compositeRef:C,index:P}=A4({metadata:N}),I=i===d,z=S.useRef(!1),$=S.useRef(null),A=me(q=>{var H;(H=$.current)==null||H.call($),$.current=q?g(q):null});fe(()=>{if(z.current){z.current=!1;return}if(!(I&&P>-1&&x!==P))return;const q=m;if(q!=null){const H=vn(Fe(q));if(H&&xe(q,H))return}s||w(P)},[I,P,x,w,s,m]);const{getButtonProps:R,buttonRef:j}=Zg({disabled:s,native:a,focusableWhenDisabled:!0}),_=f(i),F=S.useRef(!1),T=S.useRef(!1);function M(q){p(i,Me(Ed,q.nativeEvent,void 0,{activationDirection:"none"}))}function O(q){I||s||M(q)}function U(q){I||s||b&&(!F.current||T.current)&&M(q)}function L(q){if(I||s)return;F.current=!0,T.current=q.button===0;const H=Fe(q.currentTarget);function G(){F.current=!1,T.current=!1,H.removeEventListener("pointerup",G),H.removeEventListener("pointercancel",G)}H.addEventListener("pointerup",G),H.addEventListener("pointercancel",G)}return Ut("button",t,{state:{disabled:s,active:I,orientation:y,tabActivationDirection:v},ref:[n,j,C,A],props:[k,{role:"tab","aria-controls":_,"aria-selected":I,id:E,onClick:O,onFocus:U,onPointerDown:L,[k0]:I?"":void 0,onKeyDownCapture(){z.current=!0}},u,R],stateAttributesMapping:Yd})}),$4="data-index",F4={...Yd,...wg},L4=S.forwardRef(function(t,n){const{className:r,value:s,render:o,keepMounted:i=!1,style:l,...a}=t,{value:c,getTabIdByPanelValue:u,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=E0(),y=Vi(),{ref:v,index:b}=fN(),g=s===c,{mounted:m,transitionStatus:x,setMounted:w}=$E(g),E=!m,N=u(s),k={hidden:E,orientation:d,tabActivationDirection:f,transitionStatus:x},C=S.useRef(null),P=Ut("div",t,{state:k,ref:[n,v,C],props:[{"aria-labelledby":N,hidden:E,id:y,role:"tabpanel",tabIndex:g?0:-1,inert:Jg(!g),[$4]:b},a],stateAttributesMapping:F4});return Ra({open:g,ref:C,onComplete(){g||w(!1)}}),fe(()=>{if(!(y==null||E&&!i))return p(s,y)},[E,i,s,y,p]),i||m?P:null});function H4(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function B4(e){const{loopFocus:t=!0,orientation:n="both",grid:r,onLoop:s,direction:o,highlightedIndex:i,onHighlightedIndexChange:l,rootRef:a,enableHomeAndEndKeys:c=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=Yl}=e,[p,y]=S.useState(0),v=r!=null,b=S.useRef(null),g=Ni(b,a),m=S.useRef([]),x=S.useRef(!1),w=S.useRef(null),E=i??p,N=me((z,$=!1)=>{if(w.current=m.current[z]??null,(l??y)(z),$){const A=m.current[z];Yy(b.current,A,o,n)}}),k=me(z=>{var j;if(z.size===0)return;if(x.current){const _=m.current,F=_.indexOf(w.current);if(F===-1){const T=_[E];!T||Rl(_,E,d)?N(V4(_,d)):w.current=T}else F!==E&&N(F);return}x.current=!0;const $=Array.from(z.keys()),A=$.find(_=>_==null?void 0:_.hasAttribute(k0))??null,R=A?((j=z.get(A))==null?void 0:j.index)??-1:-1;if(R!==-1)N(R);else if(Rl($,E,d)){const _=Nl($,{disabledIndices:d});Af($,_)||N(_)}Yy(b.current,A,o,n)});fe(()=>{if(d==null||i!=null||!x.current)return;const z=m.current;if(Rl(z,E,d)){const $=Nl(z,{disabledIndices:d});Af(z,$)||N($)}},[d,i,E,m,N]);const C=me((z,$,A)=>s?s(z,$,A,m):A),P=me(z=>{const $=z.key===Mp||z.key===Ap;if(!t0.has(z.key)||!c&&$||W4(z,f)||!b.current)return;const R=o==="rtl",j=R?_p:Op,_=R?Op:_p,F=n==="vertical"?jp:j,T=n==="vertical"?Ip:_,M=Mt(z.nativeEvent);if(M!=null&&Ky(M)&&!H4(M)){const q=M.selectionStart,H=M.selectionEnd,G=M.value;if(q==null||z.shiftKey||q!==H||z.key!==T&&q<G.length||z.key!==F&&q>0)return}let O=E;const U=aO(m,d),L=cO(m,d);r!=null&&(O=r({disabledIndices:d,elementsRef:m,event:z,highlightedIndex:E,loopFocus:t,maxIndex:L,minIndex:U,onLoop:C,orientation:n,rtl:R}));const K=n!=="vertical"&&z.key===j||n!=="horizontal"&&z.key===jp,W=n!=="vertical"&&z.key===_||n!=="horizontal"&&z.key===Ip;c&&(z.key===Mp?O=U:z.key===Ap&&(O=L)),O===E&&(K||W)&&(t&&O===L&&K?(O=U,s&&(O=s(z,E,O,m))):t&&O===U&&W?(O=L,s&&(O=s(z,E,O,m))):O=Nl(m.current,{startingIndex:O,decrement:W,disabledIndices:d})),O!==E&&!Af(m.current,O)&&(u&&z.stopPropagation(),(v||$||K||W)&&z.preventDefault(),N(O,!0),queueMicrotask(()=>{var q;(q=m.current[O])==null||q.focus()}))});return{props:{ref:g,onFocus(z){const $=b.current,A=Mt(z.nativeEvent);!$||A==null||!Ky(A)||A.setSelectionRange(0,A.value.length)},onKeyDown:P},highlightedIndex:E,onHighlightedIndexChange:N,elementsRef:m,onMapChange:k,relayKeyboardEvent:P}}function V4(e,t){let n=-1;for(let r=0;r<e.length;r+=1){const s=e[r];if(!(!s||Rl(e,r,t))){if(s.hasAttribute(k0))return r;n===-1&&(n=r)}}return Math.max(n,0)}function W4(e,t){for(const n of rA)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function U4(e){const{render:t,className:n,style:r,refs:s=Yl,props:o=Yl,state:i=Et,stateAttributesMapping:l,highlightedIndex:a,onHighlightedIndexChange:c,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:y,onMapChange:v,stopEventPropagation:b=!0,rootRef:g,disabledIndices:m,modifierKeys:x,highlightItemOnHover:w=!1,tag:E="div",...N}=e,k=ek(),{props:C,highlightedIndex:P,onHighlightedIndexChange:I,elementsRef:z,onMapChange:$,relayKeyboardEvent:A}=B4({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:a,onHighlightedIndexChange:c,rootRef:g,stopEventPropagation:b,enableHomeAndEndKeys:y,direction:k,disabledIndices:m,modifierKeys:x}),R=Ut(E,e,{state:i,ref:s,props:[C,...o,N],stateAttributesMapping:l}),j=S.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:I,highlightItemOnHover:w,relayKeyboardEvent:A}),[P,I,w,A]);return h.jsx(XE.Provider,{value:j,children:h.jsx(cN,{elementsRef:z,onMapChange:_=>{v==null||v(_),$(_)},children:R})})}const q4=S.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:s,loopFocus:o=!0,render:i,style:l,...a}=t,{orientation:c,setTabMap:u,tabActivationDirection:d}=E0(),[f,p]=S.useState(0),[y,v]=S.useState(null),b=S.useRef(new Set),g=S.useRef(new Set),m=S.useRef(null);fe(()=>{if(typeof ResizeObserver>"u")return;const C=new ResizeObserver(()=>{b.current.forEach(P=>{P()})});return m.current=C,y&&C.observe(y),g.current.forEach(P=>{C.observe(P)}),()=>{C.disconnect(),m.current=null}},[y]);const x=me(C=>(b.current.add(C),()=>{b.current.delete(C)})),w=me(C=>{var P;return g.current.add(C),(P=m.current)==null||P.observe(C),()=>{var I;g.current.delete(C),(I=m.current)==null||I.unobserve(C)}}),E={orientation:c,tabActivationDirection:d},N={"aria-orientation":c==="vertical"?"vertical":void 0,role:"tablist"},k=S.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:x,registerTabResizeObserverElement:w,tabsListElement:y}),[r,x,w,y]);return h.jsx(hN.Provider,{value:k,children:h.jsx(U4,{render:i,className:s,style:l,state:E,refs:[n,v],props:[N,a],stateAttributesMapping:Yd,highlightedIndex:f,enableHomeAndEndKeys:!0,loopFocus:o,orientation:c,onHighlightedIndexChange:p,onMapChange:u,disabledIndices:Yl})})}),K4=M4,pN=S.forwardRef(({className:e,...t},n)=>h.jsx(q4,{ref:n,className:st("flex items-center gap-0.5 rounded border border-line bg-zinc-900/60 p-0.5",e),...t}));pN.displayName="TabsList";const mN=S.forwardRef(({className:e,...t},n)=>h.jsx(D4,{ref:n,className:st("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}));mN.displayName="TabsTab";const Yc=S.forwardRef(({className:e,...t},n)=>h.jsx(L4,{ref:n,className:st("focus-visible:outline-none",e),...t}));Yc.displayName="TabsPanel";const gN=S.createContext(void 0);function Gd(e){const t=S.useContext(gN);if(t===void 0&&!e)throw new Error(tn(72));return t}const Y4={...Yg,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class G4 extends jd{constructor(n,r,s){const o=new Ug;super(Q4(n,o,r,s),X4(o),Y4);ge(this,"setOpen",(n,r)=>{dM(this,n,r,{extraState:{openChangeReason:r.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,Me(ks,n))}}function Q4(e,t,n,r=!1){return{...qg(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 X4(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const Z4=gd(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:s,disableHoverablePopup:o=!1,trackCursorAxis:i="none",actionsRef:l,onOpenChange:a,onOpenChangeComplete:c,handle:u,triggerId:d,defaultTriggerId:f=null,children:p}=t,y=Fg((z,$)=>new G4({open:r,openProp:s,activeTriggerId:f,triggerIdProp:d},z,$));y.useControlledProp("openProp",s),y.useControlledProp("triggerIdProp",d),y.useContextCallback("onOpenChange",a),y.useContextCallback("onOpenChangeComplete",c);const v=y.useState("open"),b=!n&&v,g=y.useState("activeTriggerId"),m=y.useState("mounted"),x=y.useState("payload");y.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:o,disabled:n}),Bg(y,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:w,transitionStatus:E}=Vg(b,y),N=y.useState("isInstantPhase"),k=y.useState("instantType"),C=y.useState("lastOpenChangeReason"),P=S.useRef(null);fe(()=>{v&&n&&y.setOpen(!1,Me(qS))},[v,n,y]),fe(()=>{E==="ending"&&C===Ed||E!=="ending"&&N?(k!=="delay"&&(P.current=k),y.set("instantType","delay")):P.current!==null&&(y.set("instantType",P.current),P.current=null)},[E,N,C,k,y]),fe(()=>{b&&g==null&&y.set("payload",void 0)},[y,g,b]),S.useImperativeHandle(l,()=>({unmount:w,close:()=>y.setOpen(!1,Me(Eg))}),[w,y]);const I=b||m||!n&&i!=="none";return h.jsxs(gN.Provider,{value:y,children:[u&&h.jsx(Lg,{handle:u,store:y}),I&&h.jsx(J4,{store:y,disabled:n,trackCursorAxis:i}),typeof p=="function"?p({payload:x}):p]})});function J4({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=zg(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),o=GO(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=S.useMemo(()=>Nd(o.reference,s.reference),[o.reference,s.reference]);return Wg(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:s.floating??Et}),null}const xN=S.createContext(void 0);function e6(){return S.useContext(xN)}const t6=600,yN="data-base-ui-tooltip-trigger";function cw(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const s=n[r];if(Ce(s))return s}}const t=e.target;return Ce(t)?t:null}function n6(e){let t=e;for(;t;){const n=t.closest(`[${yN}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Ce(r.host)?r.host:null}return null}const r6=OS(function(t,n){const{render:r,className:s,style:o,handle:i,payload:l,disabled:a,delay:c,closeOnClick:u=!0,closeDelay:d,id:f,...p}=t,y=Gd(!0),b=UE(i)??y;if(!b)throw new Error(tn(82));const g=Vi(f),m=b.useState("isTriggerActive",g),x=b.useState("isOpenedByTrigger",g),w=b.useState("floatingRootContext"),E=S.useRef(null),N=d??0,{registerTrigger:k,isMountedByThisTrigger:C}=BE(g,E,b,{payload:l,closeOnClick:u,closeDelay:N}),P=e6(),{activeIdRef:I,delayRef:z,isInstantPhase:$,hasProvider:A}=V_(w,{open:x}),R=Qg(w);b.useSyncedValue("isInstantPhase",$);const j=b.useState("disabled"),_=a??j,F=Ht(_),T=b.useState("trackCursorAxis"),M=b.useState("disableHoverablePopup"),O=S.useRef(!1),U=Mr(),L=S.useRef(void 0);function K(){return A&&I.current!=null?0:c??P??t6}function W(X){const ee=E.current;if(!ee||!X)return!1;const he=n6(X);return he!==null&&he!==ee&&xe(ee,he)}function q(X){const ee=W(X);return O.current=ee,ee&&(R.openChangeTimeout.clear(),R.restTimeout.clear(),R.restTimeoutPending=!1,U.clear()),ee}const H=YE(w,{enabled:!_,mouseOnly:!0,move:!1,handleClose:!M&&T!=="both"?GE():null,restMs:K,delay(){return d==null&&A?{close:co(z.current,"close")}:{close:N}},triggerElementRef:E,isActiveTrigger:m,isClosing:()=>b.select("transitionStatus")==="ending",shouldOpen(){return!O.current}}),G=mM(w,{enabled:!_}).reference,B=X=>{const ee=O.current,he=cw(X),Pe=q(he),ce=E.current,ve=ce&&he&&xe(ce,he);if(Pe&&b.select("open")&&b.select("lastOpenChangeReason")===St){b.setOpen(!1,Me(St,X));return}if(ee&&!Pe&&ve&&!F.current&&!b.select("open")&&ce&&ys(L.current)){const ue=()=>{!O.current&&!F.current&&!b.select("open")&&b.setOpen(!0,Me(St,X,ce))},Re=K();Re===0?(U.clear(),ue()):U.start(Re,ue)}},Y=b.useState("triggerProps",C);return Ut("button",t,{state:{open:x},ref:[n,k,E],props:[H,G,C||T!=="none"?Y:void 0,{onMouseOver(X){B(X.nativeEvent)},onFocus(X){W(cw(X.nativeEvent))&&X.preventBaseUIHandler()},onMouseLeave(){O.current=!1,U.clear(),L.current=void 0},onPointerEnter(X){L.current=X.pointerType},onPointerDown(X){L.current=X.pointerType,b.set("closeOnClick",u),u&&!b.select("open")&&b.cancelPendingOpen(X.nativeEvent)},onClick(X){u&&!b.select("open")&&b.cancelPendingOpen(X.nativeEvent)},id:g,[Cp]:_?"":void 0,[yN]:_?void 0:""},p],stateAttributesMapping:BS})}),vN=S.createContext(void 0);function s6(){const e=S.useContext(vN);if(e===void 0)throw new Error(tn(70));return e}const o6=S.forwardRef(function(t,n){const{children:r,container:s,className:o,render:i,style:l,...a}=t,{node:c,subtree:u}=yE({container:s,ref:n,componentProps:t,elementProps:a});return!u&&!c?null:h.jsxs(S.Fragment,{children:[u,c&&dn.createPortal(r,c)]})}),i6=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Gd().useState("mounted")||r?h.jsx(vN.Provider,{value:r,children:h.jsx(o6,{ref:n,...s})}):null}),wN=S.createContext(void 0);function l6(){const e=S.useContext(wN);if(e===void 0)throw new Error(tn(71));return e}const a6=S.forwardRef(function(t,n){const{render:r,className:s,anchor:o,positionMethod:i="absolute",side:l="top",align:a="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:p=5,sticky:y=!1,disableAnchorTracking:v=!1,collisionAvoidance:b=mE,style:g,...m}=t,x=Gd(),w=s6(),E=x.useState("open"),N=x.useState("mounted"),k=x.useState("trackCursorAxis"),C=x.useState("disableHoverablePopup"),P=x.useState("floatingRootContext"),I=x.useState("instantType"),z=x.useState("transitionStatus"),$=x.useState("adaptiveOrigin"),A=nk({anchor:o,positionMethod:i,floatingRootContext:P,mounted:N,side:l,sideOffset:c,align:a,alignOffset:u,collisionBoundary:d,collisionPadding:f,sticky:y,arrowPadding:p,disableAnchorTracking:v,keepMounted:w,collisionAvoidance:b,adaptiveOrigin:$}),R=S.useMemo(()=>({open:E,side:A.side,align:A.align,anchorHidden:A.anchorHidden,instant:k!=="none"?"tracking-cursor":I}),[E,A.side,A.align,A.anchorHidden,k,I]),j=sk(t,R,{styles:A.positionerStyles,transitionStatus:z,props:m,refs:[n,x.useStateSetter("positionerElement")],hidden:!N,inert:!E||k==="both"||C});return h.jsx(wN.Provider,{value:A,children:j})}),c6=S.forwardRef(function(t,n){const{render:r,className:s,style:o,...i}=t,l=Gd(),{side:a,align:c}=l6(),u=l.useState("open"),d=l.useState("instantType"),f=l.useState("transitionStatus"),p=l.useState("popupProps"),y=l.useState("floatingRootContext"),v=l.useState("disabled"),b=l.useState("closeDelay");Ra({open:u,ref:l.context.popupRef,onComplete(){var w,E;u&&((E=(w=l.context).onOpenChangeComplete)==null||E.call(w,!0))}}),KE(y,{enabled:!v,closeDelay:b});const g=l.useStateSetter("popupElement");return Ut("div",t,{state:{open:u,side:a,align:c,instant:d,transitionStatus:f},ref:[n,l.context.popupRef,g],props:[$g,p,e0(f),i],stateAttributesMapping:Sg})}),u6=function(t){const{delay:n,closeDelay:r,timeout:s=400}=t,o=S.useMemo(()=>({open:n,close:r}),[n,r]);return h.jsx(xN.Provider,{value:n,children:h.jsx(B_,{delay:o,timeoutMs:s,children:t.children})})};function d6({children:e,...t}){return h.jsx(u6,{delay:150,closeDelay:80,...t,children:e})}const f6=Z4,h6=r6,p6="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 Xu({label:e,suppressed:t,side:n="bottom",align:r="end",children:s}){return h.jsxs(f6,{disabled:t??!1,children:[h.jsx(h6,{render:s}),h.jsx(i6,{children:h.jsx(a6,{side:n,align:r,sideOffset:4,collisionPadding:8,children:h.jsx(c6,{className:st(p6),children:e})})})]})}function bN({className:e}){return h.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:[h.jsx("title",{children:"durable"}),h.jsx("path",{d:"M12 2.5 21.5 12 12 21.5 2.5 12z",opacity:.35}),h.jsx("circle",{cx:"6.4",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),h.jsx("circle",{cx:"12",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),h.jsx("circle",{cx:"17.6",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),h.jsx("path",{d:"M8.1 12h2.2M13.7 12h2.2"})]})}const m6=["pending","running","suspended","completed","failed","cancelling","cancelled","dead"];function g6(e){const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const r=Math.round(n/60);if(r<60)return`${r}m ago`;const s=Math.round(r/60);return s<24?`${s}h ago`:`${Math.round(s/24)}d ago`}function x6(e,t){const 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 C0({status:e}){const t=e==="running"||e==="awaiting"||e==="cancelling";return h.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function SN({status:e}){return h.jsxs(Xe,{variant:"status",className:`s-${e} text-[11px]`,children:[h.jsx(C0,{status:e}),e]})}function y6({counts:e,filter:t,onFilter:n}){const r=Object.values(e).reduce((a,c)=>a+c,0),s=(a,c,u)=>h.jsxs(Se,{variant:"ghost",size:"chip","aria-pressed":t===a,onClick:()=>n(a),className:st("rounded-md",t===a&&"border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100"),children:[a!=="all"&&h.jsx(C0,{status:a}),h.jsx("span",{className:"uppercase tracking-wide",children:c}),h.jsx("span",{className:"mono tnum text-zinc-600",children:u})]},a),o=sN(),i=(o==null?void 0:o.role)==="tenant",l=o?o.engine?o.engine:i?o.tenant?`tenant · ${o.tenant}`:"tenant":"control plane":"";return h.jsxs("header",{className:"z-10 flex items-center gap-4 border-b border-line px-5 py-3",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"grid h-7 w-7 place-items-center rounded-md border border-brand/30 bg-brand/10",children:h.jsx(bN,{className:"h-4 w-4 text-brand"})}),h.jsxs("div",{className:"leading-none",children:[h.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"durable"}),h.jsx("div",{className:`mono text-[10px] uppercase tracking-[0.2em] ${i?"text-amber-400/80":"text-zinc-600"}`,title:i?`Tenant deployment — partition ${(o==null?void 0:o.tenant)??"(unnamed)"}`:"Control-plane deployment",children:l})]})]}),h.jsxs("div",{className:"ml-2 flex flex-wrap items-center gap-1",children:[s("all","all",r),m6.map(a=>s(a,a,e[a]??0))]}),tm(o,"workers")&&h.jsx(b6,{}),!i&&tm(o,"schedules")&&h.jsx(cz,{}),h.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[h.jsx("span",{className:"dot s-completed pulse","aria-hidden":!0}),"live"]})]})}function v6(e){const t=Math.max(0,Math.round((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.round(t/60);if(n<60)return`${n}m ago`;const r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function EN({status:e}){const t=e==null?void 0:e.concurrency;if(!e||!t)return h.jsx("span",{className:"mono text-[9px] text-zinc-600",children:"no status"});const n=t.limit>0&&e.inFlight>=t.limit*.8;return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsxs("div",{className:"mono flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[10px] text-zinc-500",children:[h.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"}),h.jsxs("span",{className:n?"text-amber-300":"text-zinc-400",children:["in-flight"," ",h.jsxs("span",{className:"tnum",children:[e.inFlight,"/",t.limit]})]}),typeof e.rssPct=="number"&&h.jsxs("span",{className:e.rssPct>=85?"text-rose-300":"",children:["ram ",h.jsxs("span",{className:"tnum",children:[Math.round(e.rssPct),"%"]})]}),typeof e.cpuPct=="number"&&h.jsxs("span",{children:["cpu ",h.jsxs("span",{className:"tnum",children:[Math.round(e.cpuPct),"%"]})]}),typeof e.throughputPerMin=="number"&&h.jsxs("span",{children:[h.jsx("span",{className:"tnum",children:Math.round(e.throughputPerMin)}),"/min"]}),typeof e.p95Ms=="number"&&h.jsxs("span",{children:["p95 ",h.jsxs("span",{className:"tnum",children:[Math.round(e.p95Ms),"ms"]})]})]}),e.lastAdjust&&h.jsxs("div",{className:"mono text-[10px] text-zinc-500",children:[e.lastAdjust.reason," ",h.jsxs("span",{className:"tnum text-zinc-400",children:[e.lastAdjust.from,"→",e.lastAdjust.to]})," ",v6(e.lastAdjust.at)]})]})}function w6({workers:e}){return h.jsx("div",{className:"flex flex-col divide-y divide-line-soft",children:e.map(t=>h.jsxs("div",{className:"flex flex-col gap-1 px-2.5 py-2",children:[h.jsx("span",{className:"mono truncate text-[10px] text-zinc-400",children:t.instanceId}),h.jsx(EN,{status:t.status})]},t.instanceId))})}function b6(){const{data:e}=Xt({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:1e4}),[t,n]=S.useState("workers");if(!e||e.length===0)return null;const r=ij(e),s={workers:"pods",partitions:"parts",alerts:"alerts"};return h.jsxs(K4,{value:t,onValueChange:o=>n(o),className:"ml-auto flex flex-nowrap items-center gap-1.5",children:[h.jsx(pN,{children:["workers","partitions","alerts"].map(o=>h.jsxs(mN,{value:o,children:[s[o],o==="alerts"&&r.starved.length>0&&h.jsx("span",{className:"tnum ml-1 rounded bg-rose-500/80 px-1 text-[9px] text-white",children:r.starved.length})]},o))}),h.jsxs("div",{className:"flex w-[300px] flex-nowrap items-center justify-end gap-1.5",children:[h.jsx(Yc,{value:"workers",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(S6,{workers:sj(e)})}),h.jsx(Yc,{value:"partitions",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(E6,{groups:e})}),h.jsx(Yc,{value:"alerts",className:"flex flex-nowrap items-center gap-1.5",children:h.jsx(k6,{summary:r})})]})]})}const uw="__overflow__";function dw(e){var n;const t=(n=e.status)==null?void 0:n.concurrency;return e.status&&t?`${e.status.inFlight}/${t.limit}`:void 0}function fw({w:e}){return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-2.5 py-2",children:h.jsx(EN,{status:e.status})}),h.jsxs("div",{className:"max-h-48 overflow-auto border-t border-line-soft px-2.5 py-1.5",children:[h.jsxs("div",{className:"mono mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:[e.handlers.length," handlers"]}),e.handlers.map(t=>h.jsx("div",{className:"mono truncate text-[10px] text-zinc-400",children:t},t))]})]})}function S6({workers:e}){const[t,n]=S.useState(void 0),[r,s]=S.useState(void 0),o=2,i=e.slice(0,o),l=e.slice(o),a=t===uw;return h.jsxs(h.Fragment,{children:[i.map(c=>{const u=t===c.instanceId,d=dw(c);return h.jsxs(Ii,{open:u,onOpenChange:f=>n(f?c.instanceId:void 0),children:[h.jsx(Xu,{suppressed:u,label:`${c.instanceId}
63
- ${c.handlers.length} handlers · ${c.partition}${d?` · ${d} in-flight`:""}`,children:h.jsx(ji,{render:h.jsxs(Se,{variant:"chip",size:"xs",className:st("mono max-w-[120px] gap-1",u&&"border-zinc-500 bg-zinc-800 text-zinc-200"),children:[h.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),h.jsx("span",{className:"truncate",children:c.instanceId}),c.partition!=="default"&&h.jsxs("span",{className:"shrink-0 text-zinc-500",children:["@",c.partition]}),h.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.handlers.length,"h",d?` · ${d}`:""]})]})})}),h.jsxs(fo,{children:[h.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:[h.jsx("span",{className:"truncate text-zinc-300",children:c.instanceId}),h.jsxs("span",{className:"shrink-0",children:[c.runtime??"node"," · ",c.partition]})]}),h.jsx(fw,{w:c})]})]},c.instanceId)}),l.length>0&&h.jsxs(Ii,{open:a,onOpenChange:c=>{n(c?uw:void 0),s(void 0)},children:[h.jsx(ji,{render:h.jsxs(Se,{variant:"chip",size:"xs",className:st("mono shrink-0",a&&"border-zinc-500 bg-zinc-800 text-zinc-200"),children:["+",l.length]})}),h.jsxs(fo,{children:[h.jsxs("div",{className:"mono border-b border-line px-2.5 py-1.5 text-[9px] uppercase tracking-wider text-zinc-600",children:[l.length," more ",l.length===1?"pod":"pods"]}),h.jsx("div",{className:"max-h-80 divide-y divide-line-soft overflow-auto",children:l.map(c=>{const u=dw(c),d=r===c.instanceId;return h.jsxs("div",{children:[h.jsxs("button",{type:"button",onClick:()=>s(d?void 0:c.instanceId),className:st("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",d?"bg-zinc-800/40 text-zinc-200":"text-zinc-300"),children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[h.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),h.jsx("span",{className:"truncate",children:c.instanceId})]}),h.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.partition!=="default"?`@${c.partition} · `:"",c.handlers.length,"h",u?` · ${u}`:""]})]}),d&&h.jsx("div",{className:"border-t border-line-soft bg-zinc-900/40",children:h.jsx(fw,{w:c})})]},c.instanceId)})})]})]})]})}function E6({groups:e}){const[t,n]=S.useState(void 0),r=tj(e);function s(o){const i=new Map;for(const l of e)if(Su(l.group)===o)for(const a of l.liveWorkers)i.has(a.instanceId)||i.set(a.instanceId,a);return[...i.values()]}return h.jsx(h.Fragment,{children:r.map(o=>{const i=o.starvedCount>0,l=t===o.partition;return h.jsxs(Ii,{open:l&&o.workerCount>0,onOpenChange:a=>n(a?o.partition:void 0),children:[h.jsx(Xu,{suppressed:l,label:`${o.partition}
64
- ${o.workerCount} workers · ${o.handlerCount} handlers · ${o.totalDepth} queued${i?` · ${o.starvedCount} starved`:""}`,children:h.jsx(ji,{render:h.jsxs(Se,{variant:"chip",size:"xs",disabled:o.workerCount===0,className:st("mono gap-1",i&&"border-rose-500/50 bg-rose-500/15 text-rose-300",!i&&l&&"border-zinc-500 bg-zinc-800 text-zinc-200",o.workerCount>0?"cursor-pointer":"cursor-default"),children:[h.jsx("span",{className:`dot ${i?"s-failed":o.workerCount>0?"s-completed":""}`,"aria-hidden":!0}),o.partition,h.jsxs("span",{className:"tnum text-zinc-500",children:[o.workerCount,"w ",o.handlerCount,"h",o.totalDepth>0?` ${o.totalDepth}q`:"",i?` ${o.starvedCount}!`:""]})]})})}),h.jsxs(fo,{children:[h.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:[h.jsx("span",{className:"text-zinc-300",children:o.partition}),h.jsxs("span",{className:"tnum",children:[o.workerCount," worker(s) · ",o.totalDepth," queued"]})]}),h.jsx(w6,{workers:s(o.partition)})]})]},o.partition)})})}function k6({summary:e}){const t=(n,r)=>`${n} ${n===1?r:`${r}s`}`;return h.jsxs(h.Fragment,{children:[h.jsx(Xu,{label:`Route-by-handler: each @Workflow & @Step is served as its own queue.
65
- ${e.queueCount} queues across ${t(e.workerCount,"worker")}.`,children:h.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?h.jsx("span",{className:"text-good",children:"all draining"}):h.jsxs("span",{className:"text-rose-300",children:[e.starved.length," starved"]})]})}),e.starved.map(n=>h.jsx(Xu,{label:`${n.group}
66
- ${n.depth} queued, no worker consuming`,children:h.jsxs(Xe,{variant:"danger",className:"mono gap-1 border-rose-500/50 bg-rose-500/15 py-0.5",children:[h.jsx("span",{className:"dot s-failed","aria-hidden":!0}),h.jsx("span",{className:"max-w-[180px] truncate",children:n.group}),h.jsxs("span",{className:"tnum shrink-0",children:[n.depth,"q · 0w"]})]})},n.group))]})}function C6(){return h.jsx("ul",{className:"divide-y divide-line-soft","aria-hidden":!0,children:[0,1,2,3,4,5].map(e=>h.jsxs("li",{className:"flex flex-col gap-2 px-4 py-3",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("div",{className:"h-3.5 w-32 animate-pulse rounded bg-zinc-800"}),h.jsx("div",{className:"h-3 w-16 animate-pulse rounded bg-zinc-800/70"})]}),h.jsx("div",{className:"h-2.5 w-48 animate-pulse rounded bg-zinc-800/50"})]},e))})}const N6=S.memo(function({run:t,siblings:n,health:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a}){const c=fS(t,{runs:n,health:r}),u=t.namespace&&t.namespace!=="default"?t.namespace:void 0,d=Hi(t.origin);return h.jsxs("button",{type:"button",onClick:()=>o(t.id),className:`flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors ${s?"bg-zinc-900":"hover:bg-zinc-900/50"}`,children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("span",{className:"truncate text-sm font-medium text-zinc-200",children:t.workflow}),u&&h.jsx(Xe,{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 ${u}`,onClick:f=>{f.stopPropagation(),l(u)},children:u}),d&&h.jsx(Xe,{variant:"origin",className:"mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-teal-400/60 hover:text-teal-200",title:`Declared by ${d} — click to show only this library's runs`,onClick:f=>{f.stopPropagation(),a({kind:"origin",origin:d})},children:ka(d)}),t.id.startsWith("dlq:")&&h.jsx(Xe,{variant:"danger",className:"mono shrink-0 px-1 text-[9px] uppercase tracking-wider",children:"dlq"})]}),h.jsx(SN,{status:c.status})]}),c.detail&&h.jsx("div",{className:`mono truncate text-[11px] s-${c.status}`,children:c.detail}),h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{className:"mono truncate text-[11px] text-zinc-600",children:t.id}),h.jsx("span",{className:"shrink-0 text-[11px] text-zinc-600",children:g6(t.updatedAt)})]}),t.tags&&t.tags.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1",children:t.tags.map(f=>h.jsxs("span",{onClick:p=>{p.stopPropagation(),i(f)},className:st(_S({variant:"outline"}),"mono cursor-pointer hover:border-zinc-500 hover:text-zinc-200"),children:["#",f]},f))})]})}),R6=86,T6=12;function P6({runs:e,siblings:t,health:n,loading:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a,total:c,onLoadMore:u,loadingMore:d,emptyNotice:f}){var w;const p=S.useRef(null),y=S.useCallback(E=>o4(e,E),[e]),v=ig({count:e.length,getScrollElement:()=>p.current,estimateSize:()=>R6,getItemKey:y,measureElement:E=>E.getBoundingClientRect().height,overscan:8}),b=v.getVirtualItems(),g=c>e.length,m=b.length>0?((w=b[b.length-1])==null?void 0:w.index)??-1:-1,x=S.useRef(-1);return S.useEffect(()=>{s4({hasMore:g,loading:!!d,lastRenderedIndex:m,loadedCount:e.length,requestedAtCount:x.current,loadAhead:T6})&&(x.current=e.length,u())},[g,d,m,e.length,u]),r&&e.length===0?h.jsx(C6,{}):e.length===0?h.jsxs("div",{className:"flex flex-col items-start gap-2 p-6 text-sm text-zinc-600",children:[h.jsx("span",{children:f.message}),f.unclassified!==void 0&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"text-[11px] text-zinc-500",children:[f.unclassified," run",f.unclassified===1?"":"s"," here"," ",f.unclassified===1?"is":"are"," the app's own (no package origin), so no package filter can match ",f.unclassified===1?"it":"them","."]}),h.jsx(Se,{variant:"chip",size:"xs",className:"mono rounded",title:ag,onClick:()=>a({kind:"unknown"}),children:"show app runs"})]})]}):h.jsxs("div",{ref:p,className:"min-h-0 flex-1 overflow-auto",children:[h.jsx("ul",{className:"relative",style:{height:v.getTotalSize()},children:b.map(E=>{const N=e[E.index];return N?h.jsx("li",{"data-index":E.index,ref:v.measureElement,className:"absolute left-0 top-0 w-full border-b border-line-soft",style:{transform:`translateY(${E.start}px)`},children:h.jsx(N6,{run:N,siblings:t,health:n,selected:s===N.id,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a})},N.id):null})}),h.jsxs("div",{className:"flex items-center gap-2 border-t border-line px-4 py-2","aria-live":"polite","aria-busy":g&&d,children:[h.jsxs("span",{className:"mono text-[10px] text-zinc-600",children:[e.length," of ",c]}),g&&h.jsx("span",{className:"mono ml-auto text-[10px] text-zinc-600",children:d?"loading…":"scroll for more"})]})]})}function I6({compensations:e,selKey:t,onSelect:n}){return h.jsxs("div",{className:"shrink-0 border-t border-amber-500/20 bg-black/20 px-7 py-3",children:[h.jsx("div",{className:"mono mb-2 text-[10px] uppercase tracking-[0.18em] text-amber-400/80",children:"compensation · unwind order"}),h.jsx("ul",{className:"flex flex-col gap-1",children:e.map(r=>{const s=`${r.runId}#${r.seq}`;return h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>n(r),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 ${s===t?"border-amber-500/50 bg-amber-500/15":"border-amber-500/20 bg-amber-500/5 hover:border-amber-500/40"}`,children:[h.jsx(C0,{status:r.status}),h.jsx("span",{className:"truncate text-amber-100",children:LI(r.name)}),h.jsx("span",{className:"ml-auto shrink-0 text-[10px] uppercase tracking-wider text-amber-400/70",children:r.status})]})},s)})})]})}const j6=[],_6=S.memo(function({id:t,onOpenRun:n}){const r=mo(),{data:s}=Xt({queryKey:["run",t],queryFn:async()=>nj(r.getQueryData(["run",t]),await $e.run(t)),refetchInterval:ne=>{var je;const Be=(je=ne.state.data)==null?void 0:je.run.status;return Be==="running"||Be==="suspended"?1500:!1}}),{data:o=[]}=Xt({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:5e3}),i=s==null?void 0:s.run,l=CN(i!==void 0&&kN([i])),a=(s==null?void 0:s.run.status)==="dead"?`dlq:${t}`:void 0,{data:c}=Xt({queryKey:["run",a],queryFn:()=>$e.run(a),enabled:!!a,retry:!1}),u=()=>{r.invalidateQueries({queryKey:["run",t]}),r.invalidateQueries({queryKey:["runs"]})},d=s==null?void 0:s.run.status,f=d==="running"||d==="suspended",p=S.useRef(f);p.current=f;const[y]=S.useState(()=>new ej),[v,b]=S.useState({});S.useEffect(()=>{const ne=lj(()=>r.invalidateQueries({queryKey:["run",t]}),1500),Be=$e.streamRun(t,je=>{var zt;if(y.push(je),je.type==="run.trigger_failed"&&je.name&&((zt=je.error)!=null&&zt.message)){const{name:gn,error:qn}=je;b(Kn=>({...Kn,[gn]:qn.message}))}if(je.type==="step.progress"&&je.event&&je.seq!=null){const gn=je.seq,qn=je.event;r.setQueryData(["run",t],Kn=>rj(Kn,gn,qn));return}(p.current||je.type==="run.triggered"||je.type==="run.trigger_failed")&&ne.call()});return()=>{ne.cancel(),Be()}},[t,y,r]);const g=mr({mutationFn:()=>$e.retry(t),onSuccess:u}),m=mr({mutationFn:ne=>$e.cancel(t,ne!==void 0?{compensate:ne}:{}),onSuccess:u}),x=mr({mutationFn:()=>$e.continue(t),onSuccess:u}),w=oN(),E=mr({mutationFn:()=>$e.redispatch(t),onSuccess:u}),[N,k]=S.useState(!1),C=mr({mutationFn:()=>$e.republishLifecycle(t),onSuccess:u}),P=mr({mutationFn:ne=>$e.republishLifecycle(t,ne),onSuccess:u}),I=mr({mutationFn:ne=>$e.retryWithInput(t,ne),onSuccess:ne=>{r.invalidateQueries({queryKey:["runs"]}),n(ne.runId)}}),[z,$]=S.useState(!1),[A,R]=S.useState(""),[j,_]=S.useState(),F=()=>{R(JSON.stringify((s==null?void 0:s.run.input)??{},null,2)),_(void 0),$(!0)},T=()=>{let ne;try{ne=JSON.parse(A)}catch(Be){_(Be instanceof Error?Be.message:"Invalid JSON");return}$(!1),I.mutate(ne)},[M,O]=S.useState(),[U,L]=S.useState(!1),[K,W]=S.useState(new Set),[q,H]=S.useState(240);function G(ne){ne.preventDefault(),ne.currentTarget.setPointerCapture(ne.pointerId);const Be=zt=>H(gn=>Math.max(120,Math.min(720,gn-zt.movementY))),je=()=>{window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",je)};window.addEventListener("pointermove",Be),window.addEventListener("pointerup",je)}const B=S.useCallback(ne=>{W(Be=>{const je=new Set(Be);return je.has(ne)?je.delete(ne):je.add(ne),je})},[]),Y=S.useCallback((ne,Be)=>{O({step:ne,run:Be})},[]),Q=S.useMemo(()=>HI((s==null?void 0:s.timeline)??[]),[s==null?void 0:s.timeline]),Z=(s==null?void 0:s.fans)??j6;if(!s)return h.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:V}=s,{body:X,compensations:ee}=Q,he=Z.reduce((ne,Be)=>ne+Be.size,X.length),Pe=X.length>0||Z.length>0,ce=kA(s.children??[],s.childCount),ve=CA(s),ue=ve.startedBy,Re=s.lifecycleSubscribers??[],ye=BI(ee),ze=V.id.startsWith("dlq:"),Ie=ze?{id:V.id.slice(4),title:"Dead-letter handler",subtitle:`started because run ${V.id.slice(4)} was dead-lettered`,cta:"open dead run →"}:c?{id:`dlq:${V.id}`,title:"Dead-lettered",subtitle:"this run exceeded recovery and was routed to a DLQ handler",cta:"open DLQ handler →"}:void 0,et=ee.length>0?(()=>{const ne=ye.failed>0?` ${ye.failed} undo${ye.failed===1?"":"s"} failed after retries — check ${ye.failed===1?"it":"them"} below.`:"";return ye.pending>0?{title:"Compensating",subtitle:`undoing completed steps in reverse (${ye.done} of ${ye.total} done).${ne}`}:V.status==="cancelled"?{title:"Cancelled with compensation",subtitle:`completed steps were undone before cancelling.${ne}`}:{title:"Saga compensated",subtitle:`the run failed and its ${ye.total} completed step${ye.total===1?"":"s"} were undone in reverse.${ne}`}})():void 0,lt=V.status==="failed"||V.status==="suspended",re=V.status==="running"||V.status==="suspended",se=V.status==="suspended"||V.status==="running",De=X.some(ne=>ne.status==="pending"&&ne.kind==="signal"&&ne.name.startsWith("breakpoint")),we=M?`${M.step.runId}#${M.step.seq}`:void 0,at=fS(V,{runs:l,health:o,timeline:X}),nn=V.namespace&&V.namespace!=="default"?V.namespace:void 0,qt=Hi(V.origin);return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-line px-7 py-5",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:h.jsx("a",{href:Od(V.workflow),className:"underline-offset-4 hover:underline",title:"Open this workflow's page: who starts when it settles, and who starts it",children:V.workflow})}),Rc(V.id)!==void 0&&h.jsx(Se,{variant:"alt",size:"xs",onClick:()=>n(Rc(V.id)),className:"mono uppercase tracking-wider",title:`Open the parent run (${Rc(V.id)}) — the macro view this child belongs to`,children:"↑ parent"}),Kc(V.id)!==void 0&&h.jsx(Se,{variant:"chip",size:"xs",onClick:()=>n(Kc(V.id)),className:"mono uppercase tracking-wider text-zinc-300",title:`This is a retry-with-input of ${Kc(V.id)} — open the original run`,children:"↩ original"}),ze&&h.jsx(Xe,{variant:"danger",className:"mono py-0.5 uppercase tracking-wider",children:"dlq"}),h.jsx(SN,{status:at.status}),at.detail&&h.jsx("span",{className:`mono text-[11px] s-${at.status}`,children:at.detail}),nn&&h.jsx(Xe,{variant:"tenant",className:"mono py-0.5",title:"Tenant / worker-pool partition this run belongs to",children:nn}),qt?h.jsx(Xe,{variant:"origin",className:"mono py-0.5",title:`Declared by ${qt}`,children:ka(qt)}):h.jsxs(Xe,{variant:"origin-unknown",className:"mono py-0.5",title:ag,children:["origin ",md]}),ee.length>0&&h.jsx(Xe,{variant:"warn",className:st("mono py-0.5 uppercase tracking-wider",ye.pending>0&&"pulse"),title:ye.pending>0?`compensating: ${ye.done} of ${ye.total} undone`:`${ye.total} step${ye.total===1?"":"s"} compensated`,children:ye.pending>0?"compensating":"compensated"}),h.jsxs(Xe,{className:"mono bg-transparent py-0.5 text-zinc-500",children:["v",V.workflowVersion]}),h.jsxs("span",{className:"mono tnum text-[11px] text-zinc-600",children:[he," ",he===1?"step":"steps"]})]}),h.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:V.id}),V.tags&&V.tags.length>0&&h.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:V.tags.map(ne=>h.jsxs(Xe,{className:"mono",children:["#",ne]},ne))}),V.searchAttributes&&Object.keys(V.searchAttributes).length>0&&h.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:Object.entries(V.searchAttributes).map(([ne,Be])=>h.jsxs(Xe,{variant:"attr",className:"mono",title:"search attribute",children:[ne,"=",String(Be)]},ne))}),ce.shown.length>0?h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:"children:"}),ce.shown.map(ne=>h.jsx(Se,{variant:"chip",size:"xs",onClick:()=>n(ne),className:"mono px-1.5 py-0",children:ne},ne)),ce.more>0&&h.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:["+",ce.more," more"]})]}):null,ue?h.jsx(rz,{source:ue,onOpenRun:n}):null,h.jsx(sz,{waitsFor:s.waitsFor,awaitedBy:s.awaitedBy,onOpenRun:n}),ve.triggered.length>0?h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[h.jsx("span",{className:"text-[10px] text-zinc-600",children:"triggered:"}),ve.triggered.map(ne=>h.jsx(Se,{variant:"chip",size:"xs",onClick:()=>n(ne),className:"mono px-1.5 py-0",children:ne},ne))]}):null,s.lifecycleDeliveries?h.jsx(oz,{deliveries:iz(s.lifecycleDeliveries,v),onOpenRun:n,onRepublish:ne=>P.mutate(ne),republishing:P.isPending}):null,s.workflowLifecycle?h.jsx("div",{className:"mt-3",children:h.jsx(lk,{links:s.workflowLifecycle})}):null,h.jsx(PA,{tail:y,sourceRunId:ue==null?void 0:ue.runId,parentRunId:Rc(V.id),onOpenRun:n})]}),h.jsxs("div",{className:"flex shrink-0 gap-2",children:[h.jsx(Se,{onClick:()=>L(!0),className:"mono px-2.5 normal-case tracking-normal text-zinc-400",title:"Run input / output",children:"{ }"}),De&&w("breakpoints")&&h.jsxs(Se,{variant:"warn",disabled:x.isPending,onClick:()=>x.mutate(),children:[h.jsx(fj,{width:12,height:12}),"Continue"]}),h.jsxs(Se,{variant:"brand",disabled:!lt||g.isPending,onClick:()=>g.mutate(),children:[h.jsx(If,{width:12,height:12}),"Retry"]}),se&&w("redispatch")&&h.jsxs(Se,{variant:"info",disabled:E.isPending,onClick:()=>E.mutate(),title:"Re-dispatch stuck `pending` remote steps — recovery for a lost step dispatch (crashed worker or dropped job)",children:[h.jsx(ku,{width:12,height:12}),"Re-dispatch"]}),Re.length>0&&w("republishLifecycle")&&h.jsxs(Se,{variant:"info",disabled:C.isPending,onClick:()=>{C.reset(),k(!0)},title:"Start the lifecycle-event subscribers that have not started from this run",children:[h.jsx(ku,{width:12,height:12}),"Republish lifecycle event"]}),(V.status==="dead"||V.status==="failed")&&h.jsxs(Se,{variant:"alt",disabled:I.isPending,onClick:F,title:"Edit the input and re-run as a fresh linked run",children:[h.jsx(If,{width:12,height:12}),"Fix & replay"]}),re&&h.jsxs(Se,{variant:"warn",disabled:m.isPending,onClick:()=>m.mutate(!0),title:"Cancel and run saga compensations (undo completed steps in reverse)",className:"bg-transparent",children:[h.jsx(If,{width:12,height:12}),"Cancel + Undo"]}),h.jsxs(Se,{className:"border-zinc-700",disabled:!re||m.isPending,onClick:()=>m.mutate(!1),children:[h.jsx(Ss,{width:12,height:12}),"Cancel"]})]})]}),Ie&&h.jsxs("div",{className:"flex items-center gap-3 border-b border-rose-500/30 bg-rose-500/10 px-7 py-3",children:[h.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:"⚠"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"text-[13px] font-medium text-rose-200",children:Ie.title}),h.jsx("div",{className:"mono truncate text-[11px] text-rose-300/70",children:Ie.subtitle})]}),h.jsx(Se,{variant:"danger",onClick:()=>n(Ie.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:Ie.cta})]}),et&&h.jsxs("div",{className:"flex items-center gap-3 border-b border-amber-500/30 bg-amber-500/10 px-7 py-3",children:[h.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:"↺"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"text-[13px] font-medium text-amber-200",children:et.title}),h.jsx("div",{className:"mono truncate text-[11px] text-amber-300/70",children:et.subtitle})]})]}),h.jsxs("div",{className:"relative grid min-h-0 flex-1",style:{gridTemplateRows:Pe?`1fr ${q}px`:"1fr"},children:[h.jsxs("div",{className:"relative min-h-0",children:[Pe?h.jsx(r4,{run:V,timeline:X,fans:Z,endStatus:at.status,selectedKey:we,onSelect:Y,onOpenRun:n,fmtDuration:x6,expanded:K,onToggleChild:B}):h.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}),(V.status==="failed"||V.status==="cancelled")&&V.error&&h.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:V.error.message})]}),Pe&&h.jsxs("div",{className:"relative min-h-0 overflow-hidden border-t border-line bg-black/20",children:[h.jsx("div",{onPointerDown:G,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"}),h.jsx(qA,{run:V,timeline:X,fans:Z,selectedKey:we,onSelect:Y,onOpenRun:n,expanded:K,onToggleChild:B})]}),M&&h.jsx(XA,{step:M.step,run:M.run,onClose:()=>O(void 0),onOpenRun:n}),U&&h.jsx(ZA,{run:V,onClose:()=>L(!1)})]}),ee.length>0&&h.jsx(I6,{compensations:ee,selKey:we,onSelect:ne=>O({step:ne,run:V})}),h.jsxs(lw,{open:N,onOpenChange:k,title:"Republish lifecycle event",subtitle:`publishes ${V.id}'s ${V.status==="completed"?"run.completed":"run.failed"} event again`,footer:C.isSuccess||C.isError?h.jsx(Se,{onClick:()=>k(!1),children:"Close"}):h.jsxs(h.Fragment,{children:[h.jsx(Se,{onClick:()=>k(!1),children:"Cancel"}),h.jsx(Se,{variant:"info",disabled:C.isPending,onClick:()=>C.mutate(),children:"Republish"})]}),children:[h.jsxs("p",{className:"text-[12px] text-zinc-400",children:["Subscribers: ",h.jsx("span",{className:"mono text-zinc-300",children:Re.join(", ")}),". The ones already started from this run are not started again."]}),C.isSuccess&&h.jsxs("div",{className:"mono mt-3 space-y-1 text-[11.5px] text-zinc-300",children:[h.jsxs("p",{children:["started ",C.data.started," subscriber run",C.data.started===1?"":"s"]}),C.data.failed.map(ne=>h.jsxs("p",{className:"rounded border border-bad/25 bg-bad/10 px-2 py-1 text-bad",children:[ne.subscriber,": ",ne.error]},ne.subscriber))]}),C.isError&&h.jsx("p",{className:"mono mt-3 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad",children:C.error instanceof Error?C.error.message:String(C.error)})]}),h.jsxs(lw,{open:z,onOpenChange:$,title:"Fix & replay",subtitle:`re-runs ${V.id} as a fresh linked run`,footer:h.jsxs(h.Fragment,{children:[h.jsx(Se,{onClick:()=>$(!1),children:"Cancel"}),h.jsx(Se,{variant:"alt",disabled:I.isPending,onClick:T,children:"Replay"})]}),children:[h.jsx("label",{className:"mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-zinc-500",htmlFor:"fix-replay-input",children:"input"}),h.jsx("textarea",{id:"fix-replay-input",value:A,spellCheck:!1,onChange:ne=>{R(ne.target.value),_(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"}),j&&h.jsx("p",{className:"mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad",children:j})]})]})});function hw(){if(typeof window>"u")return;const e=window.location.hash.match(/^#\/run\/(.+)$/),t=e==null?void 0:e[1];return t?decodeURIComponent(t):void 0}function kN(e){return e.some(t=>{var n;return t.status==="suspended"&&((n=t.tags)==null?void 0:n.some(r=>r.startsWith("singleton:")))})}function CN(e){const{data:t=[]}=Xt({queryKey:["runs","in-flight"],queryFn:()=>$e.runs(void 0,void 0,void 0,{statuses:dS,limit:500}),enabled:e,refetchInterval:5e3});return t}const O6=100;function F6(){const e=oN(),[t,n]=S.useState("all"),[r,s]=S.useState([]),[o,i]=S.useState([]),[l,a]=S.useState([]),[c,u]=S.useState(cS),[d,f]=S.useState(()=>hw()),[p,y]=S.useState(()=>typeof window>"u"?void 0:Xy(window.location.hash)),v=S.useCallback(Q=>{if(f(Q),y(void 0),typeof window>"u")return;const Z=Q?`#/run/${encodeURIComponent(Q)}`:"",V=Z||window.location.pathname+window.location.search;window.location.hash!==Z&&window.history.pushState(null,"",V)},[]);S.useEffect(()=>{const Q=()=>{f(hw()),y(Xy(window.location.hash))};return window.addEventListener("hashchange",Q),window.addEventListener("popstate",Q),()=>{window.removeEventListener("hashchange",Q),window.removeEventListener("popstate",Q)}},[]);const[b,g]=S.useState({key:"",pages:1}),m=mo(),x=o,w=x.join("|"),E=c.kind==="origin"?c.origin:c.kind==="unknown"?null:void 0,N=uS(c),k=i4({status:t,tag:r.join("|"),attrs:w,namespace:l.join("|"),origin:N}),C=b.key===k?b.pages:1,P=O6*C,{data:I=[],isPending:z,isFetching:$}=Xt({queryKey:["runs",t,r,w,l,N,P],queryFn:()=>$e.runs(t==="all"?void 0:t,r,x.length?x:void 0,{namespace:l,origin:E,limit:P}),refetchInterval:3e3,placeholderData:kR}),{data:A=[]}=Xt({queryKey:["run-facets",r,w,l],queryFn:()=>$e.facets(r,x.length?x:void 0,l),refetchInterval:5e3}),R=c.kind==="unknown"?null:c.kind==="origin"?c.origin:void 0,j=S.useMemo(()=>({namespace:l,attr:o,origin:R}),[l,o,R]),_=S.useMemo(()=>({tag:r,attr:o,origin:R}),[r,o,R]),F=S.useMemo(()=>({tag:r,namespace:l,origin:R}),[r,l,R]),{data:T=[]}=Xt({queryKey:["workers"],queryFn:()=>$e.workers(),refetchInterval:5e3}),M=mr({mutationFn:Q=>$e.bulk(Q,{status:t!=="all"?t:void 0,tag:r,attr:x.length?x:void 0,namespace:l,origin:E}),onSuccess:()=>m.invalidateQueries({queryKey:["runs"]})}),O=S.useMemo(()=>{const Q={};for(const Z of A)AI({origin:Z.origin??void 0},c)&&(Q[Z.status]=(Q[Z.status]??0)+Z.count);return Q},[A,c]),U=S.useMemo(()=>$I(A),[A]),L=S.useMemo(()=>t==="all"?Object.values(O).reduce((Q,Z)=>Q+Z,0):O[t]??0,[O,t]),K=t!=="all"||r.length>0||l.length>0||x.length>0||c.kind!=="all",W=S.useMemo(()=>zI(A),[A]),q=S.useMemo(()=>oj(T),[T]),H=CN(S.useMemo(()=>kN(I),[I])),G=S.useCallback(Q=>{s(Z=>Z.includes(Q)?Z:[...Z,Q])},[]),B=S.useCallback(Q=>{a(Z=>Z.includes(Q)?Z:[...Z,Q])},[]),Y=S.useCallback(()=>{g(Q=>({key:k,pages:Q.key===k?Q.pages+1:2}))},[k]);return h.jsxs(d6,{children:[h.jsx("div",{className:"app-bg"}),h.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[h.jsx(y6,{counts:O,filter:t,onFilter:n}),q.length>0&&h.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:[h.jsx("span",{className:"s-no-worker inline-flex items-center gap-1.5",children:h.jsx("span",{className:"dot s-no-worker","aria-hidden":!0})}),h.jsxs("span",{children:["Runs waiting on handlers with no live worker:"," ",h.jsx("span",{className:"mono text-amber-100",children:q.join(", ")}),". Start a worker to unblock."]})]}),h.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]",children:[h.jsxs("aside",{className:"flex min-h-0 flex-col border-r border-line",children:[h.jsxs("div",{className:"border-b border-line p-2",children:[h.jsx(Au,{field:"tag",scope:j,glyph:"#",label:"filter by tag",placeholder:"filter by tag…",value:r,onChange:s,title:"Tags carried by a run (WorkflowRun.tags). Several match ANY of them."}),h.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e("tags")&&h.jsx(lz,{tags:r,onChange:s})}),h.jsx("div",{className:e("namespaces")?"mt-1.5":"hidden",children:h.jsx(Au,{field:"namespace",scope:_,glyph:"@",label:"filter by tenant",placeholder:"filter by tenant / namespace…",value:l,onChange:a,title:"Tenant / worker-pool partition (WorkflowRun.namespace). None selected shows every tenant."})}),e("searchAttributes")&&h.jsx(yA,{value:o,onChange:i,scope:F})]}),e("origins")&&h.jsx(vA,{facets:W,value:c,onChange:u}),K&&L>0&&h.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-1.5",children:[h.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:[L," ",t!=="all"?t:"",r.length>0&&` #${r.join(", ")}`,l.length>0&&` @${l.join(", ")}`,c.kind==="origin"&&` ⬡${ka(c.origin)}`,c.kind==="unknown"&&` ⬡${md}`,x.length>0&&` ⛃${x.length}`]}),h.jsx(Se,{variant:"brand",size:"xs",disabled:M.isPending,onClick:()=>M.mutate("retry"),className:"mono ml-auto rounded",children:"retry all"}),h.jsx(Se,{variant:"danger",size:"xs",disabled:M.isPending,onClick:()=>M.mutate("cancel"),className:"mono rounded",children:"cancel all"})]}),h.jsx(P6,{runs:I,siblings:H,health:T,loading:z,selected:d,onSelect:v,onSelectTag:G,onSelectNamespace:B,onSelectOrigin:u,total:L,onLoadMore:Y,loadingMore:$,emptyNotice:FI({anyFilter:K,origin:c,unknownCount:U})},k)]}),h.jsx("main",{className:"min-h-0",children:d?h.jsx(_6,{id:d,onOpenRun:v},d):p?h.jsx(bA,{workflow:p},p):h.jsx("div",{className:"grid h-full place-items-center text-center",children:h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsx(bN,{className:"h-10 w-10 text-zinc-800"}),h.jsx("p",{className:"mt-3 text-sm text-zinc-600",children:"Select a run to see its timeline."})]})})})]})]})]})}export{F6 as A,A6 as Q,i0 as R,D6 as a,ZP as c,h as j,$6 as o,S as r};