@adonis-agora/durable 1.0.0-rc.23 → 1.0.0-rc.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/assets/spa/assets/index-DFNxrdSx.css +1 -0
  3. package/dist/assets/spa/assets/{index-DlwRCDs7.js → index-cmhkQ5N1.js} +3 -3
  4. package/dist/assets/spa/assets/index-cmhkQ5N1.js.map +1 -0
  5. package/dist/assets/spa/index.html +2 -2
  6. package/dist/providers/durable_provider.d.ts.map +1 -1
  7. package/dist/providers/durable_provider.js +5 -0
  8. package/dist/providers/durable_provider.js.map +1 -1
  9. package/dist/src/copy-guard.d.ts +39 -0
  10. package/dist/src/copy-guard.d.ts.map +1 -0
  11. package/dist/src/copy-guard.js +108 -0
  12. package/dist/src/copy-guard.js.map +1 -0
  13. package/dist/src/dashboard/console_switcher.d.ts +1 -1
  14. package/dist/src/dashboard/console_switcher.d.ts.map +1 -1
  15. package/dist/src/dashboard/console_switcher.js +2 -0
  16. package/dist/src/dashboard/console_switcher.js.map +1 -1
  17. package/dist/src/dashboard/index.d.ts +1 -1
  18. package/dist/src/dashboard/index.js +1 -1
  19. package/dist/src/doctor/checks.d.ts +3 -0
  20. package/dist/src/doctor/checks.d.ts.map +1 -1
  21. package/dist/src/doctor/checks.js +24 -0
  22. package/dist/src/doctor/checks.js.map +1 -1
  23. package/dist/src/engine.d.ts +1 -0
  24. package/dist/src/engine.d.ts.map +1 -1
  25. package/dist/src/engine.js +2 -0
  26. package/dist/src/engine.js.map +1 -1
  27. package/dist/src/index.d.ts +2 -1
  28. package/dist/src/index.d.ts.map +1 -1
  29. package/dist/src/index.js +2 -1
  30. package/dist/src/index.js.map +1 -1
  31. package/package.json +5 -3
  32. package/dist/assets/spa/assets/index-ChDc-SJJ.css +0 -1
  33. package/dist/assets/spa/assets/index-DlwRCDs7.js.map +0 -1
@@ -6,7 +6,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
6
6
  `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);case 30:return xe(`ViewTransition`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
7
  Error generating stack: `+e.message+`
8
8
  `+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ue(n),i=1<<r;t|=e[r],n&=~i}return t}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tt(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function at(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ot(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ue(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&st(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function st(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ue(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ct(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ue(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function lt(e,t){var n=t&-t;return n=n&42?1:ut(n),(n&(e.suspendedLanes|t))===0?n:0}function ut(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function dt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ft(){var e=G.p;return e===0?(e=window.event,e===void 0?32:wh(e.type)):e}function pt(e,t){var n=G.p;try{return G.p=e,t()}finally{G.p=n}}var mt=Math.random().toString(36).slice(2),ht=`__reactFiber$`+mt,gt=`__reactProps$`+mt,_t=`__reactContainer$`+mt,vt=`__reactEvents$`+mt,yt=`__reactListeners$`+mt,bt=`__reactHandles$`+mt,xt=`__reactResources$`+mt,St=`__reactMarker$`+mt,Ct=`__reactLoad$`+mt;function wt(e){delete e[ht],delete e[gt],delete e[yt],delete e[bt]}function Tt(e){var t;if(t=e[ht])return t;for(var n=e.parentNode;n;){if(t=n[_t]||n[ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pm(e);e!==null;){if(n=e[ht])return n;e=pm(e)}return t}e=n,n=e.parentNode}return null}function Et(e){if(e=e[ht]||e[_t]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ot(e){var t=e[xt];return t||=e[xt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function kt(e){e[St]=!0}function At(e){e[Ct]=void 0}var jt=new Set,Mt={};function Nt(e,t){Pt(e,t),Pt(e+`Capture`,t)}function Pt(e,t){for(Mt[e]=t,e=0;e<t.length;e++)jt.add(t[e])}var Ft=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),It={},Lt={};function Rt(e){return Ee.call(Lt,e)?!0:Ee.call(It,e)?!1:Ft.test(e)?Lt[e]=!0:(It[e]=!0,!1)}var zt=!1;function Bt(){var e=zt;return zt=!1,e}function Vt(e,t,n){if(Rt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Ht(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Ut(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Wt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Gt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Kt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qt(e){if(!e._valueTracker){var t=Gt(e)?`checked`:`value`;e._valueTracker=Kt(e,t,``+e[t])}}function Jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Gt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Yt=/[\n"\\]/g;function Xt(e){return e.replace(Yt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Zt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Wt(t)):e.value!==``+Wt(t)&&(e.value=``+Wt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):$t(e,Wt(n)):o===`number`&&e.value==t?$t(e,Wt(e.value)):$t(e,Wt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Wt(s):e.removeAttribute(`name`)}function Qt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){qt(e);return}n=n==null?``:``+Wt(n),t=t==null?n:``+Wt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),qt(e)}function $t(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function en(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Wt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function tn(e,t,n){t!=null&&(t=``+Wt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Wt(n)}function nn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Wt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),qt(e)}function rn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var an=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function on(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||an.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function sn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,zt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(on(e,a,r),zt=!0)}else for(var o in t)t.hasOwnProperty(o)&&on(e,o,t[o])}function cn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var ln=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),un=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function dn(e){return un.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function fn(){}var pn=null;function mn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hn=null,gn=null;function _n(e){var t=Et(e);if(t&&(e=t.stateNode)){var n=e[gt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Zt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Xt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[gt]||null;if(!a)throw Error(i(90));Zt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Jt(r)}break a;case`textarea`:tn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&en(e,!!n.multiple,t,!1)}}}var vn=!1;function yn(e,t,n){if(vn)return e(t,n);vn=!0;try{return e(t)}finally{if(vn=!1,(hn!==null||gn!==null)&&(Ld(),hn&&(t=hn,e=gn,gn=hn=null,_n(t),e)))for(t=0;t<e.length;t++)_n(e[t])}}function bn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[gt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var xn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Sn=!1;if(xn)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Sn=!0}}),window.addEventListener(`test`,Cn,Cn),window.removeEventListener(`test`,Cn,Cn)}catch{Sn=!1}var wn=null,Tn=null,En=null;function Dn(){if(En)return En;var e,t=Tn,n=t.length,r,i=`value`in wn?wn.value:wn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return En=i.slice(e,1<r?1-r:void 0)}function On(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function kn(){return!0}function An(){return!1}function jn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?kn:An,this.isPropagationStopped=An,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=kn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=kn)},persist:function(){},isPersistent:kn}),t}var Mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nn=jn(Mn),Pn=T({},Mn,{view:0,detail:0}),Fn=jn(Pn),In,Ln,Rn,zn=T({},Pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Rn&&(Rn&&e.type===`mousemove`?(In=e.screenX-Rn.screenX,Ln=e.screenY-Rn.screenY):Ln=In=0,Rn=e),In)},movementY:function(e){return`movementY`in e?e.movementY:Ln}}),Bn=jn(zn),Vn=jn(T({},zn,{dataTransfer:0})),Hn=jn(T({},Pn,{relatedTarget:0})),K=jn(T({},Mn,{animationName:0,elapsedTime:0,pseudoElement:0})),Un=jn(T({},Mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Wn=jn(T({},Mn,{data:0})),Gn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Kn={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`},qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qn[e])?!!t[e]:!1}function Yn(){return Jn}var q=jn(T({},Pn,{key:function(e){if(e.key){var t=Gn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=On(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yn,charCode:function(e){return e.type===`keypress`?On(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?On(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Xn=jn(T({},zn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Zn=jn(T({},Mn,{submitter:0})),Qn=jn(T({},Pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yn})),$n=jn(T({},Mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),er=jn(T({},zn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),tr=jn(T({},Mn,{newState:0,oldState:0,source:0})),nr=[9,13,27,32],rr=xn&&`CompositionEvent`in window,ir=null;xn&&`documentMode`in document&&(ir=document.documentMode);var ar=xn&&`TextEvent`in window&&!ir,or=xn&&(!rr||ir&&8<ir&&11>=ir),sr=` `,cr=!1;function lr(e,t){switch(e){case`keyup`:return nr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ur(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var dr=!1;function fr(e,t){switch(e){case`compositionend`:return ur(t);case`keypress`:return t.which===32?(cr=!0,sr):null;case`textInput`:return e=t.data,e===sr&&cr?null:e;default:return null}}function pr(e,t){if(dr)return e===`compositionend`||!rr&&lr(e,t)?(e=Dn(),En=Tn=wn=null,dr=!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 or&&t.locale!==`ko`?null:t.data;default:return null}}var J={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 mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!J[e.type]:t===`textarea`}function hr(e,t,n,r){hn?gn?gn.push(r):gn=[r]:hn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Nn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var gr=null,_r=null;function vr(e){Bf(e,0)}function yr(e){if(Jt(Dt(e)))return e}function br(e,t){if(e===`change`)return t}var xr=!1;if(xn){var Sr;if(xn){var Cr=`oninput`in document;if(!Cr){var wr=document.createElement(`div`);wr.setAttribute(`oninput`,`return;`),Cr=typeof wr.oninput==`function`}Sr=Cr}else Sr=!1;xr=Sr&&(!document.documentMode||9<document.documentMode)}function Tr(){gr&&(gr.detachEvent(`onpropertychange`,Er),_r=gr=null)}function Er(e){if(e.propertyName===`value`&&yr(_r)){var t=[];hr(t,_r,e,mn(e)),yn(vr,t)}}function Dr(e,t,n){e===`focusin`?(Tr(),gr=t,_r=n,gr.attachEvent(`onpropertychange`,Er)):e===`focusout`&&Tr()}function Or(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return yr(_r)}function kr(e,t){if(e===`click`)return yr(t)}function Ar(e,t){if(e===`input`||e===`change`)return yr(t)}function jr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Mr=typeof Object.is==`function`?Object.is:jr;function Nr(e,t){if(Mr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ee.call(t,i)||!Mr(e[i],t[i]))return!1}return!0}function Pr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Fr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ir(e,t){var n=Fr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Fr(n)}}function Lr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Lr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pr(e.document)}return t}function zr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Br=xn&&`documentMode`in document&&11>=document.documentMode,Vr=null,Hr=null,Ur=null,Y=!1;function Wr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Y||Vr==null||Vr!==Pr(r)||(r=Vr,`selectionStart`in r&&zr(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}),Ur&&Nr(Ur,r)||(Ur=r,r=Jf(Hr,`onSelect`),0<r.length&&(t=new Nn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Vr)))}function Gr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var X={animationend:Gr(`Animation`,`AnimationEnd`),animationiteration:Gr(`Animation`,`AnimationIteration`),animationstart:Gr(`Animation`,`AnimationStart`),transitionrun:Gr(`Transition`,`TransitionRun`),transitionstart:Gr(`Transition`,`TransitionStart`),transitioncancel:Gr(`Transition`,`TransitionCancel`),transitionend:Gr(`Transition`,`TransitionEnd`)},Kr={},qr={};xn&&(qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete X.animationend.animation,delete X.animationiteration.animation,delete X.animationstart.animation),`TransitionEvent`in window||delete X.transitionend.transition);function Jr(e){if(Kr[e])return Kr[e];if(!X[e])return e;var t=X[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in qr)return Kr[e]=t[n];return e}var Yr=Jr(`animationend`),Xr=Jr(`animationiteration`),Zr=Jr(`animationstart`),Qr=Jr(`transitionrun`),$r=Jr(`transitionstart`),ei=Jr(`transitioncancel`),ti=Jr(`transitionend`),ni=new Map,ri=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);ri.push(`scrollEnd`);function ii(e,t){ni.set(e,t),Nt(t,[e])}var ai=0;function oi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=ai++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function si(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function ci(e,t){return e=si(e),t=si(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var li=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ui=[],di=0,fi=0;function pi(){for(var e=di,t=fi=di=0;t<e;){var n=ui[t];ui[t++]=null;var r=ui[t];ui[t++]=null;var i=ui[t];ui[t++]=null;var a=ui[t];if(ui[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&_i(n,i,a)}}function mi(e,t,n,r){ui[di++]=e,ui[di++]=t,ui[di++]=n,ui[di++]=r,fi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function hi(e,t,n,r){return mi(e,t,n,r),vi(e)}function gi(e,t){return mi(e,null,null,t),vi(e)}function _i(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ue(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function vi(e){if(50<Dd)throw Dd=0,Od=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var yi={};function bi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xi(e,t,n,r){return new bi(e,t,n,r)}function Si(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ci(e,t){var n=e.alternate;return n===null?(n=xi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function wi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ti(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Si(r)&&(s=1);else if(typeof r==`string`)s=Jm(e,n,de.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case z:return e=xi(31,n,t,a),e.elementType=z,e.lanes=o,e;case k:return Ei(n.children,a,o,t);case A:s=8,a|=24;break;case j:return e=xi(12,n,t,a|2),e.elementType=j,e.lanes=o,e;case F:return e=xi(13,n,t,a),e.elementType=F,e.lanes=o,e;case I:return e=xi(19,n,t,a),e.elementType=I,e.lanes=o,e;case B:case V:return e=a|32,e=xi(30,n,t,e),e.elementType=V,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case M:s=9;break a;case P:s=11;break a;case L:s=14;break a;case R:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=xi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ei(e,t,n,r){return e=xi(7,e,r,t),e.lanes=n,e}function Di(e,t,n){return e=xi(6,e,null,t),e.lanes=n,e}function Oi(e){var t=xi(18,null,null,0);return t.stateNode=e,t}function ki(e,t,n){return t=xi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ai=new WeakMap;function ji(e,t){if(typeof e==`object`&&e){var n=Ai.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},Ai.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var Mi=[],Ni=0,Pi=null,Fi=0,Ii=[],Li=0,Ri=null,zi=1,Bi=``;function Vi(e,t){Mi[Ni++]=Fi,Mi[Ni++]=Pi,Pi=e,Fi=t}function Hi(e,t,n){Ii[Li++]=zi,Ii[Li++]=Bi,Ii[Li++]=Ri,Ri=e;var r=zi;e=Bi;var i=32-Ue(r)-1;r&=~(1<<i),n+=1;var a=32-Ue(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,zi=1<<32-Ue(t)+i|n<<i|r,Bi=a+e}else zi=1<<a|n<<i|r,Bi=e}function Ui(e){e.return!==null&&(Vi(e,1),Hi(e,1,0))}function Wi(e){for(;e===Pi;)Pi=Mi[--Ni],Mi[Ni]=null,Fi=Mi[--Ni],Mi[Ni]=null;for(;e===Ri;)Ri=Ii[--Li],Ii[Li]=null,Bi=Ii[--Li],Ii[Li]=null,zi=Ii[--Li],Ii[Li]=null}function Gi(e,t){Ii[Li++]=zi,Ii[Li++]=Bi,Ii[Li++]=Ri,zi=t.id,Bi=t.overflow,Ri=e}var Ki=null,qi=null,Ji=!1,Yi=null,Xi=!1,Zi=Error(i(519));function Qi(e){throw ia(ji(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Zi}function $i(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ht]=e,t[gt]=r,n){case`dialog`:Vf(`cancel`,t),Vf(`close`,t);break;case`iframe`:case`object`:case`embed`:Vf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)Vf(Rf[n],t);break;case`source`:Vf(`error`,t);break;case`img`:case`image`:case`link`:Vf(`error`,t),Vf(`load`,t);break;case`details`:Vf(`toggle`,t);break;case`input`:Vf(`invalid`,t),Qt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Vf(`invalid`,t);break;case`textarea`:Vf(`invalid`,t),nn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ep(t.textContent,n)?(r.popover!=null&&(Vf(`beforetoggle`,t),Vf(`toggle`,t)),r.onScroll!=null&&Vf(`scroll`,t),r.onScrollEnd!=null&&Vf(`scrollend`,t),r.onClick!=null&&(t.onclick=fn),t=!0):t=!1,t||Qi(e,!0)}function ea(e){for(Ki=e.return;Ki;)switch(Ki.tag){case 5:case 31:case 13:Xi=!1;return;case 27:case 3:Xi=!0;return;default:Ki=Ki.return}}function ta(e){if(e!==Ki)return!1;if(!Ji)return ea(e),Ji=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||mp(e.type,e.memoizedProps)),n=!n),n&&qi&&Qi(e),ea(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));qi=fm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));qi=fm(e)}else t===27?(t=qi,Cp(e.type)?(e=dm,dm=null,qi=e):qi=t):qi=Ki?um(e.stateNode.nextSibling):null;return!0}function na(){qi=Ki=null,Ji=!1}function ra(){var e=Yi;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),Yi=null),e}function ia(e){Yi===null?Yi=[e]:Yi.push(e)}var aa=ce(null),oa=null,sa=null;function ca(e,t,n){ue(aa,t._currentValue),t._currentValue=n}function la(e){e._currentValue=aa.current,le(aa)}function ua(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function da(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ua(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ua(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ua(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function fa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Mr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ch]:e.push(ch))}a=a.return}return e!==null&&da(t,e,n,r),t.flags|=262144,e!==null}function pa(e){for(e=e.firstContext;e!==null;){if(!Mr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ma(e){oa=e,sa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ha(e){return _a(oa,e)}function ga(e,t){return oa===null&&ma(e),_a(e,t)}function _a(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},sa===null){if(e===null)throw Error(i(308));sa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else sa=sa.next=t;return n}var va=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ya=t.unstable_scheduleCallback,ba=t.unstable_NormalPriority,xa={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sa(){return{controller:new va,data:new Map,refCount:0}}function Ca(e){e.refCount--,e.refCount===0&&ya(ba,function(){e.controller.abort()})}function wa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ta=null;function Ea(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Da=null,Oa=0,ka=0,Aa=null;function ja(e,t){if(Da===null){var n=Da=[];Oa=0,ka=Nf(),Aa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Oa++,t.then(Ma,Ma),t}function Ma(){if(--Oa===0&&(Ta=null,Da!==null)){Aa!==null&&(Aa.status=`fulfilled`);var e=Da;Da=null,ka=0,Aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Na(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Pa=W.S;W.S=function(e,t){if(pd=je(),typeof t==`object`&&t&&typeof t.then==`function`&&ja(e,t),Ta!==null)for(var n=yf;n!==null;)wa(n,Ta),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)wa(r,n),r=r.next;if(ka!==0){r=Ta,r===null&&(r=Ta=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Pa!==null&&Pa(e,t)};var Fa=ce(null);function Ia(){var e=Fa.current;return e===null?Yu.pooledCache:e}function La(e,t){t===null?ue(Fa,Fa.current):ue(Fa,t.pool)}function Ra(){var e=Ia();return e===null?null:{parent:xa._currentValue,pool:e}}var za=Error(i(460)),Ba=Error(i(474)),Va=Error(i(542)),Ha={then:function(){}};function Ua(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Wa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(fn,fn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ja(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(fn,fn);else{if(e=Yu,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ja(e),e}throw Ka=t,za}}function Ga(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ka=e,za):e}}var Ka=null;function qa(){if(Ka===null)throw Error(i(459));var e=Ka;return Ka=null,e}function Ja(e){if(e===za||e===Va)throw Error(i(483))}var Ya=null,Xa=0;function Za(e){var t=Xa;return Xa+=1,Ya===null&&(Ya=[]),Wa(Ya,e,t)}function Qa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function $a(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function eo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ci(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Di(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===k?(e=d(e,t,n.props.children,r,n.key),Qa(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===R&&Ga(i)===t.type)?(t=a(t,n.props),Qa(t,n),t.return=e,t):(t=Ti(n.type,n.key,n.props,null,e.mode,r),Qa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ki(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ei(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Ti(t.type,t.key,t.props,null,e.mode,n),Qa(n,t),n.return=e,n;case O:return t=ki(t,e.mode,n),t.return=e,t;case R:return t=Ga(t),f(e,t,n)}if(ie(t)||H(t))return t=Ei(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Za(t),n);if(t.$$typeof===N)return f(e,ga(e,t),n);$a(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case R:return n=Ga(n),p(e,t,n,r)}if(ie(n)||H(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Za(n),r);if(n.$$typeof===N)return p(e,t,ga(e,n),r);$a(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case R:return r=Ga(r),m(e,t,n,r,i)}if(ie(r)||H(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Za(r),i);if(r.$$typeof===N)return m(e,t,n,ga(t,r),i);$a(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Ji&&Vi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ji&&Vi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Ji&&Vi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ji&&Vi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ji&&Vi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ji&&Vi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),Qa(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===R&&Ga(l)===r.type){n(e,r.sibling),c=a(r,o.props),Qa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Ei(o.props.children,e.mode,c,o.key),Qa(c,o),c.return=e,e=c):(c=Ti(o.type,o.key,o.props,null,e.mode,c),Qa(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=ki(o,e.mode,c),c.return=e,e=c}return s(e);case R:return o=Ga(o),_(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(H(o)){if(l=H(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,Za(o),c);if(o.$$typeof===N)return _(e,r,ga(e,o),c);$a(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Xa=0;var i=_(e,t,n,r);return Ya=null,i}catch(t){if(t===za||t===Va)throw t;var a=xi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var to=eo(!0),no=eo(!1),ro=!1;function io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ao(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function oo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function so(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ju&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=vi(e),_i(e,null,n),t}return mi(e,r,t,n),vi(e)}function co(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}function lo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var uo=!1;function fo(){if(uo){var e=Aa;if(e!==null)throw e}}function po(e,t,n,r){uo=!1;var i=e.updateQueue;ro=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===ka&&(uo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:ro=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),id|=o,e.lanes=o,e.memoizedState=d}}function mo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function ho(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)mo(n[e],t)}var go=ce(null),_o=ce(0);function vo(e,t){e=nd,ue(_o,e),ue(go,t),nd=e|t.baseLanes}function yo(){ue(_o,nd),ue(go,go.current)}function bo(){nd=_o.current,le(go),le(_o)}var xo=ce(null),So=null;function Co(e){var t=e.alternate;ue(Oo,Oo.current&1),ue(xo,e),So===null&&(t===null||go.current!==null||t.memoizedState!==null)&&(So=e)}function wo(e){ue(Oo,Oo.current),ue(xo,e),So===null&&(So=e)}function To(e){e.tag===22?(ue(Oo,Oo.current),ue(xo,e),So===null&&(So=e)):Eo()}function Eo(){ue(Oo,Oo.current),ue(xo,xo.current)}function Do(e){le(xo),So===e&&(So=null),le(Oo)}var Oo=ce(0);function ko(e,t){ue(xo,xo.current),ue(Oo,t)}function Ao(e){le(Oo),le(xo),So===e&&(So=null)}function jo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sm(n)||cm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mo=0,No=null,Z=null,Po=null,Fo=!1,Io=!1,Lo=!1,Ro=0,zo=0,Bo=null,Vo=0;function Ho(){throw Error(i(321))}function Uo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Mr(e[n],t[n]))return!1;return!0}function Wo(e,t,n,r,i,a){return Mo=a,No=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?sc:cc,Lo=!1,a=n(r,i),Lo=!1,Io&&(a=Ko(t,n,r,i)),Go(e),a}function Go(e){W.H=oc;var t=Z!==null&&Z.next!==null;if(Mo=0,Po=Z=No=null,Fo=!1,zo=0,Bo=null,t)throw Error(i(300));e===null||Tc||(e=e.dependencies,e!==null&&pa(e)&&(Tc=!0))}function Ko(e,t,n,r){No=e;var a=0;do{if(Io&&(Bo=null),zo=0,Io=!1,25<=a)throw Error(i(301));if(a+=1,Po=Z=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}W.H=lc,o=t(n,r)}while(Io);return o}function qo(){var e=W.H,t=e.useState()[0];return t=typeof t.then==`function`?es(t):t,e=e.useState()[0],(Z===null?null:Z.memoizedState)!==e&&(No.flags|=1024),t}function Jo(){var e=Ro!==0;return Ro=0,e}function Yo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Xo(e){if(Fo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Fo=!1}Mo=0,Po=Z=No=null,Io=!1,zo=Ro=0,Bo=null}function Zo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Po===null?No.memoizedState=Po=e:Po=Po.next=e,Po}function Qo(){if(Z===null){var e=No.alternate;e=e===null?null:e.memoizedState}else e=Z.next;var t=Po===null?No.memoizedState:Po.next;if(t!==null)Po=t,Z=e;else{if(e===null)throw No.alternate===null?Error(i(467)):Error(i(310));Z=e,e={memoizedState:Z.memoizedState,baseState:Z.baseState,baseQueue:Z.baseQueue,queue:Z.queue,next:null},Po===null?No.memoizedState=Po=e:Po=Po.next=e}return Po}function $o(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function es(e){var t=zo;return zo+=1,Bo===null&&(Bo=[]),e=Wa(Bo,e,t),t=No,(Po===null?t.memoizedState:Po.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?sc:cc),e}function ts(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return es(e);if(e.$$typeof===te)return;if(e.$$typeof===N)return ha(e)}throw Error(i(438,String(e)))}function ns(e){var t=null,n=No.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=No.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=$o(),No.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function rs(e,t){return typeof t==`function`?t(e):t}function is(e){return as(Qo(),Z,e)}function as(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Mo&f)===f:(Q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ka&&(d=!0);else if((Mo&p)===p){u=u.next,p===ka&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,No.lanes|=p,id|=p;f=u.action,Lo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,No.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Mr(o,e.memoizedState)&&(Tc=!0,d&&(n=Aa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function os(e){var t=Qo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Mr(o,t.memoizedState)||(Tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ss(e,t,n){var r=No,a=Qo(),o=Ji;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Mr((Z||a).memoizedState,n);if(s&&(a.memoizedState=n,Tc=!0),a=a.queue,Ms(us.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Po!==null&&!!(Po.memoizedState.tag&1),Ds(e?9:8,{destroy:void 0},ls.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Yu===null)throw Error(i(349));o||Mo&127||cs(r,t,n)}return n}function cs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=No.updateQueue,t===null?(t=$o(),No.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ls(e,t,n,r){t.value=n,t.getSnapshot=r,ds(t)&&fs(e)}function us(e,t,n){return n(function(){ds(t)&&fs(e)})}function ds(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Mr(e,n)}catch{return!0}}function fs(e){var t=gi(e,2);t!==null&&Md(t,e,2)}function ps(e){var t=Zo();if(typeof e==`function`){var n=e;if(e=n(),Lo){He(!0);try{n()}finally{He(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:e},t}function ms(e,t,n,r){return e.baseState=n,as(e,Z,typeof r==`function`?r:rs)}function hs(e,t,n,r,a){if(rc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};W.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,gs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function gs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=W.T,o={};o.types=a===null?null:a.types,W.T=o;try{var s=n(i,r),c=W.S;c!==null&&c(o,s),_s(e,t,s)}catch(n){ys(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),W.T=a}}else try{a=n(i,r),_s(e,t,a)}catch(n){ys(e,t,n)}}function _s(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){vs(e,t,n)},function(n){return ys(e,t,n)}):vs(e,t,n)}function vs(e,t,n){t.status=`fulfilled`,t.value=n,bs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,gs(e,n)))}function ys(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,bs(t),t=t.next;while(t!==r)}e.action=null}function bs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function xs(e,t){return t}function Ss(e,t){if(Ji){var n=Yu.formState;if(n!==null){a:{var r=No;if(Ji){if(qi){b:{for(var i=qi,a=Xi;i.nodeType!==8;)if(!a||(i=um(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){qi=um(i.nextSibling),r=i.data===`F!`;break a}}Qi(r)}r=!1}r&&(t=n[0])}}return n=Zo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:t},n.queue=r,n=ec.bind(null,No,r),r.dispatch=n,r=ps(!1),a=nc.bind(null,No,!1,r.queue),r=Zo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=hs.bind(null,No,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Cs(e){return ws(Qo(),Z,e)}function ws(e,t,n){if(t=as(e,t,xs)[0],e=is(rs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=es(t)}catch(e){throw e===za?Va:e}else r=t;t=Qo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(No.flags|=2048,Ds(9,{destroy:void 0},Ts.bind(null,i,n),null)),[r,a,e]}function Ts(e,t){e.action=t}function Es(e){var t=Qo(),n=Z;if(n!==null)return ws(t,n,e);Qo(),t=t.memoizedState,n=Qo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ds(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=No.updateQueue,t===null&&(t=$o(),No.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Os(){return Qo().memoizedState}function ks(e,t,n,r){var i=Zo();No.flags|=e,i.memoizedState=Ds(1|t,{destroy:void 0},n,r===void 0?null:r)}function As(e,t,n,r){var i=Qo();r=r===void 0?null:r;var a=i.memoizedState.inst;Z!==null&&r!==null&&Uo(r,Z.memoizedState.deps)?i.memoizedState=Ds(t,a,n,r):(No.flags|=e,i.memoizedState=Ds(1|t,a,n,r))}function js(e,t){ks(8390656,8,e,t)}function Ms(e,t){As(2048,8,e,t)}function Ns(e){No.flags|=4;var t=No.updateQueue;if(t===null)t=$o(),No.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ps(e){var t=Qo().memoizedState;return Ns({ref:t,nextImpl:e}),function(){if(Ju&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Fs(e,t){return As(4,2,e,t)}function Is(e,t){return As(4,4,e,t)}function Ls(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Rs(e,t,n){n=n==null?null:n.concat([e]),As(4,4,Ls.bind(null,t,e),n)}function zs(){}function Bs(e,t){var n=Qo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Uo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Vs(e,t){var n=Qo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Uo(t,r[1]))return r[0];if(r=e(),Lo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r}function Hs(e,t,n){return n===void 0||Mo&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),No.lanes|=e,id|=e,n)}function Us(e,t,n,r){return Mr(n,t)?n:go.current===null?!(Mo&106)||Mo&1073741824&&!(Q&261930)?(Tc=!0,e.memoizedState=n):(e=Ad(),No.lanes|=e,id|=e,t):(e=Hs(e,n,r),Mr(e,t)||(Tc=!0),e)}function Ws(e,t,n,r,i){var a=G.p;G.p=a!==0&&8>a?a:8;var o=W.T,s={};s.types=o===null?null:o.types,W.T=s,nc(e,!1,t,n);try{var c=i(),l=W.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?tc(e,t,Na(c,r),kd(e)):tc(e,t,r,kd(e))}catch(n){tc(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{G.p=a,o!==null&&s.types!==null&&(o.types=s.types),W.T=o}}function Gs(){}function Ks(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=qs(e).queue;Ws(e,a,t,ae,n===null?Gs:function(){return Js(e),n(r)})}function qs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Js(e){var t=qs(e);t.next===null&&(t=e.alternate.memoizedState),tc(e,t.next.queue,{},kd())}function Ys(){return ha(ch)}function Xs(){return Qo().memoizedState}function Zs(){return Qo().memoizedState}function Qs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=oo(n);var r=so(t,e,n);r!==null&&(Md(r,t,n),co(r,t,n)),t={cache:Sa()},e.payload=t;return}t=t.return}}function $s(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},rc(e)?ic(t,n):(n=hi(e,t,n,r),n!==null&&(Md(n,e,r),ac(n,t,r)))}function ec(e,t,n){tc(e,t,n,kd())}function tc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(rc(e))ic(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Mr(s,o))return mi(e,t,i,0),Yu===null&&pi(),!1}catch{}if(n=hi(e,t,i,r),n!==null)return Md(n,e,r),ac(n,t,r),!0}return!1}function nc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},rc(e)){if(t)throw Error(i(479))}else t=hi(e,n,r,2),t!==null&&Md(t,e,2)}function rc(e){var t=e.alternate;return e===No||t!==null&&t===No}function ic(e,t){Io=Fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ac(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}var oc={readContext:ha,use:ts,useCallback:Ho,useContext:Ho,useEffect:Ho,useImperativeHandle:Ho,useLayoutEffect:Ho,useInsertionEffect:Ho,useMemo:Ho,useReducer:Ho,useRef:Ho,useState:Ho,useDebugValue:Ho,useDeferredValue:Ho,useTransition:Ho,useSyncExternalStore:Ho,useId:Ho,useHostTransitionStatus:Ho,useFormState:Ho,useActionState:Ho,useOptimistic:Ho,useMemoCache:Ho,useCacheRefresh:Ho,useEffectEvent:Ho},sc={readContext:ha,use:ts,useCallback:function(e,t){return Zo().memoizedState=[e,t===void 0?null:t],e},useContext:ha,useEffect:js,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ks(4194308,4,Ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ks(4194308,4,e,t)},useInsertionEffect:function(e,t){ks(4,2,e,t)},useMemo:function(e,t){var n=Zo();t=t===void 0?null:t;var r=e();if(Lo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Zo();if(n!==void 0){var i=n(t);if(Lo){He(!0);try{n(t)}finally{He(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=$s.bind(null,No,e),[r.memoizedState,e]},useRef:function(e){var t=Zo();return e={current:e},t.memoizedState=e},useState:function(e){e=ps(e);var t=e.queue,n=ec.bind(null,No,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:zs,useDeferredValue:function(e,t){return Hs(Zo(),e,t)},useTransition:function(){var e=ps(!1);return e=Ws.bind(null,No,e.queue,!0,!1),Zo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=No,a=Zo();if(Ji){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Yu===null)throw Error(i(349));Q&127||cs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,js(us.bind(null,r,o,e),[e]),r.flags|=2048,Ds(9,{destroy:void 0},ls.bind(null,r,o,n,t),null),n},useId:function(){var e=Zo(),t=Yu.identifierPrefix;if(Ji){var n=Bi,r=zi;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ro++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Vo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ys,useFormState:Ss,useActionState:Ss,useOptimistic:function(e){var t=Zo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=nc.bind(null,No,!0,n),n.dispatch=t,[e,t]},useMemoCache:ns,useCacheRefresh:function(){return Zo().memoizedState=Qs.bind(null,No)},useEffectEvent:function(e){var t=Zo(),n={impl:e};return t.memoizedState=n,function(){if(Ju&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},cc={readContext:ha,use:ts,useCallback:Bs,useContext:ha,useEffect:Ms,useImperativeHandle:Rs,useInsertionEffect:Fs,useLayoutEffect:Is,useMemo:Vs,useReducer:is,useRef:Os,useState:function(){return is(rs)},useDebugValue:zs,useDeferredValue:function(e,t){return Us(Qo(),Z.memoizedState,e,t)},useTransition:function(){var e=is(rs)[0],t=Qo().memoizedState;return[typeof e==`boolean`?e:es(e),t]},useSyncExternalStore:ss,useId:Xs,useHostTransitionStatus:Ys,useFormState:Cs,useActionState:Cs,useOptimistic:function(e,t){return ms(Qo(),Z,e,t)},useMemoCache:ns,useCacheRefresh:Zs,useEffectEvent:Ps},lc={readContext:ha,use:ts,useCallback:Bs,useContext:ha,useEffect:Ms,useImperativeHandle:Rs,useInsertionEffect:Fs,useLayoutEffect:Is,useMemo:Vs,useReducer:os,useRef:Os,useState:function(){return os(rs)},useDebugValue:zs,useDeferredValue:function(e,t){var n=Qo();return Z===null?Hs(n,e,t):Us(n,Z.memoizedState,e,t)},useTransition:function(){var e=os(rs)[0],t=Qo().memoizedState;return[typeof e==`boolean`?e:es(e),t]},useSyncExternalStore:ss,useId:Xs,useHostTransitionStatus:Ys,useFormState:Es,useActionState:Es,useOptimistic:function(e,t){var n=Qo();return Z===null?(n.baseState=e,[e,n.queue.dispatch]):ms(n,Z,e,t)},useMemoCache:ns,useCacheRefresh:Zs,useEffectEvent:Ps};function uc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var dc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=oo(r);i.payload=t,n!=null&&(i.callback=n),t=so(e,i,r),t!==null&&(Md(t,e,r),co(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=oo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=so(e,i,r),t!==null&&(Md(t,e,r),co(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=oo(n);r.tag=2,t!=null&&(r.callback=t),t=so(e,r,n),t!==null&&(Md(t,e,n),co(t,e,n))}};function fc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Nr(n,r)||!Nr(i,a):!0}function pc(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&&dc.enqueueReplaceState(t,t.state,null)}function mc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function hc(e){li(e)}function gc(e){console.error(e)}function _c(e){li(e)}function vc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function yc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function bc(e,t,n){return n=oo(n),n.tag=3,n.payload={element:null},n.callback=function(){vc(e,t)},n}function xc(e){return e=oo(e),e.tag=3,e}function Sc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){yc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){yc(t,n,r),typeof i!=`function`&&(gd===null?gd=new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Cc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&fa(t,n,a,!0),n=xo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return So===null?Wd():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ha?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),pf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ha?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),pf(e,r,a)),!1}throw Error(i(435,n.tag))}return pf(e,r,a),Wd(),!1}if(Ji)return t=xo.current,t===null?(r!==Zi&&(t=Error(i(423),{cause:r}),ia(ji(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ji(r,n),a=bc(e.stateNode,r,a),lo(e,a),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Zi&&(e=Error(i(422),{cause:r}),ia(ji(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ji(o,n),ld===null?ld=[o]:ld.push(o),rd!==4&&(rd=2),t===null)return!0;r=ji(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=bc(n.stateNode,r,e),lo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(gd===null||!gd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=xc(a),Sc(a,e,n,r),lo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var wc=Error(i(461)),Tc=!1;function Ec(e,t,n,r){t.child=e===null?no(t,null,n,r):to(t,e.child,n,r)}function Dc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ma(t),r=Wo(e,t,n,o,a,i),s=Jo(),e!==null&&!Tc?(Yo(e,t,i),tl(e,t,i)):(Ji&&s&&Ui(t),t.flags|=1,Ec(e,t,r,i),t.child)}function Oc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Si(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,kc(e,t,a,r,i)):(e=Ti(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!nl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Nr:n,n(o,r)&&e.ref===t.ref)return tl(e,t,i)}return t.flags|=1,e=Ci(a,r),e.ref=t.ref,e.return=t,t.child=e}function kc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Nr(a,r)&&e.ref===t.ref){if(Tc=!1,t.pendingProps=r=a,nl(e,i))e.flags&131072&&(Tc=!0);else return t.lanes=e.lanes,tl(e,t,i)}}return Lc(e,t,n,r,i)}function Ac(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Mc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&La(t,a===null?null:a.cachePool),a===null?yo():vo(t,a),To(t);else return r=t.lanes=536870912,Mc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&La(t,null),yo(),Eo()):(La(t,a.cachePool),vo(t,a),Eo(),t.memoizedState=null);return Ec(e,t,i,n),t.child}function jc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Mc(e,t,n,r,i){var a=Ia();return a=a===null?null:{parent:xa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&La(t,null),yo(),To(t),e!==null&&fa(e,t,r,!0),t.childLanes=i,null}function Nc(e,t){return t=Kc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Pc(e,t,n){return to(t,e.child,null,n),e=Nc(t,t.pendingProps),e.flags|=2,Do(t),t.memoizedState=null,e}function Fc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Ji){if(r.mode===`hidden`)return e=Nc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},jc(null,e);if(wo(t),(e=qi)?(e=om(e,Xi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri===null?null:{id:zi,overflow:Bi},retryLane:536870912,hydrationErrors:null},n=Oi(e),n.return=t,t.child=n,Ki=t,qi=null)):e=null,e===null)throw Qi(t);return t.lanes=536870912,null}return Nc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(wo(t),a){if(t.flags&256)t.flags&=-257,t=Pc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Tc||fa(e,t,n,!1),a=(n&e.childLanes)!==0,Tc||a){if(go.current===null){if(r=Yu,r!==null&&(s=lt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,gi(e,s),Md(r,e,s),wc;Wd()}t=Pc(e,t,n)}else e=o.treeContext,qi=um(s.nextSibling),Ki=t,Ji=!0,Yi=null,Xi=!1,e!==null&&Gi(t,e),t=Nc(t,r),t.flags|=134221824;return t}return e=Ci(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ic(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Lc(e,t,n,r,i){return ma(t),n=Wo(e,t,n,r,void 0,i),r=Jo(),e!==null&&!Tc?(Yo(e,t,i),tl(e,t,i)):(Ji&&r&&Ui(t),t.flags|=1,Ec(e,t,n,i),t.child)}function Rc(e,t,n,r,i,a){return ma(t),t.updateQueue=null,n=Ko(t,r,n,i),Go(e),r=Jo(),e!==null&&!Tc?(Yo(e,t,a),tl(e,t,a)):(Ji&&r&&Ui(t),t.flags|=1,Ec(e,t,n,a),t.child)}function zc(e,t,n,r,i){if(ma(t),t.stateNode===null){var a=yi,o=n.contextType;typeof o==`object`&&o&&(a=ha(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=dc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},io(t),o=n.contextType,a.context=typeof o==`object`&&o?ha(o):yi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(uc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&dc.enqueueReplaceState(a,a.state,null),po(t,r,a,i),fo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=mc(n,s);a.props=c;var l=a.context,u=n.contextType;o=yi,typeof u==`object`&&u&&(o=ha(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&pc(t,a,r,o),ro=!1;var f=t.memoizedState;a.state=f,po(t,r,a,i),fo(),l=t.memoizedState,s||f!==l||ro?(typeof d==`function`&&(uc(t,n,d,r),l=t.memoizedState),(c=ro||fc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ao(e,t),o=t.memoizedProps,u=mc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=yi,typeof l==`object`&&l&&(c=ha(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&pc(t,a,r,c),ro=!1,f=t.memoizedState,a.state=f,po(t,r,a,i),fo();var p=t.memoizedState;o!==d||f!==p||ro||e!==null&&e.dependencies!==null&&pa(e.dependencies)?(typeof s==`function`&&(uc(t,n,s,r),p=t.memoizedState),(u=ro||fc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&pa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Ic(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=to(t,e.child,null,i),t.child=to(t,null,n,i)):Ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=tl(e,t,i),e}function Bc(e,t,n,r){return na(),t.flags|=256,Ec(e,t,n,r),t.child}var Vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hc(e){return{baseLanes:e,cachePool:Ra()}}function Uc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function Wc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Oo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(Ji){if(i?Co(t):Eo(),(e=qi)?(e=om(e,Xi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri===null?null:{id:zi,overflow:Bi},retryLane:536870912,hydrationErrors:null},n=Oi(e),n.return=t,t.child=n,Ki=t,qi=null)):e=null,e===null)throw Qi(t);return t.lanes=cm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Eo(),i=t.mode,a=Kc({mode:`hidden`,children:a},i),r=Ei(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Hc(n),r.childLanes=Uc(e,o,n),t.memoizedState=Vc,jc(null,r)):(Co(t),Gc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Jc(e,t,a,o,r,c,s,n)}return i?(Eo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ci(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ei(i,a,n,null),i.flags|=2):i=Ci(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,jc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Hc(n):(a=i.cachePool,a===null?a=Ra():(s=xa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Uc(e,o,n),t.memoizedState=Vc,jc(e.child,r)):(Co(t),n=e.child,e=n.sibling,n=Ci(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Gc(e,t){return t=Kc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Kc(e,t){return e=xi(22,e,null,t),e.lanes=0,e}function qc(e,t,n){return to(t,e.child,null,n),e=Gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Co(t),t.flags&=-257,qc(e,t,c)):t.memoizedState===null?(Eo(),o=a.fallback,s=t.mode,a=Kc({mode:`visible`,children:a.children},s),o=Ei(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,to(t,e.child,null,c),a=t.child,a.memoizedState=Hc(c),a.childLanes=Uc(e,r,c),t.memoizedState=Vc,jc(null,a)):(Eo(),t.child=e.child,t.flags|=128,null);if(Co(t),cm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ia({value:a,source:null,stack:null})),qc(e,t,c)}if(Tc||fa(e,t,c,!1),r=(c&e.childLanes)!==0,Tc||r){if(go.current!==null)return qc(e,t,c);if(r=Yu,r!==null&&(a=lt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,gi(e,a),Md(r,e,a),wc;return sm(o)||Wd(),qc(e,t,c)}return sm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,qi=um(o.nextSibling),Ki=t,Ji=!0,Yi=null,Xi=!1,e!==null&&Gi(t,e),t=Gc(t,a.children),t.flags|=134221824,t)}function Yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ua(e.return,t,n)}function Xc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&jo(n)===null&&(t=e),e=e.sibling}return t}function Zc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Qc(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function $c(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Oo.current;if(t.flags&128)return ko(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,ko(t,o),i===`backwards`&&e!==null?(Qc(e),Ec(e,t,r,n),Qc(e)):Ec(e,t,r,n),r=Ji?Fi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Yc(e,n,t);else if(e.tag===19)Yc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=Xc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,Qc(t)),Zc(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&jo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Zc(t,!0,n,null,a,r);break;case`together`:Zc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Xc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Zc(t,!1,i,n,a,r)}return t.child}function el(e,t,n){var r=t.pendingProps;return ca(t,t.type,r.value),Ec(e,t,r.children,n),t.child}function tl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(fa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ci(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ci(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function nl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&pa(e)))}function rl(e,t,n){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),ca(t,xa,e.memoizedState.cache),na();break;case 27:case 5:_e(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:ca(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,wo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Co(t),t.flags|=128,null;r=fa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Wc(e,t,n):(Co(t),e=tl(e,t,n),e===null?null:e.sibling)}Co(t);break;case 19:if(t.flags&128)return $c(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(fa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return $c(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ko(t,Oo.current),r)break;return null;case 22:return t.lanes=0,Ac(e,t,n,t.pendingProps);case 24:ca(t,xa,e.memoizedState.cache)}return tl(e,t,n)}function il(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Tc=!0;else{if(!nl(e,n)&&!(t.flags&128))return Tc=!1,rl(e,t,n);Tc=!!(e.flags&131072)}}else Tc=!1,Ji&&t.flags&1048576&&Hi(t,Fi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ga(t.elementType),t.type=e,typeof e==`function`)Si(e)?(r=mc(e,r),t.tag=1,t=zc(null,t,e,r,n)):(t.tag=0,t=Lc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===P){t.tag=11,t=Dc(null,t,e,r,n);break a}if(a===L){t.tag=14,t=Oc(null,t,e,r,n);break a}if(a===N){t.tag=10,t.type=e,t=el(null,t,n);break a}}throw t=U(e)||e,Error(i(306,t,``))}}return t;case 0:return Lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=mc(r,t.pendingProps),zc(e,t,r,a,n);case 3:a:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ao(e,t),po(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ca(t,xa,r),r!==o.cache&&da(t,[xa],n,!0),fo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Bc(e,t,r,n);break a}if(r!==a){a=ji(Error(i(424)),t),ia(a),t=Bc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(qi=um(e.firstChild),Ki=t,Ji=!0,Yi=null,Xi=!0,n=no(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(na(),r===a){t=tl(e,t,n);break a}Ec(e,t,r,n)}t=t.child}return t;case 26:return Ic(e,t),e===null?(n=Pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ji||(t.stateNode=pp(t.type,t.pendingProps,pe.current,t)):t.memoizedState=Pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&Ji&&(r=t.stateNode=gm(t.type,t.pendingProps,pe.current),Ki=t,Xi=!0,a=qi,Cp(t.type)?(dm=a,qi=um(r.firstChild)):qi=a),Ec(e,t,t.pendingProps.children,n),Ic(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ji&&((a=r=qi)&&(r=im(r,t.type,t.pendingProps,Xi),r===null?a=!1:(t.stateNode=r,Ki=t,qi=um(r.firstChild),Xi=!1,a=!0)),a||Qi(t)),_e(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,mp(a,o)?r=null:s!==null&&mp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Wo(e,t,qo,null,null,n),ch._currentValue=a),Ic(e,t),Ec(e,t,r,n),t.child;case 6:return e===null&&Ji&&((e=n=qi)&&(n=am(n,t.pendingProps,Xi),n===null?e=!1:(t.stateNode=n,Ki=t,qi=null,e=!0)),e||Qi(t)),null;case 13:return Wc(e,t,n);case 4:return he(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=to(t,null,r,n):Ec(e,t,r,n),t.child;case 11:return Dc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Ic(e,t),Ec(e,t,r,n),t.child;case 8:return Ec(e,t,t.pendingProps.children,n),t.child;case 12:return Ec(e,t,t.pendingProps.children,n),t.child;case 10:return el(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ma(t),a=ha(a),r=r(a),t.flags|=1,Ec(e,t,r,n),t.child;case 14:return Oc(e,t,t.type,t.pendingProps,n);case 15:return kc(e,t,t.type,t.pendingProps,n);case 19:return $c(e,t,n);case 31:return Fc(e,t,n);case 22:return Ac(e,t,n,t.pendingProps);case 24:return ma(t),r=ha(xa),e===null?(a=Ia(),a===null&&(a=Yu,o=Sa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},io(t),ca(t,xa,a)):((e.lanes&n)!==0&&(ao(e,t),po(t,null,null,n),fo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ca(t,xa,r),r!==a.cache&&da(t,[xa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ca(t,xa,r))),Ec(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:Ji&&Ui(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Ic(e,t),Ec(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function al(e){e.flags|=4}function ol(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Ym(t,r):Ym(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Vd())e.flags|=8192;else throw Ka=Ha,Ba}}else e.flags&=-16777217}function sl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t)){if(Vd())e.flags|=8192;else throw Ka=Ha,Ba}}function cl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,cd|=t)}function ll(e,t){if(!Ji)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function ul(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function dl(e,t,n){var r=t.pendingProps;switch(Wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ul(t),null;case 1:return ul(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),la(xa),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ta(t)?al(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ra())),ul(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(al(t),o===null?(ul(t),ol(t,a,null,r,n)):(ul(t),sl(t,o))):o?o===e.memoizedState?(ul(t),t.flags&=-16777217):(al(t),ul(t),sl(t,o)):(e=e.memoizedProps,e!==r&&al(t),ul(t),ol(t,a,e,r,n)),null;case 27:if(ve(t),n=pe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&al(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ul(t),t.subtreeFlags&=-33554433,null}e=de.current,ta(t)?$i(t,e):(e=gm(a,r,n),t.stateNode=e,al(t))}return ul(t),t.subtreeFlags&=-33554433,null;case 5:if(ve(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&al(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ul(t),t.subtreeFlags&=-33554433,null}if(o=de.current,ta(t))$i(t,o);else{var s=up(pe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ht]=t,o[gt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(rp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&al(t)}}return ul(t),t.subtreeFlags&=-33554433,ol(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&al(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,ta(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ki,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ht]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||Qi(t,!0)}else e=up(e).createTextNode(r),e[ht]=t,t.stateNode=e}return ul(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ta(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ht]=t}else na(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ul(t),e=!1}else n=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Do(t),t):(Do(t),null);if(t.flags&128)throw Error(i(558))}return ul(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ta(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ht]=t}else na(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ul(t),a=!1}else a=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Do(t),t):(Do(t),null)}return Do(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),cl(t,t.updateQueue),ul(t),null);case 4:return ge(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,ul(t),null;case 10:return la(t.type),ul(t),null;case 19:if(Ao(t),r=t.memoizedState,r===null)return ul(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ll(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=jo(e),o!==null){for(t.flags|=128,ll(r,!1),e=o.updateQueue,t.updateQueue=e,cl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)wi(n,e),n=n.sibling;return ko(t,Oo.current&1|2),Ji&&Vi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>md&&(t.flags|=128,a=!0,ll(r,!1),t.lanes=4194304)}}else{if(!a){if(e=jo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,cl(t,e),ll(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!Ji)return ul(t),null}else 2*je()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,a=!0,ll(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,o=Oo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||Ji?ko(t,o):(n=o,ue(xo,t),ue(Oo,n),So===null&&(So=t)),Ji&&Vi(t,r.treeForkCount),e}return ul(t),null;case 22:case 23:return Do(t),bo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(ul(t),t.subtreeFlags&6&&(t.flags|=8192)):ul(t),n=t.updateQueue,n!==null&&cl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&le(Fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),la(xa),ul(t),null;case 25:return null;case 30:return t.flags|=33554432,ul(t),null}throw Error(i(156,t.tag))}function fl(e,t){switch(Wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return la(xa),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(Do(t),t.alternate===null)throw Error(i(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Do(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ao(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ge(),null;case 10:return la(t.type),null;case 22:case 23:return Do(t),bo(),e!==null&&le(Fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return la(xa),null;case 25:return null;default:return null}}function pl(e,t){switch(Wi(t),t.tag){case 3:la(xa),ge();break;case 26:case 27:case 5:ve(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&Do(t);break;case 13:Do(t);break;case 19:Ao(t);break;case 10:la(t.type);break;case 22:case 23:Do(t),bo(),e!==null&&le(Fa);break;case 24:la(xa)}}function ml(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){ff(t,t.return,e)}}function hl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function gl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ho(t,n)}catch(t){ff(e,e.return,t)}}}function _l(e,t,n){n.props=mc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function vl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=oi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Fp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Ip(e);p(e.child,!1,$p,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ff(e,t,n)}}function yl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){ff(e,t,n)}else n.current=null}}function bl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)tm(e.stateNode,t[n])}function xl(e){for(var t=e.return;t!==null&&(wl(t)&&tm(e.stateNode,t.stateNode),!Cl(t));)t=t.return}function Sl(e){for(var t=e.return;t!==null&&(wl(t)&&nm(e.stateNode,t.stateNode),!Cl(t));)t=t.return}function Cl(e){return e.tag===5||e.tag===3||e.tag===27}function wl(e){return e&&e.tag===7&&e.stateNode!==null}function Tl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ff(e,e.return,t)}}function El(e,t,n){try{var r=e.stateNode;ap(r,e.type,n,t),r[gt]=t}catch(t){ff(e,e.return,t)}}function Dl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cp(e.type)||e.tag===4}function Ol(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Dl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Cp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=fn)),bl(e,r),zt=!0;else if(i!==4&&(i===27&&(bl(e,r),r=null,Cp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(kl(e,t,n,r),e=e.sibling;e!==null;)kl(e,t,n,r),e=e.sibling}function Al(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),bl(e,r),zt=!0;else if(i!==4&&(i===27&&(bl(e,r),r=null,Cp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Al(e,t,n,r),e=e.sibling;e!==null;)Al(e,t,n,r),e=e.sibling}function jl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);rp(t,r,n),t[ht]=e,t[gt]=n}catch(t){ff(e,e.return,t)}}var Ml=!1,Nl=null;function Pl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Ml=!0)}var Fl=null;function Il(){var e=Fl;return Fl=null,e}var Ll=0;function Rl(e,t,n,r,i){return Ll=0,zl(e.child,t,n,r,i)}function zl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=kp(o);r.push(s),s.view&&(a=!0)}else a||kp(o).view&&(a=!0);Ml=!0,Ep(o,Ll===0?t:t+`_`+Ll,n),Ll++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||zl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Bl(e,t){for(;e!==null;)e.tag===5?Dp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Bl(e.child,t),e=e.sibling}function Vl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Vl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=ci(t.default,t.share),t!==`none`&&(Rl(e,n,t,null,!1)||Bl(e.child,!1))}e=e.sibling}}function Hl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=oi(r,n),a=ci(r.default,n.paired?r.share:r.enter);a===`none`?Vl(e):Rl(e,i,a,null,!1)?(Vl(e),n.paired||t||jd(e,r.onEnter)):Bl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Hl(e,t),e=e.sibling;else Vl(e)}function Ul(e){if(Nl!==null&&Nl.size!==0){var t=Nl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=ci(n.default,n.share);if(a!==`none`&&(Rl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):Bl(e.child,!1)),t.delete(r),t.size===0)break}}}Ul(e)}e=e.sibling}}}function Wl(e){if(e.tag===30){var t=e.memoizedProps,n=oi(t,e.stateNode),r=Nl===null?void 0:Nl.get(n),i=ci(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Rl(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Nl.delete(n),jd(e,t.onShare)):Bl(e.child,!1)),Nl!==null&&Ul(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Wl(e),e=e.sibling;else Nl!==null&&Ul(e)}function Gl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=oi(t,e.stateNode);t=ci(t.default,t.update),e.flags&=-5,t!==`none`&&Rl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Gl(e);e=e.sibling}}function Kl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Bl(e.child,!1))}Kl(e)}e=e.sibling}}function ql(e){if(e.tag===30)e.stateNode.paired=null,Bl(e.child,!1),Kl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else Kl(e)}function Jl(e){for(e=e.child;e!==null;)e.tag===30?Bl(e.child,!1):e.subtreeFlags&33554432&&Jl(e),e=e.sibling}function Yl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ll<a.length){var l=a[Ll],u=kp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Ep(c,Ll===0?n:n+`_`+Ll,i),s&&e.flags&4||(Fl===null&&(Fl=[]),Fl.push(c,Ll===0?r:r+`_`+Ll,t.memoizedProps)),Ll++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Yl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Xl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=oi(n,r),a=ci(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ap)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ll=0,i=Yl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Xl(e,t);e=e.sibling}}var Zl=!1,Ql=!1,$l=!1,eu=!1,tu=typeof WeakSet==`function`?WeakSet:Set,nu=null,ru=!1,iu=!1,au=!1,ou=!1;function su(e,t,n){if(e=e.containerInfo,cp=_h,e=Rr(e),zr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(lp={focusedElem:e,selectionRange:r},_h=!1,n=(n&335544064)===n,nu=t,t=n?9270:1024;nu!==null;){if(e=nu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Wl(r[a]);if(e.alternate===null&&e.flags&2)n&&Pl(e),cu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Wl(r),cu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Pl(e),cu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,nu=r):(n&&Gl(e),cu(n))}}Nl=null}function cu(e){for(;nu!==null;){var t=nu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=mc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)rm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:rm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=oi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=ci(a.default,a.update),a!==`none`&&Rl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,nu=r;break}nu=t.return}}function lu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ku(e,n),r&4&&ml(5,n);break;case 1:if(ku(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=mc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&gl(n),r&512&&vl(n,n.return);break;case 3:if(ku(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{ho(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&jl(n);case 26:case 5:ku(e,n),t===null&&r&4&&Tl(n),r&512&&vl(n,n.return);break;case 12:ku(e,n);break;case 31:ku(e,n),r&4&&vu(e,n);break;case 13:ku(e,n),r&4&&yu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),lm(e,n))));break;case 22:if(r=n.memoizedState!==null||Zl,!r){var a=t!==null&&t.memoizedState!==null||Ql;t=Zl,i=Ql,Zl=r,(Ql=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),ju(e,n,r)):ku(e,n),Zl=t,Ql=i}break;case 30:ku(e,n),r&512&&vl(n,n.return);break;case 7:r&512&&vl(n,n.return);default:ku(e,n)}}function uu(e,t){for(e=e.child;e!==null;)du(e,t),e=e.sibling}function du(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){ff(e,e.return,t)}fu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,zt=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Tp(s,!0):Tp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&uu(e,t);break;default:uu(e,t)}}function fu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:du(n,r);break a;case 22:n.memoizedState===null&&fu(n,r);break a;default:fu(n,r)}}e=e.sibling}}function pu(e){var t=e.alternate;t!==null&&(e.alternate=null,pu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var mu=null,hu=!1;function gu(e,t,n){for(n=n.child;n!==null;)_u(e,t,n),n=n.sibling}function _u(e,t,n){if(Ve&&typeof Ve.onCommitFiberUnmount==`function`)try{Ve.onCommitFiberUnmount(Be,n)}catch{}switch(n.tag){case 26:Ql||yl(n,t),gu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Ql&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ql||yl(n,t),Sl(n);var r=mu,i=hu;Cp(n.type)&&(mu=n.stateNode,hu=!1),gu(e,t,n),_m(n.stateNode,n.type,n.memoizedProps),mu=r,hu=i;break;case 5:Ql||yl(n,t),Sl(n);case 6:if(n.tag===6&&Sl(n),r=mu,i=hu,mu=null,gu(e,t,n),mu=r,hu=i,mu!==null){if(hu)try{(mu.nodeType===9?mu.body:mu.nodeName===`HTML`?mu.ownerDocument.body:mu).removeChild(n.stateNode),zt=!0}catch(e){ff(n,t,e)}else try{mu.removeChild(n.stateNode),zt=!0}catch(e){ff(n,t,e)}}break;case 18:mu!==null&&(hu?(e=mu,wp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Uh(e)):wp(mu,n.stateNode));break;case 4:r=mu,i=hu,mu=n.stateNode.containerInfo,hu=!0,gu(e,t,n),mu=r,hu=i;break;case 0:case 11:case 14:case 15:hl(2,n,t),Ql||hl(4,n,t),gu(e,t,n);break;case 1:Ql||(yl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&_l(n,t,r)),gu(e,t,n);break;case 21:gu(e,t,n);break;case 22:Ql=(r=Ql)||n.memoizedState!==null,gu(e,t,n),Ql=r;break;case 30:yl(n,t),gu(e,t,n);break;case 7:Ql||yl(n,t),gu(e,t,n);break;default:gu(e,t,n)}}function vu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Uh(e)}catch(e){ff(t,t.return,e)}}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Uh(e)}catch(e){ff(t,t.return,e)}}function bu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tu),t;default:throw Error(i(435,e.tag))}}function xu(e,t){var n=bu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function Su(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Cp(l.type)){mu=l.stateNode,hu=!1;break a}break;case 5:mu=l.stateNode,hu=!1;break a;case 3:case 4:mu=l.stateNode.containerInfo,hu=!0;break a}l=l.return}if(mu===null)throw Error(i(160));_u(s,c,o),mu=null,hu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wu(t,e,n),t=t.sibling}var Cu=null;function wu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Su(t,e,n),Tu(e),a&4&&(hl(3,e,e.return),ml(3,e),hl(5,e,e.return));break;case 1:Su(t,e,n),Tu(e),a&512&&(Ql||r===null||yl(r,r.return)),a&64&&Zl&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Cu,Su(t,e,n),Tu(e),a&512&&(Ql||r===null||yl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(Zl)e.stateNode=pp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[St]||r[ht]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),rp(r,t,n),r[ht]=e,kt(r),t=r;break a;case`link`:if(o=Km(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),rp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Km(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),rp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[ht]=e,kt(r),t=r}e.stateNode=t}}else Zl||qm(o,e.type,e.stateNode)}else e.stateNode=Vm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&El(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||Ql||t.parentNode.removeChild(t)):a.count--,n===null?Zl||qm(o,e.type,e.stateNode):Vm(o,n,e.memoizedProps))}break;case 27:Su(t,e,n),Tu(e),a&512&&(Ql||r===null||yl(r,r.return)),r!==null&&a&4&&El(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=$l,$l=!1,Su(t,e,n),$l=o,Tu(e),a&512&&(Ql||r===null||yl(r,r.return)),e.flags&32){t=e.stateNode;try{rn(t,``),zt=!0}catch(t){ff(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,El(e,t,r===null?t:r.memoizedProps)),a&1024&&(eu=!0);break;case 6:if(Su(t,e,n),Tu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,zt=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(zt=!1,Gm=null,o=Cu,Cu=xm(t.containerInfo),Su(t,e,n),Cu=o,Tu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Uh(t.containerInfo)}catch(t){ff(e,e.return,t)}eu&&(eu=!1,Eu(e)),zt=!1;break;case 4:a=$l,$l=Zl,r=Bt(),o=Cu,Cu=xm(e.stateNode.containerInfo),Su(t,e,n),Tu(e),Cu=o,zt&&iu&&(au=!0),zt=r,$l=a;break;case 12:Su(t,e,n),Tu(e);break;case 31:Su(t,e,n),Tu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 13:Su(t,e,n),Tu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=je()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Zl,l=Ql,u=$l;Zl=c||o,$l=u||o,Ql=l||s,Su(t,e,n),Ql=l,$l=u,Zl=c,Tu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Zl||Ql||(t=s||Ql,n=Zl,r=Ql,Zl=o||Zl,Ql=t,Au(e,2),Zl=n,Ql=r),!o&&$l||uu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,xu(e,n))));break;case 19:Su(t,e,n),Tu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 30:a&512&&(Ql||r===null||yl(r,r.return)),a=Bt(),o=iu,s=(n&335544064)===n,c=e.memoizedProps,iu=s&&ci(c.default,c.update)!==`none`,Su(t,e,n),Tu(e),s&&r!==null&&zt&&(e.flags|=4),iu=o,zt=a;break;case 21:break;case 7:a&512&&(Ql||r===null||yl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Su(t,e,n),Tu(e)}}function Tu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Dl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(wl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Cl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Al(e,Ol(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(rn(l,``),n.flags&=-33),Al(e,Ol(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;kl(e,Ol(e),u,s);break;default:throw Error(i(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Eu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Eu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,_h=!0,t.reset(),_h=!1),e=e.sibling}}function Du(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ou(t,e),t=t.sibling;else Xl(t,!1)}function Ou(e,t){var n=e.alternate;if(n===null)Hl(e,!1);else switch(e.tag){case 3:if(ou=ru=!1,Il(),Du(t,e),!ru&&!au){if(e=Fl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Dp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),ou=!0}Fl=null;break;case 5:Du(t,e);break;case 4:r=ru,ru=!1,Du(t,e),ru&&(au=!0),ru=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Du(t,e):Hl(e,!1));break;case 30:r=ru,i=Il(),ru=!1,Du(t,e),ru&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=oi(a,o),o=oi(n.memoizedProps,o);var s=ci(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Ll=0,t=Yl(e,n,t,o,s,a,!0),Ll!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),Fl=i):i!==null&&(i.push.apply(i,Fl),Fl=i),ru=e.flags&32?!0:r;break;default:Du(t,e)}}function ku(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lu(e,t.alternate,t),t=t.sibling}function Au(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:hl(4,n,n.return),Au(n,r);break;case 1:yl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&_l(n,n.return,i),Au(n,r);break;case 27:r&2&&_m(n.stateNode,n.type,n.memoizedProps);case 5:yl(n,n.return),n.tag!==5&&n.tag!==27||Sl(n),Au(n,r);break;case 6:Sl(n);break;case 26:yl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||Ql||i.parentNode.removeChild(i),Au(n,r);break;case 22:n.memoizedState===null&&Au(n,r);break;case 30:yl(n,n.return),Au(n,r);break;case 7:yl(n,n.return);default:Au(n,r)}e=e.sibling}}function ju(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:ju(i,a,n),ml(4,a);break;case 1:if(ju(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)mo(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&gl(a),vl(a,a.return);break;case 27:n&2&&jl(a);case 5:a.tag!==5&&a.tag!==27||xl(a),ju(i,a,n),s&&r===null&&o&4&&Tl(a),vl(a,a.return);break;case 6:xl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Zl||qm(xm(c.ownerDocument),a.type,c),ju(i,a,n),s&&r===null&&o&4&&Tl(a),vl(a,a.return);break;case 12:ju(i,a,n);break;case 31:ju(i,a,n),s&&o&4&&vu(i,a);break;case 13:ju(i,a,n),s&&o&4&&yu(i,a);break;case 22:a.memoizedState===null&&ju(i,a,n),vl(a,a.return);break;case 30:ju(i,a,n),vl(a,a.return);break;case 7:vl(a,a.return);default:ju(i,a,n)}t=t.sibling}}function Mu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ca(n))}function Nu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ca(e))}function Pu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Fu(e,t,n,r),t=t.sibling;else i&&Jl(t)}function Fu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ql(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Pu(e,t,n,r),a&2048&&ml(9,t);break;case 1:Pu(e,t,n,r);break;case 3:Pu(e,t,n,r),i&&ou&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ca(a)));break;case 12:if(a&2048){Pu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){ff(t,t.return,e)}}else Pu(e,t,n,r);break;case 31:Pu(e,t,n,r);break;case 13:Pu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&ql(t),o._visibility&2?Pu(e,t,n,r):(o._visibility|=2,Iu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ql(s),o._visibility&2?Pu(e,t,n,r):Lu(e,t)),a&2048&&Mu(s,t);break;case 24:Pu(e,t,n,r),a&2048&&Nu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Bl(a.child,!0),Bl(t.child,!0))),Pu(e,t,n,r);break;default:Pu(e,t,n,r)}}function Iu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Iu(a,o,s,c,i),ml(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Iu(a,o,s,c,i)):u._visibility&2?Iu(a,o,s,c,i):Lu(a,o),i&&l&2048&&Mu(o.alternate,o);break;case 24:Iu(a,o,s,c,i),i&&l&2048&&Nu(o.alternate,o);break;default:Iu(a,o,s,c,i)}t=t.sibling}}function Lu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Lu(n,r),i&2048&&Mu(r.alternate,r);break;case 24:Lu(n,r),i&2048&&Nu(r.alternate,r);break;default:Lu(n,r)}t=t.sibling}}var Ru=8192;function zu(e,t,n){if(e.subtreeFlags&Ru)for(e=e.child;e!==null;)Bu(e,t,n),e=e.sibling}function Bu(e,t,n){switch(e.tag){case 26:zu(e,t,n),e.flags&Ru&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Qm(n,e)):$m(n,Cu,e.memoizedState,e.memoizedProps));break;case 5:zu(e,t,n),e.flags&Ru&&(e=e.stateNode,(t&335544128)===t&&Qm(n,e));break;case 3:case 4:var r=Cu;Cu=xm(e.stateNode.containerInfo),zu(e,t,n),Cu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ru,Ru=16777216,zu(e,t,n),Ru=r):zu(e,t,n));break;case 30:if((e.flags&Ru)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Nl===null&&(Nl=new Map),Nl.set(r,i)}zu(e,t,n);break;default:zu(e,t,n)}}function Vu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Hu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nu=r,Gu(r,e)}Vu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Uu(e),e=e.sibling}function Uu(e){switch(e.tag){case 0:case 11:case 15:Hu(e),e.flags&2048&&hl(9,e,e.return);break;case 3:Hu(e);break;case 12:Hu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wu(e)):Hu(e);break;default:Hu(e)}}function Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nu=r,Gu(r,e)}Vu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:hl(8,t,t.return),Wu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wu(t));break;default:Wu(t)}e=e.sibling}}function Gu(e,t){for(;nu!==null;){var n=nu;switch(n.tag){case 0:case 11:case 15:hl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nu=r;else a:for(n=e;nu!==null;){r=nu;var i=r.sibling,a=r.return;if(pu(r),r===n){nu=null;break a}if(i!==null){i.return=a,nu=i;break a}nu=a}}}var Ku={getCacheForType:function(e){var t=ha(xa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ha(xa).controller.signal}},qu=typeof WeakMap==`function`?WeakMap:Map,Ju=0,Yu=null,Xu=null,Q=0,Zu=0,Qu=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return Ju&2&&Q!==0?Q&-Q:W.T===null?ft():Nf()}function Ad(){if(sd===0){if(!(Q&536870912)||Ji){var e=Je;Je<<=1,!(Je&3932160)&&(Je=262144),sd=e}else sd=536870912}return e=xo.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Fp(oi(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Yu&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Id(e,Q,sd,!1)),at(e,n),Ju&2&&e===Yu||(e===Yu&&(!(Ju&2)&&(ad|=n),rd===4&&Id(e,Q,sd,!1)),Tf(e))}function Nd(e,t,n){if(Ju&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Qe(e,t),a=r?qd(e,t):Gd(e,t,!0),o=r;do{if(a===0){ed&&!r&&Id(e,t,0,!1);break}if(n=e.current.alternate,o&&!Fd(n))a=Gd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,s).flags|=256),s=Gd(c,s,!1),s!==2&&s!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=o,ad|=o,a=4;break a}o=ud,ud=a,o!==null&&(ud===null?ud=o:ud.push.apply(ud,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){zd(e,0),Id(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Id(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=fd+300-je(),10<a)){if(Id(r,t,sd,!$u),Ze(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=_p(Pd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,o,`Throttled`,-0,0),a);break a}Pd(r,n,ud,hd,dd,t,sd,ad,cd,$u,o,null,-0,0)}break}}while(1);Tf(e)}function Pd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fn},Nl=null,Bu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=rh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?fd-je():(a&4194048)===a?pd-je():0,m=th(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Id(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Fd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Mr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Id(e,t,n,r){t=$e(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ue(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&st(e,n,t)}function Ld(){return Ju&6?!0:(Ef(0,!1),!1)}function Rd(){if(Xu!==null){if(Zu===0)var e=Xu.return;else e=Xu,sa=oa=null,Xo(e),Ya=null,Xa=0,e=Xu;for(;e!==null;)pl(e.alternate,e),e=e.return;Xu=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,vp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Rd(),Yu=e,Xu=n=Ci(e.current,null),Q=t,Zu=0,Qu=null,$u=!1,ed=Qe(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=$e(e,t),pi(),n}function Bd(e,t){No=null,W.H=oc,t===za||t===Va?(t=qa(),Zu=3):t===Ba?(t=qa(),Zu=4):Zu=t===wc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Qu=t,Xu===null&&(rd=1,vc(e,ji(t,e.current)))}function Vd(){var e=xo.current;return e===null?!0:(Q&4194048)===Q?So===null:(Q&62914560)===Q||Q&536870912?e===So:!1}function Hd(){var e=W.H;return W.H=oc,e===null?oc:e}function Ud(){var e=W.A;return W.A=Ku,e}function Wd(){rd=4,$u||(Q&4194048)!==Q&&xo.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Yu===null||Id(Yu,Q,sd,!1)}function Gd(e,t,n){var r=Ju;Ju|=2;var i=Hd(),a=Ud();(Yu!==e||Q!==t)&&(hd=null,zd(e,t)),t=!1;var o=rd;a:do try{if(Zu!==0&&Xu!==null){var s=Xu,c=Qu;switch(Zu){case 8:Rd(),o=6;break a;case 3:case 2:case 9:case 6:xo.current===null&&(t=!0);var l=Zu;if(Zu=0,Qu=null,Zd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Zu,Zu=0,Qu=null,Zd(e,s,c,l)}}Kd(),o=rd;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,sa=oa=null,Ju=r,W.H=i,W.A=a,Xu===null&&(Yu=null,Q=0,pi()),o}function Kd(){for(;Xu!==null;)Yd(Xu)}function qd(e,t){var n=Ju;Ju|=2;var r=Hd(),a=Ud();Yu!==e||Q!==t?(hd=null,md=je()+500,zd(e,t)):ed=Qe(e,t);a:do try{if(Zu!==0&&Xu!==null){t=Xu;var o=Qu;b:switch(Zu){case 1:Zu=0,Qu=null,Zd(e,t,o,1);break;case 2:case 9:if(Ua(o)){Zu=0,Qu=null,Xd(t);break}t=function(){Zu!==2&&Zu!==9||Yu!==e||(Zu=7),Tf(e)},o.then(t,t);break a;case 3:Zu=7;break a;case 4:Zu=5;break a;case 7:Ua(o)?(Zu=0,Qu=null,Xd(t)):(Zu=0,Qu=null,Zd(e,t,o,7));break;case 5:var s=null;switch(Xu.tag){case 26:s=Xu.memoizedState;case 5:case 27:var c=Xu;if(s?Xm(s):c.stateNode.complete){Zu=0,Qu=null;var l=c.sibling;if(l!==null)Xu=l;else{var u=c.return;u===null?Xu=null:(Xu=u,Qd(u))}break b}}Zu=0,Qu=null,Zd(e,t,o,5);break;case 6:Zu=0,Qu=null,Zd(e,t,o,6);break;case 8:Rd(),rd=6;break a;default:throw Error(i(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return sa=oa=null,W.H=r,W.A=a,Ju=n,Xu===null?(Yu=null,Q=0,pi(),rd):0}function Jd(){for(;Xu!==null&&!ke();)Yd(Xu)}function Yd(e){var t=il(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Qd(e):Xu=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Rc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=Rc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:Xo(t);var r=t;r===Ki&&(Ji?(ea(r),r.tag===5&&r.stateNode!=null&&(qi=r.stateNode)):(ea(r),Ji=!0));default:pl(n,t),t=Xu=wi(t,nd),t=il(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Qd(e):Xu=t}function Zd(e,t,n,r){sa=oa=null,Xo(t),Ya=null,Xa=0;var i=t.return;try{if(Cc(e,i,t,n,Q)){rd=1,vc(e,ji(n,e.current)),Xu=null;return}}catch(t){if(i!==null)throw Xu=i,t;rd=1,vc(e,ji(n,e.current)),Xu=null;return}t.flags&32768?(Ji||r===1?e=!0:ed||Q&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=xo.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,$u);return}e=t.return;var n=dl(t.alternate,t,nd);if(n!==null){Xu=n;return}if(t=t.sibling,t!==null){Xu=t;return}Xu=t=e}while(t!==null);rd===0&&(rd=5)}function $d(e,t){do{var n=fl(e.alternate,e);if(n!==null){n.flags&=32767,Xu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Xu=e;return}Xu=e=n}while(e!==null);rd=6,Xu=null}function ef(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(_d!==0);if(Ju&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Yu&&(Xu=Yu=null,Q=0),yd=t,vd=e,bd=n,Sd=a,Cd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=fi,ot(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=Ea(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(Fe,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Ml=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=W.T,W.T=null,i=G.p,G.p=2,a=Ju,Ju|=4;try{su(e,t,n)}finally{Ju=a,G.p=i,W.T=r}}_d=1,Ml?wd=Np(o,e.containerInfo,Ed,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function rf(){_d===3&&(_d=0,Ou(yd,vd),_d=4)}function af(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=W.T,W.T=null;var i=G.p;G.p=2;var a=Ju;Ju|=4;try{iu=au=!1,wu(t,e,n),n=lp;var o=Rr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Lr(s.ownerDocument.documentElement,s)){if(c!==null&&zr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Ir(s,h),v=Ir(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}_h=!!cp,lp=cp=null}finally{Ju=a,G.p=i,W.T=r}}e.current=t,_d=2}}function of(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=W.T,W.T=null;var r=G.p;G.p=2;var i=Ju;Ju|=4;try{lu(e,t.alternate,t)}finally{Ju=i,G.p=r,W.T=n}}_d=3}}function sf(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,Ae();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),dt(r),n=n.stateNode,Ve&&typeof Ve.onCommitFiberRoot==`function`)try{Ve.onCommitFiberRoot(Be,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=W.T,a=G.p,G.p=2,W.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{W.T=n,G.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);bd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ca(t)))}function lf(){return wd!==null&&(wd.skipTransition(),wd=null),af(),of(),sf(),uf()}function uf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=dt(bd),r=W.T,a=G.p;try{G.p=32>n?32:n,W.T=null,n=Sd,Sd=null;var o=vd,s=bd;if(_d=0,yd=vd=null,bd=0,Ju&6)throw Error(i(331));var c=Ju;if(Ju|=4,Uu(o.current),Fu(o,o.current,s,n),Ju=c,Ef(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{G.p=a,W.T=r,cf(e,t)}}function df(e,t,n){t=ji(n,t),t=bc(e.stateNode,t,2),e=so(e,t,2),e!==null&&(at(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=ji(n,e),n=xc(2),r=so(t,n,2),r!==null&&(Sc(n,r,t,e),at(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new qu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(td=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Yu===e&&(Q&n)===n&&(rd===4||rd===3&&(Q&62914560)===Q&&300>je()-fd?Ju&2?od|=n:zd(e,0):od|=n,cd===Q&&(cd=0)),Tf(e)}function hf(e,t){t===0&&(t=tt()),e=gi(e,t),e!==null&&(at(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),hf(e,n)}function vf(e,t){return De(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Q,a=Ze(r,r===Yu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Qe(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&gp()&&(e=wf);for(var t=je(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}_d!==0&&_d!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ue(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Yu,n=Q,n=Ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Oe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Oe(r),dt(n)){case 2:case 8:n=Pe;break;case 32:n=Fe;break;case 268435456:n=Le;break;default:n=Fe}return r=Af.bind(null,e),n=De(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Oe(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Q;return r=Ze(e,e===Yu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nd(e,r,t),kf(e,je()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Nd(e,t,!0)}function Mf(){xp(function(){Ju&6?De(Ne,Df):Of()})}function Nf(){if(wf===0){var e=ka;e===0&&(e=qe,qe<<=1,!(qe&261888)&&(qe=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:dn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[gt]||null).action),o=r.submitter;o&&(t=(t=o[gt]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Nn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);Ks(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Ks(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<ri.length;If++){var Lf=ri[If];ii(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}ii(Yr,`onAnimationEnd`),ii(Xr,`onAnimationIteration`),ii(Zr,`onAnimationStart`),ii(`dblclick`,`onDoubleClick`),ii(`focusin`,`onFocus`),ii(`focusout`,`onBlur`),ii(Qr,`onTransitionRun`),ii($r,`onTransitionStart`),ii(ei,`onTransitionCancel`),ii(ti,`onTransitionEnd`),Pt(`onMouseEnter`,[`mouseout`,`mouseover`]),Pt(`onMouseLeave`,[`mouseout`,`mouseover`]),Pt(`onPointerEnter`,[`pointerout`,`pointerover`]),Pt(`onPointerLeave`,[`pointerout`,`pointerover`]),Nt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Nt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Nt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Nt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){li(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){li(e)}i.currentTarget=null,a=c}}}}function Vf(e,t){var n=t[vt];n===void 0&&(n=t[vt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,jt.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(wh(t)){case 2:var i=vh;break;case 8:i=yh;break;default:i=bh}n=i.bind(null,t,n,e),i=void 0,!Sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Kf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Tt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}yn(function(){var r=a,i=mn(n),s=[];a:{var c=ni.get(e);if(c!==void 0){var l=Nn,u=e;switch(e){case`keypress`:if(On(n)===0)break a;case`keydown`:case`keyup`:l=q;break;case`focusin`:u=`focus`,l=Hn;break;case`focusout`:u=`blur`,l=Hn;break;case`beforeblur`:case`afterblur`:l=Hn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Bn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Vn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Qn;break;case Yr:case Xr:case Zr:l=K;break;case ti:l=$n;break;case`scroll`:case`scrollend`:l=Fn;break;case`wheel`:l=er;break;case`copy`:case`cut`:case`paste`:l=Un;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Xn;break;case`submit`:l=Zn;break;case`toggle`:case`beforetoggle`:l=tr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=bn(m,p),g!=null&&d.push(qf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==pn&&(u=n.relatedTarget||n.fromElement)&&(Tt(u)||u[_t]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Tt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Bn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Xn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Dt(c),h=l==null?u:Dt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Tt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,Yf):null,c!==null&&Xf(s,u,c,d,!1),l!==null&&f!==null&&Xf(s,f,l,d,!0)))}a:{if(c=r?Dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=br;else if(mr(c)){if(xr)_=Ar;else{_=Or;var v=Dr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&cn(r.elementType)&&(_=br):_=kr;if(_&&=_(e,r)){hr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Dt(r):window,e){case`focusin`:(mr(v)||v.contentEditable===`true`)&&(Vr=v,Hr=r,Ur=null);break;case`focusout`:Ur=Hr=Vr=null;break;case`mousedown`:Y=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Y=!1,Wr(s,n,i);break;case`selectionchange`:if(Br)break;case`keydown`:case`keyup`:Wr(s,n,i)}var y;if(rr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else dr?lr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(or&&n.locale!==`ko`&&(dr||b!==`onCompositionStart`?b===`onCompositionEnd`&&dr&&(y=Dn()):(wn=i,Tn=`value`in wn?wn.value:wn.textContent,dr=!0)),v=Jf(r,b),0<v.length&&(b=new Wn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=ur(n),y!==null&&(b.data=y)))),(y=ar?fr(e,n):pr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new Wn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Ff(s,e,r,n,i)}Bf(s,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=bn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=bn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=bn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=bn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
9
- `).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function tp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&rn(e,``+r);else return;break;case`className`:Ht(e,`class`,r);break;case`tabIndex`:Ht(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ht(e,n,r);break;case`style`:sn(e,r,o);return;case`data`:if(t!==`object`){Ht(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&tp(e,t,`name`,a.name,a,null),tp(e,t,`formEncType`,a.formEncType,a,null),tp(e,t,`formMethod`,a.formMethod,a,null),tp(e,t,`formTarget`,a.formTarget,a,null)):(tp(e,t,`encType`,a.encType,a,null),tp(e,t,`method`,a.method,a,null),tp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=fn);return;case`onScroll`:r!=null&&Vf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Vf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=dn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Vf(`beforetoggle`,e),Vf(`toggle`,e),Vt(e,`popover`,r);break;case`xlinkActuate`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Vt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=ln.get(n)||n,Vt(e,n,r);else return}zt=!0}function np(e,t,n,r,a,o){switch(n){case`style`:sn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)rn(e,``+r);else return;break;case`onScroll`:r!=null&&Vf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Vf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=fn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[gt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}zt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Vt(e,n,r)}return}zt=!0}function rp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Vf(`error`,e),Vf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:tp(e,t,o,s,n,null)}}a&&tp(e,t,`srcSet`,n.srcSet,n,null),r&&tp(e,t,`src`,n.src,n,null);return;case`input`:Vf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:tp(e,t,r,d,n,null)}}Qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Vf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:tp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&en(e,!!r,n,!0):en(e,!!r,t,!1);return;case`textarea`:for(s in Vf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:tp(e,t,s,c,n,null)}nn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:tp(e,t,l,r,n,null)}return;case`dialog`:Vf(`beforetoggle`,e),Vf(`toggle`,e),Vf(`cancel`,e),Vf(`close`,e);break;case`iframe`:case`object`:Vf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)Vf(Rf[r],e);break;case`image`:Vf(`error`,e),Vf(`load`,e);break;case`details`:Vf(`toggle`,e);break;case`embed`:case`source`:case`link`:Vf(`error`,e),Vf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:tp(e,t,u,r,n,null)}return;default:if(cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&np(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&tp(e,t,c,r,n,null))}var ip={};function ap(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||tp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(zt=!0),o=m;break;case`name`:m!==f&&(zt=!0),a=m;break;case`checked`:m!==f&&(zt=!0),u=m;break;case`defaultChecked`:m!==f&&(zt=!0),d=m;break;case`value`:m!==f&&(zt=!0),s=m;break;case`defaultValue`:m!==f&&(zt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&tp(e,t,p,m,r,f)}}Zt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||tp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(zt=!0),p=o;break;case`defaultValue`:o!==l&&(zt=!0),c=o;break;case`multiple`:o!==l&&(zt=!0),s=o;default:o!==l&&tp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?en(e,!!n,n?[]:``,!1):en(e,!!n,t,!0)):en(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:tp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(zt=!0),p=a;break;case`defaultValue`:a!==o&&(zt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&tp(e,t,s,a,r,o)}tn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:tp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(zt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:tp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&tp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:tp(e,t,u,p,r,m)}return;default:if(cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&np(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||np(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&tp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||tp(e,t,f,p,r,m)}function op(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function sp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&op(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&op(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var cp=null,lp=null;function up(e){return e.nodeType===9?e:e.ownerDocument}function dp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function fp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function pp(e,t,n,r){return n=up(n).createElement(e),n[ht]=r,n[gt]=t,rp(n,e,t),kt(n),n}function mp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var hp=null;function gp(){var e=window.event;return e&&e.type===`popstate`?e!==hp&&(hp=e,!0):(hp=null,!1)}var _p=typeof setTimeout==`function`?setTimeout:void 0,vp=typeof clearTimeout==`function`?clearTimeout:void 0,yp=typeof Promise==`function`?Promise:void 0,bp=typeof requestAnimationFrame==`function`?requestAnimationFrame:_p,xp=typeof queueMicrotask==`function`?queueMicrotask:yp===void 0?_p:function(e){return yp.resolve(null).then(e).catch(Sp)};function Sp(e){setTimeout(function(){throw e})}function Cp(e){return e===`head`}function wp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Uh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[St]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Uh(t)}function Tp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Ep(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Dp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Op(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function kp(e){return Op(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ap(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Op(t,n,e)}function jp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Np(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(jp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Zm(f),u>eh){s.length=o;break}f=new Promise(Mp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Pp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Pp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Pp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fp(e){return{name:e,group:new Pp(`group`,e),imagePair:new Pp(`image-pair`,e),old:new Pp(`old`,e),new:new Pp(`new`,e)}}function Ip(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ip.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Vp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=zp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Lp,e,s,r)}this._eventListeners=a}};function Lp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Ip.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Vp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=zp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Rp,e,n,i),r.splice(t,1),a!==null&&a()}};function Rp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function zp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Bp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Vp(e,t,n,r){if(e.length===0)return-1;r=Bp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Bp(a.optionsOrUseCapture)===r)return i}return-1}Ip.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,zp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,zp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Ip.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag!==6&&(e=v(e),mm(e,t))}Ip.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Up,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Hp(t[n],e);n--);};function Up(e,t){return t.push(e),!1}Ip.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=up(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0))};function Wp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ip.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Ip.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Kp,e,void 0,void 0);for(var n=t=0;n<qp.length;n++){var r=qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):qp[t++]=r}qp.length=t}};function Kp(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var qp=[],Jp=!1;function Yp(e,t,n){qp.push({fragmentInstance:e,observer:t,instance:n}),Jp||(Jp=!0,hm(function(){Jp=!1;var e=qp;qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Ip.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Xp,e,void 0,void 0),e};function Xp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Ip.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Ip.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Up,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Zp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zp(e,t,n,r,i){var a=Tt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Qp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Ip.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,Up,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),Qp(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),Qp(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=v(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<qp.length;i++){var a=qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(qp[r++]=a)}qp.length=r,n.observe(e)}),em(e,t))}function nm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Yp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:rm(n),wt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[St])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function um(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function mm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function hm(e){bp(function(){bp(function(t){return e(t)})})}function gm(e,t,n){switch(t=up(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&tp(e,t,r,null,ip,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===fn&&(e.onclick=null),wt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wt(e)}var ym=new Map,bm=new Set;function xm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Sm=G.d;G.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=Ld();return e||t}function wm(e){var t=Et(e);t!==null&&t.tag===5&&t.type===`form`?Js(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=Xt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),rp(t,`link`,e),kt(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Xt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Xt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Xt(n.imageSizes)+`"]`)):i+=`[href="`+Xt(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);rp(o,`link`,e),t===`style`&&(o[Ct]=!0,o.onload=o.onerror=function(){At(o)}),kt(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Xt(r)+`"][href="`+Xt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zm(e)}if(!ym.has(a)&&(e=T({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),rp(r,`link`,e),kt(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=Ot(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);kt(c),rp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=Ot(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=T({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),kt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=Ot(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),kt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var a=(a=pe.current)?xm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Fm(n.href),t=Ot(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Fm(n.href);var o=Ot(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ym.set(e,o)),Rm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=zm(n),t=Ot(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Fm(e){return`href="`+Xt(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ct]){r.loading=1;return}}else t=e.createElement(`link`),t[Ct]=!0,t.onload=t.onerror=At.bind(null,t),rp(t,`link`,n),kt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function zm(e){return`[src="`+Xt(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Xt(n.href)+`"]`);if(r)return t.instance=r,kt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),kt(r),rp(r,`style`,a),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Fm(n.href);var o=e.querySelector(Im(a));if(o)return t.state.loading|=4,t.instance=o,kt(o),o;r=Lm(n),(a=ym.get(a))&&Um(r,a),o=(e.ownerDocument||e).createElement(`link`),kt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),rp(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(a=e.querySelector(Bm(o)))?(t.instance=a,kt(a),a):(r=n,(a=ym.get(o))&&(r=T({},n),Wm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),kt(a),rp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Hm(r,n.precedence,e));return t.instance}function Hm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[St]||a[ht]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,kt(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),kt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),rp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*sp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=rh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ch={$$typeof:N,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function lh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rt(0),this.hiddenUpdates=rt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=xi(3,null,null,t),e.current=a,a.stateNode=e,t=Sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},io(a),e}function dh(e){return e?(e=yi,e):yi}function fh(e,t,n,r,i,a){i=dh(i),r.context===null?r.context=i:r.pendingContext=i,r=oo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=so(e,r,t),n!==null&&(Md(n,e,t),co(n,e,t))}function ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mh(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function hh(e){if(e.tag===13||e.tag===31){var t=gi(e,67108864);t!==null&&Md(t,e,67108864),mh(e,67108864)}}function gh(e){if(e.tag===13||e.tag===31){var t=kd();t=ut(t);var n=gi(e,t);n!==null&&Md(n,e,t),mh(e,t)}}var _h=!0;function vh(e,t,n,r){var i=W.T;W.T=null;var a=G.p;try{G.p=2,bh(e,t,n,r)}finally{G.p=a,W.T=i}}function yh(e,t,n,r){var i=W.T;W.T=null;var a=G.p;try{G.p=8,bh(e,t,n,r)}finally{G.p=a,W.T=i}}function bh(e,t,n,r){if(_h){var i=xh(r);if(i===null)Kf(e,t,r,Sh,n),Nh(e,r);else if(Fh(i,e,t,n,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<Mh.indexOf(e)){for(;i!==null;){var a=Et(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Xe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ue(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(Ju&6)&&(md=je()+500,Ef(0,!1))}}break;case 31:case 13:s=gi(a,2),s!==null&&Md(s,a,2),Ld(),mh(a,2)}if(a=xh(r),a===null&&Kf(e,t,r,Sh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function xh(e){return e=mn(e),Ch(e)}var Sh=null;function Ch(e){if(Sh=null,e=Tt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Sh=e,null}function wh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Me()){case Ne:return 2;case Pe:return 8;case Fe:case Ie:return 32;case Le:return 268435456;default:return 32}default:return 32}}var Th=!1,Eh=null,Dh=null,Oh=null,kh=new Map,Ah=new Map,jh=[],Mh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Nh(e,t){switch(e){case`focusin`:case`focusout`:Eh=null;break;case`dragenter`:case`dragleave`:Dh=null;break;case`mouseover`:case`mouseout`:Oh=null;break;case`pointerover`:case`pointerout`:kh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ah.delete(t.pointerId)}}function Ph(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Et(t),t!==null&&hh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fh(e,t,n,r,i){switch(t){case`focusin`:return Eh=Ph(Eh,e,t,n,r,i),!0;case`dragenter`:return Dh=Ph(Dh,e,t,n,r,i),!0;case`mouseover`:return Oh=Ph(Oh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kh.set(a,Ph(kh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ah.set(a,Ph(Ah.get(a)||null,e,t,n,r,i)),!0}return!1}function Ih(e){var t=Tt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,pt(e.priority,function(){gh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,pt(e.priority,function(){gh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pn=r,n.target.dispatchEvent(r),pn=null}else return t=Et(n),t!==null&&hh(t),e.blockedOn=n,!1;t.shift()}return!0}function Rh(e,t,n){Lh(e)&&n.delete(t)}function zh(){Th=!1,Eh!==null&&Lh(Eh)&&(Eh=null),Dh!==null&&Lh(Dh)&&(Dh=null),Oh!==null&&Lh(Oh)&&(Oh=null),kh.forEach(Rh),Ah.forEach(Rh)}function Bh(e,n){e.blockedOn===n&&(e.blockedOn=null,Th||(Th=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zh)))}var Vh=null;function Hh(e){Vh!==e&&(Vh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vh===e&&(Vh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Ch(r||n)===null)continue;break}var a=Et(n);a!==null&&(e.splice(t,3),t-=3,Ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Uh(e){function t(t){return Bh(t,e)}Eh!==null&&Bh(Eh,e),Dh!==null&&Bh(Dh,e),Oh!==null&&Bh(Oh,e),kh.forEach(t),Ah.forEach(t);for(var n=0;n<jh.length;n++){var r=jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jh.length&&(n=jh[0],n.blockedOn===null);)Ih(n),n.blockedOn===null&&jh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[gt]||null;if(typeof a==`function`)o||Hh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[gt]||null)s=o.formAction;else if(Ch(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hh(n)}}}function Wh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Gh(e){this._internalRoot=e}Kh.prototype.render=Gh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fh(n,kd(),e,t,null,null)},Kh.prototype.unmount=Gh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fh(e.current,2,null,e,null,null),Ld(),t[_t]=null}};function Kh(e){this._internalRoot=e}Kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ft();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jh.length&&t!==0&&t<jh[n].priority;n++);jh.splice(n,0,e),n===0&&Ih(e)}};var qh=n.version;if(qh!==`19.3.1`)throw Error(i(527,qh,`19.3.1`));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Jh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:W,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{Be=Yh.inject(Jh),Ve=Yh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=hc,s=gc,c=_c;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=uh(e,1,!1,null,null,n,r,null,o,s,c,Wh),e[_t]=t.current,Wf(e),new Gh(t)}})),ot=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=at()}))(),st=(0,p.createContext)({theme:`dark`,setTheme:()=>{},toggle:()=>{}});function ct(e){try{let t=window.localStorage.getItem(e);return t===`light`||t===`dark`?t:void 0}catch{return}}function lt(e,t){return typeof window>`u`?t:ct(e)??t}function ut(e){if(typeof document>`u`)return;let t=document.documentElement;t.classList.toggle(`light`,e===`light`),t.classList.toggle(`dark`,e===`dark`),t.dataset.theme=e}function dt({children:e,storageKey:t,accent:n,defaultTheme:r=`dark`}){let[i,a]=(0,p.useState)(()=>lt(t,r));(0,p.useEffect)(()=>{ut(i)},[i]),(0,p.useEffect)(()=>{n&&typeof document<`u`&&document.documentElement.style.setProperty(`--agora-accent`,n)},[n]);let o=(0,p.useCallback)(e=>{if(typeof document<`u`){let e=document.documentElement;e.classList.add(`agora-theme-switching`),window.setTimeout(()=>e.classList.remove(`agora-theme-switching`),260)}a(e);try{window.localStorage.setItem(t,e)}catch{}},[t]),s=(0,p.useCallback)(()=>o(i===`dark`?`light`:`dark`),[i,o]);return(0,m.jsx)(st.Provider,{value:{theme:i,setTheme:o,toggle:s},children:e})}function ft(){return(0,p.useContext)(st)}function pt(e,t){return function({size:n=16,...r}){return(0,m.jsx)(`svg`,{viewBox:`0 0 16 16`,width:n,height:n,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!t||void 0,role:t?`img`:void 0,"aria-label":t,...r,children:e})}}var mt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.5`}),(0,m.jsx)(`path`,{d:`M10.5 10.5 14 14`})]})),ht=pt((0,m.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`})),gt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`1.5`,y:`2.5`,width:`13`,height:`11`,rx:`2`}),(0,m.jsx)(`path`,{d:`M6 2.5v11`})]})),_t=pt((0,m.jsx)(`path`,{d:`M4 6l4 4 4-4`})),vt=pt((0,m.jsx)(`path`,{d:`M10 4 6 8l4 4`})),yt=pt((0,m.jsx)(`path`,{d:`M3.5 8.5l3 3 6-7`})),bt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`3`}),(0,m.jsx)(`path`,{d:`M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3.05 3.05l1.06 1.06M11.89 11.89l1.06 1.06M3.05 12.95l1.06-1.06M11.89 4.11l1.06-1.06`})]})),xt=pt((0,m.jsx)(`path`,{d:`M13.5 9A6 6 0 116.5 2.5a4.5 4.5 0 007 6.5z`})),St=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M10 11l4-3.5L10 4`}),(0,m.jsx)(`path`,{d:`M14 7.5H5`}),(0,m.jsx)(`path`,{d:`M6 3H3a1 1 0 00-1 1v7a1 1 0 001 1h3`})]})),Ct=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M8 2 1.5 13.5h13z`}),(0,m.jsx)(`path`,{d:`M8 6.5v3M8 11.5h.01`})]})),wt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M13.5 8a5.5 5.5 0 1 1-1.6-3.9`}),(0,m.jsx)(`path`,{d:`M13.5 2.5v3h-3`})]})),Tt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M2 9.5 4 3h8l2 6.5V13H2z`}),(0,m.jsx)(`path`,{d:`M2 9.5h3.5l1 1.5h3l1-1.5H14`})]})),Et=pt((0,m.jsx)(`path`,{d:`M2 3h12l-4.5 5.5V13l-3-1.5v-3z`}));m.Fragment;var Dt=pt((0,m.jsx)(`path`,{d:`M1.5 8h3l2-5 3 10 2-5h3`})),Ot=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`2`,y:`2`,width:`12`,height:`5`,rx:`1.2`}),(0,m.jsx)(`rect`,{x:`2`,y:`9`,width:`12`,height:`5`,rx:`1.2`}),(0,m.jsx)(`path`,{d:`M4.5 4.5h.01M4.5 11.5h.01`})]})),kt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`}),(0,m.jsx)(`path`,{d:`M8 4.5V8l2.5 1.5`})]})),At=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`1.5`,y:`2`,width:`4.5`,height:`4.5`,rx:`1.2`}),(0,m.jsx)(`rect`,{x:`10`,y:`9.5`,width:`4.5`,height:`4.5`,rx:`1.2`}),(0,m.jsx)(`path`,{d:`M6 4.25h3a1.5 1.5 0 0 1 1.5 1.5V9.5`})]}));m.Fragment,m.Fragment;var jt={workflow:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1.5`}),(0,m.jsx)(`rect`,{x:`15`,y:`14`,width:`6`,height:`6`,rx:`1.5`}),(0,m.jsx)(`path`,{d:`M9 7h4a2 2 0 0 1 2 2v5`})]}),telescope:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`m4 14 13-6 2 4-13 6z`}),(0,m.jsx)(`path`,{d:`m10 16 2 5M14 15l-2 6M17 8l1-3 3 1-1 3`})]}),media:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,m.jsx)(`circle`,{cx:`9`,cy:`10`,r:`2`}),(0,m.jsx)(`path`,{d:`m21 16-5-5-9 9`})]}),payments:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`2.5`,y:`5`,width:`19`,height:`14`,rx:`2`}),(0,m.jsx)(`path`,{d:`M2.5 10h19M6.5 15h4`})]}),agent:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`5`,y:`8`,width:`14`,height:`11`,rx:`3`}),(0,m.jsx)(`path`,{d:`M12 8V4M9 13h.01M15 13h.01M9.5 16.5h5`}),(0,m.jsx)(`circle`,{cx:`12`,cy:`3.5`,r:`0.5`})]}),identity:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 3 4.5 6v5.5c0 4.5 3.2 8.2 7.5 9.5 4.3-1.3 7.5-5 7.5-9.5V6z`}),(0,m.jsx)(`circle`,{cx:`12`,cy:`10`,r:`2.5`}),(0,m.jsx)(`path`,{d:`M8 16a4.5 4.5 0 0 1 8 0`})]}),flags:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M5 21V4`}),(0,m.jsx)(`path`,{d:`M5 4h11l-2 4 2 4H5`})]}),generic:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`3`,y:`3`,width:`7`,height:`7`,rx:`1.5`}),(0,m.jsx)(`rect`,{x:`14`,y:`3`,width:`7`,height:`7`,rx:`1.5`}),(0,m.jsx)(`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1.5`}),(0,m.jsx)(`rect`,{x:`14`,y:`14`,width:`7`,height:`7`,rx:`1.5`})]})},Mt=Object.keys(jt);function Nt(e){return Mt.includes(e)?e:`generic`}function Pt({icon:e,className:t,size:n=16}){return(0,m.jsx)(`svg`,{viewBox:`0 0 24 24`,width:n,height:n,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,"aria-hidden":`true`,"data-icon":e,children:jt[e]??jt.generic})}var Ft={authkit:`#625fff`,durable:`#a3e635`,telescope:`#e879f9`,payments:`#22d3ee`,media:`#fbbf24`,agent:`#fb7185`,flags:`#34d399`},It={identity:`#625fff`,workflow:`#a3e635`,telescope:`#e879f9`,payments:`#22d3ee`,media:`#fbbf24`,agent:`#fb7185`,flags:`#34d399`};function Lt(e,t){return(e?Ft[e]:void 0)??It[t]}function Rt({icon:e,accent:t,size:n=26,className:r}){return(0,m.jsx)(`span`,{className:`agora-tile${r?` ${r}`:``}`,style:{width:n,height:n,...t?{"--agora-tile":t}:{}},"data-accent":t,children:(0,m.jsx)(Pt,{icon:e,size:Math.round(n*.58)})})}function zt(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=zt(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Bt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=zt(e))&&(r&&(r+=` `),r+=t);return r}var Vt=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ht=(e,t)=>({classGroupId:e,validator:t}),Ut=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Wt=`-`,Gt=[],Kt=`arbitrary..`,qt=e=>{let t=Xt(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Yt(e);let n=e.split(Wt);return Jt(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Vt(i,t):t:i||Gt}return n[e]||Gt}}},Jt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Jt(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Wt):e.slice(t).join(Wt),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Yt=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Kt+r:void 0})(),Xt=e=>{let{theme:t,classGroups:n}=e;return Zt(n,t)},Zt=(e,t)=>{let n=Ut();for(let r in e){let i=e[r];Qt(i,n,r,t)}return n},Qt=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];$t(i,t,n,r)}},$t=(e,t,n,r)=>{typeof e==`string`?en(e,t,n):typeof e==`function`?tn(e,t,n,r):nn(e,t,n,r)},en=(e,t,n)=>{let r=e===``?t:rn(t,e);r.classGroupId=n},tn=(e,t,n,r)=>{an(e)?Qt(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(Ht(n,e)))},nn=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Qt(o,rn(t,a),n,r)}},rn=(e,t)=>{let n=e,r=t.split(Wt),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ut(),n.nextPart.set(t,i)),n=i}return n},an=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,on=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},sn=`!`,cn=`:`,ln=[],un=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),dn=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===cn){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(sn)?(c=s.slice(0,-1),l=!0):s.startsWith(sn)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return un(t,l,c,u)};if(t){let e=t+cn,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):un(ln,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},fn=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},pn=e=>({cache:on(e.cacheSize),parseClassName:dn(e),sortModifiers:fn(e),postfixLookupClassGroupIds:mn(e),...qt(e)}),mn=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},hn=/\s+/,gn=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(hn),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+sn:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},_n=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=vn(n))&&(i&&(i+=` `),i+=r);return i},vn=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=vn(e[r]))&&(n&&(n+=` `),n+=t);return n},yn=(e,...t)=>{let n,r,i,a,o=o=>(n=pn(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=gn(e,n);return i(e,a),a};return a=o,(...e)=>a(_n(...e))},bn=[],xn=e=>{let t=t=>t[e]||bn;return t.isThemeGetter=!0,t.themeKey=e,t},Sn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Cn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Tn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,En=/\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$/,Dn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,On=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,An=e=>wn.test(e),jn=e=>!!e&&!Number.isNaN(Number(e)),Mn=e=>!!e&&Number.isInteger(Number(e)),Nn=e=>e.endsWith(`%`)&&jn(e.slice(0,-1)),Pn=e=>Tn.test(e),Fn=()=>!0,In=e=>En.test(e)&&!Dn.test(e),Ln=()=>!1,Rn=e=>On.test(e),zn=e=>kn.test(e),Bn=e=>!K(e)&&!q(e),Vn=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)),Hn=e=>rr(e,sr,Ln),K=e=>Sn.test(e),Un=e=>rr(e,cr,In),Wn=e=>rr(e,lr,jn),Gn=e=>rr(e,dr,Fn),Kn=e=>rr(e,ur,Ln),qn=e=>rr(e,ar,Ln),Jn=e=>rr(e,or,zn),Yn=e=>rr(e,fr,Rn),q=e=>Cn.test(e),Xn=e=>ir(e,cr),Zn=e=>ir(e,ur),Qn=e=>ir(e,ar),$n=e=>ir(e,sr),er=e=>ir(e,or),tr=e=>ir(e,fr,!0),nr=e=>ir(e,dr,!0),rr=(e,t,n)=>{let r=Sn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ir=(e,t,n=!1)=>{let r=Cn.exec(e);return r?r[1]?t(r[1]):n:!1},ar=e=>e===`position`||e===`percentage`,or=e=>e===`image`||e===`url`,sr=e=>e===`length`||e===`size`||e===`bg-size`,cr=e=>e===`length`,lr=e=>e===`number`,ur=e=>e===`family-name`,dr=e=>e===`number`||e===`weight`,fr=e=>e===`shadow`,pr=yn(()=>{let e=xn(`color`),t=xn(`font`),n=xn(`text`),r=xn(`font-weight`),i=xn(`tracking`),a=xn(`leading`),o=xn(`breakpoint`),s=xn(`container`),c=xn(`spacing`),l=xn(`radius`),u=xn(`shadow`),d=xn(`inset-shadow`),f=xn(`text-shadow`),p=xn(`drop-shadow`),m=xn(`blur`),h=xn(`perspective`),g=xn(`aspect`),_=xn(`ease`),v=xn(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),q,K],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[q,K,c],T=()=>[An,`full`,`auto`,...w()],E=()=>[Mn,`none`,`subgrid`,q,K],D=()=>[`auto`,{span:[`full`,Mn,q,K]},Mn,q,K],O=()=>[Mn,`auto`,q,K],k=()=>[`auto`,`min`,`max`,`fr`,q,K],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[An,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,An,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[An,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,q,K],L=()=>[...b(),Qn,qn,{position:[q,K]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,$n,Hn,{size:[q,K]}],B=()=>[Nn,Xn,Un],ee=()=>[``,`none`,`full`,l,q,K],V=()=>[``,jn,Xn,Un],te=()=>[`solid`,`dashed`,`dotted`,`double`],ne=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],H=()=>[jn,Nn,Qn,qn],re=()=>[``,`none`,m,q,K],U=()=>[`none`,jn,q,K],ie=()=>[`none`,jn,q,K],W=()=>[jn,q,K],G=()=>[An,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Pn],breakpoint:[Pn],color:[Fn],container:[Pn],"drop-shadow":[Pn],ease:[`in`,`out`,`in-out`],font:[Bn],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Pn],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Pn],shadow:[Pn],spacing:[`px`,jn],text:[Pn],"text-shadow":[Pn],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,An,K,q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,q,K]}],"container-named":[Vn],columns:[{columns:[jn,`auto`,K,q,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Mn,`auto`,q,K]}],basis:[{basis:[An,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[jn,An,`auto`,`initial`,`none`,K]}],grow:[{grow:[``,jn,q,K]}],shrink:[{shrink:[``,jn,q,K]}],order:[{order:[Mn,`first`,`last`,`none`,q,K]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,Xn,Un]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,nr,Gn]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Nn,K]}],"font-family":[{font:[Zn,Kn,t]}],"font-features":[{"font-features":[K]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,q,K]}],"line-clamp":[{"line-clamp":[jn,`none`,q,Wn]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,q,K]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,q,K]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...te(),`wavy`]}],"text-decoration-thickness":[{decoration:[jn,`from-font`,`auto`,q,Un]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[jn,`auto`,q,K]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Mn,q,K]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,q,K]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,q,K]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Mn,q,K],radial:[``,q,K],conic:[``,Mn,q,K]},er,Jn]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...te(),`hidden`,`none`]}],"divide-style":[{divide:[...te(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...te(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[jn,q,K]}],"outline-w":[{outline:[``,jn,Xn,Un]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,tr,Yn]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,tr,Yn]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[jn,Un]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,tr,Yn]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[jn,q,K]}],"mix-blend":[{"mix-blend":[...ne(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ne()}],"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":[jn]}],"mask-image-linear-from-pos":[{"mask-linear-from":H()}],"mask-image-linear-to-pos":[{"mask-linear-to":H()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":H()}],"mask-image-t-to-pos":[{"mask-t-to":H()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":H()}],"mask-image-r-to-pos":[{"mask-r-to":H()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":H()}],"mask-image-b-to-pos":[{"mask-b-to":H()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":H()}],"mask-image-l-to-pos":[{"mask-l-to":H()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":H()}],"mask-image-x-to-pos":[{"mask-x-to":H()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":H()}],"mask-image-y-to-pos":[{"mask-y-to":H()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[q,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":H()}],"mask-image-radial-to-pos":[{"mask-radial-to":H()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[jn]}],"mask-image-conic-from-pos":[{"mask-conic-from":H()}],"mask-image-conic-to-pos":[{"mask-conic-to":H()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,q,K]}],filter:[{filter:[``,`none`,q,K]}],blur:[{blur:re()}],brightness:[{brightness:[jn,q,K]}],contrast:[{contrast:[jn,q,K]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,tr,Yn]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,jn,q,K]}],"hue-rotate":[{"hue-rotate":[jn,q,K]}],invert:[{invert:[``,jn,q,K]}],saturate:[{saturate:[jn,q,K]}],sepia:[{sepia:[``,jn,q,K]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,q,K]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[jn,q,K]}],"backdrop-contrast":[{"backdrop-contrast":[jn,q,K]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,jn,q,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[jn,q,K]}],"backdrop-invert":[{"backdrop-invert":[``,jn,q,K]}],"backdrop-opacity":[{"backdrop-opacity":[jn,q,K]}],"backdrop-saturate":[{"backdrop-saturate":[jn,q,K]}],"backdrop-sepia":[{"backdrop-sepia":[``,jn,q,K]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,q,K]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[jn,`initial`,q,K]}],ease:[{ease:[`linear`,`initial`,_,q,K]}],delay:[{delay:[jn,q,K]}],animate:[{animate:[`none`,v,q,K]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,q,K]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:W()}],"skew-x":[{"skew-x":W()}],"skew-y":[{"skew-y":W()}],transform:[{transform:[q,K,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":[`translate-none`],zoom:[{zoom:[Mn,q,K]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,q,K]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,q,K]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[jn,Xn,Un,Wn]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function J(...e){return pr(Bt(e))}function mr(){return typeof window<`u`}function hr(e){return vr(e)?(e.nodeName||``).toLowerCase():`#document`}function gr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _r(e){return((vr(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function vr(e){return mr()?e instanceof Node||e instanceof gr(e).Node:!1}function yr(e){return mr()?e instanceof Element||e instanceof gr(e).Element:!1}function br(e){return mr()?e instanceof HTMLElement||e instanceof gr(e).HTMLElement:!1}function xr(e){return!mr()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof gr(e).ShadowRoot}function Sr(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Nr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Cr(e){return/^(table|td|th)$/.test(hr(e))}function wr(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Tr=/transform|translate|scale|rotate|perspective|filter/,Er=/paint|layout|strict|content/,Dr=e=>!!e&&e!==`none`,Or;function kr(e){let t=yr(e)?Nr(e):e;return Dr(t.transform)||Dr(t.translate)||Dr(t.scale)||Dr(t.rotate)||Dr(t.perspective)||!jr()&&(Dr(t.backdropFilter)||Dr(t.filter))||Tr.test(t.willChange||``)||Er.test(t.contain||``)}function Ar(e){let t=Fr(e);for(;br(t)&&!Mr(t);){if(kr(t))return t;if(wr(t))return null;t=Fr(t)}return null}function jr(){return Or??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Or}function Mr(e){return/^(html|body|#document)$/.test(hr(e))}function Nr(e){return gr(e).getComputedStyle(e)}function Pr(e){return yr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fr(e){if(hr(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||xr(e)&&e.host||_r(e);return xr(t)?t.host:t}function Ir(e){let t=Fr(e);return Mr(t)?(e.ownerDocument||e).body:br(t)&&Sr(t)?t:Ir(t)}function Lr(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ir(e),i=r===e.ownerDocument?.body,a=gr(r);if(i){let e=Rr(a);return t.concat(a,a.visualViewport||[],Sr(r)?r:[],e&&n?Lr(e):[])}return t.concat(r,Lr(r,[],n))}function Rr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var zr={...p},Br={};function Vr(e,t){let n=p.useRef(Br);return n.current===Br&&(n.current=e(t)),n}var Hr=zr.useInsertionEffect,Ur=Hr&&Hr!==zr.useLayoutEffect?Hr:e=>e();function Y(e){let t=Vr(Wr).current;return t.next=e,Ur(t.effect),t.trampoline}function Wr(){let e={next:void 0,callback:Gr,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Gr(){}var X=typeof document<`u`?p.useLayoutEffect:()=>{};function Kr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var qr={};function Jr(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Xr(t);let a=Xr(e);return t&&(a=Zr(a,t)),n&&(a=Zr(a,n)),r&&(a=Zr(a,r)),i&&(a=Zr(a,i)),a}function Yr(e){if(e.length===0)return qr;if(e.length===1)return Xr(e[0]);let t=Xr(e[0]);for(let n=1;n<e.length;n+=1)t=Zr(t,e[n]);return t}function Xr(e){return ti(e)?{...e(qr)}:Qr(e)}function Zr(e,t){return ti(t)?t(e):$r(e,t)}function Qr(e){let t={...e};for(let e in t){let n=t[e];ei(e,n)&&(t[e]=ri(n))}return t}function $r(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Kr(e.style,r);break;case`className`:e[n]=ai(e.className,r);break;default:e[n]=ei(n,r)?ni(e[n],r):r}}return e}function ei(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function ti(e){return typeof e==`function`}function ni(e,t){return t?e?(...n)=>{let r=n[0];if(oi(r)){let i=r;ii(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:ri(t):e}function ri(e){return e&&((...t)=>{let n=t[0];return oi(n)&&ii(n),e(...t)})}function ii(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ai(e,t){return t?e?t+` `+e:t:e}function oi(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function si(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var ci=si(`https://base-ui.com/production-error`,`Base UI`),li=p.createContext(void 0);function ui(e=!1){let t=p.useContext(li);if(t===void 0&&!e)throw Error(ci(16));return t}function di(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:p.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function fi(e){return e?.ownerDocument||document}function pi(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(gr(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function mi(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=p.useRef(null),s=ui(!0),c=a??s!==void 0,{props:l}=di({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=p.useCallback(()=>{let e=o.current;hi(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return X(u,[u]),{getButtonProps:p.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Jr({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(ii(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=hi(r),s=!i&&gi(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),pi(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),pi(r,e)))},onKeyUp(e){t||(ii(e),a?.(e),e.target===e.currentTarget&&i&&c&&hi(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),pi(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Y(e=>{o.current=e,u()})}}function hi(e){return br(e)&&e.tagName===`BUTTON`}function gi(e){return br(e)&&e.tagName===`A`&&!!e.href}function _i(e,t,n,r){let i=Vr(yi).current;return bi(i,e,t,n,r)&&Si(i,[e,t,n,r]),i.callback}function vi(e){let t=Vr(yi).current;return xi(t,e)&&Si(t,e),t.callback}function yi(){return{callback:null,cleanup:null,refs:[]}}function bi(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function xi(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Si(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var Ci=19;function wi(e){return Ci>=e}function Ti(e){if(!p.isValidElement(e))return null;let t=e,n=t.props;return(wi(19)?n?.ref:t.ref)??null}function Ei(){}var Di=Object.freeze([]),Oi=Object.freeze({});function ki(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Ai(e,t){return typeof e==`function`?e(t):e}function ji(e,t){return typeof e==`function`?e(t):e}function Mi(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Ii(r));let i=Ni(t,n,r);if(n.enabled===!1)return null;let a=n.state??Oi;return Li(e,r,i,a)}function Ni(e,t,n){let{className:r,style:i}=e,{state:a=Oi,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Ai(r,a):void 0,d=l?ji(i,a):void 0,f=l?ki(a,c):Oi,p=l&&s?Pi(s):void 0,m=l?Kr(f,p)??{}:Oi;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?vi([m.ref,Ti(n),...o]):_i(m.ref,Ti(n),o):_i(null,null)),l?(u!==void 0&&(m.className=ai(m.className,u)),d!==void 0&&(m.style=Kr(m.style,d)),m):Oi}function Pi(e){return Array.isArray(e)?Yr(e):Jr(void 0,e)}var Fi=Symbol.for(`react.lazy`);function Ii(e){if(e?.$$typeof!==Fi)return e;let t=p.Children.toArray(e)[0];return p.isValidElement(t)?t:e}function Li(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Jr(n,t.props);return e.ref=n.ref,p.cloneElement(t,e)}return Ri(e,n)}function Ri(e,t){return e===`button`?(0,p.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,p.createElement)(`img`,{alt:``,...t,key:t.key}):p.createElement(e,t)}var zi=p.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=mi({disabled:i,focusableWhenDisabled:a,native:o});return Mi(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Bi=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Vi=Bt,Hi=(e,t)=>n=>{if(t?.variants==null)return Vi(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Bi(t)||Bi(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Vi(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Ui=Hi(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-brand-hover`,outline:`border-border bg-panel-2 text-dim hover:border-line-strong hover:bg-panel-3 hover:text-foreground aria-expanded:bg-panel-3 aria-expanded:text-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`text-dim hover:bg-hover hover:text-foreground aria-expanded:bg-hover aria-expanded:text-foreground`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`,brand:`border-brand-border bg-brand-soft text-brand hover:bg-brand/20`,warn:`border-warn/40 bg-warn/10 text-warn hover:bg-warn/20`,info:`border-info/30 bg-info/10 text-info hover:bg-info/20`,alt:`border-violet/30 bg-violet/10 text-violet hover:bg-violet/20`,chip:`border-border bg-panel-2 text-dim hover:border-line-strong hover:text-foreground aria-pressed:border-brand-border aria-pressed:bg-brand-soft aria-pressed:text-foreground`},size:{default:`h-8 gap-1.5 px-3 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-[26px] gap-1 rounded-[6px] px-2.5 text-[11px] [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-9`,"icon-xs":`size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-10`,micro:`h-5 gap-1 rounded-sm px-1.5 text-[10px] [&_svg:not([class*='size-'])]:size-3`,chip:`h-7 gap-1.5 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3.5`}},defaultVariants:{variant:`default`,size:`default`}});function Wi({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,m.jsx)(zi,{"data-slot":`button`,className:J(Ui({variant:t,size:n,className:e})),...r})}var Gi=class extends p.Component{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}componentDidCatch(e,t){typeof console<`u`&&console.error(`[agora-kit] region crashed`,e,t)}componentDidUpdate(e){if(!this.state.error)return;let t=e.resetKeys??[],n=this.props.resetKeys??[];(t.length!==n.length||t.some((e,t)=>!Object.is(e,n[t])))&&this.reset()}reset=()=>{this.props.onReset?.(),this.setState({error:null})};render(){let{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):(0,m.jsx)(Ki,{title:this.props.label?`${this.props.label} failed to render`:`Something broke here`,error:e,onRetry:this.reset,className:this.props.className}):this.props.children}};function Ki({title:e,error:t,onRetry:n,className:r}){let i=t instanceof Error?t.message:t?String(t):void 0;return(0,m.jsxs)(`div`,{role:`alert`,className:J(`flex flex-col items-start gap-3 rounded-lg border border-bad/25 bg-bad/5 p-4 text-sm`,r),children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-bad`,children:[(0,m.jsx)(Ct,{}),e]}),i&&(0,m.jsx)(`p`,{className:`mono break-all text-[11px] text-fg-2`,children:i}),n&&(0,m.jsxs)(Wi,{variant:`outline`,size:`sm`,onClick:n,children:[(0,m.jsx)(wt,{}),`Retry`]})]})}function qi({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=p.useRef(e!==void 0),[a,o]=p.useState(()=>t);return[i&&e!==void 0?e:a,p.useCallback(e=>{i||o(e)},[])]}function Ji(){let[,e]=p.useState({});return p.useCallback(()=>{e({})},[])}var Yi=0;function Xi(e,t=`mui`){let n=p.useRef(void 0),r=Ji(),i=e??n.current;return p.useEffect(()=>{n.current??(Yi+=1,n.current=`${t}-${Yi}`,e??r())},[e,t,r]),i}var Zi=zr.useId;function Qi(e,t){if(Zi!==void 0){let n=Zi();return e??(t?`${t}-${n}`:n)}return Xi(e,t)}function $i(e){return Qi(e,`base-ui`)}function ea(e,t,n,r){let i=!1,a=!1,o=r??Oi;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function ta(e,t,n){let r=n??Oi;return{reason:e,event:t??new Event(`base-ui`),...r}}var na=`none`,ra=`trigger-press`,ia=`trigger-hover`,aa=`trigger-focus`,oa=`outside-press`,sa=`item-press`,ca=`close-press`,la=`focus-out`,ua=`escape-key`,da=`list-navigation`,fa=`keyboard`,pa=`pointer`,ma=`cancel-open`,ha=`sibling-open`,ga=`disabled`,_a=`imperative-action`;function va(e){p.useEffect(e,Di)}var ya=null;globalThis.requestAnimationFrame;var ba=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},xa=class e{static create(){return new e}static request(e){return ba.request(e)}static cancel(e){return ba.cancel(e)}currentId=ya;request(e){this.cancel(),this.currentId=ba.request(()=>{this.currentId=ya,e()})}cancel=()=>{this.currentId!==ya&&(ba.cancel(this.currentId),this.currentId=ya)};disposeEffect=()=>this.cancel};function Sa(){let e=Vr(xa.create).current;return va(e.disposeEffect),e}function Ca(e,t=!1,n=!1,r=!1){let[i,a]=p.useState(e&&t?`idle`:void 0),[o,s]=p.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),X(()=>{if(!e&&o&&i!==`ending`&&n){let e=xa.request(()=>{a(`ending`)});return()=>{xa.cancel(e)}}},[e,o,i,n]),X(()=>{if(!e||t||i===void 0)return;let n=xa.request(()=>{a(void 0)});return()=>{xa.cancel(n)}},[t,e,i]),X(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=xa.request(()=>{a(`idle`)});return()=>{xa.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function wa(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=qi({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=Ca(a,!0,!0),u=$i(),[d,f]=p.useState(),m=d===null?void 0:d??u,h=Y(e=>{let t=!a,n=ea(ra,e.nativeEvent);r(t,n),n.isCanceled||o(t)});return p.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:h,mounted:s,open:a,panelId:m,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,h,s,a,m,c,o,f,l])}var Ta=p.createContext(void 0);function Ea(){let e=p.useContext(Ta);if(e===void 0)throw Error(ci(15));return e}var Da=`data-starting-style`,Oa=`data-ending-style`,ka={[Da]:``},Aa={[Oa]:``},ja={transitionStatus(e){return e===`starting`?ka:e===`ending`?Aa:null}},Ma=`data-open`,Na=`data-closed`,Pa=Da,Fa=`data-panel-open`,Ia={[Ma]:``},La={[Na]:``},Ra={open(e){return e?{[Fa]:``}:null}},za={open(e){return e?Ia:La},...ja},Ba=p.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=Y(o),d=wa({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=p.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),h=p.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),g=Mi(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:za});return(0,m.jsx)(Ta.Provider,{value:h,children:g})}),Va={...Ra,...ja},Ha=p.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=Ea(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=mi({disabled:c,native:u});return Mi(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:Va})});function Ua(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var Wa=0,Ga=class e{static create(){return new e}currentId=Wa;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Wa,t()},e)}isStarted(){return this.currentId!==Wa}clear=()=>{this.currentId!==Wa&&(clearTimeout(this.currentId),this.currentId=Wa)};disposeEffect=()=>this.clear};function Ka(){let e=Vr(Ga.create).current;return va(e.disposeEffect),e}function qa(e){let t=Vr(Ja,e).current;return t.next=e,X(t.effect),t}function Ja(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ya(e){return e==null?e:`current`in e?e.current:e}function Xa(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Za=c(it(),1),Qa=null;function $a(e){if(!Qa){let e=[];Qa=e,queueMicrotask(()=>{Qa=null,Za.flushSync(()=>{for(let t of e)t()})})}Qa.push(e)}function eo(e,t=!1,n=!1){let r=Sa();return Y((i,a=null)=>{r.cancel();let o=Ya(e);if(o==null)return;let s=o,c=()=>{n?$a(()=>{a?.aborted||i()}):Za.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Xa(s).map(e=>e.finished.then(Ei))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Xa(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Da;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function to(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Y(a),s=eo(r,n,i);p.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var no={height:void 0,width:void 0};function ro(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=p.useRef(null),f=p.useRef(null),[m,h]=p.useState(no),g=p.useRef(no),_=p.useRef(!1),v=p.useRef(s),y=p.useRef(!1),[b,x]=p.useState(!1),S=p.useRef(null),C=_i(t,d),w=qa(s),T=eo(d),E=!s&&!a,D=b?`idle`:u,O=s&&(v.current||y.current),k=!s&&a&&f.current===`css-animation`&&m.height===void 0&&m.width===void 0?g.current:m,A=n&&E&&f.current!==`css-animation`,j=Y((e,t=!0)=>{t&&(g.current=e),h(e)}),M=Y(()=>{S.current?.(),S.current=null}),N=Y(e=>{M(),S.current=()=>{S.current=null,e()}}),P=Y(()=>{s&&a&&f.current===`css-animation`&&(y.current=!0)});X(()=>{b&&u!==`starting`&&x(!1)},[b,u]),p.useEffect(()=>()=>{P(),M()},[P,M]),X(()=>{s||(v.current=!1,y.current=!1);let e=d.current;if(!e)return;!s&&S.current&&M();let t=ao(e,O);if(f.current=t,s&&u===`idle`&&v.current&&t===`css-animation`){g.current=io(e);return}if(s&&u===`starting`){let n=_.current;if(_.current=!1,t===`none`){j(io(e)),x(!0);return}if(t===`css-transition`){let t=co(e);if(j(io(e)),!n)return t;let r=so(e,`transition-duration`,`0s`);return N(r),x(!0),t}j(io(e));let r=so(e,`animation-name`,`none`);if(!n){r();return}let i=so(e,`animation-duration`,`0s`);r(),N(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(t===`none`){j(no,!1),c(!1);return}j(io(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=io(e);n.height>0||n.width>0?(j(n),t===`css-animation`&&so(e,`animation-name`,`none`)()):c(!1)},[a,s,M,j,c,N,O,u]),to({enabled:s&&a&&D===`idle`,open:!0,ref:d,onComplete(){s&&j(no,!1)}}),p.useEffect(()=>{if(s||!a||D!==`ending`)return;if(!d.current){c(!1),j(no,!1);return}let e=new AbortController,t=-1;function n(){w.current||(c(!1),j(no,!1))}return t=xa.request(()=>{T(n,e.signal)}),()=>{xa.cancel(t),e.abort()}},[w,a,s,D,T,j,c]),X(()=>{let e=d.current;e&&n&&E&&e.setAttribute(`hidden`,`until-found`)},[E,n]),p.useEffect(function(){let e=d.current;if(!e)return;let t=Ga.create(),n=-1,r=(r,i)=>{t.start(0,()=>{w.current||(n=xa.request(()=>{w.current||(r&&(_.current=!1),i&&e.setAttribute(Pa,``),e.setAttribute(`hidden`,`until-found`))}))})},i=Ua(e,`beforematch`,t=>{let n=ea(na,t);if(o(!0,n),n.isCanceled){r(!1,!1);return}_.current=!0;let i=e.hasAttribute(Pa);e.removeAttribute(Pa),l(!0),r(!0,i)});return()=>{t.clear(),xa.cancel(n),i()}},[w,o,l]);let F=i||n||a||s;return{height:k.height,props:{...A?{[Pa]:``}:void 0,hidden:E,id:r},ref:C,shouldPreventOpenAnimation:O,shouldRender:F,transitionStatus:D,width:k.width}}function io(e){return{height:e.scrollHeight,width:e.scrollWidth}}function ao(e,t){let n=gr(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&oo(n.animationDuration),i=oo(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function oo(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function so(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function co(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=xa.request(n);return()=>{xa.cancel(r),n()}}var lo=`--collapsible-panel-height`,uo=`--collapsible-panel-width`,fo=p.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=Ea(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;X(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:D,width:O}=ro({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=ji(s,k),j=Mi(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[lo]:S===void 0?`auto`:`${S}px`,[uo]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:za});return E?j:null});function po({...e}){return(0,m.jsx)(Ba,{"data-slot":`collapsible`,...e})}function mo({...e}){return(0,m.jsx)(Ha,{"data-slot":`collapsible-trigger`,...e})}function ho({...e}){return(0,m.jsx)(fo,{"data-slot":`collapsible-content`,...e})}function go(e){return Mi(e.defaultTagName??`div`,e,e)}var _o=768;function vo(){let[e,t]=p.useState(void 0);return p.useEffect(()=>{let e=()=>{t(window.innerWidth<_o)};if(t(window.innerWidth<_o),typeof window.matchMedia!=`function`)return;let n=window.matchMedia(`(max-width: 767px)`);return n.addEventListener(`change`,e),()=>n.removeEventListener(`change`,e)},[]),!!e}function yo(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:bo,platform:xo,maxTouchPoints:So}=yo(),Co=bo.toLowerCase(),wo=xo.toLowerCase(),To=/^i(os$|p)/.test(wo)||wo===`macintel`&&So>1,Eo=`android`,Do=wo===Eo||Co.includes(Eo),Oo=!To&&wo.startsWith(`mac`);wo.startsWith(`win`),!Do&&/^(linux|chrome os)/.test(wo);var ko=Oo||To,Ao=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Ao&&Co.includes(`firefox`),!Ao&&Co.includes(`chrom`);var jo=ko,Mo=/jsdom|happydom/.test(Co);function No(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&xr(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Po(e,t){let n=e;for(;n;){if(yr(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(xr(n)?n.host:null)}return null}function Fo(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Io=`data-base-ui-focusable`,Lo=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Ro=`ArrowLeft`,zo=`ArrowRight`,Bo=`ArrowUp`,Vo=`ArrowDown`,Ho=`data-open`,Uo=`data-closed`,Wo=`data-anchor-hidden`,Go=`data-popup-open`,Ko=`data-pressed`,qo={[Go]:``},Jo={[Go]:``,[Ko]:``},Yo={[Ho]:``},Xo={[Uo]:``},Zo={[Wo]:``},Qo={open(e){return e?qo:null}},$o={open(e){return e?Jo:null}},es={open(e){return e?Yo:Xo},anchorHidden(e){return e?Zo:null}},ts={...es,...ja},ns=`data-trigger-disabled`;function rs(e,t){if(!yr(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(ns);for(let[,e]of t.entries())if(Z(e,n))return!e.hasAttribute(ns);return!1}function is(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function as(e){return e.matches(`html,body`)}function os(e){return br(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function ss(e){return Po(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Lo}`)!=null}function cs(e){return e?e.getAttribute(`role`)===`combobox`&&os(e):!1}function ls(e){if(!e||Mo)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function us(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function ds(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ds(e,t.id,n)])}function fs(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ps(e){e.preventDefault(),e.stopPropagation()}function ms(e){return`nativeEvent`in e}function hs(e){return e.pointerType===``&&e.isTrusted?!0:Do&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function gs(e){return Mo?!1:!Do&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Do||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function _s(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function vs(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var ys=Math.min,bs=Math.max,xs=Math.round,Ss=Math.floor,Cs=e=>({x:e,y:e}),ws={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ts(e,t,n){return bs(e,ys(t,n))}function Es(e,t){return typeof e==`function`?e(t):e}function Ds(e){return e.split(`-`)[0]}function Os(e){return e.split(`-`)[1]}function ks(e){return e===`x`?`y`:`x`}function As(e){return e===`y`?`height`:`width`}function js(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ms(e){return ks(js(e))}function Ns(e,t,n){n===void 0&&(n=!1);let r=Os(e),i=Ms(e),a=As(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Hs(o)),[o,Hs(o)]}function Ps(e){let t=Hs(e);return[Fs(e),t,Fs(t)]}function Fs(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Is=[`left`,`right`],Ls=[`right`,`left`],Rs=[`top`,`bottom`],zs=[`bottom`,`top`];function Bs(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ls:Is:t?Is:Ls;case`left`:case`right`:return t?Rs:zs;default:return[]}}function Vs(e,t,n,r){let i=Os(e),a=Bs(Ds(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Fs)))),a}function Hs(e){let t=Ds(e);return ws[t]+e.slice(t.length)}function Us(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Ws(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Us(e)}function Gs(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ks(e,t){return t<0||t>=e.length}function qs(e,t){return Xs(e.current,{disabledIndices:t})}function Js(e,t){return Xs(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ys(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Xs(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Ks(e,u)?-1:u,wrapped:d}}function Xs(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Zs(e,a,r));return a}function Zs(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!$s(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Qs(e){return e.visibility===`hidden`||e.visibility===`collapse`}function $s(e,t=e?Nr(e):null){return!e||!e.isConnected||!t||Qs(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var ec=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function tc(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return xr(n)?n.host:null}function nc(e){for(let t of Array.from(e.children))if(hr(t)===`summary`)return t;return null}function rc(e,t){let n=nc(t);return!!n&&(e===n||Z(n,e))}function ic(e){let t=e?hr(e):``;return e!=null&&e.matches(ec)&&(t!==`summary`||e.parentElement!=null&&hr(e.parentElement)===`details`&&nc(e.parentElement)===e)&&(t!==`details`||nc(e)==null)&&(t!==`input`||e.type!==`hidden`)}function ac(e){if(!ic(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=tc(t)){let n=t!==e,r=hr(t)===`slot`;if(t.hasAttribute(`inert`)||n&&hr(t)===`details`&&!t.open&&!rc(e,t)||t.hasAttribute(`hidden`)||!r&&!oc(t,n))return!1}return!0}function oc(e,t){let n=Nr(e);return t?n.display!==`none`:$s(e,n)}function sc(e){let t=e.tabIndex;if(t<0){let t=hr(e);if(t===`details`||t===`audio`||t===`video`||br(e)&&e.isContentEditable)return 0}return t}function cc(e){if(hr(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function lc(e,t){let n=cc(e);if(!n)return!0;let r=t.find(e=>{let t=cc(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=cc(e);return t?.name===n.name&&t.form===n.form})===n}function uc(e){if(br(e)&&hr(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return br(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function dc(e,t){uc(e).forEach(e=>{ic(e)&&t.push(e),dc(e,t)})}function fc(e,t,n){uc(e).forEach(e=>{br(e)&&e.matches(t)&&n.push(e),fc(e,t,n)})}function pc(e){return ac(e)&&sc(e)>=0}function mc(e){let t=[];return dc(e,t),t.filter(ac)}function hc(e){let t=mc(e);return t.filter(e=>sc(e)>=0&&lc(e,t))}function gc(e,t){let n=hc(e),r=n.length;if(r===0)return;let i=No(fi(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function _c(e){return gc(fi(e).body,1)||e}function vc(e){return gc(fi(e).body,-1)||e}function yc(e,t,n){if(!e)return null;let r=[];dc(fi(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(ac);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Z(n,o)&&pc(o)&&lc(o,a))return o}return r[i]}function bc(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z(n,r)}function xc(e){hc(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Sc(e){let t=[];fc(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Cc(e,t){let n=p.useRef(e),r=Y(t);X(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var wc=p.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Mi(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),Tc=p.createContext(void 0);function Ec(e){let t=p.useContext(Tc);if(!e&&t===void 0)throw Error(ci(27));return t}var Dc=p.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Ec(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Mi(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:ts,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Oc=p.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Ec(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=mi({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,ea(ca,e.nativeEvent))}return Mi(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),kc=p.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Ec(),c=$i(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Mi(`p`,e,{ref:t,props:[{id:c},o]})});function Ac(e,t){return t!=null&&!_s(t)?0:typeof e==`function`?e():e}function jc(e,t,n){let r=Ac(e,n);return typeof r==`number`?r:r?.[t]}function Mc(e){return typeof e==`function`?e():e}function Nc(e,t){return t||e===`click`||e===`mousedown`}function Pc(e){return e?.includes(`mouse`)&&e!==`mousedown`}var Fc=p.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ga,currentIdRef:{current:null},currentContextRef:{current:null}});function Ic(e,t){e.current=t.current}function Lc(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=p.useRef(n),a=p.useRef(n),o=p.useRef(null),s=p.useRef(null),c=Ka();return X(()=>{a.current=n,o.current?i.current={open:jc(i.current,`open`),close:jc(n,`close`)}:i.current=n},[n,o,i,a]),(0,m.jsx)(Fc.Provider,{value:p.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Rc(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=p.useContext(Fc),[d,f]=p.useState(!1),m=p.useRef(n);return X(()=>{m.current=n},[n]),X(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(m.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),X(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:jc(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,ea(na))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),X(()=>()=>{if(i.current===r){if(c.current=null,!m.current)return;i.current=null,Ic(a,s),u.clear()}},[c,i,a,r,s,u]),p.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function zc(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var Bc={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Vc={...Bc,position:`fixed`,margin:0,top:0,left:0};({...Bc});var Hc=p.forwardRef(function(e,t){let[n,r]=p.useState();X(()=>{jo&&Ao&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,m.jsx)(`span`,{...e,ref:t,style:Vc,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Uc(e){return`data-base-ui-${e}`}var Wc=0;function Gc(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Wc);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Ei;let o=requestAnimationFrame(a);return Wc=o,()=>{Wc===o&&(cancelAnimationFrame(o),Wc=0)}}var Kc=`data-base-ui-inert`,qc=new WeakMap,Jc=new WeakSet,Yc=new WeakMap,Xc=0;function Zc(e){return e?xr(e)?e.host:Zc(e.parentNode):null}var Qc=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Zc(t);return e.contains(n)?n:null}).filter(e=>e!=null),$c=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},el=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{hr(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function tl(e,t,n,{mark:r=!0}){let i=Qc(t,e),a=r?el(t,$c(i),new Set(i)):[],o=[],s=[];if(n){let e=Qc(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);el(t,$c(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(qc.get(e)||0)+1;qc.set(e,r),o.push(e),r===1&&n&&Jc.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Yc.get(e)||0)+1;Yc.set(e,t),s.push(e),t===1&&e.setAttribute(Kc,``)}),Xc+=1,()=>{o.forEach(e=>{let t=(qc.get(e)||0)-1;qc.set(e,t),t||(Jc.has(e)||e.removeAttribute(`aria-hidden`),Jc.delete(e))}),r&&s.forEach(e=>{let t=(Yc.get(e)||0)-1;Yc.set(e,t),t||e.removeAttribute(Kc)}),--Xc,Xc||(qc=new WeakMap,Jc=new WeakSet,Yc=new WeakMap)}}function nl(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=fi(e[0]).body;return tl(e,i,n,{mark:r})}var rl={style:{transition:`none`}},il=`data-base-ui-click-trigger`,al={fallbackAxisSide:`none`},ol={fallbackAxisSide:`end`},sl={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},cl=p.createContext(null),ll=()=>p.useContext(cl),ul=Uc(`portal`);function dl(e={}){let{ref:t,container:n,componentProps:r=Oi,elementProps:i}=e,a=Qi(),o=ll()?.portalNode,[s,c]=p.useState(null),[l,u]=p.useState(null),d=Y(e=>{e!==null&&u(e)}),f=p.useRef(null);X(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(vr(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let m=Mi(`div`,r,{ref:[t,d],props:[{id:a,[ul]:``},i]}),h=s&&m?Za.createPortal(m,s):null;return{node:l,nodeId:p.isValidElement(m)?m.props.id:void 0,subtree:h}}var fl=p.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=dl({container:o,ref:t,componentProps:e,elementProps:c}),f=p.useRef(null),h=p.useRef(null),g=p.useRef(null),_=p.useRef(null),[v,y]=p.useState(null),b=p.useRef(!1),x=v?.modal,S=v?.open,C=!!v&&!v.modal&&v.open&&!!l;p.useEffect(()=>{if(!l||x)return;function e(e){l&&e.relatedTarget&&bc(e)&&(e.type===`focusin`?b.current&&=(Sc(l),!1):(xc(l),b.current=!0))}return zc(Ua(l,`focusin`,e,!0),Ua(l,`focusout`,e,!0))},[l,x]),X(()=>{l&&S===!0&&b.current&&(Sc(l),b.current=!1)},[S,l]);let w=p.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:h,beforeInsideRef:g,afterInsideRef:_,portalNode:l,setFocusManagerState:y}),[l]);return(0,m.jsxs)(p.Fragment,{children:[d,(0,m.jsxs)(cl.Provider,{value:w,children:[C&&l&&(0,m.jsx)(Hc,{"data-type":`outside`,ref:f,onFocus:e=>{bc(e,l)?g.current?.focus():vc(v?v.domReference:null)?.focus()}}),C&&l&&(0,m.jsx)(`span`,{role:s,"aria-owns":u,style:sl}),l&&Za.createPortal(a,l),C&&l&&(0,m.jsx)(Hc,{"data-type":`outside`,ref:h,onFocus:e=>{bc(e,l)?_.current?.focus():(_c(v?v.domReference:null)?.focus(),v?.closeOnFocusOut&&v?.onOpenChange(!1,ea(`focus-out`,e.nativeEvent)))}})]})]})});function pl(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ml=class{nodesRef={current:[]};events=pl();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},hl=p.createContext(null),gl=p.createContext(null),_l=()=>p.useContext(hl)?.id||null,vl=e=>{let t=p.useContext(gl);return e??t};function yl(e){let t=Qi(),n=vl(e),r=_l();return X(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function bl(e){let{children:t,id:n}=e,r=_l();return(0,m.jsx)(hl.Provider,{value:p.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function xl(e){let{children:t,externalTree:n}=e,r=Vr(()=>n??new ml).current;return(0,m.jsx)(gl.Provider,{value:r,children:t})}function Sl(e,t){let n=gr(Fo(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(hs(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Cl=20,wl=[];function Tl(){wl=wl.filter(e=>e.deref()?.isConnected)}function El(e){Tl(),e&&hr(e)!==`body`&&(wl.push(new WeakRef(e)),wl.length>Cl&&(wl=wl.slice(-20)))}function Dl(){return Tl(),wl[wl.length-1]?.deref()}function Ol(e){return e?pc(e)?e:hc(e)[0]||e:null}function kl(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=mc(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return pc(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Al(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:g,getInsideElements:_}=e,v=t.useState(`open`),y=t.useState(`domReferenceElement`),b=t.useState(`floatingElement`),{events:x,dataRef:S}=t.context,C=Y(()=>S.current.floatingContext?.nodeId),w=i===!1,T=cs(y)&&w,E=qa(i),D=qa(a),O=qa(o),k=qa(u),A=qa(v),j=vl(g),M=ll(),N=p.useRef(!1),P=p.useRef(!1),F=p.useRef(!1),I=p.useRef(null),L=p.useRef(``),R=p.useRef(``),z=p.useRef(null),B=p.useRef(null),ee=_i(z,h,M?.beforeInsideRef),V=_i(B,M?.afterInsideRef),te=Ka(),ne=Ka(),H=Sa(),re=M!=null,U=us(b),ie=Y((e=U)=>e?hc(e):[]),W=Y(()=>_?.().filter(e=>e!=null)??[]);p.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Z(U,No(fi(U)))&&ie().length===0&&!T&&ps(e)}return Ua(fi(U),`keydown`,e)},[r,U,c,T,ie]),p.useEffect(()=>{if(r||!v)return;let e=fi(U);function t(){F.current=!1}function n(e){let t=Fo(e),n=W(),r=Z(b,t)||Z(y,t)||Z(M?.portalNode,t)||n.some(e=>e===t||Z(e,t));F.current=!r,R.current=e.pointerType||`keyboard`,Po(t,`[data-base-ui-click-trigger]`)&&(P.current=!0,ne.start(0,()=>{P.current=!1}))}function i(){R.current=`keyboard`}return zc(Ua(e,`pointerdown`,n,!0),Ua(e,`pointerup`,t,!0),Ua(e,`pointercancel`,t,!0),Ua(e,`keydown`,i,!0),t)},[r,b,y,U,v,M,ne,W]),p.useEffect(()=>{if(r||!l)return;let e=fi(U);function n(){P.current=!0,ne.start(0,()=>{P.current=!1})}function i(e){let t=Fo(e);pc(t)&&(I.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Fo(n);c&&r==null&&a!=null&&Z(b,a)&&El(a),queueMicrotask(()=>{let o=C(),l=t.context.triggerElements,u=W(),p=r?.hasAttribute(Uc(`focus-guard`))&&[z.current,B.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Ya(f),Ya(d)].includes(r),m=!(Z(y,r)||Z(b,r)||Z(r,b)||Z(M?.portalNode,r)||u.some(e=>e===r||Z(e,r))||l.hasMatchingElement(e=>Z(e,r))||p||j&&(ds(j.nodesRef.current,o).find(e=>Z(e.context?.elements.floating,r)||Z(e.context?.elements.domReference,r))||fs(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,us(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===y&&U&&kl(U),s&&i!==y&&!$s(a)&&No(e)===e.body){if(br(U)&&(U.focus(),s===`popup`)){H.request(()=>{U.focus()});return}let e=ie(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;br(n)&&n.focus()}S.current.insideReactTree?S.current.insideReactTree=!1:(T||!c)&&r&&m&&!P.current&&(T||r!==Dl())&&(N.current=!0,t.setOpen(!1,ea(la,n)))})}function o(){F.current||(S.current.insideReactTree=!0,te.start(0,()=>{S.current.insideReactTree=!1}))}let u=br(y)?y:null;if(b||u)return zc(u&&Ua(u,`focusout`,a),u&&Ua(u,`pointerdown`,n),b&&Ua(b,`focusin`,i),b&&Ua(b,`focusout`,a),b&&M&&Ua(b,`focusout`,o,!0))},[r,y,b,U,c,j,M,t,l,s,ie,T,C,S,te,ne,H,d,f,W]),p.useEffect(()=>{if(r||!b||!v)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${Uc(`portal`)}]`)||[]),t=(j?fs(j.nodesRef.current,C()):[]).find(e=>cs(e.context?.elements.domReference||null))?.context?.elements.domReference,n=nl([b,...e,z.current,B.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...W(),t,Ya(f),Ya(d),T?y:null].filter(e=>e!=null),{ariaHidden:c||T,mark:!1}),i=nl([b,...e].filter(e=>e!=null));return()=>{i(),n()}},[v,r,y,b,c,M,T,j,C,d,f,W]),X(()=>{if(!v||r||!br(U))return;L.current=``,R.current=``;let e=fi(U),t=No(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||Z(U,t))return;let i=null,a=()=>(i??=ie(U),i[0]||U),o;o=r===!0||r===null?a():Ya(r),o||=a();let s=Z(U,No(e)),c=S.current.openEvent,l=c?.type===`mousedown`&&hs(c);Gc(o,{sync:l,preventScroll:o===U,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=No(e);return!(t!==o&&Z(U,t))}})})},[r,v,U,ie,E,k,A,S]);let G=p.useRef(null);X(()=>{if(r||!U){G.current=null;return}G.current&&=(G.current.cancelled=!0,null);let e=fi(U),t=No(e),n=k.current==null;El(t);function i(e){if(e.open||(L.current=Sl(e.nativeEvent,R.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Uc(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(N.current=!0),e.reason===`outside-press`){if(e.nested)N.current=!1;else if(hs(e.nativeEvent)||gs(e.nativeEvent))N.current=!1;else{let e=!1;fi(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}}x.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=y?.isConnected?y:null,o=t?.isConnected&&hr(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Dl()||null,typeof i==`boolean`?s:Ya(i)||s||null}return()=>{x.off(`openchange`,i);let t=No(e),n=W(),r=Z(b,t)||n.some(e=>e===t||Z(e,t))||j&&ds(j.nodesRef.current,C(),!1).some(e=>Z(e.context?.elements.floating,t)),o=D.current,s=L.current,c=a(s),l={cancelled:!1};G.current=l,queueMicrotask(()=>{G.current===l&&(G.current=null);let n=Ol(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!N.current&&br(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,b,U,D,O,k,x,j,y,C,W]),X(()=>{if(!Ao||v||!b)return;let e=No(fi(b));br(e)&&os(e)&&Z(b,e)&&e.blur()},[v,b]),X(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:l,open:v,onOpenChange:t.setOpen,domReference:y}),()=>{M.setFocusManagerState(null)}},[r,M,c,v,t,l,y]),X(()=>{if(!r&&U)return kl(U),()=>{queueMicrotask(Tl)}},[r,U]);let ae=!r&&(!c||!T)&&(re||c);return(0,m.jsxs)(p.Fragment,{children:[ae&&(0,m.jsx)(Hc,{"data-type":`inside`,ref:ee,onFocus:e=>{if(c){let e=ie();Gc(e[e.length-1])}else M?.portalNode&&(N.current=!1,bc(e,M.portalNode)?_c(y)?.focus():Ya(f??M.beforeOutsideRef)?.focus())}}),n,ae&&(0,m.jsx)(Hc,{"data-type":`inside`,ref:V,onFocus:e=>{c?Gc(ie()[0]):M?.portalNode&&(l&&(N.current=!0),bc(e,M.portalNode)?vc(y)?.focus():Ya(d??M.afterOutsideRef)?.focus())}})]})}function jl(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=ra}=t,l=e.context.dataRef,u=p.useRef(void 0),d=Sa(),f=Ka(),m=p.useMemo(()=>{function t(t,n,r,i){let a=ea(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=_s(e.pointerType,!0)&&gs(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||_s(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=Fo(s),p=os(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:_s(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return p.useMemo(()=>n?{reference:m}:Oi,[n,m])}function Ml(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Nl(e){return e!=null&&e.clientX!=null}function Pl(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=p.useRef(!1),l=p.useRef(null),[u,d]=p.useState(),[f,m]=p.useState([]),h=Y(t=>{e.set(`positionReference`,t)}),g=Y((t,n,i)=>{c.current||(!s.current.openEvent||Nl(s.current.openEvent))&&e.set(`positionReference`,Ml(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),_=Y(e=>{i?l.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=_s(u)?a:i;p.useEffect(()=>{if(!n){h(o);return}if(!v)return;function e(){l.current?.(),l.current=null}let t=gr(a);function r(t){let n=Fo(t);Z(a,n)?e():g(t.clientX,t.clientY)}return!s.current.openEvent||Nl(s.current.openEvent)?l.current=Ua(t,`mousemove`,r):h(o),e},[v,n,a,s,o,e,g,h,f]),p.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),p.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),p.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let y=p.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return p.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function Fl(){return!1}function Il(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Ll(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Fl,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,m=vl(c),h=Y(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=Y(()=>a),{escapeKey:y,outsidePress:b}=Il(s),x=p.useRef(!1),S=p.useRef(!1),C=p.useRef(!1),w=p.useRef(!1),T=p.useRef(!1),E=p.useRef(``),D=p.useRef(null),O=Ka(),k=Ka(),A=Ka(),j=Y(()=>{k.clear(),d.current.insideReactTree=!1}),M=Y(e=>{let t=d.current.floatingContext?.nodeId;return(m?ds(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Y(t=>is(t,e.select(`floatingElement`))||is(t,e.select(`domReferenceElement`))),P=Y(t=>{o()&&e.setOpen(!1,ea(ra,t.nativeEvent))}),F=Y(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=ms(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=ea(ua,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=Y(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=Y(t=>{if(!l||!n||t.button!==0)return;let r=Fo(t.nativeEvent);Z(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=Y(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});p.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),p.useEffect(()=>j,[j]),p.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new Ga,i=fi(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(Ao?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=d.current.floatingContext?.nodeId,n=m&&ds(m.nodesRef.current,t).some(t=>is(e,t.context?.elements.floating));return N(e)||n}function k(n){if(p(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=Fo(n),i=`[${Uc(`inert`)}]`,a=yr(r)?r.getRootNode():null,o=Array.from((xr(a)?a:fi(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Z(e,r))))return;let c=yr(r)?r:null;for(;c&&!Mr(c);){let e=Fr(c);if(Mr(e)||!yr(e))break;c=e}if(!(o.length&&yr(r)&&!as(r)&&!Z(r,e.select(`floatingElement`))&&o.every(e=>!Z(c,e)))){if(br(r)&&!(`touches`in n)){let e=Mr(r),t=Nr(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!h(n)){if(f()===`intentional`){if(n.detail!==0&&!hs(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof g==`function`&&!g(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,ea(oa,n)),j())}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=Fo(e);if(!n)return;let r=Ua(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():h(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())))}function ee(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function V(e){L(e,ee)}function te(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ne(e){L(e,te)}let H=zc(r&&zc(Ua(i,`keydown`,F),Ua(i,`compositionstart`,a),Ua(i,`compositionend`,o)),_&&zc(Ua(i,`click`,z,!0),Ua(i,`pointerdown`,z,!0),Ua(i,`pointerup`,B,!0),Ua(i,`pointercancel`,B,!0),Ua(i,`mousedown`,z,!0),Ua(i,`mouseup`,B,!0),Ua(i,`touchstart`,R,{capture:!0,passive:!0}),Ua(i,`touchmove`,V,{capture:!0,passive:!0}),Ua(i,`touchend`,ne,{capture:!0,passive:!0})));return()=>{H(),t.clear(),c(),C.current=!1}},[d,u,r,_,g,l,n,y,b,F,j,v,M,N,m,e,O,A]);let z=p.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=p.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return p.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}function Rl(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),X(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};yr(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function zl(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=Y(i),{mounted:c,setMounted:l,transitionStatus:u}=Ca(t,!1,!1,o),d=!t&&r;X(()=>{t&&s(!1)},[t,s]);let f=p.useRef(c),m=p.useRef(!1),h=Ji(),g=()=>{f.current=!1,l(!1),a()};X(()=>{f.current=c,m.current&&(m.current=!1,!t&&c&&g())});let _=Y(()=>{f.current&&(t?(m.current=!0,h()):g())});return to({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||_()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:_}}var Bl={tabIndex:-1,[Io]:``};function Vl(e){return t=>t!==`touch`||e.current}function Hl(e,t=!1){let n=Qi(),r=_l()!=null,i=Vr(()=>e(n,r)).current;return Rl({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Ul({handle:e,store:t}){return X(()=>e.attachStore(t),[e,t]),null}function Wl(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Gl(e,t){let n=p.useRef(null);return Y(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Wl(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Wl(t))})}function Kl(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function ql(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Jl(e,t,n,r={}){let i=n.reason,a=i===ia,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=ql(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Kl(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Za.flushSync(l):l()}function Yl(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Gl(e,n),o=Y(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Y(e=>{a(e),e&&o(e)});return X(()=>(s(t.current),()=>s(null)),[s,t,n,e]),X(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Xl(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=p.useRef(null),i=e.useState(`open`);X(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=ea(na);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Zl(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=zl({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return Vr(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Ql(e,t){e.useSyncedValues(t),X(()=>()=>{e.update({activeTriggerProps:Oi,inactiveTriggerProps:Oi,popupProps:Oi})},[e])}function $l(e,t){X(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),X(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var eu=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},tu=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),nu=o(((e,t)=>{t.exports=tu()})),ru=o((e=>{var t=u(),n=nu();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),iu=o(((e,t)=>{t.exports=ru()})),au=[],ou=void 0;function su(){return ou}function cu(e){au.push(e)}function lu(e){let t=(t,n)=>{let r=Vr(du).current,i;try{ou=r;for(let e of au)e.before(r);i=e(t,n);for(let e of au)e.after(r);r.didInitialize=!0}finally{ou=void 0}return i};return t.displayName=e.displayName||e.name,t}function uu(e){return p.forwardRef(lu(e))}function du(){return{didInitialize:!1}}var fu=nu(),pu=c(iu(),1),mu=wi(19)?_u:vu;function hu(e,t,n,r,i){return mu(e,t,n,r,i)}function gu(e,t,n,r,i){let a=p.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,fu.useSyncExternalStore)(e.subscribe,a,a)}cu({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,fu.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function _u(e,t,n,r,i){let a=su();if(!a)return gu(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function vu(e,t,n,r,i){return(0,pu.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var yu=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return hu(this,e,t,n,r)}},bu=class extends yu{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){p.useDebugValue(e);let n=this;X(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;X(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;X(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){p.useDebugValue(e);let n=this,r=t!==void 0;X(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return p.useDebugValue(e),hu(this,this.selectors[e],t,n,r)}useContextCallback(e,t){p.useDebugValue(e);let n=Y(t??Ei);this.context[e]=n}useStateSetter(e){let t=p.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},xu={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},Su=class extends bu{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:pl(),nested:n,triggerElements:i},xu),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&vs(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Cu(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Su({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Oi,inactiveTriggerProps:Oi,popupProps:Oi}}var wu=e=>e.triggerIdProp??e.activeTriggerId,Tu=e=>e.openProp??e.open,Eu=e=>(e.popupElement?.id??e.floatingId)||void 0;function Du(e,t){return t!==void 0&&Tu(e)&&wu(e)===t}function Ou(e,t){return Du(e,t)?!0:t!==void 0&&Tu(e)&&wu(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var ku={open:Tu,mounted:e=>e.mounted,transitionStatus:e=>Tu(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:wu,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Eu,isTriggerActive:(e,t)=>t!==void 0&&wu(e)===t,isOpenedByTrigger:(e,t)=>Du(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&wu(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Ou(e,t)?Eu(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Au(e){let t=p.useCallback(t=>e===void 0?Ei:e.subscribeStore(t),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,fu.useSyncExternalStore)(t,n,()=>e?.serverStore)}var ju=Oo&&Ao;function Mu(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=p.useRef(!1),s=p.useRef(null),c=p.useRef(!0),l=Ka();p.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=gr(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&br(t)&&t===No(fi(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return zc(Ua(r,`blur`,i),ju&&Ua(r,`keydown`,a,!0),ju&&Ua(r,`pointerdown`,l,!0))},[e,n]),p.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);yr(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=p.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=Fo(n.nativeEvent);if(yr(a)){if(ju&&!n.relatedTarget){if(!c.current&&!os(a))return}else if(!ls(a))return}let u=rs(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,ea(aa,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,ea(aa,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=yr(r)&&r.hasAttribute(Uc(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=No(fi(t));!r&&n===t||Z(a.current.floatingContext?.refs.floating.current,n)||Z(t,n)||o||rs(r??n,e.context.triggerElements)||e.setOpen(!1,ea(aa,i))})}}},[a,r,e,l]);return p.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var Nu=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Ga;restTimeout=new Ga;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Pu=new WeakMap;function Fu(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Pu.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Pu.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Iu(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Pu.get(n);a&&a!==e&&Fu(a),Fu(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Pu.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Lu(e){let t=e.context.dataRef.current,n=Vr(()=>t.hoverInteractionState??Nu.create()).current;return t.hoverInteractionState||=n,va(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ru(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=vl(),u=_l(),d=Lu(e),f=Ka(),m=Y(()=>Nc(c.current.openEvent?.type,d.interactedInside)),h=Y(()=>Pc(c.current.openEvent?.type)),g=Y(()=>{Fu(d)});X(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,g())},[a,d,g]),p.useEffect(()=>g,[g]),X(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&h()&&yr(s)&&o){let e=s,t=o,n=fi(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??Po(e,`[data-rootownerid]`)??n.body;return Iu(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,a,s,o,d,h,l,u,g]),p.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&ds(l.nodesRef.current,u).length>0)}function a(t){let n=jc(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,ea(ia,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=Fo(e);ss(t)?d.interactedInside=Po(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function p(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),g()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(rs(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&yr(o)&&ds(l.nodesRef.current,r,!1).some(e=>Z(e.context?.elements.floating,o))||(d.handler?d.handler(n):(g(),h()&&!m()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,ea(ia,n)),l.events.emit(`floating.closed`,n)})}let y=o;return zc(y&&Ua(y,`mouseenter`,p),y&&Ua(y,`mouseleave`,_),y&&Ua(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,h,m,g,d,l,u,f])}var zu={current:null};function Bu(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=zu,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:m,guardStaleOpen:h=!1}=t,{dataRef:g,events:_}=e.context,v=vl(l),y=Lu(e),b=p.useRef(!1),x=qa(i),S=qa(r),C=qa(o),w=qa(n),T=qa(m),E=qa(f),D=Y(()=>Nc(g.current.openEvent?.type,y.interactedInside)),O=Y(()=>T.current?.()!==!1),k=Y((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Z(t,n);if(!yr(r))return!1;let a=r;return i.hasMatchingElement(e=>Z(e,a))&&(!t||!Z(t,a))}),A=Y(()=>{y.handler&&=(fi(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=Y(()=>{Fu(y)});return u&&(y.handleCloseOptions=i?.__options),p.useEffect(()=>A,[A]),p.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===ia,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),p.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=jc(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,ea(ia,t)),v?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,ea(ia,t)),v?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!yr(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!_s(y.pointerType))return;let n=Mc(C.current),r=jc(S.current,`open`,y.pointerType),i=Fo(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(yr(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Z(t,i)){c=t;break}}yr(o)&&yr(s)&&!e.context.triggerElements.hasElement(o)&&Z(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&b.current,p=!l&&yr(c)&&yr(s)&&Z(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,ea(ia,t,c)):m||(r?y.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,ea(ia,t,c))}):g&&O()&&e.setOpen(!0,ea(ia,t,c)))}function o(n){if(D()){j();return}A();let r=fi(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=g.current.floatingContext??d?.();if(!rs(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:v,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n)}else y.pointerType===`touch`&&Z(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){Z(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let f=h?Ua(r,`mouseout`,l):void 0;return s?zc(Ua(r,`mousemove`,i,{once:!0}),Ua(r,`mouseenter`,i),Ua(r,`mouseleave`,o),f):zc(Ua(r,`mouseenter`,i),Ua(r,`mouseleave`,o),f)},[A,j,g,S,e,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,h]),p.useMemo(()=>{if(!n)return;function t(e){y.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!_s(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;Iu(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=Mc(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,ea(ia,n,r))}y.pointerType===`touch`?Za.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}function Vu(e){return Ao&&e.movementX===0&&e.movementY===0}function Hu(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Uu(e,t){return Hu(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Wu(e,t,n){return Hu(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Gu(e,t,n){return Hu(t,n?e===Ro:e===zo,e===Vo)}function Ku(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Hu(t,n?e===zo:e===Ro,e===Bo)}function qu(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=us(D),j=cs(O),M=qa(A),N=_l(),P=vl(S),F=p.useRef(f),I=p.useRef(o??-1),L=p.useRef(null),R=p.useRef(!0),z=Y(e=>{i(I.current===-1?null:I.current,e)}),B=p.useRef(!!D),ee=p.useRef(E),V=p.useRef(!1),te=p.useRef(!1),ne=p.useRef(null),H=qa(g),re=qa(E),U=qa(o),ie=qa(x),W=Sa(),G=Sa(),ae=Y(()=>{W.cancel();function e(e){d||(ne.current=Gc(e,{sync:V.current,preventScroll:!0}))}let t=n.current[I.current],r=te.current;t&&e(t),(V.current?e=>e():e=>W.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),de&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});X(()=>{k.current.orientation=_},[k,_]),X(()=>{E||(L.current=null),E&&f===`auto`||(F.current=f)},[E,f]),X(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(te.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),X(()=>{if(a){if(!E)V.current=!1;else if(D){if(r==null){if(V.current=!1,U.current!=null)return;if(B.current&&(I.current=-1,ae()),(!ee.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>G.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||Wu(L.current,v,u)||l?qs(n):Js(n),L.current=null,z())};t()}}else Ks(n.current,r)||(I.current=r,ae(),te.current=!1)}}},[a,E,D,r,U,l,n,v,u,z,ae,G]),X(()=>{if(!a||D||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=No(fi(O??t??null)),r=e.some(e=>e.context&&Z(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),X(()=>{ee.current=E,B.current=!!D});let oe=r!=null,se=Y(e=>{if(!re.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),ce=Y(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),le=Y(()=>qs(n,H.current)),ue=Y(t=>{if(R.current=!1,V.current=!0,t.which===229||!re.current&&t.currentTarget===M.current)return;if(l&&Ku(t.key,_,u,T)){Uu(t.key,ce())||ps(t),e.setOpen(!1,ea(da,t.nativeEvent));let n=C?.current??O;br(n)&&n.focus();return}r!=null&&r!==I.current&&!Ks(n.current,r)&&(I.current=r);let i=I.current,a=qs(n,g),o=Js(n,g);if(j||(t.key===`Home`&&(ps(t),I.current=a,z(t)),t.key===`End`&&(ps(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,_,c,u,g,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),_===`both`)return}if(Uu(t.key,_)){ps(t);let e=No(t.currentTarget.ownerDocument);if(E&&!d&&Z(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Z(t,e))){I.current=Wu(t.key,_,u)?a:o,z(t),r===I.current&&ae();return}let{index:l,wrapped:f}=Ys(n.current,i,{decrement:!Wu(t.key,_,u),loopFocus:c,allowEscape:s,disabledIndices:g,minIndex:a,maxIndex:o});f&&(V.current=!1),I.current=l,z(t)}}),de=p.useMemo(()=>({onFocus(e){V.current=!0,se(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Vu(e)||(V.current=!0,te.current=!1,m&&se(e))},onPointerLeave(e){if(!re.current||!R.current||e.pointerType===`touch`)return;V.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&ie.current&&(ne.current?.(),ne.current=null,I.current=-1,z(e),!d)){let e=M.current,t=No(fi(e));e&&Z(e,t)&&e.focus({preventScroll:!0})}}}),[se,re,M,m,n,z,ie,d]),fe=p.useMemo(()=>d&&E&&oe&&{"aria-activedescendant":`${b}-${r}`},[d,E,oe,b,r]),pe=p.useMemo(()=>({...j?{}:fe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!d){let n=Fo(t.nativeEvent);if(n&&!Z(M.current,n))return;ps(t);let r=ea(la,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&br(i)&&i.focus()}else ue(t)},onPointerMove(e){Vu(e)||(R.current=!0)}}),[fe,ue,M,j,e,E,d,O,C]),me=p.useMemo(()=>{function t(t){e.setOpen(!0,ea(da,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&hs(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&gs(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=Gu(n.key,ce(),u),o=Uu(n.key,r?_:v),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||os(n.currentTarget)))return ue(n);if(r||h||!i){if(s){let e=Uu(n.key,ce());L.current=l&&e?null:n.key}l?a&&(ps(n),r?(I.current=le(),z(n),d&&M.current?.focus()):t(n)):o&&(U.current!=null&&(I.current=U.current),ps(n),!r&&h?t(n):ue(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[ue,f,le,l,z,e,h,_,v,ce,u,U,d,M]),he=p.useMemo(()=>({...fe,...me}),[fe,me]);return p.useMemo(()=>a?{reference:he,floating:pe,item:de,trigger:me}:{},[a,he,pe,me,de])}function Ju(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=Y(s),f=e.useState(`open`),m=Ka(),h=p.useRef(``),g=p.useRef(u??i??-1),_=p.useRef(null),v=Y(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!$s(n)||n?.matches(`:disabled`)?!1:o==null||!Zs(Di,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let p=n.current;if(h.current.length>0&&e.key===` `&&(ps(e),d?.(!0)),h.current.length>0&&h.current[0]!==` `&&c(p,h.current)===-1&&e.key!==` `&&d?.(!1),p==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(ps(e),d?.(!0));let v=h.current===``;v&&(g.current=u??i??-1),p.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(l,()=>{h.current=``,g.current=_.current,d?.(!1)});let y=((v?u??i??-1:g.current)??0)+1,b=c(p,h.current,y);b===-1?e.key!==` `&&(h.current=``,d?.(!1)):(a?.(b,e),_.current=b)}),y=Y(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Z(r,n)||Z(i,n)||(m.clear(),h.current=``,g.current=_.current,d?.(!1))});X(()=>{(f||u===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,d?.(!1)))},[f,u,m,d]);let b=p.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return p.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Yu=.1,Xu=Yu*Yu,Q=.5;function Zu(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Qu(e,t,n,r,i,a,o,s,c,l){let u=!1;return Zu(e,t,n,r,i,a)&&(u=!u),Zu(e,t,i,a,o,s)&&(u=!u),Zu(e,t,o,s,c,l)&&(u=!u),Zu(e,t,c,l,n,r)&&(u=!u),u}function $u(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function ed(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function td(e={}){let{blockPointerEvents:t=!1}=e,n=new Ga,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Xu;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Fo(r),g=r.type===`mouseleave`,_=Z(u,h),v=Z(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&yr(r.relatedTarget)&&Z(u,r.relatedTarget))return;function y(){return!!(s&&ds(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=ed(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=ed(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=ed(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=ed(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!$u(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Q/2:Q*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Q+1,o=C||T?S.bottom-Q:S.top,s=C?T?S.bottom-Q:S.top:S.bottom-Q;M=Qu(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Q/2:Q*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Q,o=C||T?S.top+Q:S.bottom,s=C?T?S.top+Q:S.bottom:S.top+Q;M=Qu(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Q/2:Q*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Q+1,o=w||E?S.right-Q:S.left,s=w?E?S.right-Q:S.left:S.right-Q;M=Qu(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Q/2:Q*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Q,o=w||E?S.left+Q:S.right,s=w?E?S.left+Q:S.right:S.left+Q;M=Qu(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function nd(e,t,n){let{reference:r,floating:i}=e,a=js(t),o=Ms(t),s=As(o),c=Ds(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Os(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function rd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Es(t,e),p=Ws(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Gs(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Gs(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var id=50,ad=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:rd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=nd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<id&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=nd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},od=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Es(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ds(r),_=js(o),v=Ds(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Hs(o)]:Ps(o)),x=p!==`none`;!d&&x&&b.push(...Vs(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ns(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===js(t)||T.every(e=>js(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=js(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},sd=new Set([`left`,`top`]);async function cd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ds(n),s=Os(n),c=js(n)===`y`,l=sd.has(o)?-1:1,u=a&&c?-1:1,d=Es(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ld=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await cd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ud=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Es(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=js(i),p=ks(f),m=u[p],h=u[f],g=(e,t)=>Ts(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},dd=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Es(e,t),u={x:n,y:r},d=js(i),f=ks(d),p=u[f],m=u[d],h=Es(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=sd.has(Ds(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},fd=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Es(e,t),c=await i.detectOverflow(t,s),l=Ds(n),u=Os(n),d=js(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=ys(p-c[m],g),y=ys(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*bs(c.left,c.right):S=p-2*bs(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function pd(e){let t=Nr(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=br(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=xs(n)!==a||xs(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function md(e){return yr(e)?e:e.contextElement}function hd(e){let t=md(e);if(!br(t))return Cs(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=pd(t),o=(a?xs(n.width):n.width)/r,s=(a?xs(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var gd=Cs(0);function _d(e){let t=gr(e);return!jr()||!t.visualViewport?gd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vd(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===gr(e)}function yd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=md(e),o=Cs(1);t&&(r?yr(r)&&(o=hd(r)):o=hd(e));let s=vd(a,n,r)?_d(a):Cs(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=gr(a),t=yr(r)?gr(r):r,n=e,i=Rr(n);for(;i&&t!==n;){let e=hd(i),t=i.getBoundingClientRect(),r=Nr(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=gr(i),i=Rr(n)}}return Gs({width:u,height:d,x:c,y:l})}function bd(e,t){let n=Pr(e).scrollLeft;return t?t.left+n:yd(_r(e)).left+n}function xd(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-bd(e,n),y:n.top+t.scrollTop}}function Sd(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=_r(r),s=t?wr(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Cs(1),u=Cs(0),d=br(r);if((d||!a)&&((hr(r)!==`body`||Sr(o))&&(c=Pr(r)),d)){let e=yd(r);l=hd(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?xd(o,c):Cs(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Cd(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function wd(e){let t=Pr(e),n=e.ownerDocument.body,r=bs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=bs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+bd(e),o=-t.scrollTop;return Nr(n).direction===`rtl`&&(a+=bs(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Td=25;function Ed(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=gr(e),a=_r(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!jr()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(bd(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Td&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Dd(e,t){let n=yd(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=hd(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Od(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ed(e,n,t);else if(t===`document`)r=wd(_r(e));else if(yr(t))r=Dd(t,n);else{let n=_d(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Gs(r)}function kd(e,t){let n=t.get(e);if(n)return n;let r=Lr(e,[],!1).filter(e=>yr(e)&&hr(e)!==`body`),i=null,a=Nr(e).position===`fixed`,o=a?Fr(e):e;for(;yr(o)&&!Mr(o);){let e=Nr(o),t=kr(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Fr(o)}return t.set(e,r),r}function Ad(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?wr(t)?[]:kd(t,this._c):[].concat(n),r],o=Od(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Od(t,a[e],i);s=bs(n.top,s),c=ys(n.right,c),l=ys(n.bottom,l),u=bs(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function jd(e){let{width:t,height:n}=pd(e);return{width:t,height:n}}function Md(e,t,n){let r=br(t),i=_r(t),a=n===`fixed`,o=yd(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Cs(0);if((r||!a)&&((hr(t)!==`body`||Sr(i))&&(s=Pr(t)),r)){let e=yd(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=bd(i));let l=i&&!r&&!a?xd(i,s):Cs(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Nd(e){return Nr(e).position===`static`}function Pd(e,t){if(!br(e)||Nr(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return _r(e)===n&&(n=n.ownerDocument.body),n}function Fd(e,t){let n=gr(e);if(wr(e))return n;if(!br(e)){let t=Fr(e);for(;t&&!Mr(t);){if(yr(t)&&!Nd(t))return t;t=Fr(t)}return n}let r=Pd(e,t);for(;r&&Cr(r)&&Nd(r);)r=Pd(r,t);return r&&Mr(r)&&Nd(r)&&!kr(r)?n:r||Ar(e)||n}var Id=async function(e){let t=this.getOffsetParent||Fd,n=this.getDimensions,r=await n(e.floating);return{reference:Md(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ld(e){return Nr(e).direction===`rtl`}var Rd={convertOffsetParentRelativeRectToViewportRelativeRect:Sd,getDocumentElement:_r,getClippingRect:Ad,getOffsetParent:Fd,getElementRects:Id,getClientRects:Cd,getDimensions:jd,getScale:hd,isElement:yr,isRTL:Ld};function zd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bd(e,t,n){let r=null,i,a=_r(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ss(d),h=Ss(a.clientWidth-(u+f)),g=Ss(a.clientHeight-(d+p)),_=Ss(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:bs(0,ys(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!zd(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=gr(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Vd(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=md(e),u=i||a?[...l?Lr(l):[],...t?Lr(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Bd(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?yd(e):null;c&&g();function g(){let t=yd(e);h&&!zd(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Hd=ld,Ud=ud,Wd=od,Gd=fd,Kd=dd,qd=(e,t,n)=>{let r=new Map,i=n??{},a={...Rd,...i.platform,_c:r};return ad(e,t,{...i,platform:a})},Jd=typeof document<`u`?p.useLayoutEffect:function(){};function Yd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Yd(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Yd(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Xd(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zd(e,t){let n=Xd(e);return Math.round(t*n)/n}function Qd(e){let t=p.useRef(e);return Jd(()=>{t.current=e}),t}function $d(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=p.useState(r);Yd(f,r)||m(r);let[h,g]=p.useState(null),[_,v]=p.useState(null),y=p.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=p.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=p.useRef(null),w=p.useRef(null),T=p.useRef(u),E=c!=null,D=Qd(c),O=Qd(i),k=Qd(l),A=p.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),qd(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Yd(T.current,t)&&(T.current=t,Za.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Jd(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=p.useRef(!1);Jd(()=>(j.current=!0,()=>{j.current=!1}),[]),Jd(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=p.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=p.useMemo(()=>({reference:x,floating:S}),[x,S]),P=p.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Zd(N.floating,u.x),r=Zd(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Xd(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var ef=(e,t)=>{let n=Hd(e);return{name:n.name,fn:n.fn,options:[e,t]}},tf=(e,t)=>{let n=Ud(e);return{name:n.name,fn:n.fn,options:[e,t]}},nf=(e,t)=>({fn:Kd(e).fn,options:[e,t]}),rf=(e,t)=>{let n=Wd(e);return{name:n.name,fn:n.fn,options:[e,t]}},af=(e,t)=>{let n=Gd(e);return{name:n.name,fn:n.fn,options:[e,t]}},of=p.createContext(void 0);function sf(){let e=p.useContext(of);if(e===void 0)throw Error(ci(26));return e}var cf=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),lf=`--nested-dialogs`,uf=`data-nested-dialog-open`,df={...es,...ja,nestedDialogOpen(e){return e?{[uf]:``}:null}},ff=p.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Ec(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),h=c.useState(`mounted`),g=c.useState(`nested`),_=c.useState(`nestedOpenDialogCount`),v=c.useState(`open`),y=c.useState(`openMethod`),b=c.useState(`titleElementId`),x=c.useState(`transitionStatus`),S=c.useState(`role`),C=d.useState(`floatingId`);sf(),to({open:v,ref:c.context.popupRef,onComplete(){v&&c.context.onOpenChangeComplete?.(!0)}});let w=o===void 0?Vl(c.context.popupRef):o,T=_>0,E=c.useStateSetter(`popupElement`),D=Mi(`div`,e,{state:{open:v,nested:g,transitionStatus:x,nestedDialogOpen:T},props:[f,{id:C,"aria-labelledby":b,"aria-describedby":l,role:S,...Bl,hidden:!h,onKeyDown(e){cf.has(e.key)&&e.stopPropagation()},style:{[lf]:_}},s],ref:[t,c.context.popupRef,E],stateAttributesMapping:df});return(0,m.jsx)(Al,{context:d,openInteractionType:y,disabled:!h,closeOnFocusOut:!u,initialFocus:w,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:D})});function pf(e){return wi(19)?e:e?`true`:void 0}var mf=p.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,m.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),hf=p.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Ec(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,m.jsx)(of.Provider,{value:n,children:(0,m.jsxs)(fl,{ref:t,...r,children:[a&&o===!0&&(0,m.jsx)(mf,{ref:i.context.internalBackdropRef,inert:pf(!s)}),e.children]})}):null}),gf={},_f={},vf=``;function yf(e,t){return Sr(e)?e:t}function bf(e,t,n){return/hidden|clip/.test(e.getComputedStyle(yf(t,n)).overflowY)}function xf(e){if(typeof document>`u`)return!1;let t=fi(e);return gr(t).innerWidth-t.documentElement.clientWidth>0}function Sf(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=fi(e),n=t.documentElement,r=t.body,i=yf(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Cf(e){let t=fi(e),n=t.documentElement,r=t.body,i=yf(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function wf(e){let t=fi(e),n=t.documentElement,r=t.body,i=gr(n),a=0,o=0,s=!1,c=xa.create();if(Ao&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,gf={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},vf=n.style.scrollBehavior,_f={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=yf(n,r);s=Sf(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,gf),Object.assign(r.style,_f),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=vf)}function d(){u(),c.request(l)}l();let f=Ua(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Tf=new class{lockCount=0;restore=null;timeoutLock=Ga.create();timeoutUnlock=Ga.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=fi(e),n=t.documentElement,r=t.body,i=gr(n);if(bf(i,n,r)){let t=new i.MutationObserver(()=>{bf(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=To||!xf(e);this.restore=a?Cf(e):wf(e)}};function Ef(e=!0,t=null){X(()=>{if(e)return Tf.acquire(t)},[e,t])}function Df({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=p.useState(0),[d,f]=p.useState(0),m=l===0,h=Ll(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Fo(t);if(m&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Z(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return Ef(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),X(()=>{!r&&!i&&(u(0),f(0))},[r,i]),X(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),Ql(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var Of={...ku,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},kf=class extends bu{constructor(e,t,n){let r=new eu,i=Af(e,r,t,n);super(i,jf(r),Of)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(Kl(this.state,e,t.trigger)))}};function Af(e,t,n,r=!1){return{...Cu(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 jf(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Mf(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,h=e===`drawer`,g=e===`alert-dialog`,_=g?!0:c,v=g||s,y=g?`alertdialog`:`dialog`,b=Ec(!0),x={modal:_,disablePointerDismissal:v,nested:b!=null,role:y},S=Hl((e,t)=>new kf({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...x},e,t),!0);S.useControlledProp(`openProp`,r),S.useControlledProp(`triggerIdProp`,d),S.useSyncedValues(x),S.useContextCallback(`onOpenChange`,a),S.useContextCallback(`onOpenChangeComplete`,o);let C=S.useState(`open`),w=S.useState(`mounted`),T=S.useState(`payload`);$l(S,C),Xl(S);let{forceUnmount:E}=Zl(C,S);p.useImperativeHandle(l,()=>({unmount:E,close:()=>S.setOpen(!1,ea(_a))}),[E,S]);let D=C||w||u!=null;return(0,m.jsxs)(Tc.Provider,{value:S,children:[u&&(0,m.jsx)(Ul,{handle:u,store:S}),D&&(0,m.jsx)(Df,{store:S,parentContext:b?.context,isDrawer:h}),typeof n==`function`?n({payload:T}):n]})}var Nf=lu(function(e){return Mf(`dialog`,e)}),Pf=p.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Ec(),c=$i(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Mi(`h2`,e,{ref:t,props:[{id:c},o]})});function Ff(e){let t=p.useRef(``),n=p.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:p.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function If(e,t){let{onClick:n,onPointerDown:r}=Ff(Y((n,r)=>{(typeof e==`function`?e():e)||t(r||(To?`touch`:``))}));return p.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Lf(e){let[t,n]=p.useState(null),r=If(e,n);return Cc(e,t=>{t&&!e&&n(null)}),p.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Rf({...e}){return(0,m.jsx)(Nf,{"data-slot":`sheet`,...e})}function zf({...e}){return(0,m.jsx)(hf,{"data-slot":`sheet-portal`,...e})}function Bf({className:e,...t}){return(0,m.jsx)(Dc,{"data-slot":`sheet-overlay`,className:J(`fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function Vf({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,m.jsxs)(zf,{children:[(0,m.jsx)(Bf,{}),(0,m.jsxs)(ff,{"data-slot":`sheet-content`,"data-side":n,className:J(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,m.jsxs)(Oc,{"data-slot":`sheet-close`,render:(0,m.jsx)(Wi,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,m.jsx)(ht,{}),(0,m.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Hf({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sheet-header`,className:J(`flex flex-col gap-1.5 p-4`,e),...t})}function Uf({className:e,...t}){return(0,m.jsx)(Pf,{"data-slot":`sheet-title`,className:J(`cn-font-heading font-medium text-foreground`,e),...t})}function Wf({className:e,...t}){return(0,m.jsx)(kc,{"data-slot":`sheet-description`,className:J(`text-sm text-muted-foreground`,e),...t})}function Gf({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`skeleton`,className:J(`animate-pulse rounded-md bg-muted`,e),...t})}var Kf=p.createContext(void 0);function qf(e){let t=p.useContext(Kf);if(t===void 0&&!e)throw Error(ci(72));return t}var Jf={...ku,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Yf=class extends bu{constructor(e,t,n){let r=new eu;super(Xf(e,r,t,n),Zf(r),Jf)}setOpen=(e,t)=>{Jl(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,ea(ra,e))}};function Xf(e,t,n,r=!1){return{...Cu(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 Zf(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Qf=lu(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,h=Hl((e,t)=>new Yf({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));h.useControlledProp(`openProp`,r),h.useControlledProp(`triggerIdProp`,u),h.useContextCallback(`onOpenChange`,s),h.useContextCallback(`onOpenChangeComplete`,c);let g=h.useState(`open`),_=!t&&g,v=h.useState(`activeTriggerId`),y=h.useState(`mounted`),b=h.useState(`payload`);h.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Xl(h,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:x,transitionStatus:S}=Zl(_,h),C=h.useState(`isInstantPhase`),w=h.useState(`instantType`),T=h.useState(`lastOpenChangeReason`),E=p.useRef(null);X(()=>{g&&t&&h.setOpen(!1,ea(ga))},[g,t,h]),X(()=>{S===`ending`&&T===`none`||S!==`ending`&&C?(w!==`delay`&&(E.current=w),h.set(`instantType`,`delay`)):E.current!==null&&(h.set(`instantType`,E.current),E.current=null)},[S,C,T,w,h]),X(()=>{_&&(v??h.set(`payload`,void 0))},[h,v,_]),p.useImperativeHandle(o,()=>({unmount:x,close:()=>h.setOpen(!1,ea(_a))}),[x,h]);let D=_||y||!t&&a!==`none`;return(0,m.jsxs)(Kf.Provider,{value:h,children:[l&&(0,m.jsx)(Ul,{handle:l,store:h}),D&&(0,m.jsx)($f,{store:h,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:b}):f]})});function $f({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Ll(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Pl(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=p.useMemo(()=>Jr(a.reference,i.reference),[a.reference,i.reference]);return Ql(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??Oi}),null}var ep=p.createContext(void 0);function tp(){return p.useContext(ep)}var np=`data-base-ui-tooltip-trigger`;function rp(e){let t=Fo(e);return yr(t)?t:null}var ip=uu(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,m=qf(!0),h=Au(a)??m;if(!h)throw Error(ci(82));let g=$i(d),_=h.useState(`isTriggerActive`,g),v=h.useState(`isOpenedByTrigger`,g),y=h.useState(`floatingRootContext`),b=p.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=Yl(g,b,h,{payload:o,closeOnClick:l,closeDelay:x}),w=tp(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=Rc(y,{open:v}),k=Lu(y);h.useSyncedValue(`isInstantPhase`,D);let A=h.useState(`disabled`),j=s??A,M=qa(j),N=h.useState(`trackCursorAxis`),P=h.useState(`disableHoverablePopup`),F=p.useRef(!1),I=Ka(),L=p.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=b.current;if(!t||!e)return!1;let n=Po(e,`[${np}]`);return n!==null&&n!==t&&Z(t,n)}function B(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let ee=Bu(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?td():null,restMs:R,delay(){return u==null&&O?{close:jc(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),V=Mu(y,{enabled:!j}).reference,te=e=>{let t=F.current,n=rp(e),r=B(n),i=b.current,a=i&&n&&Z(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`)h.setOpen(!1,ea(ia,e));else if(t&&!r&&a&&!M.current&&!h.select(`open`)&&i&&_s(L.current)){let t=()=>{F.current||M.current||h.select(`open`)||h.setOpen(!0,ea(ia,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ne=h.useState(`appliedTriggerProps`,C||N!==`none`);return Mi(`button`,e,{state:{open:v},ref:[t,S,b],props:[ee,V,ne,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){z(rp(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,h.set(`closeOnClick`,l),l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},id:g,[ns]:j?``:void 0,[np]:j?void 0:``},f],stateAttributesMapping:Qo})}),ap=p.createContext(void 0);function op(){let e=p.useContext(ap);if(e===void 0)throw Error(ci(70));return e}var sp=p.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=dl({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,m.jsxs)(p.Fragment,{children:[l,c&&Za.createPortal(n,c)]})}),cp=p.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return qf().useState(`mounted`)||n?(0,m.jsx)(ap.Provider,{value:n,children:(0,m.jsx)(sp,{ref:t,...r})}):null}),lp=p.createContext(void 0);function up(){let e=p.useContext(lp);if(e===void 0)throw Error(ci(71));return e}function dp(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=p.useState(null),d=p.useRef(null),f=vl(n),m=p.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),h=$d({...e,elements:{...m,...l&&{reference:l}}}),g=p.useCallback(e=>{let t=yr(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=p.useMemo(()=>({...h.refs,setPositionReference:g,domReference:d}),[h.refs,g]),v=p.useMemo(()=>({...h.elements,domReference:o}),[h.elements,o]),y=p.useMemo(()=>({...h,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:_,elements:v,nodeId:t,rootStore:r}),[h,_,v,t,r,s,c]);return X(()=>{o&&(d.current=o)},[o]),X(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),p.useMemo(()=>({...h,context:y,refs:_,elements:v,rootStore:r}),[h,_,v,y,r])}var fp=p.createContext(void 0);function pp(){return p.useContext(fp)?.direction??`ltr`}var mp=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Es(e,t)||{};if(l==null)return{};let d=Ws(u),f={x:n,y:r},p=Ms(i),m=As(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=Ts(D,k,O),j=!c.arrow&&Os(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),hp=(e,t)=>{let{name:n,fn:r}=mp(e);return{name:n,fn:r,options:[e,t]}},gp={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},_p={sideX:`left`,sideY:`top`},vp=`--available-width`,yp=`--available-height`,bp=`--anchor-width`,xp=`--anchor-height`,Sp=`--transform-origin`,Cp=vp,wp=yp;function Tp(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Ep(e,t,n){let{rects:r,placement:i}=e;return{side:Tp(t,Ds(i),n),align:Os(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Dp(e){return Op(e,dp)}function Op(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=Y(k),j=k?A:n,M=qa(n),N=qa(_),P=pp()===`rtl`,[F,I]=p.useState(null);!_&&F!==null&&I(null);let L=S===`placement`,R=F?Ds(F):null,z=F&&L?Os(F)||`center`:null,B=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],ee=z||o,V=ee===`center`?B:`${B}-${ee}`,te=l;typeof te==`number`?te={top:te,right:te,bottom:te,left:te}:te&&={top:te.top||0,right:te.right||0,bottom:te.bottom||0,left:te.left||0};let ne=+(i===`bottom`),H=+(i===`top`),re=+(i===`right`),U=+(i===`left`),ie={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:te},W=p.useRef(null),G=qa(a),ae=qa(s),oe=typeof a==`function`?0:a,se=typeof s==`function`?0:s,ce=[];m&&ce.push(m),ce.push(ef(e=>{let t=Ep(e,i,P),n=typeof G.current==`function`?G.current(t):G.current,r=typeof ae.current==`function`?ae.current(t):ae.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[oe,se,P,i]));let le=T===`none`&&w!==`shift`,ue=!le&&(u||D||w===`shift`),de=w===`none`?null:rf({...ie,padding:{top:te.top+1+ne,right:te.right+1+U,bottom:te.bottom+1+H,left:te.left+1+re},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),fe=le?null:tf({...ie,rootBoundary:O,mainAxis:T!==`none`,crossAxis:ue,limiter:u||D?void 0:nf(e=>{if(!W.current)return{};let{width:t,height:n}=W.current.getBoundingClientRect(),r=js(Ds(e.placement)),i=r===`y`?t:n,a=r===`y`?te.left+te.right:te.top+te.bottom;return{offset:i/2+a/2}})},[ie,u,D,O,te,T]);w===`shift`||T===`shift`||ee===`center`?ce.push(fe,de):ce.push(de,fe),ce.push(af({...ie,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(Cp,`${t}px`),i.setProperty(wp,`${n}px`);let a=gr(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(bp,`${u}px`),i.setProperty(xp,`${d}px`)}}),hp(e=>({element:W.current||fi(e.elements.floating).createElement(`div`),padding:W.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Ds(r),u=Os(r),d=js(l)===`y`,f=W.current,p=typeof a==`function`?a(Ep(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ue&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Sp,d?`${m} ${h}`:`${h} ${m}`),{}}},gp,x),X(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let pe=p.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:g,open:h?_:void 0,placement:V,middleware:ce,strategy:r,whileElementsMounted:h?void 0:(...e)=>Vd(...e,pe),nodeId:b,externalTree:C}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||_p,Ee=Se?r:`fixed`,De=p.useMemo(()=>{let e;return e=Se?x?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[Cp]=`100vw`,e[wp]=`100vh`,Se||(e.opacity=0),e},[x,Ee,we,ge,Te,_e,Ce,Se]),Oe=p.useRef(null);X(()=>{if(!_)return;let e=M.current,t=typeof e==`function`?e():e,n=(kp(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[_,me,j,M]),p.useEffect(()=>{if(!_)return;let e=M.current;typeof e!=`function`&&kp(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[_,me,j,M]),p.useEffect(()=>{if(h&&_&&he.reference&&he.floating)return Vd(he.reference,he.floating,ye,pe)},[h,_,he,ye,pe]);let ke=Ds(be),Ae=Tp(i,ke,P),je=Os(be)||`center`,Me=!!ve.hide?.referenceHidden;X(()=>{S&&_&&Se&&(ke!==B||L&&je!==ee)&&I(be)},[S,L,_,Se,be,ke,je,B,ee]);let Ne=p.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),Pe=ve.arrow?.centerOffset!==0;return p.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:W,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Ne,W,Pe,Ae,je,ke,Me,me,xe,Se,ye])}function kp(e){return e!=null&&`current`in e}function Ap(e){return e===`starting`?rl:Oi}function jp(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Mi(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Ap(r),i],stateAttributesMapping:es})}var Mp=p.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=ol,style:v,...y}=e,b=qf(),x=op(),S=b.useState(`open`),C=b.useState(`mounted`),w=b.useState(`trackCursorAxis`),T=b.useState(`disableHoverablePopup`),E=b.useState(`floatingRootContext`),D=b.useState(`instantType`),O=b.useState(`transitionStatus`),k=Dp({anchor:i,positionMethod:a,floatingRootContext:E,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:h,arrowPadding:f,disableAnchorTracking:g,keepMounted:x,collisionAvoidance:_,adaptiveOrigin:b.useState(`adaptiveOrigin`)}),A=jp(e,p.useMemo(()=>({open:S,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:w===`none`?D:`tracking-cursor`}),[S,k.side,k.align,k.anchorHidden,w,D]),{styles:k.positionerStyles,transitionStatus:O,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!C,inert:!S||w===`both`||T});return(0,m.jsx)(lp.Provider,{value:k,children:A})}),Np=p.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=qf(),{side:s,align:c}=up(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);to({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Ru(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Mi(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Bl,f,Ap(d),a],stateAttributesMapping:ts})}),Pp=p.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=qf(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=up();return Mi(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:es})}),Fp=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=p.useMemo(()=>({open:t,close:n}),[t,n]);return(0,m.jsx)(ep.Provider,{value:t,children:(0,m.jsx)(Lc,{delay:i,timeoutMs:r,children:e.children})})};function Ip({delay:e=0,...t}){return(0,m.jsx)(Fp,{"data-slot":`tooltip-provider`,delay:e,...t})}function Lp({...e}){return(0,m.jsx)(Qf,{"data-slot":`tooltip`,...e})}function Rp({...e}){return(0,m.jsx)(ip,{"data-slot":`tooltip-trigger`,...e})}function zp({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,m.jsx)(cp,{children:(0,m.jsx)(Mp,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,m.jsxs)(Np,{"data-slot":`tooltip-content`,className:J(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,m.jsx)(Pp,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var Bp=`sidebar_state`,Vp=604800,Hp=`16rem`,Up=`18rem`,Wp=`3rem`,Gp=`b`,Kp=p.createContext(null);function qp(){let e=p.useContext(Kp);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Jp({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=vo(),[c,l]=p.useState(!1),[u,d]=p.useState(e),f=t??u,h=p.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${Bp}=${t}; path=/; max-age=${Vp}`},[n,f]),g=p.useCallback(()=>s?l(e=>!e):h(e=>!e),[s,h,l]);p.useEffect(()=>{let e=e=>{e.key===Gp&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),g())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g]);let _=f?`expanded`:`collapsed`,v=p.useMemo(()=>({state:_,open:f,setOpen:h,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:g}),[_,f,h,s,c,l,g]);return(0,m.jsx)(Kp.Provider,{value:v,children:(0,m.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":Hp,"--sidebar-width-icon":Wp,...i},className:J(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function Yp({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=qp();return n===`none`?(0,m.jsx)(`div`,{"data-slot":`sidebar`,className:J(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,m.jsx)(Rf,{open:l,onOpenChange:u,...o,children:(0,m.jsxs)(Vf,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":Up},side:e,children:[(0,m.jsxs)(Hf,{className:`sr-only`,children:[(0,m.jsx)(Uf,{children:`Sidebar`}),(0,m.jsx)(Wf,{children:`Displays the mobile sidebar.`})]}),(0,m.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,m.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,m.jsx)(`div`,{"data-slot":`sidebar-gap`,className:J(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,m.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:J(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,m.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function Xp({className:e,onClick:t,...n}){let{toggleSidebar:r}=qp();return(0,m.jsxs)(Wi,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:J(e),onClick:e=>{t?.(e),r()},...n,children:[(0,m.jsx)(gt,{className:`cn-rtl-flip`}),(0,m.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function Zp({className:e,...t}){return(0,m.jsx)(`main`,{"data-slot":`sidebar-inset`,className:J(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function Qp({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:J(`flex flex-col gap-2 p-2`,e),...t})}function $p({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:J(`flex flex-col gap-2 p-2`,e),...t})}function em({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:J(`no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function tm({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:J(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function nm({className:e,render:t,...n}){return go({defaultTagName:`div`,props:Jr({className:J(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,e)},n),render:t,state:{slot:`sidebar-group-label`,sidebar:`group-label`}})}function rm({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:J(`w-full text-sm`,e),...t})}function im({className:e,...t}){return(0,m.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:J(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function am({className:e,...t}){return(0,m.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:J(`group/menu-item relative`,e),...t})}var om=Hi(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function sm({render:e,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let{isMobile:s,state:c}=qp(),l=go({defaultTagName:`button`,props:Jr({className:J(om({variant:n,size:r}),a)},o),render:i?(0,m.jsx)(Rp,{render:e}):e,state:{slot:`sidebar-menu-button`,sidebar:`menu-button`,size:r,active:t}});return i?(typeof i==`string`&&(i={children:i}),(0,m.jsxs)(Lp,{children:[l,(0,m.jsx)(zp,{side:`right`,align:`center`,hidden:c!==`collapsed`||s,...i})]})):l}function cm({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:J(`pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground`,e),...t})}function lm(e){return typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)&&!/[\u0000-\u001f\u007f]/.test(e)}function um(e){return typeof e==`object`&&e?e:void 0}function dm(e){return typeof e==`string`&&e.trim()!==``?e:void 0}function fm(e){let t=um(e)??{},n={},r=um(t.switcher);r&&lm(r.endpoint)&&typeof r.others==`number`&&r.others>0&&(n.switcher={endpoint:r.endpoint,others:r.others});let i=um(t.search);i&&lm(i.endpoint)?n.search={endpoint:i.endpoint}:n.switcher&&(n.search={endpoint:`${n.switcher.endpoint}/search`});let a=um(t.viewer),o=dm(a?.label);if(a&&o){let e=dm(a.email),t=dm(a.role);n.viewer={label:o,...e?{email:e}:{},...t?{role:t}:{}}}let s=um(t.signOut);if(s&&lm(s.action)){let e=dm(s.csrfToken);n.signOut={action:s.action,...e?{csrfToken:e}:{}}}else s&&lm(s.href)&&(n.signOut={href:s.href});return n}function pm(e){if(typeof document>`u`)return{};let t=document.getElementById(e);if(t===null)return{};try{return fm(JSON.parse(t.textContent??``))}catch{return{}}}function mm(e){return typeof e==`object`&&e?e:void 0}function hm(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=mm(n);e&&typeof e.id==`string`&&typeof e.title==`string`&&lm(e.href)&&t.push({id:e.id,title:e.title,...typeof e.package==`string`?{package:e.package}:{},icon:Nt(e.icon),href:e.href})}return t}function gm(e){let t=mm(e),n=Array.isArray(t?.results)?t.results:Array.isArray(t?.groups)?t.groups:[],r=[];for(let e of n){let t=mm(e);if(!t||typeof t.id!=`string`||typeof t.title!=`string`||!Array.isArray(t.hits))continue;let n=[];for(let e of t.hits){let t=mm(e);t&&typeof t.title==`string`&&lm(t.href)&&n.push({title:t.title,...typeof t.subtitle==`string`?{subtitle:t.subtitle}:{},href:t.href})}n.length>0&&r.push({id:t.id,title:t.title,icon:Nt(t.icon),hits:n})}return r}async function _m(e,t){let n=await fetch(e,{headers:{accept:`application/json`},credentials:`same-origin`,...t?{signal:t}:{}});if(!n.ok)throw Error(`HTTP ${n.status}`);return n.json()}var vm;function ym(e){if(vm?.endpoint===e.endpoint)return vm.result;let t=_m(e.endpoint).then(e=>hm(mm(e)?.consoles)).catch(()=>[]);return vm={endpoint:e.endpoint,result:t},t}async function bm(e,t,n){return gm(await _m(`${e.endpoint}?q=${encodeURIComponent(t)}`,n))}var xm=1,Sm=.9,Cm=.8,wm=.17,Tm=.1,Em=.999,Dm=.9999,Om=.99,km=/[\\\/_+.#"@\[\(\{&]/,Am=/[\\\/_+.#"@\[\(\{&]/g,jm=/[\s-]/,Mm=/[\s-]/g;function Nm(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?xm:Om;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Nm(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=xm:km.test(e.charAt(l-1))?(d*=Cm,p=e.slice(i,l-1).match(Am),p&&i>0&&(d*=Em**+p.length)):jm.test(e.charAt(l-1))?(d*=Sm,m=e.slice(i,l-1).match(Mm),m&&i>0&&(d*=Em**+m.length)):(d*=wm,i>0&&(d*=Em**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Dm)),(d<Tm&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Nm(e,t,n,r,l+1,a+2,o),f*Tm>d&&(d=f*Tm)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Pm(e){return e.toLowerCase().replace(Mm,` `)}function Fm(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Nm(e,t,Pm(e),Pm(t),0,0,{})}var Im=Object.defineProperty,Lm=(e,t)=>Im(e,`name`,{value:t,configurable:!0}),Rm=!!(typeof window<`u`&&window.document&&window.document.createElement);function zm(e,t,{checkForDefaultPrevented:n=!0}={}){return Lm(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Lm(zm,`composeEventHandlers`);function Bm(e){if(!Rm)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Lm(Bm,`getOwnerWindow`);function Vm(e){if(!Rm)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Lm(Vm,`getOwnerDocument`);function Hm(e,t=!1){let{activeElement:n}=Vm(e);if(!n?.nodeName)return null;if(Um(n)&&n.contentDocument)return Hm(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Vm(n).getElementById(e);if(t)return t}}return n}Lm(Hm,`getActiveElement`);function Um(e){return e.tagName===`IFRAME`}Lm(Um,`isFrame`);var Wm=Object.defineProperty,Gm=(e,t)=>Wm(e,`name`,{value:t,configurable:!0});function Km(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Gm(Km,`setRef`);function qm(...e){return t=>{let n=!1,r=e.map(e=>{let r=Km(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Km(e[t],null)}}}}Gm(qm,`composeRefs`);function Jm(...e){return p.useCallback(qm(...e),e)}Gm(Jm,`useComposedRefs`);var Ym=Object.defineProperty,Xm=(e,t)=>Ym(e,`name`,{value:t,configurable:!0});function Zm(e,t){let n=p.createContext(t);n.displayName=e+`Context`;let r=Xm(e=>{let{children:t,...r}=e,i=p.useMemo(()=>r,Object.values(r));return(0,m.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=p.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Xm(i,`useContext`),[r,i]}Xm(Zm,`createContext`);function Qm(e,t=[]){let n=[];function r(t,r){let i=p.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Xm(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=p.useMemo(()=>o,Object.values(o));return(0,m.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=p.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Xm(s,`useContext`),[o,s]}Xm(r,`createContext`);let i=Xm(()=>{let t=n.map(e=>p.createContext(e));return Xm(function(n){let r=n?.[e]||t;return p.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,$m(i,...t)]}Xm(Qm,`createContextScope`);function $m(...e){let t=e[0];if(e.length===1)return t;let n=Xm(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Xm(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Xm($m,`composeContextScopes`);var eh=globalThis?.document?p.useLayoutEffect:()=>{},th=Object.defineProperty,nh=(e,t)=>th(e,`name`,{value:t,configurable:!0}),rh=p.useId||(()=>void 0),ih=0;function ah(e){let[t,n]=p.useState(rh());return eh(()=>{e||n(e=>e??String(ih++))},[e]),e||(t?`radix-${t}`:``)}nh(ah,`useId`);var oh=Object.defineProperty,sh=(e,t)=>oh(e,`name`,{value:t,configurable:!0}),ch=p.useEffectEvent,lh=p.useInsertionEffect;function uh(e){if(typeof ch==`function`)return ch(e);let t=p.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof lh==`function`?lh(()=>{t.current=e}):eh(()=>{t.current=e}),p.useMemo(()=>((...e)=>t.current?.(...e)),[])}sh(uh,`useEffectEvent`);var dh=Object.defineProperty,fh=(e,t)=>dh(e,`name`,{value:t,configurable:!0}),ph=p.useInsertionEffect||eh;function mh({prop:e,defaultProp:t,onChange:n=fh(()=>{},`onChange`),caller:r}){let[i,a,o]=hh({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,p.useCallback(t=>{if(s){let n=gh(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}fh(mh,`useControllableState`);function hh({defaultProp:e,onChange:t}){let[n,r]=p.useState(e),i=p.useRef(n),a=p.useRef(t);return ph(()=>{a.current=t},[t]),p.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}fh(hh,`useUncontrolledState`);function gh(e){return typeof e==`function`}fh(gh,`isFunction`);var _h=Symbol(`RADIX:SYNC_STATE`);function vh(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=uh(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=p.useReducer((t,n)=>{if(n.type===_h)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),m=d.state,h=p.useRef(m);p.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=p.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return p.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:_h,state:i})},[i,d.state,c]),[g,f]}fh(vh,`useControllableStateReducer`);var yh=Object.defineProperty,bh=(e,t)=>yh(e,`name`,{value:t,configurable:!0});function xh(e){let t=p.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=jh(r),p.Children.forEach(r,e=>{if(Dh(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;kh(n)&&typeof Fh==`function`;)n=Fh(n._payload);a=wh(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=p.cloneElement(a,void 0,s):!o&&p.Children.count(r)===1&&p.isValidElement(r)&&(a=r);let c=a?Eh(a):void 0,l=Jm(n,c);if(!a){if(r||r===0)throw Error(o?Ph(e):Nh(e));return r}let u=Th(i,a.props??{});return a.type!==p.Fragment&&(u.ref=n?l:c),p.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}bh(xh,`createSlot`);var Sh=Symbol.for(`radix.slottable`);function Ch(e){let t=bh(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Sh,t}bh(Ch,`createSlottable`);var wh=bh((e,t)=>`child`in e.props?p.isValidElement(t)?p.cloneElement(t,void 0,e.props.children(t.props.children)):null:p.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function Th(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Mh(a,i))}return{...e,...n}}bh(Th,`mergeProps`);function Eh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}bh(Eh,`getElementRef`);function Dh(e){return p.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Sh}bh(Dh,`isSlottable`);var Oh=Symbol.for(`react.lazy`);function kh(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Oh&&`_payload`in e&&Ah(e._payload)}bh(kh,`isLazyComponent`);function Ah(e){return typeof e==`object`&&!!e&&`then`in e}bh(Ah,`isPromiseLike`);function jh(e){let t=e;for(;kh(t)&&typeof Fh==`function`;)t=Fh(t._payload);return t}bh(jh,`useUnwrappedLazy`);function Mh(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}bh(Mh,`concatAriaDescribedby`);var Nh=bh(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ph=bh(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Fh=p.use,Ih=Object.defineProperty,Lh=(e,t)=>Ih(e,`name`,{value:t,configurable:!0}),Rh=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=xh(`Primitive.${t}`),r=p.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,m.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zh(e,t){e&&Za.flushSync(()=>e.dispatchEvent(t))}Lh(zh,`dispatchDiscreteCustomEvent`);var Bh=Object.defineProperty,Vh=(e,t)=>Bh(e,`name`,{value:t,configurable:!0}),Hh=p.useInsertionEffect;function Uh(e){let t=p.useRef(e);return typeof Hh==`function`?Hh(()=>{t.current=e}):eh(()=>{t.current=e}),p.useMemo(()=>((...e)=>t.current?.(...e)),[])}Vh(Uh,`useCallbackRef`);var Wh=Object.defineProperty,Gh=(e,t)=>Wh(e,`name`,{value:t,configurable:!0}),Kh=`dismissableLayer.update`,qh=`dismissableLayer.pointerDownOutside`,Jh=`dismissableLayer.focusOutside`,Yh,Xh=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Zh=p.forwardRef(Gh(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=p.useContext(Xh),[d,f]=p.useState(null),h=d?.ownerDocument??globalThis?.document,[,g]=p.useState({}),_=Jm(t,f),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?v.indexOf(y):-1,x=d?v.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,w=p.useRef(!1),T=eg(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:h,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return C&&!t},[u.branches,C])}),E=tg(e=>{if(r&&w.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},h),D=d?x===v.length-1:!1,O=Uh(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return p.useEffect(()=>{if(D)return h.addEventListener(`keydown`,O,{capture:!0}),()=>h.removeEventListener(`keydown`,O,{capture:!0})},[h,D,O]),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Yh=h.body.style.pointerEvents,h.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ng(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=Yh))}},[d,h,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ng())},[d,u]),p.useEffect(()=>{let e=Gh(()=>g({}),`handleUpdate`);return document.addEventListener(Kh,e),()=>document.removeEventListener(Kh,e)},[]),(0,m.jsx)(Rh.div,{...l,ref:_,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:zm(e.onFocusCapture,E.onFocusCapture),onBlurCapture:zm(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:zm(e.onPointerDownCapture,T.onPointerDownCapture)})},`DismissableLayer`));function Qh(){let e=p.useContext(Xh),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Gh(Qh,`useDismissableLayerSurface`);var $h=Gh(()=>!0,`IS_TRUE`);function eg(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=$h}=t,s=Uh(e),c=p.useRef(!1),l=p.useRef(!1),u=p.useRef(new Map),d=p.useRef(()=>{});return p.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Gh(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Gh(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Gh(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Gh(p,`handleInteractionBubble`);let m=Gh(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||rg(qh,s,p,{discrete:!0})};if(Gh(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Gh(()=>c.current=!0,`onPointerDownCapture`)}}Gh(eg,`usePointerDownOutside`);function tg(e,t=globalThis?.document){let n=Uh(e),r=p.useRef(!1);return p.useEffect(()=>{let e=Gh(e=>{e.target&&!r.current&&rg(Jh,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Gh(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Gh(()=>r.current=!1,`onBlurCapture`)}}Gh(tg,`useFocusOutside`);function ng(){let e=new CustomEvent(Kh);document.dispatchEvent(e)}Gh(ng,`dispatchUpdate`);function rg(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?zh(i,a):i.dispatchEvent(a)}Gh(rg,`handleAndDispatchCustomEvent`);var ig=Object.defineProperty,ag=(e,t)=>ig(e,`name`,{value:t,configurable:!0}),og=`focusScope.autoFocusOnMount`,sg=`focusScope.autoFocusOnUnmount`,cg={bubbles:!1,cancelable:!0},lg=p.forwardRef(ag(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=p.useState(null),u=Uh(a),d=Uh(o),f=p.useRef(null),h=Jm(t,l),g=p.useRef(i);p.useEffect(()=>{g.current=i});let _=p.useCallback(e=>e?c?.contains(e)?!0:!!g.current?.some(t=>t.contains(e)):!1,[c]),v=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let e=function(e){if(v.paused||!c)return;let t=e.target;_(t)?f.current=t:bg(f.current,{select:!0})},t=function(e){if(v.paused||!c)return;let t=e.relatedTarget;t!==null&&(_(t)||bg(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&bg(c)};ag(e,`handleFocusIn`),ag(t,`handleFocusOut`),ag(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,v.paused,_]),p.useEffect(()=>{if(c){xg.add(v);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(og,cg);c.addEventListener(og,u),c.dispatchEvent(t),t.defaultPrevented||(mg(wg(gg(c)),{select:!0}),document.activeElement===e&&bg(c))}return()=>{c.removeEventListener(og,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(sg,cg);c.addEventListener(sg,d),c.dispatchEvent(r),r.defaultPrevented||bg(e??t.body,{select:!0}),c.removeEventListener(sg,d),xg.remove(v)},0)}}},[c,u,d,v]);let y=p.useCallback(e=>{if(!n&&!r||v.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=hg(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&bg(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&bg(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,v.paused]);return(0,m.jsx)(Rh.div,{tabIndex:-1,...s,ref:h,onKeyDown:y})},`FocusScope`)),ug=p.createContext(null);function dg({registry:e,children:t}){return e?(0,m.jsx)(ug.Provider,{value:e,children:t}):t}ag(dg,`FocusScopeBranchProvider`);function fg(){let[e,t]=p.useState([]);return{nodes:e,registry:p.useMemo(()=>({add:ag(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:ag(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}ag(fg,`useFocusScopeBranchRegistry`);function pg(e){let t=p.useContext(ug);p.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}ag(pg,`useFocusScopeBranch`);function mg(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(bg(r,{select:t}),document.activeElement!==n)return}ag(mg,`focusFirst`);function hg(e){let t=gg(e);return[_g(t,e),_g(t.reverse(),e)]}ag(hg,`getTabbableEdges`);function gg(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ag(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}ag(gg,`getTabbableCandidates`);function _g(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):vg(r,{upTo:t})))return r}ag(_g,`findVisible`);function vg(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}ag(vg,`isHidden`);function yg(e){return e.tagName===`INPUT`&&typeof e.select==`function`}ag(yg,`isSelectableInput`);function bg(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&yg(e)&&t&&e.select()}}ag(bg,`focus`);var xg=Sg();function Sg(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Cg(e,t),e.unshift(t)},remove(t){e=Cg(e,t),e[0]?.resume()}}}ag(Sg,`createFocusScopesStack`);function Cg(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ag(Cg,`arrayRemove`);function wg(e){return e.filter(e=>e.tagName!==`A`)}ag(wg,`removeLinks`);var Tg=Object.defineProperty,Eg=p.forwardRef(((e,t)=>Tg(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=p.useState(!1);eh(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Za.createPortal((0,m.jsx)(Rh.div,{...r,ref:t}),o):null},`Portal`)),Dg=Object.defineProperty,Og=(e,t)=>Dg(e,`name`,{value:t,configurable:!0});function kg(e,t){return p.useReducer((e,n)=>t[e][n]??e,e)}Og(kg,`useStateMachine`);var Ag=Og(e=>{let{present:t,children:n}=e,r=jg(t),i=typeof n==`function`?n({present:r.isPresent}):p.Children.only(n),a=Ng(r.ref,Fg(i));return typeof n==`function`||r.isPresent?p.cloneElement(i,{ref:a}):null},`Presence`);function jg(e){let[t,n]=p.useState(),r=p.useRef(null),i=p.useRef(e),a=p.useRef(`none`),o=p.useRef(void 0),[s,c]=kg(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return p.useEffect(()=>{s===`mounted`?(a.current=o.current??Pg(r.current),o.current=void 0):a.current=`none`},[s]),eh(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Pg(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),eh(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Og(a=>{let o=Pg(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Og(e=>{e.target===t&&(a.current=Pg(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:p.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Pg(t)}else r.current=null;n(e)},[])}}Og(jg,`usePresence`);function Mg(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Og(Mg,`setRef`);function Ng(...e){let t=p.useRef(e);return t.current=e,p.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Mg(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Mg(n[e],null)}}},[])}Og(Ng,`useStableComposedRefs`);function Pg(e){return e?.animationName||`none`}Og(Pg,`getAnimationName`);function Fg(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Og(Fg,`getElementRef`);var Ig=Object.defineProperty,Lg=(e,t)=>Ig(e,`name`,{value:t,configurable:!0}),Rg=0,zg=null;function Bg(e){return Vg(),e.children}Lg(Bg,`FocusGuards`);function Vg(){p.useEffect(()=>{zg||={start:Hg(),end:Hg()};let{start:e,end:t}=zg;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Rg++,()=>{Rg===1&&(zg?.start.remove(),zg?.end.remove(),zg=null),Rg=Math.max(0,Rg-1)}},[])}Lg(Vg,`useFocusGuards`);function Hg(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Lg(Hg,`createFocusGuard`);var Ug=function(){return Ug=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ug.apply(this,arguments)};function Wg(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Gg(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Kg=`right-scroll-bar-position`,qg=`width-before-scroll-bar`,Jg=`with-scroll-bars-hidden`,Yg=`--removed-body-scroll-bar-size`;function Xg(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Zg(e,t){var n=(0,p.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Qg=typeof window<`u`?p.useLayoutEffect:p.useEffect,$g=new WeakMap;function e_(e,t){var n=Zg(t||null,function(t){return e.forEach(function(e){return Xg(e,t)})});return Qg(function(){var t=$g.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Xg(e,null)}),i.forEach(function(e){r.has(e)||Xg(e,a)})}$g.set(n,e)},[e]),n}function t_(e){return e}function n_(e,t){t===void 0&&(t=t_);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function r_(e){e===void 0&&(e={});var t=n_(null);return t.options=Ug({async:!0,ssr:!1},e),t}var i_=function(e){var t=e.sideCar,n=Wg(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return p.createElement(r,Ug({},n))};i_.isSideCarExport=!0;function a_(e,t){return e.useMedium(t),i_}var o_=r_(),s_=function(){},c_=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:s_,onWheelCapture:s_,onTouchMoveCapture:s_}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Wg(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=e_([n,t]),w=Ug(Ug({},x),i);return p.createElement(p.Fragment,null,u&&p.createElement(S,{sideCar:o_,removeScrollBar:l,shards:d,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?p.cloneElement(p.Children.only(s),Ug(Ug({},w),{ref:C})):p.createElement(y,Ug({},w,{className:c,ref:C}),s))});c_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},c_.classNames={fullWidth:qg,zeroRight:Kg};var l_=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function u_(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=l_();return t&&e.setAttribute(`nonce`,t),e}function d_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function f_(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var p_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=u_())&&(d_(t,n),f_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},m_=function(){var e=p_();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},h_=function(){var e=m_();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},g_={left:0,top:0,right:0,gap:0},__=function(e){return parseInt(e||``,10)||0},v_=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[__(n),__(r),__(i)]},y_=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return g_;var t=v_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},b_=h_(),x_=`data-scroll-locked`,S_=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
9
+ `).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function tp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&rn(e,``+r);else return;break;case`className`:Ht(e,`class`,r);break;case`tabIndex`:Ht(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ht(e,n,r);break;case`style`:sn(e,r,o);return;case`data`:if(t!==`object`){Ht(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&tp(e,t,`name`,a.name,a,null),tp(e,t,`formEncType`,a.formEncType,a,null),tp(e,t,`formMethod`,a.formMethod,a,null),tp(e,t,`formTarget`,a.formTarget,a,null)):(tp(e,t,`encType`,a.encType,a,null),tp(e,t,`method`,a.method,a,null),tp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=fn);return;case`onScroll`:r!=null&&Vf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Vf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=dn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Vf(`beforetoggle`,e),Vf(`toggle`,e),Vt(e,`popover`,r);break;case`xlinkActuate`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Vt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=ln.get(n)||n,Vt(e,n,r);else return}zt=!0}function np(e,t,n,r,a,o){switch(n){case`style`:sn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)rn(e,``+r);else return;break;case`onScroll`:r!=null&&Vf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Vf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=fn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[gt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}zt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Vt(e,n,r)}return}zt=!0}function rp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Vf(`error`,e),Vf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:tp(e,t,o,s,n,null)}}a&&tp(e,t,`srcSet`,n.srcSet,n,null),r&&tp(e,t,`src`,n.src,n,null);return;case`input`:Vf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:tp(e,t,r,d,n,null)}}Qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Vf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:tp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&en(e,!!r,n,!0):en(e,!!r,t,!1);return;case`textarea`:for(s in Vf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:tp(e,t,s,c,n,null)}nn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:tp(e,t,l,r,n,null)}return;case`dialog`:Vf(`beforetoggle`,e),Vf(`toggle`,e),Vf(`cancel`,e),Vf(`close`,e);break;case`iframe`:case`object`:Vf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)Vf(Rf[r],e);break;case`image`:Vf(`error`,e),Vf(`load`,e);break;case`details`:Vf(`toggle`,e);break;case`embed`:case`source`:case`link`:Vf(`error`,e),Vf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:tp(e,t,u,r,n,null)}return;default:if(cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&np(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&tp(e,t,c,r,n,null))}var ip={};function ap(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||tp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(zt=!0),o=m;break;case`name`:m!==f&&(zt=!0),a=m;break;case`checked`:m!==f&&(zt=!0),u=m;break;case`defaultChecked`:m!==f&&(zt=!0),d=m;break;case`value`:m!==f&&(zt=!0),s=m;break;case`defaultValue`:m!==f&&(zt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&tp(e,t,p,m,r,f)}}Zt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||tp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(zt=!0),p=o;break;case`defaultValue`:o!==l&&(zt=!0),c=o;break;case`multiple`:o!==l&&(zt=!0),s=o;default:o!==l&&tp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?en(e,!!n,n?[]:``,!1):en(e,!!n,t,!0)):en(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:tp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(zt=!0),p=a;break;case`defaultValue`:a!==o&&(zt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&tp(e,t,s,a,r,o)}tn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:tp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(zt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:tp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&tp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:tp(e,t,u,p,r,m)}return;default:if(cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&np(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||np(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&tp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||tp(e,t,f,p,r,m)}function op(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function sp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&op(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&op(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var cp=null,lp=null;function up(e){return e.nodeType===9?e:e.ownerDocument}function dp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function fp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function pp(e,t,n,r){return n=up(n).createElement(e),n[ht]=r,n[gt]=t,rp(n,e,t),kt(n),n}function mp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var hp=null;function gp(){var e=window.event;return e&&e.type===`popstate`?e!==hp&&(hp=e,!0):(hp=null,!1)}var _p=typeof setTimeout==`function`?setTimeout:void 0,vp=typeof clearTimeout==`function`?clearTimeout:void 0,yp=typeof Promise==`function`?Promise:void 0,bp=typeof requestAnimationFrame==`function`?requestAnimationFrame:_p,xp=typeof queueMicrotask==`function`?queueMicrotask:yp===void 0?_p:function(e){return yp.resolve(null).then(e).catch(Sp)};function Sp(e){setTimeout(function(){throw e})}function Cp(e){return e===`head`}function wp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Uh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[St]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Uh(t)}function Tp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Ep(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Dp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Op(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function kp(e){return Op(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ap(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Op(t,n,e)}function jp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Np(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(jp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Zm(f),u>eh){s.length=o;break}f=new Promise(Mp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Pp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Pp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Pp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fp(e){return{name:e,group:new Pp(`group`,e),imagePair:new Pp(`image-pair`,e),old:new Pp(`old`,e),new:new Pp(`new`,e)}}function Ip(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ip.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Vp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=zp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Lp,e,s,r)}this._eventListeners=a}};function Lp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Ip.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Vp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=zp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Rp,e,n,i),r.splice(t,1),a!==null&&a()}};function Rp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function zp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Bp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Vp(e,t,n,r){if(e.length===0)return-1;r=Bp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Bp(a.optionsOrUseCapture)===r)return i}return-1}Ip.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,zp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,zp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Ip.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag!==6&&(e=v(e),mm(e,t))}Ip.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Up,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Hp(t[n],e);n--);};function Up(e,t){return t.push(e),!1}Ip.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=up(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0))};function Wp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ip.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Ip.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Kp,e,void 0,void 0);for(var n=t=0;n<qp.length;n++){var r=qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):qp[t++]=r}qp.length=t}};function Kp(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var qp=[],Jp=!1;function Yp(e,t,n){qp.push({fragmentInstance:e,observer:t,instance:n}),Jp||(Jp=!0,hm(function(){Jp=!1;var e=qp;qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Ip.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Xp,e,void 0,void 0),e};function Xp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Ip.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Ip.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Up,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Zp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zp(e,t,n,r,i){var a=Tt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Qp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Ip.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,Up,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),Qp(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),Qp(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=v(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<qp.length;i++){var a=qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(qp[r++]=a)}qp.length=r,n.observe(e)}),em(e,t))}function nm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Yp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:rm(n),wt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[St])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function um(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function mm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function hm(e){bp(function(){bp(function(t){return e(t)})})}function gm(e,t,n){switch(t=up(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&tp(e,t,r,null,ip,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===fn&&(e.onclick=null),wt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wt(e)}var ym=new Map,bm=new Set;function xm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Sm=G.d;G.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=Ld();return e||t}function wm(e){var t=Et(e);t!==null&&t.tag===5&&t.type===`form`?Js(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=Xt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),rp(t,`link`,e),kt(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Xt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Xt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Xt(n.imageSizes)+`"]`)):i+=`[href="`+Xt(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);rp(o,`link`,e),t===`style`&&(o[Ct]=!0,o.onload=o.onerror=function(){At(o)}),kt(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Xt(r)+`"][href="`+Xt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zm(e)}if(!ym.has(a)&&(e=T({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),rp(r,`link`,e),kt(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=Ot(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);kt(c),rp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=Ot(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=T({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),kt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=Ot(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),kt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var a=(a=pe.current)?xm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Fm(n.href),t=Ot(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Fm(n.href);var o=Ot(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ym.set(e,o)),Rm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=zm(n),t=Ot(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Fm(e){return`href="`+Xt(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ct]){r.loading=1;return}}else t=e.createElement(`link`),t[Ct]=!0,t.onload=t.onerror=At.bind(null,t),rp(t,`link`,n),kt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function zm(e){return`[src="`+Xt(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Xt(n.href)+`"]`);if(r)return t.instance=r,kt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),kt(r),rp(r,`style`,a),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Fm(n.href);var o=e.querySelector(Im(a));if(o)return t.state.loading|=4,t.instance=o,kt(o),o;r=Lm(n),(a=ym.get(a))&&Um(r,a),o=(e.ownerDocument||e).createElement(`link`),kt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),rp(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(a=e.querySelector(Bm(o)))?(t.instance=a,kt(a),a):(r=n,(a=ym.get(o))&&(r=T({},n),Wm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),kt(a),rp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Hm(r,n.precedence,e));return t.instance}function Hm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[St]||a[ht]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,kt(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),kt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),rp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*sp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=rh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ch={$$typeof:N,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function lh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rt(0),this.hiddenUpdates=rt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=xi(3,null,null,t),e.current=a,a.stateNode=e,t=Sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},io(a),e}function dh(e){return e?(e=yi,e):yi}function fh(e,t,n,r,i,a){i=dh(i),r.context===null?r.context=i:r.pendingContext=i,r=oo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=so(e,r,t),n!==null&&(Md(n,e,t),co(n,e,t))}function ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mh(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function hh(e){if(e.tag===13||e.tag===31){var t=gi(e,67108864);t!==null&&Md(t,e,67108864),mh(e,67108864)}}function gh(e){if(e.tag===13||e.tag===31){var t=kd();t=ut(t);var n=gi(e,t);n!==null&&Md(n,e,t),mh(e,t)}}var _h=!0;function vh(e,t,n,r){var i=W.T;W.T=null;var a=G.p;try{G.p=2,bh(e,t,n,r)}finally{G.p=a,W.T=i}}function yh(e,t,n,r){var i=W.T;W.T=null;var a=G.p;try{G.p=8,bh(e,t,n,r)}finally{G.p=a,W.T=i}}function bh(e,t,n,r){if(_h){var i=xh(r);if(i===null)Kf(e,t,r,Sh,n),Nh(e,r);else if(Fh(i,e,t,n,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<Mh.indexOf(e)){for(;i!==null;){var a=Et(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Xe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ue(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(Ju&6)&&(md=je()+500,Ef(0,!1))}}break;case 31:case 13:s=gi(a,2),s!==null&&Md(s,a,2),Ld(),mh(a,2)}if(a=xh(r),a===null&&Kf(e,t,r,Sh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function xh(e){return e=mn(e),Ch(e)}var Sh=null;function Ch(e){if(Sh=null,e=Tt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Sh=e,null}function wh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Me()){case Ne:return 2;case Pe:return 8;case Fe:case Ie:return 32;case Le:return 268435456;default:return 32}default:return 32}}var Th=!1,Eh=null,Dh=null,Oh=null,kh=new Map,Ah=new Map,jh=[],Mh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Nh(e,t){switch(e){case`focusin`:case`focusout`:Eh=null;break;case`dragenter`:case`dragleave`:Dh=null;break;case`mouseover`:case`mouseout`:Oh=null;break;case`pointerover`:case`pointerout`:kh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ah.delete(t.pointerId)}}function Ph(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Et(t),t!==null&&hh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fh(e,t,n,r,i){switch(t){case`focusin`:return Eh=Ph(Eh,e,t,n,r,i),!0;case`dragenter`:return Dh=Ph(Dh,e,t,n,r,i),!0;case`mouseover`:return Oh=Ph(Oh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kh.set(a,Ph(kh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ah.set(a,Ph(Ah.get(a)||null,e,t,n,r,i)),!0}return!1}function Ih(e){var t=Tt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,pt(e.priority,function(){gh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,pt(e.priority,function(){gh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pn=r,n.target.dispatchEvent(r),pn=null}else return t=Et(n),t!==null&&hh(t),e.blockedOn=n,!1;t.shift()}return!0}function Rh(e,t,n){Lh(e)&&n.delete(t)}function zh(){Th=!1,Eh!==null&&Lh(Eh)&&(Eh=null),Dh!==null&&Lh(Dh)&&(Dh=null),Oh!==null&&Lh(Oh)&&(Oh=null),kh.forEach(Rh),Ah.forEach(Rh)}function Bh(e,n){e.blockedOn===n&&(e.blockedOn=null,Th||(Th=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zh)))}var Vh=null;function Hh(e){Vh!==e&&(Vh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vh===e&&(Vh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Ch(r||n)===null)continue;break}var a=Et(n);a!==null&&(e.splice(t,3),t-=3,Ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Uh(e){function t(t){return Bh(t,e)}Eh!==null&&Bh(Eh,e),Dh!==null&&Bh(Dh,e),Oh!==null&&Bh(Oh,e),kh.forEach(t),Ah.forEach(t);for(var n=0;n<jh.length;n++){var r=jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jh.length&&(n=jh[0],n.blockedOn===null);)Ih(n),n.blockedOn===null&&jh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[gt]||null;if(typeof a==`function`)o||Hh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[gt]||null)s=o.formAction;else if(Ch(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hh(n)}}}function Wh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Gh(e){this._internalRoot=e}Kh.prototype.render=Gh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fh(n,kd(),e,t,null,null)},Kh.prototype.unmount=Gh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fh(e.current,2,null,e,null,null),Ld(),t[_t]=null}};function Kh(e){this._internalRoot=e}Kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ft();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jh.length&&t!==0&&t<jh[n].priority;n++);jh.splice(n,0,e),n===0&&Ih(e)}};var qh=n.version;if(qh!==`19.3.1`)throw Error(i(527,qh,`19.3.1`));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Jh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:W,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{Be=Yh.inject(Jh),Ve=Yh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=hc,s=gc,c=_c;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=uh(e,1,!1,null,null,n,r,null,o,s,c,Wh),e[_t]=t.current,Wf(e),new Gh(t)}})),ot=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=at()}))(),st=(0,p.createContext)({theme:`dark`,setTheme:()=>{},toggle:()=>{}});function ct(e){try{let t=window.localStorage.getItem(e);return t===`light`||t===`dark`?t:void 0}catch{return}}function lt(e,t){return typeof window>`u`?t:ct(e)??t}function ut(e){if(typeof document>`u`)return;let t=document.documentElement;t.classList.toggle(`light`,e===`light`),t.classList.toggle(`dark`,e===`dark`),t.dataset.theme=e}function dt({children:e,storageKey:t,accent:n,defaultTheme:r=`dark`}){let[i,a]=(0,p.useState)(()=>lt(t,r));(0,p.useEffect)(()=>{ut(i)},[i]),(0,p.useEffect)(()=>{n&&typeof document<`u`&&document.documentElement.style.setProperty(`--agora-accent`,n)},[n]);let o=(0,p.useCallback)(e=>{if(typeof document<`u`){let e=document.documentElement;e.classList.add(`agora-theme-switching`),window.setTimeout(()=>e.classList.remove(`agora-theme-switching`),260)}a(e);try{window.localStorage.setItem(t,e)}catch{}},[t]),s=(0,p.useCallback)(()=>o(i===`dark`?`light`:`dark`),[i,o]);return(0,m.jsx)(st.Provider,{value:{theme:i,setTheme:o,toggle:s},children:e})}function ft(){return(0,p.useContext)(st)}function pt(e,t){return function({size:n=16,...r}){return(0,m.jsx)(`svg`,{viewBox:`0 0 16 16`,width:n,height:n,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!t||void 0,role:t?`img`:void 0,"aria-label":t,...r,children:e})}}var mt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.5`}),(0,m.jsx)(`path`,{d:`M10.5 10.5 14 14`})]})),ht=pt((0,m.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`})),gt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`1.5`,y:`2.5`,width:`13`,height:`11`,rx:`2`}),(0,m.jsx)(`path`,{d:`M6 2.5v11`})]})),_t=pt((0,m.jsx)(`path`,{d:`M4 6l4 4 4-4`})),vt=pt((0,m.jsx)(`path`,{d:`M10 4 6 8l4 4`})),yt=pt((0,m.jsx)(`path`,{d:`M3.5 8.5l3 3 6-7`})),bt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`3`}),(0,m.jsx)(`path`,{d:`M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3.05 3.05l1.06 1.06M11.89 11.89l1.06 1.06M3.05 12.95l1.06-1.06M11.89 4.11l1.06-1.06`})]})),xt=pt((0,m.jsx)(`path`,{d:`M13.5 9A6 6 0 116.5 2.5a4.5 4.5 0 007 6.5z`})),St=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M10 11l4-3.5L10 4`}),(0,m.jsx)(`path`,{d:`M14 7.5H5`}),(0,m.jsx)(`path`,{d:`M6 3H3a1 1 0 00-1 1v7a1 1 0 001 1h3`})]})),Ct=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M8 2 1.5 13.5h13z`}),(0,m.jsx)(`path`,{d:`M8 6.5v3M8 11.5h.01`})]})),wt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M13.5 8a5.5 5.5 0 1 1-1.6-3.9`}),(0,m.jsx)(`path`,{d:`M13.5 2.5v3h-3`})]})),Tt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M2 9.5 4 3h8l2 6.5V13H2z`}),(0,m.jsx)(`path`,{d:`M2 9.5h3.5l1 1.5h3l1-1.5H14`})]})),Et=pt((0,m.jsx)(`path`,{d:`M2 3h12l-4.5 5.5V13l-3-1.5v-3z`}));m.Fragment;var Dt=pt((0,m.jsx)(`path`,{d:`M1.5 8h3l2-5 3 10 2-5h3`})),Ot=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`2`,y:`2`,width:`12`,height:`5`,rx:`1.2`}),(0,m.jsx)(`rect`,{x:`2`,y:`9`,width:`12`,height:`5`,rx:`1.2`}),(0,m.jsx)(`path`,{d:`M4.5 4.5h.01M4.5 11.5h.01`})]})),kt=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`}),(0,m.jsx)(`path`,{d:`M8 4.5V8l2.5 1.5`})]})),At=pt((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`1.5`,y:`2`,width:`4.5`,height:`4.5`,rx:`1.2`}),(0,m.jsx)(`rect`,{x:`10`,y:`9.5`,width:`4.5`,height:`4.5`,rx:`1.2`}),(0,m.jsx)(`path`,{d:`M6 4.25h3a1.5 1.5 0 0 1 1.5 1.5V9.5`})]}));m.Fragment,m.Fragment,m.Fragment;var jt={workflow:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1.5`}),(0,m.jsx)(`rect`,{x:`15`,y:`14`,width:`6`,height:`6`,rx:`1.5`}),(0,m.jsx)(`path`,{d:`M9 7h4a2 2 0 0 1 2 2v5`})]}),telescope:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`m4 14 13-6 2 4-13 6z`}),(0,m.jsx)(`path`,{d:`m10 16 2 5M14 15l-2 6M17 8l1-3 3 1-1 3`})]}),media:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,m.jsx)(`circle`,{cx:`9`,cy:`10`,r:`2`}),(0,m.jsx)(`path`,{d:`m21 16-5-5-9 9`})]}),payments:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`2.5`,y:`5`,width:`19`,height:`14`,rx:`2`}),(0,m.jsx)(`path`,{d:`M2.5 10h19M6.5 15h4`})]}),agent:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`5`,y:`8`,width:`14`,height:`11`,rx:`3`}),(0,m.jsx)(`path`,{d:`M12 8V4M9 13h.01M15 13h.01M9.5 16.5h5`}),(0,m.jsx)(`circle`,{cx:`12`,cy:`3.5`,r:`0.5`})]}),identity:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 3 4.5 6v5.5c0 4.5 3.2 8.2 7.5 9.5 4.3-1.3 7.5-5 7.5-9.5V6z`}),(0,m.jsx)(`circle`,{cx:`12`,cy:`10`,r:`2.5`}),(0,m.jsx)(`path`,{d:`M8 16a4.5 4.5 0 0 1 8 0`})]}),flags:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M5 21V4`}),(0,m.jsx)(`path`,{d:`M5 4h11l-2 4 2 4H5`})]}),cms:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z`}),(0,m.jsx)(`path`,{d:`M14 3v5h5M9 13h6M9 17h4`})]}),generic:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`3`,y:`3`,width:`7`,height:`7`,rx:`1.5`}),(0,m.jsx)(`rect`,{x:`14`,y:`3`,width:`7`,height:`7`,rx:`1.5`}),(0,m.jsx)(`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1.5`}),(0,m.jsx)(`rect`,{x:`14`,y:`14`,width:`7`,height:`7`,rx:`1.5`})]})},Mt=Object.keys(jt);function Nt(e){return Mt.includes(e)?e:`generic`}function Pt({icon:e,className:t,size:n=16}){return(0,m.jsx)(`svg`,{viewBox:`0 0 24 24`,width:n,height:n,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,"aria-hidden":`true`,"data-icon":e,children:jt[e]??jt.generic})}var Ft={authkit:`#625fff`,durable:`#a3e635`,telescope:`#e879f9`,payments:`#22d3ee`,media:`#fbbf24`,agent:`#fb7185`,flags:`#34d399`,cms:`#fb923c`},It={identity:`#625fff`,workflow:`#a3e635`,telescope:`#e879f9`,payments:`#22d3ee`,media:`#fbbf24`,agent:`#fb7185`,flags:`#34d399`,cms:`#fb923c`};function Lt(e,t){return(e?Ft[e]:void 0)??It[t]}function Rt({icon:e,accent:t,size:n=26,className:r}){return(0,m.jsx)(`span`,{className:`agora-tile${r?` ${r}`:``}`,style:{width:n,height:n,...t?{"--agora-tile":t}:{}},"data-accent":t,children:(0,m.jsx)(Pt,{icon:e,size:Math.round(n*.58)})})}function zt(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=zt(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Bt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=zt(e))&&(r&&(r+=` `),r+=t);return r}var Vt=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ht=(e,t)=>({classGroupId:e,validator:t}),Ut=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Wt=`-`,Gt=[],Kt=`arbitrary..`,qt=e=>{let t=Xt(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Yt(e);let n=e.split(Wt);return Jt(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Vt(i,t):t:i||Gt}return n[e]||Gt}}},Jt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Jt(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Wt):e.slice(t).join(Wt),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Yt=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Kt+r:void 0})(),Xt=e=>{let{theme:t,classGroups:n}=e;return Zt(n,t)},Zt=(e,t)=>{let n=Ut();for(let r in e){let i=e[r];Qt(i,n,r,t)}return n},Qt=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];$t(i,t,n,r)}},$t=(e,t,n,r)=>{typeof e==`string`?en(e,t,n):typeof e==`function`?tn(e,t,n,r):nn(e,t,n,r)},en=(e,t,n)=>{let r=e===``?t:rn(t,e);r.classGroupId=n},tn=(e,t,n,r)=>{an(e)?Qt(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(Ht(n,e)))},nn=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Qt(o,rn(t,a),n,r)}},rn=(e,t)=>{let n=e,r=t.split(Wt),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ut(),n.nextPart.set(t,i)),n=i}return n},an=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,on=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},sn=`!`,cn=`:`,ln=[],un=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),dn=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===cn){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(sn)?(c=s.slice(0,-1),l=!0):s.startsWith(sn)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return un(t,l,c,u)};if(t){let e=t+cn,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):un(ln,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},fn=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},pn=e=>({cache:on(e.cacheSize),parseClassName:dn(e),sortModifiers:fn(e),postfixLookupClassGroupIds:mn(e),...qt(e)}),mn=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},hn=/\s+/,gn=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(hn),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+sn:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},_n=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=vn(n))&&(i&&(i+=` `),i+=r);return i},vn=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=vn(e[r]))&&(n&&(n+=` `),n+=t);return n},yn=(e,...t)=>{let n,r,i,a,o=o=>(n=pn(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=gn(e,n);return i(e,a),a};return a=o,(...e)=>a(_n(...e))},bn=[],xn=e=>{let t=t=>t[e]||bn;return t.isThemeGetter=!0,t.themeKey=e,t},Sn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Cn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Tn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,En=/\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$/,Dn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,On=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,An=e=>wn.test(e),jn=e=>!!e&&!Number.isNaN(Number(e)),Mn=e=>!!e&&Number.isInteger(Number(e)),Nn=e=>e.endsWith(`%`)&&jn(e.slice(0,-1)),Pn=e=>Tn.test(e),Fn=()=>!0,In=e=>En.test(e)&&!Dn.test(e),Ln=()=>!1,Rn=e=>On.test(e),zn=e=>kn.test(e),Bn=e=>!K(e)&&!q(e),Vn=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)),Hn=e=>rr(e,sr,Ln),K=e=>Sn.test(e),Un=e=>rr(e,cr,In),Wn=e=>rr(e,lr,jn),Gn=e=>rr(e,dr,Fn),Kn=e=>rr(e,ur,Ln),qn=e=>rr(e,ar,Ln),Jn=e=>rr(e,or,zn),Yn=e=>rr(e,fr,Rn),q=e=>Cn.test(e),Xn=e=>ir(e,cr),Zn=e=>ir(e,ur),Qn=e=>ir(e,ar),$n=e=>ir(e,sr),er=e=>ir(e,or),tr=e=>ir(e,fr,!0),nr=e=>ir(e,dr,!0),rr=(e,t,n)=>{let r=Sn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ir=(e,t,n=!1)=>{let r=Cn.exec(e);return r?r[1]?t(r[1]):n:!1},ar=e=>e===`position`||e===`percentage`,or=e=>e===`image`||e===`url`,sr=e=>e===`length`||e===`size`||e===`bg-size`,cr=e=>e===`length`,lr=e=>e===`number`,ur=e=>e===`family-name`,dr=e=>e===`number`||e===`weight`,fr=e=>e===`shadow`,pr=yn(()=>{let e=xn(`color`),t=xn(`font`),n=xn(`text`),r=xn(`font-weight`),i=xn(`tracking`),a=xn(`leading`),o=xn(`breakpoint`),s=xn(`container`),c=xn(`spacing`),l=xn(`radius`),u=xn(`shadow`),d=xn(`inset-shadow`),f=xn(`text-shadow`),p=xn(`drop-shadow`),m=xn(`blur`),h=xn(`perspective`),g=xn(`aspect`),_=xn(`ease`),v=xn(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),q,K],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[q,K,c],T=()=>[An,`full`,`auto`,...w()],E=()=>[Mn,`none`,`subgrid`,q,K],D=()=>[`auto`,{span:[`full`,Mn,q,K]},Mn,q,K],O=()=>[Mn,`auto`,q,K],k=()=>[`auto`,`min`,`max`,`fr`,q,K],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[An,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,An,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[An,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,q,K],L=()=>[...b(),Qn,qn,{position:[q,K]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,$n,Hn,{size:[q,K]}],B=()=>[Nn,Xn,Un],ee=()=>[``,`none`,`full`,l,q,K],V=()=>[``,jn,Xn,Un],te=()=>[`solid`,`dashed`,`dotted`,`double`],ne=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],H=()=>[jn,Nn,Qn,qn],re=()=>[``,`none`,m,q,K],U=()=>[`none`,jn,q,K],ie=()=>[`none`,jn,q,K],W=()=>[jn,q,K],G=()=>[An,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Pn],breakpoint:[Pn],color:[Fn],container:[Pn],"drop-shadow":[Pn],ease:[`in`,`out`,`in-out`],font:[Bn],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Pn],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Pn],shadow:[Pn],spacing:[`px`,jn],text:[Pn],"text-shadow":[Pn],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,An,K,q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,q,K]}],"container-named":[Vn],columns:[{columns:[jn,`auto`,K,q,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Mn,`auto`,q,K]}],basis:[{basis:[An,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[jn,An,`auto`,`initial`,`none`,K]}],grow:[{grow:[``,jn,q,K]}],shrink:[{shrink:[``,jn,q,K]}],order:[{order:[Mn,`first`,`last`,`none`,q,K]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,Xn,Un]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,nr,Gn]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Nn,K]}],"font-family":[{font:[Zn,Kn,t]}],"font-features":[{"font-features":[K]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,q,K]}],"line-clamp":[{"line-clamp":[jn,`none`,q,Wn]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,q,K]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,q,K]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...te(),`wavy`]}],"text-decoration-thickness":[{decoration:[jn,`from-font`,`auto`,q,Un]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[jn,`auto`,q,K]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Mn,q,K]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,q,K]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,q,K]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Mn,q,K],radial:[``,q,K],conic:[``,Mn,q,K]},er,Jn]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...te(),`hidden`,`none`]}],"divide-style":[{divide:[...te(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...te(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[jn,q,K]}],"outline-w":[{outline:[``,jn,Xn,Un]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,tr,Yn]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,tr,Yn]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[jn,Un]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,tr,Yn]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[jn,q,K]}],"mix-blend":[{"mix-blend":[...ne(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ne()}],"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":[jn]}],"mask-image-linear-from-pos":[{"mask-linear-from":H()}],"mask-image-linear-to-pos":[{"mask-linear-to":H()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":H()}],"mask-image-t-to-pos":[{"mask-t-to":H()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":H()}],"mask-image-r-to-pos":[{"mask-r-to":H()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":H()}],"mask-image-b-to-pos":[{"mask-b-to":H()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":H()}],"mask-image-l-to-pos":[{"mask-l-to":H()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":H()}],"mask-image-x-to-pos":[{"mask-x-to":H()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":H()}],"mask-image-y-to-pos":[{"mask-y-to":H()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[q,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":H()}],"mask-image-radial-to-pos":[{"mask-radial-to":H()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[jn]}],"mask-image-conic-from-pos":[{"mask-conic-from":H()}],"mask-image-conic-to-pos":[{"mask-conic-to":H()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,q,K]}],filter:[{filter:[``,`none`,q,K]}],blur:[{blur:re()}],brightness:[{brightness:[jn,q,K]}],contrast:[{contrast:[jn,q,K]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,tr,Yn]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,jn,q,K]}],"hue-rotate":[{"hue-rotate":[jn,q,K]}],invert:[{invert:[``,jn,q,K]}],saturate:[{saturate:[jn,q,K]}],sepia:[{sepia:[``,jn,q,K]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,q,K]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[jn,q,K]}],"backdrop-contrast":[{"backdrop-contrast":[jn,q,K]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,jn,q,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[jn,q,K]}],"backdrop-invert":[{"backdrop-invert":[``,jn,q,K]}],"backdrop-opacity":[{"backdrop-opacity":[jn,q,K]}],"backdrop-saturate":[{"backdrop-saturate":[jn,q,K]}],"backdrop-sepia":[{"backdrop-sepia":[``,jn,q,K]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,q,K]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[jn,`initial`,q,K]}],ease:[{ease:[`linear`,`initial`,_,q,K]}],delay:[{delay:[jn,q,K]}],animate:[{animate:[`none`,v,q,K]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,q,K]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:W()}],"skew-x":[{"skew-x":W()}],"skew-y":[{"skew-y":W()}],transform:[{transform:[q,K,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":[`translate-none`],zoom:[{zoom:[Mn,q,K]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,q,K]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,q,K]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[jn,Xn,Un,Wn]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function J(...e){return pr(Bt(e))}function mr(){return typeof window<`u`}function hr(e){return vr(e)?(e.nodeName||``).toLowerCase():`#document`}function gr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _r(e){return((vr(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function vr(e){return mr()?e instanceof Node||e instanceof gr(e).Node:!1}function yr(e){return mr()?e instanceof Element||e instanceof gr(e).Element:!1}function br(e){return mr()?e instanceof HTMLElement||e instanceof gr(e).HTMLElement:!1}function xr(e){return!mr()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof gr(e).ShadowRoot}function Sr(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Nr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Cr(e){return/^(table|td|th)$/.test(hr(e))}function wr(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Tr=/transform|translate|scale|rotate|perspective|filter/,Er=/paint|layout|strict|content/,Dr=e=>!!e&&e!==`none`,Or;function kr(e){let t=yr(e)?Nr(e):e;return Dr(t.transform)||Dr(t.translate)||Dr(t.scale)||Dr(t.rotate)||Dr(t.perspective)||!jr()&&(Dr(t.backdropFilter)||Dr(t.filter))||Tr.test(t.willChange||``)||Er.test(t.contain||``)}function Ar(e){let t=Fr(e);for(;br(t)&&!Mr(t);){if(kr(t))return t;if(wr(t))return null;t=Fr(t)}return null}function jr(){return Or??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Or}function Mr(e){return/^(html|body|#document)$/.test(hr(e))}function Nr(e){return gr(e).getComputedStyle(e)}function Pr(e){return yr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fr(e){if(hr(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||xr(e)&&e.host||_r(e);return xr(t)?t.host:t}function Ir(e){let t=Fr(e);return Mr(t)?(e.ownerDocument||e).body:br(t)&&Sr(t)?t:Ir(t)}function Lr(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ir(e),i=r===e.ownerDocument?.body,a=gr(r);if(i){let e=Rr(a);return t.concat(a,a.visualViewport||[],Sr(r)?r:[],e&&n?Lr(e):[])}return t.concat(r,Lr(r,[],n))}function Rr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var zr={...p},Br={};function Vr(e,t){let n=p.useRef(Br);return n.current===Br&&(n.current=e(t)),n}var Hr=zr.useInsertionEffect,Ur=Hr&&Hr!==zr.useLayoutEffect?Hr:e=>e();function Y(e){let t=Vr(Wr).current;return t.next=e,Ur(t.effect),t.trampoline}function Wr(){let e={next:void 0,callback:Gr,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Gr(){}var X=typeof document<`u`?p.useLayoutEffect:()=>{};function Kr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var qr={};function Jr(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Xr(t);let a=Xr(e);return t&&(a=Zr(a,t)),n&&(a=Zr(a,n)),r&&(a=Zr(a,r)),i&&(a=Zr(a,i)),a}function Yr(e){if(e.length===0)return qr;if(e.length===1)return Xr(e[0]);let t=Xr(e[0]);for(let n=1;n<e.length;n+=1)t=Zr(t,e[n]);return t}function Xr(e){return ti(e)?{...e(qr)}:Qr(e)}function Zr(e,t){return ti(t)?t(e):$r(e,t)}function Qr(e){let t={...e};for(let e in t){let n=t[e];ei(e,n)&&(t[e]=ri(n))}return t}function $r(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Kr(e.style,r);break;case`className`:e[n]=ai(e.className,r);break;default:e[n]=ei(n,r)?ni(e[n],r):r}}return e}function ei(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function ti(e){return typeof e==`function`}function ni(e,t){return t?e?(...n)=>{let r=n[0];if(oi(r)){let i=r;ii(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:ri(t):e}function ri(e){return e&&((...t)=>{let n=t[0];return oi(n)&&ii(n),e(...t)})}function ii(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ai(e,t){return t?e?t+` `+e:t:e}function oi(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function si(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var ci=si(`https://base-ui.com/production-error`,`Base UI`),li=p.createContext(void 0);function ui(e=!1){let t=p.useContext(li);if(t===void 0&&!e)throw Error(ci(16));return t}function di(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:p.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function fi(e){return e?.ownerDocument||document}function pi(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(gr(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function mi(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=p.useRef(null),s=ui(!0),c=a??s!==void 0,{props:l}=di({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=p.useCallback(()=>{let e=o.current;hi(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return X(u,[u]),{getButtonProps:p.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Jr({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(ii(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=hi(r),s=!i&&gi(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),pi(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),pi(r,e)))},onKeyUp(e){t||(ii(e),a?.(e),e.target===e.currentTarget&&i&&c&&hi(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),pi(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Y(e=>{o.current=e,u()})}}function hi(e){return br(e)&&e.tagName===`BUTTON`}function gi(e){return br(e)&&e.tagName===`A`&&!!e.href}function _i(e,t,n,r){let i=Vr(yi).current;return bi(i,e,t,n,r)&&Si(i,[e,t,n,r]),i.callback}function vi(e){let t=Vr(yi).current;return xi(t,e)&&Si(t,e),t.callback}function yi(){return{callback:null,cleanup:null,refs:[]}}function bi(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function xi(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Si(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var Ci=19;function wi(e){return Ci>=e}function Ti(e){if(!p.isValidElement(e))return null;let t=e,n=t.props;return(wi(19)?n?.ref:t.ref)??null}function Ei(){}var Di=Object.freeze([]),Oi=Object.freeze({});function ki(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Ai(e,t){return typeof e==`function`?e(t):e}function ji(e,t){return typeof e==`function`?e(t):e}function Mi(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Ii(r));let i=Ni(t,n,r);if(n.enabled===!1)return null;let a=n.state??Oi;return Li(e,r,i,a)}function Ni(e,t,n){let{className:r,style:i}=e,{state:a=Oi,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Ai(r,a):void 0,d=l?ji(i,a):void 0,f=l?ki(a,c):Oi,p=l&&s?Pi(s):void 0,m=l?Kr(f,p)??{}:Oi;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?vi([m.ref,Ti(n),...o]):_i(m.ref,Ti(n),o):_i(null,null)),l?(u!==void 0&&(m.className=ai(m.className,u)),d!==void 0&&(m.style=Kr(m.style,d)),m):Oi}function Pi(e){return Array.isArray(e)?Yr(e):Jr(void 0,e)}var Fi=Symbol.for(`react.lazy`);function Ii(e){if(e?.$$typeof!==Fi)return e;let t=p.Children.toArray(e)[0];return p.isValidElement(t)?t:e}function Li(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Jr(n,t.props);return e.ref=n.ref,p.cloneElement(t,e)}return Ri(e,n)}function Ri(e,t){return e===`button`?(0,p.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,p.createElement)(`img`,{alt:``,...t,key:t.key}):p.createElement(e,t)}var zi=p.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=mi({disabled:i,focusableWhenDisabled:a,native:o});return Mi(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Bi=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Vi=Bt,Hi=(e,t)=>n=>{if(t?.variants==null)return Vi(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Bi(t)||Bi(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Vi(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Ui=Hi(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-brand-hover`,outline:`border-border bg-panel-2 text-dim hover:border-line-strong hover:bg-panel-3 hover:text-foreground aria-expanded:bg-panel-3 aria-expanded:text-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`text-dim hover:bg-hover hover:text-foreground aria-expanded:bg-hover aria-expanded:text-foreground`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`,brand:`border-brand-border bg-brand-soft text-brand hover:bg-brand/20`,warn:`border-warn/40 bg-warn/10 text-warn hover:bg-warn/20`,info:`border-info/30 bg-info/10 text-info hover:bg-info/20`,alt:`border-violet/30 bg-violet/10 text-violet hover:bg-violet/20`,chip:`border-border bg-panel-2 text-dim hover:border-line-strong hover:text-foreground aria-pressed:border-brand-border aria-pressed:bg-brand-soft aria-pressed:text-foreground`},size:{default:`h-8 gap-1.5 px-3 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-[26px] gap-1 rounded-[6px] px-2.5 text-[11px] [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-9`,"icon-xs":`size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-10`,micro:`h-5 gap-1 rounded-sm px-1.5 text-[10px] [&_svg:not([class*='size-'])]:size-3`,chip:`h-7 gap-1.5 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3.5`}},defaultVariants:{variant:`default`,size:`default`}});function Wi({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,m.jsx)(zi,{"data-slot":`button`,className:J(Ui({variant:t,size:n,className:e})),...r})}var Gi=class extends p.Component{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}componentDidCatch(e,t){typeof console<`u`&&console.error(`[agora-kit] region crashed`,e,t)}componentDidUpdate(e){if(!this.state.error)return;let t=e.resetKeys??[],n=this.props.resetKeys??[];(t.length!==n.length||t.some((e,t)=>!Object.is(e,n[t])))&&this.reset()}reset=()=>{this.props.onReset?.(),this.setState({error:null})};render(){let{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):(0,m.jsx)(Ki,{title:this.props.label?`${this.props.label} failed to render`:`Something broke here`,error:e,onRetry:this.reset,className:this.props.className}):this.props.children}};function Ki({title:e,error:t,onRetry:n,className:r}){let i=t instanceof Error?t.message:t?String(t):void 0;return(0,m.jsxs)(`div`,{role:`alert`,className:J(`flex flex-col items-start gap-3 rounded-lg border border-bad/25 bg-bad/5 p-4 text-sm`,r),children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-bad`,children:[(0,m.jsx)(Ct,{}),e]}),i&&(0,m.jsx)(`p`,{className:`mono break-all text-[11px] text-fg-2`,children:i}),n&&(0,m.jsxs)(Wi,{variant:`outline`,size:`sm`,onClick:n,children:[(0,m.jsx)(wt,{}),`Retry`]})]})}function qi({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=p.useRef(e!==void 0),[a,o]=p.useState(()=>t);return[i&&e!==void 0?e:a,p.useCallback(e=>{i||o(e)},[])]}function Ji(){let[,e]=p.useState({});return p.useCallback(()=>{e({})},[])}var Yi=0;function Xi(e,t=`mui`){let n=p.useRef(void 0),r=Ji(),i=e??n.current;return p.useEffect(()=>{n.current??(Yi+=1,n.current=`${t}-${Yi}`,e??r())},[e,t,r]),i}var Zi=zr.useId;function Qi(e,t){if(Zi!==void 0){let n=Zi();return e??(t?`${t}-${n}`:n)}return Xi(e,t)}function $i(e){return Qi(e,`base-ui`)}function ea(e,t,n,r){let i=!1,a=!1,o=r??Oi;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function ta(e,t,n){let r=n??Oi;return{reason:e,event:t??new Event(`base-ui`),...r}}var na=`none`,ra=`trigger-press`,ia=`trigger-hover`,aa=`trigger-focus`,oa=`outside-press`,sa=`item-press`,ca=`close-press`,la=`focus-out`,ua=`escape-key`,da=`list-navigation`,fa=`keyboard`,pa=`pointer`,ma=`cancel-open`,ha=`sibling-open`,ga=`disabled`,_a=`imperative-action`;function va(e){p.useEffect(e,Di)}var ya=null;globalThis.requestAnimationFrame;var ba=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},xa=class e{static create(){return new e}static request(e){return ba.request(e)}static cancel(e){return ba.cancel(e)}currentId=ya;request(e){this.cancel(),this.currentId=ba.request(()=>{this.currentId=ya,e()})}cancel=()=>{this.currentId!==ya&&(ba.cancel(this.currentId),this.currentId=ya)};disposeEffect=()=>this.cancel};function Sa(){let e=Vr(xa.create).current;return va(e.disposeEffect),e}function Ca(e,t=!1,n=!1,r=!1){let[i,a]=p.useState(e&&t?`idle`:void 0),[o,s]=p.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),X(()=>{if(!e&&o&&i!==`ending`&&n){let e=xa.request(()=>{a(`ending`)});return()=>{xa.cancel(e)}}},[e,o,i,n]),X(()=>{if(!e||t||i===void 0)return;let n=xa.request(()=>{a(void 0)});return()=>{xa.cancel(n)}},[t,e,i]),X(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=xa.request(()=>{a(`idle`)});return()=>{xa.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function wa(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=qi({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=Ca(a,!0,!0),u=$i(),[d,f]=p.useState(),m=d===null?void 0:d??u,h=Y(e=>{let t=!a,n=ea(ra,e.nativeEvent);r(t,n),n.isCanceled||o(t)});return p.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:h,mounted:s,open:a,panelId:m,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,h,s,a,m,c,o,f,l])}var Ta=p.createContext(void 0);function Ea(){let e=p.useContext(Ta);if(e===void 0)throw Error(ci(15));return e}var Da=`data-starting-style`,Oa=`data-ending-style`,ka={[Da]:``},Aa={[Oa]:``},ja={transitionStatus(e){return e===`starting`?ka:e===`ending`?Aa:null}},Ma=`data-open`,Na=`data-closed`,Pa=Da,Fa=`data-panel-open`,Ia={[Ma]:``},La={[Na]:``},Ra={open(e){return e?{[Fa]:``}:null}},za={open(e){return e?Ia:La},...ja},Ba=p.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=Y(o),d=wa({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=p.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),h=p.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),g=Mi(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:za});return(0,m.jsx)(Ta.Provider,{value:h,children:g})}),Va={...Ra,...ja},Ha=p.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=Ea(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=mi({disabled:c,native:u});return Mi(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:Va})});function Ua(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var Wa=0,Ga=class e{static create(){return new e}currentId=Wa;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Wa,t()},e)}isStarted(){return this.currentId!==Wa}clear=()=>{this.currentId!==Wa&&(clearTimeout(this.currentId),this.currentId=Wa)};disposeEffect=()=>this.clear};function Ka(){let e=Vr(Ga.create).current;return va(e.disposeEffect),e}function qa(e){let t=Vr(Ja,e).current;return t.next=e,X(t.effect),t}function Ja(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ya(e){return e==null?e:`current`in e?e.current:e}function Xa(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Za=c(it(),1),Qa=null;function $a(e){if(!Qa){let e=[];Qa=e,queueMicrotask(()=>{Qa=null,Za.flushSync(()=>{for(let t of e)t()})})}Qa.push(e)}function eo(e,t=!1,n=!1){let r=Sa();return Y((i,a=null)=>{r.cancel();let o=Ya(e);if(o==null)return;let s=o,c=()=>{n?$a(()=>{a?.aborted||i()}):Za.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Xa(s).map(e=>e.finished.then(Ei))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Xa(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Da;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function to(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Y(a),s=eo(r,n,i);p.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var no={height:void 0,width:void 0};function ro(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=p.useRef(null),f=p.useRef(null),[m,h]=p.useState(no),g=p.useRef(no),_=p.useRef(!1),v=p.useRef(s),y=p.useRef(!1),[b,x]=p.useState(!1),S=p.useRef(null),C=_i(t,d),w=qa(s),T=eo(d),E=!s&&!a,D=b?`idle`:u,O=s&&(v.current||y.current),k=!s&&a&&f.current===`css-animation`&&m.height===void 0&&m.width===void 0?g.current:m,A=n&&E&&f.current!==`css-animation`,j=Y((e,t=!0)=>{t&&(g.current=e),h(e)}),M=Y(()=>{S.current?.(),S.current=null}),N=Y(e=>{M(),S.current=()=>{S.current=null,e()}}),P=Y(()=>{s&&a&&f.current===`css-animation`&&(y.current=!0)});X(()=>{b&&u!==`starting`&&x(!1)},[b,u]),p.useEffect(()=>()=>{P(),M()},[P,M]),X(()=>{s||(v.current=!1,y.current=!1);let e=d.current;if(!e)return;!s&&S.current&&M();let t=ao(e,O);if(f.current=t,s&&u===`idle`&&v.current&&t===`css-animation`){g.current=io(e);return}if(s&&u===`starting`){let n=_.current;if(_.current=!1,t===`none`){j(io(e)),x(!0);return}if(t===`css-transition`){let t=co(e);if(j(io(e)),!n)return t;let r=so(e,`transition-duration`,`0s`);return N(r),x(!0),t}j(io(e));let r=so(e,`animation-name`,`none`);if(!n){r();return}let i=so(e,`animation-duration`,`0s`);r(),N(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(t===`none`){j(no,!1),c(!1);return}j(io(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=io(e);n.height>0||n.width>0?(j(n),t===`css-animation`&&so(e,`animation-name`,`none`)()):c(!1)},[a,s,M,j,c,N,O,u]),to({enabled:s&&a&&D===`idle`,open:!0,ref:d,onComplete(){s&&j(no,!1)}}),p.useEffect(()=>{if(s||!a||D!==`ending`)return;if(!d.current){c(!1),j(no,!1);return}let e=new AbortController,t=-1;function n(){w.current||(c(!1),j(no,!1))}return t=xa.request(()=>{T(n,e.signal)}),()=>{xa.cancel(t),e.abort()}},[w,a,s,D,T,j,c]),X(()=>{let e=d.current;e&&n&&E&&e.setAttribute(`hidden`,`until-found`)},[E,n]),p.useEffect(function(){let e=d.current;if(!e)return;let t=Ga.create(),n=-1,r=(r,i)=>{t.start(0,()=>{w.current||(n=xa.request(()=>{w.current||(r&&(_.current=!1),i&&e.setAttribute(Pa,``),e.setAttribute(`hidden`,`until-found`))}))})},i=Ua(e,`beforematch`,t=>{let n=ea(na,t);if(o(!0,n),n.isCanceled){r(!1,!1);return}_.current=!0;let i=e.hasAttribute(Pa);e.removeAttribute(Pa),l(!0),r(!0,i)});return()=>{t.clear(),xa.cancel(n),i()}},[w,o,l]);let F=i||n||a||s;return{height:k.height,props:{...A?{[Pa]:``}:void 0,hidden:E,id:r},ref:C,shouldPreventOpenAnimation:O,shouldRender:F,transitionStatus:D,width:k.width}}function io(e){return{height:e.scrollHeight,width:e.scrollWidth}}function ao(e,t){let n=gr(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&oo(n.animationDuration),i=oo(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function oo(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function so(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function co(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=xa.request(n);return()=>{xa.cancel(r),n()}}var lo=`--collapsible-panel-height`,uo=`--collapsible-panel-width`,fo=p.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=Ea(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;X(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:D,width:O}=ro({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=ji(s,k),j=Mi(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[lo]:S===void 0?`auto`:`${S}px`,[uo]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:za});return E?j:null});function po({...e}){return(0,m.jsx)(Ba,{"data-slot":`collapsible`,...e})}function mo({...e}){return(0,m.jsx)(Ha,{"data-slot":`collapsible-trigger`,...e})}function ho({...e}){return(0,m.jsx)(fo,{"data-slot":`collapsible-content`,...e})}function go(e){return Mi(e.defaultTagName??`div`,e,e)}var _o=768;function vo(){let[e,t]=p.useState(void 0);return p.useEffect(()=>{let e=()=>{t(window.innerWidth<_o)};if(t(window.innerWidth<_o),typeof window.matchMedia!=`function`)return;let n=window.matchMedia(`(max-width: 767px)`);return n.addEventListener(`change`,e),()=>n.removeEventListener(`change`,e)},[]),!!e}function yo(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:bo,platform:xo,maxTouchPoints:So}=yo(),Co=bo.toLowerCase(),wo=xo.toLowerCase(),To=/^i(os$|p)/.test(wo)||wo===`macintel`&&So>1,Eo=`android`,Do=wo===Eo||Co.includes(Eo),Oo=!To&&wo.startsWith(`mac`);wo.startsWith(`win`),!Do&&/^(linux|chrome os)/.test(wo);var ko=Oo||To,Ao=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Ao&&Co.includes(`firefox`),!Ao&&Co.includes(`chrom`);var jo=ko,Mo=/jsdom|happydom/.test(Co);function No(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&xr(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Po(e,t){let n=e;for(;n;){if(yr(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(xr(n)?n.host:null)}return null}function Fo(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Io=`data-base-ui-focusable`,Lo=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Ro=`ArrowLeft`,zo=`ArrowRight`,Bo=`ArrowUp`,Vo=`ArrowDown`,Ho=`data-open`,Uo=`data-closed`,Wo=`data-anchor-hidden`,Go=`data-popup-open`,Ko=`data-pressed`,qo={[Go]:``},Jo={[Go]:``,[Ko]:``},Yo={[Ho]:``},Xo={[Uo]:``},Zo={[Wo]:``},Qo={open(e){return e?qo:null}},$o={open(e){return e?Jo:null}},es={open(e){return e?Yo:Xo},anchorHidden(e){return e?Zo:null}},ts={...es,...ja},ns=`data-trigger-disabled`;function rs(e,t){if(!yr(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(ns);for(let[,e]of t.entries())if(Z(e,n))return!e.hasAttribute(ns);return!1}function is(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function as(e){return e.matches(`html,body`)}function os(e){return br(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function ss(e){return Po(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Lo}`)!=null}function cs(e){return e?e.getAttribute(`role`)===`combobox`&&os(e):!1}function ls(e){if(!e||Mo)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function us(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function ds(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ds(e,t.id,n)])}function fs(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ps(e){e.preventDefault(),e.stopPropagation()}function ms(e){return`nativeEvent`in e}function hs(e){return e.pointerType===``&&e.isTrusted?!0:Do&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function gs(e){return Mo?!1:!Do&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Do||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function _s(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function vs(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var ys=Math.min,bs=Math.max,xs=Math.round,Ss=Math.floor,Cs=e=>({x:e,y:e}),ws={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ts(e,t,n){return bs(e,ys(t,n))}function Es(e,t){return typeof e==`function`?e(t):e}function Ds(e){return e.split(`-`)[0]}function Os(e){return e.split(`-`)[1]}function ks(e){return e===`x`?`y`:`x`}function As(e){return e===`y`?`height`:`width`}function js(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ms(e){return ks(js(e))}function Ns(e,t,n){n===void 0&&(n=!1);let r=Os(e),i=Ms(e),a=As(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Hs(o)),[o,Hs(o)]}function Ps(e){let t=Hs(e);return[Fs(e),t,Fs(t)]}function Fs(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Is=[`left`,`right`],Ls=[`right`,`left`],Rs=[`top`,`bottom`],zs=[`bottom`,`top`];function Bs(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ls:Is:t?Is:Ls;case`left`:case`right`:return t?Rs:zs;default:return[]}}function Vs(e,t,n,r){let i=Os(e),a=Bs(Ds(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Fs)))),a}function Hs(e){let t=Ds(e);return ws[t]+e.slice(t.length)}function Us(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Ws(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Us(e)}function Gs(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ks(e,t){return t<0||t>=e.length}function qs(e,t){return Xs(e.current,{disabledIndices:t})}function Js(e,t){return Xs(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ys(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Xs(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Ks(e,u)?-1:u,wrapped:d}}function Xs(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Zs(e,a,r));return a}function Zs(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!$s(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Qs(e){return e.visibility===`hidden`||e.visibility===`collapse`}function $s(e,t=e?Nr(e):null){return!e||!e.isConnected||!t||Qs(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var ec=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function tc(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return xr(n)?n.host:null}function nc(e){for(let t of Array.from(e.children))if(hr(t)===`summary`)return t;return null}function rc(e,t){let n=nc(t);return!!n&&(e===n||Z(n,e))}function ic(e){let t=e?hr(e):``;return e!=null&&e.matches(ec)&&(t!==`summary`||e.parentElement!=null&&hr(e.parentElement)===`details`&&nc(e.parentElement)===e)&&(t!==`details`||nc(e)==null)&&(t!==`input`||e.type!==`hidden`)}function ac(e){if(!ic(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=tc(t)){let n=t!==e,r=hr(t)===`slot`;if(t.hasAttribute(`inert`)||n&&hr(t)===`details`&&!t.open&&!rc(e,t)||t.hasAttribute(`hidden`)||!r&&!oc(t,n))return!1}return!0}function oc(e,t){let n=Nr(e);return t?n.display!==`none`:$s(e,n)}function sc(e){let t=e.tabIndex;if(t<0){let t=hr(e);if(t===`details`||t===`audio`||t===`video`||br(e)&&e.isContentEditable)return 0}return t}function cc(e){if(hr(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function lc(e,t){let n=cc(e);if(!n)return!0;let r=t.find(e=>{let t=cc(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=cc(e);return t?.name===n.name&&t.form===n.form})===n}function uc(e){if(br(e)&&hr(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return br(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function dc(e,t){uc(e).forEach(e=>{ic(e)&&t.push(e),dc(e,t)})}function fc(e,t,n){uc(e).forEach(e=>{br(e)&&e.matches(t)&&n.push(e),fc(e,t,n)})}function pc(e){return ac(e)&&sc(e)>=0}function mc(e){let t=[];return dc(e,t),t.filter(ac)}function hc(e){let t=mc(e);return t.filter(e=>sc(e)>=0&&lc(e,t))}function gc(e,t){let n=hc(e),r=n.length;if(r===0)return;let i=No(fi(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function _c(e){return gc(fi(e).body,1)||e}function vc(e){return gc(fi(e).body,-1)||e}function yc(e,t,n){if(!e)return null;let r=[];dc(fi(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(ac);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Z(n,o)&&pc(o)&&lc(o,a))return o}return r[i]}function bc(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z(n,r)}function xc(e){hc(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Sc(e){let t=[];fc(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Cc(e,t){let n=p.useRef(e),r=Y(t);X(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var wc=p.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Mi(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),Tc=p.createContext(void 0);function Ec(e){let t=p.useContext(Tc);if(!e&&t===void 0)throw Error(ci(27));return t}var Dc=p.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Ec(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Mi(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:ts,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Oc=p.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Ec(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=mi({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,ea(ca,e.nativeEvent))}return Mi(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),kc=p.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Ec(),c=$i(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Mi(`p`,e,{ref:t,props:[{id:c},o]})});function Ac(e,t){return t!=null&&!_s(t)?0:typeof e==`function`?e():e}function jc(e,t,n){let r=Ac(e,n);return typeof r==`number`?r:r?.[t]}function Mc(e){return typeof e==`function`?e():e}function Nc(e,t){return t||e===`click`||e===`mousedown`}function Pc(e){return e?.includes(`mouse`)&&e!==`mousedown`}var Fc=p.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ga,currentIdRef:{current:null},currentContextRef:{current:null}});function Ic(e,t){e.current=t.current}function Lc(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=p.useRef(n),a=p.useRef(n),o=p.useRef(null),s=p.useRef(null),c=Ka();return X(()=>{a.current=n,o.current?i.current={open:jc(i.current,`open`),close:jc(n,`close`)}:i.current=n},[n,o,i,a]),(0,m.jsx)(Fc.Provider,{value:p.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Rc(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=p.useContext(Fc),[d,f]=p.useState(!1),m=p.useRef(n);return X(()=>{m.current=n},[n]),X(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(m.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),X(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:jc(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,ea(na))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),X(()=>()=>{if(i.current===r){if(c.current=null,!m.current)return;i.current=null,Ic(a,s),u.clear()}},[c,i,a,r,s,u]),p.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function zc(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var Bc={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Vc={...Bc,position:`fixed`,margin:0,top:0,left:0};({...Bc});var Hc=p.forwardRef(function(e,t){let[n,r]=p.useState();X(()=>{jo&&Ao&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,m.jsx)(`span`,{...e,ref:t,style:Vc,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Uc(e){return`data-base-ui-${e}`}var Wc=0;function Gc(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Wc);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Ei;let o=requestAnimationFrame(a);return Wc=o,()=>{Wc===o&&(cancelAnimationFrame(o),Wc=0)}}var Kc=`data-base-ui-inert`,qc=new WeakMap,Jc=new WeakSet,Yc=new WeakMap,Xc=0;function Zc(e){return e?xr(e)?e.host:Zc(e.parentNode):null}var Qc=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Zc(t);return e.contains(n)?n:null}).filter(e=>e!=null),$c=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},el=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{hr(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function tl(e,t,n,{mark:r=!0}){let i=Qc(t,e),a=r?el(t,$c(i),new Set(i)):[],o=[],s=[];if(n){let e=Qc(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);el(t,$c(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(qc.get(e)||0)+1;qc.set(e,r),o.push(e),r===1&&n&&Jc.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Yc.get(e)||0)+1;Yc.set(e,t),s.push(e),t===1&&e.setAttribute(Kc,``)}),Xc+=1,()=>{o.forEach(e=>{let t=(qc.get(e)||0)-1;qc.set(e,t),t||(Jc.has(e)||e.removeAttribute(`aria-hidden`),Jc.delete(e))}),r&&s.forEach(e=>{let t=(Yc.get(e)||0)-1;Yc.set(e,t),t||e.removeAttribute(Kc)}),--Xc,Xc||(qc=new WeakMap,Jc=new WeakSet,Yc=new WeakMap)}}function nl(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=fi(e[0]).body;return tl(e,i,n,{mark:r})}var rl={style:{transition:`none`}},il=`data-base-ui-click-trigger`,al={fallbackAxisSide:`none`},ol={fallbackAxisSide:`end`},sl={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},cl=p.createContext(null),ll=()=>p.useContext(cl),ul=Uc(`portal`);function dl(e={}){let{ref:t,container:n,componentProps:r=Oi,elementProps:i}=e,a=Qi(),o=ll()?.portalNode,[s,c]=p.useState(null),[l,u]=p.useState(null),d=Y(e=>{e!==null&&u(e)}),f=p.useRef(null);X(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(vr(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let m=Mi(`div`,r,{ref:[t,d],props:[{id:a,[ul]:``},i]}),h=s&&m?Za.createPortal(m,s):null;return{node:l,nodeId:p.isValidElement(m)?m.props.id:void 0,subtree:h}}var fl=p.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=dl({container:o,ref:t,componentProps:e,elementProps:c}),f=p.useRef(null),h=p.useRef(null),g=p.useRef(null),_=p.useRef(null),[v,y]=p.useState(null),b=p.useRef(!1),x=v?.modal,S=v?.open,C=!!v&&!v.modal&&v.open&&!!l;p.useEffect(()=>{if(!l||x)return;function e(e){l&&e.relatedTarget&&bc(e)&&(e.type===`focusin`?b.current&&=(Sc(l),!1):(xc(l),b.current=!0))}return zc(Ua(l,`focusin`,e,!0),Ua(l,`focusout`,e,!0))},[l,x]),X(()=>{l&&S===!0&&b.current&&(Sc(l),b.current=!1)},[S,l]);let w=p.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:h,beforeInsideRef:g,afterInsideRef:_,portalNode:l,setFocusManagerState:y}),[l]);return(0,m.jsxs)(p.Fragment,{children:[d,(0,m.jsxs)(cl.Provider,{value:w,children:[C&&l&&(0,m.jsx)(Hc,{"data-type":`outside`,ref:f,onFocus:e=>{bc(e,l)?g.current?.focus():vc(v?v.domReference:null)?.focus()}}),C&&l&&(0,m.jsx)(`span`,{role:s,"aria-owns":u,style:sl}),l&&Za.createPortal(a,l),C&&l&&(0,m.jsx)(Hc,{"data-type":`outside`,ref:h,onFocus:e=>{bc(e,l)?_.current?.focus():(_c(v?v.domReference:null)?.focus(),v?.closeOnFocusOut&&v?.onOpenChange(!1,ea(`focus-out`,e.nativeEvent)))}})]})]})});function pl(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ml=class{nodesRef={current:[]};events=pl();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},hl=p.createContext(null),gl=p.createContext(null),_l=()=>p.useContext(hl)?.id||null,vl=e=>{let t=p.useContext(gl);return e??t};function yl(e){let t=Qi(),n=vl(e),r=_l();return X(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function bl(e){let{children:t,id:n}=e,r=_l();return(0,m.jsx)(hl.Provider,{value:p.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function xl(e){let{children:t,externalTree:n}=e,r=Vr(()=>n??new ml).current;return(0,m.jsx)(gl.Provider,{value:r,children:t})}function Sl(e,t){let n=gr(Fo(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(hs(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Cl=20,wl=[];function Tl(){wl=wl.filter(e=>e.deref()?.isConnected)}function El(e){Tl(),e&&hr(e)!==`body`&&(wl.push(new WeakRef(e)),wl.length>Cl&&(wl=wl.slice(-20)))}function Dl(){return Tl(),wl[wl.length-1]?.deref()}function Ol(e){return e?pc(e)?e:hc(e)[0]||e:null}function kl(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=mc(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return pc(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Al(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:g,getInsideElements:_}=e,v=t.useState(`open`),y=t.useState(`domReferenceElement`),b=t.useState(`floatingElement`),{events:x,dataRef:S}=t.context,C=Y(()=>S.current.floatingContext?.nodeId),w=i===!1,T=cs(y)&&w,E=qa(i),D=qa(a),O=qa(o),k=qa(u),A=qa(v),j=vl(g),M=ll(),N=p.useRef(!1),P=p.useRef(!1),F=p.useRef(!1),I=p.useRef(null),L=p.useRef(``),R=p.useRef(``),z=p.useRef(null),B=p.useRef(null),ee=_i(z,h,M?.beforeInsideRef),V=_i(B,M?.afterInsideRef),te=Ka(),ne=Ka(),H=Sa(),re=M!=null,U=us(b),ie=Y((e=U)=>e?hc(e):[]),W=Y(()=>_?.().filter(e=>e!=null)??[]);p.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Z(U,No(fi(U)))&&ie().length===0&&!T&&ps(e)}return Ua(fi(U),`keydown`,e)},[r,U,c,T,ie]),p.useEffect(()=>{if(r||!v)return;let e=fi(U);function t(){F.current=!1}function n(e){let t=Fo(e),n=W(),r=Z(b,t)||Z(y,t)||Z(M?.portalNode,t)||n.some(e=>e===t||Z(e,t));F.current=!r,R.current=e.pointerType||`keyboard`,Po(t,`[data-base-ui-click-trigger]`)&&(P.current=!0,ne.start(0,()=>{P.current=!1}))}function i(){R.current=`keyboard`}return zc(Ua(e,`pointerdown`,n,!0),Ua(e,`pointerup`,t,!0),Ua(e,`pointercancel`,t,!0),Ua(e,`keydown`,i,!0),t)},[r,b,y,U,v,M,ne,W]),p.useEffect(()=>{if(r||!l)return;let e=fi(U);function n(){P.current=!0,ne.start(0,()=>{P.current=!1})}function i(e){let t=Fo(e);pc(t)&&(I.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Fo(n);c&&r==null&&a!=null&&Z(b,a)&&El(a),queueMicrotask(()=>{let o=C(),l=t.context.triggerElements,u=W(),p=r?.hasAttribute(Uc(`focus-guard`))&&[z.current,B.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Ya(f),Ya(d)].includes(r),m=!(Z(y,r)||Z(b,r)||Z(r,b)||Z(M?.portalNode,r)||u.some(e=>e===r||Z(e,r))||l.hasMatchingElement(e=>Z(e,r))||p||j&&(ds(j.nodesRef.current,o).find(e=>Z(e.context?.elements.floating,r)||Z(e.context?.elements.domReference,r))||fs(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,us(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===y&&U&&kl(U),s&&i!==y&&!$s(a)&&No(e)===e.body){if(br(U)&&(U.focus(),s===`popup`)){H.request(()=>{U.focus()});return}let e=ie(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;br(n)&&n.focus()}S.current.insideReactTree?S.current.insideReactTree=!1:(T||!c)&&r&&m&&!P.current&&(T||r!==Dl())&&(N.current=!0,t.setOpen(!1,ea(la,n)))})}function o(){F.current||(S.current.insideReactTree=!0,te.start(0,()=>{S.current.insideReactTree=!1}))}let u=br(y)?y:null;if(b||u)return zc(u&&Ua(u,`focusout`,a),u&&Ua(u,`pointerdown`,n),b&&Ua(b,`focusin`,i),b&&Ua(b,`focusout`,a),b&&M&&Ua(b,`focusout`,o,!0))},[r,y,b,U,c,j,M,t,l,s,ie,T,C,S,te,ne,H,d,f,W]),p.useEffect(()=>{if(r||!b||!v)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${Uc(`portal`)}]`)||[]),t=(j?fs(j.nodesRef.current,C()):[]).find(e=>cs(e.context?.elements.domReference||null))?.context?.elements.domReference,n=nl([b,...e,z.current,B.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...W(),t,Ya(f),Ya(d),T?y:null].filter(e=>e!=null),{ariaHidden:c||T,mark:!1}),i=nl([b,...e].filter(e=>e!=null));return()=>{i(),n()}},[v,r,y,b,c,M,T,j,C,d,f,W]),X(()=>{if(!v||r||!br(U))return;L.current=``,R.current=``;let e=fi(U),t=No(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||Z(U,t))return;let i=null,a=()=>(i??=ie(U),i[0]||U),o;o=r===!0||r===null?a():Ya(r),o||=a();let s=Z(U,No(e)),c=S.current.openEvent,l=c?.type===`mousedown`&&hs(c);Gc(o,{sync:l,preventScroll:o===U,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=No(e);return!(t!==o&&Z(U,t))}})})},[r,v,U,ie,E,k,A,S]);let G=p.useRef(null);X(()=>{if(r||!U){G.current=null;return}G.current&&=(G.current.cancelled=!0,null);let e=fi(U),t=No(e),n=k.current==null;El(t);function i(e){if(e.open||(L.current=Sl(e.nativeEvent,R.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Uc(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(N.current=!0),e.reason===`outside-press`){if(e.nested)N.current=!1;else if(hs(e.nativeEvent)||gs(e.nativeEvent))N.current=!1;else{let e=!1;fi(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}}x.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=y?.isConnected?y:null,o=t?.isConnected&&hr(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Dl()||null,typeof i==`boolean`?s:Ya(i)||s||null}return()=>{x.off(`openchange`,i);let t=No(e),n=W(),r=Z(b,t)||n.some(e=>e===t||Z(e,t))||j&&ds(j.nodesRef.current,C(),!1).some(e=>Z(e.context?.elements.floating,t)),o=D.current,s=L.current,c=a(s),l={cancelled:!1};G.current=l,queueMicrotask(()=>{G.current===l&&(G.current=null);let n=Ol(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!N.current&&br(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,b,U,D,O,k,x,j,y,C,W]),X(()=>{if(!Ao||v||!b)return;let e=No(fi(b));br(e)&&os(e)&&Z(b,e)&&e.blur()},[v,b]),X(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:l,open:v,onOpenChange:t.setOpen,domReference:y}),()=>{M.setFocusManagerState(null)}},[r,M,c,v,t,l,y]),X(()=>{if(!r&&U)return kl(U),()=>{queueMicrotask(Tl)}},[r,U]);let ae=!r&&(!c||!T)&&(re||c);return(0,m.jsxs)(p.Fragment,{children:[ae&&(0,m.jsx)(Hc,{"data-type":`inside`,ref:ee,onFocus:e=>{if(c){let e=ie();Gc(e[e.length-1])}else M?.portalNode&&(N.current=!1,bc(e,M.portalNode)?_c(y)?.focus():Ya(f??M.beforeOutsideRef)?.focus())}}),n,ae&&(0,m.jsx)(Hc,{"data-type":`inside`,ref:V,onFocus:e=>{c?Gc(ie()[0]):M?.portalNode&&(l&&(N.current=!0),bc(e,M.portalNode)?vc(y)?.focus():Ya(d??M.afterOutsideRef)?.focus())}})]})}function jl(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=ra}=t,l=e.context.dataRef,u=p.useRef(void 0),d=Sa(),f=Ka(),m=p.useMemo(()=>{function t(t,n,r,i){let a=ea(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=_s(e.pointerType,!0)&&gs(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||_s(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=Fo(s),p=os(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:_s(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return p.useMemo(()=>n?{reference:m}:Oi,[n,m])}function Ml(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Nl(e){return e!=null&&e.clientX!=null}function Pl(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=p.useRef(!1),l=p.useRef(null),[u,d]=p.useState(),[f,m]=p.useState([]),h=Y(t=>{e.set(`positionReference`,t)}),g=Y((t,n,i)=>{c.current||(!s.current.openEvent||Nl(s.current.openEvent))&&e.set(`positionReference`,Ml(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),_=Y(e=>{i?l.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=_s(u)?a:i;p.useEffect(()=>{if(!n){h(o);return}if(!v)return;function e(){l.current?.(),l.current=null}let t=gr(a);function r(t){let n=Fo(t);Z(a,n)?e():g(t.clientX,t.clientY)}return!s.current.openEvent||Nl(s.current.openEvent)?l.current=Ua(t,`mousemove`,r):h(o),e},[v,n,a,s,o,e,g,h,f]),p.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),p.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),p.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let y=p.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return p.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function Fl(){return!1}function Il(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Ll(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Fl,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,m=vl(c),h=Y(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=Y(()=>a),{escapeKey:y,outsidePress:b}=Il(s),x=p.useRef(!1),S=p.useRef(!1),C=p.useRef(!1),w=p.useRef(!1),T=p.useRef(!1),E=p.useRef(``),D=p.useRef(null),O=Ka(),k=Ka(),A=Ka(),j=Y(()=>{k.clear(),d.current.insideReactTree=!1}),M=Y(e=>{let t=d.current.floatingContext?.nodeId;return(m?ds(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Y(t=>is(t,e.select(`floatingElement`))||is(t,e.select(`domReferenceElement`))),P=Y(t=>{o()&&e.setOpen(!1,ea(ra,t.nativeEvent))}),F=Y(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=ms(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=ea(ua,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=Y(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=Y(t=>{if(!l||!n||t.button!==0)return;let r=Fo(t.nativeEvent);Z(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=Y(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});p.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),p.useEffect(()=>j,[j]),p.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new Ga,i=fi(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(Ao?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=d.current.floatingContext?.nodeId,n=m&&ds(m.nodesRef.current,t).some(t=>is(e,t.context?.elements.floating));return N(e)||n}function k(n){if(p(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=Fo(n),i=`[${Uc(`inert`)}]`,a=yr(r)?r.getRootNode():null,o=Array.from((xr(a)?a:fi(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Z(e,r))))return;let c=yr(r)?r:null;for(;c&&!Mr(c);){let e=Fr(c);if(Mr(e)||!yr(e))break;c=e}if(!(o.length&&yr(r)&&!as(r)&&!Z(r,e.select(`floatingElement`))&&o.every(e=>!Z(c,e)))){if(br(r)&&!(`touches`in n)){let e=Mr(r),t=Nr(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!h(n)){if(f()===`intentional`){if(n.detail!==0&&!hs(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof g==`function`&&!g(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,ea(oa,n)),j())}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=Fo(e);if(!n)return;let r=Ua(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():h(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())))}function ee(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function V(e){L(e,ee)}function te(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ne(e){L(e,te)}let H=zc(r&&zc(Ua(i,`keydown`,F),Ua(i,`compositionstart`,a),Ua(i,`compositionend`,o)),_&&zc(Ua(i,`click`,z,!0),Ua(i,`pointerdown`,z,!0),Ua(i,`pointerup`,B,!0),Ua(i,`pointercancel`,B,!0),Ua(i,`mousedown`,z,!0),Ua(i,`mouseup`,B,!0),Ua(i,`touchstart`,R,{capture:!0,passive:!0}),Ua(i,`touchmove`,V,{capture:!0,passive:!0}),Ua(i,`touchend`,ne,{capture:!0,passive:!0})));return()=>{H(),t.clear(),c(),C.current=!1}},[d,u,r,_,g,l,n,y,b,F,j,v,M,N,m,e,O,A]);let z=p.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=p.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return p.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}function Rl(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),X(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};yr(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function zl(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=Y(i),{mounted:c,setMounted:l,transitionStatus:u}=Ca(t,!1,!1,o),d=!t&&r;X(()=>{t&&s(!1)},[t,s]);let f=p.useRef(c),m=p.useRef(!1),h=Ji(),g=()=>{f.current=!1,l(!1),a()};X(()=>{f.current=c,m.current&&(m.current=!1,!t&&c&&g())});let _=Y(()=>{f.current&&(t?(m.current=!0,h()):g())});return to({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||_()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:_}}var Bl={tabIndex:-1,[Io]:``};function Vl(e){return t=>t!==`touch`||e.current}function Hl(e,t=!1){let n=Qi(),r=_l()!=null,i=Vr(()=>e(n,r)).current;return Rl({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Ul({handle:e,store:t}){return X(()=>e.attachStore(t),[e,t]),null}function Wl(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Gl(e,t){let n=p.useRef(null);return Y(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Wl(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Wl(t))})}function Kl(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function ql(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Jl(e,t,n,r={}){let i=n.reason,a=i===ia,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=ql(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Kl(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Za.flushSync(l):l()}function Yl(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Gl(e,n),o=Y(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Y(e=>{a(e),e&&o(e)});return X(()=>(s(t.current),()=>s(null)),[s,t,n,e]),X(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Xl(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=p.useRef(null),i=e.useState(`open`);X(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=ea(na);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Zl(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=zl({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return Vr(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Ql(e,t){e.useSyncedValues(t),X(()=>()=>{e.update({activeTriggerProps:Oi,inactiveTriggerProps:Oi,popupProps:Oi})},[e])}function $l(e,t){X(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),X(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var eu=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},tu=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),nu=o(((e,t)=>{t.exports=tu()})),ru=o((e=>{var t=u(),n=nu();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),iu=o(((e,t)=>{t.exports=ru()})),au=[],ou=void 0;function su(){return ou}function cu(e){au.push(e)}function lu(e){let t=(t,n)=>{let r=Vr(du).current,i;try{ou=r;for(let e of au)e.before(r);i=e(t,n);for(let e of au)e.after(r);r.didInitialize=!0}finally{ou=void 0}return i};return t.displayName=e.displayName||e.name,t}function uu(e){return p.forwardRef(lu(e))}function du(){return{didInitialize:!1}}var fu=nu(),pu=c(iu(),1),mu=wi(19)?_u:vu;function hu(e,t,n,r,i){return mu(e,t,n,r,i)}function gu(e,t,n,r,i){let a=p.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,fu.useSyncExternalStore)(e.subscribe,a,a)}cu({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,fu.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function _u(e,t,n,r,i){let a=su();if(!a)return gu(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function vu(e,t,n,r,i){return(0,pu.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var yu=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return hu(this,e,t,n,r)}},bu=class extends yu{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){p.useDebugValue(e);let n=this;X(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;X(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;X(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){p.useDebugValue(e);let n=this,r=t!==void 0;X(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return p.useDebugValue(e),hu(this,this.selectors[e],t,n,r)}useContextCallback(e,t){p.useDebugValue(e);let n=Y(t??Ei);this.context[e]=n}useStateSetter(e){let t=p.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},xu={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},Su=class extends bu{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:pl(),nested:n,triggerElements:i},xu),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&vs(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Cu(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Su({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Oi,inactiveTriggerProps:Oi,popupProps:Oi}}var wu=e=>e.triggerIdProp??e.activeTriggerId,Tu=e=>e.openProp??e.open,Eu=e=>(e.popupElement?.id??e.floatingId)||void 0;function Du(e,t){return t!==void 0&&Tu(e)&&wu(e)===t}function Ou(e,t){return Du(e,t)?!0:t!==void 0&&Tu(e)&&wu(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var ku={open:Tu,mounted:e=>e.mounted,transitionStatus:e=>Tu(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:wu,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Eu,isTriggerActive:(e,t)=>t!==void 0&&wu(e)===t,isOpenedByTrigger:(e,t)=>Du(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&wu(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Ou(e,t)?Eu(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Au(e){let t=p.useCallback(t=>e===void 0?Ei:e.subscribeStore(t),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,fu.useSyncExternalStore)(t,n,()=>e?.serverStore)}var ju=Oo&&Ao;function Mu(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=p.useRef(!1),s=p.useRef(null),c=p.useRef(!0),l=Ka();p.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=gr(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&br(t)&&t===No(fi(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return zc(Ua(r,`blur`,i),ju&&Ua(r,`keydown`,a,!0),ju&&Ua(r,`pointerdown`,l,!0))},[e,n]),p.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);yr(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=p.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=Fo(n.nativeEvent);if(yr(a)){if(ju&&!n.relatedTarget){if(!c.current&&!os(a))return}else if(!ls(a))return}let u=rs(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,ea(aa,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,ea(aa,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=yr(r)&&r.hasAttribute(Uc(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=No(fi(t));!r&&n===t||Z(a.current.floatingContext?.refs.floating.current,n)||Z(t,n)||o||rs(r??n,e.context.triggerElements)||e.setOpen(!1,ea(aa,i))})}}},[a,r,e,l]);return p.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var Nu=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Ga;restTimeout=new Ga;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Pu=new WeakMap;function Fu(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Pu.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Pu.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Iu(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Pu.get(n);a&&a!==e&&Fu(a),Fu(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Pu.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Lu(e){let t=e.context.dataRef.current,n=Vr(()=>t.hoverInteractionState??Nu.create()).current;return t.hoverInteractionState||=n,va(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ru(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=vl(),u=_l(),d=Lu(e),f=Ka(),m=Y(()=>Nc(c.current.openEvent?.type,d.interactedInside)),h=Y(()=>Pc(c.current.openEvent?.type)),g=Y(()=>{Fu(d)});X(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,g())},[a,d,g]),p.useEffect(()=>g,[g]),X(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&h()&&yr(s)&&o){let e=s,t=o,n=fi(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??Po(e,`[data-rootownerid]`)??n.body;return Iu(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,a,s,o,d,h,l,u,g]),p.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&ds(l.nodesRef.current,u).length>0)}function a(t){let n=jc(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,ea(ia,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=Fo(e);ss(t)?d.interactedInside=Po(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function p(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),g()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(rs(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&yr(o)&&ds(l.nodesRef.current,r,!1).some(e=>Z(e.context?.elements.floating,o))||(d.handler?d.handler(n):(g(),h()&&!m()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,ea(ia,n)),l.events.emit(`floating.closed`,n)})}let y=o;return zc(y&&Ua(y,`mouseenter`,p),y&&Ua(y,`mouseleave`,_),y&&Ua(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,h,m,g,d,l,u,f])}var zu={current:null};function Bu(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=zu,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:m,guardStaleOpen:h=!1}=t,{dataRef:g,events:_}=e.context,v=vl(l),y=Lu(e),b=p.useRef(!1),x=qa(i),S=qa(r),C=qa(o),w=qa(n),T=qa(m),E=qa(f),D=Y(()=>Nc(g.current.openEvent?.type,y.interactedInside)),O=Y(()=>T.current?.()!==!1),k=Y((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Z(t,n);if(!yr(r))return!1;let a=r;return i.hasMatchingElement(e=>Z(e,a))&&(!t||!Z(t,a))}),A=Y(()=>{y.handler&&=(fi(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=Y(()=>{Fu(y)});return u&&(y.handleCloseOptions=i?.__options),p.useEffect(()=>A,[A]),p.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===ia,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),p.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=jc(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,ea(ia,t)),v?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,ea(ia,t)),v?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!yr(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!_s(y.pointerType))return;let n=Mc(C.current),r=jc(S.current,`open`,y.pointerType),i=Fo(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(yr(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Z(t,i)){c=t;break}}yr(o)&&yr(s)&&!e.context.triggerElements.hasElement(o)&&Z(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&b.current,p=!l&&yr(c)&&yr(s)&&Z(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,ea(ia,t,c)):m||(r?y.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,ea(ia,t,c))}):g&&O()&&e.setOpen(!0,ea(ia,t,c)))}function o(n){if(D()){j();return}A();let r=fi(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=g.current.floatingContext??d?.();if(!rs(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:v,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n)}else y.pointerType===`touch`&&Z(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){Z(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let f=h?Ua(r,`mouseout`,l):void 0;return s?zc(Ua(r,`mousemove`,i,{once:!0}),Ua(r,`mouseenter`,i),Ua(r,`mouseleave`,o),f):zc(Ua(r,`mouseenter`,i),Ua(r,`mouseleave`,o),f)},[A,j,g,S,e,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,h]),p.useMemo(()=>{if(!n)return;function t(e){y.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!_s(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;Iu(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=Mc(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,ea(ia,n,r))}y.pointerType===`touch`?Za.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}function Vu(e){return Ao&&e.movementX===0&&e.movementY===0}function Hu(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Uu(e,t){return Hu(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Wu(e,t,n){return Hu(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Gu(e,t,n){return Hu(t,n?e===Ro:e===zo,e===Vo)}function Ku(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Hu(t,n?e===zo:e===Ro,e===Bo)}function qu(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=us(D),j=cs(O),M=qa(A),N=_l(),P=vl(S),F=p.useRef(f),I=p.useRef(o??-1),L=p.useRef(null),R=p.useRef(!0),z=Y(e=>{i(I.current===-1?null:I.current,e)}),B=p.useRef(!!D),ee=p.useRef(E),V=p.useRef(!1),te=p.useRef(!1),ne=p.useRef(null),H=qa(g),re=qa(E),U=qa(o),ie=qa(x),W=Sa(),G=Sa(),ae=Y(()=>{W.cancel();function e(e){d||(ne.current=Gc(e,{sync:V.current,preventScroll:!0}))}let t=n.current[I.current],r=te.current;t&&e(t),(V.current?e=>e():e=>W.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),de&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});X(()=>{k.current.orientation=_},[k,_]),X(()=>{E||(L.current=null),E&&f===`auto`||(F.current=f)},[E,f]),X(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(te.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),X(()=>{if(a){if(!E)V.current=!1;else if(D){if(r==null){if(V.current=!1,U.current!=null)return;if(B.current&&(I.current=-1,ae()),(!ee.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>G.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||Wu(L.current,v,u)||l?qs(n):Js(n),L.current=null,z())};t()}}else Ks(n.current,r)||(I.current=r,ae(),te.current=!1)}}},[a,E,D,r,U,l,n,v,u,z,ae,G]),X(()=>{if(!a||D||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=No(fi(O??t??null)),r=e.some(e=>e.context&&Z(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),X(()=>{ee.current=E,B.current=!!D});let oe=r!=null,se=Y(e=>{if(!re.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),ce=Y(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),le=Y(()=>qs(n,H.current)),ue=Y(t=>{if(R.current=!1,V.current=!0,t.which===229||!re.current&&t.currentTarget===M.current)return;if(l&&Ku(t.key,_,u,T)){Uu(t.key,ce())||ps(t),e.setOpen(!1,ea(da,t.nativeEvent));let n=C?.current??O;br(n)&&n.focus();return}r!=null&&r!==I.current&&!Ks(n.current,r)&&(I.current=r);let i=I.current,a=qs(n,g),o=Js(n,g);if(j||(t.key===`Home`&&(ps(t),I.current=a,z(t)),t.key===`End`&&(ps(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,_,c,u,g,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),_===`both`)return}if(Uu(t.key,_)){ps(t);let e=No(t.currentTarget.ownerDocument);if(E&&!d&&Z(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Z(t,e))){I.current=Wu(t.key,_,u)?a:o,z(t),r===I.current&&ae();return}let{index:l,wrapped:f}=Ys(n.current,i,{decrement:!Wu(t.key,_,u),loopFocus:c,allowEscape:s,disabledIndices:g,minIndex:a,maxIndex:o});f&&(V.current=!1),I.current=l,z(t)}}),de=p.useMemo(()=>({onFocus(e){V.current=!0,se(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Vu(e)||(V.current=!0,te.current=!1,m&&se(e))},onPointerLeave(e){if(!re.current||!R.current||e.pointerType===`touch`)return;V.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&ie.current&&(ne.current?.(),ne.current=null,I.current=-1,z(e),!d)){let e=M.current,t=No(fi(e));e&&Z(e,t)&&e.focus({preventScroll:!0})}}}),[se,re,M,m,n,z,ie,d]),fe=p.useMemo(()=>d&&E&&oe&&{"aria-activedescendant":`${b}-${r}`},[d,E,oe,b,r]),pe=p.useMemo(()=>({...j?{}:fe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!d){let n=Fo(t.nativeEvent);if(n&&!Z(M.current,n))return;ps(t);let r=ea(la,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&br(i)&&i.focus()}else ue(t)},onPointerMove(e){Vu(e)||(R.current=!0)}}),[fe,ue,M,j,e,E,d,O,C]),me=p.useMemo(()=>{function t(t){e.setOpen(!0,ea(da,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&hs(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&gs(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=Gu(n.key,ce(),u),o=Uu(n.key,r?_:v),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||os(n.currentTarget)))return ue(n);if(r||h||!i){if(s){let e=Uu(n.key,ce());L.current=l&&e?null:n.key}l?a&&(ps(n),r?(I.current=le(),z(n),d&&M.current?.focus()):t(n)):o&&(U.current!=null&&(I.current=U.current),ps(n),!r&&h?t(n):ue(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[ue,f,le,l,z,e,h,_,v,ce,u,U,d,M]),he=p.useMemo(()=>({...fe,...me}),[fe,me]);return p.useMemo(()=>a?{reference:he,floating:pe,item:de,trigger:me}:{},[a,he,pe,me,de])}function Ju(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=Y(s),f=e.useState(`open`),m=Ka(),h=p.useRef(``),g=p.useRef(u??i??-1),_=p.useRef(null),v=Y(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!$s(n)||n?.matches(`:disabled`)?!1:o==null||!Zs(Di,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let p=n.current;if(h.current.length>0&&e.key===` `&&(ps(e),d?.(!0)),h.current.length>0&&h.current[0]!==` `&&c(p,h.current)===-1&&e.key!==` `&&d?.(!1),p==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(ps(e),d?.(!0));let v=h.current===``;v&&(g.current=u??i??-1),p.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(l,()=>{h.current=``,g.current=_.current,d?.(!1)});let y=((v?u??i??-1:g.current)??0)+1,b=c(p,h.current,y);b===-1?e.key!==` `&&(h.current=``,d?.(!1)):(a?.(b,e),_.current=b)}),y=Y(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Z(r,n)||Z(i,n)||(m.clear(),h.current=``,g.current=_.current,d?.(!1))});X(()=>{(f||u===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,d?.(!1)))},[f,u,m,d]);let b=p.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return p.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Yu=.1,Xu=Yu*Yu,Q=.5;function Zu(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Qu(e,t,n,r,i,a,o,s,c,l){let u=!1;return Zu(e,t,n,r,i,a)&&(u=!u),Zu(e,t,i,a,o,s)&&(u=!u),Zu(e,t,o,s,c,l)&&(u=!u),Zu(e,t,c,l,n,r)&&(u=!u),u}function $u(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function ed(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function td(e={}){let{blockPointerEvents:t=!1}=e,n=new Ga,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Xu;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Fo(r),g=r.type===`mouseleave`,_=Z(u,h),v=Z(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&yr(r.relatedTarget)&&Z(u,r.relatedTarget))return;function y(){return!!(s&&ds(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=ed(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=ed(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=ed(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=ed(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!$u(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Q/2:Q*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Q+1,o=C||T?S.bottom-Q:S.top,s=C?T?S.bottom-Q:S.top:S.bottom-Q;M=Qu(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Q/2:Q*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Q,o=C||T?S.top+Q:S.bottom,s=C?T?S.top+Q:S.bottom:S.top+Q;M=Qu(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Q/2:Q*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Q+1,o=w||E?S.right-Q:S.left,s=w?E?S.right-Q:S.left:S.right-Q;M=Qu(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Q/2:Q*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Q,o=w||E?S.left+Q:S.right,s=w?E?S.left+Q:S.right:S.left+Q;M=Qu(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function nd(e,t,n){let{reference:r,floating:i}=e,a=js(t),o=Ms(t),s=As(o),c=Ds(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Os(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function rd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Es(t,e),p=Ws(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Gs(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Gs(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var id=50,ad=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:rd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=nd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<id&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=nd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},od=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Es(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ds(r),_=js(o),v=Ds(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Hs(o)]:Ps(o)),x=p!==`none`;!d&&x&&b.push(...Vs(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ns(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===js(t)||T.every(e=>js(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=js(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},sd=new Set([`left`,`top`]);async function cd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ds(n),s=Os(n),c=js(n)===`y`,l=sd.has(o)?-1:1,u=a&&c?-1:1,d=Es(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ld=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await cd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ud=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Es(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=js(i),p=ks(f),m=u[p],h=u[f],g=(e,t)=>Ts(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},dd=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Es(e,t),u={x:n,y:r},d=js(i),f=ks(d),p=u[f],m=u[d],h=Es(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=sd.has(Ds(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},fd=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Es(e,t),c=await i.detectOverflow(t,s),l=Ds(n),u=Os(n),d=js(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=ys(p-c[m],g),y=ys(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*bs(c.left,c.right):S=p-2*bs(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function pd(e){let t=Nr(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=br(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=xs(n)!==a||xs(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function md(e){return yr(e)?e:e.contextElement}function hd(e){let t=md(e);if(!br(t))return Cs(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=pd(t),o=(a?xs(n.width):n.width)/r,s=(a?xs(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var gd=Cs(0);function _d(e){let t=gr(e);return!jr()||!t.visualViewport?gd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vd(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===gr(e)}function yd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=md(e),o=Cs(1);t&&(r?yr(r)&&(o=hd(r)):o=hd(e));let s=vd(a,n,r)?_d(a):Cs(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=gr(a),t=yr(r)?gr(r):r,n=e,i=Rr(n);for(;i&&t!==n;){let e=hd(i),t=i.getBoundingClientRect(),r=Nr(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=gr(i),i=Rr(n)}}return Gs({width:u,height:d,x:c,y:l})}function bd(e,t){let n=Pr(e).scrollLeft;return t?t.left+n:yd(_r(e)).left+n}function xd(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-bd(e,n),y:n.top+t.scrollTop}}function Sd(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=_r(r),s=t?wr(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Cs(1),u=Cs(0),d=br(r);if((d||!a)&&((hr(r)!==`body`||Sr(o))&&(c=Pr(r)),d)){let e=yd(r);l=hd(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?xd(o,c):Cs(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Cd(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function wd(e){let t=Pr(e),n=e.ownerDocument.body,r=bs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=bs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+bd(e),o=-t.scrollTop;return Nr(n).direction===`rtl`&&(a+=bs(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Td=25;function Ed(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=gr(e),a=_r(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!jr()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(bd(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Td&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Dd(e,t){let n=yd(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=hd(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Od(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ed(e,n,t);else if(t===`document`)r=wd(_r(e));else if(yr(t))r=Dd(t,n);else{let n=_d(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Gs(r)}function kd(e,t){let n=t.get(e);if(n)return n;let r=Lr(e,[],!1).filter(e=>yr(e)&&hr(e)!==`body`),i=null,a=Nr(e).position===`fixed`,o=a?Fr(e):e;for(;yr(o)&&!Mr(o);){let e=Nr(o),t=kr(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Fr(o)}return t.set(e,r),r}function Ad(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?wr(t)?[]:kd(t,this._c):[].concat(n),r],o=Od(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Od(t,a[e],i);s=bs(n.top,s),c=ys(n.right,c),l=ys(n.bottom,l),u=bs(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function jd(e){let{width:t,height:n}=pd(e);return{width:t,height:n}}function Md(e,t,n){let r=br(t),i=_r(t),a=n===`fixed`,o=yd(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Cs(0);if((r||!a)&&((hr(t)!==`body`||Sr(i))&&(s=Pr(t)),r)){let e=yd(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=bd(i));let l=i&&!r&&!a?xd(i,s):Cs(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Nd(e){return Nr(e).position===`static`}function Pd(e,t){if(!br(e)||Nr(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return _r(e)===n&&(n=n.ownerDocument.body),n}function Fd(e,t){let n=gr(e);if(wr(e))return n;if(!br(e)){let t=Fr(e);for(;t&&!Mr(t);){if(yr(t)&&!Nd(t))return t;t=Fr(t)}return n}let r=Pd(e,t);for(;r&&Cr(r)&&Nd(r);)r=Pd(r,t);return r&&Mr(r)&&Nd(r)&&!kr(r)?n:r||Ar(e)||n}var Id=async function(e){let t=this.getOffsetParent||Fd,n=this.getDimensions,r=await n(e.floating);return{reference:Md(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ld(e){return Nr(e).direction===`rtl`}var Rd={convertOffsetParentRelativeRectToViewportRelativeRect:Sd,getDocumentElement:_r,getClippingRect:Ad,getOffsetParent:Fd,getElementRects:Id,getClientRects:Cd,getDimensions:jd,getScale:hd,isElement:yr,isRTL:Ld};function zd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bd(e,t,n){let r=null,i,a=_r(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ss(d),h=Ss(a.clientWidth-(u+f)),g=Ss(a.clientHeight-(d+p)),_=Ss(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:bs(0,ys(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!zd(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=gr(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Vd(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=md(e),u=i||a?[...l?Lr(l):[],...t?Lr(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Bd(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?yd(e):null;c&&g();function g(){let t=yd(e);h&&!zd(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Hd=ld,Ud=ud,Wd=od,Gd=fd,Kd=dd,qd=(e,t,n)=>{let r=new Map,i=n??{},a={...Rd,...i.platform,_c:r};return ad(e,t,{...i,platform:a})},Jd=typeof document<`u`?p.useLayoutEffect:function(){};function Yd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Yd(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Yd(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Xd(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zd(e,t){let n=Xd(e);return Math.round(t*n)/n}function Qd(e){let t=p.useRef(e);return Jd(()=>{t.current=e}),t}function $d(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=p.useState(r);Yd(f,r)||m(r);let[h,g]=p.useState(null),[_,v]=p.useState(null),y=p.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=p.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=p.useRef(null),w=p.useRef(null),T=p.useRef(u),E=c!=null,D=Qd(c),O=Qd(i),k=Qd(l),A=p.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),qd(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Yd(T.current,t)&&(T.current=t,Za.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Jd(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=p.useRef(!1);Jd(()=>(j.current=!0,()=>{j.current=!1}),[]),Jd(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=p.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=p.useMemo(()=>({reference:x,floating:S}),[x,S]),P=p.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Zd(N.floating,u.x),r=Zd(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Xd(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var ef=(e,t)=>{let n=Hd(e);return{name:n.name,fn:n.fn,options:[e,t]}},tf=(e,t)=>{let n=Ud(e);return{name:n.name,fn:n.fn,options:[e,t]}},nf=(e,t)=>({fn:Kd(e).fn,options:[e,t]}),rf=(e,t)=>{let n=Wd(e);return{name:n.name,fn:n.fn,options:[e,t]}},af=(e,t)=>{let n=Gd(e);return{name:n.name,fn:n.fn,options:[e,t]}},of=p.createContext(void 0);function sf(){let e=p.useContext(of);if(e===void 0)throw Error(ci(26));return e}var cf=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),lf=`--nested-dialogs`,uf=`data-nested-dialog-open`,df={...es,...ja,nestedDialogOpen(e){return e?{[uf]:``}:null}},ff=p.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Ec(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),h=c.useState(`mounted`),g=c.useState(`nested`),_=c.useState(`nestedOpenDialogCount`),v=c.useState(`open`),y=c.useState(`openMethod`),b=c.useState(`titleElementId`),x=c.useState(`transitionStatus`),S=c.useState(`role`),C=d.useState(`floatingId`);sf(),to({open:v,ref:c.context.popupRef,onComplete(){v&&c.context.onOpenChangeComplete?.(!0)}});let w=o===void 0?Vl(c.context.popupRef):o,T=_>0,E=c.useStateSetter(`popupElement`),D=Mi(`div`,e,{state:{open:v,nested:g,transitionStatus:x,nestedDialogOpen:T},props:[f,{id:C,"aria-labelledby":b,"aria-describedby":l,role:S,...Bl,hidden:!h,onKeyDown(e){cf.has(e.key)&&e.stopPropagation()},style:{[lf]:_}},s],ref:[t,c.context.popupRef,E],stateAttributesMapping:df});return(0,m.jsx)(Al,{context:d,openInteractionType:y,disabled:!h,closeOnFocusOut:!u,initialFocus:w,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:D})});function pf(e){return wi(19)?e:e?`true`:void 0}var mf=p.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,m.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),hf=p.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Ec(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,m.jsx)(of.Provider,{value:n,children:(0,m.jsxs)(fl,{ref:t,...r,children:[a&&o===!0&&(0,m.jsx)(mf,{ref:i.context.internalBackdropRef,inert:pf(!s)}),e.children]})}):null}),gf={},_f={},vf=``;function yf(e,t){return Sr(e)?e:t}function bf(e,t,n){return/hidden|clip/.test(e.getComputedStyle(yf(t,n)).overflowY)}function xf(e){if(typeof document>`u`)return!1;let t=fi(e);return gr(t).innerWidth-t.documentElement.clientWidth>0}function Sf(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=fi(e),n=t.documentElement,r=t.body,i=yf(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Cf(e){let t=fi(e),n=t.documentElement,r=t.body,i=yf(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function wf(e){let t=fi(e),n=t.documentElement,r=t.body,i=gr(n),a=0,o=0,s=!1,c=xa.create();if(Ao&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,gf={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},vf=n.style.scrollBehavior,_f={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=yf(n,r);s=Sf(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,gf),Object.assign(r.style,_f),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=vf)}function d(){u(),c.request(l)}l();let f=Ua(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Tf=new class{lockCount=0;restore=null;timeoutLock=Ga.create();timeoutUnlock=Ga.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=fi(e),n=t.documentElement,r=t.body,i=gr(n);if(bf(i,n,r)){let t=new i.MutationObserver(()=>{bf(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=To||!xf(e);this.restore=a?Cf(e):wf(e)}};function Ef(e=!0,t=null){X(()=>{if(e)return Tf.acquire(t)},[e,t])}function Df({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=p.useState(0),[d,f]=p.useState(0),m=l===0,h=Ll(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Fo(t);if(m&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Z(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return Ef(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),X(()=>{!r&&!i&&(u(0),f(0))},[r,i]),X(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),Ql(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var Of={...ku,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},kf=class extends bu{constructor(e,t,n){let r=new eu,i=Af(e,r,t,n);super(i,jf(r),Of)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(Kl(this.state,e,t.trigger)))}};function Af(e,t,n,r=!1){return{...Cu(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 jf(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Mf(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,h=e===`drawer`,g=e===`alert-dialog`,_=g?!0:c,v=g||s,y=g?`alertdialog`:`dialog`,b=Ec(!0),x={modal:_,disablePointerDismissal:v,nested:b!=null,role:y},S=Hl((e,t)=>new kf({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...x},e,t),!0);S.useControlledProp(`openProp`,r),S.useControlledProp(`triggerIdProp`,d),S.useSyncedValues(x),S.useContextCallback(`onOpenChange`,a),S.useContextCallback(`onOpenChangeComplete`,o);let C=S.useState(`open`),w=S.useState(`mounted`),T=S.useState(`payload`);$l(S,C),Xl(S);let{forceUnmount:E}=Zl(C,S);p.useImperativeHandle(l,()=>({unmount:E,close:()=>S.setOpen(!1,ea(_a))}),[E,S]);let D=C||w||u!=null;return(0,m.jsxs)(Tc.Provider,{value:S,children:[u&&(0,m.jsx)(Ul,{handle:u,store:S}),D&&(0,m.jsx)(Df,{store:S,parentContext:b?.context,isDrawer:h}),typeof n==`function`?n({payload:T}):n]})}var Nf=lu(function(e){return Mf(`dialog`,e)}),Pf=p.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Ec(),c=$i(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Mi(`h2`,e,{ref:t,props:[{id:c},o]})});function Ff(e){let t=p.useRef(``),n=p.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:p.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function If(e,t){let{onClick:n,onPointerDown:r}=Ff(Y((n,r)=>{(typeof e==`function`?e():e)||t(r||(To?`touch`:``))}));return p.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Lf(e){let[t,n]=p.useState(null),r=If(e,n);return Cc(e,t=>{t&&!e&&n(null)}),p.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Rf({...e}){return(0,m.jsx)(Nf,{"data-slot":`sheet`,...e})}function zf({...e}){return(0,m.jsx)(hf,{"data-slot":`sheet-portal`,...e})}function Bf({className:e,...t}){return(0,m.jsx)(Dc,{"data-slot":`sheet-overlay`,className:J(`fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function Vf({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,m.jsxs)(zf,{children:[(0,m.jsx)(Bf,{}),(0,m.jsxs)(ff,{"data-slot":`sheet-content`,"data-side":n,className:J(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,m.jsxs)(Oc,{"data-slot":`sheet-close`,render:(0,m.jsx)(Wi,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,m.jsx)(ht,{}),(0,m.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Hf({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sheet-header`,className:J(`flex flex-col gap-1.5 p-4`,e),...t})}function Uf({className:e,...t}){return(0,m.jsx)(Pf,{"data-slot":`sheet-title`,className:J(`cn-font-heading font-medium text-foreground`,e),...t})}function Wf({className:e,...t}){return(0,m.jsx)(kc,{"data-slot":`sheet-description`,className:J(`text-sm text-muted-foreground`,e),...t})}function Gf({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`skeleton`,className:J(`animate-pulse rounded-md bg-muted`,e),...t})}var Kf=p.createContext(void 0);function qf(e){let t=p.useContext(Kf);if(t===void 0&&!e)throw Error(ci(72));return t}var Jf={...ku,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Yf=class extends bu{constructor(e,t,n){let r=new eu;super(Xf(e,r,t,n),Zf(r),Jf)}setOpen=(e,t)=>{Jl(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,ea(ra,e))}};function Xf(e,t,n,r=!1){return{...Cu(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 Zf(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Qf=lu(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,h=Hl((e,t)=>new Yf({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));h.useControlledProp(`openProp`,r),h.useControlledProp(`triggerIdProp`,u),h.useContextCallback(`onOpenChange`,s),h.useContextCallback(`onOpenChangeComplete`,c);let g=h.useState(`open`),_=!t&&g,v=h.useState(`activeTriggerId`),y=h.useState(`mounted`),b=h.useState(`payload`);h.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Xl(h,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:x,transitionStatus:S}=Zl(_,h),C=h.useState(`isInstantPhase`),w=h.useState(`instantType`),T=h.useState(`lastOpenChangeReason`),E=p.useRef(null);X(()=>{g&&t&&h.setOpen(!1,ea(ga))},[g,t,h]),X(()=>{S===`ending`&&T===`none`||S!==`ending`&&C?(w!==`delay`&&(E.current=w),h.set(`instantType`,`delay`)):E.current!==null&&(h.set(`instantType`,E.current),E.current=null)},[S,C,T,w,h]),X(()=>{_&&(v??h.set(`payload`,void 0))},[h,v,_]),p.useImperativeHandle(o,()=>({unmount:x,close:()=>h.setOpen(!1,ea(_a))}),[x,h]);let D=_||y||!t&&a!==`none`;return(0,m.jsxs)(Kf.Provider,{value:h,children:[l&&(0,m.jsx)(Ul,{handle:l,store:h}),D&&(0,m.jsx)($f,{store:h,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:b}):f]})});function $f({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Ll(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Pl(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=p.useMemo(()=>Jr(a.reference,i.reference),[a.reference,i.reference]);return Ql(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??Oi}),null}var ep=p.createContext(void 0);function tp(){return p.useContext(ep)}var np=`data-base-ui-tooltip-trigger`;function rp(e){let t=Fo(e);return yr(t)?t:null}var ip=uu(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,m=qf(!0),h=Au(a)??m;if(!h)throw Error(ci(82));let g=$i(d),_=h.useState(`isTriggerActive`,g),v=h.useState(`isOpenedByTrigger`,g),y=h.useState(`floatingRootContext`),b=p.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=Yl(g,b,h,{payload:o,closeOnClick:l,closeDelay:x}),w=tp(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=Rc(y,{open:v}),k=Lu(y);h.useSyncedValue(`isInstantPhase`,D);let A=h.useState(`disabled`),j=s??A,M=qa(j),N=h.useState(`trackCursorAxis`),P=h.useState(`disableHoverablePopup`),F=p.useRef(!1),I=Ka(),L=p.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=b.current;if(!t||!e)return!1;let n=Po(e,`[${np}]`);return n!==null&&n!==t&&Z(t,n)}function B(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let ee=Bu(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?td():null,restMs:R,delay(){return u==null&&O?{close:jc(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),V=Mu(y,{enabled:!j}).reference,te=e=>{let t=F.current,n=rp(e),r=B(n),i=b.current,a=i&&n&&Z(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`)h.setOpen(!1,ea(ia,e));else if(t&&!r&&a&&!M.current&&!h.select(`open`)&&i&&_s(L.current)){let t=()=>{F.current||M.current||h.select(`open`)||h.setOpen(!0,ea(ia,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ne=h.useState(`appliedTriggerProps`,C||N!==`none`);return Mi(`button`,e,{state:{open:v},ref:[t,S,b],props:[ee,V,ne,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){z(rp(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,h.set(`closeOnClick`,l),l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},id:g,[ns]:j?``:void 0,[np]:j?void 0:``},f],stateAttributesMapping:Qo})}),ap=p.createContext(void 0);function op(){let e=p.useContext(ap);if(e===void 0)throw Error(ci(70));return e}var sp=p.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=dl({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,m.jsxs)(p.Fragment,{children:[l,c&&Za.createPortal(n,c)]})}),cp=p.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return qf().useState(`mounted`)||n?(0,m.jsx)(ap.Provider,{value:n,children:(0,m.jsx)(sp,{ref:t,...r})}):null}),lp=p.createContext(void 0);function up(){let e=p.useContext(lp);if(e===void 0)throw Error(ci(71));return e}function dp(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=p.useState(null),d=p.useRef(null),f=vl(n),m=p.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),h=$d({...e,elements:{...m,...l&&{reference:l}}}),g=p.useCallback(e=>{let t=yr(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=p.useMemo(()=>({...h.refs,setPositionReference:g,domReference:d}),[h.refs,g]),v=p.useMemo(()=>({...h.elements,domReference:o}),[h.elements,o]),y=p.useMemo(()=>({...h,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:_,elements:v,nodeId:t,rootStore:r}),[h,_,v,t,r,s,c]);return X(()=>{o&&(d.current=o)},[o]),X(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),p.useMemo(()=>({...h,context:y,refs:_,elements:v,rootStore:r}),[h,_,v,y,r])}var fp=p.createContext(void 0);function pp(){return p.useContext(fp)?.direction??`ltr`}var mp=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Es(e,t)||{};if(l==null)return{};let d=Ws(u),f={x:n,y:r},p=Ms(i),m=As(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=Ts(D,k,O),j=!c.arrow&&Os(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),hp=(e,t)=>{let{name:n,fn:r}=mp(e);return{name:n,fn:r,options:[e,t]}},gp={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},_p={sideX:`left`,sideY:`top`},vp=`--available-width`,yp=`--available-height`,bp=`--anchor-width`,xp=`--anchor-height`,Sp=`--transform-origin`,Cp=vp,wp=yp;function Tp(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Ep(e,t,n){let{rects:r,placement:i}=e;return{side:Tp(t,Ds(i),n),align:Os(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Dp(e){return Op(e,dp)}function Op(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=Y(k),j=k?A:n,M=qa(n),N=qa(_),P=pp()===`rtl`,[F,I]=p.useState(null);!_&&F!==null&&I(null);let L=S===`placement`,R=F?Ds(F):null,z=F&&L?Os(F)||`center`:null,B=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],ee=z||o,V=ee===`center`?B:`${B}-${ee}`,te=l;typeof te==`number`?te={top:te,right:te,bottom:te,left:te}:te&&={top:te.top||0,right:te.right||0,bottom:te.bottom||0,left:te.left||0};let ne=+(i===`bottom`),H=+(i===`top`),re=+(i===`right`),U=+(i===`left`),ie={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:te},W=p.useRef(null),G=qa(a),ae=qa(s),oe=typeof a==`function`?0:a,se=typeof s==`function`?0:s,ce=[];m&&ce.push(m),ce.push(ef(e=>{let t=Ep(e,i,P),n=typeof G.current==`function`?G.current(t):G.current,r=typeof ae.current==`function`?ae.current(t):ae.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[oe,se,P,i]));let le=T===`none`&&w!==`shift`,ue=!le&&(u||D||w===`shift`),de=w===`none`?null:rf({...ie,padding:{top:te.top+1+ne,right:te.right+1+U,bottom:te.bottom+1+H,left:te.left+1+re},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),fe=le?null:tf({...ie,rootBoundary:O,mainAxis:T!==`none`,crossAxis:ue,limiter:u||D?void 0:nf(e=>{if(!W.current)return{};let{width:t,height:n}=W.current.getBoundingClientRect(),r=js(Ds(e.placement)),i=r===`y`?t:n,a=r===`y`?te.left+te.right:te.top+te.bottom;return{offset:i/2+a/2}})},[ie,u,D,O,te,T]);w===`shift`||T===`shift`||ee===`center`?ce.push(fe,de):ce.push(de,fe),ce.push(af({...ie,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(Cp,`${t}px`),i.setProperty(wp,`${n}px`);let a=gr(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(bp,`${u}px`),i.setProperty(xp,`${d}px`)}}),hp(e=>({element:W.current||fi(e.elements.floating).createElement(`div`),padding:W.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Ds(r),u=Os(r),d=js(l)===`y`,f=W.current,p=typeof a==`function`?a(Ep(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ue&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Sp,d?`${m} ${h}`:`${h} ${m}`),{}}},gp,x),X(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let pe=p.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:g,open:h?_:void 0,placement:V,middleware:ce,strategy:r,whileElementsMounted:h?void 0:(...e)=>Vd(...e,pe),nodeId:b,externalTree:C}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||_p,Ee=Se?r:`fixed`,De=p.useMemo(()=>{let e;return e=Se?x?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[Cp]=`100vw`,e[wp]=`100vh`,Se||(e.opacity=0),e},[x,Ee,we,ge,Te,_e,Ce,Se]),Oe=p.useRef(null);X(()=>{if(!_)return;let e=M.current,t=typeof e==`function`?e():e,n=(kp(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[_,me,j,M]),p.useEffect(()=>{if(!_)return;let e=M.current;typeof e!=`function`&&kp(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[_,me,j,M]),p.useEffect(()=>{if(h&&_&&he.reference&&he.floating)return Vd(he.reference,he.floating,ye,pe)},[h,_,he,ye,pe]);let ke=Ds(be),Ae=Tp(i,ke,P),je=Os(be)||`center`,Me=!!ve.hide?.referenceHidden;X(()=>{S&&_&&Se&&(ke!==B||L&&je!==ee)&&I(be)},[S,L,_,Se,be,ke,je,B,ee]);let Ne=p.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),Pe=ve.arrow?.centerOffset!==0;return p.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:W,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Ne,W,Pe,Ae,je,ke,Me,me,xe,Se,ye])}function kp(e){return e!=null&&`current`in e}function Ap(e){return e===`starting`?rl:Oi}function jp(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Mi(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Ap(r),i],stateAttributesMapping:es})}var Mp=p.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=ol,style:v,...y}=e,b=qf(),x=op(),S=b.useState(`open`),C=b.useState(`mounted`),w=b.useState(`trackCursorAxis`),T=b.useState(`disableHoverablePopup`),E=b.useState(`floatingRootContext`),D=b.useState(`instantType`),O=b.useState(`transitionStatus`),k=Dp({anchor:i,positionMethod:a,floatingRootContext:E,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:h,arrowPadding:f,disableAnchorTracking:g,keepMounted:x,collisionAvoidance:_,adaptiveOrigin:b.useState(`adaptiveOrigin`)}),A=jp(e,p.useMemo(()=>({open:S,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:w===`none`?D:`tracking-cursor`}),[S,k.side,k.align,k.anchorHidden,w,D]),{styles:k.positionerStyles,transitionStatus:O,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!C,inert:!S||w===`both`||T});return(0,m.jsx)(lp.Provider,{value:k,children:A})}),Np=p.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=qf(),{side:s,align:c}=up(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);to({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Ru(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Mi(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Bl,f,Ap(d),a],stateAttributesMapping:ts})}),Pp=p.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=qf(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=up();return Mi(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:es})}),Fp=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=p.useMemo(()=>({open:t,close:n}),[t,n]);return(0,m.jsx)(ep.Provider,{value:t,children:(0,m.jsx)(Lc,{delay:i,timeoutMs:r,children:e.children})})};function Ip({delay:e=0,...t}){return(0,m.jsx)(Fp,{"data-slot":`tooltip-provider`,delay:e,...t})}function Lp({...e}){return(0,m.jsx)(Qf,{"data-slot":`tooltip`,...e})}function Rp({...e}){return(0,m.jsx)(ip,{"data-slot":`tooltip-trigger`,...e})}function zp({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,m.jsx)(cp,{children:(0,m.jsx)(Mp,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,m.jsxs)(Np,{"data-slot":`tooltip-content`,className:J(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,m.jsx)(Pp,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var Bp=`sidebar_state`,Vp=604800,Hp=`16rem`,Up=`18rem`,Wp=`3rem`,Gp=`b`,Kp=p.createContext(null);function qp(){let e=p.useContext(Kp);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Jp({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=vo(),[c,l]=p.useState(!1),[u,d]=p.useState(e),f=t??u,h=p.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${Bp}=${t}; path=/; max-age=${Vp}`},[n,f]),g=p.useCallback(()=>s?l(e=>!e):h(e=>!e),[s,h,l]);p.useEffect(()=>{let e=e=>{e.key===Gp&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),g())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g]);let _=f?`expanded`:`collapsed`,v=p.useMemo(()=>({state:_,open:f,setOpen:h,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:g}),[_,f,h,s,c,l,g]);return(0,m.jsx)(Kp.Provider,{value:v,children:(0,m.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":Hp,"--sidebar-width-icon":Wp,...i},className:J(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function Yp({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=qp();return n===`none`?(0,m.jsx)(`div`,{"data-slot":`sidebar`,className:J(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,m.jsx)(Rf,{open:l,onOpenChange:u,...o,children:(0,m.jsxs)(Vf,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":Up},side:e,children:[(0,m.jsxs)(Hf,{className:`sr-only`,children:[(0,m.jsx)(Uf,{children:`Sidebar`}),(0,m.jsx)(Wf,{children:`Displays the mobile sidebar.`})]}),(0,m.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,m.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,m.jsx)(`div`,{"data-slot":`sidebar-gap`,className:J(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,m.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:J(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,m.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function Xp({className:e,onClick:t,...n}){let{toggleSidebar:r}=qp();return(0,m.jsxs)(Wi,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:J(e),onClick:e=>{t?.(e),r()},...n,children:[(0,m.jsx)(gt,{className:`cn-rtl-flip`}),(0,m.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function Zp({className:e,...t}){return(0,m.jsx)(`main`,{"data-slot":`sidebar-inset`,className:J(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function Qp({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:J(`flex flex-col gap-2 p-2`,e),...t})}function $p({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:J(`flex flex-col gap-2 p-2`,e),...t})}function em({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:J(`no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function tm({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:J(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function nm({className:e,render:t,...n}){return go({defaultTagName:`div`,props:Jr({className:J(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,e)},n),render:t,state:{slot:`sidebar-group-label`,sidebar:`group-label`}})}function rm({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:J(`w-full text-sm`,e),...t})}function im({className:e,...t}){return(0,m.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:J(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function am({className:e,...t}){return(0,m.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:J(`group/menu-item relative`,e),...t})}var om=Hi(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function sm({render:e,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let{isMobile:s,state:c}=qp(),l=go({defaultTagName:`button`,props:Jr({className:J(om({variant:n,size:r}),a)},o),render:i?(0,m.jsx)(Rp,{render:e}):e,state:{slot:`sidebar-menu-button`,sidebar:`menu-button`,size:r,active:t}});return i?(typeof i==`string`&&(i={children:i}),(0,m.jsxs)(Lp,{children:[l,(0,m.jsx)(zp,{side:`right`,align:`center`,hidden:c!==`collapsed`||s,...i})]})):l}function cm({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:J(`pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground`,e),...t})}function lm(e){return typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)&&!/[\u0000-\u001f\u007f]/.test(e)}function um(e){return typeof e==`object`&&e?e:void 0}function dm(e){return typeof e==`string`&&e.trim()!==``?e:void 0}function fm(e){let t=um(e)??{},n={},r=um(t.switcher);r&&lm(r.endpoint)&&typeof r.others==`number`&&r.others>0&&(n.switcher={endpoint:r.endpoint,others:r.others});let i=um(t.search);i&&lm(i.endpoint)?n.search={endpoint:i.endpoint}:n.switcher&&(n.search={endpoint:`${n.switcher.endpoint}/search`});let a=um(t.viewer),o=dm(a?.label);if(a&&o){let e=dm(a.email),t=dm(a.role);n.viewer={label:o,...e?{email:e}:{},...t?{role:t}:{}}}let s=um(t.signOut);if(s&&lm(s.action)){let e=dm(s.csrfToken);n.signOut={action:s.action,...e?{csrfToken:e}:{}}}else s&&lm(s.href)&&(n.signOut={href:s.href});return n}function pm(e){if(typeof document>`u`)return{};let t=document.getElementById(e);if(t===null)return{};try{return fm(JSON.parse(t.textContent??``))}catch{return{}}}function mm(e){return typeof e==`object`&&e?e:void 0}function hm(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=mm(n);e&&typeof e.id==`string`&&typeof e.title==`string`&&lm(e.href)&&t.push({id:e.id,title:e.title,...typeof e.package==`string`?{package:e.package}:{},icon:Nt(e.icon),href:e.href})}return t}function gm(e){let t=mm(e),n=Array.isArray(t?.results)?t.results:Array.isArray(t?.groups)?t.groups:[],r=[];for(let e of n){let t=mm(e);if(!t||typeof t.id!=`string`||typeof t.title!=`string`||!Array.isArray(t.hits))continue;let n=[];for(let e of t.hits){let t=mm(e);t&&typeof t.title==`string`&&lm(t.href)&&n.push({title:t.title,...typeof t.subtitle==`string`?{subtitle:t.subtitle}:{},href:t.href})}n.length>0&&r.push({id:t.id,title:t.title,icon:Nt(t.icon),hits:n})}return r}async function _m(e,t){let n=await fetch(e,{headers:{accept:`application/json`},credentials:`same-origin`,...t?{signal:t}:{}});if(!n.ok)throw Error(`HTTP ${n.status}`);return n.json()}var vm;function ym(e){if(vm?.endpoint===e.endpoint)return vm.result;let t=_m(e.endpoint).then(e=>hm(mm(e)?.consoles)).catch(()=>[]);return vm={endpoint:e.endpoint,result:t},t}async function bm(e,t,n){return gm(await _m(`${e.endpoint}?q=${encodeURIComponent(t)}`,n))}var xm=1,Sm=.9,Cm=.8,wm=.17,Tm=.1,Em=.999,Dm=.9999,Om=.99,km=/[\\\/_+.#"@\[\(\{&]/,Am=/[\\\/_+.#"@\[\(\{&]/g,jm=/[\s-]/,Mm=/[\s-]/g;function Nm(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?xm:Om;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Nm(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=xm:km.test(e.charAt(l-1))?(d*=Cm,p=e.slice(i,l-1).match(Am),p&&i>0&&(d*=Em**+p.length)):jm.test(e.charAt(l-1))?(d*=Sm,m=e.slice(i,l-1).match(Mm),m&&i>0&&(d*=Em**+m.length)):(d*=wm,i>0&&(d*=Em**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Dm)),(d<Tm&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Nm(e,t,n,r,l+1,a+2,o),f*Tm>d&&(d=f*Tm)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Pm(e){return e.toLowerCase().replace(Mm,` `)}function Fm(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Nm(e,t,Pm(e),Pm(t),0,0,{})}var Im=Object.defineProperty,Lm=(e,t)=>Im(e,`name`,{value:t,configurable:!0}),Rm=!!(typeof window<`u`&&window.document&&window.document.createElement);function zm(e,t,{checkForDefaultPrevented:n=!0}={}){return Lm(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Lm(zm,`composeEventHandlers`);function Bm(e){if(!Rm)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Lm(Bm,`getOwnerWindow`);function Vm(e){if(!Rm)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Lm(Vm,`getOwnerDocument`);function Hm(e,t=!1){let{activeElement:n}=Vm(e);if(!n?.nodeName)return null;if(Um(n)&&n.contentDocument)return Hm(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Vm(n).getElementById(e);if(t)return t}}return n}Lm(Hm,`getActiveElement`);function Um(e){return e.tagName===`IFRAME`}Lm(Um,`isFrame`);var Wm=Object.defineProperty,Gm=(e,t)=>Wm(e,`name`,{value:t,configurable:!0});function Km(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Gm(Km,`setRef`);function qm(...e){return t=>{let n=!1,r=e.map(e=>{let r=Km(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Km(e[t],null)}}}}Gm(qm,`composeRefs`);function Jm(...e){return p.useCallback(qm(...e),e)}Gm(Jm,`useComposedRefs`);var Ym=Object.defineProperty,Xm=(e,t)=>Ym(e,`name`,{value:t,configurable:!0});function Zm(e,t){let n=p.createContext(t);n.displayName=e+`Context`;let r=Xm(e=>{let{children:t,...r}=e,i=p.useMemo(()=>r,Object.values(r));return(0,m.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=p.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Xm(i,`useContext`),[r,i]}Xm(Zm,`createContext`);function Qm(e,t=[]){let n=[];function r(t,r){let i=p.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Xm(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=p.useMemo(()=>o,Object.values(o));return(0,m.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=p.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Xm(s,`useContext`),[o,s]}Xm(r,`createContext`);let i=Xm(()=>{let t=n.map(e=>p.createContext(e));return Xm(function(n){let r=n?.[e]||t;return p.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,$m(i,...t)]}Xm(Qm,`createContextScope`);function $m(...e){let t=e[0];if(e.length===1)return t;let n=Xm(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Xm(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Xm($m,`composeContextScopes`);var eh=globalThis?.document?p.useLayoutEffect:()=>{},th=Object.defineProperty,nh=(e,t)=>th(e,`name`,{value:t,configurable:!0}),rh=p.useId||(()=>void 0),ih=0;function ah(e){let[t,n]=p.useState(rh());return eh(()=>{e||n(e=>e??String(ih++))},[e]),e||(t?`radix-${t}`:``)}nh(ah,`useId`);var oh=Object.defineProperty,sh=(e,t)=>oh(e,`name`,{value:t,configurable:!0}),ch=p.useEffectEvent,lh=p.useInsertionEffect;function uh(e){if(typeof ch==`function`)return ch(e);let t=p.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof lh==`function`?lh(()=>{t.current=e}):eh(()=>{t.current=e}),p.useMemo(()=>((...e)=>t.current?.(...e)),[])}sh(uh,`useEffectEvent`);var dh=Object.defineProperty,fh=(e,t)=>dh(e,`name`,{value:t,configurable:!0}),ph=p.useInsertionEffect||eh;function mh({prop:e,defaultProp:t,onChange:n=fh(()=>{},`onChange`),caller:r}){let[i,a,o]=hh({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,p.useCallback(t=>{if(s){let n=gh(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}fh(mh,`useControllableState`);function hh({defaultProp:e,onChange:t}){let[n,r]=p.useState(e),i=p.useRef(n),a=p.useRef(t);return ph(()=>{a.current=t},[t]),p.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}fh(hh,`useUncontrolledState`);function gh(e){return typeof e==`function`}fh(gh,`isFunction`);var _h=Symbol(`RADIX:SYNC_STATE`);function vh(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=uh(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=p.useReducer((t,n)=>{if(n.type===_h)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),m=d.state,h=p.useRef(m);p.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=p.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return p.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:_h,state:i})},[i,d.state,c]),[g,f]}fh(vh,`useControllableStateReducer`);var yh=Object.defineProperty,bh=(e,t)=>yh(e,`name`,{value:t,configurable:!0});function xh(e){let t=p.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=jh(r),p.Children.forEach(r,e=>{if(Dh(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;kh(n)&&typeof Fh==`function`;)n=Fh(n._payload);a=wh(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=p.cloneElement(a,void 0,s):!o&&p.Children.count(r)===1&&p.isValidElement(r)&&(a=r);let c=a?Eh(a):void 0,l=Jm(n,c);if(!a){if(r||r===0)throw Error(o?Ph(e):Nh(e));return r}let u=Th(i,a.props??{});return a.type!==p.Fragment&&(u.ref=n?l:c),p.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}bh(xh,`createSlot`);var Sh=Symbol.for(`radix.slottable`);function Ch(e){let t=bh(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Sh,t}bh(Ch,`createSlottable`);var wh=bh((e,t)=>`child`in e.props?p.isValidElement(t)?p.cloneElement(t,void 0,e.props.children(t.props.children)):null:p.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function Th(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Mh(a,i))}return{...e,...n}}bh(Th,`mergeProps`);function Eh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}bh(Eh,`getElementRef`);function Dh(e){return p.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Sh}bh(Dh,`isSlottable`);var Oh=Symbol.for(`react.lazy`);function kh(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Oh&&`_payload`in e&&Ah(e._payload)}bh(kh,`isLazyComponent`);function Ah(e){return typeof e==`object`&&!!e&&`then`in e}bh(Ah,`isPromiseLike`);function jh(e){let t=e;for(;kh(t)&&typeof Fh==`function`;)t=Fh(t._payload);return t}bh(jh,`useUnwrappedLazy`);function Mh(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}bh(Mh,`concatAriaDescribedby`);var Nh=bh(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ph=bh(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Fh=p.use,Ih=Object.defineProperty,Lh=(e,t)=>Ih(e,`name`,{value:t,configurable:!0}),Rh=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=xh(`Primitive.${t}`),r=p.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,m.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zh(e,t){e&&Za.flushSync(()=>e.dispatchEvent(t))}Lh(zh,`dispatchDiscreteCustomEvent`);var Bh=Object.defineProperty,Vh=(e,t)=>Bh(e,`name`,{value:t,configurable:!0}),Hh=p.useInsertionEffect;function Uh(e){let t=p.useRef(e);return typeof Hh==`function`?Hh(()=>{t.current=e}):eh(()=>{t.current=e}),p.useMemo(()=>((...e)=>t.current?.(...e)),[])}Vh(Uh,`useCallbackRef`);var Wh=Object.defineProperty,Gh=(e,t)=>Wh(e,`name`,{value:t,configurable:!0}),Kh=`dismissableLayer.update`,qh=`dismissableLayer.pointerDownOutside`,Jh=`dismissableLayer.focusOutside`,Yh,Xh=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Zh=p.forwardRef(Gh(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=p.useContext(Xh),[d,f]=p.useState(null),h=d?.ownerDocument??globalThis?.document,[,g]=p.useState({}),_=Jm(t,f),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?v.indexOf(y):-1,x=d?v.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,w=p.useRef(!1),T=eg(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:h,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return C&&!t},[u.branches,C])}),E=tg(e=>{if(r&&w.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},h),D=d?x===v.length-1:!1,O=Uh(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return p.useEffect(()=>{if(D)return h.addEventListener(`keydown`,O,{capture:!0}),()=>h.removeEventListener(`keydown`,O,{capture:!0})},[h,D,O]),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Yh=h.body.style.pointerEvents,h.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ng(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=Yh))}},[d,h,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ng())},[d,u]),p.useEffect(()=>{let e=Gh(()=>g({}),`handleUpdate`);return document.addEventListener(Kh,e),()=>document.removeEventListener(Kh,e)},[]),(0,m.jsx)(Rh.div,{...l,ref:_,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:zm(e.onFocusCapture,E.onFocusCapture),onBlurCapture:zm(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:zm(e.onPointerDownCapture,T.onPointerDownCapture)})},`DismissableLayer`));function Qh(){let e=p.useContext(Xh),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Gh(Qh,`useDismissableLayerSurface`);var $h=Gh(()=>!0,`IS_TRUE`);function eg(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=$h}=t,s=Uh(e),c=p.useRef(!1),l=p.useRef(!1),u=p.useRef(new Map),d=p.useRef(()=>{});return p.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Gh(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Gh(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Gh(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Gh(p,`handleInteractionBubble`);let m=Gh(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||rg(qh,s,p,{discrete:!0})};if(Gh(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Gh(()=>c.current=!0,`onPointerDownCapture`)}}Gh(eg,`usePointerDownOutside`);function tg(e,t=globalThis?.document){let n=Uh(e),r=p.useRef(!1);return p.useEffect(()=>{let e=Gh(e=>{e.target&&!r.current&&rg(Jh,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Gh(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Gh(()=>r.current=!1,`onBlurCapture`)}}Gh(tg,`useFocusOutside`);function ng(){let e=new CustomEvent(Kh);document.dispatchEvent(e)}Gh(ng,`dispatchUpdate`);function rg(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?zh(i,a):i.dispatchEvent(a)}Gh(rg,`handleAndDispatchCustomEvent`);var ig=Object.defineProperty,ag=(e,t)=>ig(e,`name`,{value:t,configurable:!0}),og=`focusScope.autoFocusOnMount`,sg=`focusScope.autoFocusOnUnmount`,cg={bubbles:!1,cancelable:!0},lg=p.forwardRef(ag(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=p.useState(null),u=Uh(a),d=Uh(o),f=p.useRef(null),h=Jm(t,l),g=p.useRef(i);p.useEffect(()=>{g.current=i});let _=p.useCallback(e=>e?c?.contains(e)?!0:!!g.current?.some(t=>t.contains(e)):!1,[c]),v=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let e=function(e){if(v.paused||!c)return;let t=e.target;_(t)?f.current=t:bg(f.current,{select:!0})},t=function(e){if(v.paused||!c)return;let t=e.relatedTarget;t!==null&&(_(t)||bg(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&bg(c)};ag(e,`handleFocusIn`),ag(t,`handleFocusOut`),ag(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,v.paused,_]),p.useEffect(()=>{if(c){xg.add(v);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(og,cg);c.addEventListener(og,u),c.dispatchEvent(t),t.defaultPrevented||(mg(wg(gg(c)),{select:!0}),document.activeElement===e&&bg(c))}return()=>{c.removeEventListener(og,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(sg,cg);c.addEventListener(sg,d),c.dispatchEvent(r),r.defaultPrevented||bg(e??t.body,{select:!0}),c.removeEventListener(sg,d),xg.remove(v)},0)}}},[c,u,d,v]);let y=p.useCallback(e=>{if(!n&&!r||v.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=hg(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&bg(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&bg(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,v.paused]);return(0,m.jsx)(Rh.div,{tabIndex:-1,...s,ref:h,onKeyDown:y})},`FocusScope`)),ug=p.createContext(null);function dg({registry:e,children:t}){return e?(0,m.jsx)(ug.Provider,{value:e,children:t}):t}ag(dg,`FocusScopeBranchProvider`);function fg(){let[e,t]=p.useState([]);return{nodes:e,registry:p.useMemo(()=>({add:ag(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:ag(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}ag(fg,`useFocusScopeBranchRegistry`);function pg(e){let t=p.useContext(ug);p.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}ag(pg,`useFocusScopeBranch`);function mg(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(bg(r,{select:t}),document.activeElement!==n)return}ag(mg,`focusFirst`);function hg(e){let t=gg(e);return[_g(t,e),_g(t.reverse(),e)]}ag(hg,`getTabbableEdges`);function gg(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ag(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}ag(gg,`getTabbableCandidates`);function _g(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):vg(r,{upTo:t})))return r}ag(_g,`findVisible`);function vg(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}ag(vg,`isHidden`);function yg(e){return e.tagName===`INPUT`&&typeof e.select==`function`}ag(yg,`isSelectableInput`);function bg(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&yg(e)&&t&&e.select()}}ag(bg,`focus`);var xg=Sg();function Sg(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Cg(e,t),e.unshift(t)},remove(t){e=Cg(e,t),e[0]?.resume()}}}ag(Sg,`createFocusScopesStack`);function Cg(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ag(Cg,`arrayRemove`);function wg(e){return e.filter(e=>e.tagName!==`A`)}ag(wg,`removeLinks`);var Tg=Object.defineProperty,Eg=p.forwardRef(((e,t)=>Tg(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=p.useState(!1);eh(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Za.createPortal((0,m.jsx)(Rh.div,{...r,ref:t}),o):null},`Portal`)),Dg=Object.defineProperty,Og=(e,t)=>Dg(e,`name`,{value:t,configurable:!0});function kg(e,t){return p.useReducer((e,n)=>t[e][n]??e,e)}Og(kg,`useStateMachine`);var Ag=Og(e=>{let{present:t,children:n}=e,r=jg(t),i=typeof n==`function`?n({present:r.isPresent}):p.Children.only(n),a=Ng(r.ref,Fg(i));return typeof n==`function`||r.isPresent?p.cloneElement(i,{ref:a}):null},`Presence`);function jg(e){let[t,n]=p.useState(),r=p.useRef(null),i=p.useRef(e),a=p.useRef(`none`),o=p.useRef(void 0),[s,c]=kg(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return p.useEffect(()=>{s===`mounted`?(a.current=o.current??Pg(r.current),o.current=void 0):a.current=`none`},[s]),eh(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Pg(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),eh(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Og(a=>{let o=Pg(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Og(e=>{e.target===t&&(a.current=Pg(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:p.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Pg(t)}else r.current=null;n(e)},[])}}Og(jg,`usePresence`);function Mg(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Og(Mg,`setRef`);function Ng(...e){let t=p.useRef(e);return t.current=e,p.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Mg(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Mg(n[e],null)}}},[])}Og(Ng,`useStableComposedRefs`);function Pg(e){return e?.animationName||`none`}Og(Pg,`getAnimationName`);function Fg(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Og(Fg,`getElementRef`);var Ig=Object.defineProperty,Lg=(e,t)=>Ig(e,`name`,{value:t,configurable:!0}),Rg=0,zg=null;function Bg(e){return Vg(),e.children}Lg(Bg,`FocusGuards`);function Vg(){p.useEffect(()=>{zg||={start:Hg(),end:Hg()};let{start:e,end:t}=zg;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Rg++,()=>{Rg===1&&(zg?.start.remove(),zg?.end.remove(),zg=null),Rg=Math.max(0,Rg-1)}},[])}Lg(Vg,`useFocusGuards`);function Hg(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Lg(Hg,`createFocusGuard`);var Ug=function(){return Ug=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ug.apply(this,arguments)};function Wg(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Gg(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Kg=`right-scroll-bar-position`,qg=`width-before-scroll-bar`,Jg=`with-scroll-bars-hidden`,Yg=`--removed-body-scroll-bar-size`;function Xg(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Zg(e,t){var n=(0,p.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Qg=typeof window<`u`?p.useLayoutEffect:p.useEffect,$g=new WeakMap;function e_(e,t){var n=Zg(t||null,function(t){return e.forEach(function(e){return Xg(e,t)})});return Qg(function(){var t=$g.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Xg(e,null)}),i.forEach(function(e){r.has(e)||Xg(e,a)})}$g.set(n,e)},[e]),n}function t_(e){return e}function n_(e,t){t===void 0&&(t=t_);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function r_(e){e===void 0&&(e={});var t=n_(null);return t.options=Ug({async:!0,ssr:!1},e),t}var i_=function(e){var t=e.sideCar,n=Wg(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return p.createElement(r,Ug({},n))};i_.isSideCarExport=!0;function a_(e,t){return e.useMedium(t),i_}var o_=r_(),s_=function(){},c_=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:s_,onWheelCapture:s_,onTouchMoveCapture:s_}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Wg(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=e_([n,t]),w=Ug(Ug({},x),i);return p.createElement(p.Fragment,null,u&&p.createElement(S,{sideCar:o_,removeScrollBar:l,shards:d,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?p.cloneElement(p.Children.only(s),Ug(Ug({},w),{ref:C})):p.createElement(y,Ug({},w,{className:c,ref:C}),s))});c_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},c_.classNames={fullWidth:qg,zeroRight:Kg};var l_=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function u_(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=l_();return t&&e.setAttribute(`nonce`,t),e}function d_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function f_(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var p_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=u_())&&(d_(t,n),f_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},m_=function(){var e=p_();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},h_=function(){var e=m_();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},g_={left:0,top:0,right:0,gap:0},__=function(e){return parseInt(e||``,10)||0},v_=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[__(n),__(r),__(i)]},y_=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return g_;var t=v_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},b_=h_(),x_=`data-scroll-locked`,S_=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
10
10
  .${Jg} {
11
11
  overflow: hidden ${r};
12
12
  padding-right: ${s}px ${r};
@@ -46,7 +46,7 @@ Error generating stack: `+e.message+`
46
46
  `},C_=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},w_=function(){p.useEffect(function(){return document.body.setAttribute(x_,(C_()+1).toString()),function(){var e=C_()-1;e<=0?document.body.removeAttribute(x_):document.body.setAttribute(x_,e.toString())}},[])},T_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;w_();var a=p.useMemo(function(){return y_(i)},[i]);return p.createElement(b_,{styles:S_(a,!t,i,n?``:`!important`)})},E_=!1;if(typeof window<`u`)try{var D_=Object.defineProperty({},"passive",{get:function(){return E_=!0,!0}});window.addEventListener(`test`,D_,D_),window.removeEventListener(`test`,D_,D_)}catch{E_=!1}var O_=E_?{passive:!1}:!1,k_=function(e){return e.tagName===`TEXTAREA`},A_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!k_(e)&&n[t]===`visible`)},j_=function(e){return A_(e,`overflowY`)},M_=function(e){return A_(e,`overflowX`)},N_=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),I_(e,r)){var i=L_(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},P_=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},F_=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},I_=function(e,t){return e===`v`?j_(t):M_(t)},L_=function(e,t){return e===`v`?P_(t):F_(t)},R_=function(e,t){return e===`h`&&t===`rtl`?-1:1},z_=function(e,t,n,r,i){var a=R_(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=L_(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&I_(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},B_=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},V_=function(e){return[e.deltaX,e.deltaY]},H_=function(e){return e&&`current`in e?e.current:e},U_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},W_=function(e){return`
47
47
  .block-interactivity-${e} {pointer-events: none;}
48
48
  .allow-interactivity-${e} {pointer-events: all;}
49
- `},G_=0,K_=[];function q_(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),i=p.useState(G_++)[0],a=p.useState(h_)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Gg([e.lockRef.current],(e.shards||[]).map(H_),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=p.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=B_(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=N_(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=N_(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return z_(h,t,e,h===`h`?s:c,!0)},[]),c=p.useCallback(function(e){var n=e;if(K_.length&&K_[K_.length-1]===a){var r=`deltaY`in n?V_(n):B_(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&U_(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(H_).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=p.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:J_(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=p.useCallback(function(e){n.current=B_(e),r.current=void 0},[]),d=p.useCallback(function(t){l(t.type,V_(t),t.target,s(t,e.lockRef.current))},[]),f=p.useCallback(function(t){l(t.type,B_(t),t.target,s(t,e.lockRef.current))},[]);p.useEffect(function(){return K_.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,O_),document.addEventListener(`touchmove`,c,O_),document.addEventListener(`touchstart`,u,O_),function(){K_=K_.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,O_),document.removeEventListener(`touchmove`,c,O_),document.removeEventListener(`touchstart`,u,O_)}},[]);var m=e.removeScrollBar,h=e.inert;return p.createElement(p.Fragment,null,h?p.createElement(a,{styles:W_(i)}):null,m?p.createElement(T_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function J_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Y_=a_(o_,q_),X_=p.forwardRef(function(e,t){return p.createElement(c_,Ug({},e,{ref:t,sideCar:Y_}))});X_.classNames=c_.classNames;var Z_=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Q_=new WeakMap,$_=new WeakMap,ev={},tv=0,nv=function(e){return e&&(e.host||nv(e.parentNode))},rv=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=nv(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},iv=function(e,t,n,r){var i=rv(t,Array.isArray(e)?e:[e]);ev[n]||(ev[n]=new WeakMap);var a=ev[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Q_.get(e)||0)+1,l=(a.get(e)||0)+1;Q_.set(e,c),a.set(e,l),o.push(e),c===1&&i&&$_.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),tv++,function(){o.forEach(function(e){var t=Q_.get(e)-1,i=a.get(e)-1;Q_.set(e,t),a.set(e,i),t||($_.has(e)||e.removeAttribute(r),$_.delete(e)),i||e.removeAttribute(n)}),tv--,tv||(Q_=new WeakMap,Q_=new WeakMap,$_=new WeakMap,ev={})}},av=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Z_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),iv(r,i,n,`aria-hidden`)):function(){return null}},ov=Object.defineProperty,sv=(e,t)=>ov(e,`name`,{value:t,configurable:!0}),cv=`Dialog`,[lv,uv]=Qm(cv),[dv,fv]=lv(cv),pv=sv(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=p.useRef(null),c=p.useRef(null),{nodes:l,registry:u}=fg(),[d,f]=mh({prop:r,defaultProp:i??!1,onChange:a,caller:cv}),[h,g]=p.useState(0),[_,v]=p.useState(0);return(0,m.jsx)(dv,{scope:t,triggerRef:s,contentRef:c,contentId:ah(),titleId:ah(),descriptionId:ah(),titlePresent:h>0,descriptionPresent:_>0,setTitleCount:g,setDescriptionCount:v,open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),mv=`DialogPortal`,[hv,gv]=lv(mv,{forceMount:void 0}),_v=sv(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=fv(mv,t);return(0,m.jsx)(hv,{scope:t,forceMount:n,children:p.Children.map(r,e=>(0,m.jsx)(Ag,{present:n||a.open,children:(0,m.jsx)(Eg,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),vv=`DialogOverlay`,yv=p.forwardRef(sv(function(e,t){let n=gv(vv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fv(vv,e.__scopeDialog);return a.modal?(0,m.jsx)(Ag,{present:r||a.open,children:(0,m.jsx)(xv,{...i,ref:t})}):null},`DialogOverlay`)),bv=xh(`DialogOverlay.RemoveScroll`),xv=p.forwardRef(sv(function(e,t){let{__scopeDialog:n,...r}=e,i=fv(vv,n),a=Jm(t,Qh());return(0,m.jsx)(X_,{as:bv,allowPinchZoom:!0,shards:p.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,m.jsx)(Rh.div,{"data-state":Ov(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Sv=`DialogContent`,Cv=p.forwardRef(sv(function(e,t){let n=gv(Sv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fv(Sv,e.__scopeDialog);return(0,m.jsx)(Ag,{present:r||a.open,children:a.modal?(0,m.jsx)(wv,{...i,ref:t}):(0,m.jsx)(Tv,{...i,ref:t})})},`DialogContent`)),wv=p.forwardRef(sv(function(e,t){let n=fv(Sv,e.__scopeDialog),r=p.useRef(null),i=Jm(t,n.contentRef,r);return p.useEffect(()=>{let e=r.current;if(e)return av(e)},[]),(0,m.jsx)(Ev,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:zm(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:zm(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:zm(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Tv=p.forwardRef(sv(function(e,t){let n=fv(Sv,e.__scopeDialog),r=p.useRef(!1),i=p.useRef(!1);return(0,m.jsx)(Ev,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Ev=p.forwardRef(sv(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=fv(Sv,n);return Vg(),(0,m.jsx)(dg,{registry:l.branchRegistry,children:(0,m.jsx)(lg,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,m.jsx)(Zh,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Dv(o,l.descriptionId):o,"data-state":Ov(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`));function Dv(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}sv(Dv,`concatAriaDescribedby`);function Ov(e){return e?`open`:`closed`}sv(Ov,`getState`);var kv=`[cmdk-group=""]`,Av=`[cmdk-group-items=""]`,jv=`[cmdk-group-heading=""]`,Mv=`[cmdk-item=""]`,Nv=`${Mv}:not([aria-disabled="true"])`,Pv=`cmdk-item-select`,Fv=`data-value`,Iv=(e,t,n)=>Fm(e,t,n),Lv=p.createContext(void 0),Rv=()=>p.useContext(Lv),zv=p.createContext(void 0),Bv=()=>p.useContext(zv),Vv=p.createContext(void 0),Hv=p.forwardRef((e,t)=>{let n=ny(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=ny(()=>new Set),i=ny(()=>new Map),a=ny(()=>new Map),o=ny(()=>new Set),s=ey(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=ah(),b=ah(),x=ah(),S=p.useRef(null),C=ay();ty(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),ty(()=>{C(6,A)},[]);let w=p.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=p.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??Iv;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Av);t?t.appendChild(e.parentElement===t?e:e.closest(`${Av} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Av} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${kv}[${Fv}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Fv);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(kv)?.querySelector(jv))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${Mv}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(Nv)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(Fv))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(Fv))}function F(e){let t=j()?.closest(kv),n;for(;t&&!n;)t=e>0?Qv(t,kv):$v(t,kv),n=t?.querySelector(Nv);n?w.setState(`value`,n.getAttribute(Fv)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return p.createElement(Rh.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:_&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(Pv);t.dispatchEvent(e)}}}}},p.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:cy},c),sy(e,e=>p.createElement(zv.Provider,{value:w},p.createElement(Lv.Provider,{value:T},e))))}),Uv=p.forwardRef((e,t)=>{let n=ah(),r=p.useRef(null),i=p.useContext(Vv),a=Rv(),o=ey(e),s=o.current?.forceMount??i?.forceMount;ty(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=iy(n,r,[e.value,e.children,r],e.keywords),l=Bv(),u=ry(e=>e.value&&e.value===c.current),d=ry(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);p.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(Pv,f),()=>t.removeEventListener(Pv,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return p.createElement(Rh.div,{ref:qm(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:f},e.children)}),Wv=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=ah(),s=p.useRef(null),c=p.useRef(null),l=ah(),u=Rv(),d=ry(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));ty(()=>u.group(o),[]),iy(o,s,[e.value,e.heading,c]);let f=p.useMemo(()=>({id:o,forceMount:i}),[i]);return p.createElement(Rh.div,{ref:qm(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&p.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),sy(e,e=>p.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},p.createElement(Vv.Provider,{value:f},e))))}),Gv=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=p.useRef(null),a=ry(e=>!e.search);return!n&&!a?null:p.createElement(Rh.div,{ref:qm(i,t),...r,"cmdk-separator":``,role:`separator`})}),Kv=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Bv(),o=ry(e=>e.search),s=ry(e=>e.selectedItemId),c=Rv();return p.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),p.createElement(Rh.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),qv=p.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=p.useRef(null),o=p.useRef(null),s=ry(e=>e.selectedItemId),c=Rv();return p.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),p.createElement(Rh.div,{ref:qm(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},sy(e,e=>p.createElement(`div`,{ref:qm(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Jv=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return p.createElement(pv,{open:n,onOpenChange:r},p.createElement(_v,{container:o},p.createElement(yv,{"cmdk-overlay":``,className:i}),p.createElement(Cv,{"aria-label":e.label,"cmdk-dialog":``,className:a},p.createElement(Hv,{ref:t,...s}))))}),Yv=p.forwardRef((e,t)=>ry(e=>e.filtered.count===0)?p.createElement(Rh.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Xv=p.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return p.createElement(Rh.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},sy(e,e=>p.createElement(`div`,{"aria-hidden":!0},e)))}),Zv=Object.assign(Hv,{List:qv,Item:Uv,Input:Kv,Group:Wv,Separator:Gv,Dialog:Jv,Empty:Yv,Loading:Xv});function Qv(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function $v(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ey(e){let t=p.useRef(e);return ty(()=>{t.current=e}),t}var ty=typeof window>`u`?p.useEffect:p.useLayoutEffect;function ny(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function ry(e){let t=Bv(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function iy(e,t,n,r=[]){let i=p.useRef(),a=Rv();return ty(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Fv,s),i.current=s}),i}var ay=()=>{let[e,t]=p.useState(),n=ny(()=>new Map);return ty(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function oy(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function sy({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(oy(t),{ref:t.ref},n(t.props.children)):n(t)}var cy={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function ly({...e}){return(0,m.jsx)(Nf,{"data-slot":`dialog`,...e})}function uy({...e}){return(0,m.jsx)(hf,{"data-slot":`dialog-portal`,...e})}function dy({className:e,...t}){return(0,m.jsx)(Dc,{"data-slot":`dialog-overlay`,className:J(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function fy({className:e,children:t,showCloseButton:n=!0,...r}){return(0,m.jsxs)(uy,{children:[(0,m.jsx)(dy,{}),(0,m.jsxs)(ff,{"data-slot":`dialog-content`,className:J(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,m.jsxs)(Oc,{"data-slot":`dialog-close`,render:(0,m.jsx)(Wi,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,m.jsx)(ht,{}),(0,m.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function py({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`dialog-header`,className:J(`flex flex-col gap-2`,e),...t})}function my({className:e,showCloseButton:t=!1,children:n,...r}){return(0,m.jsxs)(`div`,{"data-slot":`dialog-footer`,className:J(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,m.jsx)(Oc,{render:(0,m.jsx)(Wi,{variant:`outline`}),children:`Close`})]})}function hy({className:e,...t}){return(0,m.jsx)(Pf,{"data-slot":`dialog-title`,className:J(`cn-font-heading leading-none font-medium`,e),...t})}function gy({className:e,...t}){return(0,m.jsx)(kc,{"data-slot":`dialog-description`,className:J(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function _y({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:J(`group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var vy=Hi(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function yy({className:e,align:t=`inline-start`,...n}){return(0,m.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:J(vy({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}function by({className:e,...t}){return(0,m.jsx)(Zv,{"data-slot":`command`,className:J(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,e),...t})}function xy({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!1,...a}){return(0,m.jsxs)(ly,{...a,children:[(0,m.jsxs)(py,{className:`sr-only`,children:[(0,m.jsx)(hy,{children:e}),(0,m.jsx)(gy,{children:t})]}),(0,m.jsx)(fy,{className:J(`top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0`,r),showCloseButton:i,children:n})]})}function Sy({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,m.jsxs)(_y,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,m.jsx)(Zv.Input,{"data-slot":`command-input`,className:J(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,m.jsx)(yy,{children:(0,m.jsx)(mt,{className:`size-4 shrink-0 opacity-50`})})]})})}function Cy({className:e,...t}){return(0,m.jsx)(Zv.List,{"data-slot":`command-list`,className:J(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function wy({className:e,...t}){return(0,m.jsx)(Zv.Group,{"data-slot":`command-group`,className:J(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function Ty({className:e,children:t,...n}){return(0,m.jsxs)(Zv.Item,{"data-slot":`command-item`,className:J(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:**:[svg]:text-foreground`,e),...n,children:[t,(0,m.jsx)(yt,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}function Ey({className:e,...t}){return(0,m.jsx)(`kbd`,{"data-slot":`kbd`,className:J(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,e),...t})}function Dy(e,t){let n=t.trim().toLowerCase();return n===``?[...e]:e.filter(e=>[e.label,...e.keywords??[]].some(e=>e.toLowerCase().includes(n)))}function Oy(e,t){(0,p.useEffect)(()=>{if(!e)return;let n=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),t(e=>!e))};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t])}function ky({onOpen:e,className:t,label:n=`Search all consoles`}){return(0,m.jsxs)(`button`,{type:`button`,onClick:e,"aria-keyshortcuts":`Control+K Meta+K`,"aria-label":n,className:J(`flex h-[26px] items-center gap-2 rounded-[6px] px-2.5 text-[11px] font-medium text-dim transition-colors hover:bg-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60`,t),children:[(0,m.jsx)(mt,{className:`size-[13px]`}),(0,m.jsx)(`span`,{className:`hidden sm:inline`,children:`Search`}),(0,m.jsx)(Ey,{className:`mono hidden h-4 text-[9px] sm:inline-flex`,children:`⌘K`})]})}function Ay({className:e}){return(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:14,height:14,fill:`none`,"aria-hidden":!0,"data-agora-search-spinner":``,className:J(`animate-spin text-dim motion-reduce:animate-none`,e),children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,stroke:`currentColor`,strokeOpacity:.25,strokeWidth:1.8}),(0,m.jsx)(`path`,{d:`M14 8a6 6 0 0 0-6-6`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`})]})}function jy(){return(0,m.jsxs)(`div`,{"data-agora-search-skeleton":``,"aria-hidden":!0,className:`p-1`,children:[(0,m.jsx)(`div`,{className:`px-2 py-1.5 text-xs font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Searching consoles…`}),[.55,.4,.48].map(e=>(0,m.jsxs)(`div`,{className:`flex items-center gap-2.5 px-2 py-1.5`,children:[(0,m.jsx)(Gf,{className:`size-[18px] shrink-0 rounded-[5px] bg-fg/[0.08] motion-reduce:animate-none`}),(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,m.jsx)(Gf,{className:`h-3 rounded-sm bg-fg/[0.08] motion-reduce:animate-none`,style:{width:`${e*100}%`}}),(0,m.jsx)(Gf,{className:`h-2.5 rounded-sm bg-fg/[0.08] motion-reduce:animate-none`,style:{width:`${e*55}%`}})]})]},e))]})}function My({config:e,commands:t,open:n,onOpenChange:r,placeholder:i=`Search runs, payments, users…`}){let[a,o]=(0,p.useState)(``),[s,c]=(0,p.useState)([]),[l,u]=(0,p.useState)(`idle`),[d,f]=(0,p.useState)(0);(0,p.useEffect)(()=>{n||o(``)},[n]);let h=(0,p.useMemo)(()=>Dy(t??[],a),[t,a]),g=(0,p.useMemo)(()=>{let e=new Map;for(let t of h)e.set(t.group,[...e.get(t.group)??[],t]);return[...e.entries()]},[h]);(0,p.useEffect)(()=>{let t=a.trim();if(t===``||!e){c([]),u(`idle`);return}let n=new AbortController;u(`loading`);let r=setTimeout(()=>{bm(e,t,n.signal).then(e=>{n.signal.aborted||(c(e),u(`done`))},()=>{n.signal.aborted||(c([]),u(`error`))})},200);return()=>{clearTimeout(r),n.abort()}},[a,e,d]);let _=a.trim(),v=e!==void 0&&_!==``,y=v&&l===`loading`,b=y&&s.length>0,x=s.reduce((e,t)=>e+t.hits.length,0)+h.length,S=_!==``&&h.length===0&&s.length===0&&(!v||l===`done`),C=e?`Search all consoles`:`Search`,w=e=>{r(!1),window.location.assign(e)};return(0,m.jsx)(xy,{open:n,onOpenChange:r,title:C,description:e?`Search every console you can open`:`Jump to a page`,className:`sm:max-w-xl`,children:(0,m.jsxs)(by,{shouldFilter:!1,label:C,children:[(0,m.jsxs)(`div`,{className:`relative`,children:[(0,m.jsx)(Sy,{value:a,onValueChange:o,placeholder:i,"aria-label":C,className:`pr-7`}),y&&(0,m.jsx)(Ay,{className:`pointer-events-none absolute top-[calc(50%+2px)] right-3.5 -translate-y-1/2`})]}),(0,m.jsx)(`span`,{role:`status`,className:`sr-only`,children:y?`Searching…`:v&&l===`error`?`Search failed`:_===``?``:`${x} results`}),(0,m.jsxs)(Cy,{className:`max-h-[60vh]`,"aria-busy":y,children:[_===``&&h.length===0&&(0,m.jsx)(`p`,{className:`px-3 py-6 text-center text-[13px] text-dim`,children:`Type to search.`}),S&&(0,m.jsx)(`p`,{"data-agora-search-empty":``,className:`px-3 py-6 text-center text-[13px] text-dim`,children:`Nothing found.`}),g.map(([e,t])=>(0,m.jsx)(wy,{heading:(0,m.jsx)(`span`,{className:`uppercase tracking-[0.14em]`,children:e}),children:t.map(e=>(0,m.jsxs)(Ty,{value:`local:${e.id}`,onSelect:()=>{r(!1),e.onSelect()},children:[e.icon,(0,m.jsx)(`span`,{className:`truncate text-[13px] text-fg`,children:e.label}),e.hint&&(0,m.jsx)(`span`,{className:`ml-auto text-[11px] text-dim`,children:e.hint})]},e.id))},`local:${e}`)),y&&s.length===0&&(0,m.jsx)(jy,{}),s.map(e=>(0,m.jsx)(wy,{"data-stale":b?``:void 0,className:J(`transition-opacity duration-150 motion-reduce:transition-none`,b&&`opacity-50`),heading:(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5 uppercase tracking-[0.14em]`,children:[(0,m.jsx)(Rt,{icon:e.icon,accent:Lt(e.id,e.icon),size:18}),e.title]}),children:e.hits.map(t=>(0,m.jsx)(Ty,{value:`${e.id}:${t.href}`,onSelect:()=>w(t.href),children:(0,m.jsxs)(`a`,{href:t.href,tabIndex:-1,className:`flex min-w-0 flex-col`,onClick:e=>{e.preventDefault(),w(t.href)},children:[(0,m.jsx)(`span`,{className:`mono truncate text-[13px] text-fg`,children:t.title}),t.subtitle&&(0,m.jsx)(`span`,{className:`truncate text-[11px] text-dim`,children:t.subtitle})]})},t.href))},e.id)),v&&l===`error`&&(0,m.jsxs)(`p`,{"data-agora-search-error":``,className:`flex items-center justify-center gap-2 px-3 py-3 text-[12px] text-faint`,children:[`The other consoles didn't answer.`,(0,m.jsx)(`button`,{type:`button`,onClick:()=>f(e=>e+1),className:`rounded-sm text-dim underline underline-offset-2 hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60`,children:`Retry`})]})]})]})})}var Ny=p.createContext(void 0);function Py(e){let t=p.useContext(Ny);if(t===void 0&&!e)throw Error(ci(33));return t}var Fy=p.createContext(void 0);function Iy(e){let t=p.useContext(Fy);if(t===void 0&&!e)throw Error(ci(36));return t}var Ly=p.createContext(void 0);function Ry(e=!0){let t=p.useContext(Ly);if(t===void 0&&!e)throw Error(ci(25));return t}var zy=p.createContext(null);function By(e=`root`){let t=p.useContext(zy),n=p.useContext(Fy);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var Vy={visible:!0,ref:null};function Hy(){return Vy}function Uy(e,t,n=`root`){let r=By(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Hy)({label:e.label,children:e.children,render:e.render}),a=_i(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Wy(e){e.preventDefault()}function Gy(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=Iy(),u=Ry(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,m=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:h}=a.useState(`floatingTreeRoot`),g=a.useState(`open`),_=u!==void 0,v=!f&&g&&n?0:-1;return p.useMemo(()=>({id:r,role:`menuitem`,tabIndex:v,"aria-selected":m,onMouseDown:f?Wy:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&h.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&h.emit(`close`,{domEvent:e.nativeEvent,reason:sa})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,_&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||_&&!Oo&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!_||e.button===2)&&c.type===`regular-item`&&pi(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,v,r,h,i,a.context.allowMouseUpTriggerRef,o,s,u,_,c.type,m,f])}var Ky={type:`regular-item`};function qy(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=p.useRef(null),{getButtonProps:d,buttonRef:f}=mi({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),m=Gy({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),h=p.useCallback(e=>Jr(m,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[m,d,c]),g=_i(u,f);return p.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}var Jy=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Yy(){return p.useContext(Jy)}function Xy(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Yy(),u=p.useRef(-1),[d,f]=p.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),m=a??d,h=p.useRef(null),g=p.useCallback(e=>{let t=h.current;t&&s(t),h.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return X(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:g,index:m}}var Zy=p.createContext(void 0);function Qy(){let e=p.useContext(Zy);if(e===void 0)throw Error(ci(31));return e}var $y=p.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=p.useState(void 0),c=Mi(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,m.jsx)(Zy.Provider,{value:s,children:c})}),eb=p.forwardRef(function(e,t){let n=By()?.Group??$y;return(0,m.jsx)(n,{...e,ref:t})}),tb=p.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=$i(a),c=Qy();return X(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),Mi(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),nb=p.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=Iy(),f=Xy({guess:!0,label:a}),p=$i(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=qy({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Ky});return Mi(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),rb=p.forwardRef(function(e,t){let n=Uy(e,t);return n.visible?(0,m.jsx)(nb,{...e,ref:n.ref}):null}),ib=p.createContext(void 0);function ab(e){let t=p.useContext(ib);if(t===void 0&&!e)throw Error(ci(69));return t}var ob=p.createContext(void 0);function sb(){return p.useContext(ob)}function cb(e,t){let n=Ii(e.render);if(p.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function lb(e,t,n){let r=cb(e,t),i=r===t?void 0:r;return[r,p.useCallback(e=>n?.(e?i:void 0),[i,n])]}function ub(e,t,n){let r=Ii(e.render),i=p.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var db=p.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:h}=Iy(),g=sb(),{side:_,align:v}=Py(),y=ab(!0)!=null,b=l.useState(`open`),x=l.useState(`transitionStatus`),S=l.useState(`popupProps`),C=l.useState(`mounted`),w=l.useState(`instantType`),T=l.useState(`activeTriggerElement`),E=l.useState(`parent`),D=l.useState(`lastOpenChangeReason`),O=l.useState(`rootId`),k=l.useState(`floatingRootContext`),A=l.useState(`floatingTreeRoot`),j=l.useState(`closeDelay`),M=l.useState(`hoverEnabled`),N=l.useState(`disabled`),P=l.useState(`openMethod`),F=l.useState(`activeTriggerId`),I=l.useState(`listElement`),[L,R]=lb(e,u,d),z=ub(e,T,F),B=E.type===`menu`?g:void 0,ee=E.type===`context-menu`,V=s??E.type!==`menu`;s===void 0&&I&&E.type!==`menu`&&(V=()=>l.state.activeIndex===null&&I),to({open:b,ref:l.context.popupRef,onComplete(){b&&l.context.onOpenChangeComplete?.(!0)}}),p.useEffect(()=>{function e(e){l.setOpen(!1,ea(e.reason,e.domEvent))}return A.events.on(`close`,e),()=>{A.events.off(`close`,e)}},[A.events,l]),Ru(k,{enabled:M&&!N&&!ee&&E.type!==`menubar`,closeDelay:j});let te=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:ne,handleFocus:H}=(p.useContext(zy)?.useParentHandoff??pb)(l,E,b,f),re=Mi(`div`,e,{state:{transitionStatus:x,side:_,align:v,open:b,nested:E.type===`menu`,instant:w},ref:[t,l.context.popupRef,te,R],stateAttributesMapping:ts,props:[S,{id:L,...I?{role:`presentation`}:{role:`menu`,"aria-orientation":h===`horizontal`?`horizontal`:void 0,"aria-labelledby":z},onKeyDown(e){B?.onPopupKeyDown?.(e),y&&cf.has(e.key)&&e.stopPropagation()},onFocus:H},Ap(x),c,{"data-rootownerid":O}]}),U=E.type===void 0||ee;(T||E.type===`menubar`&&D!==`outside-press`)&&(U=!0);let ie=B?.getReturnElement??ne;return(0,m.jsx)(Al,{context:k,openInteractionType:P,modal:ee,disabled:!C,returnFocus:a??ie??U,explicitReturnFocus:a===void 0&&ie?!1:void 0,initialFocus:V,restoreFocus:!0,getInsideElements:E.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:E.type===`menubar`?void 0:A,previousFocusableElement:T,nextFocusableElement:E.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:re})}),fb={parentVirtualFocusRef:void 0,handleFocus:void 0};function pb(){return fb}var mb=p.forwardRef(function(e,t){let n=By()?.Popup??db;return(0,m.jsx)(n,{...e,ref:t})}),hb=p.createContext(void 0);function gb(){let e=p.useContext(hb);if(e===void 0)throw Error(ci(32));return e}var _b=p.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Iy();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,m.jsx)(hb.Provider,{value:n,children:(0,m.jsx)(fl,{ref:t,...r,portalOwnerRole:o})})});function vb(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Y(i),[,o]=p.useState(0),s=Vr(bb).current,c=Vr(yb).current,l=p.useRef(0),u=p.useRef(!0),d=p.useRef(null),f=p.useRef(null),h=Y(()=>{u.current||(u.current=!0,o(e=>e+1))}),g=Y((e,t)=>{c.set(e,t),h()}),_=Y(e=>{c.delete(e),h()}),v=Y(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function y(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Cb(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&wb(r,n)>0){t.disconnect(),h();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Sb(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let b=Y(()=>{let[e,t]=xb(c),n=v(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});y(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});X(()=>(!u.current&&d.current&&v(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,v]),X(()=>{u.current&&b()}),X(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let x=Y(e=>(s.add(e),()=>{s.delete(e)})),S=p.useMemo(()=>({register:g,unregister:_,subscribeMapChange:x,nextIndexRef:l}),[g,_,x,l]);return(0,m.jsx)(Jy.Provider,{value:S,children:t})}function yb(){return new Map}function bb(){return new Set}function xb(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>wb(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Sb(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Cb(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function wb(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Tb(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=p.useRef(null),o=p.useRef(null),s=eo(r);X(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),X(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var Eb=20;function Db(e,t,n,r){let[i,a]=p.useState(!1);X(()=>{if(!e||!t||n==null){a(!1);return}let r=fi(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Eb)},[e,t,n]),Ef(e&&(!t||i),r)}var Ob=p.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=al,style:v,...y}=e,{store:b,virtualFocus:x,syncHighlightedItem:S}=Iy(),C=gb(),w=Ry(!0),T=b.useState(`parent`),E=b.useState(`floatingRootContext`),D=b.useState(`floatingTreeRoot`),O=b.useState(`mounted`),k=b.useState(`open`),A=b.useState(`modal`),j=b.useState(`openMethod`),M=b.useState(`activeTriggerElement`),N=b.useState(`transitionStatus`),P=b.useState(`positionerElement`),F=b.useState(`instantType`),I=b.useState(`adaptiveOrigin`),L=b.useState(`lastOpenChangeReason`),R=b.useState(`floatingNodeId`),z=b.useState(`floatingParentNodeId`),B=E.useState(`domReferenceElement`),ee=n,V=c,te=l,ne=s,H=_;T.type===`context-menu`&&(ee=n??T.context?.anchor,ne??=`start`,!o&&ne!==`center`&&(te=e.alignOffset??2,V=e.sideOffset??-5));let re=o,U=ne;T.type===`menu`?(re??=`inline-end`,U??=`start`,H=e.collisionAvoidance??ol):T.type===`menubar`&&(re??=T.context.orientation===`vertical`?`inline-end`:`bottom`,U??=`start`);let ie=T.type===`context-menu`,W=Dp({anchor:ee,floatingRootContext:E,positionMethod:w?`fixed`:r,mounted:O,side:re,sideOffset:V,align:U,alignOffset:te,arrowPadding:ie?0:f,collisionBoundary:u,collisionPadding:d,sticky:h,nodeId:R,keepMounted:C,disableAnchorTracking:g,collisionAvoidance:H,shift:ie?{crossAxis:!(`side`in H&&H.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:D,adaptiveOrigin:I,lazyFlip:x?`placement`:!1});p.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===R&&b.set(`hoverEnabled`,!1),e.nodeId!==R&&e.parentNodeId===b.select(`floatingParentNodeId`)&&b.setOpen(!1,ea(ha)))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[b,D.events,R]),p.useEffect(()=>{if(b.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==b.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;b.setOpen(!1,ea(t))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[D.events,b]);let G=Ka();p.useEffect(()=>{k||G.clear()},[k,G]),p.useEffect(()=>{function e(e){if(k&&e.nodeId===b.select(`floatingParentNodeId`)){if(e.target&&M&&M!==e.target){let e=b.select(`closeDelay`);e>0?G.isStarted()||G.start(e,()=>{b.setOpen(!1,ea(ha))}):b.setOpen(!1,ea(ha))}else G.clear()}}return D.events.on(`itemhover`,e),()=>{D.events.off(`itemhover`,e)}},[D.events,k,M,b,G]),p.useEffect(()=>{let e={open:k,nodeId:R,parentNodeId:z,reason:b.select(`lastOpenChangeReason`)};D.events.emit(`menuopenchange`,e)},[D.events,k,b,R,z]),Tb({store:b,domReference:B,positionerElement:P,open:k});let ae={open:k,side:W.side,align:W.align,anchorHidden:W.anchorHidden,nested:T.type===`menu`,instant:F},oe=T.type===`menubar`&&T.context.modal;Db(k&&(oe||A&&L!==`trigger-hover`),j===`touch`,P,M);let se=jp(e,ae,{styles:W.positionerStyles,transitionStatus:N,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!O,inert:!k}),ce=O&&T.type!==`menu`&&(T.type!==`menubar`&&A&&L!==`trigger-hover`||T.type===`menubar`&&T.context.modal),le=null;return T.type===`menubar`?le=T.context.contentElement:T.type===void 0&&(le=M),(0,m.jsxs)(Ny.Provider,{value:W,children:[ce&&(0,m.jsx)(mf,{ref:T.type===`context-menu`||T.type===`nested-context-menu`?T.context.internalBackdropRef:null,inert:pf(!k),cutout:le}),(0,m.jsx)(bl,{id:R,children:(0,m.jsx)(vb,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,onMapChange:S,children:se})})]})}),kb=p.createContext(null);function Ab(e){let t=p.useContext(kb);if(t===null&&!e)throw Error(ci(5));return t}function jb(e){return e==null?na:e.type.startsWith(`key`)?fa:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?pa:na}var Mb={...ku,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=ku.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Ao&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!ku.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Nb=class extends bu{constructor(e,t,n=!1){let r=new eu,i=Fb(r,t,n,e);super(i,Pb(r),Mb),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Pb(e){return{positionerRef:p.createRef(),popupRef:p.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:p.createRef(),beforeTriggerFocusGuardRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Fb(e,t,n=!1,r){return{...Cu(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Oi,inputProps:Oi,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ml,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Oi,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Ib=p.createContext(null);function Lb(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Rb(e,t){return e===`list-navigation`||Lb(e,t)}var zb=lu(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:h,triggerId:g,defaultTriggerId:_=null,highlightItemOnHover:v=!0,isSubmenu:y=!1,virtualFocus:b=!1,virtualFocusRef:x,allowEscape:S=!0,resetOnPointerLeave:C=!0}=e,w=Ry(!0),T=Iy(!0),E=Ab(!0),D=T?.store,O=T?.virtualFocus??!1,k=p.useMemo(()=>y&&D?{type:`menu`,store:D}:E?{type:`menubar`,context:E}:w&&!D?{type:`context-menu`,context:w}:{type:void 0},[w,D,E,y]),A=$i(),j=$i(),[M,N]=p.useState(void 0),P=(M??j)||void 0,F=_l(),I=k.type===`menu`?k.store:void 0,L=(n??o)&&I?.state.transitionStatus===`starting`,R=Vr(()=>L?I?.state.instantType:void 0).current,z=Vr(()=>{let e=new Nb({open:o,openProp:n,activeTriggerId:_,triggerIdProp:g,parent:k,disabled:s,highlightItemOnHover:v,modal:k.type===void 0?c:void 0,rootId:A,instantType:R},P,F!=null);return e.context.virtualFocusRef=x,e}).current;z.useControlledProp(`openProp`,n),z.useControlledProp(`triggerIdProp`,g),z.useContextCallback(`onOpenChangeComplete`,i);let B=z.useState(`floatingTreeRoot`),ee=yl(B),V=z.useState(`open`),te=z.useState(`activeTriggerElement`),ne=z.useState(`positionerElement`),H=z.useState(`hoverEnabled`),re=z.useState(`disabled`),U=z.useState(`lastOpenChangeReason`),ie=z.useState(`parent`),W=z.useState(`activeIndex`),G=z.useState(`keyboardOpen`),ae=z.useState(`payload`),oe=z.useState(`floatingParentNodeId`),se=p.useRef(null),ce=p.useRef(ie.type!==`context-menu`),le=Ka(),ue=p.useRef(!0),de=Ka(),fe=oe!=null,{openMethod:pe,triggerProps:me}=Lf(V);z.useSyncedValues({disabled:s,highlightItemOnHover:v,modal:ie.type===void 0?c:void 0,openMethod:pe,rootId:A}),Xl(z);let{forceUnmount:he,transitionStatus:ge}=Zl(V,z,()=>{z.set(`allowMouseEnter`,!1)},L),_e=eo(z.context.popupRef);p.useEffect(()=>{if(R===void 0)return;let e=()=>{z.state.instantType===R&&z.set(`instantType`,void 0)};if(!V){e();return}if(ge!==void 0)return;if(z.context.popupRef.current==null){e();return}let t=new AbortController;return _e(e,t.signal),()=>{t.abort()}},[R,V,ge,_e,z]),X(()=>{w&&!T?z.update({parent:{type:`context-menu`,context:w},floatingNodeId:ee,floatingParentNodeId:F}):(T||!z.select(`activeTriggerElement`))&&z.update({floatingNodeId:ee,floatingParentNodeId:F})},[w,T,ee,F,te,z]),p.useEffect(()=>{V||(se.current=null),ie.type===`context-menu`&&(V?le.start(500,()=>{ce.current=!0}):(le.clear(),ce.current=!1))},[le,V,ie.type]),X(()=>{!V&&!H&&z.set(`hoverEnabled`,!0)},[V,H,z]);let ve=Y((e,t)=>{let n=t.reason;if(!e&&!z.select(`open`)||V===e&&t.trigger===te&&U===n)return;let i=ql(t);if(!e&&t.trigger==null&&(t.trigger=te??void 0),r?.(e,t),t.isCanceled)return;z.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!ue.current)return;e&&n===`trigger-focus`?(ue.current=!1,de.start(300,()=>{ue.current=!0})):(ue.current=!0,de.clear());let o=!e&&(n===`escape-key`||n==null);se.current=t.event;let s=Kl(z.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Rb(n,a),s.instantType=ie.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Lb(n,a)?`click`:o?`dismiss`:void 0,z.update(s)}),ye=Rl({popupStore:z,floatingRootContext:z.state.floatingRootContext,floatingId:P,nested:F!=null,onOpenChange:ve}),be=ye.context.events;X(()=>{let e=({open:e,eventDetails:t})=>ve(e,t);return be.on(`setOpen`,e),()=>{be?.off(`setOpen`,e)}},[be,ve]),X(()=>z.subscribeToParentMenu(),[z]);let xe=p.useCallback(()=>{z.setOpen(!1,ea(_a))},[z]);p.useImperativeHandle(d,()=>({unmount:he,close:xe}),[he,xe]);let Se;ie.type===`context-menu`&&(Se=ie.context),p.useImperativeHandle(Se?.positionerRef,()=>ne,[ne]),p.useImperativeHandle(Se?.actionsRef,()=>({setOpen:ve}),[ve]);let Ce=Ll(ye,{enabled:!re,bubbles:{escapeKey:f&&ie.type===`menu`},outsidePress(){return ie.type!==`context-menu`||se.current?.type===`contextmenu`||ce.current},externalTree:fe?B:void 0}),we=pp(),Te=qu(ye,{enabled:!re,listRef:z.context.itemDomElements,activeIndex:W,virtual:b,nested:ie.type===`menubar`||!b&&ie.type!==void 0,parentOrientation:ie.type===`menubar`?ie.context.orientation:void 0,loopFocus:l,focusItemOnOpen:b?G:void 0,allowEscape:b&&l&&S,orientation:u,triggerOrientation:b?`vertical`:u,rtl:we===`rtl`,disabledIndices:Di,onNavigate(e,t){z.setActiveIndex(e,jb(t),t?.nativeEvent)},openOnArrowKeyDown:ie.type!==`context-menu`&&!(b&&y),externalTree:!b&&fe?B:void 0,nestedReturnFocusRef:I?.context.virtualFocusRef,focusItemOnHover:v,resetOnPointerLeave:C}),Ee=p.useCallback(e=>{z.context.typingRef.current=e},[z]),De=Ju(ye,{enabled:!re&&!b,listRef:z.context.itemLabels,elementsRef:z.context.itemDomElements,activeIndex:W,resetMs:500,onMatch:(e,t)=>{V&&e!==W&&z.setActiveIndex(e,fa,t.nativeEvent)},onTyping:Ee}),Oe=Y(a),ke=p.useRef(-1),Ae=Y(()=>{let e=z.state.activeIndex,t=e===null?void 0:z.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(ke.current===n&&z.context.reportedItem===t)return;ke.current=n,z.context.reportedItem=t,b&&z.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=z.context;z.context.highlightReason=na,z.context.highlightEvent=void 0,a&&Oe(t,ta(r,i,{label:t===void 0?void 0:z.context.itemLabels.current[n]??void 0}))});X(()=>{Ae()},[W,Ae]);let je=p.useMemo(()=>{if(!b)return Te.reference;if(!Te.trigger)return Oi;let{onFocus:e,...t}=Te.trigger;return t},[b,Te.reference,Te.trigger]);z.useSyncedValue(`inputProps`,b?Te.reference??Oi:Oi);let Me=p.useMemo(()=>{let e=Jr(De.reference,je,Ce.reference,{onMouseMove(){z.set(`allowMouseEnter`,!0)}},me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=V,e},[z,De.reference,je,Ce.reference,me,V]),Ne=p.useMemo(()=>{let e=Jr(Te.trigger,Ce.trigger,me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Te.trigger,Ce.trigger,me]);Vr(()=>(z.update({inactiveTriggerProps:Ne}),null)),Ql(z,{floatingRootContext:ye,activeTriggerProps:Me,inactiveTriggerProps:Ne,popupProps:p.useMemo(()=>Jr(Bl,{onMouseMove(){z.set(`allowMouseEnter`,!0),ie.type===`menu`&&z.set(`hoverEnabled`,!1)},onClick(){z.select(`hoverEnabled`)&&z.set(`hoverEnabled`,!1)},onKeyDown(e){let t=z.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},De.floating,Te.floating,Ce.floating),[ie.type,z,De.floating,Te.floating,Ce.floating]),itemProps:Te.item??Oi});let Pe=p.useMemo(()=>({store:z,parent:k,orientation:u,loopFocus:l,allowEscape:S,defaultFloatingId:j,setRenderedFloatingId:N,virtualFocus:b,parentVirtualFocus:O,syncHighlightedItem:Ae}),[z,k,u,l,S,j,b,O,Ae]),Fe=typeof t==`function`?t({payload:ae}):t,Ie=(0,m.jsxs)(Fy.Provider,{value:Pe,children:[h&&(0,m.jsx)(Ul,{handle:h,store:z}),Fe]});return(ie.type===void 0||ie.type===`context-menu`)&&(Ie=(0,m.jsx)(xl,{externalTree:B,children:Ie})),Ie});function Bb(e){let t=p.useContext(Ib);if(t===null)return(0,m.jsx)(zb,{...e});let n=t.Root;return(0,m.jsx)(Ib.Provider,{value:null,children:(0,m.jsx)(n,{...t.options,...e})})}var Vb=5;function Hb(e,t){let n=Ub(t);return e.clientX>=n.left-Vb&&e.clientX<=n.right+Vb&&e.clientY>=n.top-Vb&&e.clientY<=n.bottom+Vb}function Ub(e){let t=e.getBoundingClientRect(),n=gr(e);if(Mo)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Wb(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=ui(),{ref:i,index:a}=Xy(e),o=n===a,s=p.useRef(null),c=_i(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Gb(e){let{render:t,className:n,style:r,state:i=Oi,props:a=Di,refs:o=Di,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Wb({metadata:s});return Mi(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function Kb(e){if(br(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Mr(e))return Kb(Fr(e))}function qb(e,t){function n(n,r,i){let a=n.currentTarget;Za.flushSync(()=>{e.setOpen(!1,ea(la,n.nativeEvent,a))}),yc(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&bc(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Jb(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=p.useRef(!1);return p.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,fi(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Oi,[t,n,r])}var Yb=uu(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...h}=e,g=Iy(!0),_=Au(d)??g?.store;if(!_)throw Error(ci(85));let v=$i(s),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`triggerControlsId`,v),C=p.useRef(null),w=Zb(),T=ui(!0),E=vl(),D=p.useMemo(()=>E??new ml,[E]),{registerTrigger:O,isMountedByThisTrigger:k}=Yl(v,C,_,{payload:f,closeDelay:u,parent:w,floatingTreeRoot:D,floatingNodeId:yl(D),floatingParentNodeId:_l(),keyboardEventRelay:T?.relayKeyboardEvent}),A=w.type===`menubar`,j=_.useState(`disabled`),M=a||j||A&&w.context.disabled,{getButtonProps:N,buttonRef:P}=mi({disabled:M,native:o});p.useEffect(()=>{!x&&w.type===void 0&&(_.context.allowMouseUpTriggerRef.current=!1)},[_,x,w.type]);let F=p.useRef(null),I=Ka(),L=Y(e=>{if(!F.current)return;I.clear(),_.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Z(F.current,t)||Z(_.select(`positionerElement`),t)||t===F.current||t!=null&&Kb(t)===_.select(`rootId`)||Hb(e,F.current)||D.events.emit(`close`,{domEvent:e,reason:ma})});p.useEffect(()=>{let e=fi(F.current);if(x&&_.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,L,{once:!0}),()=>{e.removeEventListener(`mouseup`,L)}},[x,L,_]);let R=A&&w.context.hasSubmenuOpen,z=Bu(b,{enabled:(c??R)&&!M&&(!A||R&&!k),handleClose:td({blockPointerEvents:!A}),mouseOnly:!0,move:!1,restMs:w.type===void 0?l:void 0,delay:{close:u},triggerElementRef:C,externalTree:D,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`}),B=Xb(x,_.select(`lastOpenChangeReason`)),ee=jl(b,{enabled:!M,event:x&&A?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0&&B}),V=Mu(b,{enabled:!M&&R}),te=Jb({open:x,enabled:A,mouseDownAction:`open`}),ne=p.useMemo(()=>Jr(V.reference,ee.reference),[V.reference,ee.reference]),H=_.useState(`triggerProps`,k),re=_.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:U,handleFocusTargetFocus:ie}=qb(_,C),W={disabled:M,open:x},G=[F,t,P,O,C],ae=[ne,z??Oi,H,{"aria-haspopup":`menu`,"aria-controls":S,id:v,onMouseDown:e=>{_.select(`open`)||(I.start(200,()=>{_.context.allowMouseUpTriggerRef.current=!0}),fi(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},re,A?{role:`menuitem`}:{},te,h,N],oe=Mi(`button`,e,{enabled:!A,stateAttributesMapping:$o,state:W,ref:G,props:ae});return A?(0,m.jsx)(Gb,{tag:`button`,render:n,className:r,style:i,state:W,refs:G,props:ae,stateAttributesMapping:$o}):x?(0,m.jsxs)(p.Fragment,{children:[(0,m.jsx)(Hc,{ref:_.context.beforeTriggerFocusGuardRef,onFocus:U},`${v}-pre-focus-guard`),(0,m.jsx)(p.Fragment,{children:oe},v),(0,m.jsx)(Hc,{ref:_.context.triggerFocusTargetRef,onFocus:ie},`${v}-post-focus-guard`)]}):(0,m.jsx)(p.Fragment,{children:oe},v)});function Xb(e,t){let n=Ka(),[r,i]=p.useState(!1);return X(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Zb(){let e=Ab(!0);return p.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function Qb({...e}){return(0,m.jsx)(Bb,{"data-slot":`dropdown-menu`,...e})}function $b({...e}){return(0,m.jsx)(Yb,{"data-slot":`dropdown-menu-trigger`,...e})}function ex({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,m.jsx)(_b,{children:(0,m.jsx)(Ob,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,m.jsx)(mb,{"data-slot":`dropdown-menu-content`,className:J(`cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function tx({...e}){return(0,m.jsx)(eb,{"data-slot":`dropdown-menu-group`,...e})}function nx({className:e,inset:t,...n}){return(0,m.jsx)(tb,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:J(`px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8`,e),...n})}function rx({className:e,inset:t,variant:n=`default`,...r}){return(0,m.jsx)(rb,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:J(`group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function ix({className:e,...t}){return(0,m.jsx)(wc,{"data-slot":`dropdown-menu-separator`,className:J(`-mx-1 my-1 h-px bg-border`,e),...t})}function ax({className:e,...t}){return(0,m.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:J(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,e),...t})}function ox(e){let[t,n]=(0,p.useState)([]);return(0,p.useEffect)(()=>{if(!e)return;let t=!0;return ym(e).then(e=>{t&&n(e)}),()=>{t=!1}},[e]),t}function sx({brand:e,current:t,config:n,onSearch:r}){let i=ox(n);return!n||i.length===0?(0,m.jsx)(m.Fragment,{children:e}):(0,m.jsx)(`div`,{"data-agora-switcher":``,className:`min-w-0`,children:(0,m.jsxs)(Qb,{children:[(0,m.jsxs)($b,{"aria-label":`${t.title}: switch console`,className:`flex w-full min-w-0 items-center gap-2 rounded-md p-1 text-left outline-none transition-colors hover:bg-sidebar-accent/60 focus-visible:ring-2 focus-visible:ring-ring/60 data-popup-open:bg-sidebar-accent/60`,children:[(0,m.jsx)(`span`,{className:`min-w-0 flex-1`,children:e}),(0,m.jsx)(_t,{className:`size-3.5 shrink-0 text-dim`})]}),(0,m.jsxs)(ex,{align:`start`,className:`w-64 border border-border bg-popover shadow-(--agora-shadow) ring-0`,children:[(0,m.jsxs)(tx,{children:[(0,m.jsx)(nx,{className:`text-[10px] uppercase tracking-[0.16em] text-dim`,children:`Consoles`}),(0,m.jsxs)(rx,{disabled:!0,"aria-current":`page`,className:`data-disabled:opacity-100`,children:[(0,m.jsx)(Rt,{icon:t.icon,accent:`var(--agora-accent)`}),(0,m.jsx)(cx,{title:t.title,pkg:t.package}),(0,m.jsx)(yt,{"aria-label":`Current console`,className:`ml-auto text-brand`})]}),i.map(e=>(0,m.jsxs)(rx,{render:(0,m.jsx)(`a`,{href:e.href}),children:[(0,m.jsx)(Rt,{icon:e.icon,accent:Lt(e.id,e.icon)}),(0,m.jsx)(cx,{title:e.title,pkg:e.package})]},e.id))]}),r&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(ix,{}),(0,m.jsxs)(rx,{onClick:r,children:[(0,m.jsx)(mt,{className:`text-dim`}),`Search all consoles`,(0,m.jsx)(ax,{className:`mono`,children:`⌘K`})]})]})]})]})})}function cx({title:e,pkg:t}){return(0,m.jsxs)(`span`,{className:J(`flex min-w-0 flex-col leading-tight`),children:[(0,m.jsx)(`span`,{className:`truncate`,children:e}),t&&(0,m.jsx)(`span`,{className:`mono truncate text-[10px] text-dim`,children:t})]})}var lx=p.createContext(void 0);function ux(){let e=p.useContext(lx);if(e===void 0)throw Error(ci(13));return e}var dx={imageLoadingStatus:()=>null},fx=p.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=p.useState(`idle`),c={imageLoadingStatus:o},l=p.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=Mi(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:dx});return(0,m.jsx)(lx.Provider,{value:l,children:u})}),px=p.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=ux(),[c,l]=p.useState(i===0),u=Ka();return p.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),Mi(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:dx,enabled:s!==`loaded`&&(i===0||c)})});function mx({className:e,size:t=`default`,...n}){return(0,m.jsx)(fx,{"data-slot":`avatar`,"data-size":t,className:J(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function hx({className:e,...t}){return(0,m.jsx)(px,{"data-slot":`avatar-fallback`,className:J(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}function gx(e){let t=e.label.includes(`@`)?e.label.split(`@`)[0]??``:e.label,n=t.split(/[\s._-]+/).filter(Boolean);return(n.length>1?`${n[0]?.[0]??``}${n[1]?.[0]??``}`:t.slice(0,2)).toUpperCase()||`?`}function _x({viewer:e,signOut:t}){let{theme:n,toggle:r}=ft();return(0,m.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e&&(0,m.jsxs)(`div`,{className:`flex items-center gap-[9px] px-2 py-1.5`,"data-agora-viewer":``,children:[(0,m.jsx)(mx,{size:`sm`,className:`size-7 after:hidden`,children:(0,m.jsx)(hx,{className:`border border-brand-border bg-brand-soft text-[10.5px] font-semibold text-brand`,children:gx(e)})}),(0,m.jsxs)(`div`,{className:`min-w-0 leading-tight`,children:[(0,m.jsx)(`div`,{className:`truncate text-[11px] font-medium text-fg`,title:e.email??e.label,children:e.label}),(e.role||e.email&&e.email!==e.label)&&(0,m.jsx)(`div`,{className:`mono truncate text-[9.5px] uppercase text-faint`,children:e.role??e.email})]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,m.jsxs)(Wi,{variant:`ghost`,size:`sm`,className:`flex-1 justify-center`,onClick:r,"aria-label":n===`dark`?`Switch to light mode`:`Switch to dark mode`,children:[n===`dark`?(0,m.jsx)(bt,{}):(0,m.jsx)(xt,{}),n===`dark`?`Light mode`:`Dark mode`]}),t&&(`action`in t?(0,m.jsxs)(`form`,{method:`post`,action:t.action,className:`contents`,children:[t.csrfToken&&(0,m.jsx)(`input`,{type:`hidden`,name:`_csrf`,value:t.csrfToken}),(0,m.jsx)(Wi,{type:`submit`,variant:`ghost`,size:`icon-sm`,"aria-label":`Sign out`,title:`Sign out`,className:`text-dim`,children:(0,m.jsx)(St,{})})]}):(0,m.jsx)(Wi,{variant:`ghost`,size:`icon-sm`,"aria-label":`Sign out`,title:`Sign out`,className:`text-dim`,nativeButton:!1,render:(0,m.jsx)(`a`,{href:t.href}),children:(0,m.jsx)(St,{})}))]})]})}function vx({brand:e}){return(0,m.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,m.jsxs)(`div`,{className:`relative grid size-[30px] shrink-0 place-items-center rounded-md border border-brand-border bg-brand-soft text-brand [&_svg]:size-4`,children:[e.mark,(0,m.jsx)(`span`,{className:`agora-ring`,"aria-hidden":!0})]}),(0,m.jsxs)(`div`,{className:`min-w-0 overflow-hidden`,children:[(0,m.jsx)(`div`,{className:`truncate text-sm font-bold tracking-[0.03em] text-fg`,children:e.name}),e.subtitle&&(0,m.jsx)(`div`,{className:`mt-px truncate text-[10px] font-medium uppercase tracking-[0.08em] text-faint`,children:e.subtitle})]})]})}function yx({nav:e,activeId:t}){let{isMobile:n,setOpenMobile:r}=qp(),i=(0,p.useCallback)(()=>{n&&r(!1)},[n,r]);return(0,m.jsx)(m.Fragment,{children:e.filter(e=>e.items.length>0).map(e=>e.collapsible?(0,m.jsx)(po,{defaultOpen:e.defaultOpen??!0,children:(0,m.jsxs)(tm,{className:`px-2.5 py-0`,children:[(0,m.jsxs)(nm,{className:J(bx,`p-0`),render:(0,m.jsx)(mo,{className:`flex w-full items-center gap-1 rounded-md px-2 pt-3 pb-1.5 text-left uppercase hover:text-dim`}),children:[e.section,(0,m.jsx)(_t,{className:`ml-auto size-3! -rotate-90 transition-transform in-data-panel-open:rotate-0`})]}),(0,m.jsx)(ho,{children:(0,m.jsx)(rm,{children:(0,m.jsx)(xx,{items:e.items,activeId:t,after:i})})})]})},e.section):(0,m.jsxs)(tm,{className:`px-2.5 py-0`,children:[(0,m.jsx)(nm,{className:bx,children:e.section}),(0,m.jsx)(rm,{children:(0,m.jsx)(xx,{items:e.items,activeId:t,after:i})})]},e.section))})}var bx=`h-auto px-2 pt-3 pb-1.5 text-[9.5px] font-semibold uppercase tracking-[0.14em] text-faint`;function xx({items:e,activeId:t,after:n}){return(0,m.jsx)(im,{className:`gap-0.5`,children:e.map(e=>{let r=e.id===t,i=(0,m.jsxs)(m.Fragment,{children:[e.icon,(0,m.jsx)(`span`,{children:e.label})]});return(0,m.jsxs)(am,{children:[e.href?(0,m.jsx)(sm,{isActive:r,"aria-current":r?`page`:void 0,className:Sx,render:(0,m.jsx)(`a`,{href:e.href,onClick:t=>{e.onSelect&&(t.preventDefault(),e.onSelect()),n()}}),children:i}):(0,m.jsx)(sm,{isActive:r,"aria-current":r?`page`:void 0,className:Sx,onClick:()=>{e.onSelect?.(),n()},children:i}),e.badge!==void 0&&(0,m.jsx)(cm,{className:`mono tnum text-[10px]`,children:e.badge})]},e.id)})})}var Sx=`h-auto gap-[9px] rounded-md border border-transparent px-[9px] py-[7px] text-[12.5px] font-medium text-dim transition-colors hover:bg-hover hover:text-fg data-active:border-brand-border data-active:bg-brand-soft data-active:font-medium data-active:text-fg [&_svg]:size-[15px]! [&_svg]:text-faint hover:[&_svg]:text-dim data-active:[&_svg]:text-brand`;function Cx({title:e,actions:t,search:n}){return(0,m.jsxs)(`header`,{className:`sticky top-0 z-20 flex h-(--agora-topbar-h) shrink-0 items-center gap-3 border-b border-border bg-(--agora-topbar) px-3 backdrop-blur-md md:px-5`,children:[(0,m.jsx)(Xp,{className:`-ml-1 text-dim md:hidden`}),(0,m.jsx)(`div`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:e}),(0,m.jsxs)(`div`,{className:`ml-auto flex min-w-0 items-center gap-2`,children:[t,n]})]})}function wx({brand:e,nav:t,activeId:n,shell:r,title:i,actions:a,children:o,searchPlaceholder:s,contentClassName:c,commands:l}){let[u,d]=(0,p.useState)(!1),f=r.search!==void 0||(l?.length??0)>0;Oy(f,d);let h=(0,p.useCallback)(()=>d(!0),[]);return(0,m.jsxs)(Ip,{delay:150,children:[(0,m.jsx)(`div`,{className:`agora-glow`,"aria-hidden":!0}),(0,m.jsxs)(Jp,{className:`relative z-[1] h-svh min-h-0 overflow-hidden`,style:{"--sidebar-width":`var(--agora-sidebar-w)`},children:[(0,m.jsxs)(Yp,{className:`border-sidebar-border [&_[data-slot=sidebar-inner]]:backdrop-blur-md`,children:[(0,m.jsx)(Qp,{className:`border-b border-sidebar-border px-[18px] pt-[18px] pb-3.5`,children:(0,m.jsx)(sx,{brand:(0,m.jsx)(vx,{brand:e}),current:e.current,config:r.switcher,...f?{onSearch:h}:{}})}),(0,m.jsx)(em,{className:`pt-1 pb-2`,children:(0,m.jsx)(`nav`,{"aria-label":`Console`,children:(0,m.jsx)(yx,{nav:t,activeId:n})})}),(0,m.jsx)($p,{className:`border-t border-sidebar-border px-3.5 py-3`,children:(0,m.jsx)(_x,{...r.viewer?{viewer:r.viewer}:{},...r.signOut?{signOut:r.signOut}:{}})})]}),(0,m.jsxs)(Zp,{className:`min-h-0 min-w-0 overflow-hidden bg-transparent`,children:[(0,m.jsx)(Cx,{title:i,actions:a,search:f?(0,m.jsx)(ky,{onOpen:h,label:r.search?`Search all consoles`:`Search`}):void 0}),(0,m.jsx)(`div`,{className:J(`relative min-h-0 flex-1 overflow-y-auto`,c),children:o})]})]}),f&&(0,m.jsx)(My,{config:r.search,commands:l,open:u,onOpenChange:d,...s?{placeholder:s}:{}})]})}function Tx({children:e,className:t}){return(0,m.jsx)(`div`,{className:J(`flex flex-col gap-4 px-4 pt-5 pb-16 md:px-6 md:pt-6`,t),children:e})}function Ex(e){return encodeURIComponent(String(e))}function Dx(e){let t=[];for(let[n,r]of Object.entries(e))if(r!=null){if(Array.isArray(r))for(let e of r)t.push(`${Ex(n)}[]=${Ex(e)}`);else if(typeof r==`object`)for(let[e,i]of Object.entries(r))i!=null&&t.push(`${Ex(n)}[${Ex(e)}]=${Ex(i)}`);else t.push(`${Ex(n)}=${Ex(r)}`)}return t.join(`&`)}function Ox(e){let t=[];return kx(e,`where`,t),t.join(`&`)}function kx(e,t,n){for(let r=0;r<e.length;r++){let i=e[r],a=`${t}[${r}]`;if(n.push(`${a}[field]=${Ex(i.field)}`),n.push(`${a}[operator]=${Ex(i.operator)}`),i.value!==void 0){if(Array.isArray(i.value))for(let e=0;e<i.value.length;e++)n.push(`${a}[value][${e}]=${Ex(i.value[e])}`);else n.push(`${a}[value]=${Ex(i.value)}`)}i.AND&&i.AND.length>0&&kx(i.AND,`${a}[AND]`,n),i.OR&&i.OR.length>0&&kx(i.OR,`${a}[OR]`,n)}}var Ax=[`equals`,`notEquals`,`contains`,`notContains`,`iContains`,`startsWith`,`endsWith`,`gt`,`gte`,`lt`,`lte`,`between`,`notBetween`,`in`,`notIn`,`isAnyOf`,`isEmpty`,`isNotEmpty`,`isNull`,`isNotNull`,`exists`,`notExists`],jx=[`equals`,`notEquals`,`gt`,`gte`,`lt`,`lte`],Mx=[`contains`,`notContains`,`iContains`,`startsWith`,`endsWith`],Nx=[`in`,`notIn`,`isAnyOf`],Px=[`between`,`notBetween`],Fx=[`isNull`,`isNotNull`,`isEmpty`,`isNotEmpty`,`exists`,`notExists`],Ix=[`gt`,`gte`,`lt`,`lte`],Lx=new Set(jx),Rx=new Set(Mx),zx=new Set(Nx),Bx=new Set(Px),Vx=new Set(Fx),Hx=new Set(Ix);function Ux(e,t){if(Vx.has(e)){if(t!=null)throw Error(`Operator "${e}" does not accept a value.`)}else if(Rx.has(e)){if(typeof t!=`string`)throw Error(`Operator "${e}" expects a string value.`)}else if(Bx.has(e)){if(!Array.isArray(t)||t.length!==2)throw Error(`Operator "${e}" expects [low, high] tuple.`)}else if(zx.has(e)){if(!Array.isArray(t))throw Error(`Operator "${e}" expects an array value.`)}else if(Lx.has(e)&&Array.isArray(t))throw Error(`Operator "${e}" expects a scalar value, not an array. Use "in" for arrays.`)}function Wx(e){if(!Hx.has(e))throw Error(`Operator "${e}" should use where() (replace), not add(). add() is for range operators (gt, gte, lt, lte) on the same field.`)}var Gx=class e{conditions=[];groups=[];extra={};includes=[];searchTerm;sorts=[];distinctFields=[];groupByCountSpec;pagination;cursor;version=0;snapshot=null;listeners=new Set;where(e,t,n){if(this.conditions=this.conditions.filter(t=>t.field!==e),n!==void 0){let r=t;Ux(r,n),this.conditions.push({field:e,operator:r,value:n})}else Array.isArray(t)?this.conditions.push({field:e,operator:`in`,value:t}):typeof t==`string`&&[`isNull`,`isNotNull`,`isEmpty`,`isNotEmpty`,`exists`,`notExists`].includes(t)?(Ux(t,void 0),this.conditions.push({field:e,operator:t,value:void 0})):this.conditions.push({field:e,operator:`equals`,value:t});return this.notify(),this}whereDynamic(e,t,n){if(!Ax.includes(t))throw Error(`Unknown filter operator "${String(t)}".`);return Ux(t,n),this.conditions=this.conditions.filter(t=>t.field!==e),this.conditions.push({field:e,operator:t,value:Vx.has(t)?void 0:n}),this.notify(),this}add(e,t,n){return Wx(t),Ux(t,n),this.conditions.push({field:e,operator:t,value:n}),this.notify(),this}remove(e){return this.conditions=this.conditions.filter(t=>t.field!==e),this.notify(),this}clear(){return this.conditions=[],this.groups.length=0,this.extra={},this.includes=[],this.searchTerm=void 0,this.sorts=[],this.distinctFields=[],this.groupByCountSpec=void 0,this.pagination=void 0,this.cursor=void 0,this.notify(),this}or(t){let n=new e;return t(n),this.groups.push({type:`OR`,conditions:n.conditions}),this.notify(),this}and(t){let n=new e;return t(n),this.groups.push({type:`AND`,conditions:n.conditions}),this.notify(),this}equals(e,t){return this.where(e,`equals`,t)}notEquals(e,t){return this.where(e,`notEquals`,t)}contains(e,t){return this.where(e,`contains`,t)}in(e,t){return this.where(e,`in`,t)}notIn(e,t){return this.where(e,`notIn`,t)}between(e,t,n){return this.where(e,`between`,[t,n])}gt(e,t){return this.where(e,`gt`,t)}gte(e,t){return this.where(e,`gte`,t)}lt(e,t){return this.where(e,`lt`,t)}lte(e,t){return this.where(e,`lte`,t)}isNull(e){return this.where(e,`isNull`)}isNotNull(e){return this.where(e,`isNotNull`)}isEmpty(e){return this.where(e,`isEmpty`)}isNotEmpty(e){return this.where(e,`isNotEmpty`)}startsWith(e,t){return this.where(e,`startsWith`,t)}endsWith(e,t){return this.where(e,`endsWith`,t)}addGte(e,t){return this.add(e,`gte`,t)}addLte(e,t){return this.add(e,`lte`,t)}addGt(e,t){return this.add(e,`gt`,t)}addLt(e,t){return this.add(e,`lt`,t)}set(e,t){return this.extra[e]=t,this.notify(),this}include(...e){for(let t of e)typeof t==`string`&&(this.includes.includes(t)||this.includes.push(t));return this.notify(),this}search(e){return typeof e==`string`&&(this.searchTerm=e,this.notify()),this}distinct(...e){for(let t of e)typeof t==`string`&&(this.distinctFields.includes(t)||this.distinctFields.push(t));return this.notify(),this}groupByCount(e,t={}){return typeof e==`string`&&e!==``&&(this.groupByCountSpec={field:e,...t.limit!==void 0&&{limit:t.limit},...t.offset!==void 0&&{offset:t.offset},...t.search!==void 0&&{search:t.search}}),this.notify(),this}sort(e,t=`asc`){return this.sorts=this.sorts.filter(t=>t.field!==e),this.sorts.push({field:e,direction:t}),this.notify(),this}sortDynamic(e,t=`asc`){return this.sort(e,t)}sortDesc(e){return this.sort(e,`desc`)}sortAsc(e){return this.sort(e,`asc`)}page(e,t=25){if(!Number.isInteger(e)||e<1)throw RangeError(`page must be an integer >= 1 (pages are 1-based), got ${e}`);if(!Number.isInteger(t)||t<1)throw RangeError(`size must be an integer >= 1, got ${t}`);return this.pagination={page:e,size:t},this.cursor=void 0,this.notify(),this}after(e){return this.setCursor(`after`,e),this}before(e){return this.setCursor(`before`,e),this}first(e){return this.setCursorSize(`first`,e),this}last(e){return this.setCursorSize(`last`,e),this}setCursor(e,t){if(typeof t!=`string`||t.length===0)throw TypeError(`${e} must be a non-empty cursor string, got ${String(t)}`);let{first:n,last:r}=this.cursor??{};this.cursor={[e]:t,...n!==void 0&&{first:n},...r!==void 0&&{last:r}},this.pagination=void 0,this.notify()}setCursorSize(e,t){if(!Number.isInteger(t)||t<1)throw RangeError(`${e} must be an integer >= 1, got ${t}`);let{after:n,before:r}=this.cursor??{};this.cursor={...n!==void 0&&{after:n},...r!==void 0&&{before:r},[e]:t},this.pagination=void 0,this.notify()}notify(){this.version++,this.snapshot=null;for(let e of this.listeners)e()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>(this.snapshot===null&&(this.snapshot=this.build()),this.snapshot);getVersion(){return this.version}build(){let e=[];for(let t of this.conditions)e.push({field:t.field,operator:t.operator,value:t.value});for(let t of this.groups){let n=t.conditions.map(e=>({field:e.field,operator:e.operator,value:e.value}));t.type===`OR`?e.push({field:``,operator:`equals`,value:void 0,OR:n}):e.push({field:``,operator:`equals`,value:void 0,AND:n})}let t={...this.extra,filter:{where:e}};return this.includes.length>0&&(t.include=[...this.includes]),this.searchTerm!==void 0&&(t.search=this.searchTerm),this.sorts.length>0&&(t.sort=[...this.sorts]),this.distinctFields.length>0&&(t.distinct=[...this.distinctFields]),this.groupByCountSpec!==void 0&&(t.groupByCount={...this.groupByCountSpec}),this.pagination!==void 0&&(t.paginate={...this.pagination}),this.cursor!==void 0&&Object.assign(t,this.cursor),t}toQueryString(){let e=[],t;if(this.groups.length===0){let e=this.toFlatObject();t=Dx(Object.fromEntries(Object.entries(e).map(([e,t])=>[`filter[${e}]`,t])))}else t=Ox(this.build().filter.where);if(t&&e.push(t),this.includes.length>0&&e.push(`include=${encodeURIComponent(this.includes.join(`,`))}`),this.searchTerm!==void 0&&e.push(`search=${encodeURIComponent(this.searchTerm)}`),this.sorts.length>0){let t=this.sorts.map(e=>e.direction===`desc`?`-${e.field}`:e.field).join(`,`);e.push(`sort=${encodeURIComponent(t)}`)}if(this.distinctFields.length>0&&e.push(`distinct=${encodeURIComponent(this.distinctFields.join(`,`))}`),this.groupByCountSpec!==void 0){let{field:t,limit:n,offset:r,search:i}=this.groupByCountSpec,a=[[`groupByCount[field]`,t]];n!==void 0&&a.push([`groupByCount[limit]`,n]),r!==void 0&&a.push([`groupByCount[offset]`,r]),i!==void 0&&a.push([`groupByCount[search]`,i]);let o=Dx(Object.fromEntries(a));o&&e.push(o)}if(this.pagination!==void 0&&(e.push(`page=${encodeURIComponent(String(this.pagination.page))}`),e.push(`size=${encodeURIComponent(String(this.pagination.size))}`)),this.cursor!==void 0)for(let t of[`after`,`before`,`first`,`last`]){let n=this.cursor[t];n!==void 0&&e.push(`${t}=${encodeURIComponent(String(n))}`)}let n=Dx(this.extra);return n&&e.push(n),e.join(`&`)}toFlatObject(){let e={};for(let t of this.conditions)if(t.operator===`equals`)e[t.field]=t.value;else if(t.operator===`in`)e[t.field]=t.value;else{let n=e[t.field];typeof n==`object`&&n&&!Array.isArray(n)?n[t.operator]=t.value:e[t.field]={[t.operator]:t.value}}return e}},Kx=new Set([`eq`,`ne`,`gt`,`gte`,`lt`,`lte`,`in`]);function qx(e,t,n){if(n!==void 0){if(Array.isArray(n)){if(n.length===0)return;e.where(t,n.length===1?n[0]:n)}else n!==``&&e.where(t,n)}}function Jx(e,t={},n){let r=new Gx;qx(r,`status`,e.status),qx(r,`workflow`,e.workflow),qx(r,`tag`,e.tag),qx(r,`namespace`,e.namespace),e.origin&&r.where(`origin`,e.origin);let i=[];for(let t of e.attr??[]){let[e,n,...r]=t.split(`:`);e&&Kx.has(n??``)&&r.length!==0&&i.push(t)}return i.length>0&&r.where(`attr`,i.length===1?i[0]:i),t.page!==void 0&&r.set(`page`,t.page),t.size!==void 0&&r.set(`size`,t.size),n&&r.groupByCount(n.field,{...n.limit!==void 0&&{limit:n.limit},...n.offset!==void 0&&{offset:n.offset},...n.search?.trim()&&{search:n.search.trim()}}),r.toQueryString()}function Yx(e){if(typeof e==`object`&&e&&`durationMs`in e){let t=e.durationMs;if(typeof t==`number`)return t}}function Xx(e){let t=new Map,n=[];for(let r of e){let e=r.subId??r.name??r.process;if(e===void 0){n.push(r);continue}let i=t.get(e),a=i??{id:e,name:r.name??e,phases:[],logs:[]};i||t.set(e,a),r.name!==void 0&&(a.name=r.name),r.group!==void 0&&(a.group=r.group),r.status===void 0?r.phase===void 0?a.logs.push(r):a.phases.push(r):(a.terminal=r,a.status=r.status)}return{subs:[...t.values()].map(e=>{let t=[...e.phases,...e.logs],n=[...t,...e.terminal?[e.terminal]:[]].map(e=>e.at),r=n.length?n.reduce((e,t)=>t<e?t:e,1/0):void 0,i=Yx(e.terminal?.data)??(e.terminal&&r!==void 0&&t.length>0?e.terminal.at-r:void 0);return{...e,startedAt:r,durationMs:i}}),stepLogs:n}}var Zx={kind:`all`};function Qx(e){return e?.trim()||void 0}function $x(e){return Qx(e)===void 0}function eS(e){let t=Qx(e);if(t===void 0)return`app`;let n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)||t}function tS(e,t){return e.kind===t.kind?e.kind===`origin`&&t.kind===`origin`?e.origin===t.origin:!0:!1}function nS(e){return e.kind===`origin`?`origin:${e.origin}`:e.kind}function rS(e,t){if(t.kind===`all`)return!0;let n=Qx(e.origin);return t.kind===`unknown`?n===void 0:n===t.origin}function iS(e,t){return t.kind===`all`?[...e]:e.filter(e=>rS(e,t))}var aS=`The app's own workflows: runs with no package origin, i.e. not declared by any library.`;function oS(e){let t=new Map,n=0;for(let r of e){let e=Qx(r.origin);e===void 0?n+=1:t.set(e,(t.get(e)??0)+1)}let r=[{filter:Zx,label:`all`,title:`Every origin, including runs that have none`,count:e.length}];for(let e of[...t.keys()].sort())r.push({filter:{kind:`origin`,origin:e},label:eS(e),title:e,count:t.get(e)??0});return n>0&&r.push({filter:{kind:`unknown`},label:`app`,title:aS,count:n}),r}function sS(e){return e.some(e=>Qx(e.origin)!==void 0)}function cS(e){return e.reduce((e,t)=>e+ +!!$x(t.origin),0)}function lS(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 ${eS(e.origin.origin)} match these filters.`,unclassified:e.unknownCount}:{message:`No runs match these filters.`}:{message:`No runs yet.`}}function uS(e){return e.startsWith(`compensate:`)?e.slice(11):e}function dS(e){let t=[],n=[];for(let r of e)r.seq<0?n.push(r):t.push(r);return n.sort((e,t)=>t.seq-e.seq),{body:t,compensations:n}}function fS(e){let t=0,n=0,r=0;for(let i of e)i.status===`completed`?t++:i.status===`failed`?n++:r++;return{total:e.length,done:t,failed:n,pending:r}}var pS=`update:`,mS=`task:`,hS=`child:`,gS=`runwait:`,_S=[`bp:`,`breakpoint`];function vS(e,t){let n=e.slice(t.length),r=n.indexOf(`:`);if(r===-1)return;let i=n.slice(r+1);return i.length>0?i:void 0}function yS(e){if(!_S.some(t=>e.startsWith(t))&&!(e.startsWith(hS)||e.startsWith(gS))){if(e.startsWith(pS)){let t=vS(e,pS);if(t!==void 0)return{kind:`update`,token:e,name:t}}if(e.startsWith(mS)){let t=vS(e,mS);if(t!==void 0)return{kind:`task`,token:e,name:t}}return{kind:`signal`,token:e}}}function bS(e,t){let n=[];for(let t of e)t.kind===`signal`&&(t.status===`pending`||t.status===`running`)&&n.push(t.name);n.length===0&&t&&(t.on===`signal`||t.on===`webhook`)&&n.push(t.name);let r=new Set,i=[];for(let e of n){if(r.has(e))continue;r.add(e);let t=yS(e);t&&i.push(t)}return i}function xS(){if(typeof window>`u`)return;let e=new URLSearchParams(window.location.search).get(`tenant`);return e&&e!==`*`?e:void 0}function SS(e){let t=xS();return t===void 0?e:`${e}${e.includes(`?`)?`&`:`?`}tenant=${encodeURIComponent(t)}`}var CS=6e5;function wS(e,t){return e.kind!==`remote`||e.status!==`pending`?!1:t-(e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime())>CS}function TS(e){return e===`running`||e===`suspended`||e===`cancelling`}var ES=new Set([`running`,`suspended`,`blocked`,`cancelling`]),DS=`durable:singleton:admitted`;function OS(e){let t=e.lastIndexOf(`@`);return t===-1?e:e.slice(0,t)}function kS(e,t){let n=OS(e),r=t.filter(e=>OS(e.group)===n),i=r.some(e=>e.depth>0),a=r.some(e=>e.liveWorkers.length>0);return i&&!a}function AS(e){return e.startsWith(`wh:`)?`webhook ${e}`:e.startsWith(`child:`)?`child ${e.slice(6)}`:`signal ${e}`}function jS(e,t){let n=e.tags?.find(e=>e.startsWith(`singleton:`));if(!n||e.tags?.includes(DS))return;let r=t.filter(e=>ES.has(e.status)&&e.tags?.includes(n)).sort((e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id));return r.find(e=>e.tags?.includes(DS))??r[0]}function MS(e){return`${e.on} ${e.name}`}function NS(e,t){if(e.status!==`suspended`)return e.status===`pending`&&kS(e.workflow,t.health)?{status:`no-worker`,detail:e.workflow}:e.status===`blocked`?{status:`blocked`,detail:e.error?.message??e.workflow}:{status:e.status};let n=jS(e,t.runs);if(n&&n.id!==e.id)return{status:`queued`,detail:`behind leader ${n.id.slice(0,8)}`};let r=t.timeline?.find(e=>e.status===`pending`||e.status===`running`);if(r){if(r.name.startsWith(`signal:child:${e.id}.onError.`)){let e=r.input?.workflow;return{status:`awaiting`,detail:typeof e==`string`?`failure handler ${e}`:`failure handler`}}return r.kind===`signal`?{status:`awaiting`,detail:AS(r.name)}:r.kind===`sleep`?{status:`sleeping`}:r.workerGroup&&kS(r.workerGroup,t.health)?{status:`no-worker`,detail:OS(r.workerGroup)}:{status:`running`}}return e.waiting?{status:`awaiting`,detail:MS(e.waiting)}:kS(e.workflow,t.health)?{status:`no-worker`,detail:e.workflow}:t.timeline?{status:`suspended`}:{status:`running`}}function PS(e,t){return e.status===`suspended`?t?.some(e=>e.status===`pending`||e.status===`running`)?`running`:e.wakeAt==null?t?`awaiting`:`running`:`sleeping`:e.status}var FS=`durable-dashboard-config`;function IS(){if(typeof document>`u`)return{};let e=document.getElementById(FS);if(e===null)return{};try{let t=JSON.parse(e.textContent??``);return typeof t==`object`&&t?t:{}}catch{return{}}}function LS(){let e=IS().base;return typeof e==`string`?e:`/durable`}function RS(){let e=IS().api;return typeof e==`string`?e:`${LS()}/api`}async function zS(e){try{let t=await e.json();if(typeof t!=`object`||!t)return;let n=t.redirectTo;return typeof n==`string`&&n!==``?n:void 0}catch{return}}function BS(e){typeof window<`u`&&(window.location.href=e??(LS()||`/`))}function VS(){if(typeof document>`u`)return{};let e=/(?:^|;\s*)XSRF-TOKEN=([^;]*)/.exec(document.cookie)?.[1];return e?{"x-xsrf-token":decodeURIComponent(e)}:{}}var HS=`The server redirected this request instead of answering it, usually because the session or its CSRF token expired. Reload the page and try again.`;async function US(e,t){let n=(t?.method??`GET`).toUpperCase(),r=n!==`GET`&&n!==`HEAD`,i=await fetch(RS()+SS(e),{...t,...r?{headers:{...t?.headers,...VS()},redirect:`manual`}:{}});if(i.status===401)throw BS(await zS(i)),Error(`Not signed in; redirecting.`);if(i.type===`opaqueredirect`||i.redirected||i.status>=300&&i.status<400)throw new GS(i.status,HS,void 0);return i}async function WS(e,t){let n=await US(e,t);if(!n.ok)throw await JS(n);return await n.json()}var GS=class extends Error{status;body;constructor(e,t,n){super(t),this.status=e,this.body=n,this.name=`DurableActionError`}};function KS(e){if(!(e instanceof GS)||typeof e.body!=`object`||e.body===null)return;let t=e.body.waitingOn;if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}async function qS(e,t){let n=await US(e,t);if(!n.ok)throw await JS(n);return await n.json()}async function JS(e){let t;try{t=await e.json()}catch{t=void 0}let n=typeof t==`object`&&t&&typeof t.error==`string`?t.error:`${e.status} ${e.statusText}`;return new GS(e.status,n,t)}function YS(e,t){return qS(e,{method:`POST`,...t===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}})}var XS={async runs(e,t,n,r){let{data:i}=await XS.runsPage(e,t,n,r);return i},async runsPage(e,t,n,r,i){let a=Jx({status:e,tag:t,attr:n,...r},i??{}),o=await WS(a?`/runs?${a}`:`/runs`);return{data:o.data,meta:o.meta}},async values(e,t={},n){return WS(`/runs/values?${Jx(t,{},{field:e,...n})}`)},run(e){return WS(`/runs/${encodeURIComponent(e)}`)},fanMembers(e,t,n={}){let r=new Gx;n.failed&&r.where(`status`,`failed`),(n.page!==void 0||n.size!==void 0)&&r.page(n.page??1,n.size??100);let i=r.toQueryString(),a=`/runs/${encodeURIComponent(e)}/fans/${encodeURIComponent(t)}`;return WS(i?`${a}?${i}`:a)},async workers(){return(await WS(`/workers`)).data},topology(){return WS(`/topology`)},tenants(){return WS(`/tenants`)},selectTenant(e){return WS(`/tenants/${encodeURIComponent(e)}/select`,{method:`POST`})},compat(){return WS(`/compat`)},async retry(e){return(await WS(`/runs/${encodeURIComponent(e)}/retry`,{method:`POST`})).result},async retryWithInput(e,t){return(await WS(`/runs/${encodeURIComponent(e)}/retry-with-input`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({input:t})})).result},bulk(e,t){let{compensate:n,...r}=t,i=Jx(r),a=n?`${i?`${i}&`:``}compensate=true`:i;return WS(`/bulk/${e}${a?`?${a}`:``}`,{method:`POST`})},async cancel(e,t){let n=t?.compensate?`?compensate=true`:``;return(await WS(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:`POST`})).result},async continue(e){return(await WS(`/runs/${encodeURIComponent(e)}/continue`,{method:`POST`})).result},workflowLifecycle(e){return WS(`/workflows/${encodeURIComponent(e)}/lifecycle`)},async republishLifecycle(e,t){return(await WS(`/runs/${encodeURIComponent(e)}/republish-lifecycle`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t===void 0?{}:{subscriber:t})})).result},async redispatch(e){return(await WS(`/runs/${encodeURIComponent(e)}/redispatch`,{method:`POST`})).result},async signal(e,t,n,r){return(await YS(`/runs/${encodeURIComponent(e)}/signal`,{token:t,payload:n,...r?.force?{force:!0}:{}})).result},async update(e,t,n){return(await YS(`/runs/${encodeURIComponent(e)}/updates/${encodeURIComponent(t)}`,{arg:n})).result},completeTask(e,t,n){return YS(`/runs/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}/complete`,{result:n})},failTask(e,t,n){return YS(`/runs/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}/fail`,{error:n})},async schedules(){let e=[];for(let t=1;;t+=1){let n=await WS(`/schedules?${new Gx().page(t,200).toQueryString()}`);if(e.push(...n.data),n.meta.currentPage>=n.meta.lastPage)return e}},setSchedulePaused(e,t){return YS(`/schedules/${encodeURIComponent(e)}/${t?`pause`:`resume`}`)},async triggerSchedule(e){return(await YS(`/schedules/${encodeURIComponent(e)}/trigger`)).result},streamRun(e,t){if(typeof EventSource>`u`)return()=>{};let n=new EventSource(`${RS()}${SS(`/runs/${encodeURIComponent(e)}/stream`)}`);return n.onmessage=e=>{try{t(JSON.parse(e.data))}catch{}},()=>n.close()}};function ZS({title:e,description:t,actions:n,className:r}){return(0,m.jsxs)(`div`,{className:J(`flex flex-wrap items-end justify-between gap-3`,r),children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`h1`,{className:`text-lg font-bold tracking-[0.01em] text-fg`,children:e}),t&&(0,m.jsx)(`p`,{className:`mt-1 text-xs text-faint`,children:t})]}),n&&(0,m.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:n})]})}function QS({children:e,className:t,label:n=`toolbar`}){return(0,m.jsx)(`div`,{role:`toolbar`,"aria-label":n,className:J(`flex flex-wrap items-center gap-1.5`,t),children:e})}function $S({className:e,size:t=`default`,...n}){return(0,m.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:J(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function eC({title:e,description:t,action:n,children:r,flush:i,className:a,bodyClassName:o}){return(0,m.jsxs)($S,{className:J(`agora-surface agora-rise rounded-lg border border-border shadow-none ring-0 gap-0 py-0`,a),children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b border-border px-4 py-3`,children:[(0,m.jsx)(`h3`,{className:`text-[12.5px] font-semibold tracking-[0.02em] text-fg`,children:e}),(t||n)&&(0,m.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[t&&(0,m.jsx)(`span`,{className:`mono truncate text-[10.5px] text-faint`,children:t}),n]})]}),(0,m.jsx)(`div`,{className:J(i?``:`px-4 pt-3 pb-4`,o),children:r})]})}var tC=Hi(`group/badge inline-flex h-[18px] w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 font-mono text-[10px] font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`border-bad/22 bg-bad/12 text-bad`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`,brand:`border-brand-border bg-brand-soft text-brand`,good:`border-good/22 bg-good/12 text-good`,warn:`border-warn/22 bg-warn/12 text-warn`,info:`border-info/22 bg-info/12 text-info`,violet:`border-violet/22 bg-violet/12 text-violet`,teal:`border-teal/22 bg-teal/12 text-teal`,neutral:`border-border bg-hover text-dim`,bare:`h-auto rounded-none border-transparent px-0 uppercase tracking-wider`}},defaultVariants:{variant:`default`}});function nC({className:e,variant:t=`default`,render:n,...r}){return go({defaultTagName:`span`,props:Jr({className:J(tC({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function rC(e){return`#/workflow/${encodeURIComponent(e)}`}function iC(e){let t=e.match(/^#\/workflow\/(.+)$/);return t?.[1]?decodeURIComponent(t[1]):void 0}function aC(e){let t=[];return e.where&&t.push(`where`),e.input&&t.push(`input`),e.coalesce&&t.push(e.coalesce.keyed?`${e.coalesce.mode} by key`:e.coalesce.mode),e.local||t.push(`announced`),t}function oC(e,t){let n=e?.[t];if(n)return n.failed>0?`${n.triggered} started · ${n.failed} failed`:`${n.triggered} started`}function sC({title:e,empty:t,links:n,counts:r}){return(0,m.jsxs)(`section`,{"aria-label":e,className:`min-w-0`,children:[(0,m.jsx)(`h3`,{className:`text-[10px] uppercase tracking-wider text-dim`,children:e}),n.length===0?(0,m.jsx)(`p`,{className:`mt-1 text-[11px] text-faint`,children:t}):(0,m.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1`,children:n.map(e=>(0,m.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,m.jsx)(`a`,{href:rC(e.workflow),className:`mono text-[12px] text-fg underline-offset-2 hover:underline`,children:e.workflow}),(0,m.jsxs)(nC,{variant:`neutral`,className:e.kind===`failed`?`s-failed`:`s-completed`,children:[`on `,e.kind]}),aC(e).map(e=>(0,m.jsx)(nC,{variant:`neutral`,children:e},e)),oC(r,e.workflow)&&(0,m.jsx)(`span`,{className:`mono text-[10px] ${r?.[e.workflow]?.failed?`text-bad`:`text-dim`}`,title:`Counted by this dashboard's server process since it started`,children:oC(r,e.workflow)})]},`${e.workflow}:${e.kind}`))})]})}function cC({links:e,counts:t}){return(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-6`,children:[(0,m.jsx)(sC,{title:`Starts when it settles`,empty:`No workflow starts when it settles.`,links:e.startsOnSettle,counts:t}),(0,m.jsx)(sC,{title:`Started by`,empty:`No workflow's settling starts it.`,links:e.startedBy})]})}function lC({workflow:e}){let{data:t,error:n,isPending:r}=Qe({queryKey:[`workflow-lifecycle`,e],queryFn:()=>XS.workflowLifecycle(e),refetchInterval:1e4});return(0,m.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,m.jsx)(ZS,{title:(0,m.jsx)(`span`,{className:`mono`,children:e}),description:`Lifecycle events: registered here and announced by live workers.`}),(0,m.jsx)(eC,{title:`Lifecycle`,description:`who starts when it settles, and who starts it`,children:n?(0,m.jsx)(Ki,{title:`Lifecycle could not be loaded`,error:n}):r||!t?(0,m.jsxs)(`div`,{className:`flex flex-col gap-2`,"aria-hidden":!0,children:[(0,m.jsx)(Gf,{className:`h-3 w-48`}),(0,m.jsx)(Gf,{className:`h-3 w-64`}),(0,m.jsx)(Gf,{className:`h-3 w-40`})]}):(0,m.jsx)(cC,{links:t,counts:t.triggerCounts})})]})}function uC(e){let t=e.match(/^#\/run\/(.+)$/)?.[1];if(t)return{page:`runs`,runId:decodeURIComponent(t)};let n=iC(e);return n===void 0?e===`#/workers`?{page:`workers`}:e===`#/schedules`?{page:`schedules`}:{page:`runs`}:{page:`workflow`,workflow:n}}function dC(e){switch(e.page){case`runs`:return e.runId?`#/run/${encodeURIComponent(e.runId)}`:``;case`workflow`:return rC(e.workflow);default:return`#/${e.page}`}}function fC(){return typeof window>`u`?{page:`runs`}:uC(window.location.hash)}function pC(e){if(typeof window>`u`)return;let t=dC(e);if(window.location.hash===t)return;let n=t||window.location.pathname+window.location.search;window.history.pushState(null,``,n)}function mC({className:e}){return(0,m.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,className:e,role:`img`,"aria-label":`durable`,children:[(0,m.jsx)(`title`,{children:`durable`}),(0,m.jsx)(`path`,{d:`M12 2.5 21.5 12 12 21.5 2.5 12z`,opacity:.35}),(0,m.jsx)(`circle`,{cx:`6.4`,cy:`12`,r:`1.7`,fill:`currentColor`,stroke:`none`}),(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.7`,fill:`currentColor`,stroke:`none`}),(0,m.jsx)(`circle`,{cx:`17.6`,cy:`12`,r:`1.7`,fill:`currentColor`,stroke:`none`}),(0,m.jsx)(`path`,{d:`M8.1 12h2.2M13.7 12h2.2`})]})}var hC=[`pending`,`running`,`suspended`,`blocked`,`cancelling`,`completed`,`failed`,`cancelled`,`dead`];function gC(e){let t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function _C(e,t){let n=new Date(t).getTime()-new Date(e).getTime();return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${(n/6e4).toFixed(1)}m`}function vC({status:e}){return(0,m.jsx)(`span`,{className:`dot s-${e} ${e===`running`||e===`awaiting`?`pulse`:``}`,"aria-hidden":!0})}function yC({status:e}){return(0,m.jsxs)(nC,{variant:`bare`,className:`s-${e} gap-1.5 text-[11px]`,children:[(0,m.jsx)(vC,{status:e}),e]})}var bC={width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.7,strokeLinecap:`round`,strokeLinejoin:`round`};function xC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`rect`,{x:`7`,y:`7`,width:`10`,height:`10`,rx:`1.5`}),(0,m.jsx)(`path`,{d:`M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2`})]})}function SC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,m.jsx)(`path`,{d:`M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18`})]})}function CC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`13`,r:`8`}),(0,m.jsx)(`path`,{d:`M12 13V9M9 2h6`})]})}function wC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`}),(0,m.jsx)(`path`,{d:`M7.8 7.8a6 6 0 0 0 0 8.4M16.2 16.2a6 6 0 0 0 0-8.4M5 5a10 10 0 0 0 0 14M19 19a10 10 0 0 0 0-14`})]})}function TC(e){return(0,m.jsx)(`svg`,{...bC,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`m4 12 5 5L20 6`})})}function EC(e){return(0,m.jsx)(`svg`,{...bC,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M6 6l12 12M18 6 6 18`})})}function DC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`rect`,{x:`9`,y:`9`,width:`11`,height:`11`,rx:`2`}),(0,m.jsx)(`path`,{d:`M5 15V5a2 2 0 0 1 2-2h8`})]})}function OC(e){return(0,m.jsx)(`svg`,{...bC,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5`})})}function kC(e){return(0,m.jsx)(`svg`,{...bC,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M13 2 4 14h7l-1 8 9-12h-7l1-8z`})})}function AC(e){return(0,m.jsx)(`svg`,{...bC,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M6 4l14 8-14 8z`})})}function jC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,m.jsx)(`path`,{d:`m20 20-4-4`})]})}function MC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`6`,cy:`5`,r:`2`}),(0,m.jsx)(`path`,{d:`M6 7v6a4 4 0 004 4h4`}),(0,m.jsx)(`circle`,{cx:`18`,cy:`17`,r:`2`})]})}var NC={local:xC,remote:SC,sleep:CC,signal:wC,child:MC};function PC(e){return NC[e]??xC}var FC={local:`In-process step`,remote:`Remote worker step`,sleep:`Durable timer`,signal:`External signal`,child:`Child workflow — click to open its run`},IC=(0,p.forwardRef)(({className:e,...t},n)=>(0,m.jsx)(`input`,{ref:n,className:J(`mono w-full bg-transparent py-1.5 text-xs text-fg placeholder:text-faint focus:outline-none disabled:opacity-50`,e),...t}));IC.displayName=`Input`;var LC=(0,p.forwardRef)(({glyph:e,onClear:t,clearLabel:n=`clear`,containerClassName:r,value:i,...a},o)=>(0,m.jsxs)(`div`,{className:J(`flex items-center gap-1.5 rounded-md border border-line px-2 transition-colors focus-within:border-line-strong`,r),children:[e!==void 0&&(0,m.jsx)(`span`,{className:`shrink-0 text-faint`,"aria-hidden":!0,children:e}),(0,m.jsx)(IC,{ref:o,value:i,...a}),t&&i?(0,m.jsx)(Wi,{variant:`ghost`,size:`icon-sm`,onClick:t,title:n,"aria-label":n,className:`h-4 w-4`,children:(0,m.jsx)(EC,{width:12,height:12})}):null]}));LC.displayName=`InputField`;function RC({onOpenRun:e}){let[t,n]=(0,p.useState)(``),[r,i]=(0,p.useState)(!1),a=$e({mutationFn:e=>XS.run(e),onSuccess:t=>{n(``),i(!1),e(t.run.id)},onError:()=>i(!0)});return(0,m.jsxs)(`form`,{className:`relative`,onSubmit:e=>{e.preventDefault();let n=t.trim();n&&a.mutate(n)},children:[(0,m.jsx)(LC,{glyph:(0,m.jsx)(jC,{width:12,height:12}),value:t,onChange:e=>{n(e.target.value),i(!1)},onClear:()=>{n(``),i(!1)},clearLabel:`clear run id`,placeholder:`open run id…`,"aria-label":`open run by id`,containerClassName:`w-44`}),r&&(0,m.jsx)(`span`,{className:`mono absolute left-0 top-full z-20 mt-1 whitespace-nowrap rounded border border-bad/25 bg-panel-2 px-1.5 py-0.5 text-[10px] text-bad`,children:`no run with that id`})]})}function zC({open:e,onOpenChange:t,title:n,description:r,footer:i,children:a,className:o}){return(0,m.jsx)(ly,{open:e,onOpenChange:t,children:(0,m.jsxs)(fy,{className:J(`gap-4 sm:max-w-xl`,o),children:[(0,m.jsxs)(py,{children:[(0,m.jsx)(hy,{className:`pr-8 text-[15px] font-semibold tracking-tight`,children:n}),r&&(0,m.jsx)(gy,{className:`mono break-all text-[11px]`,children:r})]}),(0,m.jsx)(`div`,{children:a}),i&&(0,m.jsx)(my,{children:i})]})})}function BC({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`empty`,className:J(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance`,e),...t})}function VC({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`empty-header`,className:J(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var HC=Hi(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6`}},defaultVariants:{variant:`default`}});function UC({className:e,variant:t=`default`,...n}){return(0,m.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:J(HC({variant:t,className:e})),...n})}function WC({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`empty-title`,className:J(`cn-font-heading text-lg font-medium tracking-tight`,e),...t})}function GC({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`empty-description`,className:J(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function KC({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`empty-content`,className:J(`flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance`,e),...t})}function qC({title:e,description:t,icon:n,action:r,className:i}){return(0,m.jsxs)(BC,{className:J(`p-8`,i),children:[(0,m.jsxs)(VC,{children:[(0,m.jsx)(UC,{variant:`icon`,className:`border border-border bg-panel-2 text-faint`,children:n??(0,m.jsx)(Tt,{})}),(0,m.jsx)(WC,{className:`text-[13px] font-semibold text-fg`,children:e}),t&&(0,m.jsx)(GC,{className:`text-xs text-faint`,children:t})]}),r&&(0,m.jsx)(KC,{children:r})]})}var JC=p.createContext(void 0);function YC(e){let t=p.useContext(JC);if(t===void 0&&!e)throw Error(ci(47));return t}var XC={...ku,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!ku.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&ku.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>ku.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},ZC=class extends bu{constructor(e,t,n){let r=new eu;super(QC(e,r,t,n),$C(r),XC)}setOpen=(e,t)=>{let n=t.reason===ia,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=ql(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=Kl(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),Za.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function QC(e,t,n,r=!1){let i={...Cu(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function $C(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeTriggerFocusGuardRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Ga,stickIfOpen:!0,triggerElements:e}}var ew=lu(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=nw(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),h=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),$l(u,d),Xl(u);let{forceUnmount:g}=Zl(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),p.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>u.setOpen(!1,ea(_a))}),[g,u]);let _=d||f||s!=null;return(0,m.jsxs)(JC.Provider,{value:u,children:[s&&(0,m.jsx)(Ul,{handle:s,store:u}),_&&(0,m.jsx)(rw,{store:u,modal:o}),typeof t==`function`?t({payload:h}):t]})});function tw(e){return YC(!0)?(0,m.jsx)(ew,{props:e}):(0,m.jsx)(xl,{children:(0,m.jsx)(ew,{props:e})})}function nw(e,t){let n=Hl((e,n)=>new ZC(t,e,n));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function rw({store:e,modal:t}){let n=Ll(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return Ql(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var iw=uu(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...h}=e,g=YC(!0),_=Au(s)??g;if(!_)throw Error(ci(74));let v=$i(f),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`triggerPopupId`,v),C=p.useRef(null),{registerTrigger:w,isMountedByThisTrigger:T}=Yl(v,C,_,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),E=_.useState(`isPressOpenedByTrigger`,v),D=_.useState(`isTouchPressOpen`,l),O=_.useState(`hasTriggerFocusGuards`,v),k=Bu(b,{enabled:!a&&l&&!D,mouseOnly:!0,move:!1,handleClose:td(),restMs:u,delay:{close:d},triggerElementRef:C,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`}),A=jl(b,{stickIfOpen:Y(()=>_.context.stickIfOpen)}),j=If(()=>_.select(`open`),e=>{_.set(`openMethod`,e)}),M=_.useState(`triggerProps`,T),{getButtonProps:N,buttonRef:P}=mi({disabled:a,native:o}),F={open(e){return E?$o.open(e):Qo.open(e)}},{handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=qb(_,C),R=Mi(`button`,e,{state:{disabled:a,open:x},ref:[P,t,w,C],props:[A.reference,k,M,j,{[il]:``,id:v,"aria-haspopup":`dialog`,"aria-expanded":x,"aria-controls":S},h,N],stateAttributesMapping:F}),z=(0,m.jsx)(p.Fragment,{children:R},v);return O?(0,m.jsxs)(p.Fragment,{children:[(0,m.jsx)(Hc,{ref:_.context.beforeTriggerFocusGuardRef,onFocus:I}),z,(0,m.jsx)(Hc,{ref:_.context.triggerFocusTargetRef,onFocus:L})]}):z}),aw=p.createContext(void 0);function ow(){let e=p.useContext(aw);if(e===void 0)throw Error(ci(45));return e}var sw=p.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return YC().useState(`mounted`)||n?(0,m.jsx)(aw.Provider,{value:n,children:(0,m.jsx)(fl,{ref:t,...r})}):null}),cw=p.createContext(void 0);function lw(){let e=p.useContext(cw);if(!e)throw Error(ci(46));return e}var uw=p.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:h,disableAnchorTracking:g=!1,collisionAvoidance:_=ol,...v}=e,y=YC(),b=ow(),x=yl(),S=y.useState(`floatingRootContext`),C=y.useState(`mounted`),w=y.useState(`open`),T=y.useState(`openChangeReason`),E=y.useState(`activeTriggerElement`),D=y.useState(`modal`),O=y.useState(`openMethod`),k=y.useState(`positionerElement`),A=y.useState(`instantType`),j=y.useState(`transitionStatus`),M=Dp({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:h,disableAnchorTracking:g,keepMounted:b,nodeId:x,collisionAvoidance:_,adaptiveOrigin:y.useState(`adaptiveOrigin`)});Tb({store:y,domReference:S.useState(`domReferenceElement`),positionerElement:k,open:w});let N=D===!0&&T!==`trigger-hover`;Db(w&&N,O===`touch`,k,E);let P=y.useStateSetter(`positionerElement`),F=jp(e,{open:w,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:A},{styles:M.positionerStyles,transitionStatus:j,props:v,refs:[t,P],hidden:!C,inert:!w});return(0,m.jsxs)(cw.Provider,{value:M,children:[C&&N&&(0,m.jsx)(mf,{inert:pf(!w),cutout:E}),(0,m.jsx)(bl,{id:x,children:F})]})}),dw=p.createContext(void 0);function fw(){let[e,t]=p.useState(0),n=Y(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var pw=p.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=YC(),l=lw(),u=ab(!0)!=null,{context:d,hasClosePart:f}=fw(),p=c.useState(`open`),h=c.useState(`openMethod`),g=c.useState(`instantType`),_=c.useState(`transitionStatus`),v=c.useState(`popupProps`),y=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);to({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Ru(T,{enabled:O&&!D,closeDelay:k});let A=a===void 0?Vl(c.context.popupRef):a,j=x!==!1&&f;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N=Mi(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:g,transitionStatus:_},ref:[t,c.context.popupRef,M],props:[v,{id:E,role:`dialog`,...Bl,"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){u&&cf.has(e.key)&&e.stopPropagation()}},Ap(_),s],stateAttributesMapping:ts});return(0,m.jsx)(Al,{context:T,openInteractionType:h,modal:j,disabled:!S||C===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:br(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,m.jsx)(dw.Provider,{value:d,children:N})})});function mw({...e}){return(0,m.jsx)(tw,{"data-slot":`popover`,...e})}function hw({...e}){return(0,m.jsx)(iw,{"data-slot":`popover-trigger`,...e})}function gw({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,m.jsx)(sw,{children:(0,m.jsx)(uw,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,m.jsx)(pw,{"data-slot":`popover-content`,className:J(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}function _w(e){return typeof e==`object`?e.key:e}function vw(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function yw(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return(o.length!==r.length||o.some((e,t)=>r[t]!==e))&&(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1),i}return o.updateDeps=e=>{r=e},o}function bw(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var xw=(e,t)=>Math.abs(e-t)<1.01,Sw=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})};function Cw({offset:e,isScrolling:t,elementMax:n,holdOffset:r,scrollOffset:i,pendingWrite:a,clampedMaxAtWrite:o}){return t&&a===null&&e===i?`spurious`:a!==null&&Math.abs(e-a.target)<1.5?`readBack`:a!==null&&!a.smooth&&n!==null&&a.target>n+r+.5&&Math.abs(e-(n+r))<1.5||a!==null&&!a.smooth&&a.lowMaxes?.some(t=>Math.abs(e-t)<1.5)?`clampedReadBack`:o!==null&&Math.abs(e-o)<1.5?`clampedEcho`:`external`}var ww=e=>e===`smooth`||e===`smoothFinishing`;function Tw({kind:e,offset:t,command:n,target:r}){return e!==`spurious`&&e!==`readBack`&&e!==`clampedReadBack`&&n?.index!=null&&n.phase!==`queued`&&!ww(n.phase)&&!xw(t,n.lastTargetOffset)&&!xw(t,r())&&e!==`clampedEcho`}var Ew=40;function Dw(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<Ew;)n--;if(n<0)return!1;let r=e[n],i=n-1;for(;i>=0&&r.t-e[i].t<Ew;)i--;if(i<0)return!1;let a=e[i],o=(t.offset-r.offset)/(t.t-r.t),s=(r.offset-a.offset)/(r.t-a.t);return o*s>=0&&Math.abs(o)>=2*Math.abs(s)&&Math.abs(o)-Math.abs(s)>=.8}function Ow(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<Ew;)n--;if(n<0)return!1;let r=e[n];return Math.abs(t.offset-r.offset)/(t.t-r.t)>=.05}var kw,Aw=()=>{if(kw!==void 0)return kw;if(typeof navigator>`u`)return kw=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return kw=!0;let e=navigator.maxTouchPoints;return kw=navigator.platform===`MacIntel`&&e!==void 0&&e>0},jw,Mw=()=>jw===void 0?jw=Aw()&&typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`overflow-anchor: auto`):jw,Nw=()=>!Aw()||Mw(),Pw={capture:!0,passive:!0},Fw=class{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!==`lateFling`,this.dragging=()=>this._touch?.phase===`down`&&this._touch.moved,this.tail=()=>this._touch?.phase===`tail`?this._touch.moved?`fling`:`tap`:null,this.onScroll=({isScrolling:e,ownReadBack:t,moved:n,external:r})=>(e&&this._touch?.phase===`tail`?this._openTail(this._touch.moved||!t,!1):this._touch?.phase===`lateFling`&&(this.host.now()>this._touch.until?this._touch=null:r&&e&&n&&this._openTail(!0,!1)),!t&&e&&n&&this._touch?.phase===`down`?(this._touch.moved=!0,!0):!1),this.touchStart=()=>{this.end(),this._touch={phase:`down`,moved:!1}},this.touchEnd=()=>{let e=this._touch?.phase===`down`&&this._touch.moved;this.end(),this._openTail(e,e)},this.end=()=>{let e=this.host.getWindow();this._touch?.phase===`tail`&&e!=null&&e.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),n=()=>this.touchEnd();return e.addEventListener(`touchstart`,t,Pw),e.addEventListener(`touchend`,n,Pw),e.addEventListener(`touchcancel`,n,Pw),()=>{e.removeEventListener(`touchstart`,t,Pw),e.removeEventListener(`touchend`,n,Pw),e.removeEventListener(`touchcancel`,n,Pw),this.end()}},this._openTail=(e,t)=>{let n=this.host.getWindow();if(n==null)return;this.end();let r={phase:`tail`,moved:e,awaitingFling:t,timerId:n.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(r.moved,r.awaitingFling):(this._touch=r.awaitingFling?{phase:`lateFling`,until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=r}}get touch(){return this._touch}},Iw=e=>{let{clientWidth:t,clientHeight:n}=e;return{width:t,height:n}},Lw=e=>{let t=new Set;return{schedule:n=>{let r=e.requestAnimationFrame(()=>{t.delete(r),n()});t.add(r)},cancel:()=>{t.forEach(t=>e.cancelAnimationFrame(t)),t.clear()}}},Rw=e=>e,zw=e=>{let t=e.overscan*Math.max(e.lanes??1,1),n=Math.max(e.startIndex-t,0),r=Math.min(e.endIndex+t,e.count-1)-n+1,i=Array(r);for(let e=0;e<r;e++)i[e]=n+e;return i},Bw=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Iw(n)),!r.ResizeObserver)return()=>{};let a=Lw(r),o=new r.ResizeObserver(()=>{let t=()=>{i(Iw(n))};e.options.useAnimationFrameWithResizeObserver?a.schedule(t):t()});return o.observe(n,{box:`content-box`}),()=>{o.unobserve(n),a.cancel()}},Vw={passive:!0},Hw=typeof window>`u`||`onscrollend`in window,Uw=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Hw,o=0,s=a?null:Sw(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Vw),a&&r.addEventListener(`scrollend`,u,Vw),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},Ww=(e,t)=>Uw(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Gw=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Kw=(e,{adjustments:t=0,behavior:n},r)=>{var i;let{scrollElement:a,options:o}=r,s=e+t,c=o.horizontal&&o.isRtl&&a!==null&&`ownerDocument`in a;(i=a?.scrollTo)==null||i.call(a,{[o.horizontal?`left`:`top`]:c?-s:s,behavior:n})},qw=(e,t)=>e===`smooth`?t?`smoothLanded`:`smooth`:`instant`,Jw=e=>e?.phase===`smooth`||e?.phase===`smoothLanded`;function Yw(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var Xw=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new Fw({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if(e?.phase!==`queued`||this.pendingWrite!==null)return!1;let t=this._readElementOffset();return t===null||this._lastElementOffset===null||Math.abs(t-this._lastElementOffset)<1?!1:(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;e?.phase===`queued`&&Ow(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand(),this._retryClampedAdjustment()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=null,n=!1,r=!1,i=new Set,a=()=>{if(e)return e;let r=this.targetWindow;if(!r||!r.ResizeObserver)return null;let i=t=Lw(r);return e=new r.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(o)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment(),this.measureElement(null))}};if(this.options.useAnimationFrameWithResizeObserver)i.schedule(t);else{n=!0;try{t()}finally{n=!1}}})},o=e=>{let t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};return{disconnect:()=>{var n;(n=a())==null||n.disconnect(),t?.cancel(),i.clear(),r=!1,e=null,t=null},observe:o=>{let s=a();s&&(n?(i.add(o),r||(r=!0,t?.schedule(()=>{r=!1,i.forEach(t=>{t.isConnected&&e?.observe(t,{box:`border-box`})}),i.clear()}))):s.observe(o,{box:`border-box`}))},unobserve:e=>{var t;i.delete(e),(t=a())==null||t.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Rw,rangeExtractor:zw,onChange:()=>{},measureElement:Gw,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>_w(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||Yw(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:s}=this.options,c=0;for(;c<a&&s(c)!==e;)c++;if(c<a){let e=n[c];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(o=n-this.scrollOffset,this.scrollOffset=n)}}}i?this.pendingScrollAnchor={kind:`follow`,behavior:i}:o!==null&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:`anchor`,delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=yw(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,(e=this._momentumStop)==null||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{let n=t?this._elementMaxScrollOffset():null,r=this._reportedOverscroll;this._reportedOverscroll=e<0||n!==null&&e>n+1;let i=e;this._lastElementOffset=i,e=this._toLayoutOffset(e);let a=this._classifyScrollEvent(e,t,n);if(a===`spurious`)return;a===`readBack`?e=this.pendingWrite.target:a===`clampedReadBack`&&this.scrollState?.index!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:Tw({kind:a,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let o=this.getScrollOffset(),s=this.scrollDirection;this.scrollDirection=t?o===e?this.scrollDirection:o<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t;let c=this.scrollState;if(c?.phase===`queued`&&a===`external`&&t){if(r||this._reportedOverscroll)c.samples=[];else{let e=this.now();c.samples=[...(c.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:i}],(s!==null&&this.scrollDirection!==s||Dw(c.samples))&&(this.scrollState=null)}}this._iosGesture.onScroll({isScrolling:t,ownReadBack:a===`readBack`,moved:e!==o,external:a===`external`&&this.scrollState?.phase!==`smooth`&&this.scrollState?.phase!==`smoothFinishing`})&&this.scrollState?.phase===`queued`&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let t=this.pendingScrollAnchor;this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled&&(t.kind===`anchor`?this._canWriteScroll()?Jw(this.scrollState)&&!xw(this.getScrollOffset()-t.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(t.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=t.delta,this._followOffsetTarget(t.delta),this.notify(!1)):this.scrollToEnd({behavior:t.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,n)=>Cw({offset:e,isScrolling:t,elementMax:n,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:this._clampedAdjustment?.maxAtWrite??null}),this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled||!this._canWriteScroll())return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(e===null||e.phase!==`queued`)return;let{behavior:t}=e;this.getMeasurements();let n=this.getScrollStateTarget(e);e.lastTargetOffset=n,this._clampedAdjustment=null,e.phase=qw(t,e.index!=null&&xw(n,this.getScrollOffset())),this._scrollToOffset(n,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(e==null)return null;let{horizontal:t,isRtl:n}=this.options;return typeof e.scrollTop==`number`?t?e.scrollLeft*(n&&-1||1):e.scrollTop:typeof e.scrollY==`number`?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(Aw()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{if(this._holdOffset===0||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||this.scrollState?.phase===`smooth`)return;this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let t=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(t),this._scrollToOffset(t)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=yw(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=yw(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=vw(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=yw(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes,this._getLayoutTotalSize()+this.options.scrollMargin],(e,t,n,r,i)=>{if(e.length===0||t===0)return this.range=null,null;let a=Math.max(i-t,0);return this.range=$w(e,t,Math.min(n,a),r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=yw(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,n,r,i,a)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n,lanes:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!Jw(this.scrollState))return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n;if(!this.isIndexInRange(e))return;this._resizeBatch?.sync&&this.getMeasurements();let r,i,a,o=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&o!=null)a=this.options.getItemKey(e),i=o[e*2],r=o[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;a=t.key,i=t.start,r=t.size}let s=this.itemSizeCache.get(a)??r,c=t-s;if(c!==0){let o=this.options.anchorTo===`end`&&!Jw(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,l=o?this._getLayoutTotalSize():0,u=this.getScrollOffset(),d=this.itemSizeCache.has(a)?i+s<=u&&this.scrollDirection!==`backward`:i<u,f=!Jw(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?d:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:a,start:i,size:r,end:i+r,lane:0},c,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(a,t),this.itemSizeCacheVersion++;let p=!1;if(this._awaitingCommandReadBack()||(o?p=this.applyScrollAdjustment(this._getLayoutTotalSize()-l):f&&(p=this.applyScrollAdjustment(c))),this._resizeBatch){this._resizeBatch.notify=!0,(n=this._resizeBatch).sync||(n.sync=p);return}this.notify(p),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=yw(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,n)=>{let r=[];for(let i=0,a=e.length;i<a;i++){let a=t[e[i]];r.push(n===0?a:{...a,start:a.start-n,end:a.end-n})}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return bw(t[Zw(0,t.length-1,r?e=>n[e*2]:e=>bw(t[e]).start,e)])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(e===null)return;let t=this.pendingWrite,n=Math.max(e,0)+this._holdOffset;if(n>=t.target)return;let r=t.lowMaxes??=[];r[r.length-1]!==n&&r.push(n)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{let t=e+this._holdOffset;return this.pendingScrollAnchor?.kind===`anchor`&&(t+=this.pendingScrollAnchor.delta),t},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(e===null)return null;if(`scrollHeight`in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(`document`in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,n=this.targetWindow;if(t===null||n===null)return;let r=`document`in t?t.document.scrollingElement:t;if(!r?.style)return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:i}=r,a=this.options.horizontal?`overflow-x`:`overflow-y`,o=i.getPropertyValue(a),s=i.getPropertyPriority(a),c=()=>this.options.horizontal?r.clientHeight:r.clientWidth,l=c();if(i.setProperty(a,`hidden`,`important`),c()!==l){i.setProperty(a,o,s);return}let u={restore:()=>i.getPropertyValue(a)!==`hidden`||i.getPropertyPriority(a)!==`important`?!1:(i.setProperty(a,o,s),!0),done:e};this._momentumStop=u,n.requestAnimationFrame(()=>n.requestAnimationFrame(()=>{this._momentumStop===u&&(this._momentumStop=null,u.restore()&&u.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(t===null)return null;let n=t+this._holdOffset;return e>n+.5?{target:e,maxAtWrite:n}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()+this.options.scrollMargin-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.getMeasurements()[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1){let e=this.getMaxScrollOffset(),n=e-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(n,e),0),t]}let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),n,`absolute`)},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r;this._startScroll({index:e,align:a},i,n,`absolute`)},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,`start`);this._startScroll({index:null,align:`start`},n,t,`relative`)},this.scrollToEnd=({behavior:e=`auto`}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:`end`,toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,`absolute`):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n}={})=>{let r={target:e+(t??0),smooth:n===`smooth`};return this.pendingWrite=r,this.options.scrollToFn(e-this._holdOffset,{behavior:n,adjustments:t},this),r},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(Aw()&&this._iosGesture.dragging())&&e!==null&&!xw(e,this.getScrollOffset())},this._followOffsetTarget=e=>{this.scrollState!==null&&this.scrollState.index==null&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(e===0)return!1;if(this._followOffsetTarget(e),this._canWriteScroll()){let n=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(n+e);let r=this._scrollToOffset(n,{adjustments:e,behavior:t});return this.scrollOffset!==null&&(this.pendingWrite===r&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}return this._holdOffset+=e,this.scrollOffset!==null&&(this.scrollOffset+=e),!0}scheduleScrollReconcile(){this.targetWindow?this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}):this.scrollState=null}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:e.index==null?void 0:this.getOffsetForIndex(e.index,e.align);return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if(this.scrollState.phase===`queued`){this.scheduleScrollReconcile();return}this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,n=e!==this.scrollState.lastTargetOffset;if(!n&&xw(e,this.getScrollOffset())){if(this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothLanded`:this.scrollState.phase===`smoothFinishing`&&(this.scrollState.phase=`instant`),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let t=this.getSize()||600,n=Math.abs(e-this.getScrollOffset()),r=Jw(this.scrollState)&&n>t;this.scrollState.lastTargetOffset=e,r?this.scrollState.phase=`smooth`:this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothFinishing`:this.scrollState.phase===`smoothLanded`&&(this.scrollState.phase=`instant`),this._scrollToOffset(e,{behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){this.pendingScrollAnchor=null,this._clampedAdjustment=null;let i=this._iosGesture.tail();if(r===`absolute`&&i!==null){if(i===`fling`&&Nw()){this._stopMomentum(()=>{this.scrollState?.phase!==`queued`||this._iosGesture.tail()!==`fling`||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:`queued`,behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:qw(n,e.index!=null&&xw(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}},Zw=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Qw(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function $w(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=Qw(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=Zw(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var eT=typeof document<`u`?p.useLayoutEffect:p.useEffect;function tT({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=p.useReducer(e=>e+1,0)[1],a=p.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=p.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=(e,t,n)=>{let r=a.current,i=!!e.options.horizontal,o=t.start-e.options.scrollMargin;r.lastPositions.get(n)!==o&&(r.lastPositions.set(n,o),r.mode===`transform`?n.style.transform=i?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:n.style[i?`left`:`top`]=`${o}px`)},l=e=>{let t=a.current;if(t.enabled&&t.container){s(e);for(let t of e.getVirtualItems()){let n=e.elementsCache.get(t.key);n&&c(e,t,n)}}},u={...r,onChange:(t,n)=>{var s;let c=a.current,u=!0;if(c.enabled){l(t);let e=t.range,n=c.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,Za.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[d]=p.useState(()=>{let e=new Xw(u),t=e.measureElement;return e.measureElement=n=>{o.current=!0;try{t(n)}finally{o.current=!1}let r=a.current;if(n!==null&&r.enabled&&r.container){let t=e.measurementsCache[e.indexFromElement(n)];t&&c(e,t,n)}},Object.assign(e,{containerRef:t=>{let n=a.current;n.container=t,n.lastSize=null,t!==null&&l(e)}})});return d.setOptions(u),eT(()=>d._didMount(),[]),eT(()=>(s(d),d._willUpdate())),eT(()=>{l(d)}),d}function nT(e){return tT({observeElementRect:Bw,observeElementOffset:Ww,scrollToFn:Kw,...e})}var rT=48,iT=60,aT=24;function oT({glyph:e,label:t,placeholder:n,value:r,onChange:i,options:a,loading:o,failed:s,search:c,onSearchChange:l,hasMore:u,loadingMore:d,onLoadMore:f,allowCustom:h=!0,title:g}){let[_,v]=(0,p.useState)(!1),[y,b]=(0,p.useState)(``),x=l!==void 0,S=x?c??``:y,C=x?l:b,w=(0,p.useMemo)(()=>{let e=S.trim().toLowerCase(),t=e&&!x?a.filter(t=>t.value.toLowerCase().includes(e)):a;return[...r.filter(e=>!t.some(t=>t.value===e)).filter(t=>!e||t.toLowerCase().includes(e)).map(e=>({value:e,count:0})),...t]},[a,S,x,r]),T=(0,p.useRef)(null),E=()=>{let e=T.current;e&&u&&!d&&f&&e.scrollTop+e.clientHeight>=e.scrollHeight-rT&&f()},D=e=>{i(r.includes(e)?r.filter(t=>t!==e):[...r,e])},O=w.length>iT,k=nT({count:w.length,getScrollElement:()=>T.current,estimateSize:()=>aT,overscan:8,enabled:O}),A=e=>{let t=r.includes(e.value);return(0,m.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>D(e.value),className:J(`mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs hover:bg-hover`,t?`text-fg`:`text-fg-2`),children:[(0,m.jsx)(`span`,{className:`w-3 shrink-0`,children:t&&(0,m.jsx)(TC,{width:12,height:12})}),(0,m.jsx)(`span`,{className:`truncate`,children:e.value}),(0,m.jsx)(`span`,{className:`ml-auto shrink-0 text-[10px] text-faint`,children:e.count})]},e.value)},j=S.trim(),M=h&&j!==``&&!w.some(e=>e.value===j)&&!r.includes(j);return(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-line px-2 py-1 transition-colors focus-within:border-line-strong`,children:[e!==void 0&&(0,m.jsx)(`span`,{className:`shrink-0 text-faint`,"aria-hidden":!0,children:e}),(0,m.jsxs)(mw,{open:_,onOpenChange:v,children:[(0,m.jsx)(hw,{render:(0,m.jsx)(`button`,{type:`button`,"aria-label":t,title:g??t,className:`mono flex min-w-0 flex-1 flex-wrap items-center gap-1 py-0.5 text-left text-xs text-fg focus:outline-none`}),children:r.length===0?(0,m.jsx)(`span`,{className:`text-faint`,children:n}):r.map(e=>(0,m.jsx)(nC,{variant:`neutral`,className:`mono max-w-[10rem] truncate`,children:e},e))}),(0,m.jsxs)(gw,{align:`start`,className:`w-72 gap-0 overflow-hidden p-0`,children:[(0,m.jsx)(`div`,{className:`border-b border-line px-2`,children:(0,m.jsx)(IC,{autoFocus:!0,value:S,onChange:e=>C(e.target.value),placeholder:h?`search, or type a value…`:`search…`,onKeyDown:e=>{e.key===`Enter`&&M&&(e.preventDefault(),D(j),C(``))}})}),(0,m.jsxs)(`div`,{ref:T,onScroll:E,className:`max-h-64 overflow-auto py-1`,role:`listbox`,tabIndex:-1,"aria-multiselectable":!0,"aria-label":t,children:[M&&(0,m.jsxs)(`button`,{type:`button`,"aria-label":`use ${j} as typed`,onClick:()=>{D(j),C(``)},className:`mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs text-fg-2 hover:bg-hover`,children:[(0,m.jsx)(`span`,{className:`w-3 shrink-0 text-faint`,children:`+`}),(0,m.jsx)(`span`,{className:`truncate`,children:j}),(0,m.jsx)(`span`,{className:`ml-auto text-[10px] text-faint`,children:`use as typed`})]}),d&&w.length>0&&(0,m.jsx)(`p`,{className:`px-2 py-1 text-[10px] text-faint`,children:`loading more…`}),w.length===0&&!M&&(0,m.jsx)(`p`,{className:J(`px-2 py-2 text-[11px]`,s?`text-bad`:`text-faint`),children:s?`couldn't load values — type one instead`:o?`loading…`:`no values here`}),O?(0,m.jsx)(`div`,{className:`relative w-full`,style:{height:`${k.getTotalSize()}px`},children:k.getVirtualItems().map(e=>(0,m.jsx)(`div`,{ref:k.measureElement,"data-index":e.index,className:`absolute top-0 left-0 w-full`,style:{transform:`translateY(${e.start}px)`},children:A(w[e.index])},w[e.index]?.value??e.key))}):w.map(A)]})]})]}),r.length>0&&(0,m.jsx)(Wi,{variant:`ghost`,size:`icon-sm`,onClick:()=>i([]),title:`clear ${t}`,"aria-label":`clear ${t}`,className:`h-4 w-4`,children:(0,m.jsx)(EC,{width:12,height:12})})]})}var sT=50,cT=200;function lT(e,t){let[n,r]=(0,p.useState)(e);return(0,p.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function uT(e){return e.filter(e=>e.value!==null).map(e=>({value:e.value,count:e.count}))}function dT({field:e,scope:t,value:n,onChange:r,glyph:i,label:a,placeholder:o,title:s,single:c}){let[l,u]=(0,p.useState)(``),d=lT(l,cT),f=et({queryKey:[`run-values`,e,t,d],queryFn:({pageParam:n})=>XS.values(e,t,{limit:sT,offset:n,search:d}),initialPageParam:0,getNextPageParam:(e,t)=>e.length<sT?void 0:t.reduce((e,t)=>e+t.length,0),staleTime:1e4,refetchInterval:1e4}),h=(0,p.useMemo)(()=>uT(f.data?.pages.flat()??[]),[f.data]);return(0,m.jsx)(oT,{label:a,placeholder:o,...s!==void 0&&{title:s},...i!==void 0&&{glyph:i},value:n,onChange:e=>r(c?e.slice(-1):e),options:h,search:l,onSearchChange:u,loading:f.isLoading,failed:f.isError,hasMore:f.hasNextPage,loadingMore:f.isFetchingNextPage,onLoadMore:()=>void f.fetchNextPage()})}var fT=[{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 pT(e){let[t,n,...r]=e.split(`:`);return!t||!n||r.length===0?null:{key:t,op:n,operand:r.join(`:`)}}function mT(e){let t=pT(e);if(!t)return e;let n=fT.find(e=>e.op===t.op)?.label??t.op;return`${t.key} ${n} ${t.operand.split(`|`).join(`, `)}`}function hT({value:e,onChange:t,scope:n}){let[r,i]=(0,p.useState)(!1),[a,o]=(0,p.useState)(``),[s,c]=(0,p.useState)(`eq`),[l,u]=(0,p.useState)([]),[d,f]=(0,p.useState)(``),h=s===`eq`||s===`in`,g=h?l.join(`|`):d.trim(),_=a!==``&&g!==``,v=()=>{o(``),c(`eq`),u([]),f(``)},y=()=>{if(!_)return;let n=s===`in`&&l.length===1?`eq`:s;t([...e,`${a}:${n}:${g}`]),v(),i(!1)};return(0,m.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 rounded-md border border-line px-2 py-1 transition-colors focus-within:border-line-strong`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-faint`,"aria-hidden":!0,children:`⛃`}),(0,m.jsxs)(mw,{open:r,onOpenChange:e=>{i(e),e||v()},children:[(0,m.jsx)(hw,{render:(0,m.jsx)(`button`,{type:`button`,"aria-label":`filter by search attribute`,title:`Typed search attributes (WorkflowRun.searchAttributes)`,className:`mono flex min-w-0 flex-1 flex-wrap items-center gap-1 py-0.5 text-left text-xs text-fg focus:outline-none`}),children:e.length===0?(0,m.jsx)(`span`,{className:`text-faint`,children:`filter by attribute…`}):e.map(e=>(0,m.jsx)(nC,{variant:`violet`,className:`mono max-w-[12rem] truncate`,children:mT(e)},e))}),(0,m.jsx)(gw,{align:`start`,className:`w-80 gap-0 p-2`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e.length>0&&(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1 border-b border-line pb-1.5`,children:e.map(n=>(0,m.jsxs)(nC,{variant:`violet`,className:`mono gap-1 py-0.5`,children:[mT(n),(0,m.jsx)(Wi,{variant:`ghost`,size:`icon-sm`,className:`h-3 w-3 text-violet/70 hover:text-violet`,title:`remove ${mT(n)}`,"aria-label":`remove ${mT(n)}`,onClick:()=>t(e.filter(e=>e!==n)),children:(0,m.jsx)(EC,{width:10,height:10})})]},n))}),(0,m.jsx)(dT,{field:`attr`,scope:n,glyph:`⛃`,label:`attribute key`,placeholder:`key…`,single:!0,value:a?[a]:[],onChange:e=>{o(e.at(-1)??``),u([])}}),(0,m.jsx)(`select`,{"aria-label":`operator`,value:s,onChange:e=>c(e.target.value),className:`mono rounded-md border border-line bg-transparent px-2 py-1.5 text-xs text-fg focus:border-line-strong focus:outline-none`,children:fT.map(e=>(0,m.jsx)(`option`,{value:e.op,className:`bg-hover`,children:e.label},e.op))}),h?(0,m.jsx)(dT,{field:`attr.${a}`,scope:n,glyph:`=`,label:`attribute value`,placeholder:a?`value…`:`pick a key first`,...s!==`in`&&{single:!0},value:l,onChange:u}):(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-line px-2 focus-within:border-line-strong`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-faint`,"aria-hidden":!0,children:`=`}),(0,m.jsx)(IC,{value:d,onChange:e=>f(e.target.value),placeholder:`value…`,"aria-label":`attribute value`,onKeyDown:e=>{e.key===`Enter`&&y()}})]}),(0,m.jsx)(Wi,{variant:`brand`,size:`chip`,className:`mono self-end rounded`,disabled:!_,onClick:y,children:`add filter`})]})})]}),e.length>0&&(0,m.jsx)(Wi,{variant:`ghost`,size:`icon-sm`,onClick:()=>t([]),title:`clear attribute filters`,"aria-label":`clear attribute filters`,className:`h-4 w-4`,children:(0,m.jsx)(EC,{width:12,height:12})})]})}function gT({runs:e,value:t,onChange:n}){if(!sS(e)&&t.kind===`all`)return null;let r=oS(e);return(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 border-b border-line px-2 py-1.5`,children:[(0,m.jsx)(`span`,{className:`mono shrink-0 text-[10px] uppercase tracking-[0.18em] text-faint`,children:`origin`}),r.map(e=>{let r=tS(t,e.filter);return(0,m.jsxs)(Wi,{variant:`ghost`,size:`chip`,"aria-pressed":r,title:e.title,onClick:()=>n(e.filter),className:J(`mono max-w-full gap-1 rounded-md`,e.filter.kind===`unknown`&&`italic text-dim`,r&&`border-line-strong bg-hover text-fg hover:text-fg`),children:[(0,m.jsx)(`span`,{className:`truncate`,children:e.label}),(0,m.jsx)(`span`,{className:`tnum shrink-0 text-faint`,children:e.count})]},nS(e.filter))})]})}function _T(e){if(e.name.startsWith(`spawn:`))return e.name.slice(6);if(e.name.startsWith(`signal:child:`))return e.name.slice(13)}function vT(e,t=50){let n=new Set;for(let r of e){if(n.size>=t)break;let e=_T(r);e!==void 0&&n.add(e)}return[...n]}function yT(e,t){let n=`${t}.`;return`child ${e.startsWith(n)?e.slice(n.length):e}`}function bT(e,t,n=12){let r=e.slice(0,n);return{shown:r,more:Math.max(0,(t??e.length)-r.length)}}function xT(e){return{...e.triggeredBy?{startedBy:{...e.triggeredBy}}:{},triggered:[...e.triggered??[]]}}var ST=new Set([`completed`,`failed`,`cancelled`,`dead`]);function CT(e){return ST.has(e.run.status)?[...e.lifecycleSubscribers??[]]:[]}function wT(e){let t=`${e.started} subscriber run${e.started===1?``:`s`} started`;return e.failed.length===0?`${t}.`:`${t}, ${e.failed.length} failed: ${e.failed.map(e=>`${e.subscriber} (${e.error})`).join(`; `)}.`}function TT(e){let t={};for(let n of e)n.data&&(t[n.data.run.id]=n.data);return t}var ET=`fan:`;function DT(e){if(!e.name.startsWith(ET))return;let t=e.output?.values;return Array.isArray(t)?t.length:void 0}function OT(e){let t=DT(e);return t===void 0?e.name:`${t} child run${t===1?``:`s`}`}function kT(e){if(e.length===0)return``;let t=e[0]??``;for(let n of e.slice(1)){let e=0;for(;e<t.length&&e<n.length&&t[e]===n[e];)e+=1;t=t.slice(0,e)}return t.replace(/[\s._:-]+$/,``)}function AT(e){if(e.some(e=>DT(e)!==void 0))return`child runs ×${e.reduce((e,t)=>e+(DT(t)??1),0)}`;let t=kT(e.map(e=>e.name));return`${t.length>=2?t:`parallel`} ×${e.length}`}function jT(e){return e.kind===`single`?e.step.seq:e.kind===`fan`?e.steps[0]?.seq??1/0:e.fan.firstSeq}function MT(e,t=[]){let n=NT(e);if(t.length===0)return n;let r=[...t].sort((e,t)=>e.firstSeq-t.firstSeq),i=[],a=0;for(let e of n){let t=jT(e);for(;a<r.length&&r[a].firstSeq<t;)i.push({kind:`summary`,fan:r[a]}),a+=1;i.push(e)}for(;a<r.length;a+=1)i.push({kind:`summary`,fan:r[a]});return i}function NT(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===void 0){n+=1;continue}let i=r.parallelGroup;if(i===void 0||i===``){t.push({kind:`single`,step:r}),n+=1;continue}let a=[],o=n;for(;o<e.length&&e[o]?.parallelGroup===i;){let t=e[o];t!==void 0&&a.push(t),o+=1}a.length<=1?t.push({kind:`single`,step:a[0]??r}):t.push({kind:`fan`,group:i,steps:a,label:AT(a)}),n=o}return t}function PT(e,t=!1){let n=e.counts.running??0,r=e.counts.pending??0,i=e.notStarted??0;return{completed:e.counts.completed??0,failed:e.counts.failed??0,running:t?0:n,pending:t?0:r,interrupted:t?n+r:0,notStarted:t?0:i,skipped:t?i:0,started:e.size,total:e.total??e.size}}function FT(e,t=!1){let n=PT(e,t);return n.running>0?`running`:n.pending>0||n.notStarted>0?`pending`:n.failed>0||n.interrupted>0?`failed`:`completed`}function IT(e){return e.started<e.total?`${e.started} of ${e.total}`:`×${e.total}`}var LT=new Set([`completed`,`failed`,`cancelled`,`dead`]);function RT(e){return LT.has(e)}var zT=2e3,BT=3e4;function VT(e){let t=e.state.data?.run?.status;return t!==void 0&&RT(t)?BT:zT}function HT(e,t,n=100){if(e===void 0||t===void 0)return[0];let r=[];for(let i=Math.floor(e/n);i<=Math.floor(t/n);i+=1)r.push(i);return r}var UT=[{key:`completed`,className:`bg-good/60`,text:`text-good`,label:`done`},{key:`failed`,className:`bg-bad/70`,text:`text-bad`,label:`failed`},{key:`running`,className:`bg-live/70`,text:`text-live`,label:`running`},{key:`pending`,className:`bg-dim/60`,text:`text-fg-2`,label:`pending`},{key:`interrupted`,className:`bg-warn/60`,text:`text-warn`,label:`interrupted`},{key:`notStarted`,className:`bg-line-strong/70`,text:`text-fg-2`,label:`not started`},{key:`skipped`,className:`bg-line-strong/40`,text:`text-dim`,label:`never ran`}],WT=9e4;function GT(e,t,n){let r=(t?.liveWorkers??[]).filter(e=>n-e.lastBeatAt<=WT).sort((e,t)=>t.lastBeatAt-e.lastBeatAt)[0];if(r)return{kind:`working`,instanceId:r.instanceId,beatAgoS:Math.max(0,Math.round((n-r.lastBeatAt)/1e3)),inFlight:r.status?.inFlight};let i=e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime();return{kind:`lost`,minutes:Math.round((n-i)/6e4)}}var KT=[];function qT(e){return Xe({queries:(0,p.useMemo)(()=>vT(e),[e]).map(e=>({queryKey:[`run`,e],queryFn:()=>XS.run(e),refetchInterval:VT})),combine:TT})}function JT(e,t,n){if(t){let e=new Date(t.run.createdAt).getTime(),r=TS(t.run.status)?n:new Date(t.run.updatedAt).getTime();return[e,Math.max(r,e)]}let{subs:r}=Xx(e.events??[]),i=1/0,a=-1/0;for(let e of r){e.startedAt!==void 0&&(i=Math.min(i,e.startedAt));let t=e.terminal?.at??e.startedAt;t!==void 0&&(a=Math.max(a,t))}return i!==1/0&&a!==-1/0?[i,a]:[new Date(e.startedAt).getTime(),new Date(e.finishedAt).getTime()]}function YT(e,t,n){let r=TS(e.status),i=Date.now(),a=new Date(e.createdAt).getTime(),o=-1/0;for(let[e,n]of t)a=Math.min(a,e),o=Math.max(o,n);for(let e of n)e.startedAt&&(a=Math.min(a,new Date(e.startedAt).getTime())),e.finishedAt&&(o=Math.max(o,new Date(e.finishedAt).getTime()));return o=Math.max(o,r?i:a+1),{t0:a,span:Math.max(o-a,1),liveNow:i}}function XT(e,t,n,r=JT(e,t,n.liveNow)){let{t0:i,span:a}=n,[o,s]=r,{subs:c}=Xx(e.events??[]),l=c.map(e=>{let t=e.startedAt??o,n=e.terminal?.at??t;return{key:e.id,name:e.name,status:e.status??`ok`,left:(t-i)/a*100,width:Math.max((n-t)/a*100,.8),ms:e.durationMs??Math.max(n-t,0)}});return{step:e,childId:_T(e),childRun:t,left:(o-i)/a*100,width:Math.max((s-o)/a*100,.8),ms:s-o,subRows:l}}function ZT(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}var QT={ok:`bg-good/40 ring-1 ring-good/50`,failed:`bg-bad/40 ring-1 ring-bad/50`,skipped:`bg-warn/35 ring-1 ring-warn/45`},$T={ok:`bg-good`,failed:`bg-bad`,skipped:`bg-warn`};function eE({row:e,run:t,childRuns:n,depth:r,selectedKey:i,onSelect:a,onOpenRun:o,onToggleChild:s,expanded:c,collapsedSubs:l,toggleSubs:u}){let{step:d,left:f,width:p,ms:h,subRows:g}=e,_=d.status===`failed`,v=_T(d),y=!!v,b=y?MC:PC(d.kind),x=i===`${d.runId}#${d.seq}`,S=y&&v!==void 0&&c.has(v),C=g.length>0&&!y,w=l.has(d.seq),T=wS(d,Date.now()),{data:E}=Qe({queryKey:[`workers`],queryFn:()=>XS.workers(),refetchInterval:1e4,enabled:T}),D=T?GT(d,E?.find(e=>e.group===d.workerGroup),Date.now()):void 0;return(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>a(d,t),title:y?`Child workflow — click for its detail (↗ opens its run)`:void 0,className:`group grid w-full grid-cols-[150px_1fr] items-center gap-3 rounded-md px-2 py-1 text-left transition-colors ${x?`bg-hover/60`:`hover:bg-hover/60`}`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate`,children:[y&&v!==void 0&&(0,m.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s(v)},className:`shrink-0 text-violet hover:text-violet transition-colors`,title:S?`Collapse child run`:`Expand child run inline`,children:(0,m.jsx)(`span`,{className:`inline-block transition-transform`,style:{transform:S?`rotate(90deg)`:`rotate(0deg)`},children:`▸`})}),C&&(0,m.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u(d.seq)},className:`shrink-0 text-dim transition-colors hover:text-fg-2`,title:w?`Show ${g.length} sub-process(es)`:`Hide sub-processes`,children:(0,m.jsx)(`span`,{className:`inline-block transition-transform`,style:{transform:w?`rotate(0deg)`:`rotate(90deg)`},children:`▸`})}),(0,m.jsx)(`span`,{className:_?`text-bad`:y?`text-violet`:`text-good`,children:(0,m.jsx)(b,{width:12,height:12})}),(0,m.jsx)(`span`,{className:`truncate text-[12px] text-fg-2`,children:v===void 0?OT(d):n[v]?.run.workflow??yT(v,t.id)}),y&&v!==void 0&&(0,m.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o(v)},title:`Open the child run`,className:`shrink-0 text-violet transition-colors hover:text-violet`,children:`↗`})]}),(0,m.jsxs)(`span`,{className:`relative h-5`,children:[(0,m.jsx)(`span`,{className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft`}),(0,m.jsx)(`span`,{className:`absolute top-1/2 flex h-3.5 -translate-y-1/2 items-center rounded-[3px] transition-all duration-500 ease-out ${_?`bg-bad/35 ring-1 ring-bad/50`:x?`bg-good/45 ring-1 ring-good/60`:`bg-good/30 ring-1 ring-good/40`}`,style:{left:`${f}%`,width:`${p}%`}}),(0,m.jsx)(`span`,{className:`mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[10px] text-dim`,style:{left:`min(${f+p}%, calc(100% - 44px))`},children:ZT(h)})]})]}),D?.kind===`working`&&(0,m.jsxs)(`div`,{className:`mono ml-[18px] mb-1 flex items-center gap-1 text-[10px] text-good/80`,title:`A live worker holds this dispatch — its heartbeat is fresh. Long steps are expected to sit here; only re-dispatch if the heartbeat goes stale.`,children:[(0,m.jsx)(`span`,{"aria-hidden":!0,children:`⚙`}),`being worked by `,D.instanceId,` — heartbeat `,D.beatAgoS,`s ago`,D.inFlight===void 0?``:` · ${D.inFlight} in flight`]}),D?.kind===`lost`&&(0,m.jsxs)(`div`,{className:`mono ml-[18px] mb-1 flex items-center gap-1 text-[10px] s-stale`,title:"No live worker heartbeat on this step's group — reconcile-wake can't recover a stuck `pending` step; re-dispatch it from the run actions above",children:[(0,m.jsx)(`span`,{"aria-hidden":!0,children:`⚠`}),`awaiting worker result — dispatched `,D.minutes,`m ago, no live worker (possibly lost)`]}),g.length>0&&!w&&(0,m.jsx)(`div`,{className:`ml-[18px] mt-0.5 mb-1 space-y-0.5 border-l border-line-soft pl-2`,children:g.map(e=>(0,m.jsxs)(`div`,{className:`grid grid-cols-[130px_1fr] items-center gap-3 px-2`,title:`${e.name} — ${e.status}`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate`,children:[(0,m.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${$T[e.status]}`}),(0,m.jsx)(`span`,{className:`truncate text-[10px] text-fg-2`,children:e.name})]}),(0,m.jsxs)(`span`,{className:`relative h-3`,children:[(0,m.jsx)(`span`,{className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft`}),(0,m.jsx)(`span`,{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-[2px] transition-all duration-500 ease-out ${QT[e.status]}`,style:{left:`${e.left}%`,width:`${e.width}%`}}),(0,m.jsx)(`span`,{className:`mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[9px] text-faint`,style:{left:`min(${e.left+e.width}%, calc(100% - 38px))`},children:ZT(e.ms)})]})]},e.key))}),y&&v!==void 0&&S&&(0,m.jsx)(`div`,{className:`ml-[18px] mt-0.5 mb-1 border-l border-line-soft pl-2`,children:(0,m.jsx)(sE,{id:v,depth:r+1,selectedKey:i,onSelect:a,onOpenRun:o,expanded:c,onToggleChild:s})})]})}function tE({label:e,fanFailed:t,memberRows:n,rowProps:r}){return(0,m.jsxs)(`div`,{className:`rounded-md bg-hover/30 ring-1 ring-line-soft`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1`,children:[(0,m.jsx)(`span`,{className:`text-[11px] text-violet/80`,title:`parallel fan-out (ctx.gather / ctx.all)`,children:`⑃`}),(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.15em] text-dim`,children:`parallel`}),(0,m.jsx)(`span`,{className:`text-[11px] ${t?`text-bad`:`text-fg-2`}`,children:e})]}),(0,m.jsx)(`div`,{className:`ml-[10px] border-l border-line-soft pl-1`,children:n.map(e=>(0,m.jsx)(eE,{row:e,...r},e.step.seq))})]})}var nE=28;function rE({fan:e,frame:t,rowProps:n}){let[r,i]=(0,p.useState)(!1),[a,o]=(0,p.useState)(!1),s=RT(n.run.status),c=PT(e,s),l=FT(e,s),u=l===`running`||l===`pending`,d=TS(n.run.status),f=e.startedAt?new Date(e.startedAt).getTime():void 0,h=e.finishedAt?new Date(e.finishedAt).getTime():u&&d?t.liveNow:f,g=(0,p.useMemo)(()=>e.failures.map(e=>XT(e,void 0,t)),[e.failures,t]);return(0,m.jsxs)(`div`,{className:`rounded-md bg-hover/30 ring-1 ring-line-soft`,children:[(0,m.jsxs)(`div`,{className:`grid grid-cols-[150px_1fr] items-center gap-3 px-2 py-1`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate`,children:[(0,m.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`shrink-0 text-dim transition-colors hover:text-fg-2`,title:r?`Hide the members`:`List the ${e.size} members started`,children:(0,m.jsx)(`span`,{className:`inline-block transition-transform`,style:{transform:r?`rotate(90deg)`:`rotate(0deg)`},children:`▸`})}),(0,m.jsx)(`span`,{className:`text-[11px] text-violet/80`,title:`parallel fan-out, summarized`,children:`⑃`}),(0,m.jsxs)(`span`,{className:`truncate text-[12px] ${l===`failed`?`text-bad`:`text-fg-2`}`,title:e.group,children:[e.label,` ×`,c.total]})]}),(0,m.jsxs)(`span`,{className:`relative h-5`,children:[(0,m.jsx)(`span`,{className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft`}),f!==void 0&&h!==void 0&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`absolute top-1/2 h-3.5 -translate-y-1/2 rounded-[3px] ${l===`failed`?`bg-bad/25 ring-1 ring-bad/40`:`bg-violet/20 ring-1 ring-violet/40`} ${u?`pulse`:``}`,style:{left:`${(f-t.t0)/t.span*100}%`,width:`${Math.max((h-f)/t.span*100,.8)}%`}}),(0,m.jsx)(`span`,{className:`mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[10px] text-dim`,style:{left:`min(${(h-t.t0)/t.span*100}%, calc(100% - 44px))`},children:ZT(h-f)})]})]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-3 px-2 pb-1.5 pl-[26px]`,children:[(0,m.jsx)(`span`,{className:`flex h-1.5 w-40 shrink-0 overflow-hidden rounded-full bg-hover`,children:UT.map(e=>c[e.key]>0?(0,m.jsx)(`span`,{className:e.className,style:{width:`${c[e.key]/Math.max(c.total,1)*100}%`}},e.key):null)}),(0,m.jsxs)(`span`,{className:`mono tnum flex flex-wrap gap-2 text-[10px]`,children:[c.started<c.total&&(0,m.jsxs)(`span`,{className:`text-fg-2`,children:[IT(c),` started`]}),UT.map(t=>c[t.key]>0?(0,m.jsxs)(`span`,{className:t.text,children:[c[t.key],` `,t.label,t.key===`skipped`&&e.failFast?` (failFast)`:``]},t.key):null)]})]}),g.length>0&&!r&&(0,m.jsxs)(`div`,{className:`ml-[10px] border-l border-bad/30 pl-1`,children:[(0,m.jsx)(`div`,{className:`mono px-2 text-[10px] text-bad/70`,children:c.failed>g.length?`first ${g.length} of ${c.failed} failed`:`${g.length} failed`}),g.map(e=>(0,m.jsx)(eE,{row:e,...n},e.step.seq))]}),r&&(0,m.jsxs)(`div`,{className:`ml-[10px] border-l border-line-soft pl-1`,children:[(0,m.jsx)(`div`,{className:`flex items-center gap-2 px-2 py-0.5`,children:(0,m.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`mono rounded border px-1.5 text-[10px] transition-colors ${a?`border-bad/40 bg-bad/15 text-bad`:`border-line text-dim hover:text-fg-2`}`,children:`failed only`})}),(0,m.jsx)(iE,{group:e.group,failedOnly:a,live:u&&d,frame:t,rowProps:n},a?`failed`:`all`)]})]})}function iE({group:e,failedOnly:t,live:n,frame:r,rowProps:i}){let a=i.run.id,o=(0,p.useRef)(null),[s,c]=(0,p.useState)(),l=nT({count:s??0,getScrollElement:()=>o.current,estimateSize:()=>nE,measureElement:e=>e.getBoundingClientRect().height,overscan:10}),u=l.getVirtualItems(),d=HT(u[0]?.index,u[u.length-1]?.index),f=Xe({queries:d.map(r=>({queryKey:[`fan`,a,e,t,r],queryFn:()=>XS.fanMembers(a,e,{page:r+1,size:100,failed:t}),refetchInterval:n?5e3:!1}))}),h=f.find(e=>e.data!==void 0)?.data?.meta.total;(0,p.useEffect)(()=>{h!==void 0&&c(h)},[h]);let g=e=>{let t=d.indexOf(Math.floor(e/100));return t<0?void 0:f[t]},_=e=>g(e)?.data?.data[e%100],v=f.find(e=>e.isError);return s===void 0&&v?(0,m.jsxs)(`div`,{className:`mono px-2 py-1 text-[10px] text-bad`,children:[`couldn't load members:`,` `,v.error instanceof Error?v.error.message:String(v.error)]}):s===void 0?(0,m.jsx)(`div`,{className:`mono px-2 py-1 text-[10px] text-faint`,children:`loading members…`}):s===0?(0,m.jsx)(`div`,{className:`mono px-2 py-1 text-[10px] text-faint`,children:t?`no failed members`:`no members`}):(0,m.jsx)(`div`,{ref:o,className:`max-h-[320px] overflow-auto`,children:(0,m.jsx)(`div`,{className:`relative w-full`,style:{height:l.getTotalSize()},children:u.map(e=>{let t=_(e.index);return(0,m.jsx)(`div`,{"data-index":e.index,ref:l.measureElement,className:`absolute inset-x-0 top-0`,style:{transform:`translateY(${e.start}px)`},children:t?(0,m.jsx)(eE,{row:XT(t,void 0,r),...i}):(0,m.jsx)(aE,{index:e.index,page:g(e.index)})},e.key)})})})}function aE({index:e,page:t}){return t?.isError?(0,m.jsxs)(`div`,{className:`mono flex items-center gap-2 px-2 text-[10px] leading-7 text-bad`,style:{height:nE},children:[(0,m.jsxs)(`span`,{className:`truncate`,children:[`#`,e+1,` couldn't load:`,` `,t.error instanceof Error?t.error.message:String(t.error)]}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>void t.refetch(),className:`rounded border border-bad/40 px-1.5 text-bad hover:bg-bad/15`,children:`retry`})]}):(0,m.jsxs)(`div`,{className:`mono px-2 text-[10px] leading-7 text-faint`,style:{height:nE},children:[`#`,e+1,` loading…`]})}function oE({run:e,timeline:t,fans:n=KT,depth:r,selectedKey:i,onSelect:a,onOpenRun:o,expanded:s,onToggleChild:c}){let l=qT(t),{frame:u,rows:d}=(0,p.useMemo)(()=>{let r=Date.now(),i=t.map(e=>{let t=_T(e),n=t===void 0?void 0:l[t];return{step:e,childRun:n,window:JT(e,n,r)}}),a=YT(e,i.map(e=>e.window),n);return{frame:a,rows:i.map(e=>XT(e.step,e.childRun,a,e.window))}},[e,t,n,l]),f=(0,p.useMemo)(()=>MT(t,n),[t,n]),h=(0,p.useMemo)(()=>{let e=new Map;for(let t of d)e.set(t.step.seq,t);return e},[d]),[g,_]=(0,p.useState)(new Set),v={run:e,childRuns:l,depth:r,selectedKey:i,onSelect:a,onOpenRun:o,onToggleChild:c,expanded:s,collapsedSubs:g,toggleSubs:e=>_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,m.jsx)(m.Fragment,{children:f.map(e=>{if(e.kind===`single`){let t=h.get(e.step.seq);return t?(0,m.jsx)(eE,{row:t,...v},t.step.seq):null}if(e.kind===`summary`)return(0,m.jsx)(rE,{fan:e.fan,frame:u,rowProps:v},`fan:${e.fan.group}`);let t=e.steps.map(e=>h.get(e.seq)).filter(e=>e!==void 0);return(0,m.jsx)(tE,{label:e.label,fanFailed:e.steps.some(e=>e.status===`failed`),memberRows:t,rowProps:v},`fan:${e.group}`)})})}function sE({id:e,depth:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:a,onToggleChild:o}){let{data:s}=Qe({queryKey:[`run`,e],queryFn:()=>XS.run(e),refetchInterval:VT});return t>6?null:s?(0,m.jsxs)(`div`,{className:`my-1 rounded-md border border-line bg-sunken/15`,children:[(0,m.jsxs)(`div`,{className:`mono flex items-center gap-2 px-2 py-1 text-[10px] text-dim`,children:[(0,m.jsxs)(`span`,{className:`text-violet`,children:[`⌁ `,s.run.workflow]}),(0,m.jsx)(`span`,{className:`tnum text-faint`,children:e.slice(0,8)}),(0,m.jsx)(`span`,{className:`s-${s.run.status} uppercase`,children:s.run.status}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`ml-auto rounded border border-line px-1.5 text-fg-2 hover:text-fg`,children:`open ↗`})]}),(0,m.jsx)(oE,{run:s.run,timeline:s.timeline,fans:s.fans,depth:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:a,onToggleChild:o})]}):(0,m.jsx)(`div`,{className:`mono px-2 py-1 text-[10px] text-faint`,children:`loading child run…`})}function cE({run:e,timeline:t,fans:n,selectedKey:r,onSelect:i,onOpenRun:a,expanded:o,onToggleChild:s}){let c=(0,p.useMemo)(()=>YT(e,t.map(e=>[new Date(e.startedAt).getTime(),new Date(e.finishedAt).getTime()]),n??KT).span,[e,t,n]),l=o??new Set,u=s??(()=>{});return(0,m.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-2 pt-3`,children:[(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.2em] text-dim`,children:`spans`}),(0,m.jsxs)(`span`,{className:`mono tnum text-[10px] text-faint`,children:[`total `,ZT(c)]})]}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3`,children:(0,m.jsx)(oE,{run:e,timeline:t,fans:n,depth:0,selectedKey:r,onSelect:i,onOpenRun:a,expanded:l,onToggleChild:u})})]})}function lE(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function uE(e,t){return lE(new Date(t).getTime()-new Date(e).getTime())}function dE(e){return fE(new Date(e).getTime())}function fE(e){return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3})}var pE={ok:`border-good/25 bg-good/10 text-good`,failed:`border-bad/25 bg-bad/10 text-bad`,skipped:`border-warn/25 bg-warn/10 text-warn`},mE={debug:`text-dim`,info:`text-fg-2`,warn:`text-warn`,error:`text-bad`},hE=[`ok`,`failed`,`skipped`];function gE({e}){return(0,m.jsxs)(`div`,{className:`flex gap-2 py-0.5`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-faint tnum`,children:fE(e.at)}),(0,m.jsx)(`span`,{className:`shrink-0 uppercase ${mE[e.level]}`,children:e.level}),(0,m.jsx)(`span`,{className:`min-w-0 break-words text-fg-2`,children:e.message})]})}function _E({sub:e,showGroup:t=!0}){let n=e.terminal?.message!==void 0&&e.terminal.message!==e.name,r=e.phases.length>0||e.logs.length>0||n,[i,a]=(0,p.useState)(e.status===`failed`),o=e.status?pE[e.status]:`border-warn/25 bg-warn/10 text-warn`;return(0,m.jsxs)(`li`,{className:`rounded-md border ${o}`,children:[(0,m.jsxs)(`button`,{type:`button`,disabled:!r,onClick:()=>a(e=>!e),className:`flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left text-[11.5px] disabled:cursor-default`,"aria-expanded":r?i:void 0,children:[(0,m.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[r&&(0,m.jsx)(`span`,{className:`text-[9px] text-dim transition-transform duration-150 ${i?``:`-rotate-90`}`,children:`▼`}),(0,m.jsx)(`span`,{className:`mono truncate text-fg`,children:e.name}),t&&e.group&&(0,m.jsx)(`span`,{className:`mono shrink-0 text-[10px] uppercase tracking-wider text-dim`,children:e.group})]}),(0,m.jsxs)(`span`,{className:`mono flex shrink-0 items-center gap-2 text-[10px] uppercase tracking-wider`,children:[e.durationMs!==void 0&&(0,m.jsx)(`span`,{className:`tnum text-fg-2`,children:lE(e.durationMs)}),(0,m.jsx)(`span`,{children:e.status??`running`})]})]}),i&&(0,m.jsxs)(`div`,{className:`border-t border-line/60 px-2.5 py-2`,children:[e.phases.length>0&&(0,m.jsx)(`ul`,{className:`mono mb-2 flex flex-col gap-0.5 text-[10.5px]`,children:e.phases.map((t,n)=>(0,m.jsxs)(`li`,{className:`flex gap-2`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-faint tnum`,children:fE(t.at)}),(0,m.jsx)(`span`,{className:`text-fg-2`,children:t.phase}),e.startedAt!==void 0&&(0,m.jsxs)(`span`,{className:`text-faint tnum`,children:[`+`,lE(t.at-e.startedAt)]})]},`${t.at}-${t.phase}-${n}`))}),e.terminal?.message&&e.terminal.message!==e.name&&(0,m.jsx)(`div`,{className:`mono mb-2 rounded border p-2 text-[11px] ${e.status===`failed`?`border-bad/25 bg-bad/10 text-bad`:`border-line bg-sunken/20 text-fg-2`}`,children:e.terminal.message}),e.logs.length>0&&(0,m.jsx)(`div`,{className:`mono flex flex-col gap-0.5 text-[11px]`,children:e.logs.map((e,t)=>(0,m.jsx)(gE,{e},`${e.at}-${t}`))})]})]})}function vE({events:e}){let{subs:t,stepLogs:n}=Xx(e),r=hE.map(e=>[e,t.filter(t=>t.status===e).length]).filter(([,e])=>e>0),i=t.some(e=>e.group);return(0,m.jsxs)(m.Fragment,{children:[t.length>0&&(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,m.jsxs)(`span`,{className:`mono text-[10px] uppercase tracking-[0.18em] text-dim`,children:[`sub-processes · `,t.length]}),(0,m.jsx)(`span`,{className:`mono flex gap-2 text-[10px] uppercase tracking-wider`,children:r.map(([e,t])=>(0,m.jsxs)(`span`,{className:pE[e].split(` `).pop(),children:[t,` `,e]},e))})]}),i?Object.entries(t.reduce((e,t)=>{let n=t.group??`—`;return e[n]===void 0&&(e[n]=[]),e[n].push(t),e},{})).sort(([e],[t])=>e===`—`?1:t===`—`?-1:e.localeCompare(t)).map(([e,t])=>(0,m.jsxs)(`div`,{className:`mb-2`,children:[(0,m.jsx)(`div`,{className:`mono mb-1 text-[10px] uppercase tracking-wider text-dim`,children:e}),(0,m.jsx)(`ul`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,m.jsx)(_E,{sub:e,showGroup:!1},e.id))})]},e)):(0,m.jsx)(`ul`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,m.jsx)(_E,{sub:e},e.id))})]}),n.length>0&&(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-dim`,children:[`logs · `,n.length]}),(0,m.jsx)(`div`,{className:`mono max-h-64 overflow-auto rounded-lg border border-line bg-sunken/40 p-2.5 text-[11px] leading-relaxed`,children:n.map((e,t)=>(0,m.jsx)(gE,{e},`${e.at}-${t}`))})]})]})}function yE({value:e}){let[t,n]=(0,p.useState)(!1);return(0,m.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 rounded border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-dim transition-colors hover:text-fg`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1200)}catch{}},children:[t?(0,m.jsx)(TC,{width:11,height:11}):(0,m.jsx)(DC,{width:11,height:11}),t?`copied`:`copy`]})}function bE({label:e,value:t}){let n=typeof t==`string`?t:JSON.stringify(t,null,2);return(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.18em] text-dim`,children:e}),(0,m.jsx)(yE,{value:n})]}),(0,m.jsx)(`pre`,{className:`mono max-h-64 overflow-auto rounded-lg border border-line bg-sunken/40 p-3 text-[11.5px] leading-relaxed text-fg-2`,children:n})]})}function xE({error:e}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mono mb-1.5 flex items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-bad/80`,children:[(0,m.jsx)(`span`,{children:`error`}),e.code&&(0,m.jsx)(`span`,{className:`rounded border border-bad/30 px-1.5 py-px normal-case tracking-normal text-bad`,children:e.code})]}),(0,m.jsx)(`div`,{className:`mono rounded-lg border border-bad/25 bg-bad/10 p-3 text-[11.5px] leading-relaxed text-bad`,children:e.message})]}),e.details!==void 0&&(0,m.jsx)(bE,{label:`error details`,value:e.details})]})}function SE({k:e,v:t,mono:n=!0}){return(0,m.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 py-1.5`,children:[(0,m.jsx)(`span`,{className:`mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-faint`,children:e}),(0,m.jsx)(`span`,{className:`truncate text-right text-[12px] text-fg ${n?`mono tnum`:``}`,children:t})]})}function CE({id:e,onOpenRun:t}){let{data:n}=Qe({queryKey:[`run`,e],queryFn:()=>XS.run(e),refetchInterval:VT}),[r,i]=(0,p.useState)(new Set);return n?n.timeline.length===0?(0,m.jsxs)(`div`,{className:`mono px-2 py-2 text-[10px] text-faint`,children:[`no steps recorded yet — child `,n.run.status]}):(0,m.jsx)(`div`,{className:`mt-2 max-h-80 space-y-1 overflow-auto rounded-md border border-line bg-sunken/20 p-1.5`,children:(0,m.jsx)(oE,{run:n.run,timeline:n.timeline,depth:0,onSelect:()=>{},onOpenRun:t??(()=>{}),expanded:r,onToggleChild:e=>i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})})}):(0,m.jsx)(`div`,{className:`mono px-2 py-2 text-[10px] text-faint`,children:`loading child run…`})}function wE({step:e,run:t,onClose:n,onOpenRun:r}){let i=_T(e),[a,o]=(0,p.useState)(!1),s=e.status===`failed`,c=e.status===`pending`||e.status===`running`,l=PC(e.kind),u=uE(t.createdAt,e.startedAt),d=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return(0,m.jsxs)(`aside`,{className:`absolute inset-y-0 right-0 z-20 flex w-[380px] max-w-[90%] flex-col border-l border-line bg-panel/95 shadow-2xl backdrop-blur-md rise`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-line px-5 py-4`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`grid h-6 w-6 shrink-0 place-items-center rounded-md ${s?`bg-bad/15 text-bad`:c?`bg-warn/15 text-warn`:`bg-good/15 text-good`}`,children:(0,m.jsx)(l,{width:13,height:13})}),(0,m.jsx)(`h3`,{className:`truncate text-[15px] font-semibold tracking-tight text-fg`,children:e.name})]}),(0,m.jsxs)(`div`,{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status,` · `,FC[e.kind]??e.kind]})]}),(0,m.jsx)(`button`,{type:`button`,onClick:n,className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-line text-dim transition-colors hover:text-fg`,"aria-label":`Close`,children:(0,m.jsx)(EC,{})})]}),(0,m.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4`,children:[(0,m.jsxs)(`div`,{className:`rounded-lg border border-line bg-sunken/20 px-3.5 py-1`,children:[(0,m.jsx)(SE,{k:`seq`,v:`#${e.seq}`}),d>=1&&(0,m.jsx)(SE,{k:`queued`,v:(0,m.jsx)(`span`,{className:`text-info`,children:lE(d)})}),(0,m.jsx)(SE,{k:`duration`,v:c?(0,m.jsx)(`span`,{className:`text-warn`,children:`running…`}):uE(e.startedAt,e.finishedAt)}),(0,m.jsx)(SE,{k:`attempts`,v:(0,m.jsxs)(`span`,{className:e.attempts>1?`text-warn`:``,children:[e.attempts>1&&(0,m.jsx)(kC,{width:11,height:11,className:`mr-1 inline`}),e.attempts]})}),e.workerGroup&&(0,m.jsx)(SE,{k:`worker`,v:`@${e.workerGroup}`}),(0,m.jsx)(SE,{k:`started`,v:dE(e.startedAt)}),!c&&(0,m.jsx)(SE,{k:`finished`,v:dE(e.finishedAt)}),(0,m.jsx)(SE,{k:`offset`,v:`+${u}`})]}),s&&e.error&&(0,m.jsx)(xE,{error:e.error}),e.events&&e.events.length>0&&(0,m.jsx)(vE,{events:e.events}),i&&(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.18em] text-dim`,children:`child run`}),r&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>r(i),className:`mono rounded border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-dim transition-colors hover:text-fg`,children:`open ↗`})]}),(0,m.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`flex w-full items-center gap-2 rounded-md border border-violet/30 bg-violet/10 px-2.5 py-1.5 text-left transition-colors hover:bg-violet/20`,title:a?`Collapse child run`:`Expand child run inline`,children:[(0,m.jsx)(`span`,{className:`inline-block text-[9px] text-violet transition-transform`,style:{transform:a?`rotate(90deg)`:`rotate(0deg)`},children:`▸`}),(0,m.jsx)(`span`,{className:`mono truncate text-[11px] text-violet`,children:i})]}),a&&(0,m.jsx)(CE,{id:i,onOpenRun:r})]}),e.input!==void 0&&(0,m.jsx)(bE,{label:`input`,value:e.input}),e.output!==void 0&&(0,m.jsx)(bE,{label:`output`,value:e.output})]})]})}var TE=`durable:lifecycle:pending`;function EE(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}function DE(e,t){switch(e.state){case`started`:return`started`;case`owed`:{let n=e.owedSince===void 0?`owed`:`owed for ${EE(t-e.owedSince)}`;return e.orphanAt===void 0?n:`${n} · orphan in ${EE(e.orphanAt-t)}`}case`failed`:return e.error?`failed: ${e.error}`:`failed`;case`coalesced`:return`coalesced`;default:return`not started`}}var OE="No run and nothing owed: its `where` declined the event, or it subscribed after the run settled.",kE="Its last delivery failed: `where` threw, the input was rejected, the start failed, or the sweep dropped it as an orphan. The reason is in the run.trigger_failed event. Republish retries it.",AE=`No live instance registers or announces this subscriber; the lifecycle sweep drops it then and reports run.trigger_failed.`;function jE({status:e}){return e?(0,m.jsx)(nC,{variant:`bare`,className:`s-${e} text-[10px]`,children:e}):null}function ME({runId:e,onOpenRun:t}){return(0,m.jsx)(Wi,{variant:`chip`,size:`micro`,onClick:()=>t(e),className:`mono max-w-[28rem] truncate px-1.5 py-0`,title:e,children:e})}function NE({source:e,onOpenRun:t}){return(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,"data-testid":`lifecycle-source`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:`started by`}),(0,m.jsx)(ME,{runId:e.runId,onOpenRun:t}),(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:`on`}),(0,m.jsx)(nC,{variant:`neutral`,className:J(`text-[10px]`,e.kind===`failed`?`s-failed`:`s-completed`),children:e.kind}),(0,m.jsx)(jE,{status:e.status}),e.traceId&&(0,m.jsxs)(`span`,{className:`ml-1 flex items-center gap-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:`trace`}),(0,m.jsx)(`span`,{className:`mono text-[10px] text-fg-2`,title:`The source run's trace id`,children:e.traceId}),(0,m.jsx)(yE,{value:e.traceId})]})]})}function PE({waitsFor:e=[],awaitedBy:t=[],onOpenRun:n}){return e.length===0&&t.length===0?null:(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1`,children:[e.map(e=>(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,"data-testid":`waits-for`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-warn/80`,children:`Waiting for run`}),(0,m.jsx)(ME,{runId:e.runId,onOpenRun:n}),(0,m.jsx)(jE,{status:e.status})]},`${e.runId}#${e.seq}`)),t.length>0&&(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,"data-testid":`awaited-by`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:`Awaited by`}),t.map(e=>(0,m.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(ME,{runId:e.runId,onOpenRun:n}),(0,m.jsx)(jE,{status:e.status})]},`${e.runId}#${e.seq}`))]})]})}function FE({deliveries:e,errors:t,now:n=Date.now(),onOpenRun:r}){return e.length===0?null:(0,m.jsxs)(`section`,{"aria-label":`Lifecycle subscribers`,className:`mt-3`,children:[(0,m.jsx)(`h3`,{className:`text-[10px] uppercase tracking-wider text-dim`,children:`Lifecycle subscribers`}),(0,m.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1`,children:e.map(e=>{let i=e.state===`failed`?t?.get(e.subscriber):void 0,a=i!==void 0&&e.error===void 0?{...e,error:i}:e;return(0,m.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1.5`,"data-state":a.state,children:[(0,m.jsx)(`span`,{className:`mono text-[12px] text-fg`,children:a.subscriber}),(0,m.jsx)(nC,{variant:a.state===`owed`?`warn`:a.state===`failed`?`destructive`:`neutral`,className:`text-[10px]`,title:a.state===`not-started`?OE:a.state===`failed`?kE:a.orphanAt===void 0?void 0:AE,children:DE(a,n)}),a.runId&&(0,m.jsx)(ME,{runId:a.runId,onOpenRun:r}),a.state===`started`&&(0,m.jsx)(jE,{status:a.status}),a.state===`failed`&&a.error===void 0&&(0,m.jsx)(`span`,{className:`text-[10px] text-dim`,children:`see the run.trigger_failed event for the reason`})]},a.subscriber)})})]})}function IE({tags:e,onChange:t}){let n=e.includes(TE);return(0,m.jsx)(Wi,{variant:`ghost`,size:`micro`,"aria-pressed":n,title:`Settled runs whose lifecycle event is still owed to a subscriber (tag durable:lifecycle:pending)`,onClick:()=>t(n?e.filter(e=>e!==TE):[...e,TE]),className:J(`mono rounded-md border-line`,n&&`border-warn/40 bg-warn/10 text-warn hover:text-warn`),children:`lifecycle pending`})}var LE=class{limit;events=[];pushed=0;listeners=new Set;constructor(e=200){this.limit=e}push(e){this.pushed+=1;let t=[...this.events,{id:this.pushed,event:e}];this.events=t.length>this.limit?t.slice(t.length-this.limit):t;for(let e of this.listeners)e()}snapshot=()=>this.events;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e))};function RE(e,t){if(!e)return t;let n=new Map(e.timeline.map(e=>[e.seq,e]));return{...t,timeline:t.timeline.map(e=>{if((e.status===`pending`||e.status===`running`)&&(e.events?.length??0)===0){let t=n.get(e.seq)?.events;if(t?.length)return{...e,events:t}}return e})}}function zE(e,t,n){if(!e)return e;let r=e.timeline.findIndex(e=>e.seq===t),i=e.timeline[r];if(i===void 0)return e;let a=[...e.timeline];return a[r]={...i,events:[...i.events??[],n]},{...e,timeline:a}}function BE(e,t,n=Date.now){let r=-1/0,i,a=()=>{i=void 0,r=n(),e()};return{call(){if(i!==void 0)return;let e=r+t-n();e<=0?a():i=setTimeout(a,e)},cancel(){i!==void 0&&clearTimeout(i),i=void 0}}}function VE(e){let t=e.lastIndexOf(`~retry~`);return t===-1?void 0:e.slice(0,t)}function HE(e){return(VE(e)??e).match(/^(.*)\.(?:child\.\d+|onError\.\d+)$/)?.[1]||void 0}function UE(e,t){if(t&&e.startsWith(`evt:`))for(let n of[`completed`,`failed`]){let r=`:${n}:${t}`;if(e.endsWith(r)&&e.length>4+r.length)return e.slice(4,-r.length)}}function WE(e){let t=[];if(e.type===`run.triggered`&&e.triggeredRunId&&t.push({rel:`triggered`,runId:e.triggeredRunId}),e.type===`run.started`){let n=UE(e.runId,e.workflow);n&&t.push({rel:`source`,runId:n});let r=HE(e.runId);r&&t.push({rel:`parent`,runId:r})}if(e.type.startsWith(`step.`)&&e.name){let n=_T({name:e.name});n&&t.push({rel:`child`,runId:n})}return t}function GE(e){let t=[];return e.name&&t.push(e.type===`run.triggered`||e.type===`run.trigger_failed`?`subscriber ${e.name}`:e.type===`run.routed`?`handler ${e.name}`:e.name),e.durationMs!==void 0&&t.push(`${e.durationMs}ms`),e.error?.message&&t.push(e.error.message),e.reason&&t.push(e.reason),t.join(` · `)}function KE(e){let t=new Map;for(let{event:n}of e)n.type===`run.trigger_failed`&&n.name&&t.set(n.name,n.error?.message??`unknown error`),n.type===`run.triggered`&&n.name&&t.delete(n.name);return t}function qE(e){return(0,p.useSyncExternalStore)(e.subscribe,e.snapshot,e.snapshot)}var JE={triggered:`started`,source:`started by`,child:`child`,parent:`child of`};function YE(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().slice(11,23)}function XE({tail:e,onOpenRun:t}){let n=qE(e);return(0,m.jsxs)(`section`,{"aria-label":`Events`,className:`mt-3`,"data-testid":`run-events`,children:[(0,m.jsxs)(`h3`,{className:`text-[10px] uppercase tracking-wider text-dim`,children:[`Events`,n.length>0?` · ${n.length}`:``]}),n.length===0?(0,m.jsxs)(`p`,{className:`mt-1 text-[11px] text-dim`,children:[`Live only: the engine events of this run show here as they arrive while the page is open (the last `,e.limit,`). Nothing is stored, so earlier events are not shown.`]}):(0,m.jsx)(`ol`,{className:`mt-1 flex max-h-72 flex-col gap-0.5 overflow-auto`,children:[...n].reverse().map(({id:e,event:n})=>(0,m.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1.5 text-[11px]`,"data-type":n.type,children:[(0,m.jsx)(`span`,{className:`mono text-dim`,children:YE(n.at)}),(0,m.jsx)(nC,{variant:n.type===`run.trigger_failed`||n.type.endsWith(`.failed`)||n.type===`run.unrouted`?`destructive`:`neutral`,className:`mono`,children:n.type}),(0,m.jsx)(`span`,{className:`text-fg-2`,children:GE(n)}),WE(n).map(e=>(0,m.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:JE[e.rel]}),(0,m.jsx)(Wi,{variant:`chip`,size:`micro`,onClick:()=>t(e.runId),className:`mono max-w-[24rem] truncate px-1.5 py-0`,title:e.runId,children:e.runId})]},`${e.rel}:${e.runId}`))]},e))})]})}function ZE({deliveries:e,tail:t,onOpenRun:n}){let r=qE(t);return(0,m.jsx)(FE,{deliveries:e,errors:KE(r),onOpenRun:n})}function QE({run:e,onClose:t}){let n=e.input===void 0&&e.output===void 0&&!e.error;return(0,m.jsxs)(`aside`,{className:`absolute inset-y-0 right-0 z-30 flex w-[380px] max-w-[90%] flex-col border-l border-line bg-panel/95 shadow-2xl backdrop-blur-md rise`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-line px-5 py-4`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`h3`,{className:`truncate text-[15px] font-semibold tracking-tight text-fg`,children:e.workflow}),(0,m.jsxs)(`div`,{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[`run · `,e.status]})]}),(0,m.jsx)(`button`,{type:`button`,onClick:t,className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-line text-dim transition-colors hover:text-fg`,"aria-label":`Close`,children:(0,m.jsx)(EC,{})})]}),(0,m.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4`,children:[e.error&&(0,m.jsx)(xE,{error:e.error}),e.input!==void 0&&(0,m.jsx)(bE,{label:`input`,value:e.input}),e.output!==void 0&&(0,m.jsx)(bE,{label:`output`,value:e.output}),n&&(0,m.jsx)(`div`,{className:`text-sm text-faint`,children:`No input/output recorded.`})]})]})}function $E(e){let t=e.trim();if(t!==``)return JSON.parse(t)}var eD=`Not available on a tenant deployment — delivering signals/updates/tasks needs the control plane.`;function tD({id:e,label:t,hint:n,draft:r,onDraft:i}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`label`,{className:`mono mb-1.5 mt-3 block text-[10px] uppercase tracking-[0.18em] text-dim`,htmlFor:e,children:t}),(0,m.jsx)(`textarea`,{id:e,value:r,spellCheck:!1,placeholder:n,onChange:e=>i(e.target.value),className:`mono h-40 w-full resize-y rounded-lg border border-line bg-sunken/40 p-3 text-[11.5px] leading-relaxed text-fg-2 placeholder:text-faint focus:border-line-strong focus:outline-none`})]})}function nD({runId:e,targets:t,tenantPod:n,onDelivered:r}){let[i,a]=(0,p.useState)(void 0),[o,s]=(0,p.useState)(``),[c,l]=(0,p.useState)(``),[u,d]=(0,p.useState)(void 0),[f,h]=(0,p.useState)(void 0),g=e=>{s(e.verb===`signal`?e.token:``),l(``),d(void 0),h(void 0),a(e)},_=()=>a(void 0),v=()=>{_(),r()},y=e=>{h(KS(e)),d(e instanceof GS||e instanceof Error?e.message:`request failed`)},b=$e({mutationFn:t=>XS.signal(e,t.token,t.payload),onSuccess:v,onError:y}),x=$e({mutationFn:t=>XS.update(e,t.name,t.arg),onSuccess:v,onError:y}),S=$e({mutationFn:t=>XS.completeTask(e,t.name,t.result),onSuccess:v,onError:y}),C=$e({mutationFn:t=>XS.failTask(e,t.name,t.error),onSuccess:v,onError:y}),w=b.isPending||x.isPending||S.isPending||C.isPending;if(t.length===0)return null;let T=()=>{if(!i)return;if(i.verb===`task-fail`){C.mutate({name:i.name,error:c.trim()||`failed from console`});return}let e;try{e=$E(c)}catch(e){d(e instanceof Error?e.message:`Invalid JSON`);return}if(i.verb===`signal`){let t=o.trim();if(!t){d(`token is required`);return}b.mutate({token:t,payload:e})}else i.verb===`update`?x.mutate({name:i.name,arg:e}):S.mutate({name:i.name,result:e})},E=i?.verb===`signal`?`Deliver signal`:i?.verb===`update`?`Send update`:i?.verb===`task-complete`?`Complete task`:`Fail task`,D=i?.verb===`signal`?`resumes ${e} at its ctx.waitForSignal`:i?.verb===`update`?`delivers to ${e}'s ctx.onUpdate("${i.name}") — the workflow's validator arbitrates`:i?`settles ${e}'s external task "${i.name}"`:``;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-info/30 bg-info/10 px-7 py-3`,children:[(0,m.jsx)(`span`,{className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-info/40 bg-info/15 text-sm text-info`,"aria-hidden":!0,children:`✋`}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsx)(`div`,{className:`text-[13px] font-medium text-info`,children:`Waiting on a human`}),(0,m.jsxs)(`div`,{className:`mono truncate text-[11px] text-info/70`,children:[`this run is suspended until someone answers the wait`,t.length===1?``:`s`,` `,`below`]})]}),(0,m.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:t.map(e=>e.kind===`task`?(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,m.jsxs)(`span`,{className:`mono max-w-[180px] truncate text-[10px] text-info/80`,children:[`task `,e.name]}),(0,m.jsxs)(Wi,{variant:`brand`,size:`micro`,disabled:n||w,title:n?eD:`Complete task "${e.name}" with a result`,onClick:()=>g({verb:`task-complete`,name:e.name}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(TC,{width:10,height:10}),`Complete task`]}),(0,m.jsxs)(Wi,{variant:`destructive`,size:`micro`,disabled:n||w,title:n?eD:`Fail task "${e.name}" with a reason`,onClick:()=>g({verb:`task-fail`,name:e.name}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(EC,{width:10,height:10}),`Fail task`]})]},e.token):e.kind===`update`?(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,m.jsxs)(`span`,{className:`mono max-w-[180px] truncate text-[10px] text-info/80`,children:[`update `,e.name]}),(0,m.jsxs)(Wi,{variant:`info`,size:`micro`,disabled:n||w,title:n?eD:`Send a validated update to "${e.name}"`,onClick:()=>g({verb:`update`,name:e.name}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(kC,{width:10,height:10}),`Send update`]})]},e.token):(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,m.jsxs)(`span`,{className:`mono max-w-[180px] truncate text-[10px] text-info/80`,children:[`signal `,e.token]}),(0,m.jsxs)(Wi,{variant:`info`,size:`micro`,disabled:n||w,title:n?eD:`Deliver a payload on "${e.token}"`,onClick:()=>g({verb:`signal`,token:e.token}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(kC,{width:10,height:10}),`Deliver signal`]})]},e.token))})]}),(0,m.jsxs)(zC,{open:i!==void 0,onOpenChange:e=>{e||_()},title:E,description:D,footer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Wi,{variant:`outline`,size:`sm`,onClick:_,children:`Cancel`}),(0,m.jsx)(Wi,{size:`sm`,variant:i?.verb===`task-fail`?`destructive`:`info`,disabled:w,onClick:T,children:E})]}),children:[i?.verb===`signal`&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`label`,{className:`mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-dim`,htmlFor:`deliver-signal-token`,children:`token`}),(0,m.jsx)(LC,{id:`deliver-signal-token`,value:o,onChange:e=>{s(e.target.value),d(void 0)},onClear:()=>s(``),clearLabel:`clear token`,placeholder:`signal token…`,"aria-label":`signal token`}),(0,m.jsx)(tD,{id:`deliver-signal-payload`,label:`payload (json, optional)`,hint:`empty delivers no payload`,draft:c,onDraft:e=>{l(e),d(void 0)}})]}),i?.verb===`update`&&(0,m.jsx)(tD,{id:`send-update-arg`,label:`argument (json, optional)`,hint:`empty sends no argument`,draft:c,onDraft:e=>{l(e),d(void 0)}}),i?.verb===`task-complete`&&(0,m.jsx)(tD,{id:`complete-task-result`,label:`result (json, optional)`,hint:`empty completes with no result`,draft:c,onDraft:e=>{l(e),d(void 0)}}),i?.verb===`task-fail`&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`label`,{className:`mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-dim`,htmlFor:`fail-task-reason`,children:`reason`}),(0,m.jsx)(LC,{id:`fail-task-reason`,value:c,onChange:e=>{l(e.target.value),d(void 0)},onClear:()=>l(``),clearLabel:`clear reason`,placeholder:`failed from console`,"aria-label":`failure reason`})]}),u&&(0,m.jsx)(`p`,{className:`mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad`,children:u}),f&&f.length>0&&(0,m.jsxs)(`div`,{className:`mt-2`,children:[(0,m.jsx)(`div`,{className:`mono mb-1 text-[10px] uppercase tracking-[0.18em] text-dim`,children:`waiting on — pick one`}),(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:f.map(e=>(0,m.jsx)(Wi,{variant:`chip`,size:`micro`,className:`mono`,onClick:()=>{s(e),d(void 0),h(void 0)},children:e},e))})]})]})]})}function rD(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=rD(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var iD={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 Error(`illegal type: `+r);n[r]=[]}return new oD(n)}function oD(e){this._=e}function sD(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}oD.prototype=aD.prototype={constructor:oD,on:function(e,t){var n=this._,r=sD(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=cD(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=lD(n[i],e.name,t);else if(t==null)for(i in n)n[i]=lD(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new oD(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function cD(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function lD(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=iD,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var uD=`http://www.w3.org/1999/xhtml`,dD={svg:`http://www.w3.org/2000/svg`,xhtml:uD,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function fD(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),dD.hasOwnProperty(t)?{space:dD[t],local:e}:e}function pD(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===uD&&t.documentElement.namespaceURI===uD?t.createElement(e):t.createElementNS(n,e)}}function mD(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hD(e){var t=fD(e);return(t.local?mD:pD)(t)}function gD(){}function _D(e){return e==null?gD:function(){return this.querySelector(e)}}function vD(e){typeof e!=`function`&&(e=_D(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new ok(r,this._parents)}function yD(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function bD(){return[]}function xD(e){return e==null?bD:function(){return this.querySelectorAll(e)}}function SD(e){return function(){return yD(e.apply(this,arguments))}}function CD(e){e=typeof e==`function`?SD(e):xD(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new ok(r,i)}function wD(e){return function(){return this.matches(e)}}function TD(e){return function(t){return t.matches(e)}}var ED=Array.prototype.find;function DD(e){return function(){return ED.call(this.children,e)}}function OD(){return this.firstElementChild}function kD(e){return this.select(e==null?OD:DD(typeof e==`function`?e:TD(e)))}var AD=Array.prototype.filter;function jD(){return Array.from(this.children)}function MD(e){return function(){return AD.call(this.children,e)}}function ND(e){return this.selectAll(e==null?jD:MD(typeof e==`function`?e:TD(e)))}function PD(e){typeof e!=`function`&&(e=wD(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new ok(r,this._parents)}function FD(e){return Array(e.length)}function ID(){return new ok(this._enter||this._groups.map(FD),this._parents)}function LD(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}LD.prototype={constructor:LD,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 RD(e){return function(){return e}}function zD(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new LD(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function BD(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new LD(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function VD(e){return e.__data__}function HD(e,t){if(!arguments.length)return Array.from(this,VD);var n=t?BD:zD,r=this._parents,i=this._groups;typeof e!=`function`&&(e=RD(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=UD(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new ok(o,r),o._enter=s,o._exit=c,o}function UD(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function WD(){return new ok(this._exit||this._groups.map(FD),this._parents)}function GD(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function KD(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new ok(s,this._parents)}function qD(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function JD(e){e||=YD;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new ok(i,this._parents).order()}function YD(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function XD(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ZD(){return Array.from(this)}function QD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function $D(){let e=0;for(let t of this)++e;return e}function eO(){return!this.node()}function tO(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function nO(e){return function(){this.removeAttribute(e)}}function rO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function iO(e,t){return function(){this.setAttribute(e,t)}}function aO(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function oO(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function sO(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 cO(e,t){var n=fD(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?rO:nO:typeof t==`function`?n.local?sO:oO:n.local?aO:iO)(n,t))}function lO(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function uO(e){return function(){this.style.removeProperty(e)}}function dO(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fO(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function pO(e,t,n){return arguments.length>1?this.each((t==null?uO:typeof t==`function`?fO:dO)(e,t,n??``)):mO(this.node(),e)}function mO(e,t){return e.style.getPropertyValue(t)||lO(e).getComputedStyle(e,null).getPropertyValue(t)}function hO(e){return function(){delete this[e]}}function gO(e,t){return function(){this[e]=t}}function _O(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function vO(e,t){return arguments.length>1?this.each((t==null?hO:typeof t==`function`?_O:gO)(e,t)):this.node()[e]}function yO(e){return e.trim().split(/^|\s+/)}function bO(e){return e.classList||new xO(e)}function xO(e){this._node=e,this._names=yO(e.getAttribute(`class`)||``)}xO.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function SO(e,t){for(var n=bO(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function CO(e,t){for(var n=bO(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function wO(e){return function(){SO(this,e)}}function TO(e){return function(){CO(this,e)}}function EO(e,t){return function(){(t.apply(this,arguments)?SO:CO)(this,e)}}function DO(e,t){var n=yO(e+``);if(arguments.length<2){for(var r=bO(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?EO:t?wO:TO)(n,t))}function OO(){this.textContent=``}function kO(e){return function(){this.textContent=e}}function AO(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function jO(e){return arguments.length?this.each(e==null?OO:(typeof e==`function`?AO:kO)(e)):this.node().textContent}function MO(){this.innerHTML=``}function NO(e){return function(){this.innerHTML=e}}function PO(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function FO(e){return arguments.length?this.each(e==null?MO:(typeof e==`function`?PO:NO)(e)):this.node().innerHTML}function IO(){this.nextSibling&&this.parentNode.appendChild(this)}function LO(){return this.each(IO)}function RO(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zO(){return this.each(RO)}function BO(e){var t=typeof e==`function`?e:hD(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function VO(){return null}function HO(e,t){var n=typeof e==`function`?e:hD(e),r=t==null?VO:typeof t==`function`?t:_D(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function UO(){var e=this.parentNode;e&&e.removeChild(this)}function WO(){return this.each(UO)}function GO(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KO(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qO(e){return this.select(e?KO:GO)}function JO(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function YO(e){return function(t){e.call(this,t,this.__data__)}}function XO(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function ZO(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function QO(e,t,n){return function(){var r=this.__on,i,a=YO(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function $O(e,t,n){var r=XO(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?QO:ZO,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function ek(e,t,n){var r=lO(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function tk(e,t){return function(){return ek(this,e,t)}}function nk(e,t){return function(){return ek(this,e,t.apply(this,arguments))}}function rk(e,t){return this.each((typeof t==`function`?nk:tk)(e,t))}function*ik(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var ak=[null];function ok(e,t){this._groups=e,this._parents=t}function sk(){return new ok([[document.documentElement]],ak)}function ck(){return this}ok.prototype=sk.prototype={constructor:ok,select:vD,selectAll:CD,selectChild:kD,selectChildren:ND,filter:PD,data:HD,enter:ID,exit:WD,join:GD,merge:KD,selection:ck,order:qD,sort:JD,call:XD,nodes:ZD,node:QD,size:$D,empty:eO,each:tO,attr:cO,style:pO,property:vO,classed:DO,text:jO,html:FO,raise:LO,lower:zO,append:BO,insert:HO,remove:WO,clone:qO,datum:JO,on:$O,dispatch:rk,[Symbol.iterator]:ik};function lk(e){return typeof e==`string`?new ok([[document.querySelector(e)]],[document.documentElement]):new ok([[e]],ak)}var uk=0;function dk(){return new fk}function fk(){this._=`@`+(++uk).toString(36)}fk.prototype=dk.prototype={constructor:fk,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function pk(e){let t;for(;t=e.sourceEvent;)e=t;return e}function mk(e,t){if(e=pk(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var hk={passive:!1},gk={capture:!0,passive:!1};function _k(e){e.stopImmediatePropagation()}function vk(e){e.preventDefault(),e.stopImmediatePropagation()}function yk(e){var t=e.document.documentElement,n=lk(e).on(`dragstart.drag`,vk,gk);`onselectstart`in t?n.on(`selectstart.drag`,vk,gk):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function bk(e,t){var n=e.document.documentElement,r=lk(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,vk,gk),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var xk=e=>()=>e;function Sk(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Sk.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ck(e){return!e.ctrlKey&&!e.button}function wk(){return this.parentNode}function Tk(e,t){return t??{x:e.x,y:e.y}}function Ek(){return navigator.maxTouchPoints||`ontouchstart`in this}function Dk(){var e=Ck,t=wk,n=Tk,r=Ek,i={},a=aD(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,hk).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(lk(n.view).on(`mousemove.drag`,m,gk).on(`mouseup.drag`,h,gk),yk(n.view),_k(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(vk(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){lk(e.view).on(`mousemove.drag mouseup.drag`,null),bk(e.view,l),vk(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(_k(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(vk(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(_k(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=mk(l||r,t),p,m,h;if((h=n.call(e,new Sk(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=mk(l||a,t),_=o}u.call(r,e,new Sk(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:xk(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:xk(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:xk(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:xk(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Ok(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function kk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ak(){}var jk=.7,Mk=1/jk,Nk=`\\s*([+-]?\\d+)\\s*`,Pk=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Fk=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Ik=/^#([0-9a-f]{3,8})$/,Lk=RegExp(`^rgb\\(${Nk},${Nk},${Nk}\\)$`),Rk=RegExp(`^rgb\\(${Fk},${Fk},${Fk}\\)$`),zk=RegExp(`^rgba\\(${Nk},${Nk},${Nk},${Pk}\\)$`),Bk=RegExp(`^rgba\\(${Fk},${Fk},${Fk},${Pk}\\)$`),Vk=RegExp(`^hsl\\(${Pk},${Fk},${Fk}\\)$`),Hk=RegExp(`^hsla\\(${Pk},${Fk},${Fk},${Pk}\\)$`),Uk={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};Ok(Ak,Jk,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Wk,formatHex:Wk,formatHex8:Gk,formatHsl:Kk,formatRgb:qk,toString:qk});function Wk(){return this.rgb().formatHex()}function Gk(){return this.rgb().formatHex8()}function Kk(){return sA(this).formatHsl()}function qk(){return this.rgb().formatRgb()}function Jk(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Ik.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Yk(t):n===3?new $k(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Xk(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Xk(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=Lk.exec(e))?new $k(t[1],t[2],t[3],1):(t=Rk.exec(e))?new $k(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=zk.exec(e))?Xk(t[1],t[2],t[3],t[4]):(t=Bk.exec(e))?Xk(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Vk.exec(e))?oA(t[1],t[2]/100,t[3]/100,1):(t=Hk.exec(e))?oA(t[1],t[2]/100,t[3]/100,t[4]):Uk.hasOwnProperty(e)?Yk(Uk[e]):e===`transparent`?new $k(NaN,NaN,NaN,0):null}function Yk(e){return new $k(e>>16&255,e>>8&255,e&255,1)}function Xk(e,t,n,r){return r<=0&&(e=t=n=NaN),new $k(e,t,n,r)}function Zk(e){return e instanceof Ak||(e=Jk(e)),e?(e=e.rgb(),new $k(e.r,e.g,e.b,e.opacity)):new $k}function Qk(e,t,n,r){return arguments.length===1?Zk(e):new $k(e,t,n,r??1)}function $k(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ok($k,Qk,kk(Ak,{brighter(e){return e=e==null?Mk:Mk**+e,new $k(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?jk:jk**+e,new $k(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $k(iA(this.r),iA(this.g),iA(this.b),rA(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:eA,formatHex:eA,formatHex8:tA,formatRgb:nA,toString:nA}));function eA(){return`#${aA(this.r)}${aA(this.g)}${aA(this.b)}`}function tA(){return`#${aA(this.r)}${aA(this.g)}${aA(this.b)}${aA((isNaN(this.opacity)?1:this.opacity)*255)}`}function nA(){let e=rA(this.opacity);return`${e===1?`rgb(`:`rgba(`}${iA(this.r)}, ${iA(this.g)}, ${iA(this.b)}${e===1?`)`:`, ${e})`}`}function rA(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function iA(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function aA(e){return e=iA(e),(e<16?`0`:``)+e.toString(16)}function oA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new lA(e,t,n,r)}function sA(e){if(e instanceof lA)return new lA(e.h,e.s,e.l,e.opacity);if(e instanceof Ak||(e=Jk(e)),!e)return new lA;if(e instanceof lA)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new lA(o,s,c,e.opacity)}function cA(e,t,n,r){return arguments.length===1?sA(e):new lA(e,t,n,r??1)}function lA(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ok(lA,cA,kk(Ak,{brighter(e){return e=e==null?Mk:Mk**+e,new lA(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jk:jk**+e,new lA(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new $k(fA(e>=240?e-240:e+120,i,r),fA(e,i,r),fA(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new lA(uA(this.h),dA(this.s),dA(this.l),rA(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=rA(this.opacity);return`${e===1?`hsl(`:`hsla(`}${uA(this.h)}, ${dA(this.s)*100}%, ${dA(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function uA(e){return e=(e||0)%360,e<0?e+360:e}function dA(e){return Math.max(0,Math.min(1,e||0))}function fA(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var pA=Math.PI/180,mA=180/Math.PI,hA=18,gA=.96422,_A=1,vA=.82521,yA=4/29,bA=6/29,xA=3*bA*bA,SA=bA*bA*bA;function CA(e){if(e instanceof TA)return new TA(e.l,e.a,e.b,e.opacity);if(e instanceof MA)return NA(e);e instanceof $k||(e=Zk(e));var t=kA(e.r),n=kA(e.g),r=kA(e.b),i=EA((.2225045*t+.7168786*n+.0606169*r)/_A),a,o;return t===n&&n===r?a=o=i:(a=EA((.4360747*t+.3850649*n+.1430804*r)/gA),o=EA((.0139322*t+.0971045*n+.7141733*r)/vA)),new TA(116*i-16,500*(a-i),200*(i-o),e.opacity)}function wA(e,t,n,r){return arguments.length===1?CA(e):new TA(e,t,n,r??1)}function TA(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Ok(TA,wA,kk(Ak,{brighter(e){return new TA(this.l+hA*(e??1),this.a,this.b,this.opacity)},darker(e){return new TA(this.l-hA*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=gA*DA(t),e=_A*DA(e),n=vA*DA(n),new $k(OA(3.1338561*t-1.6168667*e-.4906146*n),OA(-.9787684*t+1.9161415*e+.033454*n),OA(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function EA(e){return e>SA?e**(1/3):e/xA+yA}function DA(e){return e>bA?e*e*e:xA*(e-yA)}function OA(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function kA(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function AA(e){if(e instanceof MA)return new MA(e.h,e.c,e.l,e.opacity);if(e instanceof TA||(e=CA(e)),e.a===0&&e.b===0)return new MA(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*mA;return new MA(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function jA(e,t,n,r){return arguments.length===1?AA(e):new MA(e,t,n,r??1)}function MA(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function NA(e){if(isNaN(e.h))return new TA(e.l,0,0,e.opacity);var t=e.h*pA;return new TA(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Ok(MA,jA,kk(Ak,{brighter(e){return new MA(this.h,this.c,this.l+hA*(e??1),this.opacity)},darker(e){return new MA(this.h,this.c,this.l-hA*(e??1),this.opacity)},rgb(){return NA(this).rgb()}}));var PA=-.14861,FA=1.78277,IA=-.29227,LA=-.90649,RA=1.97294,zA=RA*LA,BA=RA*FA,VA=FA*IA-LA*PA;function HA(e){if(e instanceof WA)return new WA(e.h,e.s,e.l,e.opacity);e instanceof $k||(e=Zk(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(VA*r+zA*t-BA*n)/(VA+zA-BA),a=r-i,o=(RA*(n-i)-IA*a)/LA,s=Math.sqrt(o*o+a*a)/(RA*i*(1-i)),c=s?Math.atan2(o,a)*mA-120:NaN;return new WA(c<0?c+360:c,s,i,e.opacity)}function UA(e,t,n,r){return arguments.length===1?HA(e):new WA(e,t,n,r??1)}function WA(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ok(WA,UA,kk(Ak,{brighter(e){return e=e==null?Mk:Mk**+e,new WA(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jk:jk**+e,new WA(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*pA,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new $k(255*(t+n*(PA*r+FA*i)),255*(t+n*(IA*r+LA*i)),255*(t+RA*r*n),this.opacity)}}));var GA=e=>()=>e;function KA(e,t){return function(n){return e+n*t}}function qA(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function JA(e,t){var n=t-e;return n?KA(e,n>180||n<-180?n-360*Math.round(n/360):n):GA(isNaN(e)?t:e)}function YA(e){return(e=+e)==1?XA:function(t,n){return n-t?qA(t,n,e):GA(isNaN(t)?n:t)}}function XA(e,t){var n=t-e;return n?KA(e,n):GA(isNaN(e)?t:e)}var ZA=(function e(t){var n=YA(t);function r(e,t){var r=n((e=Qk(e)).r,(t=Qk(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=XA(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function QA(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function $A(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ej(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=lj(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function tj(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function nj(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function rj(e,t){var n={},r={},i;for(i in typeof e==`object`&&e||(e={}),typeof t==`object`&&t||(t={}),t)i in e?n[i]=lj(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var ij=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,aj=new RegExp(ij.source,`g`);function oj(e){return function(){return e}}function sj(e){return function(t){return e(t)+``}}function cj(e,t){var n=ij.lastIndex=aj.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=ij.exec(e))&&(i=aj.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:nj(r,i)})),n=aj.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?sj(c[0].x):oj(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function lj(e,t){var n=typeof t,r;return t==null||n===`boolean`?GA(t):(n===`number`?nj:n===`string`?(r=Jk(t))?(t=r,ZA):cj:t instanceof Jk?ZA:t instanceof Date?tj:$A(t)?QA:Array.isArray(t)?ej:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?rj:nj)(e,t)}var uj=180/Math.PI,dj={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function fj(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*uj,skewX:Math.atan(c)*uj,scaleX:o,scaleY:s}}var pj;function mj(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?dj:fj(t.a,t.b,t.c,t.d,t.e,t.f)}function hj(e){return e==null||(pj||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),pj.setAttribute(`transform`,e),!(e=pj.transform.baseVal.consolidate()))?dj:(e=e.matrix,fj(e.a,e.b,e.c,e.d,e.e,e.f))}function gj(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:nj(e,i)},{i:c-2,x:nj(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:nj(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:nj(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:nj(e,n)},{i:s-2,x:nj(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var _j=gj(mj,`px, `,`px)`,`deg)`),vj=gj(hj,`, `,`)`,`)`),yj=1e-12;function bj(e){return((e=Math.exp(e))+1/e)/2}function xj(e){return((e=Math.exp(e))-1/e)/2}function Sj(e){return((e=Math.exp(2*e))-1)/(e+1)}var Cj=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<yj)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=bj(y),c=s/(n*g)*(i*Sj(t*r+y)-xj(y));return[a+c*d,o+c*f,s*i/bj(t*r+y)]}}return m.duration=Math.abs(h)*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4);function wj(e){return(function t(n){n=+n;function r(t,r){var i=e((t=UA(t)).h,(r=UA(r)).h),a=XA(t.s,r.s),o=XA(t.l,r.l),s=XA(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}wj(JA),wj(XA);var Tj=0,Ej=0,Dj=0,Oj=1e3,kj,Aj,jj=0,Mj=0,Nj=0,Pj=typeof performance==`object`&&performance.now?performance:Date,Fj=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ij(){return Mj||=(Fj(Lj),Pj.now()+Nj)}function Lj(){Mj=0}function Rj(){this._call=this._time=this._next=null}Rj.prototype=zj.prototype={constructor:Rj,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Ij():+n)+(t==null?0:+t),!this._next&&Aj!==this&&(Aj?Aj._next=this:kj=this,Aj=this),this._call=e,this._time=n,Wj()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wj())}};function zj(e,t,n){var r=new Rj;return r.restart(e,t,n),r}function Bj(){Ij(),++Tj;for(var e=kj,t;e;)(t=Mj-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tj}function Vj(){Mj=(jj=Pj.now())+Nj,Tj=Ej=0;try{Bj()}finally{Tj=0,Uj(),Mj=0}}function Hj(){var e=Pj.now(),t=e-jj;t>Oj&&(Nj-=t,jj=e)}function Uj(){for(var e,t=kj,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:kj=n);Aj=e,Wj(r)}function Wj(e){Tj||(Ej&&=clearTimeout(Ej),e-Mj>24?(e<1/0&&(Ej=setTimeout(Vj,Math.ceil(e-Pj.now()-Nj)+1)),Dj&&=clearInterval(Dj)):(Dj||=(jj=Pj.now(),setInterval(Hj,Oj)),Tj=1,Fj(Vj)))}function Gj(e,t,n){var r=new Rj;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}function Kj(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var qj=3;(function e(t){t=+t;function n(e){return e**+t}return n.exponent=e,n})(qj),(function e(t){t=+t;function n(e){return 1-(1-e)**t}return n.exponent=e,n})(qj),(function e(t){t=+t;function n(e){return((e*=2)<=1?e**+t:2-(2-e)**t)/2}return n.exponent=e,n})(qj);function Jj(e){return(2**(-10*e)-.0009765625)*1.0009775171065494}var Yj=4/11;1/Yj/Yj;var Xj=1.70158;(function e(t){t=+t;function n(e){return(e=+e)*e*(t*(e-1)+e)}return n.overshoot=e,n})(Xj),(function e(t){t=+t;function n(e){return--e*e*((e+1)*t+e)+1}return n.overshoot=e,n})(Xj),(function e(t){t=+t;function n(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return n.overshoot=e,n})(Xj);var Zj=2*Math.PI,Qj=1,$j=.3;(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Zj);function i(e){return t*Jj(- --e)*Math.sin((r-e)/n)}return i.amplitude=function(t){return e(t,n*Zj)},i.period=function(n){return e(t,n)},i})(Qj,$j),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Zj);function i(e){return 1-t*Jj(e=+e)*Math.sin((e+r)/n)}return i.amplitude=function(t){return e(t,n*Zj)},i.period=function(n){return e(t,n)},i})(Qj,$j),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Zj);function i(e){return((e=e*2-1)<0?t*Jj(-e)*Math.sin((r-e)/n):2-t*Jj(e)*Math.sin((r+e)/n))/2}return i.amplitude=function(t){return e(t,n*Zj)},i.period=function(n){return e(t,n)},i})(Qj,$j);var eM=aD(`start`,`end`,`cancel`,`interrupt`),tM=[],nM=0,rM=1,iM=2,aM=3,oM=4,sM=5,cM=6;function lM(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;pM(e,n,{name:t,index:r,group:i,on:eM,tween:tM,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:nM})}function uM(e,t){var n=fM(e,t);if(n.state>nM)throw Error(`too late; already scheduled`);return n}function dM(e,t){var n=fM(e,t);if(n.state>aM)throw Error(`too late; already running`);return n}function fM(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function pM(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zj(a,0,n.time);function a(e){n.state=rM,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==rM)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===aM)return Gj(o);f.state===oM?(f.state=cM,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=cM,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Gj(function(){n.state===aM&&(n.state=oM,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=iM,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===iM){for(n.state=aM,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=sM,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===sM&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=cM,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function mM(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>iM&&r.state<sM,r.state=cM,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function hM(e){return this.each(function(){mM(this,e)})}function gM(e,t){var n,r;return function(){var i=dM(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function _M(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=dM(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function vM(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=fM(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?gM:_M)(n,e,t))}function yM(e,t,n){var r=e._id;return e.each(function(){var e=dM(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return fM(e,r).value[t]}}function bM(e,t){var n;return(typeof t==`number`?nj:t instanceof Jk?ZA:(n=Jk(t))?(t=n,ZA):cj)(e,t)}function xM(e){return function(){this.removeAttribute(e)}}function SM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function CM(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function wM(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function TM(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function EM(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function DM(e,t){var n=fD(e),r=n===`transform`?vj:bM;return this.attrTween(e,typeof t==`function`?(n.local?EM:TM)(n,r,yM(this,`attr.`+e,t)):t==null?(n.local?SM:xM)(n):(n.local?wM:CM)(n,r,t))}function OM(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function kM(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function AM(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&kM(e,i)),n}return i._value=t,i}function jM(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&OM(e,i)),n}return i._value=t,i}function MM(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=fD(e);return this.tween(n,(r.local?AM:jM)(r,t))}function NM(e,t){return function(){uM(this,e).delay=+t.apply(this,arguments)}}function PM(e,t){return t=+t,function(){uM(this,e).delay=t}}function FM(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?NM:PM)(t,e)):fM(this.node(),t).delay}function IM(e,t){return function(){dM(this,e).duration=+t.apply(this,arguments)}}function LM(e,t){return t=+t,function(){dM(this,e).duration=t}}function RM(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?IM:LM)(t,e)):fM(this.node(),t).duration}function zM(e,t){if(typeof t!=`function`)throw Error();return function(){dM(this,e).ease=t}}function BM(e){var t=this._id;return arguments.length?this.each(zM(t,e)):fM(this.node(),t).ease}function VM(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();dM(this,e).ease=n}}function HM(e){if(typeof e!=`function`)throw Error();return this.each(VM(this._id,e))}function UM(e){typeof e!=`function`&&(e=wD(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new vN(r,this._parents,this._name,this._id)}function WM(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new vN(o,this._parents,this._name,this._id)}function GM(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function KM(e,t,n){var r,i,a=GM(t)?uM:dM;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function qM(e,t){var n=this._id;return arguments.length<2?fM(this.node(),n).on.on(e):this.each(KM(n,e,t))}function JM(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function YM(){return this.on(`end.remove`,JM(this._id))}function XM(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=_D(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,lM(l[f],t,n,f,l,fM(u,n)));return new vN(a,this._parents,t,n)}function ZM(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=xD(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=fM(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&lM(p,t,n,h,f,m);a.push(f),o.push(u)}return new vN(a,o,t,n)}var QM=sk.prototype.constructor;function $M(){return new QM(this._groups,this._parents)}function eN(e,t){var n,r,i;return function(){var a=mO(this,e),o=(this.style.removeProperty(e),mO(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function tN(e){return function(){this.style.removeProperty(e)}}function nN(e,t,n){var r,i=n+``,a;return function(){var o=mO(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function rN(e,t,n){var r,i,a;return function(){var o=mO(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),mO(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function iN(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=dM(this,e),l=c.on,u=c.value[a]==null?s||=tN(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function aN(e,t,n){var r=(e+=``)==`transform`?_j:bM;return t==null?this.styleTween(e,eN(e,r)).on(`end.style.`+e,tN(e)):typeof t==`function`?this.styleTween(e,rN(e,r,yM(this,`style.`+e,t))).each(iN(this._id,e)):this.styleTween(e,nN(e,r,t),n).on(`end.style.`+e,null)}function oN(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function sN(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&oN(e,a,n)),r}return a._value=t,a}function cN(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,sN(e,t,n??``))}function lN(e){return function(){this.textContent=e}}function uN(e){return function(){var t=e(this);this.textContent=t??``}}function dN(e){return this.tween(`text`,typeof e==`function`?uN(yM(this,`text`,e)):lN(e==null?``:e+``))}function fN(e){return function(t){this.textContent=e.call(this,t)}}function pN(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&fN(r)),t}return r._value=e,r}function mN(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,pN(e))}function hN(){for(var e=this._name,t=this._id,n=yN(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=fM(c,t);lM(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new vN(r,this._parents,e,n)}function gN(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=dM(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var _N=0;function vN(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function yN(){return++_N}var bN=sk.prototype;vN.prototype={constructor:vN,select:XM,selectAll:ZM,selectChild:bN.selectChild,selectChildren:bN.selectChildren,filter:UM,merge:WM,selection:$M,transition:hN,call:bN.call,nodes:bN.nodes,node:bN.node,size:bN.size,empty:bN.empty,each:bN.each,on:qM,attr:DM,attrTween:MM,style:aN,styleTween:cN,text:dN,textTween:mN,remove:YM,tween:vM,delay:FM,duration:RM,ease:BM,easeVarying:HM,end:gN,[Symbol.iterator]:bN[Symbol.iterator]};var xN={time:null,delay:0,duration:250,ease:Kj};function SN(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function CN(e){var t,n;e instanceof vN?(t=e._id,e=e._name):(t=yN(),(n=xN).time=Ij(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&lM(c,e,t,l,o,n||SN(c,t));return new vN(r,this._parents,e,t)}sk.prototype.interrupt=hM,sk.prototype.transition=CN;var wN=e=>()=>e;function TN(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function EN(e,t,n){this.k=e,this.x=t,this.y=n}EN.prototype={constructor:EN,scale:function(e){return e===1?this:new EN(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new EN(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 DN=new EN(1,0,0);ON.prototype=EN.prototype;function ON(e){for(;!e.__zoom;)if(!(e=e.parentNode))return DN;return e.__zoom}function kN(e){e.stopImmediatePropagation()}function AN(e){e.preventDefault(),e.stopImmediatePropagation()}function jN(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function MN(){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 NN(){return this.__zoom||DN}function PN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function FN(){return navigator.maxTouchPoints||`ontouchstart`in this}function IN(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function LN(){var e=jN,t=MN,n=IN,r=PN,i=FN,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Cj,l=aD(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,NN).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,NN),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(DN.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new EN(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new EN(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new EN(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=lk(this.that).datum();l.call(e,this.that,new TN(e,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=mk(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],mM(this),s.start();AN(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=lk(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=mk(t,i),l=t.clientX,u=t.clientY;yk(t.view),kN(t),a.mouse=[c,this.__zoom.invert(c)],mM(this),a.start();function d(e){if(AN(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=mk(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),bk(e.view,a.moved),AN(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=mk(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);AN(r),s>0?lk(this).transition().duration(s).call(x,d,c,r):lk(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(kN(t),s=0;s<i;++s)c=r[s],l=mk(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),mM(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(AN(e),s=0;s<a;++s)c=i[s],l=mk(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(kN(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=mk(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=lk(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:wN(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:wN(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:wN(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:wN([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var RN={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},zN=[[-1/0,-1/0],[1/0,1/0]],BN=[`Enter`,` `,`Escape`],VN={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},HN;(function(e){e.Strict=`strict`,e.Loose=`loose`})(HN||={});var UN;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(UN||={});var WN;(function(e){e.Partial=`partial`,e.Full=`full`})(WN||={});var GN={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},KN;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(KN||={});var qN;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(qN||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var JN={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top},YN=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,XN=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),ZN=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),QN=(e,t=[0,0])=>{let{width:n,height:r}=MP(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},$N=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):ZN(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,fP(e,gP(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?mP(r):{x:0,y:0,width:0,height:0}},eP=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=fP(n,gP(e)),r=!0)}),r?mP(n):{x:0,y:0,width:0,height:0}},tP=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=vP(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},nP=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function rP(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=MP(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function iP({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=kP(eP(rP(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function aP({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,RN.error005());else{let{width:e,height:t}=MP(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&jP(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=jP(d)?cP(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,RN.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function oP({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=nP(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var sP=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),cP=(e={x:0,y:0},t,n)=>({x:sP(e.x,t[0][0],t[1][0]-(n?.width??0)),y:sP(e.y,t[0][1],t[1][1]-(n?.height??0))});function lP(e,t,n){let{width:r,height:i}=MP(n),{x:a,y:o}=n.internals.positionAbsolute;return cP(e,[[a,o],[a+r,o+i]],t)}var uP=(e,t,n)=>e<t?sP(Math.abs(e-t),1,t)/t:e>n?-sP(Math.abs(e-n),1,t)/t:0,dP=(e,t,n=15,r=40)=>[uP(e.x,r,t.width-r)*n,uP(e.y,r,t.height-r)*n],fP=(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)}),pP=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),mP=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),hP=(e,t=[0,0])=>{let{x:n,y:r}=ZN(e)?e.internals.positionAbsolute:QN(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},gP=(e,t=[0,0])=>{let{x:n,y:r}=ZN(e)?e.internals.positionAbsolute:QN(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},_P=(e,t)=>mP(fP(pP(e),pP(t))),vP=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},yP=(e,t)=>vP(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),bP=e=>xP(e.width)&&xP(e.height)&&xP(e.x)&&xP(e.y),xP=e=>!isNaN(e)&&isFinite(e),SP=(e,t)=>(e,t)=>{},CP=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),wP=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?CP(s,o):s},TP=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function EP(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function DP(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=EP(e,n),i=EP(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=EP(e.top??e.y??0,n),i=EP(e.bottom??e.y??0,n),a=EP(e.left??e.x??0,t),o=EP(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function OP(e,t,n,r,i,a){let{x:o,y:s}=TP(e,[t,n,r]),{x:c,y:l}=TP({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var kP=(e,t,n,r,i,a)=>{let o=DP(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=sP(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=OP(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},AP=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function jP(e){return e!=null&&e!==`parent`}function MP(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function NP(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function PP(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function FP(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function IP(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function LP(e){return{...VN,...e||{}}}function RP(e){return e===null?null:e?`valid`:`invalid`}function zP(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=GP(e),s=wP({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?CP(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var BP=e=>({width:e.offsetWidth,height:e.offsetHeight}),VP=e=>e?.getRootNode?.()||window?.document,HP=[`INPUT`,`SELECT`,`TEXTAREA`];function UP(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?HP.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var WP=e=>`clientX`in e,GP=(e,t)=>{let n=WP(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},KP=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...BP(t)}})};function qP({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function JP(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function YP({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-JP(t-r,a),n];case $.Right:return[t+JP(r-t,a),n];case $.Top:return[t,n-JP(n-i,a)];case $.Bottom:return[t,n+JP(i-n,a)]}}function XP({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=YP({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=YP({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=qP({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function ZP({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function QP({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function $P({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=fP(gP(e),gP(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),yP({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},mP(a))>0}var eF=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,tF=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),nF=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,RN.error006()),t;let r=n.getEdgeId||eF,i;return i=YN(e)?{...e}:{...e,id:r(e)},tF(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function rF({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=ZP({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var iF={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},aF=({source:e,sourcePosition:t=$.Bottom,target:n})=>t===$.Left||t===$.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},oF=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),sF=(e,t,n)=>e.x===t.x&&t.x===n.x&&(t.y-e.y)*(n.y-t.y)>=0||e.y===t.y&&t.y===n.y&&(t.x-e.x)*(n.x-t.x)>=0;function cF({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=iF[t],c=iF[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=aF({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=ZP({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y},C=[];for(let t of[e,x,...m,S,n]){let[e,n]=C.slice(-2);n&&sF(e,n,t)&&C.pop(),C.push(t)}return[C,h,g,y,b]}function lF(e,t,n,r){let i=Math.min(oF(e,t)/2,oF(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function uF({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=cF({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=lF(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function dF(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function fF(e){let{sourceNode:t,targetNode:n}=e;if(!dF(t)||!dF(n))return null;let r=t.internals.handleBounds||pF(t.handles),i=n.internals.handleBounds||pF(n.handles),a=hF(r?.source??[],e.sourceHandle),o=hF(e.connectionMode===HN.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,RN.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=mF(t,a,s),u=mF(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function pF(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function mF(e,t,n=$.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??MP(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case $.Top:return{x:i+o/2,y:a};case $.Right:return{x:i+o,y:a+s/2};case $.Bottom:return{x:i+o/2,y:a+s};case $.Left:return{x:i,y:a+s/2}}}function hF(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function gF(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function _F(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=gF(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var vF=1e3,yF=10,bF={nodeOrigin:[0,0],nodeExtent:zN,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},xF={...bF,checkEquality:!0};function SF(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function CF(e,t,n){let r=SF(bF,n);for(let n of e.values())if(n.parentId)OF(n,e,t,r);else{let e=cP(QN(n,r.nodeOrigin),jP(n.extent)?n.extent:r.nodeExtent,MP(n));n.internals.positionAbsolute=e}}function wF(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function TF(e){return e===`manual`}function EF(e,t,n,r={}){let i=SF(xF,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!TF(i.zIndexMode)?vF:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=cP(QN(u,i.nodeOrigin),jP(u.extent)?u.extent:i.nodeExtent,MP(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:wF(u,e),z:kF(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}e.measured!==void 0&&e.measured.width!==void 0&&e.measured.height!==void 0||e.hidden||(c=!1),u.parentId&&OF(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function DF(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function OF(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=SF(bF,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}DF(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*yF),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=AF(e,u,o,s,a&&!TF(c)?vF:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function kF(e,t,n){let r=xP(e.zIndex)?e.zIndex:0;return TF(n)?r:r+(e.selected?t:0)}function AF(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=MP(e),l=QN(e,n),u=jP(e.extent)?cP(l,e.extent,c):l,d=cP({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=lP(d,c,t));let f=kF(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function jF(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=_P(a.get(n.parentId)?.expandedRect??hP(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=MP(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function MF(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=BP(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=jP(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=lP(h,s,n))}else m&&(h=cP(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:KP(`source`,r.nodeElement,p,d,e.id),target:KP(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&OF(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:hP(g,i)}))}}if(f.length>0){let e=jF(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function NF({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function PF(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function FF(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;PF(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),PF(`target`,s,c,e,i,o),t.set(r.id,r)}}function IF(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:IF(n,t):!1}function LF(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function RF(e,t,n,r,i){let a=new Map;for(let[o,s]of e)if((i?s.id===r:s.selected||s.id===r)&&(i||!s.parentId||!IF(s,e))&&(s.draggable||t&&s.draggable===void 0)){let t=e.get(o);t&&a.set(o,{id:o,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return a}function zF({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function BF({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=CP(a,t);return{x:o.x-a.x,y:o.y-a.y}}function VF({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=lk(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?pP(eP(s)):null,x=v&&l?BF({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:CP(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=aP({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=zF({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=dP(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0;let v=!!b&&!o&&!i.get(b)?.selected;m&&y||o||!b||i.get(b)?.selected||_(),y&&m&&b&&e?.(b);let x=zP(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=x,s=RF(i,c,x,b,v),s.size>0&&(n||h||!b&&g)){let[e,t]=zF({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=Dk().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=zP(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=GP(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=zP(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=GP(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=GP(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p)p&&s.size>0&&t().updateNodePositions(s,!1);else if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=zF({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!LF(t,`.${g}`,v))&&(!_||LF(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function HF(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())yP(i,hP(e))>0&&r.push(e);return r}var UF=250;function WF(e,t,n,r){let i=[],a=1/0,o=HF(e,n,t+UF);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=mF(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function GF(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...mF(o,c,c.position,!0)}:c}function KF(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function qF(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var JF=()=>!0;function YF(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=JF,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=VP(e.target),E=0,D,{x:O,y:k}=GP(e),A=KF(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=GF(i,A,r,c,t);if(!N)return;let P=GP(e,j),F=!1,I=null,L=!1,R=null;function z(){if(!u||!j)return;let[e,t]=dP(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(z)}let B={...N,nodeId:i,type:A,position:N.position},ee=c.get(i),V={inProgress:!0,isValid:null,from:mF(ee,B,$.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:ee,to:P,toHandle:null,toPosition:JN[B.position],toNode:null,pointer:P};function te(){M=!0,y(V),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&te();function ne(e){if(!M){let{x:t,y:n}=GP(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;te()}if(!x()||!B){H(e);return}let a=b();P=GP(e,j),D=WF(wP(P,a,!1,[1,1]),n,c,B),F||=(z(),!0);let s=XF(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});R=s.handleDomNode,I=s.connection,L=qF(!!D,s.isValid);let u=c.get(i),f=u?mF(u,B,$.Left,!0):V.from,p={...V,from:f,isValid:L,to:s.toHandle&&L?TP({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:JN[B.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),V=p}function H(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||R)&&I&&L&&h?.(I);let{inProgress:t,...n}=V,r={...n,toPosition:V.toHandle?V.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,R=null,T.removeEventListener(`mousemove`,ne),T.removeEventListener(`mouseup`,H),T.removeEventListener(`touchmove`,ne),T.removeEventListener(`touchend`,H)}}T.addEventListener(`mousemove`,ne),T.addEventListener(`mouseup`,H),T.addEventListener(`touchmove`,ne),T.addEventListener(`touchend`,H)}function XF(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=JF,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=GP(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=KF(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===HN.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=GF(t,e,a,u,n,!0)}return _}var ZF={onPointerDown:YF,isValid:XF};function QF({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=lk(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&AP()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=LN().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:mk}}var $F=e=>({x:e.x,y:e.y,zoom:e.k}),eI=({x:e,y:t,zoom:n})=>DN.translate(e,t).scale(n),tI=(e,t)=>e.target.closest(`.${t}`),nI=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),rI=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,iI=(e,t=0,n=rI,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},aI=e=>{let t=e.ctrlKey&&AP()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function oI({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(tI(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=mk(u),t=d*2**aI(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===UN.Vertical?0:u.deltaX*f,m=i===UN.Horizontal?0:u.deltaY*f;!AP()&&u.shiftKey&&i!==UN.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=$F(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function sI({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=tI(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function cI({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=$F(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function lI({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&nI(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,$F(a.transform))}}function uI({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&nI(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=$F(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function dI({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(tI(f,`${u}-flow__node`)||tI(f,`${u}-flow__edge`)||tI(f,`${u}-flow__selection`)||tI(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||tI(f,c)&&h||tI(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function fI({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]],f=typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t?.contentRect&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null;f?.observe(e);let p=LN().extent(()=>d).scaleExtent([t,n]).translateExtent(r),m=lk(e).call(p);b({x:i.x,y:i.y,zoom:sP(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let h=m.on(`wheel.zoom`),g=m.on(`dblclick.zoom`);p.wheelDelta(aI);async function _(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?lj:Cj).transform(iI(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function v({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:f,preventScrolling:_,zoomOnPinch:v,zoomOnScroll:y,zoomOnDoubleClick:b,panActivationKeyPressed:x=!1,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&p.on(`zoom`,null);let O=i&&!S&&!r;p.clickDistance(D?1/0:!xP(E)||E<0?0:E);let k=O?oI({zoomPanValues:l,noWheelClassName:e,d3Selection:m,d3Zoom:p,panOnScrollMode:d,panOnScrollSpeed:f,zoomOnPinch:v,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):sI({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:h});m.on(`wheel.zoom`,k,{passive:!1});let A=cI({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});p.on(`start`,A);let j=lI({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});p.on(`zoom`,j);let M=uI({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});p.on(`end`,M);let N=dI({panActivationKeyPressed:x,zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:y,panOnScroll:i,zoomOnDoubleClick:b,zoomOnPinch:v,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});p.filter(N),b?m.on(`dblclick.zoom`,g):m.on(`dblclick.zoom`,null)}function y(){p.on(`zoom`,null),f?.disconnect()}async function b(e,t,n){let r=eI(e),i=p?.constrain()(r,t,n);return i&&await _(i),i}async function x(e,t){let n=eI(e);return await _(n,t),n}function S(e){if(m){let t=eI(e),n=m.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&p?.transform(m,t,null,{sync:!0})}}function C(){let e=m?ON(m.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function w(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?lj:Cj).scaleTo(iI(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function T(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?lj:Cj).scaleBy(iI(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function E(e){p?.scaleExtent(e)}function D(e){p?.translateExtent(e)}function O(e){let t=!xP(e)||e<0?0:e;p?.clickDistance(t)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:C,scaleTo:w,scaleBy:T,setScaleExtent:E,setTranslateExtent:D,syncViewport:S,setClickDistance:O}}var pI;(function(e){e.Line=`line`,e.Handle=`handle`})(pI||={});function mI({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function hI(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function gI(e,t){return Math.max(0,t-e)}function _I(e,t){return Math.max(0,e-t)}function vI(e,t,n){return Math.max(0,t-e,e-n)}function yI(e,t){return e?!t:t}function bI(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=vI(E,h,g),j=vI(D,_,v);if(o){let e=0,t=0;c&&w<0?e=gI(y+w+O,o[0][0]):!c&&w>0&&(e=_I(y+E+O,o[1][0])),l&&T<0?t=gI(b+T+k,o[0][1]):!l&&T>0&&(t=_I(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=_I(y+w,s[0][0]):!c&&w<0&&(e=gI(y+E,s[1][0])),l&&T>0?t=_I(b+T,s[0][1]):!l&&T<0&&(t=gI(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=vI(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?_I(b+k+E/C,o[1][1])*C:gI(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?gI(b+E/C,s[1][1])*C:_I(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=vI(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?_I(y+D*C+O,o[1][0])/C:gI(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?gI(y+D*C,s[1][0])/C:_I(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(yI(c,l)?-w:w)/C:w=(yI(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var xI={width:0,height:0,x:0,y:0},SI={...xI,pointerX:0,pointerY:0,aspectRatio:1};function CI(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function wI({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=lk(e),o={controlDirection:hI(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...xI},h={...SI};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:hI(e)};let g,_=null,v=[],y,b,x,S=Dk().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=zP(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=jP(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=CI(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=zP(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:S,height:C}=m,w={},T=g.origin??s,{width:E,height:D,x:O,y:k}=bI(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,T,b,x),A=E!==S,j=D!==C,M=O!==u&&A,N=k!==f&&j;if(!M&&!N&&!A&&!j)return;let P={prevValues:{...m},startX:h.x,startY:h.y,childNodes:v.map(e=>({...e,position:{...e.position}}))};if((M||N||T[0]===1||T[1]===1)&&(w.x=M?O:m.x,w.y=N?k:m.y,m.x=w.x,m.y=w.y,v.length>0)){let e=O-u,t=k-f;for(let n of v)n.position={x:n.position.x-e+T[0]*(E-S),y:n.position.y-t+T[1]*(D-C)},l.push(n)}if((A||j)&&(w.width=A&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?E:m.width,w.height=j&&(!o.resizeDirection||o.resizeDirection===`vertical`)?D:m.height,m.width=w.width,m.height=w.height),y&&g.expandParent){let e=T[0]*(w.width??0);w.x&&w.x<e&&(m.x=e,h.x-=w.x-e);let t=T[1]*(w.height??0);w.y&&w.y<t&&(m.y=t,h.y-=w.y-t)}let F=mI({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)===!1?(m=P.prevValues,h.x=P.startX,h.y=P.startY,v.forEach((e,t)=>{e.position=P.childNodes[t].position})):(d?.(e,I),r(w,l))}).on(`end`,e=>{f?.(e,{...m}),i?.({...m})});a.call(S)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var TI=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},EI=e=>e?TI(e):TI,{useDebugValue:DI}=p.default,{useSyncExternalStoreWithSelector:OI}=pu.default,kI=e=>e;function AI(e,t=kI,n){let r=OI(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return DI(r),r}var jI=(e,t)=>{let n=EI(e),r=(e,r=t)=>AI(n,e,r);return Object.assign(r,n),r},MI=(e,t)=>e?jI(e,t):jI;function NI(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var PI=(0,p.createContext)(null),FI=PI.Provider,II=RN.error001(`react`);function LI(e,t){let n=(0,p.useContext)(PI);if(n===null)throw Error(II);return AI(n,e,t)}function RI(){let e=(0,p.useContext)(PI);if(e===null)throw Error(II);return(0,p.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var zI={display:`none`},BI={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},VI=`react-flow__node-desc`,HI=`react-flow__edge-desc`,UI=`react-flow__aria-live`,WI=e=>e.ariaLiveMessage,GI=e=>e.ariaLabelConfig;function KI({rfId:e}){let t=LI(WI);return(0,m.jsx)(`div`,{id:`${UI}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:BI,children:t})}function qI({rfId:e,disableKeyboardA11y:t}){let n=LI(GI);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{id:`${VI}-${e}`,style:zI,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,m.jsx)(`div`,{id:`${HI}-${e}`,style:zI,children:n[`edge.a11yDescription.default`]}),!t&&(0,m.jsx)(KI,{rfId:e})]})}var JI=(0,p.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,m.jsx)(`div`,{className:rD([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});JI.displayName=`Panel`;var YI=`https://reactflow.dev?utm_source=attribution`;function XI({proOptions:e,position:t=`bottom-right`}){return(0,p.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,m.jsx)(JI,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${YI}`,children:(0,m.jsx)(`a`,{href:YI,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var ZI=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},QI=e=>e.id;function $I(e,t){return NI(e.selectedNodes.map(QI),t.selectedNodes.map(QI))&&NI(e.selectedEdges.map(QI),t.selectedEdges.map(QI))}function eL({onSelectionChange:e}){let t=RI(),{selectedNodes:n,selectedEdges:r}=LI(ZI,$I);return(0,p.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var tL=e=>!!e.onSelectionChangeHandlers;function nL({onSelectionChange:e}){let t=LI(tL);return e||t?(0,m.jsx)(eL,{onSelectionChange:e}):null}var rL=[0,0],iL={x:0,y:0,zoom:1},aL=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],oL=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}),sL={translateExtent:zN,nodeOrigin:rL,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function cL(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=LI(oL,NI),l=RI();(0,p.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=sL,s()}),[]);let u=(0,p.useRef)(sL);return(0,p.useEffect)(()=>{for(let s of aL){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:LP(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},aL.map(t=>e[t])),null}function lL(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function uL(e){let[t,n]=(0,p.useState)(e===`system`?null:e);return(0,p.useEffect)(()=>{if(e!==`system`){n(e);return}let t=lL(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?lL()?.matches?`dark`:`light`:t}var dL=typeof document<`u`?document:null;function fL(e=null,t={target:dL,actInsideInputWithModifier:!0}){let[n,r]=(0,p.useState)(!1),i=(0,p.useRef)(!1),a=(0,p.useRef)(new Set([])),[o,s]=(0,p.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
49
+ `},G_=0,K_=[];function q_(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),i=p.useState(G_++)[0],a=p.useState(h_)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Gg([e.lockRef.current],(e.shards||[]).map(H_),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=p.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=B_(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=N_(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=N_(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return z_(h,t,e,h===`h`?s:c,!0)},[]),c=p.useCallback(function(e){var n=e;if(K_.length&&K_[K_.length-1]===a){var r=`deltaY`in n?V_(n):B_(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&U_(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(H_).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=p.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:J_(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=p.useCallback(function(e){n.current=B_(e),r.current=void 0},[]),d=p.useCallback(function(t){l(t.type,V_(t),t.target,s(t,e.lockRef.current))},[]),f=p.useCallback(function(t){l(t.type,B_(t),t.target,s(t,e.lockRef.current))},[]);p.useEffect(function(){return K_.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,O_),document.addEventListener(`touchmove`,c,O_),document.addEventListener(`touchstart`,u,O_),function(){K_=K_.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,O_),document.removeEventListener(`touchmove`,c,O_),document.removeEventListener(`touchstart`,u,O_)}},[]);var m=e.removeScrollBar,h=e.inert;return p.createElement(p.Fragment,null,h?p.createElement(a,{styles:W_(i)}):null,m?p.createElement(T_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function J_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Y_=a_(o_,q_),X_=p.forwardRef(function(e,t){return p.createElement(c_,Ug({},e,{ref:t,sideCar:Y_}))});X_.classNames=c_.classNames;var Z_=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Q_=new WeakMap,$_=new WeakMap,ev={},tv=0,nv=function(e){return e&&(e.host||nv(e.parentNode))},rv=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=nv(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},iv=function(e,t,n,r){var i=rv(t,Array.isArray(e)?e:[e]);ev[n]||(ev[n]=new WeakMap);var a=ev[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Q_.get(e)||0)+1,l=(a.get(e)||0)+1;Q_.set(e,c),a.set(e,l),o.push(e),c===1&&i&&$_.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),tv++,function(){o.forEach(function(e){var t=Q_.get(e)-1,i=a.get(e)-1;Q_.set(e,t),a.set(e,i),t||($_.has(e)||e.removeAttribute(r),$_.delete(e)),i||e.removeAttribute(n)}),tv--,tv||(Q_=new WeakMap,Q_=new WeakMap,$_=new WeakMap,ev={})}},av=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Z_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),iv(r,i,n,`aria-hidden`)):function(){return null}},ov=Object.defineProperty,sv=(e,t)=>ov(e,`name`,{value:t,configurable:!0}),cv=`Dialog`,[lv,uv]=Qm(cv),[dv,fv]=lv(cv),pv=sv(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=p.useRef(null),c=p.useRef(null),{nodes:l,registry:u}=fg(),[d,f]=mh({prop:r,defaultProp:i??!1,onChange:a,caller:cv}),[h,g]=p.useState(0),[_,v]=p.useState(0);return(0,m.jsx)(dv,{scope:t,triggerRef:s,contentRef:c,contentId:ah(),titleId:ah(),descriptionId:ah(),titlePresent:h>0,descriptionPresent:_>0,setTitleCount:g,setDescriptionCount:v,open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),mv=`DialogPortal`,[hv,gv]=lv(mv,{forceMount:void 0}),_v=sv(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=fv(mv,t);return(0,m.jsx)(hv,{scope:t,forceMount:n,children:p.Children.map(r,e=>(0,m.jsx)(Ag,{present:n||a.open,children:(0,m.jsx)(Eg,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),vv=`DialogOverlay`,yv=p.forwardRef(sv(function(e,t){let n=gv(vv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fv(vv,e.__scopeDialog);return a.modal?(0,m.jsx)(Ag,{present:r||a.open,children:(0,m.jsx)(xv,{...i,ref:t})}):null},`DialogOverlay`)),bv=xh(`DialogOverlay.RemoveScroll`),xv=p.forwardRef(sv(function(e,t){let{__scopeDialog:n,...r}=e,i=fv(vv,n),a=Jm(t,Qh());return(0,m.jsx)(X_,{as:bv,allowPinchZoom:!0,shards:p.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,m.jsx)(Rh.div,{"data-state":Ov(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Sv=`DialogContent`,Cv=p.forwardRef(sv(function(e,t){let n=gv(Sv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fv(Sv,e.__scopeDialog);return(0,m.jsx)(Ag,{present:r||a.open,children:a.modal?(0,m.jsx)(wv,{...i,ref:t}):(0,m.jsx)(Tv,{...i,ref:t})})},`DialogContent`)),wv=p.forwardRef(sv(function(e,t){let n=fv(Sv,e.__scopeDialog),r=p.useRef(null),i=Jm(t,n.contentRef,r);return p.useEffect(()=>{let e=r.current;if(e)return av(e)},[]),(0,m.jsx)(Ev,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:zm(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:zm(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:zm(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Tv=p.forwardRef(sv(function(e,t){let n=fv(Sv,e.__scopeDialog),r=p.useRef(!1),i=p.useRef(!1);return(0,m.jsx)(Ev,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Ev=p.forwardRef(sv(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=fv(Sv,n);return Vg(),(0,m.jsx)(dg,{registry:l.branchRegistry,children:(0,m.jsx)(lg,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,m.jsx)(Zh,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Dv(o,l.descriptionId):o,"data-state":Ov(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`));function Dv(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}sv(Dv,`concatAriaDescribedby`);function Ov(e){return e?`open`:`closed`}sv(Ov,`getState`);var kv=`[cmdk-group=""]`,Av=`[cmdk-group-items=""]`,jv=`[cmdk-group-heading=""]`,Mv=`[cmdk-item=""]`,Nv=`${Mv}:not([aria-disabled="true"])`,Pv=`cmdk-item-select`,Fv=`data-value`,Iv=(e,t,n)=>Fm(e,t,n),Lv=p.createContext(void 0),Rv=()=>p.useContext(Lv),zv=p.createContext(void 0),Bv=()=>p.useContext(zv),Vv=p.createContext(void 0),Hv=p.forwardRef((e,t)=>{let n=ny(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=ny(()=>new Set),i=ny(()=>new Map),a=ny(()=>new Map),o=ny(()=>new Set),s=ey(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=ah(),b=ah(),x=ah(),S=p.useRef(null),C=ay();ty(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),ty(()=>{C(6,A)},[]);let w=p.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=p.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??Iv;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Av);t?t.appendChild(e.parentElement===t?e:e.closest(`${Av} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Av} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${kv}[${Fv}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Fv);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(kv)?.querySelector(jv))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${Mv}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(Nv)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(Fv))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(Fv))}function F(e){let t=j()?.closest(kv),n;for(;t&&!n;)t=e>0?Qv(t,kv):$v(t,kv),n=t?.querySelector(Nv);n?w.setState(`value`,n.getAttribute(Fv)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return p.createElement(Rh.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:_&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(Pv);t.dispatchEvent(e)}}}}},p.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:cy},c),sy(e,e=>p.createElement(zv.Provider,{value:w},p.createElement(Lv.Provider,{value:T},e))))}),Uv=p.forwardRef((e,t)=>{let n=ah(),r=p.useRef(null),i=p.useContext(Vv),a=Rv(),o=ey(e),s=o.current?.forceMount??i?.forceMount;ty(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=iy(n,r,[e.value,e.children,r],e.keywords),l=Bv(),u=ry(e=>e.value&&e.value===c.current),d=ry(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);p.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(Pv,f),()=>t.removeEventListener(Pv,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return p.createElement(Rh.div,{ref:qm(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:f},e.children)}),Wv=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=ah(),s=p.useRef(null),c=p.useRef(null),l=ah(),u=Rv(),d=ry(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));ty(()=>u.group(o),[]),iy(o,s,[e.value,e.heading,c]);let f=p.useMemo(()=>({id:o,forceMount:i}),[i]);return p.createElement(Rh.div,{ref:qm(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&p.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),sy(e,e=>p.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},p.createElement(Vv.Provider,{value:f},e))))}),Gv=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=p.useRef(null),a=ry(e=>!e.search);return!n&&!a?null:p.createElement(Rh.div,{ref:qm(i,t),...r,"cmdk-separator":``,role:`separator`})}),Kv=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Bv(),o=ry(e=>e.search),s=ry(e=>e.selectedItemId),c=Rv();return p.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),p.createElement(Rh.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),qv=p.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=p.useRef(null),o=p.useRef(null),s=ry(e=>e.selectedItemId),c=Rv();return p.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),p.createElement(Rh.div,{ref:qm(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},sy(e,e=>p.createElement(`div`,{ref:qm(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Jv=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return p.createElement(pv,{open:n,onOpenChange:r},p.createElement(_v,{container:o},p.createElement(yv,{"cmdk-overlay":``,className:i}),p.createElement(Cv,{"aria-label":e.label,"cmdk-dialog":``,className:a},p.createElement(Hv,{ref:t,...s}))))}),Yv=p.forwardRef((e,t)=>ry(e=>e.filtered.count===0)?p.createElement(Rh.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Xv=p.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return p.createElement(Rh.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},sy(e,e=>p.createElement(`div`,{"aria-hidden":!0},e)))}),Zv=Object.assign(Hv,{List:qv,Item:Uv,Input:Kv,Group:Wv,Separator:Gv,Dialog:Jv,Empty:Yv,Loading:Xv});function Qv(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function $v(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ey(e){let t=p.useRef(e);return ty(()=>{t.current=e}),t}var ty=typeof window>`u`?p.useEffect:p.useLayoutEffect;function ny(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function ry(e){let t=Bv(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function iy(e,t,n,r=[]){let i=p.useRef(),a=Rv();return ty(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Fv,s),i.current=s}),i}var ay=()=>{let[e,t]=p.useState(),n=ny(()=>new Map);return ty(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function oy(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function sy({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(oy(t),{ref:t.ref},n(t.props.children)):n(t)}var cy={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function ly({...e}){return(0,m.jsx)(Nf,{"data-slot":`dialog`,...e})}function uy({...e}){return(0,m.jsx)(hf,{"data-slot":`dialog-portal`,...e})}function dy({className:e,...t}){return(0,m.jsx)(Dc,{"data-slot":`dialog-overlay`,className:J(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function fy({className:e,children:t,showCloseButton:n=!0,...r}){return(0,m.jsxs)(uy,{children:[(0,m.jsx)(dy,{}),(0,m.jsxs)(ff,{"data-slot":`dialog-content`,className:J(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,m.jsxs)(Oc,{"data-slot":`dialog-close`,render:(0,m.jsx)(Wi,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,m.jsx)(ht,{}),(0,m.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function py({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`dialog-header`,className:J(`flex flex-col gap-2`,e),...t})}function my({className:e,showCloseButton:t=!1,children:n,...r}){return(0,m.jsxs)(`div`,{"data-slot":`dialog-footer`,className:J(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,m.jsx)(Oc,{render:(0,m.jsx)(Wi,{variant:`outline`}),children:`Close`})]})}function hy({className:e,...t}){return(0,m.jsx)(Pf,{"data-slot":`dialog-title`,className:J(`cn-font-heading leading-none font-medium`,e),...t})}function gy({className:e,...t}){return(0,m.jsx)(kc,{"data-slot":`dialog-description`,className:J(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function _y({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:J(`group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var vy=Hi(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function yy({className:e,align:t=`inline-start`,...n}){return(0,m.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:J(vy({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}function by({className:e,...t}){return(0,m.jsx)(Zv,{"data-slot":`command`,className:J(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,e),...t})}function xy({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!1,...a}){return(0,m.jsxs)(ly,{...a,children:[(0,m.jsxs)(py,{className:`sr-only`,children:[(0,m.jsx)(hy,{children:e}),(0,m.jsx)(gy,{children:t})]}),(0,m.jsx)(fy,{className:J(`top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0`,r),showCloseButton:i,children:n})]})}function Sy({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,m.jsxs)(_y,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,m.jsx)(Zv.Input,{"data-slot":`command-input`,className:J(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,m.jsx)(yy,{children:(0,m.jsx)(mt,{className:`size-4 shrink-0 opacity-50`})})]})})}function Cy({className:e,...t}){return(0,m.jsx)(Zv.List,{"data-slot":`command-list`,className:J(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function wy({className:e,...t}){return(0,m.jsx)(Zv.Group,{"data-slot":`command-group`,className:J(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function Ty({className:e,children:t,...n}){return(0,m.jsxs)(Zv.Item,{"data-slot":`command-item`,className:J(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:**:[svg]:text-foreground`,e),...n,children:[t,(0,m.jsx)(yt,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}function Ey({className:e,...t}){return(0,m.jsx)(`kbd`,{"data-slot":`kbd`,className:J(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,e),...t})}function Dy(e,t){let n=t.trim().toLowerCase();return n===``?[...e]:e.filter(e=>[e.label,...e.keywords??[]].some(e=>e.toLowerCase().includes(n)))}function Oy(e,t){(0,p.useEffect)(()=>{if(!e)return;let n=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),t(e=>!e))};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t])}function ky({onOpen:e,className:t,label:n=`Search all consoles`}){return(0,m.jsxs)(`button`,{type:`button`,onClick:e,"aria-keyshortcuts":`Control+K Meta+K`,"aria-label":n,className:J(`flex h-[26px] items-center gap-2 rounded-[6px] px-2.5 text-[11px] font-medium text-dim transition-colors hover:bg-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60`,t),children:[(0,m.jsx)(mt,{className:`size-[13px]`}),(0,m.jsx)(`span`,{className:`hidden sm:inline`,children:`Search`}),(0,m.jsx)(Ey,{className:`mono hidden h-4 text-[9px] sm:inline-flex`,children:`⌘K`})]})}function Ay({className:e}){return(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:14,height:14,fill:`none`,"aria-hidden":!0,"data-agora-search-spinner":``,className:J(`animate-spin text-dim motion-reduce:animate-none`,e),children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,stroke:`currentColor`,strokeOpacity:.25,strokeWidth:1.8}),(0,m.jsx)(`path`,{d:`M14 8a6 6 0 0 0-6-6`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`})]})}function jy(){return(0,m.jsxs)(`div`,{"data-agora-search-skeleton":``,"aria-hidden":!0,className:`p-1`,children:[(0,m.jsx)(`div`,{className:`px-2 py-1.5 text-xs font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Searching consoles…`}),[.55,.4,.48].map(e=>(0,m.jsxs)(`div`,{className:`flex items-center gap-2.5 px-2 py-1.5`,children:[(0,m.jsx)(Gf,{className:`size-[18px] shrink-0 rounded-[5px] bg-fg/[0.08] motion-reduce:animate-none`}),(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,m.jsx)(Gf,{className:`h-3 rounded-sm bg-fg/[0.08] motion-reduce:animate-none`,style:{width:`${e*100}%`}}),(0,m.jsx)(Gf,{className:`h-2.5 rounded-sm bg-fg/[0.08] motion-reduce:animate-none`,style:{width:`${e*55}%`}})]})]},e))]})}function My({config:e,commands:t,open:n,onOpenChange:r,placeholder:i=`Search runs, payments, users…`}){let[a,o]=(0,p.useState)(``),[s,c]=(0,p.useState)([]),[l,u]=(0,p.useState)(`idle`),[d,f]=(0,p.useState)(0);(0,p.useEffect)(()=>{n||o(``)},[n]);let h=(0,p.useMemo)(()=>Dy(t??[],a),[t,a]),g=(0,p.useMemo)(()=>{let e=new Map;for(let t of h)e.set(t.group,[...e.get(t.group)??[],t]);return[...e.entries()]},[h]);(0,p.useEffect)(()=>{let t=a.trim();if(t===``||!e){c([]),u(`idle`);return}let n=new AbortController;u(`loading`);let r=setTimeout(()=>{bm(e,t,n.signal).then(e=>{n.signal.aborted||(c(e),u(`done`))},()=>{n.signal.aborted||(c([]),u(`error`))})},200);return()=>{clearTimeout(r),n.abort()}},[a,e,d]);let _=a.trim(),v=e!==void 0&&_!==``,y=v&&l===`loading`,b=y&&s.length>0,x=s.reduce((e,t)=>e+t.hits.length,0)+h.length,S=_!==``&&h.length===0&&s.length===0&&(!v||l===`done`),C=e?`Search all consoles`:`Search`,w=e=>{r(!1),window.location.assign(e)};return(0,m.jsx)(xy,{open:n,onOpenChange:r,title:C,description:e?`Search every console you can open`:`Jump to a page`,className:`sm:max-w-xl`,children:(0,m.jsxs)(by,{shouldFilter:!1,label:C,children:[(0,m.jsxs)(`div`,{className:`relative`,children:[(0,m.jsx)(Sy,{value:a,onValueChange:o,placeholder:i,"aria-label":C,className:`pr-7`}),y&&(0,m.jsx)(Ay,{className:`pointer-events-none absolute top-[calc(50%+2px)] right-3.5 -translate-y-1/2`})]}),(0,m.jsx)(`span`,{role:`status`,className:`sr-only`,children:y?`Searching…`:v&&l===`error`?`Search failed`:_===``?``:`${x} results`}),(0,m.jsxs)(Cy,{className:`max-h-[60vh]`,"aria-busy":y,children:[_===``&&h.length===0&&(0,m.jsx)(`p`,{className:`px-3 py-6 text-center text-[13px] text-dim`,children:`Type to search.`}),S&&(0,m.jsx)(`p`,{"data-agora-search-empty":``,className:`px-3 py-6 text-center text-[13px] text-dim`,children:`Nothing found.`}),g.map(([e,t])=>(0,m.jsx)(wy,{heading:(0,m.jsx)(`span`,{className:`uppercase tracking-[0.14em]`,children:e}),children:t.map(e=>(0,m.jsxs)(Ty,{value:`local:${e.id}`,onSelect:()=>{r(!1),e.onSelect()},children:[e.icon,(0,m.jsx)(`span`,{className:`truncate text-[13px] text-fg`,children:e.label}),e.hint&&(0,m.jsx)(`span`,{className:`ml-auto text-[11px] text-dim`,children:e.hint})]},e.id))},`local:${e}`)),y&&s.length===0&&(0,m.jsx)(jy,{}),s.map(e=>(0,m.jsx)(wy,{"data-stale":b?``:void 0,className:J(`transition-opacity duration-150 motion-reduce:transition-none`,b&&`opacity-50`),heading:(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5 uppercase tracking-[0.14em]`,children:[(0,m.jsx)(Rt,{icon:e.icon,accent:Lt(e.id,e.icon),size:18}),e.title]}),children:e.hits.map(t=>(0,m.jsx)(Ty,{value:`${e.id}:${t.href}`,onSelect:()=>w(t.href),children:(0,m.jsxs)(`a`,{href:t.href,tabIndex:-1,className:`flex min-w-0 flex-col`,onClick:e=>{e.preventDefault(),w(t.href)},children:[(0,m.jsx)(`span`,{className:`mono truncate text-[13px] text-fg`,children:t.title}),t.subtitle&&(0,m.jsx)(`span`,{className:`truncate text-[11px] text-dim`,children:t.subtitle})]})},t.href))},e.id)),v&&l===`error`&&(0,m.jsxs)(`p`,{"data-agora-search-error":``,className:`flex items-center justify-center gap-2 px-3 py-3 text-[12px] text-faint`,children:[`The other consoles didn't answer.`,(0,m.jsx)(`button`,{type:`button`,onClick:()=>f(e=>e+1),className:`rounded-sm text-dim underline underline-offset-2 hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60`,children:`Retry`})]})]})]})})}var Ny=p.createContext(void 0);function Py(e){let t=p.useContext(Ny);if(t===void 0&&!e)throw Error(ci(33));return t}var Fy=p.createContext(void 0);function Iy(e){let t=p.useContext(Fy);if(t===void 0&&!e)throw Error(ci(36));return t}var Ly=p.createContext(void 0);function Ry(e=!0){let t=p.useContext(Ly);if(t===void 0&&!e)throw Error(ci(25));return t}var zy=p.createContext(null);function By(e=`root`){let t=p.useContext(zy),n=p.useContext(Fy);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var Vy={visible:!0,ref:null};function Hy(){return Vy}function Uy(e,t,n=`root`){let r=By(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Hy)({label:e.label,children:e.children,render:e.render}),a=_i(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Wy(e){e.preventDefault()}function Gy(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=Iy(),u=Ry(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,m=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:h}=a.useState(`floatingTreeRoot`),g=a.useState(`open`),_=u!==void 0,v=!f&&g&&n?0:-1;return p.useMemo(()=>({id:r,role:`menuitem`,tabIndex:v,"aria-selected":m,onMouseDown:f?Wy:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&h.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&h.emit(`close`,{domEvent:e.nativeEvent,reason:sa})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,_&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||_&&!Oo&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!_||e.button===2)&&c.type===`regular-item`&&pi(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,v,r,h,i,a.context.allowMouseUpTriggerRef,o,s,u,_,c.type,m,f])}var Ky={type:`regular-item`};function qy(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=p.useRef(null),{getButtonProps:d,buttonRef:f}=mi({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),m=Gy({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),h=p.useCallback(e=>Jr(m,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[m,d,c]),g=_i(u,f);return p.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}var Jy=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Yy(){return p.useContext(Jy)}function Xy(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Yy(),u=p.useRef(-1),[d,f]=p.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),m=a??d,h=p.useRef(null),g=p.useCallback(e=>{let t=h.current;t&&s(t),h.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return X(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:g,index:m}}var Zy=p.createContext(void 0);function Qy(){let e=p.useContext(Zy);if(e===void 0)throw Error(ci(31));return e}var $y=p.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=p.useState(void 0),c=Mi(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,m.jsx)(Zy.Provider,{value:s,children:c})}),eb=p.forwardRef(function(e,t){let n=By()?.Group??$y;return(0,m.jsx)(n,{...e,ref:t})}),tb=p.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=$i(a),c=Qy();return X(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),Mi(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),nb=p.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=Iy(),f=Xy({guess:!0,label:a}),p=$i(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=qy({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Ky});return Mi(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),rb=p.forwardRef(function(e,t){let n=Uy(e,t);return n.visible?(0,m.jsx)(nb,{...e,ref:n.ref}):null}),ib=p.createContext(void 0);function ab(e){let t=p.useContext(ib);if(t===void 0&&!e)throw Error(ci(69));return t}var ob=p.createContext(void 0);function sb(){return p.useContext(ob)}function cb(e,t){let n=Ii(e.render);if(p.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function lb(e,t,n){let r=cb(e,t),i=r===t?void 0:r;return[r,p.useCallback(e=>n?.(e?i:void 0),[i,n])]}function ub(e,t,n){let r=Ii(e.render),i=p.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var db=p.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:h}=Iy(),g=sb(),{side:_,align:v}=Py(),y=ab(!0)!=null,b=l.useState(`open`),x=l.useState(`transitionStatus`),S=l.useState(`popupProps`),C=l.useState(`mounted`),w=l.useState(`instantType`),T=l.useState(`activeTriggerElement`),E=l.useState(`parent`),D=l.useState(`lastOpenChangeReason`),O=l.useState(`rootId`),k=l.useState(`floatingRootContext`),A=l.useState(`floatingTreeRoot`),j=l.useState(`closeDelay`),M=l.useState(`hoverEnabled`),N=l.useState(`disabled`),P=l.useState(`openMethod`),F=l.useState(`activeTriggerId`),I=l.useState(`listElement`),[L,R]=lb(e,u,d),z=ub(e,T,F),B=E.type===`menu`?g:void 0,ee=E.type===`context-menu`,V=s??E.type!==`menu`;s===void 0&&I&&E.type!==`menu`&&(V=()=>l.state.activeIndex===null&&I),to({open:b,ref:l.context.popupRef,onComplete(){b&&l.context.onOpenChangeComplete?.(!0)}}),p.useEffect(()=>{function e(e){l.setOpen(!1,ea(e.reason,e.domEvent))}return A.events.on(`close`,e),()=>{A.events.off(`close`,e)}},[A.events,l]),Ru(k,{enabled:M&&!N&&!ee&&E.type!==`menubar`,closeDelay:j});let te=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:ne,handleFocus:H}=(p.useContext(zy)?.useParentHandoff??pb)(l,E,b,f),re=Mi(`div`,e,{state:{transitionStatus:x,side:_,align:v,open:b,nested:E.type===`menu`,instant:w},ref:[t,l.context.popupRef,te,R],stateAttributesMapping:ts,props:[S,{id:L,...I?{role:`presentation`}:{role:`menu`,"aria-orientation":h===`horizontal`?`horizontal`:void 0,"aria-labelledby":z},onKeyDown(e){B?.onPopupKeyDown?.(e),y&&cf.has(e.key)&&e.stopPropagation()},onFocus:H},Ap(x),c,{"data-rootownerid":O}]}),U=E.type===void 0||ee;(T||E.type===`menubar`&&D!==`outside-press`)&&(U=!0);let ie=B?.getReturnElement??ne;return(0,m.jsx)(Al,{context:k,openInteractionType:P,modal:ee,disabled:!C,returnFocus:a??ie??U,explicitReturnFocus:a===void 0&&ie?!1:void 0,initialFocus:V,restoreFocus:!0,getInsideElements:E.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:E.type===`menubar`?void 0:A,previousFocusableElement:T,nextFocusableElement:E.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:re})}),fb={parentVirtualFocusRef:void 0,handleFocus:void 0};function pb(){return fb}var mb=p.forwardRef(function(e,t){let n=By()?.Popup??db;return(0,m.jsx)(n,{...e,ref:t})}),hb=p.createContext(void 0);function gb(){let e=p.useContext(hb);if(e===void 0)throw Error(ci(32));return e}var _b=p.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Iy();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,m.jsx)(hb.Provider,{value:n,children:(0,m.jsx)(fl,{ref:t,...r,portalOwnerRole:o})})});function vb(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Y(i),[,o]=p.useState(0),s=Vr(bb).current,c=Vr(yb).current,l=p.useRef(0),u=p.useRef(!0),d=p.useRef(null),f=p.useRef(null),h=Y(()=>{u.current||(u.current=!0,o(e=>e+1))}),g=Y((e,t)=>{c.set(e,t),h()}),_=Y(e=>{c.delete(e),h()}),v=Y(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function y(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Cb(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&wb(r,n)>0){t.disconnect(),h();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Sb(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let b=Y(()=>{let[e,t]=xb(c),n=v(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});y(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});X(()=>(!u.current&&d.current&&v(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,v]),X(()=>{u.current&&b()}),X(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let x=Y(e=>(s.add(e),()=>{s.delete(e)})),S=p.useMemo(()=>({register:g,unregister:_,subscribeMapChange:x,nextIndexRef:l}),[g,_,x,l]);return(0,m.jsx)(Jy.Provider,{value:S,children:t})}function yb(){return new Map}function bb(){return new Set}function xb(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>wb(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Sb(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Cb(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function wb(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Tb(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=p.useRef(null),o=p.useRef(null),s=eo(r);X(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),X(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var Eb=20;function Db(e,t,n,r){let[i,a]=p.useState(!1);X(()=>{if(!e||!t||n==null){a(!1);return}let r=fi(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Eb)},[e,t,n]),Ef(e&&(!t||i),r)}var Ob=p.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=al,style:v,...y}=e,{store:b,virtualFocus:x,syncHighlightedItem:S}=Iy(),C=gb(),w=Ry(!0),T=b.useState(`parent`),E=b.useState(`floatingRootContext`),D=b.useState(`floatingTreeRoot`),O=b.useState(`mounted`),k=b.useState(`open`),A=b.useState(`modal`),j=b.useState(`openMethod`),M=b.useState(`activeTriggerElement`),N=b.useState(`transitionStatus`),P=b.useState(`positionerElement`),F=b.useState(`instantType`),I=b.useState(`adaptiveOrigin`),L=b.useState(`lastOpenChangeReason`),R=b.useState(`floatingNodeId`),z=b.useState(`floatingParentNodeId`),B=E.useState(`domReferenceElement`),ee=n,V=c,te=l,ne=s,H=_;T.type===`context-menu`&&(ee=n??T.context?.anchor,ne??=`start`,!o&&ne!==`center`&&(te=e.alignOffset??2,V=e.sideOffset??-5));let re=o,U=ne;T.type===`menu`?(re??=`inline-end`,U??=`start`,H=e.collisionAvoidance??ol):T.type===`menubar`&&(re??=T.context.orientation===`vertical`?`inline-end`:`bottom`,U??=`start`);let ie=T.type===`context-menu`,W=Dp({anchor:ee,floatingRootContext:E,positionMethod:w?`fixed`:r,mounted:O,side:re,sideOffset:V,align:U,alignOffset:te,arrowPadding:ie?0:f,collisionBoundary:u,collisionPadding:d,sticky:h,nodeId:R,keepMounted:C,disableAnchorTracking:g,collisionAvoidance:H,shift:ie?{crossAxis:!(`side`in H&&H.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:D,adaptiveOrigin:I,lazyFlip:x?`placement`:!1});p.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===R&&b.set(`hoverEnabled`,!1),e.nodeId!==R&&e.parentNodeId===b.select(`floatingParentNodeId`)&&b.setOpen(!1,ea(ha)))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[b,D.events,R]),p.useEffect(()=>{if(b.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==b.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;b.setOpen(!1,ea(t))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[D.events,b]);let G=Ka();p.useEffect(()=>{k||G.clear()},[k,G]),p.useEffect(()=>{function e(e){if(k&&e.nodeId===b.select(`floatingParentNodeId`)){if(e.target&&M&&M!==e.target){let e=b.select(`closeDelay`);e>0?G.isStarted()||G.start(e,()=>{b.setOpen(!1,ea(ha))}):b.setOpen(!1,ea(ha))}else G.clear()}}return D.events.on(`itemhover`,e),()=>{D.events.off(`itemhover`,e)}},[D.events,k,M,b,G]),p.useEffect(()=>{let e={open:k,nodeId:R,parentNodeId:z,reason:b.select(`lastOpenChangeReason`)};D.events.emit(`menuopenchange`,e)},[D.events,k,b,R,z]),Tb({store:b,domReference:B,positionerElement:P,open:k});let ae={open:k,side:W.side,align:W.align,anchorHidden:W.anchorHidden,nested:T.type===`menu`,instant:F},oe=T.type===`menubar`&&T.context.modal;Db(k&&(oe||A&&L!==`trigger-hover`),j===`touch`,P,M);let se=jp(e,ae,{styles:W.positionerStyles,transitionStatus:N,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!O,inert:!k}),ce=O&&T.type!==`menu`&&(T.type!==`menubar`&&A&&L!==`trigger-hover`||T.type===`menubar`&&T.context.modal),le=null;return T.type===`menubar`?le=T.context.contentElement:T.type===void 0&&(le=M),(0,m.jsxs)(Ny.Provider,{value:W,children:[ce&&(0,m.jsx)(mf,{ref:T.type===`context-menu`||T.type===`nested-context-menu`?T.context.internalBackdropRef:null,inert:pf(!k),cutout:le}),(0,m.jsx)(bl,{id:R,children:(0,m.jsx)(vb,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,onMapChange:S,children:se})})]})}),kb=p.createContext(null);function Ab(e){let t=p.useContext(kb);if(t===null&&!e)throw Error(ci(5));return t}function jb(e){return e==null?na:e.type.startsWith(`key`)?fa:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?pa:na}var Mb={...ku,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=ku.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Ao&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!ku.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Nb=class extends bu{constructor(e,t,n=!1){let r=new eu,i=Fb(r,t,n,e);super(i,Pb(r),Mb),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Pb(e){return{positionerRef:p.createRef(),popupRef:p.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:p.createRef(),beforeTriggerFocusGuardRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Fb(e,t,n=!1,r){return{...Cu(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Oi,inputProps:Oi,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ml,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Oi,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Ib=p.createContext(null);function Lb(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Rb(e,t){return e===`list-navigation`||Lb(e,t)}var zb=lu(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:h,triggerId:g,defaultTriggerId:_=null,highlightItemOnHover:v=!0,isSubmenu:y=!1,virtualFocus:b=!1,virtualFocusRef:x,allowEscape:S=!0,resetOnPointerLeave:C=!0}=e,w=Ry(!0),T=Iy(!0),E=Ab(!0),D=T?.store,O=T?.virtualFocus??!1,k=p.useMemo(()=>y&&D?{type:`menu`,store:D}:E?{type:`menubar`,context:E}:w&&!D?{type:`context-menu`,context:w}:{type:void 0},[w,D,E,y]),A=$i(),j=$i(),[M,N]=p.useState(void 0),P=(M??j)||void 0,F=_l(),I=k.type===`menu`?k.store:void 0,L=(n??o)&&I?.state.transitionStatus===`starting`,R=Vr(()=>L?I?.state.instantType:void 0).current,z=Vr(()=>{let e=new Nb({open:o,openProp:n,activeTriggerId:_,triggerIdProp:g,parent:k,disabled:s,highlightItemOnHover:v,modal:k.type===void 0?c:void 0,rootId:A,instantType:R},P,F!=null);return e.context.virtualFocusRef=x,e}).current;z.useControlledProp(`openProp`,n),z.useControlledProp(`triggerIdProp`,g),z.useContextCallback(`onOpenChangeComplete`,i);let B=z.useState(`floatingTreeRoot`),ee=yl(B),V=z.useState(`open`),te=z.useState(`activeTriggerElement`),ne=z.useState(`positionerElement`),H=z.useState(`hoverEnabled`),re=z.useState(`disabled`),U=z.useState(`lastOpenChangeReason`),ie=z.useState(`parent`),W=z.useState(`activeIndex`),G=z.useState(`keyboardOpen`),ae=z.useState(`payload`),oe=z.useState(`floatingParentNodeId`),se=p.useRef(null),ce=p.useRef(ie.type!==`context-menu`),le=Ka(),ue=p.useRef(!0),de=Ka(),fe=oe!=null,{openMethod:pe,triggerProps:me}=Lf(V);z.useSyncedValues({disabled:s,highlightItemOnHover:v,modal:ie.type===void 0?c:void 0,openMethod:pe,rootId:A}),Xl(z);let{forceUnmount:he,transitionStatus:ge}=Zl(V,z,()=>{z.set(`allowMouseEnter`,!1)},L),_e=eo(z.context.popupRef);p.useEffect(()=>{if(R===void 0)return;let e=()=>{z.state.instantType===R&&z.set(`instantType`,void 0)};if(!V){e();return}if(ge!==void 0)return;if(z.context.popupRef.current==null){e();return}let t=new AbortController;return _e(e,t.signal),()=>{t.abort()}},[R,V,ge,_e,z]),X(()=>{w&&!T?z.update({parent:{type:`context-menu`,context:w},floatingNodeId:ee,floatingParentNodeId:F}):(T||!z.select(`activeTriggerElement`))&&z.update({floatingNodeId:ee,floatingParentNodeId:F})},[w,T,ee,F,te,z]),p.useEffect(()=>{V||(se.current=null),ie.type===`context-menu`&&(V?le.start(500,()=>{ce.current=!0}):(le.clear(),ce.current=!1))},[le,V,ie.type]),X(()=>{!V&&!H&&z.set(`hoverEnabled`,!0)},[V,H,z]);let ve=Y((e,t)=>{let n=t.reason;if(!e&&!z.select(`open`)||V===e&&t.trigger===te&&U===n)return;let i=ql(t);if(!e&&t.trigger==null&&(t.trigger=te??void 0),r?.(e,t),t.isCanceled)return;z.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!ue.current)return;e&&n===`trigger-focus`?(ue.current=!1,de.start(300,()=>{ue.current=!0})):(ue.current=!0,de.clear());let o=!e&&(n===`escape-key`||n==null);se.current=t.event;let s=Kl(z.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Rb(n,a),s.instantType=ie.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Lb(n,a)?`click`:o?`dismiss`:void 0,z.update(s)}),ye=Rl({popupStore:z,floatingRootContext:z.state.floatingRootContext,floatingId:P,nested:F!=null,onOpenChange:ve}),be=ye.context.events;X(()=>{let e=({open:e,eventDetails:t})=>ve(e,t);return be.on(`setOpen`,e),()=>{be?.off(`setOpen`,e)}},[be,ve]),X(()=>z.subscribeToParentMenu(),[z]);let xe=p.useCallback(()=>{z.setOpen(!1,ea(_a))},[z]);p.useImperativeHandle(d,()=>({unmount:he,close:xe}),[he,xe]);let Se;ie.type===`context-menu`&&(Se=ie.context),p.useImperativeHandle(Se?.positionerRef,()=>ne,[ne]),p.useImperativeHandle(Se?.actionsRef,()=>({setOpen:ve}),[ve]);let Ce=Ll(ye,{enabled:!re,bubbles:{escapeKey:f&&ie.type===`menu`},outsidePress(){return ie.type!==`context-menu`||se.current?.type===`contextmenu`||ce.current},externalTree:fe?B:void 0}),we=pp(),Te=qu(ye,{enabled:!re,listRef:z.context.itemDomElements,activeIndex:W,virtual:b,nested:ie.type===`menubar`||!b&&ie.type!==void 0,parentOrientation:ie.type===`menubar`?ie.context.orientation:void 0,loopFocus:l,focusItemOnOpen:b?G:void 0,allowEscape:b&&l&&S,orientation:u,triggerOrientation:b?`vertical`:u,rtl:we===`rtl`,disabledIndices:Di,onNavigate(e,t){z.setActiveIndex(e,jb(t),t?.nativeEvent)},openOnArrowKeyDown:ie.type!==`context-menu`&&!(b&&y),externalTree:!b&&fe?B:void 0,nestedReturnFocusRef:I?.context.virtualFocusRef,focusItemOnHover:v,resetOnPointerLeave:C}),Ee=p.useCallback(e=>{z.context.typingRef.current=e},[z]),De=Ju(ye,{enabled:!re&&!b,listRef:z.context.itemLabels,elementsRef:z.context.itemDomElements,activeIndex:W,resetMs:500,onMatch:(e,t)=>{V&&e!==W&&z.setActiveIndex(e,fa,t.nativeEvent)},onTyping:Ee}),Oe=Y(a),ke=p.useRef(-1),Ae=Y(()=>{let e=z.state.activeIndex,t=e===null?void 0:z.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(ke.current===n&&z.context.reportedItem===t)return;ke.current=n,z.context.reportedItem=t,b&&z.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=z.context;z.context.highlightReason=na,z.context.highlightEvent=void 0,a&&Oe(t,ta(r,i,{label:t===void 0?void 0:z.context.itemLabels.current[n]??void 0}))});X(()=>{Ae()},[W,Ae]);let je=p.useMemo(()=>{if(!b)return Te.reference;if(!Te.trigger)return Oi;let{onFocus:e,...t}=Te.trigger;return t},[b,Te.reference,Te.trigger]);z.useSyncedValue(`inputProps`,b?Te.reference??Oi:Oi);let Me=p.useMemo(()=>{let e=Jr(De.reference,je,Ce.reference,{onMouseMove(){z.set(`allowMouseEnter`,!0)}},me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=V,e},[z,De.reference,je,Ce.reference,me,V]),Ne=p.useMemo(()=>{let e=Jr(Te.trigger,Ce.trigger,me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Te.trigger,Ce.trigger,me]);Vr(()=>(z.update({inactiveTriggerProps:Ne}),null)),Ql(z,{floatingRootContext:ye,activeTriggerProps:Me,inactiveTriggerProps:Ne,popupProps:p.useMemo(()=>Jr(Bl,{onMouseMove(){z.set(`allowMouseEnter`,!0),ie.type===`menu`&&z.set(`hoverEnabled`,!1)},onClick(){z.select(`hoverEnabled`)&&z.set(`hoverEnabled`,!1)},onKeyDown(e){let t=z.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},De.floating,Te.floating,Ce.floating),[ie.type,z,De.floating,Te.floating,Ce.floating]),itemProps:Te.item??Oi});let Pe=p.useMemo(()=>({store:z,parent:k,orientation:u,loopFocus:l,allowEscape:S,defaultFloatingId:j,setRenderedFloatingId:N,virtualFocus:b,parentVirtualFocus:O,syncHighlightedItem:Ae}),[z,k,u,l,S,j,b,O,Ae]),Fe=typeof t==`function`?t({payload:ae}):t,Ie=(0,m.jsxs)(Fy.Provider,{value:Pe,children:[h&&(0,m.jsx)(Ul,{handle:h,store:z}),Fe]});return(ie.type===void 0||ie.type===`context-menu`)&&(Ie=(0,m.jsx)(xl,{externalTree:B,children:Ie})),Ie});function Bb(e){let t=p.useContext(Ib);if(t===null)return(0,m.jsx)(zb,{...e});let n=t.Root;return(0,m.jsx)(Ib.Provider,{value:null,children:(0,m.jsx)(n,{...t.options,...e})})}var Vb=5;function Hb(e,t){let n=Ub(t);return e.clientX>=n.left-Vb&&e.clientX<=n.right+Vb&&e.clientY>=n.top-Vb&&e.clientY<=n.bottom+Vb}function Ub(e){let t=e.getBoundingClientRect(),n=gr(e);if(Mo)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Wb(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=ui(),{ref:i,index:a}=Xy(e),o=n===a,s=p.useRef(null),c=_i(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Gb(e){let{render:t,className:n,style:r,state:i=Oi,props:a=Di,refs:o=Di,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Wb({metadata:s});return Mi(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function Kb(e){if(br(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Mr(e))return Kb(Fr(e))}function qb(e,t){function n(n,r,i){let a=n.currentTarget;Za.flushSync(()=>{e.setOpen(!1,ea(la,n.nativeEvent,a))}),yc(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&bc(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Jb(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=p.useRef(!1);return p.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,fi(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Oi,[t,n,r])}var Yb=uu(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...h}=e,g=Iy(!0),_=Au(d)??g?.store;if(!_)throw Error(ci(85));let v=$i(s),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`triggerControlsId`,v),C=p.useRef(null),w=Zb(),T=ui(!0),E=vl(),D=p.useMemo(()=>E??new ml,[E]),{registerTrigger:O,isMountedByThisTrigger:k}=Yl(v,C,_,{payload:f,closeDelay:u,parent:w,floatingTreeRoot:D,floatingNodeId:yl(D),floatingParentNodeId:_l(),keyboardEventRelay:T?.relayKeyboardEvent}),A=w.type===`menubar`,j=_.useState(`disabled`),M=a||j||A&&w.context.disabled,{getButtonProps:N,buttonRef:P}=mi({disabled:M,native:o});p.useEffect(()=>{!x&&w.type===void 0&&(_.context.allowMouseUpTriggerRef.current=!1)},[_,x,w.type]);let F=p.useRef(null),I=Ka(),L=Y(e=>{if(!F.current)return;I.clear(),_.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Z(F.current,t)||Z(_.select(`positionerElement`),t)||t===F.current||t!=null&&Kb(t)===_.select(`rootId`)||Hb(e,F.current)||D.events.emit(`close`,{domEvent:e,reason:ma})});p.useEffect(()=>{let e=fi(F.current);if(x&&_.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,L,{once:!0}),()=>{e.removeEventListener(`mouseup`,L)}},[x,L,_]);let R=A&&w.context.hasSubmenuOpen,z=Bu(b,{enabled:(c??R)&&!M&&(!A||R&&!k),handleClose:td({blockPointerEvents:!A}),mouseOnly:!0,move:!1,restMs:w.type===void 0?l:void 0,delay:{close:u},triggerElementRef:C,externalTree:D,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`}),B=Xb(x,_.select(`lastOpenChangeReason`)),ee=jl(b,{enabled:!M,event:x&&A?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0&&B}),V=Mu(b,{enabled:!M&&R}),te=Jb({open:x,enabled:A,mouseDownAction:`open`}),ne=p.useMemo(()=>Jr(V.reference,ee.reference),[V.reference,ee.reference]),H=_.useState(`triggerProps`,k),re=_.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:U,handleFocusTargetFocus:ie}=qb(_,C),W={disabled:M,open:x},G=[F,t,P,O,C],ae=[ne,z??Oi,H,{"aria-haspopup":`menu`,"aria-controls":S,id:v,onMouseDown:e=>{_.select(`open`)||(I.start(200,()=>{_.context.allowMouseUpTriggerRef.current=!0}),fi(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},re,A?{role:`menuitem`}:{},te,h,N],oe=Mi(`button`,e,{enabled:!A,stateAttributesMapping:$o,state:W,ref:G,props:ae});return A?(0,m.jsx)(Gb,{tag:`button`,render:n,className:r,style:i,state:W,refs:G,props:ae,stateAttributesMapping:$o}):x?(0,m.jsxs)(p.Fragment,{children:[(0,m.jsx)(Hc,{ref:_.context.beforeTriggerFocusGuardRef,onFocus:U},`${v}-pre-focus-guard`),(0,m.jsx)(p.Fragment,{children:oe},v),(0,m.jsx)(Hc,{ref:_.context.triggerFocusTargetRef,onFocus:ie},`${v}-post-focus-guard`)]}):(0,m.jsx)(p.Fragment,{children:oe},v)});function Xb(e,t){let n=Ka(),[r,i]=p.useState(!1);return X(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Zb(){let e=Ab(!0);return p.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function Qb({...e}){return(0,m.jsx)(Bb,{"data-slot":`dropdown-menu`,...e})}function $b({...e}){return(0,m.jsx)(Yb,{"data-slot":`dropdown-menu-trigger`,...e})}function ex({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,m.jsx)(_b,{children:(0,m.jsx)(Ob,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,m.jsx)(mb,{"data-slot":`dropdown-menu-content`,className:J(`cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function tx({...e}){return(0,m.jsx)(eb,{"data-slot":`dropdown-menu-group`,...e})}function nx({className:e,inset:t,...n}){return(0,m.jsx)(tb,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:J(`px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8`,e),...n})}function rx({className:e,inset:t,variant:n=`default`,...r}){return(0,m.jsx)(rb,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:J(`group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function ix({className:e,...t}){return(0,m.jsx)(wc,{"data-slot":`dropdown-menu-separator`,className:J(`-mx-1 my-1 h-px bg-border`,e),...t})}function ax({className:e,...t}){return(0,m.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:J(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,e),...t})}function ox(e){let[t,n]=(0,p.useState)([]);return(0,p.useEffect)(()=>{if(!e)return;let t=!0;return ym(e).then(e=>{t&&n(e)}),()=>{t=!1}},[e]),t}function sx({brand:e,current:t,config:n,onSearch:r}){let i=ox(n);return!n||i.length===0?(0,m.jsx)(m.Fragment,{children:e}):(0,m.jsx)(`div`,{"data-agora-switcher":``,className:`-mx-2 -mt-2 -mb-1.5 min-w-0`,children:(0,m.jsxs)(Qb,{children:[(0,m.jsxs)($b,{"aria-label":`${t.title}: switch console`,className:`flex w-full min-w-0 items-center gap-2.5 rounded-lg border border-transparent p-2 text-left outline-none transition-colors hover:border-border hover:bg-sidebar-accent/60 focus-visible:ring-2 focus-visible:ring-ring/60 data-popup-open:border-border data-popup-open:bg-sidebar-accent/60`,children:[(0,m.jsx)(`span`,{className:`min-w-0 flex-1`,children:e}),(0,m.jsx)(_t,{className:`size-3 shrink-0 text-faint`})]}),(0,m.jsxs)(ex,{align:`start`,className:`w-64 border border-border bg-popover shadow-(--agora-shadow) ring-0`,children:[(0,m.jsxs)(tx,{children:[(0,m.jsx)(nx,{className:`text-[10px] uppercase tracking-[0.16em] text-dim`,children:`Consoles`}),(0,m.jsxs)(rx,{disabled:!0,"aria-current":`page`,className:`data-disabled:opacity-100`,children:[(0,m.jsx)(Rt,{icon:t.icon,accent:`var(--agora-accent)`}),(0,m.jsx)(cx,{title:t.title,pkg:t.package}),(0,m.jsx)(yt,{"aria-label":`Current console`,className:`ml-auto text-brand`})]}),i.map(e=>(0,m.jsxs)(rx,{render:(0,m.jsx)(`a`,{href:e.href}),children:[(0,m.jsx)(Rt,{icon:e.icon,accent:Lt(e.id,e.icon)}),(0,m.jsx)(cx,{title:e.title,pkg:e.package})]},e.id))]}),r&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(ix,{}),(0,m.jsxs)(rx,{onClick:r,children:[(0,m.jsx)(mt,{className:`text-dim`}),`Search all consoles`,(0,m.jsx)(ax,{className:`mono`,children:`⌘K`})]})]})]})]})})}function cx({title:e,pkg:t}){return(0,m.jsxs)(`span`,{className:J(`flex min-w-0 flex-col leading-tight`),children:[(0,m.jsx)(`span`,{className:`truncate`,children:e}),t&&(0,m.jsx)(`span`,{className:`mono truncate text-[10px] text-dim`,children:t})]})}var lx=p.createContext(void 0);function ux(){let e=p.useContext(lx);if(e===void 0)throw Error(ci(13));return e}var dx={imageLoadingStatus:()=>null},fx=p.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=p.useState(`idle`),c={imageLoadingStatus:o},l=p.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=Mi(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:dx});return(0,m.jsx)(lx.Provider,{value:l,children:u})}),px=p.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=ux(),[c,l]=p.useState(i===0),u=Ka();return p.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),Mi(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:dx,enabled:s!==`loaded`&&(i===0||c)})});function mx({className:e,size:t=`default`,...n}){return(0,m.jsx)(fx,{"data-slot":`avatar`,"data-size":t,className:J(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function hx({className:e,...t}){return(0,m.jsx)(px,{"data-slot":`avatar-fallback`,className:J(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}function gx(e){let t=e.label.includes(`@`)?e.label.split(`@`)[0]??``:e.label,n=t.split(/[\s._-]+/).filter(Boolean);return(n.length>1?`${n[0]?.[0]??``}${n[1]?.[0]??``}`:t.slice(0,2)).toUpperCase()||`?`}function _x({viewer:e,signOut:t}){let{theme:n,toggle:r}=ft();return(0,m.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[e&&(0,m.jsxs)(`div`,{className:`flex items-center gap-[9px] px-2 py-1.5`,"data-agora-viewer":``,children:[(0,m.jsx)(mx,{className:`size-7 after:hidden`,children:(0,m.jsx)(hx,{className:`border border-brand-border bg-brand-soft text-[10.5px] font-semibold text-brand`,children:gx(e)})}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1 leading-[normal]`,children:[(0,m.jsx)(`div`,{className:`truncate text-[11px] font-medium text-fg`,title:e.email??e.label,children:e.label}),(e.role||e.email&&e.email!==e.label)&&(0,m.jsx)(`div`,{className:`mono truncate text-[9.5px] text-faint`,children:e.role??e.email})]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,m.jsxs)(Wi,{variant:`ghost`,size:`sm`,className:`flex-1 justify-start gap-2`,onClick:r,"aria-label":n===`dark`?`Switch to light mode`:`Switch to dark mode`,children:[n===`dark`?(0,m.jsx)(bt,{className:`size-[13px]`}):(0,m.jsx)(xt,{className:`size-[13px]`}),n===`dark`?`Light mode`:`Dark mode`]}),t&&(`action`in t?(0,m.jsxs)(`form`,{method:`post`,action:t.action,className:`contents`,children:[t.csrfToken&&(0,m.jsx)(`input`,{type:`hidden`,name:`_csrf`,value:t.csrfToken}),(0,m.jsx)(Wi,{type:`submit`,variant:`ghost`,size:`sm`,"aria-label":`Sign out`,title:`Sign out`,className:`text-dim`,children:(0,m.jsx)(St,{className:`size-[13px]`})})]}):(0,m.jsx)(Wi,{variant:`ghost`,size:`sm`,"aria-label":`Sign out`,title:`Sign out`,className:`text-dim`,nativeButton:!1,render:(0,m.jsx)(`a`,{href:t.href}),children:(0,m.jsx)(St,{className:`size-[13px]`})}))]})]})}function vx({brand:e}){return(0,m.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,m.jsxs)(`div`,{className:`relative grid size-[30px] shrink-0 place-items-center rounded-md border border-brand-border bg-brand-soft text-brand [&_svg]:size-4`,children:[e.mark,(0,m.jsx)(`span`,{className:`agora-ring`,"aria-hidden":!0})]}),(0,m.jsxs)(`div`,{className:`min-w-0 overflow-hidden`,children:[(0,m.jsx)(`div`,{className:`truncate text-sm leading-[normal] font-bold tracking-[0.03em] text-fg`,children:e.name}),e.subtitle&&(0,m.jsx)(`div`,{className:`mt-px truncate text-[10px] leading-[normal] font-medium uppercase tracking-[0.08em] text-faint`,children:e.subtitle})]})]})}function yx({nav:e,activeId:t}){let{isMobile:n,setOpenMobile:r}=qp(),i=(0,p.useCallback)(()=>{n&&r(!1)},[n,r]);return(0,m.jsx)(m.Fragment,{children:e.filter(e=>e.items.length>0).map(e=>e.collapsible?(0,m.jsx)(po,{defaultOpen:e.defaultOpen??!0,children:(0,m.jsxs)(tm,{className:`px-2.5 py-0`,children:[(0,m.jsxs)(nm,{className:J(bx,`p-0`),render:(0,m.jsx)(mo,{className:`flex w-full items-center gap-1 rounded-md px-2 pt-3 pb-[5px] text-left uppercase hover:text-dim`}),children:[e.section,(0,m.jsx)(_t,{className:`ml-auto size-3! -rotate-90 transition-transform in-data-panel-open:rotate-0`})]}),(0,m.jsx)(ho,{children:(0,m.jsx)(rm,{children:(0,m.jsx)(xx,{items:e.items,activeId:t,after:i})})})]})},e.section):(0,m.jsxs)(tm,{className:`px-2.5 py-0`,children:[(0,m.jsx)(nm,{className:bx,children:e.section}),(0,m.jsx)(rm,{children:(0,m.jsx)(xx,{items:e.items,activeId:t,after:i})})]},e.section))})}var bx=`h-auto px-2 pt-3 pb-[5px] text-[9.5px] leading-[normal] font-semibold uppercase tracking-[0.14em] text-faint`;function xx({items:e,activeId:t,after:n}){return(0,m.jsx)(im,{className:`gap-0`,children:e.map(e=>{let r=e.id===t,i=(0,m.jsxs)(m.Fragment,{children:[e.icon,(0,m.jsx)(`span`,{children:e.label})]});return(0,m.jsxs)(am,{children:[e.href?(0,m.jsx)(sm,{isActive:r,"aria-current":r?`page`:void 0,className:Sx,render:(0,m.jsx)(`a`,{href:e.href,onClick:t=>{e.onSelect&&(t.preventDefault(),e.onSelect()),n()}}),children:i}):(0,m.jsx)(sm,{isActive:r,"aria-current":r?`page`:void 0,className:Sx,onClick:()=>{e.onSelect?.(),n()},children:i}),e.badge!==void 0&&(0,m.jsx)(cm,{className:`mono tnum text-[10px]`,children:e.badge})]},e.id)})})}var Sx=`h-auto gap-[9px] rounded-md border border-transparent px-[9px] py-[7px] text-[12.5px] leading-[normal] font-medium text-dim transition-colors hover:bg-hover hover:text-fg data-active:border-brand-border data-active:bg-brand-soft data-active:font-medium data-active:text-fg [&_svg]:size-[15px]! [&_svg]:text-faint hover:[&_svg]:text-dim data-active:[&_svg]:text-brand`;function Cx({title:e,actions:t,search:n}){return(0,m.jsxs)(`header`,{className:`sticky top-0 z-20 flex h-(--agora-topbar-h) shrink-0 items-center gap-3 border-b border-border bg-(--agora-topbar) px-3 backdrop-blur-md md:px-5`,children:[(0,m.jsx)(Xp,{className:`-ml-1 text-dim md:hidden`}),(0,m.jsx)(`div`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:e}),(0,m.jsxs)(`div`,{className:`ml-auto flex min-w-0 items-center gap-2`,children:[t,n]})]})}function wx({brand:e,nav:t,activeId:n,shell:r,title:i,actions:a,children:o,searchPlaceholder:s,contentClassName:c,commands:l}){let[u,d]=(0,p.useState)(!1),f=r.search!==void 0||(l?.length??0)>0;Oy(f,d);let h=(0,p.useCallback)(()=>d(!0),[]);return(0,m.jsxs)(Ip,{delay:150,children:[(0,m.jsx)(`div`,{className:`agora-glow`,"aria-hidden":!0}),(0,m.jsxs)(Jp,{className:`relative z-[1] h-svh min-h-0 overflow-hidden`,style:{"--sidebar-width":`var(--agora-sidebar-w)`},children:[(0,m.jsxs)(Yp,{className:`border-sidebar-border [&_[data-slot=sidebar-inner]]:backdrop-blur-md`,children:[(0,m.jsx)(Qp,{className:`border-b border-sidebar-border px-[18px] pt-[18px] pb-3.5`,children:(0,m.jsx)(sx,{brand:(0,m.jsx)(vx,{brand:e}),current:e.current,config:r.switcher,...f?{onSearch:h}:{}})}),(0,m.jsx)(em,{className:`pt-2.5 pb-2`,children:(0,m.jsx)(`nav`,{"aria-label":`Console`,children:(0,m.jsx)(yx,{nav:t,activeId:n})})}),(0,m.jsx)($p,{className:`border-t border-sidebar-border px-3.5 py-3`,children:(0,m.jsx)(_x,{...r.viewer?{viewer:r.viewer}:{},...r.signOut?{signOut:r.signOut}:{}})})]}),(0,m.jsxs)(Zp,{className:`min-h-0 min-w-0 overflow-hidden bg-transparent`,children:[(0,m.jsx)(Cx,{title:i,actions:a,search:f?(0,m.jsx)(ky,{onOpen:h,label:r.search?`Search all consoles`:`Search`}):void 0}),(0,m.jsx)(`div`,{className:J(`relative min-h-0 flex-1 overflow-y-auto`,c),children:o})]})]}),f&&(0,m.jsx)(My,{config:r.search,commands:l,open:u,onOpenChange:d,...s?{placeholder:s}:{}})]})}function Tx({children:e,className:t}){return(0,m.jsx)(`div`,{className:J(`flex flex-col gap-4 px-4 pt-5 pb-16 md:px-6 md:pt-6`,t),children:e})}function Ex(e){return encodeURIComponent(String(e))}function Dx(e){let t=[];for(let[n,r]of Object.entries(e))if(r!=null){if(Array.isArray(r))for(let e of r)t.push(`${Ex(n)}[]=${Ex(e)}`);else if(typeof r==`object`)for(let[e,i]of Object.entries(r))i!=null&&t.push(`${Ex(n)}[${Ex(e)}]=${Ex(i)}`);else t.push(`${Ex(n)}=${Ex(r)}`)}return t.join(`&`)}function Ox(e){let t=[];return kx(e,`where`,t),t.join(`&`)}function kx(e,t,n){for(let r=0;r<e.length;r++){let i=e[r],a=`${t}[${r}]`;if(n.push(`${a}[field]=${Ex(i.field)}`),n.push(`${a}[operator]=${Ex(i.operator)}`),i.value!==void 0){if(Array.isArray(i.value))for(let e=0;e<i.value.length;e++)n.push(`${a}[value][${e}]=${Ex(i.value[e])}`);else n.push(`${a}[value]=${Ex(i.value)}`)}i.AND&&i.AND.length>0&&kx(i.AND,`${a}[AND]`,n),i.OR&&i.OR.length>0&&kx(i.OR,`${a}[OR]`,n)}}var Ax=[`equals`,`notEquals`,`contains`,`notContains`,`iContains`,`startsWith`,`endsWith`,`gt`,`gte`,`lt`,`lte`,`between`,`notBetween`,`in`,`notIn`,`isAnyOf`,`isEmpty`,`isNotEmpty`,`isNull`,`isNotNull`,`exists`,`notExists`],jx=[`equals`,`notEquals`,`gt`,`gte`,`lt`,`lte`],Mx=[`contains`,`notContains`,`iContains`,`startsWith`,`endsWith`],Nx=[`in`,`notIn`,`isAnyOf`],Px=[`between`,`notBetween`],Fx=[`isNull`,`isNotNull`,`isEmpty`,`isNotEmpty`,`exists`,`notExists`],Ix=[`gt`,`gte`,`lt`,`lte`],Lx=new Set(jx),Rx=new Set(Mx),zx=new Set(Nx),Bx=new Set(Px),Vx=new Set(Fx),Hx=new Set(Ix);function Ux(e,t){if(Vx.has(e)){if(t!=null)throw Error(`Operator "${e}" does not accept a value.`)}else if(Rx.has(e)){if(typeof t!=`string`)throw Error(`Operator "${e}" expects a string value.`)}else if(Bx.has(e)){if(!Array.isArray(t)||t.length!==2)throw Error(`Operator "${e}" expects [low, high] tuple.`)}else if(zx.has(e)){if(!Array.isArray(t))throw Error(`Operator "${e}" expects an array value.`)}else if(Lx.has(e)&&Array.isArray(t))throw Error(`Operator "${e}" expects a scalar value, not an array. Use "in" for arrays.`)}function Wx(e){if(!Hx.has(e))throw Error(`Operator "${e}" should use where() (replace), not add(). add() is for range operators (gt, gte, lt, lte) on the same field.`)}var Gx=class e{conditions=[];groups=[];extra={};includes=[];searchTerm;sorts=[];distinctFields=[];groupByCountSpec;pagination;cursor;version=0;snapshot=null;listeners=new Set;where(e,t,n){if(this.conditions=this.conditions.filter(t=>t.field!==e),n!==void 0){let r=t;Ux(r,n),this.conditions.push({field:e,operator:r,value:n})}else Array.isArray(t)?this.conditions.push({field:e,operator:`in`,value:t}):typeof t==`string`&&[`isNull`,`isNotNull`,`isEmpty`,`isNotEmpty`,`exists`,`notExists`].includes(t)?(Ux(t,void 0),this.conditions.push({field:e,operator:t,value:void 0})):this.conditions.push({field:e,operator:`equals`,value:t});return this.notify(),this}whereDynamic(e,t,n){if(!Ax.includes(t))throw Error(`Unknown filter operator "${String(t)}".`);return Ux(t,n),this.conditions=this.conditions.filter(t=>t.field!==e),this.conditions.push({field:e,operator:t,value:Vx.has(t)?void 0:n}),this.notify(),this}add(e,t,n){return Wx(t),Ux(t,n),this.conditions.push({field:e,operator:t,value:n}),this.notify(),this}remove(e){return this.conditions=this.conditions.filter(t=>t.field!==e),this.notify(),this}clear(){return this.conditions=[],this.groups.length=0,this.extra={},this.includes=[],this.searchTerm=void 0,this.sorts=[],this.distinctFields=[],this.groupByCountSpec=void 0,this.pagination=void 0,this.cursor=void 0,this.notify(),this}or(t){let n=new e;return t(n),this.groups.push({type:`OR`,conditions:n.conditions}),this.notify(),this}and(t){let n=new e;return t(n),this.groups.push({type:`AND`,conditions:n.conditions}),this.notify(),this}equals(e,t){return this.where(e,`equals`,t)}notEquals(e,t){return this.where(e,`notEquals`,t)}contains(e,t){return this.where(e,`contains`,t)}in(e,t){return this.where(e,`in`,t)}notIn(e,t){return this.where(e,`notIn`,t)}between(e,t,n){return this.where(e,`between`,[t,n])}gt(e,t){return this.where(e,`gt`,t)}gte(e,t){return this.where(e,`gte`,t)}lt(e,t){return this.where(e,`lt`,t)}lte(e,t){return this.where(e,`lte`,t)}isNull(e){return this.where(e,`isNull`)}isNotNull(e){return this.where(e,`isNotNull`)}isEmpty(e){return this.where(e,`isEmpty`)}isNotEmpty(e){return this.where(e,`isNotEmpty`)}startsWith(e,t){return this.where(e,`startsWith`,t)}endsWith(e,t){return this.where(e,`endsWith`,t)}addGte(e,t){return this.add(e,`gte`,t)}addLte(e,t){return this.add(e,`lte`,t)}addGt(e,t){return this.add(e,`gt`,t)}addLt(e,t){return this.add(e,`lt`,t)}set(e,t){return this.extra[e]=t,this.notify(),this}include(...e){for(let t of e)typeof t==`string`&&(this.includes.includes(t)||this.includes.push(t));return this.notify(),this}search(e){return typeof e==`string`&&(this.searchTerm=e,this.notify()),this}distinct(...e){for(let t of e)typeof t==`string`&&(this.distinctFields.includes(t)||this.distinctFields.push(t));return this.notify(),this}groupByCount(e,t={}){return typeof e==`string`&&e!==``&&(this.groupByCountSpec={field:e,...t.limit!==void 0&&{limit:t.limit},...t.offset!==void 0&&{offset:t.offset},...t.search!==void 0&&{search:t.search}}),this.notify(),this}sort(e,t=`asc`){return this.sorts=this.sorts.filter(t=>t.field!==e),this.sorts.push({field:e,direction:t}),this.notify(),this}sortDynamic(e,t=`asc`){return this.sort(e,t)}sortDesc(e){return this.sort(e,`desc`)}sortAsc(e){return this.sort(e,`asc`)}page(e,t=25){if(!Number.isInteger(e)||e<1)throw RangeError(`page must be an integer >= 1 (pages are 1-based), got ${e}`);if(!Number.isInteger(t)||t<1)throw RangeError(`size must be an integer >= 1, got ${t}`);return this.pagination={page:e,size:t},this.cursor=void 0,this.notify(),this}after(e){return this.setCursor(`after`,e),this}before(e){return this.setCursor(`before`,e),this}first(e){return this.setCursorSize(`first`,e),this}last(e){return this.setCursorSize(`last`,e),this}setCursor(e,t){if(typeof t!=`string`||t.length===0)throw TypeError(`${e} must be a non-empty cursor string, got ${String(t)}`);let{first:n,last:r}=this.cursor??{};this.cursor={[e]:t,...n!==void 0&&{first:n},...r!==void 0&&{last:r}},this.pagination=void 0,this.notify()}setCursorSize(e,t){if(!Number.isInteger(t)||t<1)throw RangeError(`${e} must be an integer >= 1, got ${t}`);let{after:n,before:r}=this.cursor??{};this.cursor={...n!==void 0&&{after:n},...r!==void 0&&{before:r},[e]:t},this.pagination=void 0,this.notify()}notify(){this.version++,this.snapshot=null;for(let e of this.listeners)e()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>(this.snapshot===null&&(this.snapshot=this.build()),this.snapshot);getVersion(){return this.version}build(){let e=[];for(let t of this.conditions)e.push({field:t.field,operator:t.operator,value:t.value});for(let t of this.groups){let n=t.conditions.map(e=>({field:e.field,operator:e.operator,value:e.value}));t.type===`OR`?e.push({field:``,operator:`equals`,value:void 0,OR:n}):e.push({field:``,operator:`equals`,value:void 0,AND:n})}let t={...this.extra,filter:{where:e}};return this.includes.length>0&&(t.include=[...this.includes]),this.searchTerm!==void 0&&(t.search=this.searchTerm),this.sorts.length>0&&(t.sort=[...this.sorts]),this.distinctFields.length>0&&(t.distinct=[...this.distinctFields]),this.groupByCountSpec!==void 0&&(t.groupByCount={...this.groupByCountSpec}),this.pagination!==void 0&&(t.paginate={...this.pagination}),this.cursor!==void 0&&Object.assign(t,this.cursor),t}toQueryString(){let e=[],t;if(this.groups.length===0){let e=this.toFlatObject();t=Dx(Object.fromEntries(Object.entries(e).map(([e,t])=>[`filter[${e}]`,t])))}else t=Ox(this.build().filter.where);if(t&&e.push(t),this.includes.length>0&&e.push(`include=${encodeURIComponent(this.includes.join(`,`))}`),this.searchTerm!==void 0&&e.push(`search=${encodeURIComponent(this.searchTerm)}`),this.sorts.length>0){let t=this.sorts.map(e=>e.direction===`desc`?`-${e.field}`:e.field).join(`,`);e.push(`sort=${encodeURIComponent(t)}`)}if(this.distinctFields.length>0&&e.push(`distinct=${encodeURIComponent(this.distinctFields.join(`,`))}`),this.groupByCountSpec!==void 0){let{field:t,limit:n,offset:r,search:i}=this.groupByCountSpec,a=[[`groupByCount[field]`,t]];n!==void 0&&a.push([`groupByCount[limit]`,n]),r!==void 0&&a.push([`groupByCount[offset]`,r]),i!==void 0&&a.push([`groupByCount[search]`,i]);let o=Dx(Object.fromEntries(a));o&&e.push(o)}if(this.pagination!==void 0&&(e.push(`page=${encodeURIComponent(String(this.pagination.page))}`),e.push(`size=${encodeURIComponent(String(this.pagination.size))}`)),this.cursor!==void 0)for(let t of[`after`,`before`,`first`,`last`]){let n=this.cursor[t];n!==void 0&&e.push(`${t}=${encodeURIComponent(String(n))}`)}let n=Dx(this.extra);return n&&e.push(n),e.join(`&`)}toFlatObject(){let e={};for(let t of this.conditions)if(t.operator===`equals`)e[t.field]=t.value;else if(t.operator===`in`)e[t.field]=t.value;else{let n=e[t.field];typeof n==`object`&&n&&!Array.isArray(n)?n[t.operator]=t.value:e[t.field]={[t.operator]:t.value}}return e}},Kx=new Set([`eq`,`ne`,`gt`,`gte`,`lt`,`lte`,`in`]);function qx(e,t,n){if(n!==void 0){if(Array.isArray(n)){if(n.length===0)return;e.where(t,n.length===1?n[0]:n)}else n!==``&&e.where(t,n)}}function Jx(e,t={},n){let r=new Gx;qx(r,`status`,e.status),qx(r,`workflow`,e.workflow),qx(r,`tag`,e.tag),qx(r,`namespace`,e.namespace),e.origin&&r.where(`origin`,e.origin);let i=[];for(let t of e.attr??[]){let[e,n,...r]=t.split(`:`);e&&Kx.has(n??``)&&r.length!==0&&i.push(t)}return i.length>0&&r.where(`attr`,i.length===1?i[0]:i),t.page!==void 0&&r.set(`page`,t.page),t.size!==void 0&&r.set(`size`,t.size),n&&r.groupByCount(n.field,{...n.limit!==void 0&&{limit:n.limit},...n.offset!==void 0&&{offset:n.offset},...n.search?.trim()&&{search:n.search.trim()}}),r.toQueryString()}function Yx(e){if(typeof e==`object`&&e&&`durationMs`in e){let t=e.durationMs;if(typeof t==`number`)return t}}function Xx(e){let t=new Map,n=[];for(let r of e){let e=r.subId??r.name??r.process;if(e===void 0){n.push(r);continue}let i=t.get(e),a=i??{id:e,name:r.name??e,phases:[],logs:[]};i||t.set(e,a),r.name!==void 0&&(a.name=r.name),r.group!==void 0&&(a.group=r.group),r.status===void 0?r.phase===void 0?a.logs.push(r):a.phases.push(r):(a.terminal=r,a.status=r.status)}return{subs:[...t.values()].map(e=>{let t=[...e.phases,...e.logs],n=[...t,...e.terminal?[e.terminal]:[]].map(e=>e.at),r=n.length?n.reduce((e,t)=>t<e?t:e,1/0):void 0,i=Yx(e.terminal?.data)??(e.terminal&&r!==void 0&&t.length>0?e.terminal.at-r:void 0);return{...e,startedAt:r,durationMs:i}}),stepLogs:n}}var Zx={kind:`all`};function Qx(e){return e?.trim()||void 0}function $x(e){return Qx(e)===void 0}function eS(e){let t=Qx(e);if(t===void 0)return`app`;let n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)||t}function tS(e,t){return e.kind===t.kind?e.kind===`origin`&&t.kind===`origin`?e.origin===t.origin:!0:!1}function nS(e){return e.kind===`origin`?`origin:${e.origin}`:e.kind}function rS(e,t){if(t.kind===`all`)return!0;let n=Qx(e.origin);return t.kind===`unknown`?n===void 0:n===t.origin}function iS(e,t){return t.kind===`all`?[...e]:e.filter(e=>rS(e,t))}var aS=`The app's own workflows: runs with no package origin, i.e. not declared by any library.`;function oS(e){let t=new Map,n=0;for(let r of e){let e=Qx(r.origin);e===void 0?n+=1:t.set(e,(t.get(e)??0)+1)}let r=[{filter:Zx,label:`all`,title:`Every origin, including runs that have none`,count:e.length}];for(let e of[...t.keys()].sort())r.push({filter:{kind:`origin`,origin:e},label:eS(e),title:e,count:t.get(e)??0});return n>0&&r.push({filter:{kind:`unknown`},label:`app`,title:aS,count:n}),r}function sS(e){return e.some(e=>Qx(e.origin)!==void 0)}function cS(e){return e.reduce((e,t)=>e+ +!!$x(t.origin),0)}function lS(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 ${eS(e.origin.origin)} match these filters.`,unclassified:e.unknownCount}:{message:`No runs match these filters.`}:{message:`No runs yet.`}}function uS(e){return e.startsWith(`compensate:`)?e.slice(11):e}function dS(e){let t=[],n=[];for(let r of e)r.seq<0?n.push(r):t.push(r);return n.sort((e,t)=>t.seq-e.seq),{body:t,compensations:n}}function fS(e){let t=0,n=0,r=0;for(let i of e)i.status===`completed`?t++:i.status===`failed`?n++:r++;return{total:e.length,done:t,failed:n,pending:r}}var pS=`update:`,mS=`task:`,hS=`child:`,gS=`runwait:`,_S=[`bp:`,`breakpoint`];function vS(e,t){let n=e.slice(t.length),r=n.indexOf(`:`);if(r===-1)return;let i=n.slice(r+1);return i.length>0?i:void 0}function yS(e){if(!_S.some(t=>e.startsWith(t))&&!(e.startsWith(hS)||e.startsWith(gS))){if(e.startsWith(pS)){let t=vS(e,pS);if(t!==void 0)return{kind:`update`,token:e,name:t}}if(e.startsWith(mS)){let t=vS(e,mS);if(t!==void 0)return{kind:`task`,token:e,name:t}}return{kind:`signal`,token:e}}}function bS(e,t){let n=[];for(let t of e)t.kind===`signal`&&(t.status===`pending`||t.status===`running`)&&n.push(t.name);n.length===0&&t&&(t.on===`signal`||t.on===`webhook`)&&n.push(t.name);let r=new Set,i=[];for(let e of n){if(r.has(e))continue;r.add(e);let t=yS(e);t&&i.push(t)}return i}function xS(){if(typeof window>`u`)return;let e=new URLSearchParams(window.location.search).get(`tenant`);return e&&e!==`*`?e:void 0}function SS(e){let t=xS();return t===void 0?e:`${e}${e.includes(`?`)?`&`:`?`}tenant=${encodeURIComponent(t)}`}var CS=6e5;function wS(e,t){return e.kind!==`remote`||e.status!==`pending`?!1:t-(e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime())>CS}function TS(e){return e===`running`||e===`suspended`||e===`cancelling`}var ES=new Set([`running`,`suspended`,`blocked`,`cancelling`]),DS=`durable:singleton:admitted`;function OS(e){let t=e.lastIndexOf(`@`);return t===-1?e:e.slice(0,t)}function kS(e,t){let n=OS(e),r=t.filter(e=>OS(e.group)===n),i=r.some(e=>e.depth>0),a=r.some(e=>e.liveWorkers.length>0);return i&&!a}function AS(e){return e.startsWith(`wh:`)?`webhook ${e}`:e.startsWith(`child:`)?`child ${e.slice(6)}`:`signal ${e}`}function jS(e,t){let n=e.tags?.find(e=>e.startsWith(`singleton:`));if(!n||e.tags?.includes(DS))return;let r=t.filter(e=>ES.has(e.status)&&e.tags?.includes(n)).sort((e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id));return r.find(e=>e.tags?.includes(DS))??r[0]}function MS(e){return`${e.on} ${e.name}`}function NS(e,t){if(e.status!==`suspended`)return e.status===`pending`&&kS(e.workflow,t.health)?{status:`no-worker`,detail:e.workflow}:e.status===`blocked`?{status:`blocked`,detail:e.error?.message??e.workflow}:{status:e.status};let n=jS(e,t.runs);if(n&&n.id!==e.id)return{status:`queued`,detail:`behind leader ${n.id.slice(0,8)}`};let r=t.timeline?.find(e=>e.status===`pending`||e.status===`running`);if(r){if(r.name.startsWith(`signal:child:${e.id}.onError.`)){let e=r.input?.workflow;return{status:`awaiting`,detail:typeof e==`string`?`failure handler ${e}`:`failure handler`}}return r.kind===`signal`?{status:`awaiting`,detail:AS(r.name)}:r.kind===`sleep`?{status:`sleeping`}:r.workerGroup&&kS(r.workerGroup,t.health)?{status:`no-worker`,detail:OS(r.workerGroup)}:{status:`running`}}return e.waiting?{status:`awaiting`,detail:MS(e.waiting)}:kS(e.workflow,t.health)?{status:`no-worker`,detail:e.workflow}:t.timeline?{status:`suspended`}:{status:`running`}}function PS(e,t){return e.status===`suspended`?t?.some(e=>e.status===`pending`||e.status===`running`)?`running`:e.wakeAt==null?t?`awaiting`:`running`:`sleeping`:e.status}var FS=`durable-dashboard-config`;function IS(){if(typeof document>`u`)return{};let e=document.getElementById(FS);if(e===null)return{};try{let t=JSON.parse(e.textContent??``);return typeof t==`object`&&t?t:{}}catch{return{}}}function LS(){let e=IS().base;return typeof e==`string`?e:`/durable`}function RS(){let e=IS().api;return typeof e==`string`?e:`${LS()}/api`}async function zS(e){try{let t=await e.json();if(typeof t!=`object`||!t)return;let n=t.redirectTo;return typeof n==`string`&&n!==``?n:void 0}catch{return}}function BS(e){typeof window<`u`&&(window.location.href=e??(LS()||`/`))}function VS(){if(typeof document>`u`)return{};let e=/(?:^|;\s*)XSRF-TOKEN=([^;]*)/.exec(document.cookie)?.[1];return e?{"x-xsrf-token":decodeURIComponent(e)}:{}}var HS=`The server redirected this request instead of answering it, usually because the session or its CSRF token expired. Reload the page and try again.`;async function US(e,t){let n=(t?.method??`GET`).toUpperCase(),r=n!==`GET`&&n!==`HEAD`,i=await fetch(RS()+SS(e),{...t,...r?{headers:{...t?.headers,...VS()},redirect:`manual`}:{}});if(i.status===401)throw BS(await zS(i)),Error(`Not signed in; redirecting.`);if(i.type===`opaqueredirect`||i.redirected||i.status>=300&&i.status<400)throw new GS(i.status,HS,void 0);return i}async function WS(e,t){let n=await US(e,t);if(!n.ok)throw await JS(n);return await n.json()}var GS=class extends Error{status;body;constructor(e,t,n){super(t),this.status=e,this.body=n,this.name=`DurableActionError`}};function KS(e){if(!(e instanceof GS)||typeof e.body!=`object`||e.body===null)return;let t=e.body.waitingOn;if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}async function qS(e,t){let n=await US(e,t);if(!n.ok)throw await JS(n);return await n.json()}async function JS(e){let t;try{t=await e.json()}catch{t=void 0}let n=typeof t==`object`&&t&&typeof t.error==`string`?t.error:`${e.status} ${e.statusText}`;return new GS(e.status,n,t)}function YS(e,t){return qS(e,{method:`POST`,...t===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}})}var XS={async runs(e,t,n,r){let{data:i}=await XS.runsPage(e,t,n,r);return i},async runsPage(e,t,n,r,i){let a=Jx({status:e,tag:t,attr:n,...r},i??{}),o=await WS(a?`/runs?${a}`:`/runs`);return{data:o.data,meta:o.meta}},async values(e,t={},n){return WS(`/runs/values?${Jx(t,{},{field:e,...n})}`)},run(e){return WS(`/runs/${encodeURIComponent(e)}`)},fanMembers(e,t,n={}){let r=new Gx;n.failed&&r.where(`status`,`failed`),(n.page!==void 0||n.size!==void 0)&&r.page(n.page??1,n.size??100);let i=r.toQueryString(),a=`/runs/${encodeURIComponent(e)}/fans/${encodeURIComponent(t)}`;return WS(i?`${a}?${i}`:a)},async workers(){return(await WS(`/workers`)).data},topology(){return WS(`/topology`)},tenants(){return WS(`/tenants`)},selectTenant(e){return WS(`/tenants/${encodeURIComponent(e)}/select`,{method:`POST`})},compat(){return WS(`/compat`)},async retry(e){return(await WS(`/runs/${encodeURIComponent(e)}/retry`,{method:`POST`})).result},async retryWithInput(e,t){return(await WS(`/runs/${encodeURIComponent(e)}/retry-with-input`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({input:t})})).result},bulk(e,t){let{compensate:n,...r}=t,i=Jx(r),a=n?`${i?`${i}&`:``}compensate=true`:i;return WS(`/bulk/${e}${a?`?${a}`:``}`,{method:`POST`})},async cancel(e,t){let n=t?.compensate?`?compensate=true`:``;return(await WS(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:`POST`})).result},async continue(e){return(await WS(`/runs/${encodeURIComponent(e)}/continue`,{method:`POST`})).result},workflowLifecycle(e){return WS(`/workflows/${encodeURIComponent(e)}/lifecycle`)},async republishLifecycle(e,t){return(await WS(`/runs/${encodeURIComponent(e)}/republish-lifecycle`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t===void 0?{}:{subscriber:t})})).result},async redispatch(e){return(await WS(`/runs/${encodeURIComponent(e)}/redispatch`,{method:`POST`})).result},async signal(e,t,n,r){return(await YS(`/runs/${encodeURIComponent(e)}/signal`,{token:t,payload:n,...r?.force?{force:!0}:{}})).result},async update(e,t,n){return(await YS(`/runs/${encodeURIComponent(e)}/updates/${encodeURIComponent(t)}`,{arg:n})).result},completeTask(e,t,n){return YS(`/runs/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}/complete`,{result:n})},failTask(e,t,n){return YS(`/runs/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}/fail`,{error:n})},async schedules(){let e=[];for(let t=1;;t+=1){let n=await WS(`/schedules?${new Gx().page(t,200).toQueryString()}`);if(e.push(...n.data),n.meta.currentPage>=n.meta.lastPage)return e}},setSchedulePaused(e,t){return YS(`/schedules/${encodeURIComponent(e)}/${t?`pause`:`resume`}`)},async triggerSchedule(e){return(await YS(`/schedules/${encodeURIComponent(e)}/trigger`)).result},streamRun(e,t){if(typeof EventSource>`u`)return()=>{};let n=new EventSource(`${RS()}${SS(`/runs/${encodeURIComponent(e)}/stream`)}`);return n.onmessage=e=>{try{t(JSON.parse(e.data))}catch{}},()=>n.close()}};function ZS({title:e,description:t,actions:n,className:r}){return(0,m.jsxs)(`div`,{className:J(`flex flex-wrap items-end justify-between gap-3`,r),children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`h1`,{className:`text-lg font-bold tracking-[0.01em] text-fg`,children:e}),t&&(0,m.jsx)(`p`,{className:`mt-1 text-xs text-faint`,children:t})]}),n&&(0,m.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:n})]})}function QS({children:e,className:t,label:n=`toolbar`}){return(0,m.jsx)(`div`,{role:`toolbar`,"aria-label":n,className:J(`flex flex-wrap items-center gap-1.5`,t),children:e})}function $S({className:e,size:t=`default`,...n}){return(0,m.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:J(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function eC({title:e,description:t,action:n,children:r,flush:i,className:a,bodyClassName:o}){return(0,m.jsxs)($S,{className:J(`agora-surface agora-rise rounded-lg border border-border shadow-none ring-0 gap-0 py-0`,a),children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b border-border px-4 py-3`,children:[(0,m.jsx)(`h3`,{className:`text-[12.5px] font-semibold tracking-[0.02em] text-fg`,children:e}),(t||n)&&(0,m.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[t&&(0,m.jsx)(`span`,{className:`mono truncate text-[10.5px] text-faint`,children:t}),n]})]}),(0,m.jsx)(`div`,{className:J(i?``:`px-4 pt-3 pb-4`,o),children:r})]})}var tC=Hi(`group/badge inline-flex h-[18px] w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 font-mono text-[10px] font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`border-bad/22 bg-bad/12 text-bad`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`,brand:`border-brand-border bg-brand-soft text-brand`,good:`border-good/22 bg-good/12 text-good`,warn:`border-warn/22 bg-warn/12 text-warn`,info:`border-info/22 bg-info/12 text-info`,violet:`border-violet/22 bg-violet/12 text-violet`,teal:`border-teal/22 bg-teal/12 text-teal`,neutral:`border-border bg-hover text-dim`,bare:`h-auto rounded-none border-transparent px-0 uppercase tracking-wider`}},defaultVariants:{variant:`default`}});function nC({className:e,variant:t=`default`,render:n,...r}){return go({defaultTagName:`span`,props:Jr({className:J(tC({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function rC(e){return`#/workflow/${encodeURIComponent(e)}`}function iC(e){let t=e.match(/^#\/workflow\/(.+)$/);return t?.[1]?decodeURIComponent(t[1]):void 0}function aC(e){let t=[];return e.where&&t.push(`where`),e.input&&t.push(`input`),e.coalesce&&t.push(e.coalesce.keyed?`${e.coalesce.mode} by key`:e.coalesce.mode),e.local||t.push(`announced`),t}function oC(e,t){let n=e?.[t];if(n)return n.failed>0?`${n.triggered} started · ${n.failed} failed`:`${n.triggered} started`}function sC({title:e,empty:t,links:n,counts:r}){return(0,m.jsxs)(`section`,{"aria-label":e,className:`min-w-0`,children:[(0,m.jsx)(`h3`,{className:`text-[10px] uppercase tracking-wider text-dim`,children:e}),n.length===0?(0,m.jsx)(`p`,{className:`mt-1 text-[11px] text-faint`,children:t}):(0,m.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1`,children:n.map(e=>(0,m.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,m.jsx)(`a`,{href:rC(e.workflow),className:`mono text-[12px] text-fg underline-offset-2 hover:underline`,children:e.workflow}),(0,m.jsxs)(nC,{variant:`neutral`,className:e.kind===`failed`?`s-failed`:`s-completed`,children:[`on `,e.kind]}),aC(e).map(e=>(0,m.jsx)(nC,{variant:`neutral`,children:e},e)),oC(r,e.workflow)&&(0,m.jsx)(`span`,{className:`mono text-[10px] ${r?.[e.workflow]?.failed?`text-bad`:`text-dim`}`,title:`Counted by this dashboard's server process since it started`,children:oC(r,e.workflow)})]},`${e.workflow}:${e.kind}`))})]})}function cC({links:e,counts:t}){return(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-6`,children:[(0,m.jsx)(sC,{title:`Starts when it settles`,empty:`No workflow starts when it settles.`,links:e.startsOnSettle,counts:t}),(0,m.jsx)(sC,{title:`Started by`,empty:`No workflow's settling starts it.`,links:e.startedBy})]})}function lC({workflow:e}){let{data:t,error:n,isPending:r}=Qe({queryKey:[`workflow-lifecycle`,e],queryFn:()=>XS.workflowLifecycle(e),refetchInterval:1e4});return(0,m.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,m.jsx)(ZS,{title:(0,m.jsx)(`span`,{className:`mono`,children:e}),description:`Lifecycle events: registered here and announced by live workers.`}),(0,m.jsx)(eC,{title:`Lifecycle`,description:`who starts when it settles, and who starts it`,children:n?(0,m.jsx)(Ki,{title:`Lifecycle could not be loaded`,error:n}):r||!t?(0,m.jsxs)(`div`,{className:`flex flex-col gap-2`,"aria-hidden":!0,children:[(0,m.jsx)(Gf,{className:`h-3 w-48`}),(0,m.jsx)(Gf,{className:`h-3 w-64`}),(0,m.jsx)(Gf,{className:`h-3 w-40`})]}):(0,m.jsx)(cC,{links:t,counts:t.triggerCounts})})]})}function uC(e){let t=e.match(/^#\/run\/(.+)$/)?.[1];if(t)return{page:`runs`,runId:decodeURIComponent(t)};let n=iC(e);return n===void 0?e===`#/workers`?{page:`workers`}:e===`#/schedules`?{page:`schedules`}:{page:`runs`}:{page:`workflow`,workflow:n}}function dC(e){switch(e.page){case`runs`:return e.runId?`#/run/${encodeURIComponent(e.runId)}`:``;case`workflow`:return rC(e.workflow);default:return`#/${e.page}`}}function fC(){return typeof window>`u`?{page:`runs`}:uC(window.location.hash)}function pC(e){if(typeof window>`u`)return;let t=dC(e);if(window.location.hash===t)return;let n=t||window.location.pathname+window.location.search;window.history.pushState(null,``,n)}function mC({className:e}){return(0,m.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,className:e,role:`img`,"aria-label":`durable`,children:[(0,m.jsx)(`title`,{children:`durable`}),(0,m.jsx)(`path`,{d:`M12 2.5 21.5 12 12 21.5 2.5 12z`,opacity:.35}),(0,m.jsx)(`circle`,{cx:`6.4`,cy:`12`,r:`1.7`,fill:`currentColor`,stroke:`none`}),(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.7`,fill:`currentColor`,stroke:`none`}),(0,m.jsx)(`circle`,{cx:`17.6`,cy:`12`,r:`1.7`,fill:`currentColor`,stroke:`none`}),(0,m.jsx)(`path`,{d:`M8.1 12h2.2M13.7 12h2.2`})]})}var hC=[`pending`,`running`,`suspended`,`blocked`,`cancelling`,`completed`,`failed`,`cancelled`,`dead`];function gC(e){let t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function _C(e,t){let n=new Date(t).getTime()-new Date(e).getTime();return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${(n/6e4).toFixed(1)}m`}function vC({status:e}){return(0,m.jsx)(`span`,{className:`dot s-${e} ${e===`running`||e===`awaiting`?`pulse`:``}`,"aria-hidden":!0})}function yC({status:e}){return(0,m.jsxs)(nC,{variant:`bare`,className:`s-${e} gap-1.5 text-[11px]`,children:[(0,m.jsx)(vC,{status:e}),e]})}var bC={width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.7,strokeLinecap:`round`,strokeLinejoin:`round`};function xC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`rect`,{x:`7`,y:`7`,width:`10`,height:`10`,rx:`1.5`}),(0,m.jsx)(`path`,{d:`M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2`})]})}function SC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,m.jsx)(`path`,{d:`M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18`})]})}function CC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`13`,r:`8`}),(0,m.jsx)(`path`,{d:`M12 13V9M9 2h6`})]})}function wC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`}),(0,m.jsx)(`path`,{d:`M7.8 7.8a6 6 0 0 0 0 8.4M16.2 16.2a6 6 0 0 0 0-8.4M5 5a10 10 0 0 0 0 14M19 19a10 10 0 0 0 0-14`})]})}function TC(e){return(0,m.jsx)(`svg`,{...bC,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`m4 12 5 5L20 6`})})}function EC(e){return(0,m.jsx)(`svg`,{...bC,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M6 6l12 12M18 6 6 18`})})}function DC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`rect`,{x:`9`,y:`9`,width:`11`,height:`11`,rx:`2`}),(0,m.jsx)(`path`,{d:`M5 15V5a2 2 0 0 1 2-2h8`})]})}function OC(e){return(0,m.jsx)(`svg`,{...bC,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5`})})}function kC(e){return(0,m.jsx)(`svg`,{...bC,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M13 2 4 14h7l-1 8 9-12h-7l1-8z`})})}function AC(e){return(0,m.jsx)(`svg`,{...bC,...e,"aria-hidden":`true`,children:(0,m.jsx)(`path`,{d:`M6 4l14 8-14 8z`})})}function jC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,m.jsx)(`path`,{d:`m20 20-4-4`})]})}function MC(e){return(0,m.jsxs)(`svg`,{...bC,...e,"aria-hidden":`true`,children:[(0,m.jsx)(`circle`,{cx:`6`,cy:`5`,r:`2`}),(0,m.jsx)(`path`,{d:`M6 7v6a4 4 0 004 4h4`}),(0,m.jsx)(`circle`,{cx:`18`,cy:`17`,r:`2`})]})}var NC={local:xC,remote:SC,sleep:CC,signal:wC,child:MC};function PC(e){return NC[e]??xC}var FC={local:`In-process step`,remote:`Remote worker step`,sleep:`Durable timer`,signal:`External signal`,child:`Child workflow — click to open its run`},IC=(0,p.forwardRef)(({className:e,...t},n)=>(0,m.jsx)(`input`,{ref:n,className:J(`mono w-full bg-transparent py-1.5 text-xs text-fg placeholder:text-faint focus:outline-none disabled:opacity-50`,e),...t}));IC.displayName=`Input`;var LC=(0,p.forwardRef)(({glyph:e,onClear:t,clearLabel:n=`clear`,containerClassName:r,value:i,...a},o)=>(0,m.jsxs)(`div`,{className:J(`flex items-center gap-1.5 rounded-md border border-line px-2 transition-colors focus-within:border-line-strong`,r),children:[e!==void 0&&(0,m.jsx)(`span`,{className:`shrink-0 text-faint`,"aria-hidden":!0,children:e}),(0,m.jsx)(IC,{ref:o,value:i,...a}),t&&i?(0,m.jsx)(Wi,{variant:`ghost`,size:`icon-sm`,onClick:t,title:n,"aria-label":n,className:`h-4 w-4`,children:(0,m.jsx)(EC,{width:12,height:12})}):null]}));LC.displayName=`InputField`;function RC({onOpenRun:e}){let[t,n]=(0,p.useState)(``),[r,i]=(0,p.useState)(!1),a=$e({mutationFn:e=>XS.run(e),onSuccess:t=>{n(``),i(!1),e(t.run.id)},onError:()=>i(!0)});return(0,m.jsxs)(`form`,{className:`relative`,onSubmit:e=>{e.preventDefault();let n=t.trim();n&&a.mutate(n)},children:[(0,m.jsx)(LC,{glyph:(0,m.jsx)(jC,{width:12,height:12}),value:t,onChange:e=>{n(e.target.value),i(!1)},onClear:()=>{n(``),i(!1)},clearLabel:`clear run id`,placeholder:`open run id…`,"aria-label":`open run by id`,containerClassName:`w-44`}),r&&(0,m.jsx)(`span`,{className:`mono absolute left-0 top-full z-20 mt-1 whitespace-nowrap rounded border border-bad/25 bg-panel-2 px-1.5 py-0.5 text-[10px] text-bad`,children:`no run with that id`})]})}function zC({open:e,onOpenChange:t,title:n,description:r,footer:i,children:a,className:o}){return(0,m.jsx)(ly,{open:e,onOpenChange:t,children:(0,m.jsxs)(fy,{className:J(`gap-4 sm:max-w-xl`,o),children:[(0,m.jsxs)(py,{children:[(0,m.jsx)(hy,{className:`pr-8 text-[15px] font-semibold tracking-tight`,children:n}),r&&(0,m.jsx)(gy,{className:`mono break-all text-[11px]`,children:r})]}),(0,m.jsx)(`div`,{children:a}),i&&(0,m.jsx)(my,{children:i})]})})}function BC({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`empty`,className:J(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance`,e),...t})}function VC({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`empty-header`,className:J(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var HC=Hi(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6`}},defaultVariants:{variant:`default`}});function UC({className:e,variant:t=`default`,...n}){return(0,m.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:J(HC({variant:t,className:e})),...n})}function WC({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`empty-title`,className:J(`cn-font-heading text-lg font-medium tracking-tight`,e),...t})}function GC({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`empty-description`,className:J(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function KC({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`empty-content`,className:J(`flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance`,e),...t})}function qC({title:e,description:t,icon:n,action:r,className:i}){return(0,m.jsxs)(BC,{className:J(`p-8`,i),children:[(0,m.jsxs)(VC,{children:[(0,m.jsx)(UC,{variant:`icon`,className:`border border-border bg-panel-2 text-faint`,children:n??(0,m.jsx)(Tt,{})}),(0,m.jsx)(WC,{className:`text-[13px] font-semibold text-fg`,children:e}),t&&(0,m.jsx)(GC,{className:`text-xs text-faint`,children:t})]}),r&&(0,m.jsx)(KC,{children:r})]})}var JC=p.createContext(void 0);function YC(e){let t=p.useContext(JC);if(t===void 0&&!e)throw Error(ci(47));return t}var XC={...ku,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!ku.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&ku.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>ku.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},ZC=class extends bu{constructor(e,t,n){let r=new eu;super(QC(e,r,t,n),$C(r),XC)}setOpen=(e,t)=>{let n=t.reason===ia,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=ql(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=Kl(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),Za.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function QC(e,t,n,r=!1){let i={...Cu(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function $C(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeTriggerFocusGuardRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Ga,stickIfOpen:!0,triggerElements:e}}var ew=lu(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=nw(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),h=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),$l(u,d),Xl(u);let{forceUnmount:g}=Zl(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),p.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>u.setOpen(!1,ea(_a))}),[g,u]);let _=d||f||s!=null;return(0,m.jsxs)(JC.Provider,{value:u,children:[s&&(0,m.jsx)(Ul,{handle:s,store:u}),_&&(0,m.jsx)(rw,{store:u,modal:o}),typeof t==`function`?t({payload:h}):t]})});function tw(e){return YC(!0)?(0,m.jsx)(ew,{props:e}):(0,m.jsx)(xl,{children:(0,m.jsx)(ew,{props:e})})}function nw(e,t){let n=Hl((e,n)=>new ZC(t,e,n));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function rw({store:e,modal:t}){let n=Ll(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return Ql(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var iw=uu(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...h}=e,g=YC(!0),_=Au(s)??g;if(!_)throw Error(ci(74));let v=$i(f),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`triggerPopupId`,v),C=p.useRef(null),{registerTrigger:w,isMountedByThisTrigger:T}=Yl(v,C,_,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),E=_.useState(`isPressOpenedByTrigger`,v),D=_.useState(`isTouchPressOpen`,l),O=_.useState(`hasTriggerFocusGuards`,v),k=Bu(b,{enabled:!a&&l&&!D,mouseOnly:!0,move:!1,handleClose:td(),restMs:u,delay:{close:d},triggerElementRef:C,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`}),A=jl(b,{stickIfOpen:Y(()=>_.context.stickIfOpen)}),j=If(()=>_.select(`open`),e=>{_.set(`openMethod`,e)}),M=_.useState(`triggerProps`,T),{getButtonProps:N,buttonRef:P}=mi({disabled:a,native:o}),F={open(e){return E?$o.open(e):Qo.open(e)}},{handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=qb(_,C),R=Mi(`button`,e,{state:{disabled:a,open:x},ref:[P,t,w,C],props:[A.reference,k,M,j,{[il]:``,id:v,"aria-haspopup":`dialog`,"aria-expanded":x,"aria-controls":S},h,N],stateAttributesMapping:F}),z=(0,m.jsx)(p.Fragment,{children:R},v);return O?(0,m.jsxs)(p.Fragment,{children:[(0,m.jsx)(Hc,{ref:_.context.beforeTriggerFocusGuardRef,onFocus:I}),z,(0,m.jsx)(Hc,{ref:_.context.triggerFocusTargetRef,onFocus:L})]}):z}),aw=p.createContext(void 0);function ow(){let e=p.useContext(aw);if(e===void 0)throw Error(ci(45));return e}var sw=p.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return YC().useState(`mounted`)||n?(0,m.jsx)(aw.Provider,{value:n,children:(0,m.jsx)(fl,{ref:t,...r})}):null}),cw=p.createContext(void 0);function lw(){let e=p.useContext(cw);if(!e)throw Error(ci(46));return e}var uw=p.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:h,disableAnchorTracking:g=!1,collisionAvoidance:_=ol,...v}=e,y=YC(),b=ow(),x=yl(),S=y.useState(`floatingRootContext`),C=y.useState(`mounted`),w=y.useState(`open`),T=y.useState(`openChangeReason`),E=y.useState(`activeTriggerElement`),D=y.useState(`modal`),O=y.useState(`openMethod`),k=y.useState(`positionerElement`),A=y.useState(`instantType`),j=y.useState(`transitionStatus`),M=Dp({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:h,disableAnchorTracking:g,keepMounted:b,nodeId:x,collisionAvoidance:_,adaptiveOrigin:y.useState(`adaptiveOrigin`)});Tb({store:y,domReference:S.useState(`domReferenceElement`),positionerElement:k,open:w});let N=D===!0&&T!==`trigger-hover`;Db(w&&N,O===`touch`,k,E);let P=y.useStateSetter(`positionerElement`),F=jp(e,{open:w,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:A},{styles:M.positionerStyles,transitionStatus:j,props:v,refs:[t,P],hidden:!C,inert:!w});return(0,m.jsxs)(cw.Provider,{value:M,children:[C&&N&&(0,m.jsx)(mf,{inert:pf(!w),cutout:E}),(0,m.jsx)(bl,{id:x,children:F})]})}),dw=p.createContext(void 0);function fw(){let[e,t]=p.useState(0),n=Y(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var pw=p.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=YC(),l=lw(),u=ab(!0)!=null,{context:d,hasClosePart:f}=fw(),p=c.useState(`open`),h=c.useState(`openMethod`),g=c.useState(`instantType`),_=c.useState(`transitionStatus`),v=c.useState(`popupProps`),y=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);to({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Ru(T,{enabled:O&&!D,closeDelay:k});let A=a===void 0?Vl(c.context.popupRef):a,j=x!==!1&&f;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N=Mi(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:g,transitionStatus:_},ref:[t,c.context.popupRef,M],props:[v,{id:E,role:`dialog`,...Bl,"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){u&&cf.has(e.key)&&e.stopPropagation()}},Ap(_),s],stateAttributesMapping:ts});return(0,m.jsx)(Al,{context:T,openInteractionType:h,modal:j,disabled:!S||C===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:br(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,m.jsx)(dw.Provider,{value:d,children:N})})});function mw({...e}){return(0,m.jsx)(tw,{"data-slot":`popover`,...e})}function hw({...e}){return(0,m.jsx)(iw,{"data-slot":`popover-trigger`,...e})}function gw({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,m.jsx)(sw,{children:(0,m.jsx)(uw,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,m.jsx)(pw,{"data-slot":`popover-content`,className:J(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}function _w(e){return typeof e==`object`?e.key:e}function vw(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function yw(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return(o.length!==r.length||o.some((e,t)=>r[t]!==e))&&(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1),i}return o.updateDeps=e=>{r=e},o}function bw(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var xw=(e,t)=>Math.abs(e-t)<1.01,Sw=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})};function Cw({offset:e,isScrolling:t,elementMax:n,holdOffset:r,scrollOffset:i,pendingWrite:a,clampedMaxAtWrite:o}){return t&&a===null&&e===i?`spurious`:a!==null&&Math.abs(e-a.target)<1.5?`readBack`:a!==null&&!a.smooth&&n!==null&&a.target>n+r+.5&&Math.abs(e-(n+r))<1.5||a!==null&&!a.smooth&&a.lowMaxes?.some(t=>Math.abs(e-t)<1.5)?`clampedReadBack`:o!==null&&Math.abs(e-o)<1.5?`clampedEcho`:`external`}var ww=e=>e===`smooth`||e===`smoothFinishing`;function Tw({kind:e,offset:t,command:n,target:r}){return e!==`spurious`&&e!==`readBack`&&e!==`clampedReadBack`&&n?.index!=null&&n.phase!==`queued`&&!ww(n.phase)&&!xw(t,n.lastTargetOffset)&&!xw(t,r())&&e!==`clampedEcho`}var Ew=40;function Dw(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<Ew;)n--;if(n<0)return!1;let r=e[n],i=n-1;for(;i>=0&&r.t-e[i].t<Ew;)i--;if(i<0)return!1;let a=e[i],o=(t.offset-r.offset)/(t.t-r.t),s=(r.offset-a.offset)/(r.t-a.t);return o*s>=0&&Math.abs(o)>=2*Math.abs(s)&&Math.abs(o)-Math.abs(s)>=.8}function Ow(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<Ew;)n--;if(n<0)return!1;let r=e[n];return Math.abs(t.offset-r.offset)/(t.t-r.t)>=.05}var kw,Aw=()=>{if(kw!==void 0)return kw;if(typeof navigator>`u`)return kw=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return kw=!0;let e=navigator.maxTouchPoints;return kw=navigator.platform===`MacIntel`&&e!==void 0&&e>0},jw,Mw=()=>jw===void 0?jw=Aw()&&typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`overflow-anchor: auto`):jw,Nw=()=>!Aw()||Mw(),Pw={capture:!0,passive:!0},Fw=class{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!==`lateFling`,this.dragging=()=>this._touch?.phase===`down`&&this._touch.moved,this.tail=()=>this._touch?.phase===`tail`?this._touch.moved?`fling`:`tap`:null,this.onScroll=({isScrolling:e,ownReadBack:t,moved:n,external:r})=>(e&&this._touch?.phase===`tail`?this._openTail(this._touch.moved||!t,!1):this._touch?.phase===`lateFling`&&(this.host.now()>this._touch.until?this._touch=null:r&&e&&n&&this._openTail(!0,!1)),!t&&e&&n&&this._touch?.phase===`down`?(this._touch.moved=!0,!0):!1),this.touchStart=()=>{this.end(),this._touch={phase:`down`,moved:!1}},this.touchEnd=()=>{let e=this._touch?.phase===`down`&&this._touch.moved;this.end(),this._openTail(e,e)},this.end=()=>{let e=this.host.getWindow();this._touch?.phase===`tail`&&e!=null&&e.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),n=()=>this.touchEnd();return e.addEventListener(`touchstart`,t,Pw),e.addEventListener(`touchend`,n,Pw),e.addEventListener(`touchcancel`,n,Pw),()=>{e.removeEventListener(`touchstart`,t,Pw),e.removeEventListener(`touchend`,n,Pw),e.removeEventListener(`touchcancel`,n,Pw),this.end()}},this._openTail=(e,t)=>{let n=this.host.getWindow();if(n==null)return;this.end();let r={phase:`tail`,moved:e,awaitingFling:t,timerId:n.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(r.moved,r.awaitingFling):(this._touch=r.awaitingFling?{phase:`lateFling`,until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=r}}get touch(){return this._touch}},Iw=e=>{let{clientWidth:t,clientHeight:n}=e;return{width:t,height:n}},Lw=e=>{let t=new Set;return{schedule:n=>{let r=e.requestAnimationFrame(()=>{t.delete(r),n()});t.add(r)},cancel:()=>{t.forEach(t=>e.cancelAnimationFrame(t)),t.clear()}}},Rw=e=>e,zw=e=>{let t=e.overscan*Math.max(e.lanes??1,1),n=Math.max(e.startIndex-t,0),r=Math.min(e.endIndex+t,e.count-1)-n+1,i=Array(r);for(let e=0;e<r;e++)i[e]=n+e;return i},Bw=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Iw(n)),!r.ResizeObserver)return()=>{};let a=Lw(r),o=new r.ResizeObserver(()=>{let t=()=>{i(Iw(n))};e.options.useAnimationFrameWithResizeObserver?a.schedule(t):t()});return o.observe(n,{box:`content-box`}),()=>{o.unobserve(n),a.cancel()}},Vw={passive:!0},Hw=typeof window>`u`||`onscrollend`in window,Uw=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Hw,o=0,s=a?null:Sw(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Vw),a&&r.addEventListener(`scrollend`,u,Vw),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},Ww=(e,t)=>Uw(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Gw=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Kw=(e,{adjustments:t=0,behavior:n},r)=>{var i;let{scrollElement:a,options:o}=r,s=e+t,c=o.horizontal&&o.isRtl&&a!==null&&`ownerDocument`in a;(i=a?.scrollTo)==null||i.call(a,{[o.horizontal?`left`:`top`]:c?-s:s,behavior:n})},qw=(e,t)=>e===`smooth`?t?`smoothLanded`:`smooth`:`instant`,Jw=e=>e?.phase===`smooth`||e?.phase===`smoothLanded`;function Yw(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var Xw=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new Fw({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if(e?.phase!==`queued`||this.pendingWrite!==null)return!1;let t=this._readElementOffset();return t===null||this._lastElementOffset===null||Math.abs(t-this._lastElementOffset)<1?!1:(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;e?.phase===`queued`&&Ow(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand(),this._retryClampedAdjustment()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=null,n=!1,r=!1,i=new Set,a=()=>{if(e)return e;let r=this.targetWindow;if(!r||!r.ResizeObserver)return null;let i=t=Lw(r);return e=new r.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(o)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment(),this.measureElement(null))}};if(this.options.useAnimationFrameWithResizeObserver)i.schedule(t);else{n=!0;try{t()}finally{n=!1}}})},o=e=>{let t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};return{disconnect:()=>{var n;(n=a())==null||n.disconnect(),t?.cancel(),i.clear(),r=!1,e=null,t=null},observe:o=>{let s=a();s&&(n?(i.add(o),r||(r=!0,t?.schedule(()=>{r=!1,i.forEach(t=>{t.isConnected&&e?.observe(t,{box:`border-box`})}),i.clear()}))):s.observe(o,{box:`border-box`}))},unobserve:e=>{var t;i.delete(e),(t=a())==null||t.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Rw,rangeExtractor:zw,onChange:()=>{},measureElement:Gw,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>_w(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||Yw(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:s}=this.options,c=0;for(;c<a&&s(c)!==e;)c++;if(c<a){let e=n[c];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(o=n-this.scrollOffset,this.scrollOffset=n)}}}i?this.pendingScrollAnchor={kind:`follow`,behavior:i}:o!==null&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:`anchor`,delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=yw(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,(e=this._momentumStop)==null||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{let n=t?this._elementMaxScrollOffset():null,r=this._reportedOverscroll;this._reportedOverscroll=e<0||n!==null&&e>n+1;let i=e;this._lastElementOffset=i,e=this._toLayoutOffset(e);let a=this._classifyScrollEvent(e,t,n);if(a===`spurious`)return;a===`readBack`?e=this.pendingWrite.target:a===`clampedReadBack`&&this.scrollState?.index!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:Tw({kind:a,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let o=this.getScrollOffset(),s=this.scrollDirection;this.scrollDirection=t?o===e?this.scrollDirection:o<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t;let c=this.scrollState;if(c?.phase===`queued`&&a===`external`&&t){if(r||this._reportedOverscroll)c.samples=[];else{let e=this.now();c.samples=[...(c.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:i}],(s!==null&&this.scrollDirection!==s||Dw(c.samples))&&(this.scrollState=null)}}this._iosGesture.onScroll({isScrolling:t,ownReadBack:a===`readBack`,moved:e!==o,external:a===`external`&&this.scrollState?.phase!==`smooth`&&this.scrollState?.phase!==`smoothFinishing`})&&this.scrollState?.phase===`queued`&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let t=this.pendingScrollAnchor;this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled&&(t.kind===`anchor`?this._canWriteScroll()?Jw(this.scrollState)&&!xw(this.getScrollOffset()-t.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(t.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=t.delta,this._followOffsetTarget(t.delta),this.notify(!1)):this.scrollToEnd({behavior:t.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,n)=>Cw({offset:e,isScrolling:t,elementMax:n,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:this._clampedAdjustment?.maxAtWrite??null}),this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled||!this._canWriteScroll())return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(e===null||e.phase!==`queued`)return;let{behavior:t}=e;this.getMeasurements();let n=this.getScrollStateTarget(e);e.lastTargetOffset=n,this._clampedAdjustment=null,e.phase=qw(t,e.index!=null&&xw(n,this.getScrollOffset())),this._scrollToOffset(n,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(e==null)return null;let{horizontal:t,isRtl:n}=this.options;return typeof e.scrollTop==`number`?t?e.scrollLeft*(n&&-1||1):e.scrollTop:typeof e.scrollY==`number`?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(Aw()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{if(this._holdOffset===0||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||this.scrollState?.phase===`smooth`)return;this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let t=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(t),this._scrollToOffset(t)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=yw(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=yw(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=vw(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=yw(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes,this._getLayoutTotalSize()+this.options.scrollMargin],(e,t,n,r,i)=>{if(e.length===0||t===0)return this.range=null,null;let a=Math.max(i-t,0);return this.range=$w(e,t,Math.min(n,a),r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=yw(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,n,r,i,a)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n,lanes:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!Jw(this.scrollState))return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n;if(!this.isIndexInRange(e))return;this._resizeBatch?.sync&&this.getMeasurements();let r,i,a,o=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&o!=null)a=this.options.getItemKey(e),i=o[e*2],r=o[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;a=t.key,i=t.start,r=t.size}let s=this.itemSizeCache.get(a)??r,c=t-s;if(c!==0){let o=this.options.anchorTo===`end`&&!Jw(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,l=o?this._getLayoutTotalSize():0,u=this.getScrollOffset(),d=this.itemSizeCache.has(a)?i+s<=u&&this.scrollDirection!==`backward`:i<u,f=!Jw(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?d:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:a,start:i,size:r,end:i+r,lane:0},c,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(a,t),this.itemSizeCacheVersion++;let p=!1;if(this._awaitingCommandReadBack()||(o?p=this.applyScrollAdjustment(this._getLayoutTotalSize()-l):f&&(p=this.applyScrollAdjustment(c))),this._resizeBatch){this._resizeBatch.notify=!0,(n=this._resizeBatch).sync||(n.sync=p);return}this.notify(p),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=yw(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,n)=>{let r=[];for(let i=0,a=e.length;i<a;i++){let a=t[e[i]];r.push(n===0?a:{...a,start:a.start-n,end:a.end-n})}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return bw(t[Zw(0,t.length-1,r?e=>n[e*2]:e=>bw(t[e]).start,e)])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(e===null)return;let t=this.pendingWrite,n=Math.max(e,0)+this._holdOffset;if(n>=t.target)return;let r=t.lowMaxes??=[];r[r.length-1]!==n&&r.push(n)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{let t=e+this._holdOffset;return this.pendingScrollAnchor?.kind===`anchor`&&(t+=this.pendingScrollAnchor.delta),t},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(e===null)return null;if(`scrollHeight`in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(`document`in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,n=this.targetWindow;if(t===null||n===null)return;let r=`document`in t?t.document.scrollingElement:t;if(!r?.style)return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:i}=r,a=this.options.horizontal?`overflow-x`:`overflow-y`,o=i.getPropertyValue(a),s=i.getPropertyPriority(a),c=()=>this.options.horizontal?r.clientHeight:r.clientWidth,l=c();if(i.setProperty(a,`hidden`,`important`),c()!==l){i.setProperty(a,o,s);return}let u={restore:()=>i.getPropertyValue(a)!==`hidden`||i.getPropertyPriority(a)!==`important`?!1:(i.setProperty(a,o,s),!0),done:e};this._momentumStop=u,n.requestAnimationFrame(()=>n.requestAnimationFrame(()=>{this._momentumStop===u&&(this._momentumStop=null,u.restore()&&u.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(t===null)return null;let n=t+this._holdOffset;return e>n+.5?{target:e,maxAtWrite:n}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()+this.options.scrollMargin-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.getMeasurements()[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1){let e=this.getMaxScrollOffset(),n=e-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(n,e),0),t]}let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),n,`absolute`)},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r;this._startScroll({index:e,align:a},i,n,`absolute`)},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,`start`);this._startScroll({index:null,align:`start`},n,t,`relative`)},this.scrollToEnd=({behavior:e=`auto`}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:`end`,toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,`absolute`):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n}={})=>{let r={target:e+(t??0),smooth:n===`smooth`};return this.pendingWrite=r,this.options.scrollToFn(e-this._holdOffset,{behavior:n,adjustments:t},this),r},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(Aw()&&this._iosGesture.dragging())&&e!==null&&!xw(e,this.getScrollOffset())},this._followOffsetTarget=e=>{this.scrollState!==null&&this.scrollState.index==null&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(e===0)return!1;if(this._followOffsetTarget(e),this._canWriteScroll()){let n=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(n+e);let r=this._scrollToOffset(n,{adjustments:e,behavior:t});return this.scrollOffset!==null&&(this.pendingWrite===r&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}return this._holdOffset+=e,this.scrollOffset!==null&&(this.scrollOffset+=e),!0}scheduleScrollReconcile(){this.targetWindow?this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}):this.scrollState=null}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:e.index==null?void 0:this.getOffsetForIndex(e.index,e.align);return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if(this.scrollState.phase===`queued`){this.scheduleScrollReconcile();return}this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,n=e!==this.scrollState.lastTargetOffset;if(!n&&xw(e,this.getScrollOffset())){if(this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothLanded`:this.scrollState.phase===`smoothFinishing`&&(this.scrollState.phase=`instant`),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let t=this.getSize()||600,n=Math.abs(e-this.getScrollOffset()),r=Jw(this.scrollState)&&n>t;this.scrollState.lastTargetOffset=e,r?this.scrollState.phase=`smooth`:this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothFinishing`:this.scrollState.phase===`smoothLanded`&&(this.scrollState.phase=`instant`),this._scrollToOffset(e,{behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){this.pendingScrollAnchor=null,this._clampedAdjustment=null;let i=this._iosGesture.tail();if(r===`absolute`&&i!==null){if(i===`fling`&&Nw()){this._stopMomentum(()=>{this.scrollState?.phase!==`queued`||this._iosGesture.tail()!==`fling`||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:`queued`,behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:qw(n,e.index!=null&&xw(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}},Zw=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Qw(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function $w(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=Qw(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=Zw(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var eT=typeof document<`u`?p.useLayoutEffect:p.useEffect;function tT({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=p.useReducer(e=>e+1,0)[1],a=p.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=p.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=(e,t,n)=>{let r=a.current,i=!!e.options.horizontal,o=t.start-e.options.scrollMargin;r.lastPositions.get(n)!==o&&(r.lastPositions.set(n,o),r.mode===`transform`?n.style.transform=i?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:n.style[i?`left`:`top`]=`${o}px`)},l=e=>{let t=a.current;if(t.enabled&&t.container){s(e);for(let t of e.getVirtualItems()){let n=e.elementsCache.get(t.key);n&&c(e,t,n)}}},u={...r,onChange:(t,n)=>{var s;let c=a.current,u=!0;if(c.enabled){l(t);let e=t.range,n=c.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,Za.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[d]=p.useState(()=>{let e=new Xw(u),t=e.measureElement;return e.measureElement=n=>{o.current=!0;try{t(n)}finally{o.current=!1}let r=a.current;if(n!==null&&r.enabled&&r.container){let t=e.measurementsCache[e.indexFromElement(n)];t&&c(e,t,n)}},Object.assign(e,{containerRef:t=>{let n=a.current;n.container=t,n.lastSize=null,t!==null&&l(e)}})});return d.setOptions(u),eT(()=>d._didMount(),[]),eT(()=>(s(d),d._willUpdate())),eT(()=>{l(d)}),d}function nT(e){return tT({observeElementRect:Bw,observeElementOffset:Ww,scrollToFn:Kw,...e})}var rT=48,iT=60,aT=24;function oT({glyph:e,label:t,placeholder:n,value:r,onChange:i,options:a,loading:o,failed:s,search:c,onSearchChange:l,hasMore:u,loadingMore:d,onLoadMore:f,allowCustom:h=!0,title:g}){let[_,v]=(0,p.useState)(!1),[y,b]=(0,p.useState)(``),x=l!==void 0,S=x?c??``:y,C=x?l:b,w=(0,p.useMemo)(()=>{let e=S.trim().toLowerCase(),t=e&&!x?a.filter(t=>t.value.toLowerCase().includes(e)):a;return[...r.filter(e=>!t.some(t=>t.value===e)).filter(t=>!e||t.toLowerCase().includes(e)).map(e=>({value:e,count:0})),...t]},[a,S,x,r]),T=(0,p.useRef)(null),E=()=>{let e=T.current;e&&u&&!d&&f&&e.scrollTop+e.clientHeight>=e.scrollHeight-rT&&f()},D=e=>{i(r.includes(e)?r.filter(t=>t!==e):[...r,e])},O=w.length>iT,k=nT({count:w.length,getScrollElement:()=>T.current,estimateSize:()=>aT,overscan:8,enabled:O}),A=e=>{let t=r.includes(e.value);return(0,m.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>D(e.value),className:J(`mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs hover:bg-hover`,t?`text-fg`:`text-fg-2`),children:[(0,m.jsx)(`span`,{className:`w-3 shrink-0`,children:t&&(0,m.jsx)(TC,{width:12,height:12})}),(0,m.jsx)(`span`,{className:`truncate`,children:e.value}),(0,m.jsx)(`span`,{className:`ml-auto shrink-0 text-[10px] text-faint`,children:e.count})]},e.value)},j=S.trim(),M=h&&j!==``&&!w.some(e=>e.value===j)&&!r.includes(j);return(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-line px-2 py-1 transition-colors focus-within:border-line-strong`,children:[e!==void 0&&(0,m.jsx)(`span`,{className:`shrink-0 text-faint`,"aria-hidden":!0,children:e}),(0,m.jsxs)(mw,{open:_,onOpenChange:v,children:[(0,m.jsx)(hw,{render:(0,m.jsx)(`button`,{type:`button`,"aria-label":t,title:g??t,className:`mono flex min-w-0 flex-1 flex-wrap items-center gap-1 py-0.5 text-left text-xs text-fg focus:outline-none`}),children:r.length===0?(0,m.jsx)(`span`,{className:`text-faint`,children:n}):r.map(e=>(0,m.jsx)(nC,{variant:`neutral`,className:`mono max-w-[10rem] truncate`,children:e},e))}),(0,m.jsxs)(gw,{align:`start`,className:`w-72 gap-0 overflow-hidden p-0`,children:[(0,m.jsx)(`div`,{className:`border-b border-line px-2`,children:(0,m.jsx)(IC,{autoFocus:!0,value:S,onChange:e=>C(e.target.value),placeholder:h?`search, or type a value…`:`search…`,onKeyDown:e=>{e.key===`Enter`&&M&&(e.preventDefault(),D(j),C(``))}})}),(0,m.jsxs)(`div`,{ref:T,onScroll:E,className:`max-h-64 overflow-auto py-1`,role:`listbox`,tabIndex:-1,"aria-multiselectable":!0,"aria-label":t,children:[M&&(0,m.jsxs)(`button`,{type:`button`,"aria-label":`use ${j} as typed`,onClick:()=>{D(j),C(``)},className:`mono flex w-full items-center gap-2 px-2 py-1 text-left text-xs text-fg-2 hover:bg-hover`,children:[(0,m.jsx)(`span`,{className:`w-3 shrink-0 text-faint`,children:`+`}),(0,m.jsx)(`span`,{className:`truncate`,children:j}),(0,m.jsx)(`span`,{className:`ml-auto text-[10px] text-faint`,children:`use as typed`})]}),d&&w.length>0&&(0,m.jsx)(`p`,{className:`px-2 py-1 text-[10px] text-faint`,children:`loading more…`}),w.length===0&&!M&&(0,m.jsx)(`p`,{className:J(`px-2 py-2 text-[11px]`,s?`text-bad`:`text-faint`),children:s?`couldn't load values — type one instead`:o?`loading…`:`no values here`}),O?(0,m.jsx)(`div`,{className:`relative w-full`,style:{height:`${k.getTotalSize()}px`},children:k.getVirtualItems().map(e=>(0,m.jsx)(`div`,{ref:k.measureElement,"data-index":e.index,className:`absolute top-0 left-0 w-full`,style:{transform:`translateY(${e.start}px)`},children:A(w[e.index])},w[e.index]?.value??e.key))}):w.map(A)]})]})]}),r.length>0&&(0,m.jsx)(Wi,{variant:`ghost`,size:`icon-sm`,onClick:()=>i([]),title:`clear ${t}`,"aria-label":`clear ${t}`,className:`h-4 w-4`,children:(0,m.jsx)(EC,{width:12,height:12})})]})}var sT=50,cT=200;function lT(e,t){let[n,r]=(0,p.useState)(e);return(0,p.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function uT(e){return e.filter(e=>e.value!==null).map(e=>({value:e.value,count:e.count}))}function dT({field:e,scope:t,value:n,onChange:r,glyph:i,label:a,placeholder:o,title:s,single:c}){let[l,u]=(0,p.useState)(``),d=lT(l,cT),f=et({queryKey:[`run-values`,e,t,d],queryFn:({pageParam:n})=>XS.values(e,t,{limit:sT,offset:n,search:d}),initialPageParam:0,getNextPageParam:(e,t)=>e.length<sT?void 0:t.reduce((e,t)=>e+t.length,0),staleTime:1e4,refetchInterval:1e4}),h=(0,p.useMemo)(()=>uT(f.data?.pages.flat()??[]),[f.data]);return(0,m.jsx)(oT,{label:a,placeholder:o,...s!==void 0&&{title:s},...i!==void 0&&{glyph:i},value:n,onChange:e=>r(c?e.slice(-1):e),options:h,search:l,onSearchChange:u,loading:f.isLoading,failed:f.isError,hasMore:f.hasNextPage,loadingMore:f.isFetchingNextPage,onLoadMore:()=>void f.fetchNextPage()})}var fT=[{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 pT(e){let[t,n,...r]=e.split(`:`);return!t||!n||r.length===0?null:{key:t,op:n,operand:r.join(`:`)}}function mT(e){let t=pT(e);if(!t)return e;let n=fT.find(e=>e.op===t.op)?.label??t.op;return`${t.key} ${n} ${t.operand.split(`|`).join(`, `)}`}function hT({value:e,onChange:t,scope:n}){let[r,i]=(0,p.useState)(!1),[a,o]=(0,p.useState)(``),[s,c]=(0,p.useState)(`eq`),[l,u]=(0,p.useState)([]),[d,f]=(0,p.useState)(``),h=s===`eq`||s===`in`,g=h?l.join(`|`):d.trim(),_=a!==``&&g!==``,v=()=>{o(``),c(`eq`),u([]),f(``)},y=()=>{if(!_)return;let n=s===`in`&&l.length===1?`eq`:s;t([...e,`${a}:${n}:${g}`]),v(),i(!1)};return(0,m.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 rounded-md border border-line px-2 py-1 transition-colors focus-within:border-line-strong`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-faint`,"aria-hidden":!0,children:`⛃`}),(0,m.jsxs)(mw,{open:r,onOpenChange:e=>{i(e),e||v()},children:[(0,m.jsx)(hw,{render:(0,m.jsx)(`button`,{type:`button`,"aria-label":`filter by search attribute`,title:`Typed search attributes (WorkflowRun.searchAttributes)`,className:`mono flex min-w-0 flex-1 flex-wrap items-center gap-1 py-0.5 text-left text-xs text-fg focus:outline-none`}),children:e.length===0?(0,m.jsx)(`span`,{className:`text-faint`,children:`filter by attribute…`}):e.map(e=>(0,m.jsx)(nC,{variant:`violet`,className:`mono max-w-[12rem] truncate`,children:mT(e)},e))}),(0,m.jsx)(gw,{align:`start`,className:`w-80 gap-0 p-2`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e.length>0&&(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1 border-b border-line pb-1.5`,children:e.map(n=>(0,m.jsxs)(nC,{variant:`violet`,className:`mono gap-1 py-0.5`,children:[mT(n),(0,m.jsx)(Wi,{variant:`ghost`,size:`icon-sm`,className:`h-3 w-3 text-violet/70 hover:text-violet`,title:`remove ${mT(n)}`,"aria-label":`remove ${mT(n)}`,onClick:()=>t(e.filter(e=>e!==n)),children:(0,m.jsx)(EC,{width:10,height:10})})]},n))}),(0,m.jsx)(dT,{field:`attr`,scope:n,glyph:`⛃`,label:`attribute key`,placeholder:`key…`,single:!0,value:a?[a]:[],onChange:e=>{o(e.at(-1)??``),u([])}}),(0,m.jsx)(`select`,{"aria-label":`operator`,value:s,onChange:e=>c(e.target.value),className:`mono rounded-md border border-line bg-transparent px-2 py-1.5 text-xs text-fg focus:border-line-strong focus:outline-none`,children:fT.map(e=>(0,m.jsx)(`option`,{value:e.op,className:`bg-hover`,children:e.label},e.op))}),h?(0,m.jsx)(dT,{field:`attr.${a}`,scope:n,glyph:`=`,label:`attribute value`,placeholder:a?`value…`:`pick a key first`,...s!==`in`&&{single:!0},value:l,onChange:u}):(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-line px-2 focus-within:border-line-strong`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-faint`,"aria-hidden":!0,children:`=`}),(0,m.jsx)(IC,{value:d,onChange:e=>f(e.target.value),placeholder:`value…`,"aria-label":`attribute value`,onKeyDown:e=>{e.key===`Enter`&&y()}})]}),(0,m.jsx)(Wi,{variant:`brand`,size:`chip`,className:`mono self-end rounded`,disabled:!_,onClick:y,children:`add filter`})]})})]}),e.length>0&&(0,m.jsx)(Wi,{variant:`ghost`,size:`icon-sm`,onClick:()=>t([]),title:`clear attribute filters`,"aria-label":`clear attribute filters`,className:`h-4 w-4`,children:(0,m.jsx)(EC,{width:12,height:12})})]})}function gT({runs:e,value:t,onChange:n}){if(!sS(e)&&t.kind===`all`)return null;let r=oS(e);return(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 border-b border-line px-2 py-1.5`,children:[(0,m.jsx)(`span`,{className:`mono shrink-0 text-[10px] uppercase tracking-[0.18em] text-faint`,children:`origin`}),r.map(e=>{let r=tS(t,e.filter);return(0,m.jsxs)(Wi,{variant:`ghost`,size:`chip`,"aria-pressed":r,title:e.title,onClick:()=>n(e.filter),className:J(`mono max-w-full gap-1 rounded-md`,e.filter.kind===`unknown`&&`italic text-dim`,r&&`border-line-strong bg-hover text-fg hover:text-fg`),children:[(0,m.jsx)(`span`,{className:`truncate`,children:e.label}),(0,m.jsx)(`span`,{className:`tnum shrink-0 text-faint`,children:e.count})]},nS(e.filter))})]})}function _T(e){if(e.name.startsWith(`spawn:`))return e.name.slice(6);if(e.name.startsWith(`signal:child:`))return e.name.slice(13)}function vT(e,t=50){let n=new Set;for(let r of e){if(n.size>=t)break;let e=_T(r);e!==void 0&&n.add(e)}return[...n]}function yT(e,t){let n=`${t}.`;return`child ${e.startsWith(n)?e.slice(n.length):e}`}function bT(e,t,n=12){let r=e.slice(0,n);return{shown:r,more:Math.max(0,(t??e.length)-r.length)}}function xT(e){return{...e.triggeredBy?{startedBy:{...e.triggeredBy}}:{},triggered:[...e.triggered??[]]}}var ST=new Set([`completed`,`failed`,`cancelled`,`dead`]);function CT(e){return ST.has(e.run.status)?[...e.lifecycleSubscribers??[]]:[]}function wT(e){let t=`${e.started} subscriber run${e.started===1?``:`s`} started`;return e.failed.length===0?`${t}.`:`${t}, ${e.failed.length} failed: ${e.failed.map(e=>`${e.subscriber} (${e.error})`).join(`; `)}.`}function TT(e){let t={};for(let n of e)n.data&&(t[n.data.run.id]=n.data);return t}var ET=`fan:`;function DT(e){if(!e.name.startsWith(ET))return;let t=e.output?.values;return Array.isArray(t)?t.length:void 0}function OT(e){let t=DT(e);return t===void 0?e.name:`${t} child run${t===1?``:`s`}`}function kT(e){if(e.length===0)return``;let t=e[0]??``;for(let n of e.slice(1)){let e=0;for(;e<t.length&&e<n.length&&t[e]===n[e];)e+=1;t=t.slice(0,e)}return t.replace(/[\s._:-]+$/,``)}function AT(e){if(e.some(e=>DT(e)!==void 0))return`child runs ×${e.reduce((e,t)=>e+(DT(t)??1),0)}`;let t=kT(e.map(e=>e.name));return`${t.length>=2?t:`parallel`} ×${e.length}`}function jT(e){return e.kind===`single`?e.step.seq:e.kind===`fan`?e.steps[0]?.seq??1/0:e.fan.firstSeq}function MT(e,t=[]){let n=NT(e);if(t.length===0)return n;let r=[...t].sort((e,t)=>e.firstSeq-t.firstSeq),i=[],a=0;for(let e of n){let t=jT(e);for(;a<r.length&&r[a].firstSeq<t;)i.push({kind:`summary`,fan:r[a]}),a+=1;i.push(e)}for(;a<r.length;a+=1)i.push({kind:`summary`,fan:r[a]});return i}function NT(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===void 0){n+=1;continue}let i=r.parallelGroup;if(i===void 0||i===``){t.push({kind:`single`,step:r}),n+=1;continue}let a=[],o=n;for(;o<e.length&&e[o]?.parallelGroup===i;){let t=e[o];t!==void 0&&a.push(t),o+=1}a.length<=1?t.push({kind:`single`,step:a[0]??r}):t.push({kind:`fan`,group:i,steps:a,label:AT(a)}),n=o}return t}function PT(e,t=!1){let n=e.counts.running??0,r=e.counts.pending??0,i=e.notStarted??0;return{completed:e.counts.completed??0,failed:e.counts.failed??0,running:t?0:n,pending:t?0:r,interrupted:t?n+r:0,notStarted:t?0:i,skipped:t?i:0,started:e.size,total:e.total??e.size}}function FT(e,t=!1){let n=PT(e,t);return n.running>0?`running`:n.pending>0||n.notStarted>0?`pending`:n.failed>0||n.interrupted>0?`failed`:`completed`}function IT(e){return e.started<e.total?`${e.started} of ${e.total}`:`×${e.total}`}var LT=new Set([`completed`,`failed`,`cancelled`,`dead`]);function RT(e){return LT.has(e)}var zT=2e3,BT=3e4;function VT(e){let t=e.state.data?.run?.status;return t!==void 0&&RT(t)?BT:zT}function HT(e,t,n=100){if(e===void 0||t===void 0)return[0];let r=[];for(let i=Math.floor(e/n);i<=Math.floor(t/n);i+=1)r.push(i);return r}var UT=[{key:`completed`,className:`bg-good/60`,text:`text-good`,label:`done`},{key:`failed`,className:`bg-bad/70`,text:`text-bad`,label:`failed`},{key:`running`,className:`bg-live/70`,text:`text-live`,label:`running`},{key:`pending`,className:`bg-dim/60`,text:`text-fg-2`,label:`pending`},{key:`interrupted`,className:`bg-warn/60`,text:`text-warn`,label:`interrupted`},{key:`notStarted`,className:`bg-line-strong/70`,text:`text-fg-2`,label:`not started`},{key:`skipped`,className:`bg-line-strong/40`,text:`text-dim`,label:`never ran`}],WT=9e4;function GT(e,t,n){let r=(t?.liveWorkers??[]).filter(e=>n-e.lastBeatAt<=WT).sort((e,t)=>t.lastBeatAt-e.lastBeatAt)[0];if(r)return{kind:`working`,instanceId:r.instanceId,beatAgoS:Math.max(0,Math.round((n-r.lastBeatAt)/1e3)),inFlight:r.status?.inFlight};let i=e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime();return{kind:`lost`,minutes:Math.round((n-i)/6e4)}}var KT=[];function qT(e){return Xe({queries:(0,p.useMemo)(()=>vT(e),[e]).map(e=>({queryKey:[`run`,e],queryFn:()=>XS.run(e),refetchInterval:VT})),combine:TT})}function JT(e,t,n){if(t){let e=new Date(t.run.createdAt).getTime(),r=TS(t.run.status)?n:new Date(t.run.updatedAt).getTime();return[e,Math.max(r,e)]}let{subs:r}=Xx(e.events??[]),i=1/0,a=-1/0;for(let e of r){e.startedAt!==void 0&&(i=Math.min(i,e.startedAt));let t=e.terminal?.at??e.startedAt;t!==void 0&&(a=Math.max(a,t))}return i!==1/0&&a!==-1/0?[i,a]:[new Date(e.startedAt).getTime(),new Date(e.finishedAt).getTime()]}function YT(e,t,n){let r=TS(e.status),i=Date.now(),a=new Date(e.createdAt).getTime(),o=-1/0;for(let[e,n]of t)a=Math.min(a,e),o=Math.max(o,n);for(let e of n)e.startedAt&&(a=Math.min(a,new Date(e.startedAt).getTime())),e.finishedAt&&(o=Math.max(o,new Date(e.finishedAt).getTime()));return o=Math.max(o,r?i:a+1),{t0:a,span:Math.max(o-a,1),liveNow:i}}function XT(e,t,n,r=JT(e,t,n.liveNow)){let{t0:i,span:a}=n,[o,s]=r,{subs:c}=Xx(e.events??[]),l=c.map(e=>{let t=e.startedAt??o,n=e.terminal?.at??t;return{key:e.id,name:e.name,status:e.status??`ok`,left:(t-i)/a*100,width:Math.max((n-t)/a*100,.8),ms:e.durationMs??Math.max(n-t,0)}});return{step:e,childId:_T(e),childRun:t,left:(o-i)/a*100,width:Math.max((s-o)/a*100,.8),ms:s-o,subRows:l}}function ZT(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}var QT={ok:`bg-good/40 ring-1 ring-good/50`,failed:`bg-bad/40 ring-1 ring-bad/50`,skipped:`bg-warn/35 ring-1 ring-warn/45`},$T={ok:`bg-good`,failed:`bg-bad`,skipped:`bg-warn`};function eE({row:e,run:t,childRuns:n,depth:r,selectedKey:i,onSelect:a,onOpenRun:o,onToggleChild:s,expanded:c,collapsedSubs:l,toggleSubs:u}){let{step:d,left:f,width:p,ms:h,subRows:g}=e,_=d.status===`failed`,v=_T(d),y=!!v,b=y?MC:PC(d.kind),x=i===`${d.runId}#${d.seq}`,S=y&&v!==void 0&&c.has(v),C=g.length>0&&!y,w=l.has(d.seq),T=wS(d,Date.now()),{data:E}=Qe({queryKey:[`workers`],queryFn:()=>XS.workers(),refetchInterval:1e4,enabled:T}),D=T?GT(d,E?.find(e=>e.group===d.workerGroup),Date.now()):void 0;return(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>a(d,t),title:y?`Child workflow — click for its detail (↗ opens its run)`:void 0,className:`group grid w-full grid-cols-[150px_1fr] items-center gap-3 rounded-md px-2 py-1 text-left transition-colors ${x?`bg-hover/60`:`hover:bg-hover/60`}`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate`,children:[y&&v!==void 0&&(0,m.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s(v)},className:`shrink-0 text-violet hover:text-violet transition-colors`,title:S?`Collapse child run`:`Expand child run inline`,children:(0,m.jsx)(`span`,{className:`inline-block transition-transform`,style:{transform:S?`rotate(90deg)`:`rotate(0deg)`},children:`▸`})}),C&&(0,m.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u(d.seq)},className:`shrink-0 text-dim transition-colors hover:text-fg-2`,title:w?`Show ${g.length} sub-process(es)`:`Hide sub-processes`,children:(0,m.jsx)(`span`,{className:`inline-block transition-transform`,style:{transform:w?`rotate(0deg)`:`rotate(90deg)`},children:`▸`})}),(0,m.jsx)(`span`,{className:_?`text-bad`:y?`text-violet`:`text-good`,children:(0,m.jsx)(b,{width:12,height:12})}),(0,m.jsx)(`span`,{className:`truncate text-[12px] text-fg-2`,children:v===void 0?OT(d):n[v]?.run.workflow??yT(v,t.id)}),y&&v!==void 0&&(0,m.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o(v)},title:`Open the child run`,className:`shrink-0 text-violet transition-colors hover:text-violet`,children:`↗`})]}),(0,m.jsxs)(`span`,{className:`relative h-5`,children:[(0,m.jsx)(`span`,{className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft`}),(0,m.jsx)(`span`,{className:`absolute top-1/2 flex h-3.5 -translate-y-1/2 items-center rounded-[3px] transition-all duration-500 ease-out ${_?`bg-bad/35 ring-1 ring-bad/50`:x?`bg-good/45 ring-1 ring-good/60`:`bg-good/30 ring-1 ring-good/40`}`,style:{left:`${f}%`,width:`${p}%`}}),(0,m.jsx)(`span`,{className:`mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[10px] text-dim`,style:{left:`min(${f+p}%, calc(100% - 44px))`},children:ZT(h)})]})]}),D?.kind===`working`&&(0,m.jsxs)(`div`,{className:`mono ml-[18px] mb-1 flex items-center gap-1 text-[10px] text-good/80`,title:`A live worker holds this dispatch — its heartbeat is fresh. Long steps are expected to sit here; only re-dispatch if the heartbeat goes stale.`,children:[(0,m.jsx)(`span`,{"aria-hidden":!0,children:`⚙`}),`being worked by `,D.instanceId,` — heartbeat `,D.beatAgoS,`s ago`,D.inFlight===void 0?``:` · ${D.inFlight} in flight`]}),D?.kind===`lost`&&(0,m.jsxs)(`div`,{className:`mono ml-[18px] mb-1 flex items-center gap-1 text-[10px] s-stale`,title:"No live worker heartbeat on this step's group — reconcile-wake can't recover a stuck `pending` step; re-dispatch it from the run actions above",children:[(0,m.jsx)(`span`,{"aria-hidden":!0,children:`⚠`}),`awaiting worker result — dispatched `,D.minutes,`m ago, no live worker (possibly lost)`]}),g.length>0&&!w&&(0,m.jsx)(`div`,{className:`ml-[18px] mt-0.5 mb-1 space-y-0.5 border-l border-line-soft pl-2`,children:g.map(e=>(0,m.jsxs)(`div`,{className:`grid grid-cols-[130px_1fr] items-center gap-3 px-2`,title:`${e.name} — ${e.status}`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate`,children:[(0,m.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${$T[e.status]}`}),(0,m.jsx)(`span`,{className:`truncate text-[10px] text-fg-2`,children:e.name})]}),(0,m.jsxs)(`span`,{className:`relative h-3`,children:[(0,m.jsx)(`span`,{className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft`}),(0,m.jsx)(`span`,{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-[2px] transition-all duration-500 ease-out ${QT[e.status]}`,style:{left:`${e.left}%`,width:`${e.width}%`}}),(0,m.jsx)(`span`,{className:`mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[9px] text-faint`,style:{left:`min(${e.left+e.width}%, calc(100% - 38px))`},children:ZT(e.ms)})]})]},e.key))}),y&&v!==void 0&&S&&(0,m.jsx)(`div`,{className:`ml-[18px] mt-0.5 mb-1 border-l border-line-soft pl-2`,children:(0,m.jsx)(sE,{id:v,depth:r+1,selectedKey:i,onSelect:a,onOpenRun:o,expanded:c,onToggleChild:s})})]})}function tE({label:e,fanFailed:t,memberRows:n,rowProps:r}){return(0,m.jsxs)(`div`,{className:`rounded-md bg-hover/30 ring-1 ring-line-soft`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1`,children:[(0,m.jsx)(`span`,{className:`text-[11px] text-violet/80`,title:`parallel fan-out (ctx.gather / ctx.all)`,children:`⑃`}),(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.15em] text-dim`,children:`parallel`}),(0,m.jsx)(`span`,{className:`text-[11px] ${t?`text-bad`:`text-fg-2`}`,children:e})]}),(0,m.jsx)(`div`,{className:`ml-[10px] border-l border-line-soft pl-1`,children:n.map(e=>(0,m.jsx)(eE,{row:e,...r},e.step.seq))})]})}var nE=28;function rE({fan:e,frame:t,rowProps:n}){let[r,i]=(0,p.useState)(!1),[a,o]=(0,p.useState)(!1),s=RT(n.run.status),c=PT(e,s),l=FT(e,s),u=l===`running`||l===`pending`,d=TS(n.run.status),f=e.startedAt?new Date(e.startedAt).getTime():void 0,h=e.finishedAt?new Date(e.finishedAt).getTime():u&&d?t.liveNow:f,g=(0,p.useMemo)(()=>e.failures.map(e=>XT(e,void 0,t)),[e.failures,t]);return(0,m.jsxs)(`div`,{className:`rounded-md bg-hover/30 ring-1 ring-line-soft`,children:[(0,m.jsxs)(`div`,{className:`grid grid-cols-[150px_1fr] items-center gap-3 px-2 py-1`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate`,children:[(0,m.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`shrink-0 text-dim transition-colors hover:text-fg-2`,title:r?`Hide the members`:`List the ${e.size} members started`,children:(0,m.jsx)(`span`,{className:`inline-block transition-transform`,style:{transform:r?`rotate(90deg)`:`rotate(0deg)`},children:`▸`})}),(0,m.jsx)(`span`,{className:`text-[11px] text-violet/80`,title:`parallel fan-out, summarized`,children:`⑃`}),(0,m.jsxs)(`span`,{className:`truncate text-[12px] ${l===`failed`?`text-bad`:`text-fg-2`}`,title:e.group,children:[e.label,` ×`,c.total]})]}),(0,m.jsxs)(`span`,{className:`relative h-5`,children:[(0,m.jsx)(`span`,{className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft`}),f!==void 0&&h!==void 0&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`absolute top-1/2 h-3.5 -translate-y-1/2 rounded-[3px] ${l===`failed`?`bg-bad/25 ring-1 ring-bad/40`:`bg-violet/20 ring-1 ring-violet/40`} ${u?`pulse`:``}`,style:{left:`${(f-t.t0)/t.span*100}%`,width:`${Math.max((h-f)/t.span*100,.8)}%`}}),(0,m.jsx)(`span`,{className:`mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[10px] text-dim`,style:{left:`min(${(h-t.t0)/t.span*100}%, calc(100% - 44px))`},children:ZT(h-f)})]})]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-3 px-2 pb-1.5 pl-[26px]`,children:[(0,m.jsx)(`span`,{className:`flex h-1.5 w-40 shrink-0 overflow-hidden rounded-full bg-hover`,children:UT.map(e=>c[e.key]>0?(0,m.jsx)(`span`,{className:e.className,style:{width:`${c[e.key]/Math.max(c.total,1)*100}%`}},e.key):null)}),(0,m.jsxs)(`span`,{className:`mono tnum flex flex-wrap gap-2 text-[10px]`,children:[c.started<c.total&&(0,m.jsxs)(`span`,{className:`text-fg-2`,children:[IT(c),` started`]}),UT.map(t=>c[t.key]>0?(0,m.jsxs)(`span`,{className:t.text,children:[c[t.key],` `,t.label,t.key===`skipped`&&e.failFast?` (failFast)`:``]},t.key):null)]})]}),g.length>0&&!r&&(0,m.jsxs)(`div`,{className:`ml-[10px] border-l border-bad/30 pl-1`,children:[(0,m.jsx)(`div`,{className:`mono px-2 text-[10px] text-bad/70`,children:c.failed>g.length?`first ${g.length} of ${c.failed} failed`:`${g.length} failed`}),g.map(e=>(0,m.jsx)(eE,{row:e,...n},e.step.seq))]}),r&&(0,m.jsxs)(`div`,{className:`ml-[10px] border-l border-line-soft pl-1`,children:[(0,m.jsx)(`div`,{className:`flex items-center gap-2 px-2 py-0.5`,children:(0,m.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`mono rounded border px-1.5 text-[10px] transition-colors ${a?`border-bad/40 bg-bad/15 text-bad`:`border-line text-dim hover:text-fg-2`}`,children:`failed only`})}),(0,m.jsx)(iE,{group:e.group,failedOnly:a,live:u&&d,frame:t,rowProps:n},a?`failed`:`all`)]})]})}function iE({group:e,failedOnly:t,live:n,frame:r,rowProps:i}){let a=i.run.id,o=(0,p.useRef)(null),[s,c]=(0,p.useState)(),l=nT({count:s??0,getScrollElement:()=>o.current,estimateSize:()=>nE,measureElement:e=>e.getBoundingClientRect().height,overscan:10}),u=l.getVirtualItems(),d=HT(u[0]?.index,u[u.length-1]?.index),f=Xe({queries:d.map(r=>({queryKey:[`fan`,a,e,t,r],queryFn:()=>XS.fanMembers(a,e,{page:r+1,size:100,failed:t}),refetchInterval:n?5e3:!1}))}),h=f.find(e=>e.data!==void 0)?.data?.meta.total;(0,p.useEffect)(()=>{h!==void 0&&c(h)},[h]);let g=e=>{let t=d.indexOf(Math.floor(e/100));return t<0?void 0:f[t]},_=e=>g(e)?.data?.data[e%100],v=f.find(e=>e.isError);return s===void 0&&v?(0,m.jsxs)(`div`,{className:`mono px-2 py-1 text-[10px] text-bad`,children:[`couldn't load members:`,` `,v.error instanceof Error?v.error.message:String(v.error)]}):s===void 0?(0,m.jsx)(`div`,{className:`mono px-2 py-1 text-[10px] text-faint`,children:`loading members…`}):s===0?(0,m.jsx)(`div`,{className:`mono px-2 py-1 text-[10px] text-faint`,children:t?`no failed members`:`no members`}):(0,m.jsx)(`div`,{ref:o,className:`max-h-[320px] overflow-auto`,children:(0,m.jsx)(`div`,{className:`relative w-full`,style:{height:l.getTotalSize()},children:u.map(e=>{let t=_(e.index);return(0,m.jsx)(`div`,{"data-index":e.index,ref:l.measureElement,className:`absolute inset-x-0 top-0`,style:{transform:`translateY(${e.start}px)`},children:t?(0,m.jsx)(eE,{row:XT(t,void 0,r),...i}):(0,m.jsx)(aE,{index:e.index,page:g(e.index)})},e.key)})})})}function aE({index:e,page:t}){return t?.isError?(0,m.jsxs)(`div`,{className:`mono flex items-center gap-2 px-2 text-[10px] leading-7 text-bad`,style:{height:nE},children:[(0,m.jsxs)(`span`,{className:`truncate`,children:[`#`,e+1,` couldn't load:`,` `,t.error instanceof Error?t.error.message:String(t.error)]}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>void t.refetch(),className:`rounded border border-bad/40 px-1.5 text-bad hover:bg-bad/15`,children:`retry`})]}):(0,m.jsxs)(`div`,{className:`mono px-2 text-[10px] leading-7 text-faint`,style:{height:nE},children:[`#`,e+1,` loading…`]})}function oE({run:e,timeline:t,fans:n=KT,depth:r,selectedKey:i,onSelect:a,onOpenRun:o,expanded:s,onToggleChild:c}){let l=qT(t),{frame:u,rows:d}=(0,p.useMemo)(()=>{let r=Date.now(),i=t.map(e=>{let t=_T(e),n=t===void 0?void 0:l[t];return{step:e,childRun:n,window:JT(e,n,r)}}),a=YT(e,i.map(e=>e.window),n);return{frame:a,rows:i.map(e=>XT(e.step,e.childRun,a,e.window))}},[e,t,n,l]),f=(0,p.useMemo)(()=>MT(t,n),[t,n]),h=(0,p.useMemo)(()=>{let e=new Map;for(let t of d)e.set(t.step.seq,t);return e},[d]),[g,_]=(0,p.useState)(new Set),v={run:e,childRuns:l,depth:r,selectedKey:i,onSelect:a,onOpenRun:o,onToggleChild:c,expanded:s,collapsedSubs:g,toggleSubs:e=>_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,m.jsx)(m.Fragment,{children:f.map(e=>{if(e.kind===`single`){let t=h.get(e.step.seq);return t?(0,m.jsx)(eE,{row:t,...v},t.step.seq):null}if(e.kind===`summary`)return(0,m.jsx)(rE,{fan:e.fan,frame:u,rowProps:v},`fan:${e.fan.group}`);let t=e.steps.map(e=>h.get(e.seq)).filter(e=>e!==void 0);return(0,m.jsx)(tE,{label:e.label,fanFailed:e.steps.some(e=>e.status===`failed`),memberRows:t,rowProps:v},`fan:${e.group}`)})})}function sE({id:e,depth:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:a,onToggleChild:o}){let{data:s}=Qe({queryKey:[`run`,e],queryFn:()=>XS.run(e),refetchInterval:VT});return t>6?null:s?(0,m.jsxs)(`div`,{className:`my-1 rounded-md border border-line bg-sunken/15`,children:[(0,m.jsxs)(`div`,{className:`mono flex items-center gap-2 px-2 py-1 text-[10px] text-dim`,children:[(0,m.jsxs)(`span`,{className:`text-violet`,children:[`⌁ `,s.run.workflow]}),(0,m.jsx)(`span`,{className:`tnum text-faint`,children:e.slice(0,8)}),(0,m.jsx)(`span`,{className:`s-${s.run.status} uppercase`,children:s.run.status}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`ml-auto rounded border border-line px-1.5 text-fg-2 hover:text-fg`,children:`open ↗`})]}),(0,m.jsx)(oE,{run:s.run,timeline:s.timeline,fans:s.fans,depth:t,selectedKey:n,onSelect:r,onOpenRun:i,expanded:a,onToggleChild:o})]}):(0,m.jsx)(`div`,{className:`mono px-2 py-1 text-[10px] text-faint`,children:`loading child run…`})}function cE({run:e,timeline:t,fans:n,selectedKey:r,onSelect:i,onOpenRun:a,expanded:o,onToggleChild:s}){let c=(0,p.useMemo)(()=>YT(e,t.map(e=>[new Date(e.startedAt).getTime(),new Date(e.finishedAt).getTime()]),n??KT).span,[e,t,n]),l=o??new Set,u=s??(()=>{});return(0,m.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-2 pt-3`,children:[(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.2em] text-dim`,children:`spans`}),(0,m.jsxs)(`span`,{className:`mono tnum text-[10px] text-faint`,children:[`total `,ZT(c)]})]}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3`,children:(0,m.jsx)(oE,{run:e,timeline:t,fans:n,depth:0,selectedKey:r,onSelect:i,onOpenRun:a,expanded:l,onToggleChild:u})})]})}function lE(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function uE(e,t){return lE(new Date(t).getTime()-new Date(e).getTime())}function dE(e){return fE(new Date(e).getTime())}function fE(e){return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3})}var pE={ok:`border-good/25 bg-good/10 text-good`,failed:`border-bad/25 bg-bad/10 text-bad`,skipped:`border-warn/25 bg-warn/10 text-warn`},mE={debug:`text-dim`,info:`text-fg-2`,warn:`text-warn`,error:`text-bad`},hE=[`ok`,`failed`,`skipped`];function gE({e}){return(0,m.jsxs)(`div`,{className:`flex gap-2 py-0.5`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-faint tnum`,children:fE(e.at)}),(0,m.jsx)(`span`,{className:`shrink-0 uppercase ${mE[e.level]}`,children:e.level}),(0,m.jsx)(`span`,{className:`min-w-0 break-words text-fg-2`,children:e.message})]})}function _E({sub:e,showGroup:t=!0}){let n=e.terminal?.message!==void 0&&e.terminal.message!==e.name,r=e.phases.length>0||e.logs.length>0||n,[i,a]=(0,p.useState)(e.status===`failed`),o=e.status?pE[e.status]:`border-warn/25 bg-warn/10 text-warn`;return(0,m.jsxs)(`li`,{className:`rounded-md border ${o}`,children:[(0,m.jsxs)(`button`,{type:`button`,disabled:!r,onClick:()=>a(e=>!e),className:`flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left text-[11.5px] disabled:cursor-default`,"aria-expanded":r?i:void 0,children:[(0,m.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[r&&(0,m.jsx)(`span`,{className:`text-[9px] text-dim transition-transform duration-150 ${i?``:`-rotate-90`}`,children:`▼`}),(0,m.jsx)(`span`,{className:`mono truncate text-fg`,children:e.name}),t&&e.group&&(0,m.jsx)(`span`,{className:`mono shrink-0 text-[10px] uppercase tracking-wider text-dim`,children:e.group})]}),(0,m.jsxs)(`span`,{className:`mono flex shrink-0 items-center gap-2 text-[10px] uppercase tracking-wider`,children:[e.durationMs!==void 0&&(0,m.jsx)(`span`,{className:`tnum text-fg-2`,children:lE(e.durationMs)}),(0,m.jsx)(`span`,{children:e.status??`running`})]})]}),i&&(0,m.jsxs)(`div`,{className:`border-t border-line/60 px-2.5 py-2`,children:[e.phases.length>0&&(0,m.jsx)(`ul`,{className:`mono mb-2 flex flex-col gap-0.5 text-[10.5px]`,children:e.phases.map((t,n)=>(0,m.jsxs)(`li`,{className:`flex gap-2`,children:[(0,m.jsx)(`span`,{className:`shrink-0 text-faint tnum`,children:fE(t.at)}),(0,m.jsx)(`span`,{className:`text-fg-2`,children:t.phase}),e.startedAt!==void 0&&(0,m.jsxs)(`span`,{className:`text-faint tnum`,children:[`+`,lE(t.at-e.startedAt)]})]},`${t.at}-${t.phase}-${n}`))}),e.terminal?.message&&e.terminal.message!==e.name&&(0,m.jsx)(`div`,{className:`mono mb-2 rounded border p-2 text-[11px] ${e.status===`failed`?`border-bad/25 bg-bad/10 text-bad`:`border-line bg-sunken/20 text-fg-2`}`,children:e.terminal.message}),e.logs.length>0&&(0,m.jsx)(`div`,{className:`mono flex flex-col gap-0.5 text-[11px]`,children:e.logs.map((e,t)=>(0,m.jsx)(gE,{e},`${e.at}-${t}`))})]})]})}function vE({events:e}){let{subs:t,stepLogs:n}=Xx(e),r=hE.map(e=>[e,t.filter(t=>t.status===e).length]).filter(([,e])=>e>0),i=t.some(e=>e.group);return(0,m.jsxs)(m.Fragment,{children:[t.length>0&&(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,m.jsxs)(`span`,{className:`mono text-[10px] uppercase tracking-[0.18em] text-dim`,children:[`sub-processes · `,t.length]}),(0,m.jsx)(`span`,{className:`mono flex gap-2 text-[10px] uppercase tracking-wider`,children:r.map(([e,t])=>(0,m.jsxs)(`span`,{className:pE[e].split(` `).pop(),children:[t,` `,e]},e))})]}),i?Object.entries(t.reduce((e,t)=>{let n=t.group??`—`;return e[n]===void 0&&(e[n]=[]),e[n].push(t),e},{})).sort(([e],[t])=>e===`—`?1:t===`—`?-1:e.localeCompare(t)).map(([e,t])=>(0,m.jsxs)(`div`,{className:`mb-2`,children:[(0,m.jsx)(`div`,{className:`mono mb-1 text-[10px] uppercase tracking-wider text-dim`,children:e}),(0,m.jsx)(`ul`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,m.jsx)(_E,{sub:e,showGroup:!1},e.id))})]},e)):(0,m.jsx)(`ul`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,m.jsx)(_E,{sub:e},e.id))})]}),n.length>0&&(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-dim`,children:[`logs · `,n.length]}),(0,m.jsx)(`div`,{className:`mono max-h-64 overflow-auto rounded-lg border border-line bg-sunken/40 p-2.5 text-[11px] leading-relaxed`,children:n.map((e,t)=>(0,m.jsx)(gE,{e},`${e.at}-${t}`))})]})]})}function yE({value:e}){let[t,n]=(0,p.useState)(!1);return(0,m.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 rounded border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-dim transition-colors hover:text-fg`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1200)}catch{}},children:[t?(0,m.jsx)(TC,{width:11,height:11}):(0,m.jsx)(DC,{width:11,height:11}),t?`copied`:`copy`]})}function bE({label:e,value:t}){let n=typeof t==`string`?t:JSON.stringify(t,null,2);return(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.18em] text-dim`,children:e}),(0,m.jsx)(yE,{value:n})]}),(0,m.jsx)(`pre`,{className:`mono max-h-64 overflow-auto rounded-lg border border-line bg-sunken/40 p-3 text-[11.5px] leading-relaxed text-fg-2`,children:n})]})}function xE({error:e}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mono mb-1.5 flex items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-bad/80`,children:[(0,m.jsx)(`span`,{children:`error`}),e.code&&(0,m.jsx)(`span`,{className:`rounded border border-bad/30 px-1.5 py-px normal-case tracking-normal text-bad`,children:e.code})]}),(0,m.jsx)(`div`,{className:`mono rounded-lg border border-bad/25 bg-bad/10 p-3 text-[11.5px] leading-relaxed text-bad`,children:e.message})]}),e.details!==void 0&&(0,m.jsx)(bE,{label:`error details`,value:e.details})]})}function SE({k:e,v:t,mono:n=!0}){return(0,m.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 py-1.5`,children:[(0,m.jsx)(`span`,{className:`mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-faint`,children:e}),(0,m.jsx)(`span`,{className:`truncate text-right text-[12px] text-fg ${n?`mono tnum`:``}`,children:t})]})}function CE({id:e,onOpenRun:t}){let{data:n}=Qe({queryKey:[`run`,e],queryFn:()=>XS.run(e),refetchInterval:VT}),[r,i]=(0,p.useState)(new Set);return n?n.timeline.length===0?(0,m.jsxs)(`div`,{className:`mono px-2 py-2 text-[10px] text-faint`,children:[`no steps recorded yet — child `,n.run.status]}):(0,m.jsx)(`div`,{className:`mt-2 max-h-80 space-y-1 overflow-auto rounded-md border border-line bg-sunken/20 p-1.5`,children:(0,m.jsx)(oE,{run:n.run,timeline:n.timeline,depth:0,onSelect:()=>{},onOpenRun:t??(()=>{}),expanded:r,onToggleChild:e=>i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})})}):(0,m.jsx)(`div`,{className:`mono px-2 py-2 text-[10px] text-faint`,children:`loading child run…`})}function wE({step:e,run:t,onClose:n,onOpenRun:r}){let i=_T(e),[a,o]=(0,p.useState)(!1),s=e.status===`failed`,c=e.status===`pending`||e.status===`running`,l=PC(e.kind),u=uE(t.createdAt,e.startedAt),d=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return(0,m.jsxs)(`aside`,{className:`absolute inset-y-0 right-0 z-20 flex w-[380px] max-w-[90%] flex-col border-l border-line bg-panel/95 shadow-2xl backdrop-blur-md rise`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-line px-5 py-4`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`grid h-6 w-6 shrink-0 place-items-center rounded-md ${s?`bg-bad/15 text-bad`:c?`bg-warn/15 text-warn`:`bg-good/15 text-good`}`,children:(0,m.jsx)(l,{width:13,height:13})}),(0,m.jsx)(`h3`,{className:`truncate text-[15px] font-semibold tracking-tight text-fg`,children:e.name})]}),(0,m.jsxs)(`div`,{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status,` · `,FC[e.kind]??e.kind]})]}),(0,m.jsx)(`button`,{type:`button`,onClick:n,className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-line text-dim transition-colors hover:text-fg`,"aria-label":`Close`,children:(0,m.jsx)(EC,{})})]}),(0,m.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4`,children:[(0,m.jsxs)(`div`,{className:`rounded-lg border border-line bg-sunken/20 px-3.5 py-1`,children:[(0,m.jsx)(SE,{k:`seq`,v:`#${e.seq}`}),d>=1&&(0,m.jsx)(SE,{k:`queued`,v:(0,m.jsx)(`span`,{className:`text-info`,children:lE(d)})}),(0,m.jsx)(SE,{k:`duration`,v:c?(0,m.jsx)(`span`,{className:`text-warn`,children:`running…`}):uE(e.startedAt,e.finishedAt)}),(0,m.jsx)(SE,{k:`attempts`,v:(0,m.jsxs)(`span`,{className:e.attempts>1?`text-warn`:``,children:[e.attempts>1&&(0,m.jsx)(kC,{width:11,height:11,className:`mr-1 inline`}),e.attempts]})}),e.workerGroup&&(0,m.jsx)(SE,{k:`worker`,v:`@${e.workerGroup}`}),(0,m.jsx)(SE,{k:`started`,v:dE(e.startedAt)}),!c&&(0,m.jsx)(SE,{k:`finished`,v:dE(e.finishedAt)}),(0,m.jsx)(SE,{k:`offset`,v:`+${u}`})]}),s&&e.error&&(0,m.jsx)(xE,{error:e.error}),e.events&&e.events.length>0&&(0,m.jsx)(vE,{events:e.events}),i&&(0,m.jsxs)(`section`,{className:`rise`,children:[(0,m.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,m.jsx)(`span`,{className:`mono text-[10px] uppercase tracking-[0.18em] text-dim`,children:`child run`}),r&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>r(i),className:`mono rounded border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-dim transition-colors hover:text-fg`,children:`open ↗`})]}),(0,m.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`flex w-full items-center gap-2 rounded-md border border-violet/30 bg-violet/10 px-2.5 py-1.5 text-left transition-colors hover:bg-violet/20`,title:a?`Collapse child run`:`Expand child run inline`,children:[(0,m.jsx)(`span`,{className:`inline-block text-[9px] text-violet transition-transform`,style:{transform:a?`rotate(90deg)`:`rotate(0deg)`},children:`▸`}),(0,m.jsx)(`span`,{className:`mono truncate text-[11px] text-violet`,children:i})]}),a&&(0,m.jsx)(CE,{id:i,onOpenRun:r})]}),e.input!==void 0&&(0,m.jsx)(bE,{label:`input`,value:e.input}),e.output!==void 0&&(0,m.jsx)(bE,{label:`output`,value:e.output})]})]})}var TE=`durable:lifecycle:pending`;function EE(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}function DE(e,t){switch(e.state){case`started`:return`started`;case`owed`:{let n=e.owedSince===void 0?`owed`:`owed for ${EE(t-e.owedSince)}`;return e.orphanAt===void 0?n:`${n} · orphan in ${EE(e.orphanAt-t)}`}case`failed`:return e.error?`failed: ${e.error}`:`failed`;case`coalesced`:return`coalesced`;default:return`not started`}}var OE="No run and nothing owed: its `where` declined the event, or it subscribed after the run settled.",kE="Its last delivery failed: `where` threw, the input was rejected, the start failed, or the sweep dropped it as an orphan. The reason is in the run.trigger_failed event. Republish retries it.",AE=`No live instance registers or announces this subscriber; the lifecycle sweep drops it then and reports run.trigger_failed.`;function jE({status:e}){return e?(0,m.jsx)(nC,{variant:`bare`,className:`s-${e} text-[10px]`,children:e}):null}function ME({runId:e,onOpenRun:t}){return(0,m.jsx)(Wi,{variant:`chip`,size:`micro`,onClick:()=>t(e),className:`mono max-w-[28rem] truncate px-1.5 py-0`,title:e,children:e})}function NE({source:e,onOpenRun:t}){return(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,"data-testid":`lifecycle-source`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:`started by`}),(0,m.jsx)(ME,{runId:e.runId,onOpenRun:t}),(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:`on`}),(0,m.jsx)(nC,{variant:`neutral`,className:J(`text-[10px]`,e.kind===`failed`?`s-failed`:`s-completed`),children:e.kind}),(0,m.jsx)(jE,{status:e.status}),e.traceId&&(0,m.jsxs)(`span`,{className:`ml-1 flex items-center gap-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:`trace`}),(0,m.jsx)(`span`,{className:`mono text-[10px] text-fg-2`,title:`The source run's trace id`,children:e.traceId}),(0,m.jsx)(yE,{value:e.traceId})]})]})}function PE({waitsFor:e=[],awaitedBy:t=[],onOpenRun:n}){return e.length===0&&t.length===0?null:(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1`,children:[e.map(e=>(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,"data-testid":`waits-for`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-warn/80`,children:`Waiting for run`}),(0,m.jsx)(ME,{runId:e.runId,onOpenRun:n}),(0,m.jsx)(jE,{status:e.status})]},`${e.runId}#${e.seq}`)),t.length>0&&(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,"data-testid":`awaited-by`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:`Awaited by`}),t.map(e=>(0,m.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(ME,{runId:e.runId,onOpenRun:n}),(0,m.jsx)(jE,{status:e.status})]},`${e.runId}#${e.seq}`))]})]})}function FE({deliveries:e,errors:t,now:n=Date.now(),onOpenRun:r}){return e.length===0?null:(0,m.jsxs)(`section`,{"aria-label":`Lifecycle subscribers`,className:`mt-3`,children:[(0,m.jsx)(`h3`,{className:`text-[10px] uppercase tracking-wider text-dim`,children:`Lifecycle subscribers`}),(0,m.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1`,children:e.map(e=>{let i=e.state===`failed`?t?.get(e.subscriber):void 0,a=i!==void 0&&e.error===void 0?{...e,error:i}:e;return(0,m.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1.5`,"data-state":a.state,children:[(0,m.jsx)(`span`,{className:`mono text-[12px] text-fg`,children:a.subscriber}),(0,m.jsx)(nC,{variant:a.state===`owed`?`warn`:a.state===`failed`?`destructive`:`neutral`,className:`text-[10px]`,title:a.state===`not-started`?OE:a.state===`failed`?kE:a.orphanAt===void 0?void 0:AE,children:DE(a,n)}),a.runId&&(0,m.jsx)(ME,{runId:a.runId,onOpenRun:r}),a.state===`started`&&(0,m.jsx)(jE,{status:a.status}),a.state===`failed`&&a.error===void 0&&(0,m.jsx)(`span`,{className:`text-[10px] text-dim`,children:`see the run.trigger_failed event for the reason`})]},a.subscriber)})})]})}function IE({tags:e,onChange:t}){let n=e.includes(TE);return(0,m.jsx)(Wi,{variant:`ghost`,size:`micro`,"aria-pressed":n,title:`Settled runs whose lifecycle event is still owed to a subscriber (tag durable:lifecycle:pending)`,onClick:()=>t(n?e.filter(e=>e!==TE):[...e,TE]),className:J(`mono rounded-md border-line`,n&&`border-warn/40 bg-warn/10 text-warn hover:text-warn`),children:`lifecycle pending`})}var LE=class{limit;events=[];pushed=0;listeners=new Set;constructor(e=200){this.limit=e}push(e){this.pushed+=1;let t=[...this.events,{id:this.pushed,event:e}];this.events=t.length>this.limit?t.slice(t.length-this.limit):t;for(let e of this.listeners)e()}snapshot=()=>this.events;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e))};function RE(e,t){if(!e)return t;let n=new Map(e.timeline.map(e=>[e.seq,e]));return{...t,timeline:t.timeline.map(e=>{if((e.status===`pending`||e.status===`running`)&&(e.events?.length??0)===0){let t=n.get(e.seq)?.events;if(t?.length)return{...e,events:t}}return e})}}function zE(e,t,n){if(!e)return e;let r=e.timeline.findIndex(e=>e.seq===t),i=e.timeline[r];if(i===void 0)return e;let a=[...e.timeline];return a[r]={...i,events:[...i.events??[],n]},{...e,timeline:a}}function BE(e,t,n=Date.now){let r=-1/0,i,a=()=>{i=void 0,r=n(),e()};return{call(){if(i!==void 0)return;let e=r+t-n();e<=0?a():i=setTimeout(a,e)},cancel(){i!==void 0&&clearTimeout(i),i=void 0}}}function VE(e){let t=e.lastIndexOf(`~retry~`);return t===-1?void 0:e.slice(0,t)}function HE(e){return(VE(e)??e).match(/^(.*)\.(?:child\.\d+|onError\.\d+)$/)?.[1]||void 0}function UE(e,t){if(t&&e.startsWith(`evt:`))for(let n of[`completed`,`failed`]){let r=`:${n}:${t}`;if(e.endsWith(r)&&e.length>4+r.length)return e.slice(4,-r.length)}}function WE(e){let t=[];if(e.type===`run.triggered`&&e.triggeredRunId&&t.push({rel:`triggered`,runId:e.triggeredRunId}),e.type===`run.started`){let n=UE(e.runId,e.workflow);n&&t.push({rel:`source`,runId:n});let r=HE(e.runId);r&&t.push({rel:`parent`,runId:r})}if(e.type.startsWith(`step.`)&&e.name){let n=_T({name:e.name});n&&t.push({rel:`child`,runId:n})}return t}function GE(e){let t=[];return e.name&&t.push(e.type===`run.triggered`||e.type===`run.trigger_failed`?`subscriber ${e.name}`:e.type===`run.routed`?`handler ${e.name}`:e.name),e.durationMs!==void 0&&t.push(`${e.durationMs}ms`),e.error?.message&&t.push(e.error.message),e.reason&&t.push(e.reason),t.join(` · `)}function KE(e){let t=new Map;for(let{event:n}of e)n.type===`run.trigger_failed`&&n.name&&t.set(n.name,n.error?.message??`unknown error`),n.type===`run.triggered`&&n.name&&t.delete(n.name);return t}function qE(e){return(0,p.useSyncExternalStore)(e.subscribe,e.snapshot,e.snapshot)}var JE={triggered:`started`,source:`started by`,child:`child`,parent:`child of`};function YE(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().slice(11,23)}function XE({tail:e,onOpenRun:t}){let n=qE(e);return(0,m.jsxs)(`section`,{"aria-label":`Events`,className:`mt-3`,"data-testid":`run-events`,children:[(0,m.jsxs)(`h3`,{className:`text-[10px] uppercase tracking-wider text-dim`,children:[`Events`,n.length>0?` · ${n.length}`:``]}),n.length===0?(0,m.jsxs)(`p`,{className:`mt-1 text-[11px] text-dim`,children:[`Live only: the engine events of this run show here as they arrive while the page is open (the last `,e.limit,`). Nothing is stored, so earlier events are not shown.`]}):(0,m.jsx)(`ol`,{className:`mt-1 flex max-h-72 flex-col gap-0.5 overflow-auto`,children:[...n].reverse().map(({id:e,event:n})=>(0,m.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1.5 text-[11px]`,"data-type":n.type,children:[(0,m.jsx)(`span`,{className:`mono text-dim`,children:YE(n.at)}),(0,m.jsx)(nC,{variant:n.type===`run.trigger_failed`||n.type.endsWith(`.failed`)||n.type===`run.unrouted`?`destructive`:`neutral`,className:`mono`,children:n.type}),(0,m.jsx)(`span`,{className:`text-fg-2`,children:GE(n)}),WE(n).map(e=>(0,m.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:JE[e.rel]}),(0,m.jsx)(Wi,{variant:`chip`,size:`micro`,onClick:()=>t(e.runId),className:`mono max-w-[24rem] truncate px-1.5 py-0`,title:e.runId,children:e.runId})]},`${e.rel}:${e.runId}`))]},e))})]})}function ZE({deliveries:e,tail:t,onOpenRun:n}){let r=qE(t);return(0,m.jsx)(FE,{deliveries:e,errors:KE(r),onOpenRun:n})}function QE({run:e,onClose:t}){let n=e.input===void 0&&e.output===void 0&&!e.error;return(0,m.jsxs)(`aside`,{className:`absolute inset-y-0 right-0 z-30 flex w-[380px] max-w-[90%] flex-col border-l border-line bg-panel/95 shadow-2xl backdrop-blur-md rise`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-line px-5 py-4`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`h3`,{className:`truncate text-[15px] font-semibold tracking-tight text-fg`,children:e.workflow}),(0,m.jsxs)(`div`,{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[`run · `,e.status]})]}),(0,m.jsx)(`button`,{type:`button`,onClick:t,className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-line text-dim transition-colors hover:text-fg`,"aria-label":`Close`,children:(0,m.jsx)(EC,{})})]}),(0,m.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4`,children:[e.error&&(0,m.jsx)(xE,{error:e.error}),e.input!==void 0&&(0,m.jsx)(bE,{label:`input`,value:e.input}),e.output!==void 0&&(0,m.jsx)(bE,{label:`output`,value:e.output}),n&&(0,m.jsx)(`div`,{className:`text-sm text-faint`,children:`No input/output recorded.`})]})]})}function $E(e){let t=e.trim();if(t!==``)return JSON.parse(t)}var eD=`Not available on a tenant deployment — delivering signals/updates/tasks needs the control plane.`;function tD({id:e,label:t,hint:n,draft:r,onDraft:i}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`label`,{className:`mono mb-1.5 mt-3 block text-[10px] uppercase tracking-[0.18em] text-dim`,htmlFor:e,children:t}),(0,m.jsx)(`textarea`,{id:e,value:r,spellCheck:!1,placeholder:n,onChange:e=>i(e.target.value),className:`mono h-40 w-full resize-y rounded-lg border border-line bg-sunken/40 p-3 text-[11.5px] leading-relaxed text-fg-2 placeholder:text-faint focus:border-line-strong focus:outline-none`})]})}function nD({runId:e,targets:t,tenantPod:n,onDelivered:r}){let[i,a]=(0,p.useState)(void 0),[o,s]=(0,p.useState)(``),[c,l]=(0,p.useState)(``),[u,d]=(0,p.useState)(void 0),[f,h]=(0,p.useState)(void 0),g=e=>{s(e.verb===`signal`?e.token:``),l(``),d(void 0),h(void 0),a(e)},_=()=>a(void 0),v=()=>{_(),r()},y=e=>{h(KS(e)),d(e instanceof GS||e instanceof Error?e.message:`request failed`)},b=$e({mutationFn:t=>XS.signal(e,t.token,t.payload),onSuccess:v,onError:y}),x=$e({mutationFn:t=>XS.update(e,t.name,t.arg),onSuccess:v,onError:y}),S=$e({mutationFn:t=>XS.completeTask(e,t.name,t.result),onSuccess:v,onError:y}),C=$e({mutationFn:t=>XS.failTask(e,t.name,t.error),onSuccess:v,onError:y}),w=b.isPending||x.isPending||S.isPending||C.isPending;if(t.length===0)return null;let T=()=>{if(!i)return;if(i.verb===`task-fail`){C.mutate({name:i.name,error:c.trim()||`failed from console`});return}let e;try{e=$E(c)}catch(e){d(e instanceof Error?e.message:`Invalid JSON`);return}if(i.verb===`signal`){let t=o.trim();if(!t){d(`token is required`);return}b.mutate({token:t,payload:e})}else i.verb===`update`?x.mutate({name:i.name,arg:e}):S.mutate({name:i.name,result:e})},E=i?.verb===`signal`?`Deliver signal`:i?.verb===`update`?`Send update`:i?.verb===`task-complete`?`Complete task`:`Fail task`,D=i?.verb===`signal`?`resumes ${e} at its ctx.waitForSignal`:i?.verb===`update`?`delivers to ${e}'s ctx.onUpdate("${i.name}") — the workflow's validator arbitrates`:i?`settles ${e}'s external task "${i.name}"`:``;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-info/30 bg-info/10 px-7 py-3`,children:[(0,m.jsx)(`span`,{className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-info/40 bg-info/15 text-sm text-info`,"aria-hidden":!0,children:`✋`}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsx)(`div`,{className:`text-[13px] font-medium text-info`,children:`Waiting on a human`}),(0,m.jsxs)(`div`,{className:`mono truncate text-[11px] text-info/70`,children:[`this run is suspended until someone answers the wait`,t.length===1?``:`s`,` `,`below`]})]}),(0,m.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:t.map(e=>e.kind===`task`?(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,m.jsxs)(`span`,{className:`mono max-w-[180px] truncate text-[10px] text-info/80`,children:[`task `,e.name]}),(0,m.jsxs)(Wi,{variant:`brand`,size:`micro`,disabled:n||w,title:n?eD:`Complete task "${e.name}" with a result`,onClick:()=>g({verb:`task-complete`,name:e.name}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(TC,{width:10,height:10}),`Complete task`]}),(0,m.jsxs)(Wi,{variant:`destructive`,size:`micro`,disabled:n||w,title:n?eD:`Fail task "${e.name}" with a reason`,onClick:()=>g({verb:`task-fail`,name:e.name}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(EC,{width:10,height:10}),`Fail task`]})]},e.token):e.kind===`update`?(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,m.jsxs)(`span`,{className:`mono max-w-[180px] truncate text-[10px] text-info/80`,children:[`update `,e.name]}),(0,m.jsxs)(Wi,{variant:`info`,size:`micro`,disabled:n||w,title:n?eD:`Send a validated update to "${e.name}"`,onClick:()=>g({verb:`update`,name:e.name}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(kC,{width:10,height:10}),`Send update`]})]},e.token):(0,m.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,m.jsxs)(`span`,{className:`mono max-w-[180px] truncate text-[10px] text-info/80`,children:[`signal `,e.token]}),(0,m.jsxs)(Wi,{variant:`info`,size:`micro`,disabled:n||w,title:n?eD:`Deliver a payload on "${e.token}"`,onClick:()=>g({verb:`signal`,token:e.token}),className:`mono uppercase tracking-wider`,children:[(0,m.jsx)(kC,{width:10,height:10}),`Deliver signal`]})]},e.token))})]}),(0,m.jsxs)(zC,{open:i!==void 0,onOpenChange:e=>{e||_()},title:E,description:D,footer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Wi,{variant:`outline`,size:`sm`,onClick:_,children:`Cancel`}),(0,m.jsx)(Wi,{size:`sm`,variant:i?.verb===`task-fail`?`destructive`:`info`,disabled:w,onClick:T,children:E})]}),children:[i?.verb===`signal`&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`label`,{className:`mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-dim`,htmlFor:`deliver-signal-token`,children:`token`}),(0,m.jsx)(LC,{id:`deliver-signal-token`,value:o,onChange:e=>{s(e.target.value),d(void 0)},onClear:()=>s(``),clearLabel:`clear token`,placeholder:`signal token…`,"aria-label":`signal token`}),(0,m.jsx)(tD,{id:`deliver-signal-payload`,label:`payload (json, optional)`,hint:`empty delivers no payload`,draft:c,onDraft:e=>{l(e),d(void 0)}})]}),i?.verb===`update`&&(0,m.jsx)(tD,{id:`send-update-arg`,label:`argument (json, optional)`,hint:`empty sends no argument`,draft:c,onDraft:e=>{l(e),d(void 0)}}),i?.verb===`task-complete`&&(0,m.jsx)(tD,{id:`complete-task-result`,label:`result (json, optional)`,hint:`empty completes with no result`,draft:c,onDraft:e=>{l(e),d(void 0)}}),i?.verb===`task-fail`&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`label`,{className:`mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-dim`,htmlFor:`fail-task-reason`,children:`reason`}),(0,m.jsx)(LC,{id:`fail-task-reason`,value:c,onChange:e=>{l(e.target.value),d(void 0)},onClear:()=>l(``),clearLabel:`clear reason`,placeholder:`failed from console`,"aria-label":`failure reason`})]}),u&&(0,m.jsx)(`p`,{className:`mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad`,children:u}),f&&f.length>0&&(0,m.jsxs)(`div`,{className:`mt-2`,children:[(0,m.jsx)(`div`,{className:`mono mb-1 text-[10px] uppercase tracking-[0.18em] text-dim`,children:`waiting on — pick one`}),(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:f.map(e=>(0,m.jsx)(Wi,{variant:`chip`,size:`micro`,className:`mono`,onClick:()=>{s(e),d(void 0),h(void 0)},children:e},e))})]})]})]})}function rD(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=rD(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var iD={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 Error(`illegal type: `+r);n[r]=[]}return new oD(n)}function oD(e){this._=e}function sD(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}oD.prototype=aD.prototype={constructor:oD,on:function(e,t){var n=this._,r=sD(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=cD(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=lD(n[i],e.name,t);else if(t==null)for(i in n)n[i]=lD(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new oD(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function cD(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function lD(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=iD,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var uD=`http://www.w3.org/1999/xhtml`,dD={svg:`http://www.w3.org/2000/svg`,xhtml:uD,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function fD(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),dD.hasOwnProperty(t)?{space:dD[t],local:e}:e}function pD(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===uD&&t.documentElement.namespaceURI===uD?t.createElement(e):t.createElementNS(n,e)}}function mD(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hD(e){var t=fD(e);return(t.local?mD:pD)(t)}function gD(){}function _D(e){return e==null?gD:function(){return this.querySelector(e)}}function vD(e){typeof e!=`function`&&(e=_D(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new ok(r,this._parents)}function yD(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function bD(){return[]}function xD(e){return e==null?bD:function(){return this.querySelectorAll(e)}}function SD(e){return function(){return yD(e.apply(this,arguments))}}function CD(e){e=typeof e==`function`?SD(e):xD(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new ok(r,i)}function wD(e){return function(){return this.matches(e)}}function TD(e){return function(t){return t.matches(e)}}var ED=Array.prototype.find;function DD(e){return function(){return ED.call(this.children,e)}}function OD(){return this.firstElementChild}function kD(e){return this.select(e==null?OD:DD(typeof e==`function`?e:TD(e)))}var AD=Array.prototype.filter;function jD(){return Array.from(this.children)}function MD(e){return function(){return AD.call(this.children,e)}}function ND(e){return this.selectAll(e==null?jD:MD(typeof e==`function`?e:TD(e)))}function PD(e){typeof e!=`function`&&(e=wD(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new ok(r,this._parents)}function FD(e){return Array(e.length)}function ID(){return new ok(this._enter||this._groups.map(FD),this._parents)}function LD(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}LD.prototype={constructor:LD,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 RD(e){return function(){return e}}function zD(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new LD(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function BD(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new LD(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function VD(e){return e.__data__}function HD(e,t){if(!arguments.length)return Array.from(this,VD);var n=t?BD:zD,r=this._parents,i=this._groups;typeof e!=`function`&&(e=RD(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=UD(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new ok(o,r),o._enter=s,o._exit=c,o}function UD(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function WD(){return new ok(this._exit||this._groups.map(FD),this._parents)}function GD(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function KD(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new ok(s,this._parents)}function qD(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function JD(e){e||=YD;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new ok(i,this._parents).order()}function YD(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function XD(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ZD(){return Array.from(this)}function QD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function $D(){let e=0;for(let t of this)++e;return e}function eO(){return!this.node()}function tO(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function nO(e){return function(){this.removeAttribute(e)}}function rO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function iO(e,t){return function(){this.setAttribute(e,t)}}function aO(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function oO(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function sO(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 cO(e,t){var n=fD(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?rO:nO:typeof t==`function`?n.local?sO:oO:n.local?aO:iO)(n,t))}function lO(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function uO(e){return function(){this.style.removeProperty(e)}}function dO(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fO(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function pO(e,t,n){return arguments.length>1?this.each((t==null?uO:typeof t==`function`?fO:dO)(e,t,n??``)):mO(this.node(),e)}function mO(e,t){return e.style.getPropertyValue(t)||lO(e).getComputedStyle(e,null).getPropertyValue(t)}function hO(e){return function(){delete this[e]}}function gO(e,t){return function(){this[e]=t}}function _O(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function vO(e,t){return arguments.length>1?this.each((t==null?hO:typeof t==`function`?_O:gO)(e,t)):this.node()[e]}function yO(e){return e.trim().split(/^|\s+/)}function bO(e){return e.classList||new xO(e)}function xO(e){this._node=e,this._names=yO(e.getAttribute(`class`)||``)}xO.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function SO(e,t){for(var n=bO(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function CO(e,t){for(var n=bO(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function wO(e){return function(){SO(this,e)}}function TO(e){return function(){CO(this,e)}}function EO(e,t){return function(){(t.apply(this,arguments)?SO:CO)(this,e)}}function DO(e,t){var n=yO(e+``);if(arguments.length<2){for(var r=bO(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?EO:t?wO:TO)(n,t))}function OO(){this.textContent=``}function kO(e){return function(){this.textContent=e}}function AO(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function jO(e){return arguments.length?this.each(e==null?OO:(typeof e==`function`?AO:kO)(e)):this.node().textContent}function MO(){this.innerHTML=``}function NO(e){return function(){this.innerHTML=e}}function PO(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function FO(e){return arguments.length?this.each(e==null?MO:(typeof e==`function`?PO:NO)(e)):this.node().innerHTML}function IO(){this.nextSibling&&this.parentNode.appendChild(this)}function LO(){return this.each(IO)}function RO(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zO(){return this.each(RO)}function BO(e){var t=typeof e==`function`?e:hD(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function VO(){return null}function HO(e,t){var n=typeof e==`function`?e:hD(e),r=t==null?VO:typeof t==`function`?t:_D(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function UO(){var e=this.parentNode;e&&e.removeChild(this)}function WO(){return this.each(UO)}function GO(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KO(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qO(e){return this.select(e?KO:GO)}function JO(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function YO(e){return function(t){e.call(this,t,this.__data__)}}function XO(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function ZO(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function QO(e,t,n){return function(){var r=this.__on,i,a=YO(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function $O(e,t,n){var r=XO(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?QO:ZO,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function ek(e,t,n){var r=lO(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function tk(e,t){return function(){return ek(this,e,t)}}function nk(e,t){return function(){return ek(this,e,t.apply(this,arguments))}}function rk(e,t){return this.each((typeof t==`function`?nk:tk)(e,t))}function*ik(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var ak=[null];function ok(e,t){this._groups=e,this._parents=t}function sk(){return new ok([[document.documentElement]],ak)}function ck(){return this}ok.prototype=sk.prototype={constructor:ok,select:vD,selectAll:CD,selectChild:kD,selectChildren:ND,filter:PD,data:HD,enter:ID,exit:WD,join:GD,merge:KD,selection:ck,order:qD,sort:JD,call:XD,nodes:ZD,node:QD,size:$D,empty:eO,each:tO,attr:cO,style:pO,property:vO,classed:DO,text:jO,html:FO,raise:LO,lower:zO,append:BO,insert:HO,remove:WO,clone:qO,datum:JO,on:$O,dispatch:rk,[Symbol.iterator]:ik};function lk(e){return typeof e==`string`?new ok([[document.querySelector(e)]],[document.documentElement]):new ok([[e]],ak)}var uk=0;function dk(){return new fk}function fk(){this._=`@`+(++uk).toString(36)}fk.prototype=dk.prototype={constructor:fk,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function pk(e){let t;for(;t=e.sourceEvent;)e=t;return e}function mk(e,t){if(e=pk(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var hk={passive:!1},gk={capture:!0,passive:!1};function _k(e){e.stopImmediatePropagation()}function vk(e){e.preventDefault(),e.stopImmediatePropagation()}function yk(e){var t=e.document.documentElement,n=lk(e).on(`dragstart.drag`,vk,gk);`onselectstart`in t?n.on(`selectstart.drag`,vk,gk):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function bk(e,t){var n=e.document.documentElement,r=lk(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,vk,gk),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var xk=e=>()=>e;function Sk(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Sk.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ck(e){return!e.ctrlKey&&!e.button}function wk(){return this.parentNode}function Tk(e,t){return t??{x:e.x,y:e.y}}function Ek(){return navigator.maxTouchPoints||`ontouchstart`in this}function Dk(){var e=Ck,t=wk,n=Tk,r=Ek,i={},a=aD(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,hk).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(lk(n.view).on(`mousemove.drag`,m,gk).on(`mouseup.drag`,h,gk),yk(n.view),_k(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(vk(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){lk(e.view).on(`mousemove.drag mouseup.drag`,null),bk(e.view,l),vk(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(_k(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(vk(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(_k(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=mk(l||r,t),p,m,h;if((h=n.call(e,new Sk(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=mk(l||a,t),_=o}u.call(r,e,new Sk(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:xk(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:xk(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:xk(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:xk(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Ok(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function kk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ak(){}var jk=.7,Mk=1/jk,Nk=`\\s*([+-]?\\d+)\\s*`,Pk=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Fk=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Ik=/^#([0-9a-f]{3,8})$/,Lk=RegExp(`^rgb\\(${Nk},${Nk},${Nk}\\)$`),Rk=RegExp(`^rgb\\(${Fk},${Fk},${Fk}\\)$`),zk=RegExp(`^rgba\\(${Nk},${Nk},${Nk},${Pk}\\)$`),Bk=RegExp(`^rgba\\(${Fk},${Fk},${Fk},${Pk}\\)$`),Vk=RegExp(`^hsl\\(${Pk},${Fk},${Fk}\\)$`),Hk=RegExp(`^hsla\\(${Pk},${Fk},${Fk},${Pk}\\)$`),Uk={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};Ok(Ak,Jk,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Wk,formatHex:Wk,formatHex8:Gk,formatHsl:Kk,formatRgb:qk,toString:qk});function Wk(){return this.rgb().formatHex()}function Gk(){return this.rgb().formatHex8()}function Kk(){return sA(this).formatHsl()}function qk(){return this.rgb().formatRgb()}function Jk(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Ik.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Yk(t):n===3?new $k(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Xk(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Xk(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=Lk.exec(e))?new $k(t[1],t[2],t[3],1):(t=Rk.exec(e))?new $k(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=zk.exec(e))?Xk(t[1],t[2],t[3],t[4]):(t=Bk.exec(e))?Xk(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Vk.exec(e))?oA(t[1],t[2]/100,t[3]/100,1):(t=Hk.exec(e))?oA(t[1],t[2]/100,t[3]/100,t[4]):Uk.hasOwnProperty(e)?Yk(Uk[e]):e===`transparent`?new $k(NaN,NaN,NaN,0):null}function Yk(e){return new $k(e>>16&255,e>>8&255,e&255,1)}function Xk(e,t,n,r){return r<=0&&(e=t=n=NaN),new $k(e,t,n,r)}function Zk(e){return e instanceof Ak||(e=Jk(e)),e?(e=e.rgb(),new $k(e.r,e.g,e.b,e.opacity)):new $k}function Qk(e,t,n,r){return arguments.length===1?Zk(e):new $k(e,t,n,r??1)}function $k(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ok($k,Qk,kk(Ak,{brighter(e){return e=e==null?Mk:Mk**+e,new $k(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?jk:jk**+e,new $k(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $k(iA(this.r),iA(this.g),iA(this.b),rA(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:eA,formatHex:eA,formatHex8:tA,formatRgb:nA,toString:nA}));function eA(){return`#${aA(this.r)}${aA(this.g)}${aA(this.b)}`}function tA(){return`#${aA(this.r)}${aA(this.g)}${aA(this.b)}${aA((isNaN(this.opacity)?1:this.opacity)*255)}`}function nA(){let e=rA(this.opacity);return`${e===1?`rgb(`:`rgba(`}${iA(this.r)}, ${iA(this.g)}, ${iA(this.b)}${e===1?`)`:`, ${e})`}`}function rA(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function iA(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function aA(e){return e=iA(e),(e<16?`0`:``)+e.toString(16)}function oA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new lA(e,t,n,r)}function sA(e){if(e instanceof lA)return new lA(e.h,e.s,e.l,e.opacity);if(e instanceof Ak||(e=Jk(e)),!e)return new lA;if(e instanceof lA)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new lA(o,s,c,e.opacity)}function cA(e,t,n,r){return arguments.length===1?sA(e):new lA(e,t,n,r??1)}function lA(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ok(lA,cA,kk(Ak,{brighter(e){return e=e==null?Mk:Mk**+e,new lA(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jk:jk**+e,new lA(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new $k(fA(e>=240?e-240:e+120,i,r),fA(e,i,r),fA(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new lA(uA(this.h),dA(this.s),dA(this.l),rA(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=rA(this.opacity);return`${e===1?`hsl(`:`hsla(`}${uA(this.h)}, ${dA(this.s)*100}%, ${dA(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function uA(e){return e=(e||0)%360,e<0?e+360:e}function dA(e){return Math.max(0,Math.min(1,e||0))}function fA(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var pA=Math.PI/180,mA=180/Math.PI,hA=18,gA=.96422,_A=1,vA=.82521,yA=4/29,bA=6/29,xA=3*bA*bA,SA=bA*bA*bA;function CA(e){if(e instanceof TA)return new TA(e.l,e.a,e.b,e.opacity);if(e instanceof MA)return NA(e);e instanceof $k||(e=Zk(e));var t=kA(e.r),n=kA(e.g),r=kA(e.b),i=EA((.2225045*t+.7168786*n+.0606169*r)/_A),a,o;return t===n&&n===r?a=o=i:(a=EA((.4360747*t+.3850649*n+.1430804*r)/gA),o=EA((.0139322*t+.0971045*n+.7141733*r)/vA)),new TA(116*i-16,500*(a-i),200*(i-o),e.opacity)}function wA(e,t,n,r){return arguments.length===1?CA(e):new TA(e,t,n,r??1)}function TA(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Ok(TA,wA,kk(Ak,{brighter(e){return new TA(this.l+hA*(e??1),this.a,this.b,this.opacity)},darker(e){return new TA(this.l-hA*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=gA*DA(t),e=_A*DA(e),n=vA*DA(n),new $k(OA(3.1338561*t-1.6168667*e-.4906146*n),OA(-.9787684*t+1.9161415*e+.033454*n),OA(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function EA(e){return e>SA?e**(1/3):e/xA+yA}function DA(e){return e>bA?e*e*e:xA*(e-yA)}function OA(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function kA(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function AA(e){if(e instanceof MA)return new MA(e.h,e.c,e.l,e.opacity);if(e instanceof TA||(e=CA(e)),e.a===0&&e.b===0)return new MA(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*mA;return new MA(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function jA(e,t,n,r){return arguments.length===1?AA(e):new MA(e,t,n,r??1)}function MA(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function NA(e){if(isNaN(e.h))return new TA(e.l,0,0,e.opacity);var t=e.h*pA;return new TA(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Ok(MA,jA,kk(Ak,{brighter(e){return new MA(this.h,this.c,this.l+hA*(e??1),this.opacity)},darker(e){return new MA(this.h,this.c,this.l-hA*(e??1),this.opacity)},rgb(){return NA(this).rgb()}}));var PA=-.14861,FA=1.78277,IA=-.29227,LA=-.90649,RA=1.97294,zA=RA*LA,BA=RA*FA,VA=FA*IA-LA*PA;function HA(e){if(e instanceof WA)return new WA(e.h,e.s,e.l,e.opacity);e instanceof $k||(e=Zk(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(VA*r+zA*t-BA*n)/(VA+zA-BA),a=r-i,o=(RA*(n-i)-IA*a)/LA,s=Math.sqrt(o*o+a*a)/(RA*i*(1-i)),c=s?Math.atan2(o,a)*mA-120:NaN;return new WA(c<0?c+360:c,s,i,e.opacity)}function UA(e,t,n,r){return arguments.length===1?HA(e):new WA(e,t,n,r??1)}function WA(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ok(WA,UA,kk(Ak,{brighter(e){return e=e==null?Mk:Mk**+e,new WA(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jk:jk**+e,new WA(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*pA,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new $k(255*(t+n*(PA*r+FA*i)),255*(t+n*(IA*r+LA*i)),255*(t+RA*r*n),this.opacity)}}));var GA=e=>()=>e;function KA(e,t){return function(n){return e+n*t}}function qA(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function JA(e,t){var n=t-e;return n?KA(e,n>180||n<-180?n-360*Math.round(n/360):n):GA(isNaN(e)?t:e)}function YA(e){return(e=+e)==1?XA:function(t,n){return n-t?qA(t,n,e):GA(isNaN(t)?n:t)}}function XA(e,t){var n=t-e;return n?KA(e,n):GA(isNaN(e)?t:e)}var ZA=(function e(t){var n=YA(t);function r(e,t){var r=n((e=Qk(e)).r,(t=Qk(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=XA(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function QA(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function $A(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ej(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=lj(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function tj(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function nj(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function rj(e,t){var n={},r={},i;for(i in typeof e==`object`&&e||(e={}),typeof t==`object`&&t||(t={}),t)i in e?n[i]=lj(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var ij=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,aj=new RegExp(ij.source,`g`);function oj(e){return function(){return e}}function sj(e){return function(t){return e(t)+``}}function cj(e,t){var n=ij.lastIndex=aj.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=ij.exec(e))&&(i=aj.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:nj(r,i)})),n=aj.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?sj(c[0].x):oj(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function lj(e,t){var n=typeof t,r;return t==null||n===`boolean`?GA(t):(n===`number`?nj:n===`string`?(r=Jk(t))?(t=r,ZA):cj:t instanceof Jk?ZA:t instanceof Date?tj:$A(t)?QA:Array.isArray(t)?ej:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?rj:nj)(e,t)}var uj=180/Math.PI,dj={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function fj(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*uj,skewX:Math.atan(c)*uj,scaleX:o,scaleY:s}}var pj;function mj(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?dj:fj(t.a,t.b,t.c,t.d,t.e,t.f)}function hj(e){return e==null||(pj||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),pj.setAttribute(`transform`,e),!(e=pj.transform.baseVal.consolidate()))?dj:(e=e.matrix,fj(e.a,e.b,e.c,e.d,e.e,e.f))}function gj(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:nj(e,i)},{i:c-2,x:nj(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:nj(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:nj(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:nj(e,n)},{i:s-2,x:nj(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var _j=gj(mj,`px, `,`px)`,`deg)`),vj=gj(hj,`, `,`)`,`)`),yj=1e-12;function bj(e){return((e=Math.exp(e))+1/e)/2}function xj(e){return((e=Math.exp(e))-1/e)/2}function Sj(e){return((e=Math.exp(2*e))-1)/(e+1)}var Cj=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<yj)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=bj(y),c=s/(n*g)*(i*Sj(t*r+y)-xj(y));return[a+c*d,o+c*f,s*i/bj(t*r+y)]}}return m.duration=Math.abs(h)*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4);function wj(e){return(function t(n){n=+n;function r(t,r){var i=e((t=UA(t)).h,(r=UA(r)).h),a=XA(t.s,r.s),o=XA(t.l,r.l),s=XA(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}wj(JA),wj(XA);var Tj=0,Ej=0,Dj=0,Oj=1e3,kj,Aj,jj=0,Mj=0,Nj=0,Pj=typeof performance==`object`&&performance.now?performance:Date,Fj=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ij(){return Mj||=(Fj(Lj),Pj.now()+Nj)}function Lj(){Mj=0}function Rj(){this._call=this._time=this._next=null}Rj.prototype=zj.prototype={constructor:Rj,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Ij():+n)+(t==null?0:+t),!this._next&&Aj!==this&&(Aj?Aj._next=this:kj=this,Aj=this),this._call=e,this._time=n,Wj()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wj())}};function zj(e,t,n){var r=new Rj;return r.restart(e,t,n),r}function Bj(){Ij(),++Tj;for(var e=kj,t;e;)(t=Mj-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tj}function Vj(){Mj=(jj=Pj.now())+Nj,Tj=Ej=0;try{Bj()}finally{Tj=0,Uj(),Mj=0}}function Hj(){var e=Pj.now(),t=e-jj;t>Oj&&(Nj-=t,jj=e)}function Uj(){for(var e,t=kj,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:kj=n);Aj=e,Wj(r)}function Wj(e){Tj||(Ej&&=clearTimeout(Ej),e-Mj>24?(e<1/0&&(Ej=setTimeout(Vj,Math.ceil(e-Pj.now()-Nj)+1)),Dj&&=clearInterval(Dj)):(Dj||=(jj=Pj.now(),setInterval(Hj,Oj)),Tj=1,Fj(Vj)))}function Gj(e,t,n){var r=new Rj;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}function Kj(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var qj=3;(function e(t){t=+t;function n(e){return e**+t}return n.exponent=e,n})(qj),(function e(t){t=+t;function n(e){return 1-(1-e)**t}return n.exponent=e,n})(qj),(function e(t){t=+t;function n(e){return((e*=2)<=1?e**+t:2-(2-e)**t)/2}return n.exponent=e,n})(qj);function Jj(e){return(2**(-10*e)-.0009765625)*1.0009775171065494}var Yj=4/11;1/Yj/Yj;var Xj=1.70158;(function e(t){t=+t;function n(e){return(e=+e)*e*(t*(e-1)+e)}return n.overshoot=e,n})(Xj),(function e(t){t=+t;function n(e){return--e*e*((e+1)*t+e)+1}return n.overshoot=e,n})(Xj),(function e(t){t=+t;function n(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return n.overshoot=e,n})(Xj);var Zj=2*Math.PI,Qj=1,$j=.3;(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Zj);function i(e){return t*Jj(- --e)*Math.sin((r-e)/n)}return i.amplitude=function(t){return e(t,n*Zj)},i.period=function(n){return e(t,n)},i})(Qj,$j),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Zj);function i(e){return 1-t*Jj(e=+e)*Math.sin((e+r)/n)}return i.amplitude=function(t){return e(t,n*Zj)},i.period=function(n){return e(t,n)},i})(Qj,$j),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Zj);function i(e){return((e=e*2-1)<0?t*Jj(-e)*Math.sin((r-e)/n):2-t*Jj(e)*Math.sin((r+e)/n))/2}return i.amplitude=function(t){return e(t,n*Zj)},i.period=function(n){return e(t,n)},i})(Qj,$j);var eM=aD(`start`,`end`,`cancel`,`interrupt`),tM=[],nM=0,rM=1,iM=2,aM=3,oM=4,sM=5,cM=6;function lM(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;pM(e,n,{name:t,index:r,group:i,on:eM,tween:tM,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:nM})}function uM(e,t){var n=fM(e,t);if(n.state>nM)throw Error(`too late; already scheduled`);return n}function dM(e,t){var n=fM(e,t);if(n.state>aM)throw Error(`too late; already running`);return n}function fM(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function pM(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zj(a,0,n.time);function a(e){n.state=rM,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==rM)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===aM)return Gj(o);f.state===oM?(f.state=cM,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=cM,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Gj(function(){n.state===aM&&(n.state=oM,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=iM,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===iM){for(n.state=aM,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=sM,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===sM&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=cM,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function mM(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>iM&&r.state<sM,r.state=cM,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function hM(e){return this.each(function(){mM(this,e)})}function gM(e,t){var n,r;return function(){var i=dM(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function _M(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=dM(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function vM(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=fM(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?gM:_M)(n,e,t))}function yM(e,t,n){var r=e._id;return e.each(function(){var e=dM(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return fM(e,r).value[t]}}function bM(e,t){var n;return(typeof t==`number`?nj:t instanceof Jk?ZA:(n=Jk(t))?(t=n,ZA):cj)(e,t)}function xM(e){return function(){this.removeAttribute(e)}}function SM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function CM(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function wM(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function TM(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function EM(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function DM(e,t){var n=fD(e),r=n===`transform`?vj:bM;return this.attrTween(e,typeof t==`function`?(n.local?EM:TM)(n,r,yM(this,`attr.`+e,t)):t==null?(n.local?SM:xM)(n):(n.local?wM:CM)(n,r,t))}function OM(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function kM(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function AM(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&kM(e,i)),n}return i._value=t,i}function jM(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&OM(e,i)),n}return i._value=t,i}function MM(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=fD(e);return this.tween(n,(r.local?AM:jM)(r,t))}function NM(e,t){return function(){uM(this,e).delay=+t.apply(this,arguments)}}function PM(e,t){return t=+t,function(){uM(this,e).delay=t}}function FM(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?NM:PM)(t,e)):fM(this.node(),t).delay}function IM(e,t){return function(){dM(this,e).duration=+t.apply(this,arguments)}}function LM(e,t){return t=+t,function(){dM(this,e).duration=t}}function RM(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?IM:LM)(t,e)):fM(this.node(),t).duration}function zM(e,t){if(typeof t!=`function`)throw Error();return function(){dM(this,e).ease=t}}function BM(e){var t=this._id;return arguments.length?this.each(zM(t,e)):fM(this.node(),t).ease}function VM(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();dM(this,e).ease=n}}function HM(e){if(typeof e!=`function`)throw Error();return this.each(VM(this._id,e))}function UM(e){typeof e!=`function`&&(e=wD(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new vN(r,this._parents,this._name,this._id)}function WM(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new vN(o,this._parents,this._name,this._id)}function GM(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function KM(e,t,n){var r,i,a=GM(t)?uM:dM;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function qM(e,t){var n=this._id;return arguments.length<2?fM(this.node(),n).on.on(e):this.each(KM(n,e,t))}function JM(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function YM(){return this.on(`end.remove`,JM(this._id))}function XM(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=_D(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,lM(l[f],t,n,f,l,fM(u,n)));return new vN(a,this._parents,t,n)}function ZM(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=xD(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=fM(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&lM(p,t,n,h,f,m);a.push(f),o.push(u)}return new vN(a,o,t,n)}var QM=sk.prototype.constructor;function $M(){return new QM(this._groups,this._parents)}function eN(e,t){var n,r,i;return function(){var a=mO(this,e),o=(this.style.removeProperty(e),mO(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function tN(e){return function(){this.style.removeProperty(e)}}function nN(e,t,n){var r,i=n+``,a;return function(){var o=mO(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function rN(e,t,n){var r,i,a;return function(){var o=mO(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),mO(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function iN(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=dM(this,e),l=c.on,u=c.value[a]==null?s||=tN(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function aN(e,t,n){var r=(e+=``)==`transform`?_j:bM;return t==null?this.styleTween(e,eN(e,r)).on(`end.style.`+e,tN(e)):typeof t==`function`?this.styleTween(e,rN(e,r,yM(this,`style.`+e,t))).each(iN(this._id,e)):this.styleTween(e,nN(e,r,t),n).on(`end.style.`+e,null)}function oN(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function sN(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&oN(e,a,n)),r}return a._value=t,a}function cN(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,sN(e,t,n??``))}function lN(e){return function(){this.textContent=e}}function uN(e){return function(){var t=e(this);this.textContent=t??``}}function dN(e){return this.tween(`text`,typeof e==`function`?uN(yM(this,`text`,e)):lN(e==null?``:e+``))}function fN(e){return function(t){this.textContent=e.call(this,t)}}function pN(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&fN(r)),t}return r._value=e,r}function mN(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,pN(e))}function hN(){for(var e=this._name,t=this._id,n=yN(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=fM(c,t);lM(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new vN(r,this._parents,e,n)}function gN(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=dM(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var _N=0;function vN(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function yN(){return++_N}var bN=sk.prototype;vN.prototype={constructor:vN,select:XM,selectAll:ZM,selectChild:bN.selectChild,selectChildren:bN.selectChildren,filter:UM,merge:WM,selection:$M,transition:hN,call:bN.call,nodes:bN.nodes,node:bN.node,size:bN.size,empty:bN.empty,each:bN.each,on:qM,attr:DM,attrTween:MM,style:aN,styleTween:cN,text:dN,textTween:mN,remove:YM,tween:vM,delay:FM,duration:RM,ease:BM,easeVarying:HM,end:gN,[Symbol.iterator]:bN[Symbol.iterator]};var xN={time:null,delay:0,duration:250,ease:Kj};function SN(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function CN(e){var t,n;e instanceof vN?(t=e._id,e=e._name):(t=yN(),(n=xN).time=Ij(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&lM(c,e,t,l,o,n||SN(c,t));return new vN(r,this._parents,e,t)}sk.prototype.interrupt=hM,sk.prototype.transition=CN;var wN=e=>()=>e;function TN(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function EN(e,t,n){this.k=e,this.x=t,this.y=n}EN.prototype={constructor:EN,scale:function(e){return e===1?this:new EN(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new EN(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 DN=new EN(1,0,0);ON.prototype=EN.prototype;function ON(e){for(;!e.__zoom;)if(!(e=e.parentNode))return DN;return e.__zoom}function kN(e){e.stopImmediatePropagation()}function AN(e){e.preventDefault(),e.stopImmediatePropagation()}function jN(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function MN(){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 NN(){return this.__zoom||DN}function PN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function FN(){return navigator.maxTouchPoints||`ontouchstart`in this}function IN(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function LN(){var e=jN,t=MN,n=IN,r=PN,i=FN,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Cj,l=aD(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,NN).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,NN),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(DN.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new EN(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new EN(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new EN(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=lk(this.that).datum();l.call(e,this.that,new TN(e,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=mk(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],mM(this),s.start();AN(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=lk(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=mk(t,i),l=t.clientX,u=t.clientY;yk(t.view),kN(t),a.mouse=[c,this.__zoom.invert(c)],mM(this),a.start();function d(e){if(AN(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=mk(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),bk(e.view,a.moved),AN(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=mk(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);AN(r),s>0?lk(this).transition().duration(s).call(x,d,c,r):lk(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(kN(t),s=0;s<i;++s)c=r[s],l=mk(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),mM(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(AN(e),s=0;s<a;++s)c=i[s],l=mk(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(kN(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=mk(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=lk(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:wN(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:wN(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:wN(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:wN([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var RN={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},zN=[[-1/0,-1/0],[1/0,1/0]],BN=[`Enter`,` `,`Escape`],VN={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},HN;(function(e){e.Strict=`strict`,e.Loose=`loose`})(HN||={});var UN;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(UN||={});var WN;(function(e){e.Partial=`partial`,e.Full=`full`})(WN||={});var GN={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},KN;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(KN||={});var qN;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(qN||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var JN={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top},YN=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,XN=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),ZN=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),QN=(e,t=[0,0])=>{let{width:n,height:r}=MP(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},$N=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):ZN(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,fP(e,gP(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?mP(r):{x:0,y:0,width:0,height:0}},eP=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=fP(n,gP(e)),r=!0)}),r?mP(n):{x:0,y:0,width:0,height:0}},tP=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=vP(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},nP=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function rP(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=MP(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function iP({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=kP(eP(rP(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function aP({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,RN.error005());else{let{width:e,height:t}=MP(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&jP(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=jP(d)?cP(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,RN.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function oP({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=nP(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var sP=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),cP=(e={x:0,y:0},t,n)=>({x:sP(e.x,t[0][0],t[1][0]-(n?.width??0)),y:sP(e.y,t[0][1],t[1][1]-(n?.height??0))});function lP(e,t,n){let{width:r,height:i}=MP(n),{x:a,y:o}=n.internals.positionAbsolute;return cP(e,[[a,o],[a+r,o+i]],t)}var uP=(e,t,n)=>e<t?sP(Math.abs(e-t),1,t)/t:e>n?-sP(Math.abs(e-n),1,t)/t:0,dP=(e,t,n=15,r=40)=>[uP(e.x,r,t.width-r)*n,uP(e.y,r,t.height-r)*n],fP=(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)}),pP=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),mP=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),hP=(e,t=[0,0])=>{let{x:n,y:r}=ZN(e)?e.internals.positionAbsolute:QN(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},gP=(e,t=[0,0])=>{let{x:n,y:r}=ZN(e)?e.internals.positionAbsolute:QN(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},_P=(e,t)=>mP(fP(pP(e),pP(t))),vP=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},yP=(e,t)=>vP(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),bP=e=>xP(e.width)&&xP(e.height)&&xP(e.x)&&xP(e.y),xP=e=>!isNaN(e)&&isFinite(e),SP=(e,t)=>(e,t)=>{},CP=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),wP=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?CP(s,o):s},TP=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function EP(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function DP(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=EP(e,n),i=EP(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=EP(e.top??e.y??0,n),i=EP(e.bottom??e.y??0,n),a=EP(e.left??e.x??0,t),o=EP(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function OP(e,t,n,r,i,a){let{x:o,y:s}=TP(e,[t,n,r]),{x:c,y:l}=TP({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var kP=(e,t,n,r,i,a)=>{let o=DP(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=sP(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=OP(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},AP=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function jP(e){return e!=null&&e!==`parent`}function MP(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function NP(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function PP(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function FP(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function IP(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function LP(e){return{...VN,...e||{}}}function RP(e){return e===null?null:e?`valid`:`invalid`}function zP(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=GP(e),s=wP({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?CP(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var BP=e=>({width:e.offsetWidth,height:e.offsetHeight}),VP=e=>e?.getRootNode?.()||window?.document,HP=[`INPUT`,`SELECT`,`TEXTAREA`];function UP(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?HP.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var WP=e=>`clientX`in e,GP=(e,t)=>{let n=WP(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},KP=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...BP(t)}})};function qP({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function JP(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function YP({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-JP(t-r,a),n];case $.Right:return[t+JP(r-t,a),n];case $.Top:return[t,n-JP(n-i,a)];case $.Bottom:return[t,n+JP(i-n,a)]}}function XP({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=YP({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=YP({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=qP({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function ZP({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function QP({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function $P({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=fP(gP(e),gP(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),yP({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},mP(a))>0}var eF=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,tF=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),nF=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,RN.error006()),t;let r=n.getEdgeId||eF,i;return i=YN(e)?{...e}:{...e,id:r(e)},tF(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function rF({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=ZP({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var iF={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},aF=({source:e,sourcePosition:t=$.Bottom,target:n})=>t===$.Left||t===$.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},oF=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),sF=(e,t,n)=>e.x===t.x&&t.x===n.x&&(t.y-e.y)*(n.y-t.y)>=0||e.y===t.y&&t.y===n.y&&(t.x-e.x)*(n.x-t.x)>=0;function cF({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=iF[t],c=iF[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=aF({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=ZP({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y},C=[];for(let t of[e,x,...m,S,n]){let[e,n]=C.slice(-2);n&&sF(e,n,t)&&C.pop(),C.push(t)}return[C,h,g,y,b]}function lF(e,t,n,r){let i=Math.min(oF(e,t)/2,oF(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function uF({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=cF({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=lF(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function dF(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function fF(e){let{sourceNode:t,targetNode:n}=e;if(!dF(t)||!dF(n))return null;let r=t.internals.handleBounds||pF(t.handles),i=n.internals.handleBounds||pF(n.handles),a=hF(r?.source??[],e.sourceHandle),o=hF(e.connectionMode===HN.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,RN.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=mF(t,a,s),u=mF(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function pF(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function mF(e,t,n=$.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??MP(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case $.Top:return{x:i+o/2,y:a};case $.Right:return{x:i+o,y:a+s/2};case $.Bottom:return{x:i+o/2,y:a+s};case $.Left:return{x:i,y:a+s/2}}}function hF(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function gF(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function _F(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=gF(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var vF=1e3,yF=10,bF={nodeOrigin:[0,0],nodeExtent:zN,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},xF={...bF,checkEquality:!0};function SF(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function CF(e,t,n){let r=SF(bF,n);for(let n of e.values())if(n.parentId)OF(n,e,t,r);else{let e=cP(QN(n,r.nodeOrigin),jP(n.extent)?n.extent:r.nodeExtent,MP(n));n.internals.positionAbsolute=e}}function wF(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function TF(e){return e===`manual`}function EF(e,t,n,r={}){let i=SF(xF,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!TF(i.zIndexMode)?vF:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=cP(QN(u,i.nodeOrigin),jP(u.extent)?u.extent:i.nodeExtent,MP(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:wF(u,e),z:kF(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}e.measured!==void 0&&e.measured.width!==void 0&&e.measured.height!==void 0||e.hidden||(c=!1),u.parentId&&OF(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function DF(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function OF(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=SF(bF,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}DF(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*yF),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=AF(e,u,o,s,a&&!TF(c)?vF:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function kF(e,t,n){let r=xP(e.zIndex)?e.zIndex:0;return TF(n)?r:r+(e.selected?t:0)}function AF(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=MP(e),l=QN(e,n),u=jP(e.extent)?cP(l,e.extent,c):l,d=cP({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=lP(d,c,t));let f=kF(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function jF(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=_P(a.get(n.parentId)?.expandedRect??hP(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=MP(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function MF(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=BP(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=jP(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=lP(h,s,n))}else m&&(h=cP(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:KP(`source`,r.nodeElement,p,d,e.id),target:KP(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&OF(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:hP(g,i)}))}}if(f.length>0){let e=jF(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function NF({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function PF(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function FF(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;PF(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),PF(`target`,s,c,e,i,o),t.set(r.id,r)}}function IF(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:IF(n,t):!1}function LF(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function RF(e,t,n,r,i){let a=new Map;for(let[o,s]of e)if((i?s.id===r:s.selected||s.id===r)&&(i||!s.parentId||!IF(s,e))&&(s.draggable||t&&s.draggable===void 0)){let t=e.get(o);t&&a.set(o,{id:o,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return a}function zF({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function BF({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=CP(a,t);return{x:o.x-a.x,y:o.y-a.y}}function VF({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=lk(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?pP(eP(s)):null,x=v&&l?BF({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:CP(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=aP({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=zF({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=dP(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0;let v=!!b&&!o&&!i.get(b)?.selected;m&&y||o||!b||i.get(b)?.selected||_(),y&&m&&b&&e?.(b);let x=zP(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=x,s=RF(i,c,x,b,v),s.size>0&&(n||h||!b&&g)){let[e,t]=zF({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=Dk().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=zP(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=GP(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=zP(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=GP(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=GP(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p)p&&s.size>0&&t().updateNodePositions(s,!1);else if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=zF({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!LF(t,`.${g}`,v))&&(!_||LF(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function HF(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())yP(i,hP(e))>0&&r.push(e);return r}var UF=250;function WF(e,t,n,r){let i=[],a=1/0,o=HF(e,n,t+UF);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=mF(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function GF(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...mF(o,c,c.position,!0)}:c}function KF(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function qF(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var JF=()=>!0;function YF(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=JF,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=VP(e.target),E=0,D,{x:O,y:k}=GP(e),A=KF(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=GF(i,A,r,c,t);if(!N)return;let P=GP(e,j),F=!1,I=null,L=!1,R=null;function z(){if(!u||!j)return;let[e,t]=dP(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(z)}let B={...N,nodeId:i,type:A,position:N.position},ee=c.get(i),V={inProgress:!0,isValid:null,from:mF(ee,B,$.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:ee,to:P,toHandle:null,toPosition:JN[B.position],toNode:null,pointer:P};function te(){M=!0,y(V),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&te();function ne(e){if(!M){let{x:t,y:n}=GP(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;te()}if(!x()||!B){H(e);return}let a=b();P=GP(e,j),D=WF(wP(P,a,!1,[1,1]),n,c,B),F||=(z(),!0);let s=XF(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});R=s.handleDomNode,I=s.connection,L=qF(!!D,s.isValid);let u=c.get(i),f=u?mF(u,B,$.Left,!0):V.from,p={...V,from:f,isValid:L,to:s.toHandle&&L?TP({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:JN[B.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),V=p}function H(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||R)&&I&&L&&h?.(I);let{inProgress:t,...n}=V,r={...n,toPosition:V.toHandle?V.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,R=null,T.removeEventListener(`mousemove`,ne),T.removeEventListener(`mouseup`,H),T.removeEventListener(`touchmove`,ne),T.removeEventListener(`touchend`,H)}}T.addEventListener(`mousemove`,ne),T.addEventListener(`mouseup`,H),T.addEventListener(`touchmove`,ne),T.addEventListener(`touchend`,H)}function XF(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=JF,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=GP(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=KF(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===HN.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=GF(t,e,a,u,n,!0)}return _}var ZF={onPointerDown:YF,isValid:XF};function QF({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=lk(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&AP()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=LN().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:mk}}var $F=e=>({x:e.x,y:e.y,zoom:e.k}),eI=({x:e,y:t,zoom:n})=>DN.translate(e,t).scale(n),tI=(e,t)=>e.target.closest(`.${t}`),nI=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),rI=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,iI=(e,t=0,n=rI,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},aI=e=>{let t=e.ctrlKey&&AP()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function oI({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(tI(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=mk(u),t=d*2**aI(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===UN.Vertical?0:u.deltaX*f,m=i===UN.Horizontal?0:u.deltaY*f;!AP()&&u.shiftKey&&i!==UN.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=$F(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function sI({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=tI(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function cI({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=$F(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function lI({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&nI(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,$F(a.transform))}}function uI({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&nI(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=$F(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function dI({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(tI(f,`${u}-flow__node`)||tI(f,`${u}-flow__edge`)||tI(f,`${u}-flow__selection`)||tI(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||tI(f,c)&&h||tI(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function fI({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]],f=typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t?.contentRect&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null;f?.observe(e);let p=LN().extent(()=>d).scaleExtent([t,n]).translateExtent(r),m=lk(e).call(p);b({x:i.x,y:i.y,zoom:sP(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let h=m.on(`wheel.zoom`),g=m.on(`dblclick.zoom`);p.wheelDelta(aI);async function _(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?lj:Cj).transform(iI(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function v({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:f,preventScrolling:_,zoomOnPinch:v,zoomOnScroll:y,zoomOnDoubleClick:b,panActivationKeyPressed:x=!1,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&p.on(`zoom`,null);let O=i&&!S&&!r;p.clickDistance(D?1/0:!xP(E)||E<0?0:E);let k=O?oI({zoomPanValues:l,noWheelClassName:e,d3Selection:m,d3Zoom:p,panOnScrollMode:d,panOnScrollSpeed:f,zoomOnPinch:v,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):sI({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:h});m.on(`wheel.zoom`,k,{passive:!1});let A=cI({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});p.on(`start`,A);let j=lI({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});p.on(`zoom`,j);let M=uI({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});p.on(`end`,M);let N=dI({panActivationKeyPressed:x,zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:y,panOnScroll:i,zoomOnDoubleClick:b,zoomOnPinch:v,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});p.filter(N),b?m.on(`dblclick.zoom`,g):m.on(`dblclick.zoom`,null)}function y(){p.on(`zoom`,null),f?.disconnect()}async function b(e,t,n){let r=eI(e),i=p?.constrain()(r,t,n);return i&&await _(i),i}async function x(e,t){let n=eI(e);return await _(n,t),n}function S(e){if(m){let t=eI(e),n=m.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&p?.transform(m,t,null,{sync:!0})}}function C(){let e=m?ON(m.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function w(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?lj:Cj).scaleTo(iI(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function T(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?lj:Cj).scaleBy(iI(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function E(e){p?.scaleExtent(e)}function D(e){p?.translateExtent(e)}function O(e){let t=!xP(e)||e<0?0:e;p?.clickDistance(t)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:C,scaleTo:w,scaleBy:T,setScaleExtent:E,setTranslateExtent:D,syncViewport:S,setClickDistance:O}}var pI;(function(e){e.Line=`line`,e.Handle=`handle`})(pI||={});function mI({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function hI(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function gI(e,t){return Math.max(0,t-e)}function _I(e,t){return Math.max(0,e-t)}function vI(e,t,n){return Math.max(0,t-e,e-n)}function yI(e,t){return e?!t:t}function bI(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=vI(E,h,g),j=vI(D,_,v);if(o){let e=0,t=0;c&&w<0?e=gI(y+w+O,o[0][0]):!c&&w>0&&(e=_I(y+E+O,o[1][0])),l&&T<0?t=gI(b+T+k,o[0][1]):!l&&T>0&&(t=_I(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=_I(y+w,s[0][0]):!c&&w<0&&(e=gI(y+E,s[1][0])),l&&T>0?t=_I(b+T,s[0][1]):!l&&T<0&&(t=gI(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=vI(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?_I(b+k+E/C,o[1][1])*C:gI(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?gI(b+E/C,s[1][1])*C:_I(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=vI(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?_I(y+D*C+O,o[1][0])/C:gI(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?gI(y+D*C,s[1][0])/C:_I(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(yI(c,l)?-w:w)/C:w=(yI(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var xI={width:0,height:0,x:0,y:0},SI={...xI,pointerX:0,pointerY:0,aspectRatio:1};function CI(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function wI({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=lk(e),o={controlDirection:hI(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...xI},h={...SI};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:hI(e)};let g,_=null,v=[],y,b,x,S=Dk().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=zP(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=jP(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=CI(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=zP(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:S,height:C}=m,w={},T=g.origin??s,{width:E,height:D,x:O,y:k}=bI(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,T,b,x),A=E!==S,j=D!==C,M=O!==u&&A,N=k!==f&&j;if(!M&&!N&&!A&&!j)return;let P={prevValues:{...m},startX:h.x,startY:h.y,childNodes:v.map(e=>({...e,position:{...e.position}}))};if((M||N||T[0]===1||T[1]===1)&&(w.x=M?O:m.x,w.y=N?k:m.y,m.x=w.x,m.y=w.y,v.length>0)){let e=O-u,t=k-f;for(let n of v)n.position={x:n.position.x-e+T[0]*(E-S),y:n.position.y-t+T[1]*(D-C)},l.push(n)}if((A||j)&&(w.width=A&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?E:m.width,w.height=j&&(!o.resizeDirection||o.resizeDirection===`vertical`)?D:m.height,m.width=w.width,m.height=w.height),y&&g.expandParent){let e=T[0]*(w.width??0);w.x&&w.x<e&&(m.x=e,h.x-=w.x-e);let t=T[1]*(w.height??0);w.y&&w.y<t&&(m.y=t,h.y-=w.y-t)}let F=mI({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)===!1?(m=P.prevValues,h.x=P.startX,h.y=P.startY,v.forEach((e,t)=>{e.position=P.childNodes[t].position})):(d?.(e,I),r(w,l))}).on(`end`,e=>{f?.(e,{...m}),i?.({...m})});a.call(S)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var TI=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},EI=e=>e?TI(e):TI,{useDebugValue:DI}=p.default,{useSyncExternalStoreWithSelector:OI}=pu.default,kI=e=>e;function AI(e,t=kI,n){let r=OI(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return DI(r),r}var jI=(e,t)=>{let n=EI(e),r=(e,r=t)=>AI(n,e,r);return Object.assign(r,n),r},MI=(e,t)=>e?jI(e,t):jI;function NI(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var PI=(0,p.createContext)(null),FI=PI.Provider,II=RN.error001(`react`);function LI(e,t){let n=(0,p.useContext)(PI);if(n===null)throw Error(II);return AI(n,e,t)}function RI(){let e=(0,p.useContext)(PI);if(e===null)throw Error(II);return(0,p.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var zI={display:`none`},BI={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},VI=`react-flow__node-desc`,HI=`react-flow__edge-desc`,UI=`react-flow__aria-live`,WI=e=>e.ariaLiveMessage,GI=e=>e.ariaLabelConfig;function KI({rfId:e}){let t=LI(WI);return(0,m.jsx)(`div`,{id:`${UI}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:BI,children:t})}function qI({rfId:e,disableKeyboardA11y:t}){let n=LI(GI);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{id:`${VI}-${e}`,style:zI,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,m.jsx)(`div`,{id:`${HI}-${e}`,style:zI,children:n[`edge.a11yDescription.default`]}),!t&&(0,m.jsx)(KI,{rfId:e})]})}var JI=(0,p.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,m.jsx)(`div`,{className:rD([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});JI.displayName=`Panel`;var YI=`https://reactflow.dev?utm_source=attribution`;function XI({proOptions:e,position:t=`bottom-right`}){return(0,p.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,m.jsx)(JI,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${YI}`,children:(0,m.jsx)(`a`,{href:YI,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var ZI=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},QI=e=>e.id;function $I(e,t){return NI(e.selectedNodes.map(QI),t.selectedNodes.map(QI))&&NI(e.selectedEdges.map(QI),t.selectedEdges.map(QI))}function eL({onSelectionChange:e}){let t=RI(),{selectedNodes:n,selectedEdges:r}=LI(ZI,$I);return(0,p.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var tL=e=>!!e.onSelectionChangeHandlers;function nL({onSelectionChange:e}){let t=LI(tL);return e||t?(0,m.jsx)(eL,{onSelectionChange:e}):null}var rL=[0,0],iL={x:0,y:0,zoom:1},aL=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],oL=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}),sL={translateExtent:zN,nodeOrigin:rL,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function cL(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=LI(oL,NI),l=RI();(0,p.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=sL,s()}),[]);let u=(0,p.useRef)(sL);return(0,p.useEffect)(()=>{for(let s of aL){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:LP(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},aL.map(t=>e[t])),null}function lL(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function uL(e){let[t,n]=(0,p.useState)(e===`system`?null:e);return(0,p.useEffect)(()=>{if(e!==`system`){n(e);return}let t=lL(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?lL()?.matches?`dark`:`light`:t}var dL=typeof document<`u`?document:null;function fL(e=null,t={target:dL,actInsideInputWithModifier:!0}){let[n,r]=(0,p.useState)(!1),i=(0,p.useRef)(!1),a=(0,p.useRef)(new Set([])),[o,s]=(0,p.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
50
50
  `).replace(`
51
51
 
52
52
  `,`
@@ -54,4 +54,4 @@ Error generating stack: `+e.message+`
54
54
  `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,p.useEffect)(()=>{let n=t?.target??dL,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&UP(e))return!1;let n=mL(e.code,s);if(a.current.add(e[n]),pL(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=mL(e.code,s);pL(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function pL(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function mL(e,t){return t.includes(e)?`code`:`key`}var hL=()=>{let e=RI();return(0,p.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=kP(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return wP(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=TP(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function gL(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)_L(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function _L(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function vL(e,t){return gL(e,t)}function yL(e,t){return gL(e,t)}function bL(e,t){return{id:e,type:`select`,selected:t}}function xL(e,t=new Set){let n=[];for(let[r,i]of e){let e=t.has(r);(i.selected!==void 0||e)&&i.selected!==e&&n.push(bL(i.id,e))}return n}function SL({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function CL(e){return{id:e.id,type:`remove`}}var wL=SP(`React Flow`,`https://reactflow.dev/`);function TL(e,t,n={}){return nF(e,t,{...n,onError:n.onError??wL})}var EL=e=>XN(e),DL=e=>YN(e);function OL(e){return(0,p.forwardRef)(e)}var kL=typeof window<`u`?p.useLayoutEffect:p.useEffect;function AL(e){let[t,n]=(0,p.useState)(BigInt(0)),[r]=(0,p.useState)(()=>jL(()=>n(e=>e+BigInt(1))));return kL(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function jL(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var ML=(0,p.createContext)(null);function NL({children:e}){let t=RI(),n=AL((0,p.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=SL({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=AL((0,p.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(SL({items:s,lookup:o}))},[])),i=(0,p.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,m.jsx)(ML.Provider,{value:i,children:e})}function PL(){let e=(0,p.useContext)(ML);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var FL=e=>!!e.panZoom;function IL(){let e=hL(),t=RI(),n=PL(),r=LI(FL),i=(0,p.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=EL(e)?e:n.get(e.id),a=i.parentId?PP(i.position,i.measured,i.parentId,n,r):i.position;return hP({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height},i.parentId?void 0:r)},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&EL(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&DL(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await oP({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(CL);o?.(f),c(e)}if(m){let e=d.map(CL);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=bP(e),o=i?e:a(e),s=r!==void 0;if(!o)return[];let{nodeOrigin:c}=t.getState();return(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let l=hP(s?r:a,c),u=yP(l,o);return n&&u>0||u>=l.width*l.height||u>=o.width*o.height})},isNodeIntersecting:(e,t,n=!0)=>{let r=bP(e)?e:a(e);if(!r)return!1;let i=yP(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return $N(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??IP();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,p.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var LL=e=>e.selected,RL=typeof window<`u`?window:void 0;function zL({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=RI(),{deleteElements:r}=IL(),i=fL(e,{actInsideInputWithModifier:!1}),a=fL(t,{target:RL});(0,p.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(LL),edges:e.filter(LL)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,p.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function BL(e){let t=RI();(0,p.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=BP(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,RN.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t.disconnect()}}},[])}var VL={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},HL=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function UL({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=UN.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:g=!0,children:_,noWheelClassName:v,noPanClassName:y,onViewportChange:b,isControlledViewport:x,paneClickDistance:S,selectionOnDrag:C}){let w=RI(),T=(0,p.useRef)(null),{userSelectionActive:E,lib:D,connectionInProgress:O}=LI(HL,NI),k=fL(h),A=(0,p.useRef)();BL(T);let j=(0,p.useCallback)(e=>{b?.({x:e[0],y:e[1],zoom:e[2]}),x||w.setState({transform:e})},[b,x]);return(0,p.useEffect)(()=>{if(T.current){A.current=fI({domNode:T.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>w.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=w.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=w.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=w.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=A.current.getViewport();return w.setState({panZoom:A.current,transform:[e,t,n],domNode:T.current.closest(`.react-flow`)}),()=>{A.current?.destroy()}}},[]),(0,p.useEffect)(()=>{A.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:k,preventScrolling:g,noPanClassName:y,userSelectionActive:E,noWheelClassName:v,lib:D,onTransformChange:j,connectionInProgress:O,selectionOnDrag:C,paneClickDistance:S})},[e,t,n,r,i,a,o,s,c,k,g,y,E,v,D,j,O,C,S]),(0,m.jsx)(`div`,{className:`react-flow__renderer`,ref:T,style:VL,children:_})}var WL=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function GL(){let{userSelectionActive:e,userSelectionRect:t}=LI(WL,NI);return e&&t?(0,m.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var KL=(e,t)=>n=>{n.target===t.current&&e?.(n)},qL=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function JL({isSelecting:e,selectionKeyPressed:t,selectionMode:n=WN.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:h,onPaneMouseLeave:g,children:_}){let v=(0,p.useRef)(0),y=RI(),{userSelectionActive:b,elementsSelectable:x,dragging:S,panBy:C,autoPanSpeed:w}=LI(qL,NI),T=x&&(e||b),E=(0,p.useRef)(null),D=(0,p.useRef)(),O=(0,p.useRef)(new Set),k=(0,p.useRef)(new Set),A=(0,p.useRef)(!1),j=(0,p.useRef)(!1),M=(0,p.useRef)({x:0,y:0}),N=(0,p.useRef)(!1),P=e=>{if(j.current||A.current||y.getState().connection.inProgress){j.current=!1,A.current=!1;return}let{connectionClickStartHandle:t,connection:n,onClickConnectEnd:r,resetSelectedElements:i}=y.getState();if(t){let t=structuredClone(n);delete t.inProgress,t.toPosition=t.toHandle?t.toHandle.position:null,r?.(e.nativeEvent,t),y.setState({connectionClickStartHandle:null})}l?.(e),i(),y.setState({nodesSelectionActive:!1})},F=e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},I=d?e=>d(e):void 0,L=e=>{j.current&&=(e.stopPropagation(),!1)},R=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=y.getState();if(D.current=i?.getBoundingClientRect(),!D.current)return;let s=n.target===E.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),j.current=!1;let{x:c,y:l}=GP(n.nativeEvent,D.current),u=wP({x:c,y:l},a);y.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function z(e,t){let{userSelectionRect:r}=y.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=y.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=TP(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=O.current,g=k.current;O.current=new Set(tP(a,m,i,n===WN.Partial,!0).map(e=>e.id)),k.current=new Set;let _=u?.selectable??!0;for(let e of O.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??_)&&k.current.add(e)}}FP(h,O.current)||c(xL(a,O.current)),FP(g,k.current)||l(xL(o,k.current)),y.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function B(){if(!i||!D.current)return;let[e,t]=dP(M.current,D.current,w);C({x:e,y:t}).then(e=>{if(!j.current||!e){v.current=requestAnimationFrame(B);return}let{x:t,y:n}=M.current;z(t,n),v.current=requestAnimationFrame(B)})}let ee=()=>{cancelAnimationFrame(v.current),v.current=0,N.current=!1};(0,p.useEffect)(()=>()=>ee(),[]);let V=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=y.getState();if(!D.current||!n)return;let{x:o,y:c}=GP(e.nativeEvent,D.current);M.current={x:o,y:c};let l=TP({x:n.startX,y:n.startY},r);if(!j.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}j.current=!0,N.current||=(B(),!0),z(o,c)},te=e=>{T?e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!b&&e.target===E.current&&y.getState().userSelectionRect&&P?.(e),y.setState({userSelectionActive:!1,userSelectionRect:null}),j.current&&(c?.(e),y.setState({nodesSelectionActive:O.current.size>0})),ee()):e.target===E.current&&y.getState().connection.inProgress&&(A.current=!0)},ne=e=>{e.target?.releasePointerCapture?.(e.pointerId),ee()},H=r===!0||Array.isArray(r)&&r.includes(0);return(0,m.jsxs)(`div`,{className:rD([`react-flow__pane`,{draggable:H,dragging:S,selection:e}]),onClick:T?void 0:KL(P,E),onContextMenu:KL(F,E),onWheel:KL(I,E),onPointerEnter:T?void 0:f,onPointerMove:T?V:h,onPointerUp:te,onPointerCancel:T?ne:void 0,onPointerDownCapture:T?R:void 0,onClickCapture:T?L:void 0,onPointerLeave:g,ref:E,style:VL,children:[_,(0,m.jsx)(GL,{})]})}function YL({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);l?(t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])):c?.(`012`,RN.error012(e))}function XL({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=RI(),[c,l]=(0,p.useState)(!1),u=(0,p.useRef)();return(0,p.useEffect)(()=>{if(!t)return u.current=VF({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{YL({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,p.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var ZL=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function QL(){let e=RI();return(0,p.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=ZL(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=CP(t,i));let{position:a,positionAbsolute:s}=aP({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var $L=(0,p.createContext)(null),eR=$L.Provider;$L.Consumer;var tR=()=>(0,p.useContext)($L),nR=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),rR=(0,p.createContext)(null);function iR({children:e}){let t=LI(nR,NI);return(0,m.jsx)(rR.Provider,{value:t,children:e})}function aR(){let e=(0,p.useContext)(rR);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var oR={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},sR=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return oR;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===HN.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function cR({type:e=`source`,position:t=$.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let h=o||null,g=e===`target`,_=RI(),v=tR(),{connectOnClick:y,noPanClassName:b,rfId:x}=aR(),{connectingFrom:S,connectingTo:C,clickConnecting:w,isPossibleEndHandle:T,connectionInProcess:E,clickConnectionInProcess:D,valid:O}=LI(sR(v,h,e),NI);v||_.getState().onError?.(`010`,RN.error010());let k=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=_.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=_.getState();t(TL(i,e,{onError:n}))}n?.(i),s?.(i)},A=e=>{if(!v)return;let t=WP(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=_.getState();ZF.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:g,handleId:h,nodeId:v,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>_.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:k,isValidConnection:n||((...e)=>_.getState().isValidConnection?.(...e)??!0),getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,m.jsx)(`div`,{"data-handleid":h,"data-nodeid":v,"data-handlepos":t,"data-id":`${x}-${v}-${h}-${e}`,className:rD([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,b,l,{source:!g,target:g,connectable:r,connectablestart:i,connectableend:a,clickconnecting:w,connectingfrom:S,connectingto:C,valid:O,connectionindicator:r&&(!E||T)&&(E||D?a:i)}]),onMouseDown:A,onTouchStart:A,onClick:y?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=_.getState();if(!v||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:v,handleId:h,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:v,type:e,id:h}});return}let p=VP(t.target),m=n||c,{connection:g,isValid:y}=ZF.isValid(t.nativeEvent,{handle:{nodeId:v,id:h,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:m,flowId:u,doc:p,lib:l,nodeLookup:d});y&&g&&k(g);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),_.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var lR=(0,p.memo)(OL(cR));function uR({data:e,isConnectable:t,sourcePosition:n=$.Bottom}){return(0,m.jsxs)(m.Fragment,{children:[e?.label,(0,m.jsx)(lR,{type:`source`,position:n,isConnectable:t})]})}function dR({data:e,isConnectable:t,targetPosition:n=$.Top,sourcePosition:r=$.Bottom}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(lR,{type:`target`,position:n,isConnectable:t}),e?.label,(0,m.jsx)(lR,{type:`source`,position:r,isConnectable:t})]})}function fR(){return null}function pR({data:e,isConnectable:t,targetPosition:n=$.Top}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(lR,{type:`target`,position:n,isConnectable:t}),e?.label]})}var mR={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},hR={input:uR,default:dR,output:pR,group:fR};function gR(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var _R=e=>{let{width:t,height:n,x:r,y:i}=eP(e.nodeLookup,{filter:e=>!!e.selected});return{width:xP(t)?t:null,height:xP(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function vR({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=RI(),{width:i,height:a,transformString:o,userSelectionActive:s}=LI(_R,NI),c=QL(),l=(0,p.useRef)(null);(0,p.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(XL({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,m.jsx)(`div`,{className:rD([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,m.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(mR,e.key)&&(e.preventDefault(),c({direction:mR[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var yR=typeof window<`u`?window:void 0,bR=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function xR({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:h,panActivationKeyCode:g,zoomActivationKeyCode:_,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:x,panOnScrollSpeed:S,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:T,autoPanOnSelection:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,onSelectionContextMenu:M,noWheelClassName:N,noPanClassName:P,disableKeyboardA11y:F,onViewportChange:I,isControlledViewport:L}){let{nodesSelectionActive:R,userSelectionActive:z}=LI(bR,NI),B=fL(l,{target:yR}),ee=fL(g,{target:yR}),V=ee||T,te=ee||x,ne=u&&V!==!0,H=B||z||ne;return zL({deleteKeyCode:c,multiSelectionKeyCode:h}),(0,m.jsx)(UL,{onPaneContextMenu:a,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:te,panActivationKeyPressed:ee,panOnScrollSpeed:S,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:!B&&V,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,zoomActivationKeyCode:_,preventScrolling:j,noWheelClassName:N,noPanClassName:P,onViewportChange:I,isControlledViewport:L,paneClickDistance:s,selectionOnDrag:ne,children:(0,m.jsxs)(JL,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:V,autoPanOnSelection:E,isSelecting:!!H,selectionMode:d,selectionKeyPressed:B,paneClickDistance:s,selectionOnDrag:ne,children:[e,R&&(0,m.jsx)(vR,{onSelectionContextMenu:M,noPanClassName:P,disableKeyboardA11y:F})]})})}xR.displayName=`FlowRenderer`;var SR=(0,p.memo)(xR),CR=e=>t=>e?tP(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function wR(e){return LI((0,p.useCallback)(CR(e),[e]),NI)}var TR=e=>e.updateNodeInternals;function ER(){let e=LI(TR),[t]=(0,p.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,p.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function DR({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=RI(),a=(0,p.useRef)(null),o=(0,p.useRef)(null),s=(0,p.useRef)(e.sourcePosition),c=(0,p.useRef)(e.targetPosition),l=(0,p.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,p.useEffect)(()=>{!a.current||e.hidden||u&&o.current===a.current||(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,p.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,p.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function OR({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:h,rfId:g,nodeTypes:_,nodeClickDistance:v,onError:y}){let{node:b,internals:x,isParent:S}=LI(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},NI),C=b.type||`default`,w=_?.[C]||hR[C];w===void 0&&(y?.(`003`,RN.error003(C)),C=`default`,w=_?.default||hR.default);let T=!!(b.draggable||s&&b.draggable===void 0),E=!!(b.selectable||c&&b.selectable===void 0),D=!!(b.connectable||l&&b.connectable===void 0),O=!!(b.focusable||u&&b.focusable===void 0),k=RI(),A=NP(b),j=DR({node:b,nodeType:C,hasDimensions:A,resizeObserver:d}),M=XL({nodeRef:j,disabled:b.hidden||!T,noDragClassName:f,handleSelector:b.dragHandle,nodeId:e,isSelectable:E,nodeClickDistance:v}),N=QL();if(b.hidden)return null;let P=MP(b),F=gR(b),I=E||T||t||n||r||i,L=n?e=>n(e,{...x.userNode}):void 0,R=r?e=>r(e,{...x.userNode}):void 0,z=i?e=>i(e,{...x.userNode}):void 0,B=a?e=>a(e,{...x.userNode}):void 0,ee=o?e=>o(e,{...x.userNode}):void 0,V=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=k.getState();E&&(!r||!T||i>0)&&YL({id:e,store:k,nodeRef:j}),t&&t(n,{...x.userNode})},te=t=>{if(!(UP(t.nativeEvent)||h)){if(BN.includes(t.key)&&E){let n=t.key===`Escape`;YL({id:e,store:k,unselect:n,nodeRef:j})}else if(T&&b.selected&&Object.prototype.hasOwnProperty.call(mR,t.key)){t.preventDefault();let{ariaLabelConfig:e}=k.getState();k.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),N({direction:mR[t.key],factor:t.shiftKey?4:1})}}},ne=()=>{if(h||!j.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=k.getState();i&&(tP(new Map([[e,b]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(b.position.x+P.width/2,b.position.y+P.height/2,{zoom:t[2]}))};return(0,m.jsx)(`div`,{className:rD([`react-flow__node`,`react-flow__node-${C}`,{[p]:T},b.className,{selected:b.selected,selectable:E,parent:S,draggable:T,dragging:M}]),ref:j,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:I?`all`:`none`,visibility:A?`visible`:`hidden`,...b.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:R,onMouseLeave:z,onContextMenu:B,onClick:V,onDoubleClick:ee,onKeyDown:O?te:void 0,tabIndex:O?0:void 0,onFocus:O?ne:void 0,role:b.ariaRole??(O?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":h?void 0:`${VI}-${g}`,"aria-label":b.ariaLabel,...b.domAttributes,children:(0,m.jsx)(eR,{value:e,children:(0,m.jsx)(w,{id:e,data:b.data,type:C,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:b.selected??!1,selectable:E,draggable:T,deletable:b.deletable??!0,isConnectable:D,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:M,dragHandle:b.dragHandle,zIndex:x.z,parentId:b.parentId,...P})})})}var kR=(0,p.memo)(OR),AR=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function jR(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=LI(AR,NI),a=wR(e.onlyRenderVisibleElements),o=ER();return(0,m.jsx)(`div`,{className:`react-flow__nodes`,style:VL,children:a.map(a=>(0,m.jsx)(kR,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}jR.displayName=`NodeRenderer`;var MR=(0,p.memo)(jR);function NR(e){return LI((0,p.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&$P({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),NI)}var PR=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,m.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},FR=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,m.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},IR={[qN.Arrow]:PR,[qN.ArrowClosed]:FR};function LR(e){let t=RI();return(0,p.useMemo)(()=>Object.prototype.hasOwnProperty.call(IR,e)?IR[e]:(t.getState().onError?.(`009`,RN.error009(e)),null),[e])}var RR=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=LR(t);return c?(0,m.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,m.jsx)(c,{color:n,strokeWidth:o})}):null},zR=({defaultColor:e,rfId:t})=>{let n=LI(e=>e.edges),r=LI(e=>e.defaultEdgeOptions),i=(0,p.useMemo)(()=>_F(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,m.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,m.jsx)(`defs`,{children:i.map(e=>(0,m.jsx)(RR,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};zR.displayName=`MarkerDefinitions`;var BR=(0,p.memo)(zR);function VR({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,p.useState)({x:1,y:0,width:0,height:0}),h=rD([`react-flow__edge-textwrapper`,l]),g=(0,p.useRef)(null);return(0,p.useEffect)(()=>{if(g.current){let e=g.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,m.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,m.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,m.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:g,style:r,children:n}),c]}):null}VR.displayName=`EdgeText`;var HR=(0,p.memo)(VR);function UR({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{...u,d:e,fill:`none`,className:rD([`react-flow__edge-path`,u.className])}),l?(0,m.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&xP(t)&&xP(n)?(0,m.jsx)(HR,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function WR({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$.Left||e===$.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function GR({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top}){let[o,s]=WR({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=WR({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=qP({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function KR(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:g,markerStart:_,interactionWidth:v})=>{let[y,b,x]=GR({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),S=e.isInternal?void 0:t;return(0,m.jsx)(UR,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:g,markerStart:_,interactionWidth:v})})}var qR=KR({isInternal:!1}),JR=KR({isInternal:!0});qR.displayName=`SimpleBezierEdge`,JR.displayName=`SimpleBezierEdgeInternal`;function YR(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=$.Bottom,targetPosition:h=$.Top,markerEnd:g,markerStart:_,pathOptions:v,interactionWidth:y})=>{let[b,x,S]=uF({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:h,borderRadius:v?.borderRadius,offset:v?.offset,stepPosition:v?.stepPosition}),C=e.isInternal?void 0:t;return(0,m.jsx)(UR,{id:C,path:b,labelX:x,labelY:S,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:_,interactionWidth:y})})}var XR=YR({isInternal:!1}),ZR=YR({isInternal:!0});XR.displayName=`SmoothStepEdge`,ZR.displayName=`SmoothStepEdgeInternal`;function QR(e){return(0,p.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,m.jsx)(XR,{...n,id:r,pathOptions:(0,p.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var $R=QR({isInternal:!1}),ez=QR({isInternal:!0});$R.displayName=`StepEdge`,ez.displayName=`StepEdgeInternal`;function tz(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:h,interactionWidth:g})=>{let[_,v,y]=rF({sourceX:n,sourceY:r,targetX:i,targetY:a}),b=e.isInternal?void 0:t;return(0,m.jsx)(UR,{id:b,path:_,labelX:v,labelY:y,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:h,interactionWidth:g})})}var nz=tz({isInternal:!1}),rz=tz({isInternal:!0});nz.displayName=`StraightEdge`,rz.displayName=`StraightEdgeInternal`;function iz(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=$.Bottom,targetPosition:s=$.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:g,markerStart:_,pathOptions:v,interactionWidth:y})=>{let[b,x,S]=XP({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:v?.curvature}),C=e.isInternal?void 0:t;return(0,m.jsx)(UR,{id:C,path:b,labelX:x,labelY:S,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:g,markerStart:_,interactionWidth:y})})}var az=iz({isInternal:!1}),oz=iz({isInternal:!0});az.displayName=`BezierEdge`,oz.displayName=`BezierEdgeInternal`;var sz={default:oz,straight:rz,step:ez,smoothstep:ZR,simplebezier:JR},cz={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},lz=(e,t,n)=>n===$.Left?e-t:n===$.Right?e+t:e,uz=(e,t,n)=>n===$.Top?e-t:n===$.Bottom?e+t:e,dz=`react-flow__edgeupdater`;function fz({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,m.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:rD([dz,`${dz}-${s}`]),cx:lz(t,r,e),cy:uz(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function pz({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let h=RI(),g=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:m,rfId:g,panBy:_,updateConnection:v}=h.getState(),y=t.type===`target`;ZF.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:m,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>h.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>h.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle,dragThreshold:h.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},_=e=>g(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),v=e=>g(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),y=()=>p(!0),b=()=>p(!1);return(0,m.jsxs)(m.Fragment,{children:[(e===!0||e===`source`)&&(0,m.jsx)(fz,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:_,onMouseEnter:y,onMouseOut:b,type:`source`}),(e===!0||e===`target`)&&(0,m.jsx)(fz,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:v,onMouseEnter:y,onMouseOut:b,type:`target`})]})}function mz({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,rfId:g,edgeTypes:_,noPanClassName:v,onError:y,disableKeyboardA11y:b}){let x=LI(t=>t.edgeLookup.get(e)),S=LI(e=>e.defaultEdgeOptions);x=S?{...S,...x}:x;let C=x.type||`default`,w=_?.[C]||sz[C];w===void 0&&(y?.(`011`,RN.error011(C)),C=`default`,w=_?.default||sz.default);let T=!!(x.focusable||t&&x.focusable===void 0),E=d!==void 0&&(x.reconnectable||n&&x.reconnectable===void 0),D=!!(x.selectable||r&&x.selectable===void 0),O=(0,p.useRef)(null),[k,A]=(0,p.useState)(!1),[j,M]=(0,p.useState)(!1),N=RI(),{zIndex:P=x.zIndex,sourceX:F,sourceY:I,targetX:L,targetY:R,sourcePosition:z,targetPosition:B}=LI((0,p.useCallback)(t=>{let n=t.nodeLookup.get(x.source),r=t.nodeLookup.get(x.target);if(!n||!r)return cz;let i=fF({id:e,sourceNode:n,targetNode:r,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:t.connectionMode,onError:y}),a=QP({selected:x.selected,zIndex:x.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||cz,zIndex:a}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex,y]),NI),ee=(0,p.useMemo)(()=>x.markerStart?`url('#${gF(x.markerStart,g)}')`:void 0,[x.markerStart,g]),V=(0,p.useMemo)(()=>x.markerEnd?`url('#${gF(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||F===null||I===null||L===null||R===null)return null;let te=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=N.getState();D&&(N.setState({nodesSelectionActive:!1}),x.selected&&a?(r({nodes:[],edges:[x]}),O.current?.blur()):n([e])),i&&i(t,x)},ne=a?e=>{a(e,{...x})}:void 0,H=o?e=>{o(e,{...x})}:void 0,re=s?e=>{s(e,{...x})}:void 0,U=c?e=>{c(e,{...x})}:void 0,ie=l?e=>{l(e,{...x})}:void 0;return(0,m.jsx)(`svg`,{style:{zIndex:P},children:(0,m.jsxs)(`g`,{className:rD([`react-flow__edge`,`react-flow__edge-${C}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!D&&!i,updating:k,selectable:D}]),onClick:te,onDoubleClick:ne,onContextMenu:H,onMouseEnter:re,onMouseMove:U,onMouseLeave:ie,onKeyDown:T?t=>{if(!b&&BN.includes(t.key)&&D){let{unselectNodesAndEdges:n,addSelectedEdges:r}=N.getState();t.key===`Escape`?(O.current?.blur(),n({edges:[x]})):r([e])}}:void 0,tabIndex:T?0:void 0,role:x.ariaRole??(T?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":T?`${HI}-${g}`:void 0,ref:O,...x.domAttributes,children:[!j&&(0,m.jsx)(w,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:D,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:F,sourceY:I,targetX:L,targetY:R,sourcePosition:z,targetPosition:B,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:ee,markerEnd:V,pathOptions:`pathOptions`in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&(0,m.jsx)(pz,{edge:x,isReconnectable:E,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,sourceX:F,sourceY:I,targetX:L,targetY:R,sourcePosition:z,targetPosition:B,setUpdateHover:A,setReconnecting:M})]})})}var hz=(0,p.memo)(mz),gz=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function _z({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:h,disableKeyboardA11y:g}){let{edgesFocusable:_,edgesReconnectable:v,elementsSelectable:y,onError:b}=LI(gz,NI),x=NR(t);return(0,m.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,m.jsx)(BR,{defaultColor:e,rfId:n}),x.map(e=>(0,m.jsx)(hz,{id:e,edgesFocusable:_,edgesReconnectable:v,elementsSelectable:y,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:h,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:g},e))]})}_z.displayName=`EdgeRenderer`;var vz=(0,p.memo)(_z),yz=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function bz({children:e}){let t=RI(),n=(0,p.useRef)(null),[r]=(0,p.useState)(()=>t.getState().transform);return kL(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=yz(r)))};return r(),t.subscribe(r)},[t]),(0,m.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:yz(r)},children:e})}function xz(e){let t=IL(),n=(0,p.useRef)(!1);(0,p.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var Sz=e=>e.panZoom?.syncViewport;function Cz(e){let t=LI(Sz),n=RI();return(0,p.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function wz(e){return e.connection.inProgress?{...e.connection,to:wP(e.connection.to,e.transform)}:{...e.connection}}function Tz(e){return e?t=>e(wz(t)):wz}function Ez(e){return LI(Tz(e),NI)}var Dz=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Oz({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=LI(Dz,NI);return a&&i&&c?(0,m.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,m.jsx)(`g`,{className:rD([`react-flow__connection`,RP(s)]),children:(0,m.jsx)(kz,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var kz=({style:e,type:t=KN.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=Ez();if(!i)return;if(n)return(0,m.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:RP(r),toNode:u,toHandle:d,pointer:p});let h=``,g={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case KN.Bezier:[h]=XP(g);break;case KN.SimpleBezier:[h]=GR(g);break;case KN.Step:[h]=uF({...g,borderRadius:0});break;case KN.SmoothStep:[h]=uF(g);break;default:[h]=rF(g)}return(0,m.jsx)(`path`,{d:h,fill:`none`,className:`react-flow__connection-path`,style:e})};kz.displayName=`ConnectionLine`;var Az={};function jz(e=Az){(0,p.useRef)(e),RI(),(0,p.useEffect)(()=>{},[e])}function Mz(){RI(),(0,p.useRef)(!1),(0,p.useEffect)(()=>{},[])}function Nz({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:h,connectionLineStyle:g,connectionLineComponent:_,connectionLineContainerStyle:v,selectionKeyCode:y,selectionOnDrag:b,selectionMode:x,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:w,deleteKeyCode:T,onlyRenderVisibleElements:E,elementsSelectable:D,defaultViewport:O,translateExtent:k,minZoom:A,maxZoom:j,preventScrolling:M,defaultMarkerColor:N,zoomOnScroll:P,zoomOnPinch:F,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:R,zoomOnDoubleClick:z,panOnDrag:B,autoPanOnSelection:ee,onPaneClick:V,onPaneMouseEnter:te,onPaneMouseMove:ne,onPaneMouseLeave:H,onPaneScroll:re,onPaneContextMenu:U,paneClickDistance:ie,nodeClickDistance:W,onEdgeContextMenu:G,onEdgeMouseEnter:ae,onEdgeMouseMove:oe,onEdgeMouseLeave:se,reconnectRadius:ce,onReconnect:le,onReconnectStart:ue,onReconnectEnd:de,noDragClassName:fe,noWheelClassName:pe,noPanClassName:me,disableKeyboardA11y:he,nodeExtent:ge,rfId:_e,viewport:ve,onViewportChange:ye,nodesDraggable:be}){return jz(e),jz(t),Mz(),xz(n),Cz(ve),(0,m.jsx)(SR,{onPaneClick:V,onPaneMouseEnter:te,onPaneMouseMove:ne,onPaneMouseLeave:H,onPaneContextMenu:U,onPaneScroll:re,paneClickDistance:ie,deleteKeyCode:T,selectionKeyCode:y,selectionOnDrag:b,selectionMode:x,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:w,elementsSelectable:D,zoomOnScroll:P,zoomOnPinch:F,zoomOnDoubleClick:z,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:R,panOnDrag:B,autoPanOnSelection:ee,defaultViewport:O,translateExtent:k,minZoom:A,maxZoom:j,onSelectionContextMenu:d,preventScrolling:M,noDragClassName:fe,noWheelClassName:pe,noPanClassName:me,disableKeyboardA11y:he,onViewportChange:ye,isControlledViewport:!!ve,children:(0,m.jsxs)(bz,{children:[(0,m.jsx)(vz,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:le,onReconnectStart:ue,onReconnectEnd:de,onlyRenderVisibleElements:E,onEdgeContextMenu:G,onEdgeMouseEnter:ae,onEdgeMouseMove:oe,onEdgeMouseLeave:se,reconnectRadius:ce,defaultMarkerColor:N,noPanClassName:me,disableKeyboardA11y:he,rfId:_e}),(0,m.jsx)(Oz,{style:g,type:h,component:_,containerStyle:v}),(0,m.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,m.jsx)(MR,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:W,onlyRenderVisibleElements:E,noPanClassName:me,noDragClassName:fe,disableKeyboardA11y:he,nodeExtent:ge,rfId:_e,nodesDraggable:be}),(0,m.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}Nz.displayName=`GraphView`;var Pz=(0,p.memo)(Nz),Fz=SP(`React Flow`,`https://reactflow.dev/`),Iz=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??zN;FF(h,g,_);let{nodesInitialized:x}=EF(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=kP(eP(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:zN,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:HN.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...GN},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Fz,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:VN,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},Lz=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>MI((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await iP({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...Iz({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=EF(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();FF(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=MF(e,n,r,i,a,o,l);d&&(CF(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=mF(e,o.fromHandle,$.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=jF(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(vL(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(yL(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();t?i(e.map(e=>bL(e,!0))):(i(xL(r,new Set([...e]))),a(xL(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();t?a(e.map(e=>bL(e,!0))):(a(xL(n,new Set([...e]))),i(xL(r,new Set)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s)e.selected&&l.push(bL(e.id,!1));let u=[];for(let e of c)e.selected&&u.push(bL(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,bL(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,bL(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(EF(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return NF({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...GN}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...Iz()})}},Object.is);function Rz({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:h}){let[g]=(0,p.useState)(()=>Lz({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,m.jsx)(FI,{value:g,children:(0,m.jsx)(NL,{children:(0,m.jsx)(iR,{children:h})})})}function zz({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h}){return(0,p.useContext)(PI)?(0,m.jsx)(m.Fragment,{children:e}):(0,m.jsx)(Rz,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:e})}var Bz={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function Vz({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:g,onConnectEnd:_,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:S,onNodeContextMenu:C,onNodeDoubleClick:w,onNodeDragStart:T,onNodeDrag:E,onNodeDragStop:D,onNodesDelete:O,onEdgesDelete:k,onDelete:A,onSelectionChange:j,onSelectionDragStart:M,onSelectionDrag:N,onSelectionDragStop:P,onSelectionContextMenu:F,onSelectionStart:I,onSelectionEnd:L,onBeforeDelete:R,connectionMode:z,connectionLineType:B=KN.Bezier,connectionLineStyle:ee,connectionLineComponent:V,connectionLineContainerStyle:te,deleteKeyCode:ne=`Backspace`,selectionKeyCode:H=`Shift`,selectionOnDrag:re=!1,selectionMode:U=WN.Full,panActivationKeyCode:ie=`Space`,multiSelectionKeyCode:W=AP()?`Meta`:`Control`,zoomActivationKeyCode:G=AP()?`Meta`:`Control`,snapToGrid:ae,snapGrid:oe,onlyRenderVisibleElements:se=!1,selectNodesOnDrag:ce,nodesDraggable:le,autoPanOnNodeFocus:ue,nodesConnectable:de,nodesFocusable:fe,nodeOrigin:pe=rL,edgesFocusable:me,edgesReconnectable:he,elementsSelectable:ge=!0,defaultViewport:_e=iL,minZoom:ve=.5,maxZoom:ye=2,translateExtent:be=zN,preventScrolling:xe=!0,nodeExtent:Se,defaultMarkerColor:Ce=`#b1b1b7`,zoomOnScroll:we=!0,zoomOnPinch:Te=!0,panOnScroll:Ee=!1,panOnScrollSpeed:De=.5,panOnScrollMode:Oe=UN.Free,zoomOnDoubleClick:ke=!0,panOnDrag:Ae=!0,onPaneClick:je,onPaneMouseEnter:Me,onPaneMouseMove:Ne,onPaneMouseLeave:Pe,onPaneScroll:Fe,onPaneContextMenu:Ie,paneClickDistance:Le=1,nodeClickDistance:Re=0,children:ze,onReconnect:Be,onReconnectStart:Ve,onReconnectEnd:He,onEdgeContextMenu:Ue,onEdgeDoubleClick:We,onEdgeMouseEnter:Ge,onEdgeMouseMove:Ke,onEdgeMouseLeave:qe,reconnectRadius:Je=10,onNodesChange:Ye,onEdgesChange:Xe,noDragClassName:Ze=`nodrag`,noWheelClassName:Qe=`nowheel`,noPanClassName:$e=`nopan`,fitView:et,fitViewOptions:tt,connectOnClick:nt,attributionPosition:rt,proOptions:it,defaultEdgeOptions:at,elevateNodesOnSelect:ot=!0,elevateEdgesOnSelect:st=!1,disableKeyboardA11y:ct=!1,autoPanOnConnect:lt,autoPanOnNodeDrag:ut,autoPanOnSelection:dt=!0,autoPanSpeed:ft,connectionRadius:pt,isValidConnection:mt,onError:ht,style:gt,id:_t,nodeDragThreshold:vt,connectionDragThreshold:yt,viewport:bt,onViewportChange:xt,width:St,height:Ct,colorMode:wt=`light`,debug:Tt,onScroll:Et,ariaLabelConfig:Dt,zIndexMode:Ot=`basic`,...kt},At){let jt=_t||`1`,Mt=uL(wt),Nt=(0,p.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Et?.(e)},[Et]);return(0,m.jsx)(`div`,{"data-testid":`rf__wrapper`,...kt,onScroll:Nt,style:{...gt,...Bz},ref:At,className:rD([`react-flow`,i,Mt]),id:_t,role:`application`,children:(0,m.jsxs)(zz,{nodes:e,edges:t,width:St,height:Ct,fitView:et,fitViewOptions:tt,minZoom:ve,maxZoom:ye,nodeOrigin:pe,nodeExtent:Se,zIndexMode:Ot,children:[(0,m.jsx)(cL,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:g,onConnectEnd:_,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:le,autoPanOnNodeFocus:ue,nodesConnectable:de,nodesFocusable:fe,edgesFocusable:me,edgesReconnectable:he,elementsSelectable:ge,elevateNodesOnSelect:ot,elevateEdgesOnSelect:st,minZoom:ve,maxZoom:ye,nodeExtent:Se,onNodesChange:Ye,onEdgesChange:Xe,snapToGrid:ae,snapGrid:oe,connectionMode:z,translateExtent:be,connectOnClick:nt,defaultEdgeOptions:at,fitView:et,fitViewOptions:tt,onNodesDelete:O,onEdgesDelete:k,onDelete:A,onNodeDragStart:T,onNodeDrag:E,onNodeDragStop:D,onSelectionDrag:N,onSelectionDragStart:M,onSelectionDragStop:P,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:$e,nodeOrigin:pe,rfId:jt,autoPanOnConnect:lt,autoPanOnNodeDrag:ut,autoPanSpeed:ft,onError:ht,connectionRadius:pt,isValidConnection:mt,selectNodesOnDrag:ce,nodeDragThreshold:vt,connectionDragThreshold:yt,onBeforeDelete:R,debug:Tt,ariaLabelConfig:Dt,zIndexMode:Ot}),(0,m.jsx)(Pz,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:S,onNodeContextMenu:C,onNodeDoubleClick:w,nodeTypes:a,edgeTypes:o,connectionLineType:B,connectionLineStyle:ee,connectionLineComponent:V,connectionLineContainerStyle:te,selectionKeyCode:H,selectionOnDrag:re,selectionMode:U,deleteKeyCode:ne,multiSelectionKeyCode:W,panActivationKeyCode:ie,zoomActivationKeyCode:G,onlyRenderVisibleElements:se,defaultViewport:_e,translateExtent:be,minZoom:ve,maxZoom:ye,preventScrolling:xe,zoomOnScroll:we,zoomOnPinch:Te,zoomOnDoubleClick:ke,panOnScroll:Ee,panOnScrollSpeed:De,panOnScrollMode:Oe,panOnDrag:Ae,autoPanOnSelection:dt,onPaneClick:je,onPaneMouseEnter:Me,onPaneMouseMove:Ne,onPaneMouseLeave:Pe,onPaneScroll:Fe,onPaneContextMenu:Ie,paneClickDistance:Le,nodeClickDistance:Re,onSelectionContextMenu:F,onSelectionStart:I,onSelectionEnd:L,onReconnect:Be,onReconnectStart:Ve,onReconnectEnd:He,onEdgeContextMenu:Ue,onEdgeDoubleClick:We,onEdgeMouseEnter:Ge,onEdgeMouseMove:Ke,onEdgeMouseLeave:qe,reconnectRadius:Je,defaultMarkerColor:Ce,noDragClassName:Ze,noWheelClassName:Qe,noPanClassName:$e,rfId:jt,disableKeyboardA11y:ct,nodeExtent:Se,viewport:bt,onViewportChange:xt,nodesDraggable:le}),(0,m.jsx)(nL,{onSelectionChange:j}),ze,(0,m.jsx)(XI,{proOptions:it,position:rt}),(0,m.jsx)(qI,{rfId:jt,disableKeyboardA11y:ct})]})})}var Hz=OL(Vz);RN.error014();function Uz({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,m.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rD([`react-flow__background-pattern`,n,r])})}function Wz({radius:e,className:t}){return(0,m.jsx)(`circle`,{cx:e,cy:e,r:e,className:rD([`react-flow__background-pattern`,`dots`,t])})}var Gz;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(Gz||={});var Kz={[Gz.Dots]:1,[Gz.Lines]:1,[Gz.Cross]:6},qz=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Jz({id:e,variant:t=Gz.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,p.useRef)(null),{transform:f,patternId:h}=LI(qz,NI),g=r||Kz[t],_=t===Gz.Dots,v=t===Gz.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*f[2]||1,y[1]*f[2]||1],x=g*f[2],S=Array.isArray(a)?a:[a,a],C=v?[x,x]:b,w=[S[0]*f[2]+C[0]/2,S[1]*f[2]+C[1]/2],T=`${h}${e||``}`;return(0,m.jsxs)(`svg`,{className:rD([`react-flow__background`,l]),style:{...c,...VL,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,m.jsx)(`pattern`,{id:T,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${w[0]},-${w[1]})`,children:_?(0,m.jsx)(Wz,{radius:x/2,className:u}):(0,m.jsx)(Uz,{dimensions:C,lineWidth:i,variant:t,className:u})}),(0,m.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${T})`})]})}Jz.displayName=`Background`;var Yz=(0,p.memo)(Jz);function Xz(){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,m.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function Zz(){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,m.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function Qz(){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,m.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function $z(){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,m.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function eB(){return(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,m.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function tB({children:e,className:t,...n}){return(0,m.jsx)(`button`,{type:`button`,className:rD([`react-flow__controls-button`,t]),...n,children:e})}var nB=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function rB({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let h=RI(),{isInteractive:g,minZoomReached:_,maxZoomReached:v,ariaLabelConfig:y}=LI(nB,NI),{zoomIn:b,zoomOut:x,fitView:S}=IL();return(0,m.jsxs)(JI,{className:rD([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??y[`controls.ariaLabel`],children:[t&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(tB,{onClick:()=>{b(),a?.()},className:`react-flow__controls-zoomin`,title:y[`controls.zoomIn.ariaLabel`],"aria-label":y[`controls.zoomIn.ariaLabel`],disabled:v,children:(0,m.jsx)(Xz,{})}),(0,m.jsx)(tB,{onClick:()=>{x(),o?.()},className:`react-flow__controls-zoomout`,title:y[`controls.zoomOut.ariaLabel`],"aria-label":y[`controls.zoomOut.ariaLabel`],disabled:_,children:(0,m.jsx)(Zz,{})})]}),n&&(0,m.jsx)(tB,{className:`react-flow__controls-fitview`,onClick:()=>{S(i),s?.()},title:y[`controls.fitView.ariaLabel`],"aria-label":y[`controls.fitView.ariaLabel`],children:(0,m.jsx)(Qz,{})}),r&&(0,m.jsx)(tB,{className:`react-flow__controls-interactive`,onClick:()=>{h.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c?.(!g)},title:y[`controls.interactive.ariaLabel`],"aria-label":y[`controls.interactive.ariaLabel`],children:g?(0,m.jsx)(eB,{}):(0,m.jsx)($z,{})}),u]})}rB.displayName=`Controls`;var iB=(0,p.memo)(rB);function aB({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:h,backgroundColor:g}=a||{},_=o||h||g;return(0,m.jsx)(`rect`,{className:rD([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:_,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var oB=(0,p.memo)(aB),sB=e=>e.nodes.map(e=>e.id),cB=e=>e instanceof Function?e:()=>e;function lB({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=oB,onClick:o}){let s=LI(sB,NI),c=cB(t),l=cB(e),u=cB(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,m.jsx)(m.Fragment,{children:s.map(e=>(0,m.jsx)(dB,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function uB({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=LI(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=MP(r);return{node:r,x:i,y:a,width:o,height:s}},NI);return!l||l.hidden||!NP(l)?null:(0,m.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var dB=(0,p.memo)(uB),fB=(0,p.memo)(lB),pB=200,mB=150,hB=e=>!e.hidden,gB=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?_P(eP(e.nodeLookup,{filter:hB}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},_B=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,vB=(e,t)=>_B(e.viewBB,t.viewBB)&&_B(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,yB=`react-flow__minimap-desc`;function bB({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:h,onNodeClick:g,pannable:_=!1,zoomable:v=!1,ariaLabel:y,inversePan:b,zoomStep:x=1,offsetScale:S=5}){let C=RI(),w=(0,p.useRef)(null),{boundingRect:T,panZoom:E,viewBB:D,rfId:O,translateExtent:k,flowWidth:A,flowHeight:j,ariaLabelConfig:M}=LI(gB,vB),N=e?.width??pB,P=e?.height??mB,F=T.width/N,I=T.height/P,L=Math.max(F,I),R=L*N,z=L*P,B=S*L,ee=T.x-(R-T.width)/2-B,V=T.y-(z-T.height)/2-B,te=R+B*2,ne=z+B*2,H=`${yB}-${O}`,re=(0,p.useRef)(0),U=(0,p.useRef)();re.current=L,(0,p.useEffect)(()=>{let e=C.getState().panZoom;if(w.current&&e)return U.current=QF({domNode:w.current,panZoom:e,getTransform:()=>C.getState().transform,getViewScale:()=>re.current}),()=>{U.current?.destroy()}},[E]),(0,p.useEffect)(()=>{U.current?.update({translateExtent:k,width:A,height:j,inversePan:b,pannable:_,zoomStep:x,zoomable:v})},[_,v,b,x,k,A,j]);let ie=h?e=>{let[t,n]=U.current?.pointer(e)||[0,0];h(e,{x:t,y:n})}:void 0,W=(0,p.useCallback)((e,t)=>{let n=C.getState().nodeLookup.get(t).internals.userNode;g?.(e,n)},[g]),G=g?W:void 0,ae=y??M[`minimap.ariaLabel`];return(0,m.jsx)(JI,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*L:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:rD([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,m.jsxs)(`svg`,{width:N,height:P,viewBox:`${ee} ${V} ${te} ${ne}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":H,ref:w,onClick:ie,children:[ae&&(0,m.jsx)(`title`,{id:H,children:ae}),(0,m.jsx)(fB,{onClick:G,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,m.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${ee-B},${V-B}h${te+B*2}v${ne+B*2}h${-te-B*2}z
55
55
  M${D.x},${D.y}h${D.width}v${D.height}h${-D.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}bB.displayName=`MiniMap`,(0,p.memo)(bB);var xB=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,SB={[pI.Line]:`right`,[pI.Handle]:`bottom-right`};function CB({nodeId:e,position:t,variant:n=pI.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:h=!0,shouldResize:g,onResizeStart:_,onResize:v,onResizeEnd:y}){let b=tR(),x=typeof e==`string`?e:b,S=RI(),C=(0,p.useRef)(null),w=n===pI.Handle,T=LI((0,p.useCallback)(xB(w&&h),[w,h]),NI),E=(0,p.useRef)(null),D=t??SB[n];(0,p.useEffect)(()=>{if(C.current&&x)return E.current||=wI({domNode:C.current,nodeId:x,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=S.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=S.getState(),o=[],s={x:e.x,y:e.y},c=r.get(x);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=jF([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...PP({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:x,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:x,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:x,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};S.getState().triggerNodeChanges([n])}}),E.current.update({controlPosition:D,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:_,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{E.current?.destroy()}},[D,s,c,l,u,d,_,v,y,g]);let O=D.split(`-`);return(0,m.jsx)(`div`,{className:rD([`react-flow__resize-control`,`nodrag`,...O,n,r]),ref:C,style:{...i,scale:T,...o&&{[w?`backgroundColor`:`borderColor`]:o}},children:a})}(0,p.memo)(CB);var wB=new Set,TB=[];function EB(e){return e.startsWith(`signal:child:`)}function DB(e){let t=g();return Xe({queries:(()=>{let n=new Set(e),r=e.size+50,i=[...e];for(;i.length>0&&n.size<r;){let e=i.shift();if(e===void 0)continue;let a=t.getQueryData([`run`,e]);if(a!==void 0)for(let e of vT(a.timeline)){if(n.size>=r)break;n.has(e)||(n.add(e),i.push(e))}}return[...n].sort()})().map(e=>({queryKey:[`run`,e],queryFn:()=>XS.run(e),refetchInterval:VT})),combine:TT})}function OB({data:e}){let t=e.status===`failed`,n=e.status===`pending`||e.status===`running`,r=!!e.childRunId,i=!!e.collapsed,a=r&&!i,o=a?MC:PC(e.kind),s=t?{rail:`bg-bad`,badge:`bg-bad/15 text-bad`,pill:`bg-bad/20 text-bad`}:n?{rail:`bg-live`,badge:`bg-live/15 text-live`,pill:`bg-live/20 text-live`}:{rail:`bg-good`,badge:`bg-good/15 text-good`,pill:`bg-good/20 text-good`};return(0,m.jsxs)(`div`,{title:a?FC.child:FC[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-bad/40 hover:border-bad/60`:a?`border-violet/40 hover:border-violet/60`:`border-line hover:border-line-strong`}`,children:[(0,m.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-[3px] ${s.rail} ${n?`animate-pulse`:``}`}),(0,m.jsx)(lR,{type:`target`,position:$.Left,className:`!border-0 !bg-line-strong`}),(0,m.jsxs)(`div`,{className:`py-2.5 pl-3.5 pr-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${s.badge}`,children:(0,m.jsx)(o,{width:12,height:12})}),(0,m.jsx)(`span`,{className:`truncate text-[13px] font-medium text-fg`,children:e.name}),(0,m.jsx)(`span`,{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${s.pill} ${n?`animate-pulse`:``}`,children:t?(0,m.jsx)(EC,{width:9,height:9}):n?(0,m.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-current`}):(0,m.jsx)(TC,{width:9,height:9})})]}),(0,m.jsxs)(`div`,{className:`mono mt-1.5 flex items-center gap-1.5 text-[10px] text-dim`,children:[r?(0,m.jsxs)(`span`,{className:`flex items-center gap-1`,children:[!i&&(0,m.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e.childRunId&&e.onToggleChild?.(e.childRunId)},title:e.childExpanded?`Collapse child flow`:`Expand child flow inline`,className:`grid h-4 w-4 place-items-center rounded border border-violet/30 bg-violet/10 text-violet transition-colors hover:border-violet/60 hover:bg-violet/20 hover:text-violet`,children:(0,m.jsx)(`span`,{className:`inline-block text-[9px] transition-transform`,style:{transform:e.childExpanded?`rotate(90deg)`:`rotate(0deg)`},children:`▸`})}),(0,m.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e.childRunId&&e.onOpenRun?.(e.childRunId)},title:`Open the child run`,className:`rounded border border-violet/30 bg-violet/10 px-1 text-violet transition-colors hover:border-violet/60 hover:bg-violet/20 hover:text-violet`,children:`child ↗`})]}):(0,m.jsx)(`span`,{className:`rounded border border-line px-1 text-fg-2`,children:e.kind}),e.attempts>1&&(0,m.jsxs)(`span`,{className:`flex items-center gap-0.5 text-warn`,children:[(0,m.jsx)(kC,{width:9,height:9}),e.attempts]}),e.workerGroup&&(0,m.jsxs)(`span`,{className:`truncate`,children:[`@`,e.workerGroup]}),(0,m.jsxs)(`span`,{className:`tnum ml-auto text-fg-2`,children:[`#`,e.seq,e.duration&&(0,m.jsxs)(`span`,{className:`text-faint`,children:[` · `,e.duration]})]})]}),e.subs&&(0,m.jsxs)(`div`,{className:`mono mt-1.5 flex items-center gap-2 border-t border-line pt-1.5 text-[10px]`,children:[e.subs.ok>0&&(0,m.jsxs)(`span`,{className:`text-good`,children:[e.subs.ok,` ok`]}),e.subs.failed>0&&(0,m.jsxs)(`span`,{className:`text-bad`,children:[e.subs.failed,` failed`]}),e.subs.skipped>0&&(0,m.jsxs)(`span`,{className:`text-warn`,children:[e.subs.skipped,` skipped`]})]})]}),(0,m.jsx)(lR,{type:`source`,position:$.Right,className:`!border-0 !bg-line-strong`})]})}function kB({data:e}){let{fan:t}=e,n=PT(t,e.runFinished),r=FT(t,e.runFinished),i=r===`failed`,a=r===`pending`||r===`running`,o=i?`bg-bad`:a?`bg-live`:`bg-good`,s=e=>`${e/Math.max(n.total,1)*100}%`;return(0,m.jsxs)(`div`,{title:`parallel fan ${t.group}`,className:`relative w-[208px] overflow-hidden rounded-xl border bg-panel/95 shadow-lg backdrop-blur ${i?`border-bad/40`:`border-violet/40`}`,children:[(0,m.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-[3px] ${o} ${a?`animate-pulse`:``}`}),(0,m.jsx)(lR,{type:`target`,position:$.Left,className:`!border-0 !bg-line-strong`}),(0,m.jsxs)(`div`,{className:`py-2.5 pl-3.5 pr-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`grid h-5 w-5 shrink-0 place-items-center rounded bg-violet/15 text-[11px] text-violet`,children:`⑃`}),(0,m.jsx)(`span`,{className:`truncate text-[13px] font-medium text-fg`,children:t.label}),(0,m.jsx)(`span`,{className:`mono tnum ml-auto shrink-0 text-[11px] text-fg-2`,children:IT(n)})]}),(0,m.jsx)(`div`,{className:`mt-2 flex h-1.5 overflow-hidden rounded-full bg-hover`,children:UT.map(e=>(0,m.jsx)(`span`,{className:e.className,style:{width:s(n[e.key])}},e.key))}),(0,m.jsxs)(`div`,{className:`mono tnum mt-1.5 flex flex-wrap items-center gap-2 text-[10px]`,children:[UT.map(e=>n[e.key]>0?(0,m.jsxs)(`span`,{className:e.text,children:[n[e.key],` `,e.label,e.key===`skipped`&&t.failFast?` (failFast)`:``]},e.key):null),(0,m.jsxs)(`span`,{className:`ml-auto text-dim`,children:[`#`,t.firstSeq,`–`,t.lastSeq]})]})]}),(0,m.jsx)(lR,{type:`source`,position:$.Right,className:`!border-0 !bg-line-strong`})]})}function AB({data:e}){let t=e.status===`running`||e.status===`awaiting`;return(0,m.jsxs)(`div`,{className:`s-${e.status} flex items-center gap-2 rounded-full border border-current/30 bg-panel px-3.5 py-1.5`,children:[(0,m.jsx)(lR,{type:`target`,position:$.Left,className:`!border-0 !bg-line-strong`}),(0,m.jsx)(`span`,{className:`dot ${t?`pulse`:``}`}),(0,m.jsx)(`span`,{className:`mono text-[11px] uppercase tracking-wider`,children:e.label}),(0,m.jsx)(lR,{type:`source`,position:$.Right,className:`!border-0 !bg-line-strong`})]})}var jB={step:OB,fan:kB,terminal:AB};function MB(e){let t=e.events?.filter(e=>e.status);if(t&&t.length!==0)return{ok:t.filter(e=>e.status===`ok`).length,failed:t.filter(e=>e.status===`failed`).length,skipped:t.filter(e=>e.status===`skipped`).length}}function NB({run:e,timeline:t,fans:n=TB,endStatus:r,selectedKey:i,onSelect:a,onOpenRun:o,fmtDuration:s,expanded:c,onToggleChild:l}){let u=c??wB,d=DB((0,p.useMemo)(()=>{let e=new Set(u);for(let n of vT(t))e.add(n);return e},[u,t])),{nodes:f,edges:h}=(0,p.useMemo)(()=>{let a=[],c=[],f=TS(e.status),p=(e,t,n)=>({id:`${e}->${t}`,source:e,target:t,style:{stroke:n?`var(--agora-bad)`:`var(--agora-line-strong)`,strokeWidth:1.5}}),m=(e,t)=>({id:`${e}=>${t}`,source:e,target:t,style:{stroke:`var(--agora-violet)`,strokeWidth:1.5,strokeDasharray:`4 3`}});function h(e,t,n,r,f,p){let h=`${f}s${e.seq}`,_=_T(e),v=_===void 0?void 0:d[_],y=v!==void 0&&v.timeline.length===1&&v.timeline[0]?{step:v.timeline[0],run:v.run}:void 0,b=y!==void 0,x=!b&&_!==void 0&&u.has(_),S=y?y.step:e,C=y?y.run:p,w=y?y.step.name:_===void 0?OT(e):v?.run.workflow??yT(_,p.id),T=S.status===`failed`;a.push({id:h,type:`step`,draggable:!1,position:{x:t,y:n},data:{seq:S.seq,name:w,kind:S.kind,status:S.status,workerGroup:S.workerGroup,attempts:S.attempts,duration:s(S.startedAt,S.finishedAt),subs:MB(S),selected:i===`${S.runId}#${S.seq}`,childRunId:_,onOpenRun:o,childExpanded:x,onToggleChild:l,collapsed:b,depth:r,step:S,laneRun:C}});let E=x?v:void 0;if(E){let i=g(E.timeline,E.fans??TB,r+1,t+248,n+150,`${_}:`,E.run);for(let e of i.firstIds)c.push(m(h,e));return{id:h,exits:EB(e.name)&&i.connectors.length>0?i.connectors:[{id:h,failed:T}],nextX:Math.max(t+248,i.nextX),bottomY:Math.max(n,i.bottomY)}}return{id:h,exits:[{id:h,failed:T}],nextX:t+248,bottomY:n}}function g(e,t,n,r,i,o,s){let l=r,u=[],d=[],f=i;for(let r of MT(e,t)){if(r.kind===`summary`){let e=`${o}fan:${r.fan.group}`;a.push({id:e,type:`fan`,draggable:!1,position:{x:l,y:i},data:{fan:r.fan,runFinished:RT(s.status),depth:n}}),u.length===0&&u.push(e);for(let t of d)c.push(p(t.id,e,t.failed));d=[{id:e,failed:FT(r.fan,RT(s.status))===`failed`}],l+=248;continue}let e=r.kind===`single`?[r.step]:r.steps,t=u.length===0,m=[],g=i,_=l;for(let r of e){let e=h(r,l,g,n,o,s);t&&u.push(e.id);for(let t of d)c.push(p(t.id,e.id,t.failed));m.push(...e.exits),_=Math.max(_,e.nextX),g=e.bottomY+96}d=m,l=_,f=Math.max(f,g-96)}return{firstIds:u,connectors:d,nextX:l,bottomY:f}}a.push({id:`start`,type:`terminal`,position:{x:0,y:0},draggable:!1,data:{status:`running`,label:e.workflow}});let _=g(t,n,0,248,0,``,e);for(let e of _.firstIds)c.push({id:`start->${e}`,source:`start`,target:e});let v=r??PS(e,t);a.push({id:`end`,type:`terminal`,position:{x:Math.max(_.nextX,248),y:0},draggable:!1,data:{status:v,label:v}});let y=_.connectors.length>0?_.connectors:[{id:`start`,failed:!1}];for(let e of y)c.push({id:`${e.id}->end`,source:e.id,target:`end`,animated:f,style:{stroke:f?`var(--agora-live)`:`var(--agora-line-strong)`,strokeWidth:f?2:1.5}});return{nodes:a,edges:c}},[e,t,n,r,i,o,s,u,l,d]),g=(0,p.useCallback)((e,t)=>{if(t.type!==`step`)return;let n=t.data;n.step&&n.laneRun&&a(n.step,n.laneRun)},[a]);return(0,m.jsxs)(Hz,{nodes:f,edges:h,nodeTypes:jB,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,children:[(0,m.jsx)(Yz,{variant:Gz.Dots,gap:22,size:1,color:`var(--agora-line-strong)`}),(0,m.jsx)(iB,{showInteractive:!1,position:`bottom-right`})]})}function PB(){return(0,m.jsxs)(`div`,{className:`flex h-full flex-col`,"aria-hidden":!0,children:[(0,m.jsxs)(`div`,{className:`flex flex-col gap-2.5 border-b border-line px-5 py-5 md:px-7`,children:[(0,m.jsx)(Gf,{className:`h-5 w-56`}),(0,m.jsx)(Gf,{className:`h-3 w-72`}),(0,m.jsx)(Gf,{className:`h-3 w-40`})]}),(0,m.jsx)(`div`,{className:`flex-1 p-6`,children:(0,m.jsx)(Gf,{className:`h-full min-h-40 w-full rounded-xl`})}),(0,m.jsxs)(`div`,{className:`h-48 border-t border-line p-4`,children:[(0,m.jsx)(Gf,{className:`h-3 w-full`}),(0,m.jsx)(Gf,{className:`mt-3 h-3 w-4/5`}),(0,m.jsx)(Gf,{className:`mt-3 h-3 w-3/5`})]})]})}function FB({compensations:e,selKey:t,onSelect:n}){return(0,m.jsxs)(`div`,{className:`shrink-0 border-t border-warn/20 bg-sunken/20 px-7 py-3`,children:[(0,m.jsx)(`div`,{className:`mono mb-2 text-[10px] uppercase tracking-[0.18em] text-warn/80`,children:`compensation · unwind order`}),(0,m.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map(e=>{let r=`${e.runId}#${e.seq}`;return(0,m.jsx)(`li`,{children:(0,m.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:`mono flex w-full items-center gap-2 rounded-md border px-2.5 py-1.5 text-left text-[11.5px] transition-colors ${r===t?`border-warn/50 bg-warn/15`:`border-warn/20 bg-warn/5 hover:border-warn/40`}`,children:[(0,m.jsx)(vC,{status:e.status}),(0,m.jsx)(`span`,{className:`truncate text-warn`,children:uS(e.name)}),(0,m.jsx)(`span`,{className:`ml-auto shrink-0 text-[10px] uppercase tracking-wider text-warn/70`,children:e.status})]})},r)})})]})}var IB=[];function LB({id:e,onOpenRun:t}){let n=g(),{data:r}=Qe({queryKey:[`run`,e],queryFn:async()=>RE(n.getQueryData([`run`,e]),await XS.run(e)),refetchInterval:e=>{let t=e.state.data?.run.status;return t===`running`||t===`suspended`||t===`cancelling`?1500:!1}}),{data:i=[]}=Qe({queryKey:[`workers`],queryFn:()=>XS.workers(),refetchInterval:5e3}),{data:a=[]}=Qe({queryKey:[`runs`,``,``],queryFn:()=>XS.runs(),refetchInterval:3e3}),{data:o}=Qe({queryKey:[`topology`],queryFn:()=>XS.topology(),staleTime:1/0,refetchInterval:!1}),s=o?.role===`tenant`,c=r?.run.status===`dead`?`dlq:${e}`:void 0,{data:l}=Qe({queryKey:[`run`,c],queryFn:()=>XS.run(c),enabled:!!c,retry:!1,refetchInterval:e=>!e.state.data&&1e4}),u=()=>{n.invalidateQueries({queryKey:[`run`,e]}),n.invalidateQueries({queryKey:[`runs`]})},d=(0,p.useRef)(null);d.current?.runId!==e&&(d.current={runId:e,tail:new LE});let f=d.current.tail;(0,p.useEffect)(()=>{let t=BE(()=>n.invalidateQueries({queryKey:[`run`,e]}),1500),r=XS.streamRun(e,r=>{if(f.push(r),r.type===`step.progress`&&r.event&&r.seq!=null){let t=r.seq,i=r.event;n.setQueryData([`run`,e],e=>zE(e,t,i))}else t.call()});return()=>{t.cancel(),r()}},[e,n,f]);let h=$e({mutationFn:()=>XS.retry(e),onSuccess:u}),_=$e({mutationFn:t=>XS.cancel(e,t===void 0?{}:{compensate:t}),onSuccess:u}),v=$e({mutationFn:()=>XS.continue(e),onSuccess:u}),y=$e({mutationFn:()=>XS.redispatch(e),onSuccess:u}),[b,x]=(0,p.useState)(!1),S=$e({mutationFn:()=>XS.republishLifecycle(e),onSuccess:u}),C=$e({mutationFn:t=>XS.retryWithInput(e,t),onSuccess:e=>{n.invalidateQueries({queryKey:[`runs`]}),t(e.runId)}}),[w,T]=(0,p.useState)(!1),[E,D]=(0,p.useState)(``),[O,k]=(0,p.useState)(),A=()=>{D(JSON.stringify(r?.run.input??{},null,2)),k(void 0),T(!0)},j=()=>{let e;try{e=JSON.parse(E)}catch(e){k(e instanceof Error?e.message:`Invalid JSON`);return}T(!1),C.mutate(e)},[M,N]=(0,p.useState)(),[P,F]=(0,p.useState)(!1),[I,L]=(0,p.useState)(new Set),[R,z]=(0,p.useState)(240);function B(e){e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId);let t=e=>z(t=>Math.max(120,Math.min(720,t-e.movementY))),n=()=>{window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerup`,n)};window.addEventListener(`pointermove`,t),window.addEventListener(`pointerup`,n)}function ee(e){L(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}if(!r)return(0,m.jsx)(PB,{});let{run:V,timeline:te}=r,{body:ne,compensations:H}=dS(te),re=r.fans??IB,U=re.reduce((e,t)=>e+t.size,ne.length),ie=ne.length>0||re.length>0,W=bT(r.children??[],r.childCount),G=xT(r),ae=G.startedBy,oe=CT(r),se=fS(H),ce=V.id.startsWith(`dlq:`),le=ce?{id:V.id.slice(4),title:`Dead-letter handler`,subtitle:`started because run ${V.id.slice(4)} was dead-lettered`,cta:`open dead run →`}:l?{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,ue=H.length>0||V.status===`cancelling`?(()=>{let e=se.failed>0?` ${se.failed} undo${se.failed===1?``:`s`} failed after retries — check ${se.failed===1?`it`:`them`} below.`:``;return V.status===`cancelling`?{title:`Cancelling`,subtitle:H.length>0?`undoing completed steps in reverse before cancelling (${se.done} of ${se.total} done).${e}`:`a compensating cancel is undoing the saga; the run becomes cancelled when it is done.`}:se.pending>0?{title:`Compensating`,subtitle:`undoing completed steps in reverse (${se.done} of ${se.total} done).${e}`}:V.status===`cancelled`?{title:`Cancelled with compensation`,subtitle:`completed steps were undone before cancelling.${e}`}:{title:`Saga compensated`,subtitle:`the run failed and its ${se.total} completed step${se.total===1?``:`s`} were undone in reverse.${e}`}})():void 0,de=V.status===`failed`||V.status===`suspended`,fe=V.status===`running`||V.status===`suspended`,pe=V.status===`suspended`||V.status===`running`,me=ne.some(e=>e.status===`pending`&&e.kind===`signal`&&e.name.startsWith(`breakpoint`)),he=M?`${M.step.runId}#${M.step.seq}`:void 0,ge=NS(V,{runs:a,health:i,timeline:ne}),_e=V.namespace&&V.namespace!=="default"?V.namespace:void 0,ve=Qx(V.origin),ye=V.waiting??a.find(e=>e.id===V.id)?.waiting,be=V.status===`suspended`?bS(ne,ye):[],xe=[h,_,v,y,C].find(e=>e.error)?.error;return(0,m.jsxs)(`div`,{className:`flex h-full flex-col overflow-y-auto lg:overflow-hidden`,children:[(0,m.jsxs)(`div`,{className:`flex flex-col gap-4 border-b border-line px-5 py-5 md:px-7 2xl:flex-row 2xl:items-start 2xl:justify-between`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,m.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-fg`,children:(0,m.jsx)(`a`,{href:rC(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})}),HE(V.id)!==void 0&&(0,m.jsx)(Wi,{variant:`alt`,size:`micro`,onClick:()=>t(HE(V.id)),className:`mono uppercase tracking-wider`,title:`Open the parent run (${HE(V.id)}) — the macro view this child belongs to`,children:`↑ parent`}),VE(V.id)!==void 0&&(0,m.jsx)(Wi,{variant:`chip`,size:`micro`,onClick:()=>t(VE(V.id)),className:`mono uppercase tracking-wider text-fg-2`,title:`This is a retry-with-input of ${VE(V.id)} — open the original run`,children:`↩ original`}),ce&&(0,m.jsx)(nC,{variant:`destructive`,className:`mono py-0.5 uppercase tracking-wider`,children:`dlq`}),(0,m.jsx)(yC,{status:ge.status}),ge.detail&&(0,m.jsx)(`span`,{className:`mono text-[11px] s-${ge.status}`,children:ge.detail}),_e&&(0,m.jsx)(nC,{variant:`info`,className:`mono py-0.5`,title:`Namespace (worker pool) this run belongs to`,children:_e}),ve?(0,m.jsx)(nC,{variant:`teal`,className:`mono py-0.5`,title:`Declared by ${ve}`,children:eS(ve)}):(0,m.jsxs)(nC,{variant:`neutral`,className:`mono py-0.5`,title:aS,children:[`origin `,`app`]}),H.length>0&&(0,m.jsx)(nC,{variant:`warn`,className:J(`mono py-0.5 uppercase tracking-wider`,se.pending>0&&`pulse`),title:se.pending>0?`compensating: ${se.done} of ${se.total} undone`:`${se.total} step${se.total===1?``:`s`} compensated`,children:se.pending>0?`compensating`:`compensated`}),(0,m.jsxs)(nC,{variant:`neutral`,className:`mono bg-transparent py-0.5 text-dim`,children:[`v`,V.workflowVersion]}),(0,m.jsxs)(`span`,{className:`mono tnum text-[11px] text-faint`,children:[U,` `,U===1?`step`:`steps`]})]}),(0,m.jsx)(`div`,{className:`mono mt-1 truncate text-[11px] text-faint`,children:V.id}),V.tags&&V.tags.length>0&&(0,m.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:V.tags.map(e=>(0,m.jsxs)(nC,{variant:`neutral`,className:`mono`,children:[`#`,e]},e))}),V.searchAttributes&&Object.keys(V.searchAttributes).length>0&&(0,m.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:Object.entries(V.searchAttributes).map(([e,t])=>(0,m.jsxs)(nC,{variant:`violet`,className:`mono`,title:`search attribute`,children:[e,`=`,String(t)]},e))}),W.shown.length>0?(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:`children:`}),W.shown.map(e=>(0,m.jsx)(Wi,{variant:`chip`,size:`micro`,onClick:()=>t(e),className:`mono px-1.5 py-0`,children:e},e)),W.more>0&&(0,m.jsxs)(`span`,{className:`mono text-[10px] text-dim`,children:[`+`,W.more,` more`]})]}):null,ae?(0,m.jsx)(NE,{source:ae,onOpenRun:t}):null,(0,m.jsx)(PE,{waitsFor:r.waitsFor,awaitedBy:r.awaitedBy,onOpenRun:t}),G.triggered.length>0&&!r.lifecycleDeliveries?(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] text-faint`,children:`triggered:`}),G.triggered.map(e=>(0,m.jsx)(Wi,{variant:`chip`,size:`micro`,onClick:()=>t(e),className:`mono px-1.5 py-0`,children:e},e))]}):null,r.lifecycleDeliveries?(0,m.jsx)(ZE,{deliveries:r.lifecycleDeliveries,tail:f,onOpenRun:t}):null,r.workflowLifecycle?(0,m.jsx)(`div`,{className:`mt-3`,children:(0,m.jsx)(cC,{links:r.workflowLifecycle})}):null,(0,m.jsx)(XE,{tail:f,onOpenRun:t})]}),(0,m.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,m.jsx)(Wi,{variant:`outline`,size:`sm`,onClick:()=>F(!0),className:`mono px-2.5 normal-case tracking-normal text-fg-2`,title:`Run input / output`,children:`{ }`}),me&&(0,m.jsxs)(Wi,{size:`sm`,variant:`warn`,disabled:v.isPending||s,onClick:()=>v.mutate(),title:s?`Not available on a tenant deployment — resuming a breakpoint needs the control plane.`:void 0,children:[(0,m.jsx)(AC,{width:12,height:12}),`Continue`]}),(0,m.jsxs)(Wi,{size:`sm`,variant:`brand`,disabled:!de||h.isPending,onClick:()=>h.mutate(),children:[(0,m.jsx)(OC,{width:12,height:12}),`Retry`]}),pe&&(0,m.jsxs)(Wi,{size:`sm`,variant:`info`,disabled:y.isPending,onClick:()=>y.mutate(),title:"Re-dispatch stuck `pending` remote steps — recovery for a lost step dispatch (crashed worker or dropped job)",children:[(0,m.jsx)(kC,{width:12,height:12}),`Re-dispatch`]}),oe.length>0&&(0,m.jsxs)(Wi,{size:`sm`,variant:`info`,disabled:S.isPending,onClick:()=>{S.reset(),x(!0)},title:`Publish this run's lifecycle event again, to the subscribers it has not started yet`,children:[(0,m.jsx)(kC,{width:12,height:12}),`Republish lifecycle event`]}),(V.status===`dead`||V.status===`failed`)&&(0,m.jsxs)(Wi,{size:`sm`,variant:`alt`,disabled:C.isPending||s,onClick:A,title:s?`Not available on a tenant deployment — fix & replay needs the control plane.`:`Edit the input and re-run as a fresh linked run`,children:[(0,m.jsx)(OC,{width:12,height:12}),`Fix & replay`]}),fe&&(0,m.jsxs)(Wi,{size:`sm`,variant:`warn`,disabled:_.isPending,onClick:()=>_.mutate(!0),title:`Cancel and run saga compensations (undo completed steps in reverse)`,className:`bg-transparent`,children:[(0,m.jsx)(OC,{width:12,height:12}),`Cancel + Undo`]}),(0,m.jsxs)(Wi,{variant:`outline`,size:`sm`,className:`border-line-strong`,disabled:!fe||_.isPending,onClick:()=>_.mutate(!1),children:[(0,m.jsx)(EC,{width:12,height:12}),`Cancel`]})]})]}),le&&(0,m.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-bad/30 bg-bad/10 px-7 py-3`,children:[(0,m.jsx)(`span`,{className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-bad/40 bg-bad/15 text-sm text-bad`,"aria-hidden":!0,children:`⚠`}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsx)(`div`,{className:`text-[13px] font-medium text-bad`,children:le.title}),(0,m.jsx)(`div`,{className:`mono truncate text-[11px] text-bad/70`,children:le.subtitle})]}),(0,m.jsx)(Wi,{size:`sm`,variant:`destructive`,onClick:()=>t(le.id),className:`mono shrink-0 border-bad/40 bg-bad/15 px-2.5 text-[11px] normal-case tracking-normal text-bad enabled:hover:bg-bad/25`,children:le.cta})]}),xe&&(0,m.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-3 border-b border-bad/30 bg-bad/10 px-7 py-3 text-[12px] text-bad`,children:[(0,m.jsx)(`span`,{className:`font-medium`,children:`Action failed:`}),(0,m.jsx)(`span`,{className:`mono min-w-0 flex-1 truncate`,children:xe instanceof Error?xe.message:String(xe)})]}),be.length>0&&(0,m.jsx)(nD,{runId:V.id,targets:be,tenantPod:s,onDelivered:u}),ue&&(0,m.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-warn/30 bg-warn/10 px-7 py-3`,children:[(0,m.jsx)(`span`,{className:`grid h-7 w-7 shrink-0 place-items-center rounded-md border border-warn/40 bg-warn/15 text-sm text-warn`,"aria-hidden":!0,children:`↺`}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsx)(`div`,{className:`text-[13px] font-medium text-warn`,children:ue.title}),(0,m.jsx)(`div`,{className:`mono truncate text-[11px] text-warn/70`,children:ue.subtitle})]})]}),(0,m.jsxs)(`div`,{className:`relative grid min-h-[560px] flex-1 lg:min-h-0`,style:{gridTemplateRows:ie?`1fr ${R}px`:`1fr`},children:[(0,m.jsxs)(`div`,{className:`relative min-h-0`,children:[ie?(0,m.jsx)(NB,{run:V,timeline:ne,fans:re,endStatus:ge.status,selectedKey:he,onSelect:(e,t)=>N({step:e,run:t}),onOpenRun:t,fmtDuration:_C,expanded:I,onToggleChild:ee}):(0,m.jsx)(`div`,{className:`grid h-full place-items-center text-sm text-faint`,children:`No steps recorded yet.`}),(V.status===`failed`||V.status===`cancelled`)&&V.error&&(0,m.jsx)(`div`,{className:`mono absolute inset-x-6 bottom-6 rounded-lg border border-bad/20 bg-bad/10 px-3 py-2 text-xs text-bad backdrop-blur`,children:V.error.message})]}),ie&&(0,m.jsxs)(`div`,{className:`relative min-h-0 overflow-hidden border-t border-line bg-sunken/20`,children:[(0,m.jsx)(`div`,{onPointerDown:B,className:`absolute inset-x-0 top-0 z-10 h-1.5 -translate-y-1/2 cursor-row-resize hover:bg-brand/40`,title:`Drag to resize`}),(0,m.jsx)(cE,{run:V,timeline:ne,fans:re,selectedKey:he,onSelect:(e,t)=>N({step:e,run:t}),onOpenRun:t,expanded:I,onToggleChild:ee})]}),M&&(0,m.jsx)(wE,{step:M.step,run:M.run,onClose:()=>N(void 0),onOpenRun:t}),P&&(0,m.jsx)(QE,{run:V,onClose:()=>F(!1)})]}),H.length>0&&(0,m.jsx)(FB,{compensations:H,selKey:he,onSelect:e=>N({step:e,run:V})}),(0,m.jsxs)(zC,{open:b,onOpenChange:x,title:`Republish lifecycle event`,description:`publishes ${V.id}'s ${V.status===`completed`?`completed`:`failed`} event again`,footer:S.isSuccess?(0,m.jsx)(Wi,{variant:`outline`,size:`sm`,onClick:()=>x(!1),children:`Close`}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Wi,{variant:`outline`,size:`sm`,onClick:()=>x(!1),children:`Cancel`}),(0,m.jsx)(Wi,{size:`sm`,variant:`info`,disabled:S.isPending,onClick:()=>S.mutate(),children:`Republish`})]}),children:[S.isSuccess?(0,m.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-fg-2`,children:wT(S.data)}):(0,m.jsxs)(`p`,{className:`text-[12.5px] leading-relaxed text-fg-2`,children:[`Starts the subscribers of this run's lifecycle event that it has not started yet:`,` `,(0,m.jsx)(`span`,{className:`mono text-fg-2`,children:oe.join(`, `)}),`. A subscriber run that already exists is not started again.`]}),S.isError&&(0,m.jsx)(`p`,{className:`mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad`,children:S.error instanceof Error?S.error.message:`Republish failed`})]}),(0,m.jsxs)(zC,{open:w,onOpenChange:T,title:`Fix & replay`,description:`re-runs ${V.id} as a fresh linked run`,footer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Wi,{variant:`outline`,size:`sm`,onClick:()=>T(!1),children:`Cancel`}),(0,m.jsx)(Wi,{size:`sm`,variant:`alt`,disabled:C.isPending,onClick:j,children:`Replay`})]}),children:[(0,m.jsx)(`label`,{className:`mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-dim`,htmlFor:`fix-replay-input`,children:`input`}),(0,m.jsx)(`textarea`,{id:`fix-replay-input`,value:E,spellCheck:!1,onChange:e=>{D(e.target.value),k(void 0)},className:`mono h-64 w-full resize-y rounded-lg border border-line bg-sunken/40 p-3 text-[11.5px] leading-relaxed text-fg-2 focus:border-line-strong focus:outline-none`}),O&&(0,m.jsx)(`p`,{className:`mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad`,children:O})]})]})}function RB(e){let t=new URL(window.location.href);e===void 0?t.searchParams.delete(`tenant`):t.searchParams.set(`tenant`,e),window.history.pushState(null,``,t.toString())}function zB(e,t){return t===void 0?`All organizations`:e?.tenants.find(e=>e.id===t)?.label??t}function BB(){let{data:e}=Qe({queryKey:[`tenants`],queryFn:()=>XS.tenants(),staleTime:6e4,refetchInterval:!1});return e}function VB(){let e=BB(),t=g(),[n,r]=(0,p.useState)(!1),[i,a]=(0,p.useState)(``),o=xS();if(!e||e.mode===`off`)return null;let s=`mono flex items-center gap-1.5 rounded-md border border-line bg-panel px-2 py-1 text-[11px] text-fg-2`;if(e.mode===`none`)return(0,m.jsxs)(`span`,{className:s,title:`Choose an organization in the app to see its runs`,children:[(0,m.jsx)(`span`,{className:`text-dim`,children:`Organization`}),` none`]});if(e.mode===`fixed`)return(0,m.jsxs)(`span`,{className:s,"data-tenant-picker":`fixed`,children:[(0,m.jsx)(`span`,{className:`text-dim`,children:`Organization`}),e.tenants[0]?.label??e.tenants[0]?.id]});let c=async e=>{r(!1),a(``),await XS.selectTenant(e??`*`).catch(()=>void 0),RB(e),await t.invalidateQueries({predicate:e=>e.queryKey[0]!==`tenants`})},l=i.trim().toLowerCase(),u=e.tenants.filter(e=>l===``||e.label.toLowerCase().includes(l)||e.id.toLowerCase().includes(l));return(0,m.jsxs)(mw,{open:n,onOpenChange:r,children:[(0,m.jsxs)(hw,{className:`${s} hover:border-line-strong`,"aria-label":`Organization`,"data-tenant-picker":`pick`,children:[(0,m.jsx)(`span`,{className:`text-dim`,children:`Organization`}),zB(e,o)]}),(0,m.jsxs)(gw,{align:`end`,className:`w-64 gap-1 p-1`,children:[(0,m.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:`search organizations…`,"aria-label":`search organizations`,className:`mb-1 w-full rounded border border-line bg-transparent px-2 py-1 text-xs text-fg outline-none`}),(0,m.jsxs)(`div`,{role:`listbox`,"aria-label":`Organizations`,className:`max-h-72 overflow-y-auto`,children:[e.all&&(0,m.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":o===void 0,onClick:()=>void c(void 0),className:`w-full rounded px-2 py-1.5 text-left text-xs text-fg hover:bg-panel`,children:`All organizations`}),u.map(e=>(0,m.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":o===e.id,onClick:()=>void c(e.id),className:`flex w-full flex-col rounded px-2 py-1.5 text-left text-xs text-fg hover:bg-panel`,children:[(0,m.jsx)(`span`,{className:`truncate`,children:e.label}),e.label!==e.id&&(0,m.jsx)(`span`,{className:`mono truncate text-[10px] text-dim`,children:e.id})]},e.id)),u.length===0&&(0,m.jsx)(`p`,{className:`px-2 py-1.5 text-xs text-dim`,children:`No match.`})]})]})]})}function HB(){return(0,m.jsx)(`ul`,{className:`divide-y divide-line-soft`,"aria-hidden":!0,children:[`a`,`b`,`c`,`d`,`e`,`f`].map(e=>(0,m.jsxs)(`li`,{className:`flex flex-col gap-2 px-4 py-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,m.jsx)(Gf,{className:`h-3.5 w-32`}),(0,m.jsx)(Gf,{className:`h-3 w-16`})]}),(0,m.jsx)(Gf,{className:`h-2.5 w-48`})]},e))})}function UB({r:e,allRuns:t,health:n,selected:r,onSelect:i,onSelectTag:a,onSelectNamespace:o,onSelectOrigin:s,tenantPicker:c}){let l=NS(e,{runs:t,health:n}),u=e.namespace&&e.namespace!=="default"?e.namespace:void 0,d=Qx(e.origin),f=c?.mode===`pick`&&xS()===void 0;return(0,m.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:`flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors ${r===e.id?`bg-hover`:`hover:bg-hover/50`}`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,m.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.workflow}),u&&(0,m.jsx)(nC,{variant:`info`,className:`mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-info/60 hover:text-info`,title:`Namespace (worker pool) — click to show only ${u}`,onClick:e=>{e.stopPropagation(),o(u)},children:u}),f&&(0,m.jsx)(nC,{variant:`info`,className:`shrink-0 px-1 text-[9px]`,title:`Organization this run belongs to`,"data-run-org":``,children:e.tenantId?zB(c,e.tenantId):`no organization`}),d&&(0,m.jsx)(nC,{variant:`teal`,className:`mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-teal/60 hover:text-teal`,title:`Declared by ${d} — click to show only this library's runs`,onClick:e=>{e.stopPropagation(),s({kind:`origin`,origin:d})},children:eS(d)}),e.id.startsWith(`dlq:`)&&(0,m.jsx)(nC,{variant:`destructive`,className:`mono shrink-0 px-1 text-[9px] uppercase tracking-wider`,children:`dlq`})]}),(0,m.jsx)(yC,{status:l.status})]}),l.detail&&(0,m.jsx)(`div`,{className:`mono truncate text-[11px] s-${l.status}`,children:l.detail}),(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,m.jsx)(`span`,{className:`mono truncate text-[11px] text-faint`,children:e.id}),(0,m.jsx)(`span`,{className:`shrink-0 text-[11px] text-faint`,children:gC(e.updatedAt)})]}),e.tags&&e.tags.length>0&&(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.tags.map(e=>(0,m.jsxs)(`span`,{onClick:t=>{t.stopPropagation(),a(e)},className:J(tC({variant:`neutral`}),`mono h-auto cursor-pointer py-0 text-[10px] hover:border-line-strong hover:text-fg`),children:[`#`,e]},e))})]})}var WB=88;function GB({runs:e,allRuns:t,health:n,loading:r,selected:i,onSelect:a,onSelectTag:o,onSelectNamespace:s,onSelectOrigin:c,emptyNotice:l,hasMore:u,loadingMore:d,onLoadMore:f,tenantPicker:h}){let g=(0,p.useRef)(null),_=(0,p.useCallback)(t=>e[t]?.id??t,[e]),v=nT({count:e.length,getScrollElement:()=>g.current,estimateSize:()=>WB,getItemKey:_,overscan:10,initialRect:{width:340,height:480}}),y=v.getVirtualItems(),b=y.length>0?y[y.length-1]?.index??-1:-1;return(0,p.useEffect)(()=>{e.length!==0&&(b<e.length-1||u&&!d&&f?.())},[b,e.length,u,d,f]),r&&e.length===0?(0,m.jsx)(HB,{}):e.length===0?(0,m.jsx)(qC,{className:`p-6`,icon:(0,m.jsx)(At,{}),title:h?.mode===`none`?`No organization picked`:`No runs here`,description:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`block`,children:h?.mode===`none`?`Choose an organization to see its data.`:l.message}),l.unclassified!==void 0&&(0,m.jsxs)(`span`,{className:`mt-2 block text-[12px]`,children:[l.unclassified,` run`,l.unclassified===1?``:`s`,` here`,` `,l.unclassified===1?`is`:`are`,` the app's own (no package origin), so no package filter can match `,l.unclassified===1?`it`:`them`,`.`]})]}),action:l.unclassified===void 0?void 0:(0,m.jsx)(Wi,{variant:`chip`,size:`micro`,className:`mono`,title:aS,onClick:()=>c({kind:`unknown`}),children:`show app runs`})}):(0,m.jsxs)(`div`,{ref:g,className:`h-full overflow-auto`,"data-testid":`runs-list-scroll`,children:[(0,m.jsx)(`ul`,{className:`relative divide-y divide-line-soft`,style:{height:v.getTotalSize()},children:y.map(r=>{let l=e[r.index];return l?(0,m.jsx)(`li`,{ref:v.measureElement,"data-index":r.index,className:`absolute inset-x-0 top-0`,style:{transform:`translateY(${r.start}px)`},children:(0,m.jsx)(UB,{r:l,allRuns:t,health:n,selected:i,onSelect:a,onSelectTag:o,onSelectNamespace:s,onSelectOrigin:c,tenantPicker:h})},l.id):null})}),d&&(0,m.jsx)(`div`,{className:`mono px-4 py-2 text-center text-[11px] text-faint`,children:`loading more…`})]})}function KB(){let[e,t]=(0,p.useState)(`all`),[n,r]=(0,p.useState)([]),[i,a]=(0,p.useState)([]),[o,s]=(0,p.useState)([]),[c,l]=(0,p.useState)([]),[u,d]=(0,p.useState)(Zx);return{status:e,setStatus:t,workflow:n,setWorkflow:r,tag:i,setTag:a,attr:o,setAttr:s,namespace:c,setNamespace:l,origin:u,setOrigin:d}}function qB({scope:e,value:t,onChange:n}){let{data:r=[]}=Qe({queryKey:[`run-values`,`status`,e],queryFn:()=>XS.values(`status`,e),refetchInterval:5e3}),i={};for(let e of r)e.value!==null&&(i[e.value]=e.count);let a=Object.values(i).reduce((e,t)=>e+t,0),o=(e,r)=>(0,m.jsxs)(Wi,{variant:`chip`,size:`chip`,"aria-pressed":t===e,onClick:()=>n(e),className:`shrink-0 rounded-md`,children:[e!==`all`&&(0,m.jsx)(vC,{status:e}),(0,m.jsx)(`span`,{className:`uppercase tracking-wide`,children:e}),(0,m.jsx)(`span`,{className:`mono tnum text-faint`,children:r})]},e);return(0,m.jsxs)(QS,{label:`filter runs by status`,className:`-mx-4 flex-nowrap overflow-x-auto px-4 pb-1 sm:mx-0 sm:flex-wrap sm:overflow-visible sm:px-0 sm:pb-0`,children:[o(`all`,a),hC.map(e=>o(e,i[e]??0))]})}function JB({filters:e,selected:t,onSelect:n,onOpenRun:r,tenantPicker:i}){let{status:a,setStatus:o,workflow:s,setWorkflow:c,tag:l,setTag:u,attr:d,setAttr:f,namespace:h,setNamespace:_,origin:v,setOrigin:y}=e,b=g(),x=d,[S,C]=(0,p.useState)(()=>typeof window>`u`||window.innerWidth>=1024),{data:w,dataUpdatedAt:T,isPending:E,fetchNextPage:D,hasNextPage:O,isFetchingNextPage:k}=et({queryKey:[`runs`,a,s,l,x.join(`|`),h],queryFn:({pageParam:e})=>XS.runsPage(a===`all`?void 0:a,l.length?l:void 0,x.length?x:void 0,{namespace:h.length?h:void 0,workflow:s.length?s:void 0},{page:e,size:100}),initialPageParam:1,getNextPageParam:e=>{let{currentPage:t,lastPage:n}=e.meta;return t<n?t+1:void 0},refetchInterval:3e3}),A=(0,p.useMemo)(()=>w?.pages.flatMap(e=>e.data)??[],[w]),j=w?.pages[0]?.meta.total;(0,p.useEffect)(()=>{T>0&&b.invalidateQueries({queryKey:[`run-values`,`status`]})},[T,b]);let{data:M=[]}=Qe({queryKey:[`workers`],queryFn:()=>XS.workers(),refetchInterval:5e3}),[N,P]=(0,p.useState)(void 0),[F,I]=(0,p.useState)(void 0),L=$e({mutationFn:e=>XS.bulk(e,{status:a===`all`?void 0:a,workflow:s.length?s:void 0,tag:l.length?l:void 0,attr:x.length?x:void 0,namespace:h.length?h:void 0,origin:v.kind===`origin`?v.origin:void 0}),onSuccess:(e,t)=>{I({action:t,...e}),b.invalidateQueries({queryKey:[`runs`]})}});(0,p.useEffect)(()=>{if(!F||F.matched>=500)return;let e=setTimeout(()=>I(void 0),6e3);return()=>clearTimeout(e)},[F]);let R=iS(A,v),z=cS(A),B=a!==`all`||s.length>0||l.length>0||h.length>0||x.length>0||v.kind!==`all`,ee=s.length+l.length+h.length+x.length+(v.kind===`all`?0:1),V=a===`all`?void 0:a,te=(0,p.useMemo)(()=>({status:V,tag:l,namespace:h,attr:d}),[V,l,h,d]),ne=(0,p.useMemo)(()=>({status:V,workflow:s,namespace:h,attr:d}),[V,s,h,d]),H=(0,p.useMemo)(()=>({status:V,workflow:s,tag:l,attr:d}),[V,s,l,d]),re=(0,p.useMemo)(()=>({status:V,workflow:s,tag:l,namespace:h}),[V,s,l,h]),U=(0,p.useMemo)(()=>({workflow:s,tag:l,namespace:h,attr:d}),[s,l,h,d]),ie=(0,p.useCallback)(e=>u(t=>t.includes(e)?t:[...t,e]),[u]),W=(0,p.useCallback)(e=>_(t=>t.includes(e)?t:[...t,e]),[_]),G=v.kind===`unknown`?`Bulk actions cannot be scoped to the app's own runs — runs with no package origin have no server-side filter. Retry or cancel them from their own run view.`:void 0,ae=(0,p.useMemo)(()=>[...new Set(A.filter(e=>NS(e,{runs:A,health:M}).status===`no-worker`).map(e=>e.workflow))],[A,M]),oe=`${a}|${s.join(`|`)}|${l.join(`|`)}|${x.join(`,`)}|${h.join(`|`)}|${nS(v)}`,se=[a===`all`?void 0:`status ${a}`,s.length>0?`workflow ${s.join(`, `)}`:void 0,l.length>0?`tag ${l.join(`, `)}`:void 0,h.length>0?`namespace ${h.join(`, `)}`:void 0,x.length>0?`attr ${x.join(` · `)}`:void 0,v.kind===`origin`?`origin ${eS(v.origin)}`:void 0].filter(e=>e!==void 0).join(` · `)||`no filter — every run`;return(0,m.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[ae.length>0&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-warn/30 bg-warn/10 px-4 py-2 text-[12px] text-warn md:px-6`,children:[(0,m.jsx)(`span`,{className:`dot s-no-worker shrink-0`,"aria-hidden":!0}),(0,m.jsxs)(`span`,{children:[`Runs waiting on handlers with no live worker:`,` `,(0,m.jsx)(`span`,{className:`mono font-medium`,children:ae.join(`, `)}),`. Start a worker to unblock.`]})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 pt-5 pb-3 md:px-6 md:pt-6`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-2`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-lg font-bold tracking-[0.01em] text-fg`,children:`Runs`}),(0,m.jsx)(`p`,{className:`mt-1 text-xs text-faint`,children:j===void 0?`Every workflow run, live.`:`${j} ${B?`matching`:``} run${j===1?``:`s`} · live`})]}),(0,m.jsxs)(Wi,{variant:`outline`,size:`sm`,"aria-expanded":S,"aria-controls":`runs-filters`,onClick:()=>C(e=>!e),children:[(0,m.jsx)(Et,{}),`Filters`,ee>0&&(0,m.jsx)(`span`,{className:`mono tnum rounded bg-primary/15 px-1 text-[10px] text-brand`,children:ee})]})]}),(0,m.jsx)(qB,{scope:U,value:a,onChange:o})]}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1 px-0 pb-0 md:px-6 md:pb-6`,children:(0,m.jsxs)(`div`,{className:`grid h-full min-h-0 overflow-hidden border-t border-border bg-card agora-surface md:rounded-lg md:border lg:grid-cols-[minmax(300px,380px)_1fr]`,children:[(0,m.jsxs)(`aside`,{"aria-label":`Runs`,className:J(`flex min-h-0 flex-col border-border lg:border-r`,t!==void 0&&`hidden lg:flex`),children:[(0,m.jsxs)(Gi,{label:`Filters`,children:[S&&(0,m.jsxs)(`div`,{id:`runs-filters`,className:`border-b border-border p-2`,children:[(0,m.jsx)(dT,{field:`workflow`,scope:te,glyph:`ƒ`,label:`filter by workflow`,placeholder:`filter by workflow…`,value:s,onChange:c,title:`Workflow handler names (WorkflowRun.workflow). Several match ANY of them.`}),(0,m.jsx)(`div`,{className:`mt-1.5`,children:(0,m.jsx)(dT,{field:`tag`,scope:ne,glyph:`#`,label:`filter by tag`,placeholder:`filter by tag…`,value:l,onChange:u,title:`Tags carried by a run (WorkflowRun.tags). Several match ANY of them.`})}),(0,m.jsx)(`div`,{className:`mt-1.5 flex`,children:(0,m.jsx)(IE,{tags:l,onChange:u})}),(0,m.jsx)(`div`,{className:`mt-1.5`,children:(0,m.jsx)(dT,{field:`namespace`,scope:H,glyph:`@`,label:`filter by namespace`,placeholder:`filter by namespace…`,value:h,onChange:_,title:`Namespace: the worker pool a run belongs to (WorkflowRun.namespace). None selected shows every namespace.`})}),(0,m.jsx)(hT,{value:d,onChange:f,scope:re})]}),(0,m.jsx)(gT,{runs:A,value:v,onChange:y})]}),B&&R.length>0&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-1.5`,children:[(0,m.jsxs)(`span`,{className:`mono min-w-0 truncate text-[10px] text-dim`,children:[R.length,` `,a===`all`?``:a,` `,s.length>0&&`ƒ${s.join(`, `)}`,l.length>0&&` #${l.join(`, `)}`,h.length>0&&` @${h.join(`, `)}`,v.kind===`origin`&&` ⬡${eS(v.origin)}`,v.kind===`unknown`&&` ⬡app`,x.length>0&&` ⛃${x.length}`]}),(0,m.jsx)(Wi,{variant:`brand`,size:`micro`,disabled:L.isPending||G!==void 0,title:G,onClick:()=>P(`retry`),className:`mono ml-auto`,children:`retry all`}),(0,m.jsx)(Wi,{variant:`destructive`,size:`micro`,disabled:L.isPending||G!==void 0,title:G,onClick:()=>P(`cancel`),className:`mono`,children:`cancel all`})]}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,m.jsx)(Gi,{label:`Run list`,resetKeys:[oe],children:(0,m.jsx)(GB,{tenantPicker:i,runs:R,allRuns:A,health:M,loading:E,selected:t,onSelect:n,onSelectTag:ie,onSelectNamespace:W,onSelectOrigin:y,hasMore:O,loadingMore:k,onLoadMore:D,emptyNotice:lS({anyFilter:B,origin:v,unknownCount:z})},oe)})})]}),(0,m.jsx)(`section`,{"aria-label":`Run detail`,className:J(`min-h-0 min-w-0`,t===void 0&&`hidden lg:block`),children:t?(0,m.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,m.jsx)(`div`,{className:`border-b border-border px-3 py-2 lg:hidden`,children:(0,m.jsxs)(Wi,{variant:`ghost`,size:`sm`,onClick:()=>n(void 0),children:[(0,m.jsx)(vt,{}),`All runs`]})}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,m.jsx)(Gi,{label:`Run detail`,resetKeys:[t],children:(0,m.jsx)(LB,{id:t,onOpenRun:r},t)})})]}):(0,m.jsx)(qC,{className:`h-full`,icon:(0,m.jsx)(mC,{className:`size-6`}),title:`No run selected`,description:`Select a run to see its timeline, steps and spans.`})})]})}),(0,m.jsx)(zC,{open:N!==void 0,onOpenChange:e=>{e||P(void 0)},title:N===`cancel`?`Cancel all matching runs`:`Retry all matching runs`,description:se,footer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Wi,{size:`sm`,variant:`outline`,onClick:()=>P(void 0),children:`Back`}),(0,m.jsx)(Wi,{size:`sm`,variant:N===`cancel`?`destructive`:`brand`,disabled:L.isPending,onClick:()=>{N&&L.mutate(N),P(void 0)},children:N===`cancel`?`cancel all`:`retry all`})]}),children:(0,m.jsxs)(`p`,{className:`text-[12.5px] leading-relaxed text-fg-2`,children:[`This `,N===`cancel`?`cancels`:`retries`,` `,(0,m.jsx)(`em`,{children:`every`}),` run matching the filter above on the server — including matches beyond the rows loaded on screen. The server acts on at most `,(0,m.jsx)(`span`,{className:`mono tnum text-fg`,children:500}),` matches per call.`]})}),L.error&&(0,m.jsxs)(`div`,{role:`alert`,className:`fixed bottom-4 left-1/2 z-50 -translate-x-1/2 rounded-md border border-bad/40 bg-bad/15 px-4 py-2 text-[12px] text-bad`,children:[`Bulk action failed:`,` `,L.error instanceof Error?L.error.message:String(L.error)]}),F&&(0,m.jsxs)(`output`,{className:`agora-rise fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-3 rounded-lg border border-border bg-popover px-4 py-3 text-left shadow-2xl`,children:[(0,m.jsxs)(`div`,{className:`min-w-0 flex-1 text-[12px]`,children:[(0,m.jsxs)(`div`,{className:`text-fg`,children:[`Bulk `,F.action,`: `,(0,m.jsx)(`span`,{className:`mono tnum`,children:F.applied}),` of`,` `,(0,m.jsx)(`span`,{className:`mono tnum`,children:F.matched}),` matched`,` `,F.matched===1?`run`:`runs`,` `,F.action===`cancel`?`cancelled`:`retried`,`.`]}),F.matched>=500&&(0,m.jsxs)(`div`,{className:`mt-1 text-[11px] text-warn`,children:[`Matched the `,500,`-run server cap — only the first `,500,` were affected. Run the action again to continue.`]})]}),(0,m.jsx)(Wi,{variant:`ghost`,size:`icon-xs`,"aria-label":`dismiss`,onClick:()=>I(void 0),children:(0,m.jsx)(EC,{width:12,height:12})})]})]})}function YB({label:e,children:t,side:n=`bottom`,align:r=`center`,suppressed:i}){return(0,m.jsxs)(Lp,{disabled:i??!1,children:[(0,m.jsx)(Rp,{render:t}),(0,m.jsx)(zp,{side:n,align:r,className:`max-w-[300px] whitespace-pre-line text-left`,children:e})]})}function XB(e){let t=(e,t)=>`${Number.isInteger(e)?e:e.toFixed(1)}${t}`;if(e<1e3)return`${e}ms`;let n=e/1e3;if(n<60)return t(n,`s`);let r=n/60;if(r<60)return t(r,`m`);let i=r/60;return i<24?t(i,`h`):t(i/24,`d`)}function ZB(e){return e.cron?e.cron:e.everyMs==null?`—`:`every ${XB(e.everyMs)}`}function QB(e,t=Date.now()){let n=e-t;if(n<=0)return`due now`;let r=Math.round(n/1e3);if(r<60)return`in ${r}s`;let i=Math.round(r/60);if(i<60)return`in ${i}m`;let a=Math.round(i/60);return a<24?`in ${a}h`:`in ${Math.round(a/24)}d`}var $B=`grid grid-cols-[minmax(0,1.2fr)_minmax(0,1fr)_minmax(0,0.8fr)_minmax(0,0.8fr)_80px_minmax(0,1.3fr)_176px] items-center gap-3 px-4`;function eV({s:e,onOpenRun:t}){let n=g(),r=()=>n.invalidateQueries({queryKey:[`schedules`]}),i=$e({mutationFn:t=>XS.setSchedulePaused(e.key,t),onSuccess:r}),a=$e({mutationFn:()=>XS.triggerSchedule(e.key),onSuccess:e=>{r(),n.invalidateQueries({queryKey:[`runs`]}),t(e.runId)}}),o=e.namespace&&e.namespace!=="default"?e.namespace:void 0;return(0,m.jsxs)(`li`,{className:J($B,`py-3`),children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`mono truncate text-[12px] text-fg`,children:e.key}),e.overlap===`skip`&&(0,m.jsx)(`div`,{className:`mono text-[9px] uppercase tracking-wider text-faint`,children:`no overlap`})]}),(0,m.jsxs)(`div`,{className:`mono flex min-w-0 items-center gap-1.5 text-[11px] text-fg-2`,children:[(0,m.jsx)(`span`,{className:`truncate`,children:e.workflow}),o&&(0,m.jsx)(nC,{variant:`info`,className:`mono shrink-0 px-1 text-[9px]`,children:o})]}),(0,m.jsx)(`span`,{className:`mono truncate text-[11px] text-fg-2`,title:ZB(e),children:ZB(e)}),(0,m.jsx)(`span`,{className:`mono truncate text-[10px] text-dim`,children:e.timezone??`UTC`}),(0,m.jsx)(`span`,{className:J(`mono tnum text-[11px]`,e.paused?`text-faint`:`text-fg-2`),title:new Date(e.nextFireAt).toISOString(),children:e.paused?`—`:QB(e.nextFireAt)}),(0,m.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.lastRunStatus?(0,m.jsx)(`button`,{type:`button`,onClick:()=>t(e.currentWindowRunId),title:`Open the current window's run (${e.currentWindowRunId})`,className:`cursor-pointer`,children:(0,m.jsxs)(nC,{variant:`bare`,className:`s-${e.lastRunStatus} text-[11px] hover:underline`,children:[(0,m.jsx)(`span`,{className:`dot s-${e.lastRunStatus}`,"aria-hidden":!0}),e.lastRunStatus]})}):(0,m.jsx)(`span`,{className:`mono text-[11px] text-faint`,title:`The current window has no run yet`,children:`—`}),e.paused&&(0,m.jsx)(YB,{label:e.pausedAtRuntime?`Paused by a runtime override (from this console) — it survives until resumed, overriding the config.`:`Paused in the schedule config.`,children:(0,m.jsxs)(nC,{variant:`warn`,className:`mono min-w-0 py-0.5 uppercase tracking-wider`,children:[`paused`,e.pausedAtRuntime?` · runtime override`:``]})})]}),(0,m.jsxs)(`span`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,m.jsx)(Wi,{variant:e.paused?`outline`:`warn`,size:`micro`,disabled:i.isPending,onClick:()=>i.mutate(!e.paused),className:`mono uppercase tracking-wider`,title:e.paused?`Resume this schedule fleet-wide (clears the runtime pause)`:`Pause this schedule fleet-wide, at runtime — the config stays untouched`,children:e.paused?`Resume`:`Pause`}),(0,m.jsxs)(Wi,{variant:`brand`,size:`micro`,disabled:a.isPending,onClick:()=>a.mutate(),className:`mono uppercase tracking-wider`,title:`Fire the current window now and open its run`,children:[(0,m.jsx)(AC,{width:10,height:10}),`Run now`]})]}),(i.error||a.error)&&(0,m.jsx)(`div`,{role:`alert`,className:`mono col-span-full text-[11px] text-bad`,children:(()=>{let e=i.error??a.error;return`Action failed: ${e instanceof Error?e.message:String(e)}`})()})]})}function tV({onOpenRun:e}){let{data:t,error:n,isPending:r}=Qe({queryKey:[`schedules`],queryFn:()=>XS.schedules(),refetchInterval:5e3,retry:!1});return(0,m.jsxs)(Tx,{children:[(0,m.jsx)(ZS,{title:`Schedules`,description:t?`${t.length} ticked schedule${t.length===1?``:`s`} · pause/resume is a fleet-wide runtime override · "Run now" fires the current window`:`Ticked schedules, their cadence and their current window.`}),(0,m.jsx)(Gi,{label:`Schedules`,children:(0,m.jsx)(nV,{schedules:t,error:n,loading:r,onOpenRun:e})})]})}function nV({schedules:e,error:t,loading:n,onOpenRun:r}){return t?(0,m.jsx)(eC,{title:`Ticked schedules`,flush:!0,children:(0,m.jsx)(qC,{icon:(0,m.jsx)(kt,{}),title:`Schedules are not available here.`,description:(0,m.jsxs)(`span`,{className:`mono text-[11px]`,children:["This deployment's server has no runtime schedule control (a tenant topology, or a server older than the endpoint) — `GET /schedules` answered: ",t.message]})})}):(0,m.jsx)(eC,{title:`Ticked schedules`,description:`key · workflow · cadence · next fire · current window`,flush:!0,children:(0,m.jsx)(`div`,{className:`overflow-x-auto`,children:(0,m.jsxs)(`div`,{className:`min-w-[860px]`,children:[(0,m.jsxs)(`div`,{className:J($B,`border-b border-border py-2.5 text-[10.5px] font-medium uppercase tracking-[0.14em] text-dim`),children:[(0,m.jsx)(`span`,{children:`key`}),(0,m.jsx)(`span`,{children:`workflow`}),(0,m.jsx)(`span`,{children:`cadence`}),(0,m.jsx)(`span`,{children:`timezone`}),(0,m.jsx)(`span`,{children:`next fire`}),(0,m.jsx)(`span`,{children:`last run`}),(0,m.jsx)(`span`,{className:`text-right`,children:`actions`})]}),n||!e?(0,m.jsx)(`ul`,{className:`divide-y divide-line-soft`,"aria-hidden":!0,children:[`a`,`b`,`c`,`d`].map(e=>(0,m.jsxs)(`li`,{className:J($B,`py-3.5`),children:[(0,m.jsx)(Gf,{className:`h-3 w-32`}),(0,m.jsx)(Gf,{className:`h-3 w-24`}),(0,m.jsx)(Gf,{className:`h-3 w-20`}),(0,m.jsx)(Gf,{className:`h-3 w-12`}),(0,m.jsx)(Gf,{className:`h-3 w-12`}),(0,m.jsx)(Gf,{className:`h-3 w-16`}),(0,m.jsx)(Gf,{className:`ml-auto h-6 w-28`})]},e))}):e.length===0?(0,m.jsx)(qC,{icon:(0,m.jsx)(kt,{}),title:`No schedules registered.`,description:`Declare a schedule on a workflow and it shows up here once the ticker runs.`}):(0,m.jsx)(`ul`,{className:`divide-y divide-line-soft`,children:e.map(e=>(0,m.jsx)(eV,{s:e,onOpenRun:r},e.key))})]})})})}function rV({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,m.jsx)(`table`,{"data-slot":`table`,className:J(`w-full caption-bottom text-sm`,e),...t})})}function iV({className:e,...t}){return(0,m.jsx)(`thead`,{"data-slot":`table-header`,className:J(`[&_tr]:border-b`,e),...t})}function aV({className:e,...t}){return(0,m.jsx)(`tbody`,{"data-slot":`table-body`,className:J(`[&_tr:last-child]:border-0`,e),...t})}function oV({className:e,...t}){return(0,m.jsx)(`tr`,{"data-slot":`table-row`,className:J(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function sV({className:e,...t}){return(0,m.jsx)(`th`,{"data-slot":`table-head`,className:J(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function cV({className:e,...t}){return(0,m.jsx)(`td`,{"data-slot":`table-cell`,className:J(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}var lV={sm:`hidden sm:table-cell`,md:`hidden md:table-cell`,lg:`hidden lg:table-cell`};function uV({columns:e,rows:t,rowKey:n,onRowClick:r,loading:i,skeletonRows:a=5,empty:o,className:s,label:c,rowClassName:l,subRow:u}){let d=e=>J(e.hideBelow&&lV[e.hideBelow],e.align===`right`&&`text-right`,e.className);return!i&&t&&t.length===0&&o?(0,m.jsx)(m.Fragment,{children:o}):(0,m.jsxs)(rV,{className:s,"aria-label":c,children:[(0,m.jsx)(iV,{children:(0,m.jsx)(oV,{className:`border-border hover:bg-transparent`,children:e.map(e=>(0,m.jsx)(sV,{className:J(`h-auto px-3 py-2 text-[10px] font-semibold uppercase tracking-[0.12em] text-faint`,d(e)),children:e.header},e.id))})}),(0,m.jsx)(aV,{children:i||!t?Array.from({length:a},(t,n)=>(0,m.jsx)(oV,{"aria-hidden":!0,className:`hover:bg-transparent`,children:e.map((e,t)=>(0,m.jsx)(cV,{className:J(`px-3 py-3`,d(e)),children:(0,m.jsx)(Gf,{className:J(`h-3`,t===0?`w-36`:`w-16`)})},e.id))},`s${n}`)):t.map(t=>{let i=u?.(t);return(0,m.jsxs)(p.Fragment,{children:[(0,m.jsx)(oV,{className:J(`border-border hover:bg-hover`,r&&`cursor-pointer`,l?.(t)),...r?{onClick:()=>r(t),onKeyDown:e=>{e.key===`Enter`&&r(t)},tabIndex:0}:{},children:e.map(e=>(0,m.jsx)(cV,{className:J(`px-3 py-2.5 text-[12.5px] text-dim`,d(e)),children:e.cell(t)},e.id))}),i!=null&&i!==!1&&(0,m.jsx)(oV,{className:`border-border hover:bg-transparent`,children:(0,m.jsx)(cV,{colSpan:e.length,className:`px-3 pt-0 pb-3 whitespace-normal`,children:i})})]},n(t))})})]})}var dV={default:`text-fg`,brand:`text-brand`,good:`text-good`,warn:`text-warn`,bad:`text-bad`,info:`text-info`,violet:`text-violet`};function fV({label:e,value:t,caption:n,tone:r=`default`,className:i}){return(0,m.jsxs)($S,{className:J(`agora-surface agora-rise rounded-lg border border-border shadow-none ring-0 gap-0 px-[18px] pt-4 pb-3.5`,i),children:[(0,m.jsx)(`div`,{className:`mb-2.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-faint`,children:e}),(0,m.jsx)(`div`,{className:J(`mono tnum text-[26px] font-semibold leading-none tracking-[-0.02em]`,dV[r]),children:t}),n&&(0,m.jsx)(`div`,{className:`mono mt-2 truncate text-[10.5px] text-faint`,children:n})]})}function pV({children:e,className:t}){return(0,m.jsx)(`div`,{className:J(`grid grid-cols-2 gap-3 md:grid-cols-[repeat(auto-fit,minmax(160px,1fr))]`,t),children:e})}function mV({count:e=6}){return(0,m.jsx)(pV,{children:Array.from({length:e},(e,t)=>`metric-skeleton-${t}`).map(e=>(0,m.jsxs)($S,{className:`agora-surface agora-rise rounded-lg border border-border shadow-none ring-0 gap-2.5 px-[18px] pt-4 pb-3.5`,"aria-hidden":!0,children:[(0,m.jsx)(Gf,{className:`h-2.5 w-20`}),(0,m.jsx)(Gf,{className:`h-7 w-12`}),(0,m.jsx)(Gf,{className:`h-2.5 w-28`})]},e))})}function hV(e){let t=e.lastIndexOf(`@`);return t===-1?`default`:e.slice(t+1)}function gV(e){let t=e.lastIndexOf(`@`);return t===-1?e:e.slice(0,t)}function _V(e){let t=new Map;for(let n of e){let e=hV(n.group),r=t.get(e);r?r.push(n):t.set(e,[n])}return[...t.entries()].map(([e,t])=>{let n=new Set,r=0,i=0;for(let e of t){r+=e.depth,e.depth>0&&e.liveWorkers.length===0&&(i+=1);for(let t of e.liveWorkers)n.add(t.instanceId)}return{partition:e,workerCount:n.size,handlerCount:t.length,totalDepth:r,starvedCount:i}}).sort((e,t)=>e.partition==="default"?-1:t.partition==="default"?1:e.partition.localeCompare(t.partition))}function vV(e){let t=new Map;for(let n of e)for(let e of n.liveWorkers){let n=gV(e.group),r=t.get(e.instanceId);r===void 0?t.set(e.instanceId,{instanceId:e.instanceId,partition:hV(e.group),runtime:e.status?.runtime,handlers:new Set([n]),status:e.status,lastBeatAt:e.lastBeatAt}):(r.handlers.add(n),e.lastBeatAt>=r.lastBeatAt&&(r.lastBeatAt=e.lastBeatAt,r.partition=hV(e.group),r.runtime=e.status?.runtime,r.status=e.status))}return[...t.values()].map(e=>({instanceId:e.instanceId,partition:e.partition,runtime:e.runtime,handlers:[...e.handlers].sort((e,t)=>e.localeCompare(t)),status:e.status,lastBeatAt:e.lastBeatAt})).sort((e,t)=>e.partition===t.partition?e.instanceId.localeCompare(t.instanceId):e.partition==="default"?-1:t.partition==="default"?1:e.partition.localeCompare(t.partition))}function yV(e){let t=new Set,n=new Set,r=new Set;for(let i of e){for(let e of i.liveWorkers)t.add(e.instanceId);i.kind===`workflow`?n.add(gV(i.group)):i.kind===`step`&&r.add(gV(i.group))}let i=e.filter(e=>e.depth>0&&e.liveWorkers.length===0).sort((e,t)=>t.depth-e.depth);return{queueCount:e.length,workflowCount:n.size,stepCount:r.size,workerCount:t.size,starved:i,allDraining:i.length===0}}function bV(e){return e[0]===e[1]?`v${e[0]}`:`v${e[0]}–${e[1]}`}function xV(e){return e.groups.some(e=>e.incompatible)?`incompatible`:e.groups.some(e=>e.degraded)?`degraded`:`compatible`}function SV(e){return e===`incompatible`?`s-failed`:e===`degraded`?`s-suspended`:`s-completed`}function CV({compat:e}){if(e.groups.length===0)return(0,m.jsx)(qC,{icon:(0,m.jsx)(yt,{}),title:`no descriptors`,description:`No worker has advertised a handshake descriptor yet — legacy workers are assumed compatible.`});let t=e.groups.flatMap(e=>e.pods.map(t=>({token:e.token,pod:t})));return(0,m.jsx)(uV,{label:`Fleet compatibility`,rows:t,rowKey:e=>`${e.token}/${e.pod.instanceId}`,columns:[{id:`pod`,header:`Pod`,cell:e=>(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,m.jsxs)(`span`,{className:`mono flex items-center gap-1.5 text-[12px] text-fg`,children:[(0,m.jsx)(`span`,{className:`dot ${SV(e.pod.outcome)}`,"aria-hidden":!0}),(0,m.jsx)(`span`,{className:`truncate`,children:e.pod.instanceId})]}),(0,m.jsx)(`span`,{className:`mono truncate text-[10px] text-dim`,children:e.token})]})},{id:`protocol`,header:`Protocol`,cell:e=>(0,m.jsx)(`span`,{className:`mono tnum text-[12px] text-fg-2`,children:bV(e.pod.protocolRange)})},{id:`outcome`,header:`Outcome`,cell:e=>(0,m.jsx)(nC,{variant:e.pod.outcome===`incompatible`?`destructive`:e.pod.outcome===`degraded`?`warn`:`good`,className:`mono text-[10px] uppercase tracking-wider`,children:e.pod.outcome})},{id:`detail`,header:`Detail`,hideBelow:`md`,className:`whitespace-normal`,cell:e=>(0,m.jsxs)(`div`,{className:`mono flex flex-col gap-0.5 text-[11px]`,children:[e.pod.reason&&(0,m.jsx)(`span`,{className:`text-bad`,children:e.pod.reason}),e.pod.missingOnRemote.length>0&&(0,m.jsxs)(`span`,{className:`text-dim`,children:[`missing on worker: `,e.pod.missingOnRemote.join(`, `)]}),e.pod.missingOnLocal.length>0&&(0,m.jsxs)(`span`,{className:`text-dim`,children:[`missing on control plane: `,e.pod.missingOnLocal.join(`, `)]}),!e.pod.reason&&e.pod.missingOnRemote.length===0&&e.pod.missingOnLocal.length===0&&(0,m.jsx)(`span`,{className:`text-faint`,children:`—`})]})}]})}function wV({blocked:e,onOpenRun:t}){return e.length===0?(0,m.jsx)(qC,{icon:(0,m.jsx)(yt,{}),title:`No blocked runs`,description:`Every parked run has a compatible worker to resume it.`}):(0,m.jsx)(`ul`,{className:`divide-y divide-line-soft`,children:e.map(e=>(0,m.jsx)(`li`,{children:(0,m.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id),className:J(`mono flex w-full flex-col gap-0.5 px-4 py-3 text-left text-[11px] transition-colors hover:bg-hover`),children:[(0,m.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`dot s-blocked`,"aria-hidden":!0}),(0,m.jsx)(`span`,{className:`truncate text-[12.5px] text-fg`,children:e.workflow}),(0,m.jsx)(`span`,{className:`truncate text-faint`,children:e.id})]}),(0,m.jsx)(`span`,{className:`text-bad`,children:e.reason}),e.missingCapabilities&&e.missingCapabilities.length>0&&(0,m.jsxs)(`span`,{className:`text-dim`,children:[`missing: `,e.missingCapabilities.join(`, `)]})]})},e.id))})}function TV(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;let n=Math.round(t/60);if(n<60)return`${n}m ago`;let r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function EV({status:e}){let t=e?.concurrency;if(!e||!t)return(0,m.jsx)(`span`,{className:`mono text-[9px] text-faint`,children:`no status`});let n=t.limit>0&&e.inFlight>=t.limit*.8;return(0,m.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,m.jsxs)(`div`,{className:`mono flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[10px] text-dim`,children:[(0,m.jsx)(`span`,{className:`shrink-0 rounded border px-1 text-[9px] uppercase tracking-wider ${t.mode===`adaptive`?`border-info/40 bg-info/10 text-info`:`border-line-strong/50 bg-hover/60 text-fg-2`}`,children:t.mode===`adaptive`?`adaptive ${t.min??1}–${t.max??32}`:`fixed`}),(0,m.jsxs)(`span`,{className:n?`text-warn`:`text-fg-2`,children:[`in-flight`,` `,(0,m.jsxs)(`span`,{className:`tnum`,children:[e.inFlight,`/`,t.limit]})]}),typeof e.rssPct==`number`&&(0,m.jsxs)(`span`,{className:e.rssPct>=85?`text-bad`:``,children:[`ram `,(0,m.jsxs)(`span`,{className:`tnum`,children:[Math.round(e.rssPct),`%`]})]}),typeof e.cpuPct==`number`&&(0,m.jsxs)(`span`,{children:[`cpu `,(0,m.jsxs)(`span`,{className:`tnum`,children:[Math.round(e.cpuPct),`%`]})]}),typeof e.throughputPerMin==`number`&&(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:`tnum`,children:Math.round(e.throughputPerMin)}),`/min`]}),typeof e.p95Ms==`number`&&(0,m.jsxs)(`span`,{children:[`p95 `,(0,m.jsxs)(`span`,{className:`tnum`,children:[Math.round(e.p95Ms),`ms`]})]})]}),e.lastAdjust&&(0,m.jsxs)(`div`,{className:`mono text-[10px] text-dim`,children:[e.lastAdjust.reason,` `,(0,m.jsxs)(`span`,{className:`tnum text-fg-2`,children:[e.lastAdjust.from,`→`,e.lastAdjust.to]}),` `,TV(e.lastAdjust.at)]})]})}function DV({onOpenRun:e}){let t=Qe({queryKey:[`workers`],queryFn:()=>XS.workers(),refetchInterval:1e4}),n=Qe({queryKey:[`compat`],queryFn:()=>XS.compat(),refetchInterval:15e3,retry:!1});return(0,m.jsx)(OV,{groups:t.data,groupsError:t.data===void 0?t.error:null,onRetryGroups:()=>void t.refetch(),compat:n.data,compatError:n.data===void 0?n.error:null,onOpenRun:e})}function OV({groups:e,groupsError:t,onRetryGroups:n,compat:r,compatError:i,onOpenRun:a}){let o=e?yV(e):void 0;return(0,m.jsxs)(Tx,{children:[(0,m.jsx)(ZS,{title:`Workers`,description:`Live heartbeats, partitions, starved queues and protocol compatibility.`}),(0,m.jsx)(Gi,{label:`Fleet summary`,children:t?(0,m.jsx)(Ki,{title:`Workers could not be loaded`,error:t,onRetry:n}):o?(0,m.jsx)(AV,{summary:o,compat:r}):(0,m.jsx)(mV,{})}),(0,m.jsx)(Gi,{label:`Pods`,children:(0,m.jsx)(eC,{title:`Pods`,description:`each live worker, what it serves and its load`,flush:!0,action:e?(0,m.jsxs)(`span`,{className:`mono tnum text-[11px] text-dim`,children:[vV(e).length,` live`]}):void 0,children:(0,m.jsx)(MV,{workers:e?vV(e):void 0})})}),(0,m.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,m.jsx)(Gi,{label:`Partitions`,children:(0,m.jsx)(eC,{title:`Partitions`,description:`tenant-isolation axis · default = control plane`,flush:!0,children:(0,m.jsx)(NV,{partitions:e?_V(e):void 0})})}),(0,m.jsx)(Gi,{label:`Starved queues`,children:(0,m.jsx)(eC,{title:`Starved queues`,description:`queued work with no worker consuming it`,flush:!0,children:(0,m.jsx)(FV,{summary:o})})})]}),(0,m.jsx)(Gi,{label:`Compatibility`,children:(0,m.jsx)(eC,{title:`Compatibility`,description:r?`control plane ${r.controlPlane.instanceId} · protocol v${r.controlPlane.protocol}`:`protocol and capability negotiation per pod`,flush:!0,children:i?(0,m.jsx)(`div`,{className:`p-4`,children:(0,m.jsx)(Ki,{title:`Compatibility report unavailable`,error:i})}):r?(0,m.jsx)(CV,{compat:r}):(0,m.jsx)(jV,{})})}),r&&r.blockedCount>0&&(0,m.jsx)(Gi,{label:`Blocked runs`,children:(0,m.jsx)(eC,{title:`Blocked runs`,description:`parked: no compatible worker can take them`,flush:!0,action:(0,m.jsx)(nC,{variant:`destructive`,className:`mono tnum`,children:r.blockedCount}),children:(0,m.jsx)(wV,{blocked:r.blocked,onOpenRun:a})})})]})}function kV(e,t){return`${e} ${e===1?t:`${t}s`}`}function AV({summary:e,compat:t}){let n=t?xV(t):void 0,r=n===`incompatible`?`bad`:n===`degraded`?`warn`:`good`;return(0,m.jsxs)(pV,{children:[(0,m.jsx)(fV,{label:`Live workers`,value:e.workerCount,tone:`brand`,caption:`${kV(e.queueCount,`queue`)} served`}),(0,m.jsx)(fV,{label:`Workflows`,value:e.workflowCount,tone:`info`,caption:`@Workflow handlers`}),(0,m.jsx)(fV,{label:`Steps`,value:e.stepCount,tone:`violet`,caption:`@Step handlers`}),(0,m.jsx)(fV,{label:`Starved`,value:e.starved.length,tone:e.starved.length>0?`bad`:`good`,caption:e.allDraining?`all draining`:`queues with no worker`}),(0,m.jsx)(fV,{label:`Compatibility`,value:t?t.incompatibleCount>0?t.incompatibleCount:`✓`:`—`,tone:t?r:`default`,caption:t?n??``:`no report`}),(0,m.jsx)(fV,{label:`Blocked runs`,value:t?.blockedCount??`—`,tone:(t?.blockedCount??0)>0?`bad`:`default`,caption:`no compatible worker`})]})}function jV(){return(0,m.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,"aria-hidden":!0,children:[(0,m.jsx)(Gf,{className:`h-3 w-3/4`}),(0,m.jsx)(Gf,{className:`h-3 w-2/3`}),(0,m.jsx)(Gf,{className:`h-3 w-1/2`})]})}function MV({workers:e}){return(0,m.jsx)(uV,{label:`Pods`,rows:e,loading:e===void 0,rowKey:e=>e.instanceId,empty:(0,m.jsx)(qC,{icon:(0,m.jsx)(Ot,{}),title:`No live workers`,description:`No worker heartbeat in the last window. Start a worker, or check the transport can report health.`}),columns:[{id:`pod`,header:`Pod`,cell:e=>(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,m.jsxs)(`span`,{className:`mono flex items-center gap-1.5 text-[12px] text-fg`,children:[(0,m.jsx)(`span`,{className:`dot ${e.status?`s-completed`:``}`,"aria-hidden":!0}),(0,m.jsx)(`span`,{className:`truncate`,children:e.instanceId})]}),(0,m.jsxs)(`span`,{className:`mono text-[10px] text-dim`,children:[e.runtime??`node`,` · beat `,TV(e.lastBeatAt)]})]})},{id:`partition`,header:`Partition`,hideBelow:`sm`,cell:e=>(0,m.jsx)(nC,{variant:e.partition==="default"?`neutral`:`info`,className:`mono text-[10px]`,children:e.partition})},{id:`handlers`,header:`Handlers`,cell:e=>(0,m.jsx)(YB,{label:e.handlers.join(`
56
56
  `),align:`start`,children:(0,m.jsx)(`span`,{className:`mono tnum cursor-default text-[12px] text-fg-2 underline decoration-line-strong decoration-dotted underline-offset-4`,children:e.handlers.length})})},{id:`status`,header:`Load`,hideBelow:`md`,className:`whitespace-normal`,cell:e=>(0,m.jsx)(EV,{status:e.status})}]})}function NV({partitions:e}){return(0,m.jsx)(uV,{label:`Partitions`,rows:e,loading:e===void 0,rowKey:e=>e.partition,empty:(0,m.jsx)(qC,{icon:(0,m.jsx)(Ot,{}),title:`No partitions`,description:`Nothing is queued or served yet.`}),columns:[{id:`partition`,header:`Partition`,cell:e=>(0,m.jsxs)(`span`,{className:`mono flex items-center gap-1.5 text-[12px] text-fg`,children:[(0,m.jsx)(`span`,{className:`dot ${e.starvedCount>0?`s-failed`:e.workerCount>0?`s-completed`:``}`,"aria-hidden":!0}),e.partition]})},{id:`workers`,header:`Workers`,align:`right`,cell:e=>(0,m.jsx)(PV,{n:e.workerCount})},{id:`handlers`,header:`Handlers`,align:`right`,cell:e=>(0,m.jsx)(PV,{n:e.handlerCount})},{id:`queued`,header:`Queued`,align:`right`,cell:e=>(0,m.jsx)(PV,{n:e.totalDepth})},{id:`starved`,header:`Starved`,align:`right`,cell:e=>(0,m.jsx)(PV,{n:e.starvedCount,bad:e.starvedCount>0})}]})}function PV({n:e,bad:t}){return(0,m.jsx)(`span`,{className:`mono tnum text-[12px] ${t?`text-bad`:`text-fg-2`}`,children:e})}function FV({summary:e}){return e?e.starved.length===0?(0,m.jsx)(qC,{icon:(0,m.jsx)(yt,{}),title:`All queues draining`,description:`${kV(e.queueCount,`queue`)} across ${kV(e.workerCount,`worker`)}, every backlog has a consumer.`}):(0,m.jsx)(`ul`,{className:`divide-y divide-line-soft`,children:e.starved.map(e=>(0,m.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,m.jsx)(`span`,{className:`dot s-failed`,"aria-hidden":!0}),(0,m.jsx)(`span`,{className:`mono min-w-0 flex-1 truncate text-[12px] text-fg`,children:e.group}),(0,m.jsxs)(nC,{variant:`destructive`,className:`mono tnum text-[10px]`,children:[e.depth,` queued · 0 workers`]})]},e.group))}):(0,m.jsx)(jV,{})}var IV=`#a3e635`,LV={runs:`Runs`,workers:`Workers`,schedules:`Schedules`,workflow:`Workflow`};function RV(){return(0,m.jsxs)(`span`,{className:`hidden items-center gap-1.5 text-[12px] text-dim sm:flex`,children:[(0,m.jsx)(`span`,{className:`dot s-completed pulse`,"aria-hidden":!0}),`live`]})}function zV(){let e=(0,p.useMemo)(()=>pm(FS),[]),t=BB(),n=KB(),[r,i]=(0,p.useState)(()=>fC()),a=(0,p.useCallback)(e=>{i(e),pC(e)},[]),o=(0,p.useCallback)(e=>a({page:`runs`,runId:e}),[a]),s=(0,p.useCallback)(e=>a(e?{page:`runs`,runId:e}:{page:`runs`}),[a]);(0,p.useEffect)(()=>{let e=()=>i(fC());return window.addEventListener(`hashchange`,e),window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`hashchange`,e),window.removeEventListener(`popstate`,e)}},[]);let{data:c}=Qe({queryKey:[`topology`],queryFn:()=>XS.topology(),staleTime:1/0,refetchInterval:!1}),l=c?.role===`tenant`,u=c?l?c.tenant?`tenant · ${c.tenant}`:`tenant`:`control plane`:` `,d=(0,p.useMemo)(()=>[{section:`Monitor`,items:[{id:`runs`,label:`Runs`,icon:(0,m.jsx)(Dt,{}),href:`#/`,onSelect:()=>a({page:`runs`})},{id:`workers`,label:`Workers`,icon:(0,m.jsx)(Ot,{}),href:`#/workers`,onSelect:()=>a({page:`workers`})}]},{section:`Operations`,items:l?[]:[{id:`schedules`,label:`Schedules`,icon:(0,m.jsx)(kt,{}),href:`#/schedules`,onSelect:()=>a({page:`schedules`})}]}],[l,a]),f=r.page===`workflow`?`runs`:r.page,h=r.page===`workflow`?r.workflow:LV[r.page];return(0,m.jsx)(wx,{brand:{name:`durable`,subtitle:(0,m.jsx)(`span`,{className:l?`text-warn`:void 0,title:l?`Tenant deployment — partition ${c?.tenant??`(unnamed)`}`:`Control-plane deployment`,children:u}),mark:(0,m.jsx)(mC,{}),current:{title:`Workflows`,package:`@adonis-agora/durable`,icon:`workflow`}},nav:d,activeId:f,shell:e,title:h,searchPlaceholder:`Search runs, workflows, payments, users…`,contentClassName:r.page===`runs`?`overflow-hidden`:void 0,actions:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(VB,{}),(0,m.jsx)(`div`,{className:`hidden md:block`,children:(0,m.jsx)(RC,{onOpenRun:o})}),(0,m.jsx)(RV,{})]}),children:(0,m.jsx)(Gi,{label:LV[r.page],resetKeys:[r.page],children:r.page===`workflow`?(0,m.jsx)(Tx,{children:(0,m.jsx)(lC,{workflow:r.workflow})}):r.page===`schedules`&&!l?(0,m.jsx)(tV,{onOpenRun:o}):r.page===`workers`?(0,m.jsx)(DV,{onOpenRun:o}):(0,m.jsx)(JB,{filters:n,selected:r.page===`runs`?r.runId:void 0,onSelect:s,onOpenRun:o,tenantPicker:t})})})}var BV=new Re({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});(0,ot.createRoot)(document.getElementById(`root`)).render((0,m.jsx)(p.StrictMode,{children:(0,m.jsx)(dt,{storageKey:`agora-durable-theme`,accent:IV,children:(0,m.jsx)(_,{client:BV,children:(0,m.jsx)(zV,{})})})}));
57
- //# sourceMappingURL=index-DlwRCDs7.js.map
57
+ //# sourceMappingURL=index-cmhkQ5N1.js.map