@anvia/studio 0.7.41 → 0.7.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/assets/{chunk-TIV3WFSR-BCFNcVBW.js → chunk-PJDL5UT2-D8QokyBL.js} +2 -2
- package/dist/ui/assets/chunk-PJDL5UT2-D8QokyBL.js.map +1 -0
- package/dist/ui/assets/{evals-page-CtsKzSlO.js → evals-page-DkyqKUak.js} +2 -2
- package/dist/ui/assets/{evals-page-CtsKzSlO.js.map → evals-page-DkyqKUak.js.map} +1 -1
- package/dist/ui/assets/{index-Br02DQhZ.js → index-DuJGKHsF.js} +5 -5
- package/dist/ui/assets/{index-Br02DQhZ.js.map → index-DuJGKHsF.js.map} +1 -1
- package/dist/ui/assets/{knowledge-page-4XUY0A05.js → knowledge-page-BsIEmgbK.js} +2 -2
- package/dist/ui/assets/{knowledge-page-4XUY0A05.js.map → knowledge-page-BsIEmgbK.js.map} +1 -1
- package/dist/ui/assets/{mcps-page-D2bfql9X.js → mcps-page-CLkKV3gQ.js} +2 -2
- package/dist/ui/assets/{mcps-page-D2bfql9X.js.map → mcps-page-CLkKV3gQ.js.map} +1 -1
- package/dist/ui/assets/{memory-page-Bv_jKRIe.js → memory-page-B6wO-dfj.js} +2 -2
- package/dist/ui/assets/{memory-page-Bv_jKRIe.js.map → memory-page-B6wO-dfj.js.map} +1 -1
- package/dist/ui/assets/{pipelines-page-Ccc7drvi.js → pipelines-page-DBrdwSHs.js} +2 -2
- package/dist/ui/assets/{pipelines-page-Ccc7drvi.js.map → pipelines-page-DBrdwSHs.js.map} +1 -1
- package/dist/ui/assets/{sandboxes-page-lr90zS3G.js → sandboxes-page-B9Tqi3T9.js} +2 -2
- package/dist/ui/assets/{sandboxes-page-lr90zS3G.js.map → sandboxes-page-B9Tqi3T9.js.map} +1 -1
- package/dist/ui/assets/{sessions-page-_9Crnndq.js → sessions-page-BEVnUUFi.js} +2 -2
- package/dist/ui/assets/{sessions-page-_9Crnndq.js.map → sessions-page-BEVnUUFi.js.map} +1 -1
- package/dist/ui/assets/{status-page-BguURb9e.js → status-page-CqcN8K2V.js} +2 -2
- package/dist/ui/assets/{status-page-BguURb9e.js.map → status-page-CqcN8K2V.js.map} +1 -1
- package/dist/ui/assets/{tool-runner-Doo0UBcS.js → tool-runner-7FNoql1w.js} +2 -2
- package/dist/ui/assets/{tool-runner-Doo0UBcS.js.map → tool-runner-7FNoql1w.js.map} +1 -1
- package/dist/ui/assets/{tools-page-Bl4RGn6w.js → tools-page-zkT-hZtg.js} +2 -2
- package/dist/ui/assets/{tools-page-Bl4RGn6w.js.map → tools-page-zkT-hZtg.js.map} +1 -1
- package/dist/ui/assets/{trace-browser-B-5APgrF.js → trace-browser-BrJaIgIn.js} +2 -2
- package/dist/ui/assets/{trace-browser-B-5APgrF.js.map → trace-browser-BrJaIgIn.js.map} +1 -1
- package/dist/ui/assets/{transcript-item-oaLLzHaS.js → transcript-item-CHLeQcgs.js} +2 -2
- package/dist/ui/assets/{transcript-item-oaLLzHaS.js.map → transcript-item-CHLeQcgs.js.map} +1 -1
- package/dist/ui/index.html +2 -2
- package/package.json +4 -4
- package/dist/ui/assets/chunk-TIV3WFSR-BCFNcVBW.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agents-page-Bbbg-x2R.js","assets/utils-C9GMruoG.js","assets/badge-D7D2A73-.js","assets/evals-page-
|
|
2
|
-
import{a as e,i as t,n,r,s as i,t as a}from"./utils-C9GMruoG.js";import{f as o,i as s,m as c,s as l}from"./format-D43vTqrO.js";import{c as u,i as d,n as f,o as p,r as m,s as h,t as g}from"./chunk-TIV3WFSR-BCFNcVBW.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var _=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),v=e(((e,t)=>{t.exports=_()})),y=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.8`})),b=e(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=y()})),x=e((e=>{var n=v(),r=t(),i=b();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case x:return`Profiler`;case y:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},re=[],ie=-1;function ae(e){return{current:e}}function I(e){0>ie||(e.current=re[ie],re[ie]=null,ie--)}function L(e,t){ie++,re[ie]=e.current,e.current=t}var oe=ae(null),se=ae(null),R=ae(null),ce=ae(null);function le(e,t){switch(L(R,t),L(se,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(oe),L(oe,e)}function ue(){I(oe),I(se),I(R)}function de(e){e.memoizedState!==null&&L(ce,e);var t=oe.current,n=Hd(t,e.type);t!==n&&(L(se,e),L(oe,n))}function fe(e){se.current===e&&(I(oe),I(se)),ce.current===e&&(I(ce),Qf._currentValue=ne)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1<e.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agents-page-Bbbg-x2R.js","assets/utils-C9GMruoG.js","assets/badge-D7D2A73-.js","assets/evals-page-DkyqKUak.js","assets/knowledge-page-BsIEmgbK.js","assets/renderers-BgRlCTll.js","assets/format-D43vTqrO.js","assets/mcps-page-CLkKV3gQ.js","assets/tool-runner-7FNoql1w.js","assets/memory-page-B6wO-dfj.js","assets/chunk-PJDL5UT2-D8QokyBL.js","assets/pipelines-page-DBrdwSHs.js","assets/pipelines-page-DLioOiRN.css","assets/sessions-page-BEVnUUFi.js","assets/sandboxes-page-B9Tqi3T9.js","assets/status-page-CqcN8K2V.js","assets/tools-page-zkT-hZtg.js","assets/trace-browser-BrJaIgIn.js","assets/transcript-item-CHLeQcgs.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,n,r,s as i,t as a}from"./utils-C9GMruoG.js";import{f as o,i as s,m as c,s as l}from"./format-D43vTqrO.js";import{c as u,i as d,n as f,o as p,r as m,s as h,t as g}from"./chunk-PJDL5UT2-D8QokyBL.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var _=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),v=e(((e,t)=>{t.exports=_()})),y=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.8`})),b=e(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=y()})),x=e((e=>{var n=v(),r=t(),i=b();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case x:return`Profiler`;case y:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},re=[],ie=-1;function ae(e){return{current:e}}function I(e){0>ie||(e.current=re[ie],re[ie]=null,ie--)}function L(e,t){ie++,re[ie]=e.current,e.current=t}var oe=ae(null),se=ae(null),R=ae(null),ce=ae(null);function le(e,t){switch(L(R,t),L(se,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(oe),L(oe,e)}function ue(){I(oe),I(se),I(R)}function de(e){e.memoizedState!==null&&L(ce,e);var t=oe.current,n=Hd(t,e.type);t!==n&&(L(se,e),L(oe,n))}function fe(e){se.current===e&&(I(oe),I(se)),ce.current===e&&(I(ce),Qf._currentValue=ne)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+pe+e+me}var ge=!1;function _e(e,t){if(!e||ge)return``;ge=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
5
|
`),l=s.split(`
|
|
@@ -12,7 +12,7 @@ Error generating stack: `+e.message+`
|
|
|
12
12
|
`)}function ao(e){return e instanceof Error?{name:e.name,message:e.message}:{message:typeof e==`string`?e:oo(e)}}function oo(e){try{let t=JSON.stringify(e);return t===void 0?String(e):t}catch{return String(e)}}function so(e){if(typeof e==`string`)try{return co(JSON.parse(e))}catch{return}if(e!==void 0)return co(e)}function co(e){return e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||Array.isArray(e)||mo(e)?e:oo(e)}function lo(e,t){try{return JSON.stringify(uo(e))===JSON.stringify(uo(t))}catch{return!1}}function uo(e){return Array.isArray(e)?e.map(e=>uo(e)):V(e)?Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,uo(t)])):e}function fo(e,t){return V(e)&&V(t)?{...e,...t}:t}function V(e){return mo(e)&&!Array.isArray(e)}function H(e,t){return t===void 0?`tool_${e}`:`tool_${t}_${e}`}function po(e,t){for(let n=e.length-1;n>=0;--n)if(t(e[n]))return n;return-1}function mo(e){return typeof e==`object`&&!!e}function ho(e={}){let[t,n]=(0,C.useState)(()=>[...e.initialMessages??[]]),[r,i]=(0,C.useState)([]),[a,o]=(0,C.useState)(`idle`),[s,c]=(0,C.useState)(),[l,u]=(0,C.useState)([]),[d,f]=(0,C.useState)([]),[p,m]=(0,C.useState)(()=>new Set),[h,g]=(0,C.useState)(()=>new Set),[_,v]=(0,C.useState)(),[y,b]=(0,C.useState)(!1),x=(0,C.useRef)(void 0),S=(0,C.useRef)(t),w=(0,C.useRef)(l),T=(0,C.useRef)(d),E=(0,C.useRef)(p),D=(0,C.useRef)(h),O=(0,C.useRef)(void 0),k=(0,C.useRef)(0),A=(0,C.useRef)(!1),j=(0,C.useRef)(0);(0,C.useEffect)(()=>{S.current=t},[t]),(0,C.useEffect)(()=>{w.current=l},[l]),(0,C.useEffect)(()=>{T.current=d},[d]),(0,C.useEffect)(()=>{E.current=p},[p]),(0,C.useEffect)(()=>{D.current=h},[h]),(0,C.useEffect)(()=>()=>{x.current?.abort()},[]);let M=(0,C.useMemo)(()=>{if(e.transport!==void 0)return e.transport;if(e.endpoint!==void 0)return fa({endpoint:e.endpoint,format:e.format??`jsonl`})},[e.transport,e.endpoint,e.format]),N=(0,C.useCallback)(e=>{let t=typeof e==`function`?e(S.current):e;S.current=t,n(t)},[]),ee=(0,C.useCallback)(e=>{O.current=e,v(e)},[]),te=(0,C.useCallback)(()=>{let t=O.current;t!==void 0&&ya(e.resume,{version:1,streamId:t,lastEventId:k.current,messages:S.current})},[e.resume]),P=(0,C.useCallback)(()=>{k.current=0,ee(void 0),ba(e.resume)},[e.resume,ee]),F=(0,C.useCallback)(e=>{u(t=>{let n=ra(t,e);return w.current=n,n})},[]),ne=(0,C.useCallback)(e=>{f(t=>{let n=ra(t,e);return T.current=n,n})},[]),re=(0,C.useCallback)(()=>{j.current+=1,w.current=[],T.current=[],E.current=new Set,D.current=new Set,u([]),f([]),m(new Set),g(new Set)},[]),ie=(0,C.useCallback)(t=>{let n=e.eventToUIEvent?.(t);if(n!==void 0){N(e=>ka(e,n));return}if(!(e.eventToUIEvent!==void 0||e.eventToDelta!==void 0||e.eventToFinal!==void 0)){let e=!1;if(N(n=>{let r=Aa(n,t);return r===void 0?n:(e=!0,r)}),e)return}let r=e.eventToDelta?.(t);r!==void 0&&r.length>0&&N(e=>Fa(e,r));let i=e.eventToFinal?.(t);i!==void 0&&N(e=>La(e,i))},[e,N]),ae=(0,C.useCallback)(t=>{let n=e.humanInput;if(n===void 0)return;let r=(n.eventToApproval??$i)(t);r!==void 0&&F(r);let i=(n.eventToQuestion??ea)(t);i!==void 0&&ne(i)},[e.humanInput,F,ne]),I=(0,C.useCallback)(async(t,n={})=>{if(M===void 0)throw Error(`useChat requires either transport or endpoint`);x.current?.abort();let r=new AbortController;x.current=r;let a=e.createRequest??(e=>{let t={messages:e.coreMessages,stream:!0};return e.resume!==void 0&&(t.resume=e.resume),t});n.resume===void 0?P():(k.current=n.resume.after,ee(n.resume.streamId)),N(t),i([]),c(void 0),re(),o(`streaming`),b(n.isResuming===!0);try{let s=a({messages:t,uiMessages:t,coreMessages:Si(t),resume:n.resume});for await(let t of M.send(s,{signal:r.signal})){if(x.current!==r||r.signal.aborted)return;if(xa(t)){if(t.type===`stream_start`){ee(t.streamId),te();continue}if(t.type===`stream_end`){k.current=t.eventId,P();continue}k.current=t.eventId;let n=t.event;if(i(e=>[...e,n]),ae(n),e.onEvent?.(n),x.current!==r||r.signal.aborted)return;ie(n),te();continue}let n=t;if(i(e=>[...e,n]),ae(n),e.onEvent?.(n),x.current!==r||r.signal.aborted)return;ie(n)}x.current===r&&!r.signal.aborted&&o(`idle`)}catch(t){if(_o(t)){x.current===r&&o(`idle`);return}if(x.current!==r)return;c(t),o(`error`),e.onError?.(t)}finally{x.current===r&&(x.current=void 0,b(!1))}},[ie,ae,re,P,e,te,N,ee,M]),L=(0,C.useCallback)(async()=>{let t=va(e.resume);t!==void 0&&await I(t.messages,{resume:{streamId:t.streamId,after:t.lastEventId},isResuming:!0})},[e.resume,I]);(0,C.useEffect)(()=>{e.resume?.auto===!1||A.current||(A.current=!0,L())},[e.resume?.auto,L]);let oe=(0,C.useCallback)(async e=>{let t=Da(e);if(t===void 0)return;let n=S.current;await I([...x.current!==void 0&&n.at(-1)?.role===`assistant`?n.slice(0,-1):n,t])},[I]),se=(0,C.useCallback)(async(e=``)=>{await oe(e)},[oe]),R=(0,C.useCallback)(async()=>{let e=go(S.current);e!==-1&&await I(S.current.slice(0,e+1))},[I]),ce=(0,C.useCallback)(()=>{x.current?.abort(),x.current=void 0,P(),o(`idle`),b(!1)},[P]),le=(0,C.useCallback)(async(t,n,r)=>{let i=e.humanInput;if(i===void 0)throw Error(`useChat humanInput is not configured`);if(E.current.has(t))return;let a=j.current,o=new Set(E.current).add(t);E.current=o,m(o);try{let e=w.current.find(e=>e.id===t),o={approvalId:t,approved:n};r!==void 0&&(o.reason=r),e!==void 0&&(o.approval=e);let s=i.decideApproval===void 0?await ta(o,i):await i.decideApproval(o);s!==void 0&&j.current===a&&F(s)}finally{if(j.current===a){let e=new Set(E.current);e.delete(t),E.current=e,m(e)}}},[e.humanInput,F]),ue=(0,C.useCallback)(async(e,t)=>{await le(e,!0,t)},[le]),de=(0,C.useCallback)(async(e,t)=>{await le(e,!1,t)},[le]),fe=(0,C.useCallback)(async(t,n)=>{let r=e.humanInput;if(r===void 0)throw Error(`useChat humanInput is not configured`);if(D.current.has(t))return;let i=j.current,a=new Set(D.current).add(t);D.current=a,g(a);try{let e=T.current.find(e=>e.id===t),a={questionId:t,answers:n};e!==void 0&&(a.question=e);let o=r.answerQuestion===void 0?await na(a,r):await r.answerQuestion(a);o!==void 0&&j.current===i&&ne(o)}finally{if(j.current===i){let e=new Set(D.current);e.delete(t),D.current=e,g(e)}}},[e.humanInput,ne]),pe=(0,C.useCallback)((e=[])=>{x.current?.abort(),x.current=void 0,P(),N(e),i([]),re(),c(void 0),o(`idle`),b(!1)},[re,P,N]);return{messages:t,events:r,suggestions:e.suggestions??[],setMessages:N,sendMessage:oe,send:se,regenerate:R,stop:ce,reset:pe,status:a,error:s,text:ja(t),streamId:_,isResuming:y,resume:L,humanInput:{approvals:{all:l,pending:l.filter(e=>e.status===`pending`)},questions:{all:d,pending:d.filter(e=>e.status===`pending`)}},decidingApprovals:new Set(p),answeringQuestions:new Set(h),approveTool:ue,rejectTool:de,answerToolQuestion:fe}}function go(e){for(let t=e.length-1;t>=0;--t)if(e[t]?.role===`user`)return t;return-1}function _o(e){return e instanceof DOMException&&e.name===`AbortError`}var vo={baseCharsPerSecond:140,completionDrainMs:700,initialSampleSpreadMs:50,maxCommitFps:60,maxCompletionCharsPerFrame:30,maxCompletionCharsPerSecond:1600,maxElapsedMs:64,maxPendingChars:1e3,maxSourceSamples:64,maxStreamingCharsPerFrame:6,maxStreamingCharsPerSecond:360,sourceGapResetMs:180,sourceInterpolationMs:100,streamingBaseCharsPerSecond:200,streamingDrainMs:250,targetBufferMs:225};function yo(e,t,n){let r=[...e],i=U(r,n);return{displayedItems:r,drainDeadlineAtMs:null,isSourceStreaming:t.isStreaming,lastAdvanceAtMs:t.nowMs,playbackCursorChars:i,sourceSamples:[{atMs:t.nowMs,totalChars:i}],targetItems:r}}function bo(e,t,n,r){let i=[...t];if(!e.isSourceStreaming&&!n.isStreaming&&!ko(e,r))return yo(i,n,r);let a=U(e.targetItems,r),o=U(i,r),s=Oo(e.displayedItems,i,r);s=Do(s,i,0,r);let c=e.sourceSamples;n.isStreaming&&(c=To(c,a,o,n.nowMs));let l={...e,displayedItems:s,drainDeadlineAtMs:n.isStreaming||e.drainDeadlineAtMs!==null?n.isStreaming?null:e.drainDeadlineAtMs:n.nowMs+vo.completionDrainMs,isSourceStreaming:n.isStreaming,sourceSamples:c,targetItems:i};return l=Eo(l,r),!n.isStreaming&&!ko(l,r)?{...l,displayedItems:i,drainDeadlineAtMs:null,playbackCursorChars:o}:(!n.isStreaming&&l.drainDeadlineAtMs===null&&(l={...l,drainDeadlineAtMs:n.nowMs+vo.completionDrainMs}),l)}function xo(e,t,n){let r=Math.min(Math.max(t-e.lastAdvanceAtMs,0),vo.maxElapsedMs),i=U(e.displayedItems,n),a=U(e.targetItems,n),o=Math.max(0,a-i),s=e.isSourceStreaming?wo(e.sourceSamples,t):a,c=Math.max(0,s-i),l=e.isSourceStreaming?jo(c):Mo(o,e.drainDeadlineAtMs,t),u=Math.min(s,Math.max(e.playbackCursorChars,i)+r/1e3*l),d=Math.max(0,Math.floor(u-i)),f=Math.min(d,e.isSourceStreaming?vo.maxStreamingCharsPerFrame:vo.maxCompletionCharsPerFrame),p=Do(e.displayedItems,e.targetItems,f,n),m=U(p,n),h=Ao(p,e.targetItems,n);return{...e,displayedItems:h?p:e.targetItems,drainDeadlineAtMs:!e.isSourceStreaming&&!h?null:e.drainDeadlineAtMs,lastAdvanceAtMs:t,playbackCursorChars:Math.max(u,m)}}function So(e,t,n){let r=U(e.targetItems,n);return{...e,displayedItems:e.targetItems,drainDeadlineAtMs:null,lastAdvanceAtMs:t,playbackCursorChars:r,sourceSamples:[{atMs:t,totalChars:r}]}}function Co(e,t){let n=ko(e,t),r=e.isSourceStreaming||n,i=e.displayedItems.at(-1),a=r&&i!==void 0&&t.getText(i)!==void 0?t.getKey(i):null;return{hasPendingContent:n,isDraining:!e.isSourceStreaming&&n,items:e.displayedItems,liveItemKey:a}}function wo(e,t){let n=t-vo.targetBufferMs,r=e[0];if(r===void 0)return 0;if(n<=r.atMs)return r.totalChars;for(let t=1;t<e.length;t+=1){let r=e[t-1],i=e[t];if(r===void 0||i===void 0||n>i.atMs)continue;let a=Math.max(i.atMs-r.atMs,1),o=Math.min(Math.max((n-r.atMs)/a,0),1);return r.totalChars+(i.totalChars-r.totalChars)*o}return e.at(-1)?.totalChars??0}function To(e,t,n,r){if(n===t)return[...e];if(n<t)return[{atMs:r-vo.initialSampleSpreadMs,totalChars:Math.min(t,n)},{atMs:r,totalChars:n}];let i=[...e],a=i.at(-1);return a===void 0?i.push({atMs:r-vo.initialSampleSpreadMs,totalChars:t}):r-a.atMs>vo.sourceGapResetMs&&i.push({atMs:r-vo.sourceInterpolationMs,totalChars:t}),i.push({atMs:r,totalChars:n}),i.slice(-vo.maxSourceSamples)}function Eo(e,t){let n=U(e.displayedItems,t),r=U(e.targetItems,t)-n-vo.maxPendingChars;if(r<=0)return e;let i=Do(e.displayedItems,e.targetItems,r,t,!0),a=U(i,t);return{...e,displayedItems:i,playbackCursorChars:Math.max(e.playbackCursorChars,a)}}function Do(e,t,n,r,i=!1){let a=[],o=Math.max(0,n);for(let n=0;n<t.length;n+=1){let s=t[n];if(s===void 0)continue;let c=e[n],l=c!==void 0&&r.getKey(c)===r.getKey(s),u=r.getText(s);if(u===void 0){if(l||n===a.length){a.push(s);continue}break}let d=l&&c!==void 0?r.getText(c)??``:``;if(d===u){a.push(s);continue}if(o<=0){(l||d.length>0)&&a.push(r.withText(s,d));break}let f=Math.min(u.length,d.length+o),p=i?Po(u,f):Fo(u,f),m=u.slice(0,p),h=Math.max(0,m.length-d.length);if(o=Math.max(0,o-h),p<u.length){a.push(r.withText(s,m));break}a.push(s)}return a}function Oo(e,t,n){let r=[];for(let i=0;i<t.length;i+=1){let a=t[i],o=e[i];if(a===void 0||o===void 0||n.getKey(a)!==n.getKey(o))break;let s=n.getText(a),c=n.getText(o);if(s===void 0){if(r.push(a),c!==void 0)continue;continue}if(c===void 0){r.push(n.withText(a,``));break}if(s.startsWith(c)){r.push(c===s?a:n.withText(a,c));continue}let l=No(c,s);r.push(n.withText(a,s.slice(0,l)));break}return r}function ko(e,t){return Ao(e.displayedItems,e.targetItems,t)}function Ao(e,t,n){return e.length===t.length?t.some((t,r)=>{let i=e[r];if(i===void 0||n.getKey(i)!==n.getKey(t))return!0;let a=n.getText(t),o=n.getText(i);return a===void 0?i!==t:o!==a}):!0}function U(e,t){return e.reduce((e,n)=>e+(t.getText(n)?.length??0),0)}function jo(e){return Math.min(vo.maxStreamingCharsPerSecond,Math.max(vo.streamingBaseCharsPerSecond,e/(vo.streamingDrainMs/1e3)))}function Mo(e,t,n){let r=Math.max((t??n)-n,1);return Math.min(vo.maxCompletionCharsPerSecond,Math.max(vo.baseCharsPerSecond,e/(r/1e3)))}function No(e,t){let n=Io(e),r=Io(t),i=Math.min(n.length,r.length),a=0;for(let e=0;e<i;e+=1){let t=n[e],i=r[e];if(t===void 0||t!==i)break;a+=t.length}return a}function Po(e,t){let n=Fo(e,t),r=Math.min(e.length,n+64);for(let t=n;t<r;t+=1){let n=e[t];if(n===`
|
|
13
13
|
`||(n===`.`||n===`!`||n===`?`)&&/\s/u.test(e[t+1]??``)||/\s/u.test(n??``))return Fo(e,t+1)}return n}function Fo(e,t){let n=Math.min(Math.max(t,0),e.length);if(n===0||n===e.length)return n;let r=Lo();if(r!==void 0){let t=r.segment(e).containing(n-1);return t===void 0?e.length:t.index+t.segment.length}let i=e.charCodeAt(n-1);return i>=55296&&i<=56319?Math.min(e.length,n+1):n}function Io(e){let t=Lo();return t===void 0?[...e]:[...t.segment(e)].map(e=>e.segment)}function Lo(){if(!(typeof Intl>`u`||typeof Intl.Segmenter!=`function`))return new Intl.Segmenter(void 0,{granularity:`grapheme`})}var Ro=typeof window>`u`?C.useEffect:C.useLayoutEffect;function zo(e,t){let n=(0,C.useRef)(t.adapter);n.current=t.adapter;let r=(0,C.useRef)(void 0);r.current===void 0&&(r.current=Bo());let i=(0,C.useRef)(void 0);i.current===void 0&&(i.current=yo(e,{isStreaming:t.isStreaming,nowMs:r.current},t.adapter));let a=(0,C.useRef)(t.resetKey),o=(0,C.useRef)(null),s=(0,C.useRef)(!0),[c,l]=(0,C.useState)(()=>Co(i.current,t.adapter)),u=(0,C.useCallback)(()=>{let e=o.current;o.current=null,e!==null&&typeof window<`u`&&typeof window.cancelAnimationFrame==`function`&&window.cancelAnimationFrame(e)},[]),d=(0,C.useCallback)(e=>{let t=n.current;i.current=e;let r=Co(e,t);l(e=>Vo(e,r,t)?e:r)},[]),f=(0,C.useCallback)(()=>{let e=i.current;e!==void 0&&(u(),d(So(e,Bo(),n.current)))},[u,d]),p=(0,C.useCallback)(function e(){if(!(o.current!==null||!s.current)){if(typeof window>`u`||typeof window.requestAnimationFrame!=`function`){f();return}o.current=window.requestAnimationFrame(t=>{o.current=null;let r=i.current;if(!s.current||r===void 0)return;let a=1e3/vo.maxCommitFps;if(t-r.lastAdvanceAtMs+.5<a){e();return}let c=xo(r,t,n.current),l=Co(c,n.current);d(c),l.hasPendingContent&&e()})}},[d,f]);return(0,C.useEffect)(()=>(s.current=!0,()=>{s.current=!1,u()}),[u]),Ro(()=>{let n=Bo(),r=a.current!==t.resetKey;a.current=t.resetKey;let o=r?yo(e,{isStreaming:t.isStreaming,nowMs:n},t.adapter):bo(i.current,e,{isStreaming:t.isStreaming,nowMs:n},t.adapter),s=typeof document<`u`&&document.visibilityState===`hidden`;(t.flushImmediately===!0||s)&&(o=So(o,n,t.adapter));let c=Co(o,t.adapter);d(o),c.hasPendingContent?p():u()},[u,d,e,t.adapter,t.flushImmediately,t.isStreaming,t.resetKey,p]),(0,C.useEffect)(()=>{if(typeof document>`u`)return;let e=()=>{document.visibilityState===`hidden`&&f()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[f]),{items:c.items,isAnimating:c.hasPendingContent,isDraining:c.isDraining,liveItemKey:c.liveItemKey,flush:f}}function Bo(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function Vo(e,t,n){return e.hasPendingContent!==t.hasPendingContent||e.isDraining!==t.isDraining||e.liveItemKey!==t.liveItemKey||e.items.length!==t.items.length?!1:e.items.every((e,r)=>{let i=t.items[r];if(i===void 0||n.getKey(e)!==n.getKey(i))return!1;let a=n.getText(e),o=n.getText(i);return a===void 0?e===i:a===o})}async function Ho(e,t){let n=``;try{let t=await e.json();typeof t==`object`&&t&&`error`in t&&typeof t.error==`object`&&t.error!==null&&`message`in t.error&&typeof t.error.message==`string`&&(n=`: ${t.error.message}`)}catch{}return`${t} with HTTP ${e.status}${n}`}function Uo(e){return e instanceof Yi?e.response.status===401?`Authentication required`:`Run failed with HTTP ${e.response.status}`:s(e)}function Wo(e,t){let n=``;try{let t=JSON.parse(e.body);typeof t==`object`&&t&&`error`in t&&typeof t.error==`object`&&t.error!==null&&`message`in t.error&&typeof t.error.message==`string`&&(n=`: ${t.error.message}`)}catch{}return`${t} with HTTP ${e.response.status}${n}`}function Go(e){if(typeof e==`string`)return e;if(e instanceof Error)return e.message;try{return JSON.stringify(e)??String(e)}catch{return String(e)}}var Ko=0;function qo(e){Ko=e}function Jo(){Ko=0}function Yo(e){return e.filter(e=>e.kind===`message`&&e.text.trim().length>0).map(e=>({role:e.role,content:[{type:`text`,text:e.text}]}))}function Xo(e){return e.currentTarget.value}function Zo(e){e!==null&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)}function Qo(){let e=Ko;return Ko+=1,e}function $o(e){return e.reduce((e,t)=>Math.max(e,t.entryId+1),0)}function es(e,t,n){for(let r=e.length-1;r>=0;--r){let i=e[r];if(i!==void 0&&!(i.kind!==`tool`||i.toolName!==t||i.result!==void 0)&&(n===void 0||i.callId===n))return r}return-1}function ts(e,t,n){for(let r=e.length-1;r>=0;--r){let i=e[r];if(i!==void 0&&!(i.kind!==`tool`||i.toolName!==t)&&(n===void 0||i.callId===n))return r}return-1}function ns(e){return typeof e==`string`?e:c(e)?typeof e.text==`string`?e.text:typeof e.content==`string`?e.content:Array.isArray(e.content)?e.content.map(rs).filter(Boolean).join(`
|
|
14
14
|
`):``:``}function rs(e){return typeof e==`string`?e:c(e)?typeof e.text==`string`?e.text:e.type===`tool_call`&&c(e.function)?`${String(e.function.name??`tool`)}(${l(e.function.arguments)})`:e.type===`tool_result`&&Array.isArray(e.content)?e.content.map(rs).filter(Boolean).join(`
|
|
15
|
-
`):typeof e.type==`string`?e.type:``:``}function is(){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>e())})})}function as(e){let{attachments:t,messages:n,onActivePageChange:r,onAttachmentsChange:i,onBeforeRun:a,onError:c,onPromptChange:u,onRunStateChange:d,onSessionTraceSummariesChange:f,onStatus:p,promptRef:m,runState:h,selectedAgent:g,selectedAgentId:_,selectedModelRef:v,sessions:y,sessionsEnabled:b,traces:x,transcript:S}=e,w=(0,C.useRef)(void 0),T=(0,C.useRef)(void 0),E=(0,C.useRef)(!1),D=(0,C.useRef)(!1),O=(0,C.useRef)(void 0),k=(0,C.useRef)(Promise.resolve()),[A,j]=(0,C.useState)(void 0),M=ho({transport:fa({endpoint:e=>`/agents/${encodeURIComponent(e.agentId)}/runs`,method:`POST`,format:`jsonl`,headers:{"content-type":`application/json`},body:e=>{let{agentId:t,...n}=e;return JSON.stringify(n)},mapEvent:e=>e}),createRequest:({coreMessages:e})=>{let t=w.current;if(t===void 0)throw Error(`Missing playground run request`);let n=t.useTextMessage?t.promptText:e.at(-1);if(n===void 0)throw Error(`Missing playground prompt message`);return os(t,n)},eventToDelta:()=>void 0,eventToFinal:()=>void 0,humanInput:{eventToApproval:e=>e.type===`tool_approval_request`||e.type===`tool_approval_result`?e.approval:void 0,eventToQuestion:e=>e.type===`tool_question_request`||e.type===`tool_question_result`?e.question:void 0,decideApproval:async e=>{let t=await fetch(`/approvals/${encodeURIComponent(e.approvalId)}/decision`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({approved:e.approved})});if(!t.ok)throw Error(`Approval decision failed with HTTP ${t.status}`);let n=await t.json();return ss(S,n),n},answerQuestion:async e=>{let t=await fetch(`/questions/${encodeURIComponent(e.questionId)}/answer`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({answers:e.answers})});if(!t.ok)throw Error(`Question answer failed with HTTP ${t.status}`);let n=await t.json();return cs(S,n),n}},onEvent(e){D.current||F(e)&&(k.current=k.current.then(is))},onError(e){if(E.current||D.current)return;D.current=!0,T.current=e;let t=Uo(e);c(t),S.appendAssistantError(t),ne()}});async function N(e){let l=e.trim(),C=t,A=g?.id??_;if(l.length===0&&C.length===0||A.length===0||h===`running`||M.status===`streaming`)return;E.current=!1,D.current=!1,d(`running`),a(),r(`playground`),c(``),u(``),i([]),requestAnimationFrame(()=>Zo(m.current));let N=C.length===0?{text:l}:li(l,C);S.setMessages(e=>{let t={entryId:Qo(),kind:`message`,role:`user`,text:l};return C.length>0&&(t.attachments=ui(C)),[...e,t,{entryId:Qo(),kind:`message`,role:`assistant`,text:``,tone:`pending`}]});try{let e=b&&y.selectedSessionId.length===0,t=e?(await y.createSession(o(l),{updatePath:!1})).id:y.selectedSessionId,r=b?void 0:Yo(n);T.current=void 0,k.current=Promise.resolve();let i={source:`anvia-studio`};v.length>0&&(i.studioModel=v);let a={agentId:A,promptText:l,useTextMessage:C.length===0,stream:!0,metadata:i};t.length>0&&(a.sessionId=t),r!==void 0&&(a.history=r),v.length>0&&(a.model=v),w.current=a;let s=Date.now();if(O.current=s,j(s),await M.sendMessage(N),await k.current,T.current===void 0){if(await y.loadAllSessions(),t.length>0){y.setSelectedSessionId(t);let[n]=await Promise.all([x.loadSessionTraceSummaries(t),y.loadSessionLogs(t)]);f(n),S.setMessages(e=>ni(e,n)),e&&y.openSessionPath(t)}p(E.current?`Stopped`:`Connected`)}}catch(e){if(!E.current&&!D.current){D.current=!0;let t=s(e);c(t),S.appendAssistantError(t),ne()}}finally{ne(),w.current=void 0,M.reset(),d(`idle`)}}function ee(){if(M.status!==`streaming`||D.current)return;E.current=!0,D.current=!0;let e=re();M.stop(),S.cancelPendingRun(e??0),p(`Stopping`)}function te(e,t){c(``),(t?M.approveTool(e):M.rejectTool(e)).catch(e=>c(s(e)))}function P(e,t){c(``),M.answerToolQuestion(e,t).catch(e=>c(s(e)))}function F(e){if(e.type===`text_delta`)return S.appendAssistantText(e.delta),!0;if(e.type===`reasoning_delta`)return S.appendReasoningText(e.delta,e.id),!0;if(e.type===`tool_call`)return S.appendToolCall(e.toolCall.function.name,l(e.toolCall.function.arguments),e.toolCall.callId??e.toolCall.id),!0;if(e.type===`tool_result`){let t={toolName:e.toolName,callId:e.toolCallId,args:e.args,result:e.result};return e.structuredResult!==void 0&&(t.structuredResult=e.structuredResult),S.appendToolResult(t),!0}if(e.type===`agent_tool_event`)return S.appendAgentToolEvent(e),!0;if(e.type===`tool_approval_request`||e.type===`tool_approval_result`)return S.updateToolApproval(e.approval),!0;if(e.type===`tool_question_request`||e.type===`tool_question_result`)return S.updateToolQuestion(e.question),!0;if(e.type===`session_log`)return y.appendSessionLogEntry(e.log),!0;if(e.type===`final`)return D.current=!0,e.trace?.traceId!==void 0&&S.assignAssistantTraceId(e.trace.traceId),S.clearPendingAssistant(),ne(),!0;if(e.type===`error`){D.current=!0;let t=Go(e.error);return T.current=e.error,c(t),S.appendAssistantError(t),ne(),!0}return!1}function ne(){let e=re();e!==void 0&&S.completeRun(e)}function re(){let e=O.current;if(e!==void 0)return O.current=void 0,j(void 0),Date.now()-e}return{answeringQuestions:new Set(M.answeringQuestions),decidingApprovals:new Set(M.decidingApprovals),isStreaming:M.status===`streaming`,workingStartedAt:A,answerToolQuestion:P,decideToolApproval:te,runPrompt:N,stopPrompt:ee}}function os(e,t){let n={agentId:e.agentId,message:t,stream:e.stream,metadata:e.metadata};return e.sessionId!==void 0&&(n.sessionId=e.sessionId),e.history!==void 0&&(n.history=e.history),e.model!==void 0&&(n.model=e.model),n}function ss(e,t){let n=ls(t);n!==void 0&&e.updateToolApproval(n)}function cs(e,t){let n=us(t);n!==void 0&&e.updateToolQuestion(n)}function ls(e){if(e.requestedAt===void 0)return;let t={id:e.id,toolName:e.toolName,status:e.status,requestedAt:e.requestedAt};return e.callId!==void 0&&(t.callId=e.callId),e.resolvedAt!==void 0&&(t.resolvedAt=e.resolvedAt),e.reason!==void 0&&(t.reason=e.reason),t}function us(e){if(e.requestedAt===void 0)return;let t={id:e.id,toolName:e.toolName,status:e.status,requestedAt:e.requestedAt,questions:e.questions};return e.callId!==void 0&&(t.callId=e.callId),e.answeredAt!==void 0&&(t.answeredAt=e.answeredAt),e.cancelledAt!==void 0&&(t.cancelledAt=e.cancelledAt),e.answers!==void 0&&(t.answers=e.answers),t}function ds(){let[e,t]=(0,C.useState)([]);return{messages:e,setMessages:t,appendAgentToolEvent:e=>t(t=>ws(t,e)),appendAssistantError:e=>t(t=>hs(t,e)),appendAssistantText:e=>t(t=>ms(t,e)),appendReasoningText:(e,n)=>t(t=>xs(t,e,n)),appendToolCall:(e,n,r)=>t(t=>Ss(t,e,n,r)),appendToolResult:e=>t(t=>Cs(t,e)),assignAssistantTraceId:e=>t(t=>gs(t,e)),cancelPendingRun:e=>t(t=>fs(t,new Date().toISOString(),e)),clearPendingAssistant:()=>t(e=>Ts(e)),completeRun:e=>t(t=>ps(t,e)),updateToolApproval:e=>t(t=>_s(t,e)),updateToolQuestion:e=>t(t=>vs(t,e))}}function fs(e,t,n){let r=Ts(e),i=-1;for(let e=r.length-1;e>=0;--e){let t=r[e];if(t?.kind===`message`&&t.role===`user`){i=e;break}}if(i<0)return ps(r,n);for(let e=i+1;e<r.length;e+=1){let n=r[e];if(n?.kind!==`tool`)continue;let i={...n};n.approval?.status===`pending`&&(i.approval={...n.approval,status:`cancelled`,resolvedAt:t,reason:`Run cancelled in Anvia Studio.`}),n.question?.status===`pending`&&(i.question={...n.question,status:`cancelled`,cancelledAt:t}),r[e]=i}return ps(r,n)}function ps(e,t){let n=[...e],r=Math.max(0,t);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t?.kind===`message`&&t.role===`assistant`){if(t.tone===`pending`){let{tone:i,...a}=t;n[e]={...a,durationMs:r}}else n[e]={...t,durationMs:r};return n}if(t?.kind===`message`&&t.role===`user`)break}return n.push({entryId:Qo(),kind:`message`,role:`assistant`,text:``,durationMs:r}),n}function ms(e,t){let n=[...e],r=n.at(-1);if(r?.kind===`message`&&r.role===`assistant`)if(r.tone===`pending`){let{tone:e,...i}=r;n[n.length-1]={...i,text:t}}else n[n.length-1]={...r,text:`${r.text}${t}`};else n.push({entryId:Qo(),kind:`message`,role:`assistant`,text:t});return n}function hs(e,t){let n=[...e],r=n.at(-1),i={entryId:r?.kind===`message`&&r.role===`assistant`&&r.tone===`pending`?r.entryId:Qo(),kind:`message`,role:`assistant`,text:t,tone:`error`};return r?.kind===`message`&&r.role===`assistant`&&r.tone===`pending`?(n[n.length-1]=i,n):[...n,i]}function gs(e,t){let n=[...e];for(let e=n.length-1;e>=0;--e){let r=n[e];if(r?.kind===`message`&&r.role===`assistant`){n[e]={...r,traceId:t};break}}return n}function _s(e,t){let n=Ts(e),r=ts(n,t.toolName,t.callId),i=ys(t);if(r<0){let e={entryId:Qo(),kind:`tool`,toolName:t.toolName,approval:i};return t.callId!==void 0&&(e.callId=t.callId),n.push(e),n}let a=n[r];return a!==void 0&&a.kind===`tool`&&(n[r]={...a,approval:i}),n}function vs(e,t){let n=Ts(e),r=ts(n,t.toolName,t.callId),i=bs(t);if(r<0){let e={entryId:Qo(),kind:`tool`,toolName:t.toolName,question:i};return t.callId!==void 0&&(e.callId=t.callId),n.push(e),n}let a=n[r];return a!==void 0&&a.kind===`tool`&&(n[r]={...a,question:i}),n}function ys(e){let t={id:e.id,status:e.status,requestedAt:e.requestedAt};return e.resolvedAt!==void 0&&(t.resolvedAt=e.resolvedAt),e.reason!==void 0&&(t.reason=e.reason),t}function bs(e){let t={id:e.id,status:e.status,requestedAt:e.requestedAt,questions:e.questions};return e.answeredAt!==void 0&&(t.answeredAt=e.answeredAt),e.answers!==void 0&&(t.answers=e.answers),t}function xs(e,t,n){let r=Ts(e),i=r.at(-1);if(i?.kind===`reasoning`&&(i.reasoningId??``)===(n??``))r[r.length-1]={...i,text:`${i.text}${t}`};else{let e={entryId:Qo(),kind:`reasoning`,text:t};n!==void 0&&(e.reasoningId=n),r.push(e)}return r}function Ss(e,t,n,r){let i={entryId:Qo(),kind:`tool`,toolName:t};return r!==void 0&&(i.callId=r),n.length>0&&(i.args=n),[...Ts(e),i]}function Cs(e,t){let n=Ts(e),r=es(n,t.toolName,t.callId);if(r>=0){let e=n[r];if(e!==void 0&&e.kind===`tool`){let i={...e,args:e.args??t.args,result:t.result};return t.structuredResult!==void 0&&(i.structuredResult=t.structuredResult),n[r]=i,n}}let i={entryId:Qo(),kind:`tool`,toolName:t.toolName,args:t.args,result:t.result};return t.callId!==void 0&&(i.callId=t.callId),t.structuredResult!==void 0&&(i.structuredResult=t.structuredResult),n.push(i),n}function ws(e,t){let n=Es(t);if(n===void 0)return e;let r=Ts(e),i=es(r,t.toolName,t.toolCallId);if(i<0){let e={entryId:Qo(),kind:`tool`,toolName:t.toolName,childEvents:[n]};return t.toolCallId!==void 0&&(e.callId=t.toolCallId),r.push(e),r}let a=r[i];if(a===void 0||a.kind!==`tool`)return r;let o=[...a.childEvents??[]];return Ds(o,n),r[i]={...a,childEvents:o},r}function Ts(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.kind===`message`&&n.role===`assistant`&&n.tone===`pending`&&n.text.trim().length===0)return e.filter((e,n)=>n!==t)}return[...e]}function Es(e){let t=e.event;if(t.type===`text_delta`){let n={kind:`message`,agentId:e.agentId,text:t.delta};return e.agentName!==void 0&&(n.agentName=e.agentName),n}if(t.type===`reasoning_delta`){let n={kind:`reasoning`,agentId:e.agentId,text:t.delta};return e.agentName!==void 0&&(n.agentName=e.agentName),t.id!==void 0&&(n.reasoningId=t.id),n}if(t.type===`tool_call`){let n={kind:`tool`,agentId:e.agentId,toolName:t.toolCall.function.name,args:l(t.toolCall.function.arguments)};e.agentName!==void 0&&(n.agentName=e.agentName);let r=t.toolCall.callId??t.toolCall.id;return r!==void 0&&(n.callId=r),n}if(t.type===`tool_result`){let n={kind:`tool`,agentId:e.agentId,toolName:t.toolName,args:t.args,result:t.result};return e.agentName!==void 0&&(n.agentName=e.agentName),t.toolCallId!==void 0&&(n.callId=t.toolCallId),t.structuredResult!==void 0&&(n.structuredResult=t.structuredResult),n}if(t.type===`error`){let n={kind:`message`,agentId:e.agentId,text:`Error: ${s(t.error)}`};return e.agentName!==void 0&&(n.agentName=e.agentName),n}}function Ds(e,t){if(t.kind===`message`){let n=e.at(-1);n?.kind===`message`&&n.agentId===t.agentId?e[e.length-1]={...n,text:`${n.text}${t.text}`}:e.push(t);return}if(t.kind===`reasoning`){let n=e.at(-1);n?.kind===`reasoning`&&n.agentId===t.agentId&&(n.reasoningId??``)===(t.reasoningId??``)?e[e.length-1]={...n,text:`${n.text}${t.text}`}:e.push(t);return}let n=Os(e,t);if(n<0){e.push(t);return}let r=e[n];if(r?.kind===`tool`){let i={...r};r.args===void 0&&t.args!==void 0&&(i.args=t.args),t.result!==void 0&&(i.result=t.result),e[n]=i}}function Os(e,t){for(let n=e.length-1;n>=0;--n){let r=e[n];if(!(r?.kind!==`tool`||r.agentId!==t.agentId||r.toolName!==t.toolName||r.result!==void 0)&&(t.callId===void 0||r.callId===t.callId))return n}return-1}function ks(e){let{currentAgentId:t,enabled:n,loadSessionTraceSummaries:r,runState:i,selectedModelRef:a,onError:o,onSessionCreated:c,onSessionDeleted:l,onSessionLoaded:u,onStatus:d}=e,[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)([]),[g,_]=(0,C.useState)([]),[v,y]=(0,C.useState)(`idle`),[b,x]=(0,C.useState)(`idle`),S=(0,C.useRef)(``),w=(0,C.useCallback)(async()=>{if(!n){h([]);return}try{let e=await fetch(`/sessions?limit=100`);if(!e.ok)throw Error(`Sessions failed with HTTP ${e.status}`);h((await e.json()).sessions)}catch(e){o(s(e))}},[n,o]);(0,C.useEffect)(()=>{w()},[w]);let T=(0,C.useCallback)(async e=>{if(!n)return _([]),[];x(`loading`);try{let t=new URLSearchParams({limit:`1000`}),n=await fetch(`/sessions/${encodeURIComponent(e)}/logs?${t}`);if(!n.ok)throw Error(`Session logs failed with HTTP ${n.status}`);let r=await n.json();return _(r.logs),r.logs}catch(e){return o(s(e)),_([]),[]}finally{x(`idle`)}},[n,o]),E=(0,C.useCallback)(async(e,n={})=>{let r={source:`anvia-studio`};a.length>0&&(r[Xr]=a);let i=await fetch(`/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agentId:t,title:e,metadata:r})});if(!i.ok)throw Error(await Ho(i,`Session create failed`));let o=await i.json();return p(o.id),h(e=>[o,...e.filter(e=>e.id!==o.id)]),n.updatePath!==!1&&c(o.id),await T(o.id),o},[t,T,c,a]),D=(0,C.useCallback)(async(e,t={})=>{if(i!==`running`){S.current=e,y(`loading`),o(``);try{let n=await fetch(`/sessions/${encodeURIComponent(e)}`);if(!n.ok)throw Error(`Session load failed with HTTP ${n.status}`);let i=await n.json(),[a]=await Promise.all([r(i.id),T(i.id)]);if(S.current!==e)return;p(i.id),u(i,a,t),d(`Connected`)}catch(t){S.current===e&&o(s(t))}finally{S.current===e&&y(`idle`)}}},[T,r,o,u,d,i]),O=(0,C.useCallback)(async e=>{if(i!==`running`){o(``);try{let t=await fetch(`/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`});if(!t.ok)throw Error(`Session delete failed with HTTP ${t.status}`);let n=f===e.id;h(t=>t.filter(t=>t.id!==e.id)),n&&(p(``),_([])),l(e.id,n),d(`Connected`)}catch(e){o(s(e))}}},[o,l,d,i,f]),k=(0,C.useCallback)(()=>{p(``),_([])},[]),A=(0,C.useCallback)(e=>{_(t=>t.some(t=>t.id===e.id)?t:[...t,e].sort((e,t)=>e.sequence-t.sequence))},[]);return(0,C.useMemo)(()=>({allSessions:m,selectedSessionId:f,sessionLogs:g,sessionLoadState:v,sessionLogLoadState:b,appendSessionLogEntry:A,clearSelectedSession:k,createSession:E,deleteSession:O,loadAllSessions:w,loadSession:D,loadSessionLogs:T,openSessionPath:c,setSelectedSessionId:p}),[m,A,k,E,O,w,D,T,c,f,v,b,g])}function As(e,t){return!0}function js(e,t){return e}var Ms=document.getElementById(`anvia-ui`),Ns=Ms?.dataset.uiPath??`/ui`,Ps=Ms?.dataset.uiCompatPath??`/ui`,Fs=`${Ls(Ns)||Ls(Ps)||`/ui`}/assets/logo.png`,Is=`static-context`;function Ls(e){return e===`/`?``:e.replace(/\/+$/,``)}function Rs(e){let{activePage:t,enabled:n,onError:r,onNavigateTracing:i,onOpenTrace:a,onOpenTraceIndex:o,onOpenTraceSession:c}=e,[l,u]=(0,C.useState)([]),[d,f]=(0,C.useState)(()=>e.initialTraceId),[p,m]=(0,C.useState)(()=>e.initialTraceSessionId),[h,g]=(0,C.useState)(`idle`),_=(0,C.useCallback)(async()=>{if(!n){u([]);return}g(`loading`);try{let e=new URLSearchParams({include:`detail`,limit:`50`}),t=await fetch(`/traces?${e.toString()}`);if(!t.ok)throw Error(`Traces failed with HTTP ${t.status}`);let n=(await t.json()).traces;if(d.length>0&&!n.some(e=>e.id===d)){let e=await fetch(`/traces/${encodeURIComponent(d)}`);if(e.ok){u([await e.json(),...n]);return}}u(n)}catch(e){r(s(e))}finally{g(`idle`)}},[n,r,d]),v=(0,C.useCallback)(async(e,t={})=>{if(n){g(`loading`);try{let n=new URLSearchParams({include:`detail`,limit:`50`,sessionId:e}),r=await fetch(`/traces?${n.toString()}`);if(!r.ok)throw Error(`Session traces failed with HTTP ${r.status}`);let a=[...(await r.json()).traces].sort((e,t)=>Date.parse(e.startedAt)-Date.parse(t.startedAt));u(a);let o=a[0]?.id;if(o===void 0){f(``),m(e),t.updatePath!==!1&&c(e);return}i(),f(o),m(e),t.updatePath!==!1&&c(e)}catch(e){r(s(e))}finally{g(`idle`)}}},[n,r,i,c]),y=(0,C.useCallback)(async e=>{if(!n)return[];let t=new URLSearchParams({limit:`100`}),r=await fetch(`/sessions/${encodeURIComponent(e)}/traces?${t}`);return r.ok?(await r.json()).traces:[]},[n]);(0,C.useEffect)(()=>{t!==`tracing`||p!==void 0||_()},[t,_,p]);let b=(0,C.useCallback)((e,t)=>{f(e),m(t)},[]),x=(0,C.useCallback)(()=>{f(``),m(void 0)},[]),S=(0,C.useCallback)(e=>{if(i(),f(e),m(void 0),e.length===0){o();return}a(e)},[i,a,o]),w=(0,C.useCallback)(e=>{u(t=>t.filter(t=>t.sessionId!==e))},[]);return(0,C.useMemo)(()=>({traces:l,selectedTraceId:d,traceSessionDetailId:p,traceLoadState:h,clearTraceSelection:x,loadSessionTraceSummaries:y,loadTraces:_,removeSessionTraces:w,selectTrace:S,setTraceLocation:b,showSessionTraces:v}),[x,y,_,w,S,d,b,v,h,p,l])}var zs=(0,C.createContext)(void 0);function Bs(){let e=(0,C.useContext)(zs);if(e===void 0)throw Error(`StudioConsoleContext is missing`);return e}var Vs=`modulepreload`,Hs=function(e){return`/ui/`+e},Us={},Ws=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Hs(t,n),t in Us)return;Us[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Vs,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Gs=(0,C.lazy)(()=>Ws(()=>import(`./agents-page-Bbbg-x2R.js`).then(e=>({default:e.AgentsPage})),__vite__mapDeps([0,1,2]))),Ks=(0,C.lazy)(()=>Ws(()=>import(`./evals-page-CtsKzSlO.js`).then(e=>({default:e.EvalsPage})),__vite__mapDeps([3,1]))),qs=(0,C.lazy)(()=>Ws(()=>import(`./knowledge-page-4XUY0A05.js`).then(e=>({default:e.KnowledgePage})),__vite__mapDeps([4,1,5,6,2]))),Js=(0,C.lazy)(()=>Ws(()=>import(`./mcps-page-D2bfql9X.js`).then(e=>({default:e.McpsPage})),__vite__mapDeps([7,1,2,8,5,6]))),Ys=(0,C.lazy)(()=>Ws(()=>import(`./memory-page-Bv_jKRIe.js`).then(e=>({default:e.MemoryPage})),__vite__mapDeps([9,1,5,6,10,2]))),Xs=(0,C.lazy)(()=>Ws(()=>import(`./pipelines-page-Ccc7drvi.js`).then(e=>({default:e.PipelinesPage})),__vite__mapDeps([11,1,5,6,12]))),Zs=(0,C.lazy)(()=>Ws(()=>import(`./sessions-page-_9Crnndq.js`).then(e=>({default:e.SessionsPage})),__vite__mapDeps([13,1,6]))),Qs=(0,C.lazy)(()=>Ws(()=>import(`./sandboxes-page-lr90zS3G.js`).then(e=>({default:e.SandboxesPage})),__vite__mapDeps([14,1,6]))),$s=(0,C.lazy)(()=>Ws(()=>import(`./sessions-page-_9Crnndq.js`).then(e=>({default:e.DeleteSessionDialog})),__vite__mapDeps([13,1,6]))),ec=(0,C.lazy)(()=>Ws(()=>import(`./status-page-BguURb9e.js`).then(e=>({default:e.StatusPage})),__vite__mapDeps([15,1,5,6,2]))),tc=(0,C.lazy)(()=>Ws(()=>import(`./tools-page-Bl4RGn6w.js`).then(e=>({default:e.ToolsPage})),__vite__mapDeps([16,1,2,8,5,6]))),nc=(0,C.lazy)(()=>Ws(()=>import(`./trace-browser-B-5APgrF.js`).then(e=>({default:e.TraceBrowser})),__vite__mapDeps([17,1,2,6])));function W(){return(0,z.jsx)(`section`,{className:`grid h-full min-h-0 place-items-center bg-background/45 text-sm font-medium text-muted-foreground`,children:`Loading`})}var rc=[[`path`,{d:`M4.31802 19.682C3 18.364 3 16.2426 3 12C3 7.75736 3 5.63604 4.31802 4.31802C5.63604 3 7.75736 3 12 3C16.2426 3 18.364 3 19.682 4.31802C21 5.63604 21 7.75736 21 12C21 16.2426 21 18.364 19.682 19.682C18.364 21 16.2426 21 12 21C7.75736 21 5.63604 21 4.31802 19.682Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 14L9.79289 11.2071C10.1834 10.8166 10.8166 10.8166 11.2071 11.2071L12.7929 12.7929C13.1834 13.1834 13.8166 13.1834 14.2071 12.7929L17 10`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],ic=[[`path`,{d:`M13 2H11C7.22876 2 5.34315 2 4.17157 3.17157C3 4.34315 3 6.22876 3 10V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V10C21 6.22876 21 4.34315 19.8284 3.17157C18.6569 2 16.7712 2 13 2Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M21 12H3`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M15 7H9`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M15 17H9`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}]],ac=[[`path`,{d:`M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],oc=[[`path`,{d:`M5.5 12.002H19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M10.9999 18.002C10.9999 18.002 4.99998 13.583 4.99997 12.0019C4.99996 10.4208 11 6.00195 11 6.00195`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],sc=[[`path`,{d:`M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],cc=[[`path`,{d:`M11 6H15.5C17.9853 6 20 8.01472 20 10.5C20 12.9853 17.9853 15 15.5 15H4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6.99998 12C6.99998 12 4.00001 14.2095 4 15C3.99999 15.7906 7 18 7 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],lc=[[`path`,{d:`M12 5.5V19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 11C18 11 13.5811 5.00001 12 5C10.4188 4.99999 6 11 6 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],uc=[[`path`,{d:`M19.5 12.0001V13.5001C19.5 17.6422 16.1421 21.0001 12 21.0001C7.85786 21.0001 4.5 17.6422 4.5 13.5001V8C4.5 5.23858 6.73858 3 9.5 3C12.2614 3 14.5 5.23858 14.5 8V13.5C14.5 14.8807 13.3807 16 12 16C10.6193 16 9.5 14.8807 9.5 13.5V9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],dc=[[`path`,{d:`M5.33333 3.00001C7.79379 2.99657 10.1685 3.88709 12 5.5V21C10.1685 19.3871 7.79379 18.4966 5.33333 18.5C3.77132 18.5 2.99032 18.5 2.64526 18.2792C2.4381 18.1466 2.35346 18.0619 2.22086 17.8547C2 17.5097 2 16.8941 2 15.6629V6.40322C2 4.97543 2 4.26154 2.54874 3.68286C3.09748 3.10418 3.65923 3.07432 4.78272 3.0146C4.965 3.00491 5.14858 3.00001 5.33333 3.00001Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18.6667 3.00001C16.2062 2.99657 13.8315 3.88709 12 5.5V21C13.8315 19.3871 16.2062 18.4966 18.6667 18.5C20.2287 18.5 21.0097 18.5 21.3547 18.2792C21.5619 18.1466 21.6465 18.0619 21.7791 17.8547C22 17.5097 22 16.8941 22 15.6629V6.40322C22 4.97543 22 4.26154 21.4513 3.68286C20.9025 3.10418 20.3408 3.07432 19.2173 3.0146C19.035 3.00491 18.8514 3.00001 18.6667 3.00001Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M19 7.32566C18.8893 7.32211 18.7782 7.32032 18.6667 7.32032C18.1048 7.31954 17.5475 7.36537 17 7.45576M19 11.0067C18.8893 11.0032 18.7782 11.0014 18.6667 11.0014C17.401 10.9996 16.158 11.2344 15 11.6824M19 14.501C18.8893 14.4975 18.7782 14.4957 18.6667 14.4957C17.401 14.4939 16.158 14.7287 15 15.1767`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M5 7.32566C5.11067 7.32211 5.22179 7.32032 5.33333 7.32032C5.89518 7.31954 6.45255 7.36537 7 7.45576M5 11.0067C5.11067 11.0032 5.22179 11.0014 5.33333 11.0014C6.599 10.9996 7.84198 11.2344 9 11.6824M5 14.501C5.11067 14.4975 5.22179 14.4957 5.33333 14.4957C6.599 14.4939 7.84198 14.7287 9 15.1767`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],fc=[[`path`,{d:`M18 6L6.00081 17.9992M17.9992 18L6 6.00085`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],pc=[[`path`,{d:`M4 15L4 19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 9L12 19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M22 22L2 22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M20 13L20 19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M5.60009 8.79993C5.23521 8.31419 4.6543 8 4 8C2.89543 8 2 8.89543 2 10C2 11.1046 2.89543 12 4 12C5.10457 12 6 11.1046 6 10C6 9.54973 5.8512 9.13421 5.60009 8.79993ZM5.60009 8.79993L10.3999 5.20007M10.3999 5.20007C10.7648 5.68581 11.3457 6 12 6C12.783 6 13.4609 5.55006 13.7892 4.89462M10.3999 5.20007C10.1488 4.86579 10 4.45027 10 4C10 2.89543 10.8954 2 12 2C13.1046 2 14 2.89543 14 4C14 4.32158 13.9241 4.62543 13.7892 4.89462M13.7892 4.89462L18.2108 7.10538M18.2108 7.10538C18.0759 7.37457 18 7.67842 18 8C18 9.10457 18.8954 10 20 10C21.1046 10 22 9.10457 22 8C22 6.89543 21.1046 6 20 6C19.217 6 18.5391 6.44994 18.2108 7.10538Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`4`}]],mc=[[`path`,{d:`M2 10.5C2 9.72921 2.01346 8.97679 2.03909 8.2503C2.12282 5.87683 2.16469 4.69009 3.13007 3.71745C4.09545 2.74481 5.3157 2.6926 7.7562 2.58819C9.09517 2.5309 10.5209 2.5 12 2.5C13.4791 2.5 14.9048 2.5309 16.2438 2.58819C18.6843 2.6926 19.9046 2.74481 20.8699 3.71745C21.8353 4.69009 21.8772 5.87683 21.9609 8.2503C21.9865 8.97679 22 9.72921 22 10.5C22 11.2708 21.9865 12.0232 21.9609 12.7497C21.8772 15.1232 21.8353 16.3099 20.8699 17.2826C19.9046 18.2552 18.6843 18.3074 16.2437 18.4118C15.5098 18.4432 14.7498 18.4667 13.9693 18.4815C13.2282 18.4955 12.8576 18.5026 12.532 18.6266C12.2064 18.7506 11.9325 18.9855 11.3845 19.4553L9.20503 21.3242C9.07273 21.4376 8.90419 21.5 8.72991 21.5C8.32679 21.5 8 21.1732 8 20.7701V18.4219C7.91842 18.4186 7.83715 18.4153 7.75619 18.4118C5.31569 18.3074 4.09545 18.2552 3.13007 17.2825C2.16469 16.3099 2.12282 15.1232 2.03909 12.7497C2.01346 12.0232 2 11.2708 2 10.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12.1257 10.5H12.0007M8.125 10.5H8M16.125 10.5H16M12.2507 10.5C12.2507 10.6381 12.1388 10.75 12.0007 10.75C11.8627 10.75 11.7507 10.6381 11.7507 10.5C11.7507 10.3619 11.8627 10.25 12.0007 10.25C12.1388 10.25 12.2507 10.3619 12.2507 10.5ZM8.25 10.5C8.25 10.6381 8.13807 10.75 8 10.75C7.86193 10.75 7.75 10.6381 7.75 10.5C7.75 10.3619 7.86193 10.25 8 10.25C8.13807 10.25 8.25 10.3619 8.25 10.5ZM16.25 10.5C16.25 10.6381 16.1381 10.75 16 10.75C15.8619 10.75 15.75 10.6381 15.75 10.5C15.75 10.3619 15.8619 10.25 16 10.25C16.1381 10.25 16.25 10.3619 16.25 10.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],hc=[[`path`,{d:`M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17.0001 9.00004 17.0001C9.41425 17.0001 9.74759 16.6523 10.4143 15.9568L19 7.00006`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],gc=[[`path`,{d:`M7.5 7.5L8.72654 8.55719C9.24218 9.00163 9.5 9.22386 9.5 9.5C9.5 9.77614 9.24218 9.99836 8.72654 10.4428L7.5 11.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M11.5 12.5H15.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 21C15.7497 21 17.6246 21 18.9389 20.0451C19.3634 19.7367 19.7367 19.3634 20.0451 18.9389C21 17.6246 21 15.7497 21 12C21 8.25027 21 6.3754 20.0451 5.06107C19.7367 4.6366 19.3634 4.26331 18.9389 3.95491C17.6246 3 15.7497 3 12 3C8.25027 3 6.3754 3 5.06107 3.95491C4.6366 4.26331 4.26331 4.6366 3.95491 5.06107C3 6.3754 3 8.25027 3 12C3 15.7497 3 17.6246 3.95491 18.9389C4.26331 19.3634 4.6366 19.7367 5.06107 20.0451C6.3754 21 8.25027 21 12 21Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],_c=[[`path`,{d:`M15 5H9C6.09433 5 4.64149 5 3.62036 5.73563C3.27976 5.981 2.981 6.27976 2.73563 6.62036C2 7.64149 2 9.09433 2 12C2 14.9057 2 16.3585 2.73563 17.3796C2.981 17.7202 3.27976 18.019 3.62036 18.2644C4.64149 19 6.09433 19 9 19H15C17.9057 19 19.3585 19 20.3796 18.2644C20.7202 18.019 21.019 17.7202 21.2644 17.3796C22 16.3585 22 14.9057 22 12C22 9.09433 22 7.64149 21.2644 6.62036C21.019 6.27976 20.7202 5.981 20.3796 5.73563C19.3585 5 17.9057 5 15 5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 9V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M14 9V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M10 9V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M6 9V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],vc=[[`path`,{d:`M9 15C9 12.1716 9 10.7574 9.87868 9.87868C10.7574 9 12.1716 9 15 9L16 9C18.8284 9 20.2426 9 21.1213 9.87868C22 10.7574 22 12.1716 22 15V16C22 18.8284 22 20.2426 21.1213 21.1213C20.2426 22 18.8284 22 16 22H15C12.1716 22 10.7574 22 9.87868 21.1213C9 20.2426 9 18.8284 9 16L9 15Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16.9999 9C16.9975 6.04291 16.9528 4.51121 16.092 3.46243C15.9258 3.25989 15.7401 3.07418 15.5376 2.90796C14.4312 2 12.7875 2 9.5 2C6.21252 2 4.56878 2 3.46243 2.90796C3.25989 3.07417 3.07418 3.25989 2.90796 3.46243C2 4.56878 2 6.21252 2 9.5C2 12.7875 2 14.4312 2.90796 15.5376C3.07417 15.7401 3.25989 15.9258 3.46243 16.092C4.51121 16.9528 6.04291 16.9975 9 16.9999`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],yc=[[`path`,{d:`M11 10.6667C11 10.6667 11.75 10.6667 12.5 12C12.5 12 14.8824 8.66667 17 8`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 11V9C7 5.70017 7 4.05025 8.02513 3.02513C9.05025 2 10.7002 2 14 2C17.2998 2 18.9497 2 19.9749 3.02513C21 4.05025 21 5.70017 21 9V11C21 14.2998 21 15.9497 19.9749 16.9749C18.9497 18 17.2998 18 14 18C10.7002 18 9.05025 18 8.02513 16.9749C7 15.9497 7 14.2998 7 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M3 6V15C3 18.2998 3 19.9497 4.02513 20.9749C5.05025 22 6.70017 22 10 22H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],bc=[[`path`,{d:`M4 12C4 8.22876 4 6.34315 5.17157 5.17157C6.34315 4 8.22876 4 12 4C15.7712 4 17.6569 4 18.8284 5.17157C20 6.34315 20 8.22876 20 12C20 15.7712 20 17.6569 18.8284 18.8284C17.6569 20 15.7712 20 12 20C8.22876 20 6.34315 20 5.17157 18.8284C4 17.6569 4 15.7712 4 12Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.5 2V4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M14.5 2V4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M9.5 20V22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M14.5 20V22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M13 9L9 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M15 13L13 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M22 14.5L20 14.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`7`}],[`path`,{d:`M4 9.5L2 9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`8`}],[`path`,{d:`M4 14.5L2 14.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`9`}],[`path`,{d:`M22 9.5L20 9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`10`}]],xc=[[`path`,{d:`M10 8.00024C13.866 8.00024 17 6.6571 17 5.00024C17 3.34339 13.866 2.00024 10 2.00024C6.13401 2.00024 3 3.34339 3 5.00024C3 6.6571 6.13401 8.00024 10 8.00024Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M10 14.0002C6.13401 14.0002 3 12.6571 3 11.0002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M10 20.0002C6.13401 20.0002 3 18.6571 3 17.0002V5.00024`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M18 15.0001V10.6516C18 10.2918 17.7083 10.0001 17.3485 10.0002C17.1308 10.0003 16.9275 10.1091 16.8067 10.2903L13.1289 15.807C13.0449 15.9331 13 16.0812 13 16.2327C13 16.6567 13.3437 17.0003 13.7676 17.0003L16 17.0003L16 21.3488C16 21.7086 16.2917 22.0003 16.6515 22.0002C16.8692 22.0001 17.0725 21.8913 17.1933 21.7101L20.8711 16.1934C20.9551 16.0673 21 15.9192 21 15.7677C21 15.3437 20.6563 15.0001 20.2324 15.0001H18Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M6 10.4896V10.4996`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M6 16.4899V16.4999`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],Sc=[[`ellipse`,{cx:`12`,cy:`5`,rx:`8`,ry:`3`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 10.842C7.60158 11.0229 8.27434 11.1718 9 11.282`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M20 12C20 13.6569 16.4183 15 12 15C7.58172 15 4 13.6569 4 12`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M7 17.842C7.60158 18.0229 8.27434 18.1718 9 18.282`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M20 5V19C20 20.6569 16.4183 22 12 22C7.58172 22 4 20.6569 4 19V5`,stroke:`currentColor`,strokeWidth:`1.5`,key:`4`}]],Cc=[[`path`,{d:`M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.5 16.5L9.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M14.5 16.5L14.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}]],wc=[[`path`,{d:`M2.99969 17.0002C2.99969 17.9302 2.99969 18.3952 3.10192 18.7767C3.37932 19.8119 4.18796 20.6206 5.22324 20.898C5.60474 21.0002 6.06972 21.0002 6.99969 21.0002L16.9997 21.0002C17.9297 21.0002 18.3947 21.0002 18.7762 20.898C19.8114 20.6206 20.6201 19.8119 20.8975 18.7767C20.9997 18.3952 20.9997 17.9302 20.9997 17.0002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16.4998 11.5002C16.4998 11.5002 13.1856 16.0002 11.9997 16.0002C10.8139 16.0002 7.49976 11.5002 7.49976 11.5002M11.9997 15.0002V3.00016`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Tc=[[`path`,{d:`M15 3H18C19.4142 3 20.1213 3 20.5607 3.43934C21 3.87868 21 4.58579 21 6V9M20 4L11 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20 13C20 16.7712 20 18.6569 18.8284 19.8284C17.6569 21 15.7712 21 12 21H11C7.22876 21 5.34315 21 4.17157 19.8284C3 18.6569 3 16.7712 3 13V12C3 8.22876 3 6.34315 4.17157 5.17157C5.34315 4 7.22876 4 11 4`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],Ec=[[`path`,{d:`M8 7L16 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 11L12 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Dc=[[`path`,{d:`M2.5 20V8.87695C2.5 7.58945 2.5 6.9457 2.78533 6.47048C2.9541 6.18939 3.18939 5.9541 3.47048 5.78533C3.9457 5.5 4.59449 5.5 5.89206 5.5C6.52339 5.5 6.83906 5.5 7.12612 5.58819C7.31759 5.64702 7.49914 5.73428 7.66469 5.84705C7.91289 6.01611 8.10859 6.26074 8.5 6.75C8.89141 7.23926 9.08711 7.48389 9.33531 7.65295C9.50086 7.76572 9.68241 7.85298 9.87388 7.91181C10.1609 8 10.4742 8 11.1008 8H15C16.4045 8 17.1067 8 17.6111 8.33706C17.8295 8.48298 18.017 8.67048 18.1629 8.88886C18.5 9.39331 18.5 10.0955 18.5 11.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M4.42028 14.0144L3.63368 16.0144C2.65618 18.4998 2.16743 19.7425 2.7524 20.6213C3.33737 21.5 4.65337 21.5 7.28537 21.5H15.1903C16.4249 21.5 17.0422 21.5 17.5295 21.1795C18.0169 20.859 18.2702 20.2865 18.7769 19.1415L19.6618 17.1415C20.7866 14.5992 21.349 13.3281 20.7679 12.4141C20.1868 11.5 18.8163 11.5 16.0752 11.5H8.07196C6.78232 11.5 6.1375 11.5 5.63811 11.8439C5.13872 12.1877 4.89924 12.7966 4.42028 14.0144Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M11.5 4.51456C12.4151 3.28409 13.6662 2.55594 15.5125 2.50161C16.1155 2.48386 16.7152 2.61395 17.2682 2.85544C18.5748 3.42601 19.4185 4.15644 20 5.5L21.5 3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Oc=[[`circle`,{cx:`12`,cy:`14`,r:`2`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20.0007 20C21.2561 18.3287 22 16.2512 22 14C22 12.5778 21.7031 11.2249 21.1679 10M3.99927 20C2.74389 18.3287 2 16.2512 2 14C2 8.47715 6.47715 4 12 4C13.4222 4 14.7751 4.2969 16 4.83209`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M13.5 12.5L19 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],kc=[[`path`,{d:`M7 19H13C15.8284 19 17.2426 19 18.1213 18.1213C19 17.2426 19 15.8284 19 13V10M19 10C19.7002 10 21.0085 11.9943 21.5 12.5M19 10C18.2998 10 16.9915 11.9943 16.5 12.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5 7L5 17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`circle`,{cx:`5`,cy:`5`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`3`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`4`}]],Ac=[[`path`,{d:`M2 11.4C2 10.2417 2.24173 10 3.4 10H20.6C21.7583 10 22 10.2417 22 11.4V12.6C22 13.7583 21.7583 14 20.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2 19.4C2 18.2417 2.24173 18 3.4 18H20.6C21.7583 18 22 18.2417 22 19.4V20.6C22 21.7583 21.7583 22 20.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}]],jc=[[`path`,{d:`M12 3V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 18V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21 12L18 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6 12L3 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M18.3635 5.63672L16.2422 7.75804`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M7.75804 16.2422L5.63672 18.3635`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M18.3635 18.3635L16.2422 16.2422`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M7.75804 7.75804L5.63672 5.63672`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`7`}]],Mc=[[`path`,{d:`M21.5 14.0784C20.3003 14.7189 18.9301 15.0821 17.4751 15.0821C12.7491 15.0821 8.91792 11.2509 8.91792 6.52485C8.91792 5.06986 9.28105 3.69968 9.92163 2.5C5.66765 3.49698 2.5 7.31513 2.5 11.8731C2.5 17.1899 6.8101 21.5 12.1269 21.5C16.6849 21.5 20.503 18.3324 21.5 14.0784Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Nc=[[`path`,{d:`M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M11 13.4625C14 14.955 17 12.8198 17 10.3934C17 7.96698 14.7614 6 12 6C9.23858 6 7 7.96698 7 10.3934C7 11.3826 7.37209 12.2955 8 13.0298M11 13.4625V9.90523M11 13.4625V15.8456C11 16.8264 11 17.3168 10.7732 17.5868C10.1251 18.3583 9 17.9399 8.5 17.2275`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Pc=[[`path`,{d:`M18.8906 12.846C18.5371 14.189 16.8667 15.138 13.5257 17.0361C10.296 18.8709 8.6812 19.7884 7.37983 19.4196C6.8418 19.2671 6.35159 18.9776 5.95624 18.5787C5 17.6139 5 15.7426 5 12C5 8.2574 5 6.3861 5.95624 5.42132C6.35159 5.02245 6.8418 4.73288 7.37983 4.58042C8.6812 4.21165 10.296 5.12907 13.5257 6.96393C16.8667 8.86197 18.5371 9.811 18.8906 11.154C19.0365 11.7084 19.0365 12.2916 18.8906 12.846Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Fc=[[`path`,{d:`M15.5 2V6M8.5 6V2`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6.00446 7.61331C5.93719 6.74273 6.63957 6 7.53014 6H16.4699C17.3604 6 18.0628 6.74273 17.9955 7.61331L17.8117 9.99197C17.6796 11.7019 17.1011 13.3498 16.132 14.7773L15.5312 15.6622C14.9638 16.4979 14.0077 17 12.9838 17H11.0162C9.99228 17 9.03617 16.4979 8.46881 15.6622L7.86803 14.7773C6.89885 13.3498 6.32041 11.7019 6.18827 9.99197L6.00446 7.61331Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 17V22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M11 9H13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Ic=[[`path`,{d:`M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Lc=[[`path`,{d:`M12 4V2`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20 22C20 17.5817 16.4183 14 12 14C7.58172 14 4 17.5817 4 22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.375 8.25H9.25M9.5 8.25C9.5 8.38807 9.38807 8.5 9.25 8.5C9.11193 8.5 9 8.38807 9 8.25C9 8.11193 9.11193 8 9.25 8C9.38807 8 9.5 8.11193 9.5 8.25Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M14.875 8.25H14.75M15 8.25C15 8.38807 14.8881 8.5 14.75 8.5C14.6119 8.5 14.5 8.38807 14.5 8.25C14.5 8.11193 14.6119 8 14.75 8C14.8881 8 15 8.11193 15 8.25Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M15.1538 4H8.84615C7.59095 4 6.96334 4 6.47397 4.22025C5.91693 4.47095 5.47095 4.91693 5.22025 5.47397C5 5.96334 5 6.59095 5 7.84615C5 9.85448 5 10.8586 5.3524 11.6417C5.75353 12.5329 6.46709 13.2465 7.35835 13.6476C8.14135 14 9.14552 14 11.1538 14H12.8462C14.8545 14 15.8586 14 16.6417 13.6476C17.5329 13.2465 18.2465 12.5329 18.6476 11.6417C19 10.8586 19 9.85448 19 7.84615C19 6.59095 19 5.96334 18.7797 5.47397C18.529 4.91693 18.0831 4.47095 17.526 4.22025C17.0367 4 16.4091 4 15.1538 4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],Rc=[[`path`,{d:`M2.5 9H6.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2.5 14H6.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2.5 4H18.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M18.5355 17.0355L21.5 20M20 13.5C20 10.7386 17.7614 8.5 15 8.5C12.2386 8.5 10 10.7386 10 13.5C10 16.2614 12.2386 18.5 15 18.5C17.7614 18.5 20 16.2614 20 13.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],zc=[[`path`,{d:`M15.5 12C15.5 13.933 13.933 15.5 12 15.5C10.067 15.5 8.5 13.933 8.5 12C8.5 10.067 10.067 8.5 12 8.5C13.933 8.5 15.5 10.067 15.5 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M21.011 14.0965C21.5329 13.9558 21.7939 13.8854 21.8969 13.7508C22 13.6163 22 13.3998 22 12.9669V11.0332C22 10.6003 22 10.3838 21.8969 10.2493C21.7938 10.1147 21.5329 10.0443 21.011 9.90358C19.0606 9.37759 17.8399 7.33851 18.3433 5.40087C18.4817 4.86799 18.5509 4.60156 18.4848 4.44529C18.4187 4.28902 18.2291 4.18134 17.8497 3.96596L16.125 2.98673C15.7528 2.77539 15.5667 2.66972 15.3997 2.69222C15.2326 2.71472 15.0442 2.90273 14.6672 3.27873C13.208 4.73448 10.7936 4.73442 9.33434 3.27864C8.95743 2.90263 8.76898 2.71463 8.60193 2.69212C8.43489 2.66962 8.24877 2.77529 7.87653 2.98663L6.15184 3.96587C5.77253 4.18123 5.58287 4.28891 5.51678 4.44515C5.45068 4.6014 5.51987 4.86787 5.65825 5.4008C6.16137 7.3385 4.93972 9.37763 2.98902 9.9036C2.46712 10.0443 2.20617 10.1147 2.10308 10.2492C2 10.3838 2 10.6003 2 11.0332V12.9669C2 13.3998 2 13.6163 2.10308 13.7508C2.20615 13.8854 2.46711 13.9558 2.98902 14.0965C4.9394 14.6225 6.16008 16.6616 5.65672 18.5992C5.51829 19.1321 5.44907 19.3985 5.51516 19.5548C5.58126 19.7111 5.77092 19.8188 6.15025 20.0341L7.87495 21.0134C8.24721 21.2247 8.43334 21.3304 8.6004 21.3079C8.76746 21.2854 8.95588 21.0973 9.33271 20.7213C10.7927 19.2644 13.2088 19.2643 14.6689 20.7212C15.0457 21.0973 15.2341 21.2853 15.4012 21.3078C15.5682 21.3303 15.7544 21.2246 16.1266 21.0133L17.8513 20.034C18.2307 19.8187 18.4204 19.711 18.4864 19.5547C18.5525 19.3984 18.4833 19.132 18.3448 18.5991C17.8412 16.6616 19.0609 14.6226 21.011 14.0965Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],Bc=[[`path`,{d:`M18.7088 3.49534C16.8165 2.55382 14.5009 2 12 2C9.4991 2 7.1835 2.55382 5.29116 3.49534C4.36318 3.95706 3.89919 4.18792 3.4496 4.91378C3 5.63965 3 6.34248 3 7.74814V11.2371C3 16.9205 7.54236 20.0804 10.173 21.4338C10.9067 21.8113 11.2735 22 12 22C12.7265 22 13.0933 21.8113 13.8269 21.4338C16.4576 20.0804 21 16.9205 21 11.2371L21 7.74814C21 6.34249 21 5.63966 20.5504 4.91378C20.1008 4.18791 19.6368 3.95706 18.7088 3.49534Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Vc=[[`path`,{d:`M4 12C4 8.72077 4 7.08116 4.81382 5.91891C5.1149 5.48891 5.48891 5.1149 5.91891 4.81382C7.08116 4 8.72077 4 12 4C15.2792 4 16.9188 4 18.0811 4.81382C18.5111 5.1149 18.8851 5.48891 19.1862 5.91891C20 7.08116 20 8.72077 20 12C20 15.2792 20 16.9188 19.1862 18.0811C18.8851 18.5111 18.5111 18.8851 18.0811 19.1862C16.9188 20 15.2792 20 12 20C8.72077 20 7.08116 20 5.91891 19.1862C5.48891 18.8851 5.1149 18.5111 4.81382 18.0811C4 16.9188 4 15.2792 4 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}]],Hc=[[`path`,{d:`M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 2C11.6227 2.33333 11.0945 3.2 12 4M12 20C12.3773 20.3333 12.9055 21.2 12 22M19.5 4.50271C18.9685 4.46982 17.9253 4.72293 18.0042 5.99847M5.49576 17.5C5.52865 18.0315 5.27555 19.0747 4 18.9958M5.00271 4.5C4.96979 5.03202 5.22315 6.0763 6.5 5.99729M18 17.5026C18.5315 17.4715 19.5747 17.7108 19.4958 18.9168M22 12C21.6667 11.6227 20.8 11.0945 20 12M4 11.5C3.66667 11.8773 2.8 12.4055 2 11.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],Uc=[[`path`,{d:`M13 11L18 6`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 7L17 5L19.5 3.5L20.5 4.5L19 7Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M4.02513 8.97487C3.01416 7.96391 2.75095 6.48836 3.23548 5.23548L4.65748 6.65748H6.65748V4.65748L5.23548 3.23548C6.48836 2.75095 7.96391 3.01416 8.97487 4.02513C9.98621 5.03647 10.2493 6.51274 9.76398 7.76593L16.2341 14.236C17.4873 13.7507 18.9635 14.0138 19.9749 15.0251C20.9858 16.0361 21.2491 17.5116 20.7645 18.7645L19.3425 17.3425L17.3425 17.3425V19.3425L18.7645 20.7645C17.5116 21.2491 16.0361 20.9858 15.0251 19.9749C14.0145 18.9643 13.7511 17.4895 14.2349 16.2369L7.76312 9.76507C6.51053 10.2489 5.03571 9.98546 4.02513 8.97487Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M12.203 14.5L6.59897 20.1041C6.07115 20.6319 5.2154 20.6319 4.68758 20.1041L3.89586 19.3124C3.36805 18.7846 3.36805 17.9288 3.89586 17.401L9.49994 11.7969`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Wc=[[`path`,{d:`M6 5.5C6 4.56538 6 4.09808 6.20096 3.75C6.33261 3.52197 6.52197 3.33261 6.75 3.20096C7.09808 3 7.56538 3 8.5 3H11.5C12.4346 3 12.9019 3 13.25 3.20096C13.478 3.33261 13.6674 3.52197 13.799 3.75C14 4.09808 14 4.56538 14 5.5C14 6.43462 14 6.90192 13.799 7.25C13.6674 7.47803 13.478 7.66739 13.25 7.79904C12.9019 8 12.4346 8 11.5 8H8.5C7.56538 8 7.09808 8 6.75 7.79904C6.52197 7.66739 6.33261 7.47803 6.20096 7.25C6 6.90192 6 6.43462 6 5.5Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6 15.5C6 14.5654 6 14.0981 6.20096 13.75C6.33261 13.522 6.52197 13.3326 6.75 13.201C7.09808 13 7.56538 13 8.5 13H11.5C12.4346 13 12.9019 13 13.25 13.201C13.478 13.3326 13.6674 13.522 13.799 13.75C14 14.0981 14 14.5654 14 15.5C14 16.4346 14 16.9019 13.799 17.25C13.6674 17.478 13.478 17.6674 13.25 17.799C12.9019 18 12.4346 18 11.5 18H8.5C7.56538 18 7.09808 18 6.75 17.799C6.52197 17.6674 6.33261 17.478 6.20096 17.25C6 16.9019 6 16.4346 6 15.5Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M20.8398 17.1408C21.6133 16.3673 22 15.9806 22 15.5C22 15.0194 21.6133 14.6327 20.8398 13.8592L20.6408 13.6602C19.8673 12.8867 19.4806 12.5 19 12.5C18.5194 12.5 18.1327 12.8867 17.3592 13.6602L17.1602 13.8592C16.3867 14.6327 16 15.0194 16 15.5C16 15.9806 16.3867 16.3673 17.1602 17.1408L17.3592 17.3398C18.1327 18.1133 18.5194 18.5 19 18.5C19.4806 18.5 19.8673 18.1133 20.6408 17.3398L20.8398 17.1408Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6.006 5.5H2.00781M2.00781 5.5V2M2.00781 5.5V12C2.00781 13.1037 1.85651 14.4679 2.89627 15.1629C3.40049 15.5 4.1024 15.5 5.50623 15.5M14.0024 15.5H16.0015M19.0001 12.5V9.5C19.0001 7.61438 19.0001 6.67157 18.4146 6.08579C17.8291 5.5 16.8867 5.5 15.0019 5.5H14.0024`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M22.0001 22C21.0682 22 20.6023 22 20.2348 21.8695C19.7447 21.6955 19.3554 21.3618 19.1524 20.9417C19.0001 20.6267 19.0001 20.2273 19.0001 19.4286V19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],Gc=[[`path`,{d:`M20.3584 13.3567C19.1689 14.546 16.9308 14.4998 13.4992 14.4998C11.2914 14.4998 9.50138 12.7071 9.50024 10.4993C9.50024 7.07001 9.454 4.83065 10.6435 3.64138C11.8329 2.45212 12.3583 2.50027 17.6274 2.50027C18.1366 2.49809 18.3929 3.11389 18.0329 3.47394L15.3199 6.18714C14.6313 6.87582 14.6294 7.99233 15.3181 8.68092C16.0068 9.36952 17.1234 9.36959 17.8122 8.68109L20.5259 5.96855C20.886 5.60859 21.5019 5.86483 21.4997 6.37395C21.4997 11.6422 21.5479 12.1675 20.3584 13.3567Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M13.5 14.5L7.32842 20.6716C6.22386 21.7761 4.433 21.7761 3.32843 20.6716C2.22386 19.567 2.22386 17.7761 3.32843 16.6716L9.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5.50896 18.5H5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,key:`2`}]],Kc=Object.defineProperty,qc=(e,t)=>Kc(e,`name`,{value:t,configurable:!0});function Jc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}qc(Jc,`setRef`);function Yc(...e){return t=>{let n=!1,r=e.map(e=>{let r=Jc(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():Jc(e[t],null)}}}}qc(Yc,`composeRefs`);function Xc(...e){return C.useCallback(Yc(...e),e)}qc(Xc,`useComposedRefs`);var Zc=Object.defineProperty,Qc=(e,t)=>Zc(e,`name`,{value:t,configurable:!0});function $c(e){let t=C.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];cl(r)&&typeof fl==`function`&&(r=fl(r._payload)),C.Children.forEach(r,e=>{if(ol(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;cl(n)&&typeof fl==`function`&&(n=fl(n._payload)),a=rl(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=C.cloneElement(a,void 0,s):!o&&C.Children.count(r)===1&&C.isValidElement(r)&&(a=r);let c=a?al(a):void 0,l=Xc(n,c);if(!a){if(r||r===0)throw Error(o?dl(e):ul(e));return r}let u=il(i,a.props??{});return a.type!==C.Fragment&&(u.ref=n?l:c),C.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Qc($c,`createSlot`);var el=$c(`Slot`),tl=Symbol.for(`radix.slottable`);function nl(e){let t=Qc(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=tl,t}Qc(nl,`createSlottable`);var rl=Qc((e,t)=>{if(`child`in e.props){let t=e.props.child;return C.isValidElement(t)?C.cloneElement(t,void 0,e.props.children(t.props.children)):null}return C.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function il(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(` `))}return{...e,...n}}Qc(il,`mergeProps`);function al(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)}Qc(al,`getElementRef`);function ol(e){return C.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===tl}Qc(ol,`isSlottable`);var sl=Symbol.for(`react.lazy`);function cl(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===sl&&`_payload`in e&&ll(e._payload)}Qc(cl,`isLazyComponent`);function ll(e){return typeof e==`object`&&!!e&&`then`in e}Qc(ll,`isPromiseLike`);var ul=Qc(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),dl=Qc(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),fl=C.use,pl=n(`inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-semibold shadow-none transition duration-200 ease-out active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-ring/35 focus-visible:ring-offset-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`border border-foreground/45 bg-foreground text-background hover:bg-foreground/90`,ghost:`border border-transparent bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground`,destructive:`border border-destructive bg-destructive text-destructive-foreground hover:bg-destructive/90`,secondary:`border border-border/80 bg-secondary text-secondary-foreground hover:border-muted-foreground/45 hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 px-3`,icon:`h-8 w-8 p-0`,sm:`h-8 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function ml({className:e,variant:t,size:n,asChild:r=!1,...i}){return(0,z.jsx)(r?el:`button`,{className:a(pl({variant:t,size:n,className:e})),...i})}var hl={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`},gl=(0,C.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n,absoluteStrokeWidth:r=!1,className:i=``,altIcon:a,showAlt:o=!1,icon:s,primaryColor:c,secondaryColor:l,disableSecondaryOpacity:u=!1,...d},f)=>{let p=n===void 0?void 0:r?Number(n)*24/Number(t):n,m=p===void 0?{}:{strokeWidth:p,stroke:`currentColor`};return(0,C.createElement)(`svg`,{ref:f,...hl,width:t,height:t,color:c||e,className:i,...m,...d},[...o&&a?a:s].sort(([,e],[,t])=>{let n=e.opacity!==void 0;return t.opacity===void 0?n?-1:0:1}).map(([t,n])=>{let r=n.opacity!==void 0,i=r&&!u?n.opacity:void 0,a=l?{...n.stroke===void 0?{fill:r?l:c||e}:{stroke:r?l:c||e}}:{};return(0,C.createElement)(t,{...n,...m,...a,opacity:i,key:n.key})}))});gl.displayName=`HugeiconsIcon`;function _l({color:e=`currentColor`,strokeWidth:t=1.5,...n}){return(0,z.jsx)(gl,{color:e,strokeWidth:t,...n})}function vl(e){return e.flatMap(e=>e.sources.map((t,n)=>({key:`${e.agentId}:${xl(t,n)}`,agentId:e.agentId,agentName:e.agentName??e.agentId,source:bl(t,n)})))}var yl=[{id:`static-context`,label:`Static Context`},{id:`dynamic-context`,label:`Dynamic Context`},{id:`dynamic-tools`,label:`Dynamic Tools`},{id:`retrieval-log`,label:`Retrieval Log`}];function bl(e,t){return e.sourceId===void 0?{...e,sourceId:Sl(e,t)}:e}function xl(e,t=0){return e.sourceId??Sl(e,t)}function Sl(e,t){switch(e.kind){case`static_context`:return`static-context`;case`dynamic_context`:return`dynamic-context-${e.registrationIndex??t}`;case`dynamic_tools`:return`dynamic-tools-${e.registrationIndex??t}`}}function Cl(e){switch(e){case`static_context`:return`Static context`;case`dynamic_context`:return`Dynamic context`;case`dynamic_tools`:return`Dynamic tools`}}function wl(e){switch(e){case`static-context`:return`static_context`;case`dynamic-context`:return`dynamic_context`;case`dynamic-tools`:return`dynamic_tools`;case`retrieval-log`:return}}function Tl(e){return yl.find(t=>t.id===e)?.label??`Knowledge`}function El(e){let t=Dl(e.icon);return(0,z.jsxs)(ml,{className:a(`studio-sidebar-nav-button h-9 min-h-9 w-full justify-start gap-3 rounded-lg bg-transparent px-2.5 py-0.5 text-base font-medium text-sidebar-foreground/62 shadow-none transition duration-200 hover:text-sidebar-foreground active:translate-y-px [&_svg]:h-[17px] [&_svg]:w-[17px]`,e.active&&`studio-sidebar-nav-button-active text-sidebar-accent-foreground`),variant:`ghost`,type:`button`,disabled:e.disabled,onClick:e.onClick,children:[(0,z.jsx)(_l,{icon:t}),(0,z.jsx)(`span`,{children:e.label})]})}function Dl(e){switch(e){case`activity`:return rc;case`bot`:return Lc;case`book-open-text`:return dc;case`container`:return _c;case`database`:return Sc;case`database-lightning`:return xc;case`gauge`:return Oc;case`list`:return Ac;case`message`:return mc;case`plug`:return Fc;case`search-list`:return Rc;case`shield`:return Bc;case`tools`:return Uc;case`wrench`:return Gc;case`workflow`:return Wc}}var Ol={"static-context":`book-open-text`,"dynamic-context":`database-lightning`,"dynamic-tools":`tools`,"retrieval-log":`search-list`};function kl(e){return(0,z.jsxs)(`aside`,{className:`flex h-[100dvh] min-h-0 flex-col overflow-hidden border-r border-sidebar-border bg-sidebar text-sidebar-foreground`,children:[(0,z.jsx)(`div`,{className:`flex h-15 items-center px-4`,children:(0,z.jsxs)(`div`,{className:`studio-logo-lockup min-w-0`,children:[(0,z.jsx)(`img`,{className:`h-auto w-[92px] shrink-0 object-contain`,src:Fs,alt:`Anvia`}),(0,z.jsx)(`span`,{className:`studio-logo-badge`,children:`Studio`})]})}),(0,z.jsxs)(`nav`,{className:`grid gap-0.5 px-3 py-3`,"aria-label":`Main`,children:[(0,z.jsx)(`div`,{className:`px-2.5 pb-1.5 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground opacity-50`,children:`Workspace`}),(0,z.jsx)(El,{active:e.activePage===`playground`,disabled:!e.hasAgents,icon:`message`,label:`Chat`,onClick:()=>e.onNavigate(`playground`)}),(0,z.jsx)(El,{active:e.activePage===`pipelines`,disabled:!e.pipelinesEnabled,icon:`workflow`,label:`Pipelines`,onClick:()=>e.onNavigate(`pipelines`)}),(0,z.jsx)(El,{active:e.activePage===`evals`,disabled:!e.evalsEnabled,icon:`gauge`,label:`Evals`,onClick:()=>e.onNavigate(`evals`)}),(0,z.jsx)(El,{active:e.activePage===`sessions`,disabled:!e.sessionsEnabled,icon:`list`,label:`Sessions`,onClick:()=>e.onNavigate(`sessions`)}),(0,z.jsx)(El,{active:e.activePage===`tracing`,disabled:!e.tracesEnabled,icon:`activity`,label:`Traces`,onClick:()=>e.onNavigate(`tracing`)})]}),(0,z.jsxs)(`nav`,{className:`grid gap-0.5 px-3 py-3`,"aria-label":`Studio`,children:[(0,z.jsx)(`div`,{className:`px-2.5 pb-1.5 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground opacity-50`,children:`Inspect`}),(0,z.jsx)(El,{active:e.activePage===`agents`,icon:`bot`,label:`Studio`,onClick:()=>e.onNavigate(`agents`)}),(0,z.jsx)(El,{active:e.activePage===`tools`,disabled:!e.toolsEnabled,icon:`wrench`,label:`Tools`,onClick:()=>e.onNavigate(`tools`)}),(0,z.jsx)(El,{active:e.activePage===`sandboxes`,disabled:!e.sandboxesEnabled,icon:`container`,label:`Sandboxes`,onClick:()=>e.onNavigate(`sandboxes`)}),(0,z.jsx)(El,{active:e.activePage===`mcps`,disabled:!e.mcpsEnabled,icon:`plug`,label:`MCPs`,onClick:()=>e.onNavigate(`mcps`)}),yl.map(t=>(0,z.jsx)(El,{active:e.activePage===`knowledge`&&e.knowledgeTab===t.id,disabled:!e.knowledgeEnabled,icon:Ol[t.id],label:t.label,onClick:()=>e.onNavigateKnowledgeTab(t.id)},t.id)),(0,z.jsx)(El,{active:e.activePage===`memory`,disabled:!e.memoryEnabled,icon:`database`,label:`Memory`,onClick:()=>e.onNavigate(`memory`)}),(0,z.jsx)(El,{active:e.activePage===`status`,disabled:!e.statusEnabled,icon:`gauge`,label:`Status`,onClick:()=>e.onNavigate(`status`)})]}),(0,z.jsxs)(`div`,{className:`mt-auto px-3 py-3`,children:[(0,z.jsx)(`nav`,{className:`grid gap-1`,"aria-label":`Anvia links`,children:(0,z.jsx)(jl,{href:`https://anvia.dev/docs`,label:`Anvia Docs`})}),(0,z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:e.status})]})]})}function Al(e){return(0,z.jsx)(`header`,{className:`grid min-h-13 border-b border-border bg-background/88 backdrop-blur`,children:(0,z.jsxs)(`div`,{className:`grid min-h-13 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 py-0 pl-4 pr-6`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:[(0,z.jsx)(`span`,{className:`text-foreground`,children:e.activePage===`playground`?`Agents`:`Studio`}),(0,z.jsx)(`span`,{className:`text-muted-foreground`,children:`/`}),(0,z.jsx)(`span`,{className:`truncate`,children:e.selectedAgentLabel})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(ml,{"aria-label":e.theme===`dark`?`Switch to light theme`:`Switch to dark theme`,className:`h-8 min-h-8 w-8 border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-muted/45 hover:text-foreground`,title:e.theme===`dark`?`Switch to light theme`:`Switch to dark theme`,type:`button`,variant:`ghost`,size:`icon`,onClick:e.onToggleTheme,children:e.theme===`dark`?(0,z.jsx)(_l,{icon:Hc,"aria-hidden":`true`}):(0,z.jsx)(_l,{icon:Mc,"aria-hidden":`true`})}),(0,z.jsx)(ml,{className:`h-8 min-h-8 rounded-lg border border-white bg-white px-3 text-xs text-black shadow-none [box-shadow:none] hover:border-white hover:bg-white/90 hover:text-black focus-visible:ring-0 active:bg-white/85 disabled:bg-muted disabled:text-muted-foreground`,type:`button`,variant:`ghost`,disabled:!e.sessionsEnabled,onClick:e.onNewSession,children:`New session`})]})]})})}function jl(e){return(0,z.jsxs)(`a`,{className:`flex h-8 min-h-8 items-center justify-between rounded-lg px-2 text-xs font-semibold text-sidebar-foreground/62 transition duration-200 hover:bg-sidebar-accent hover:text-sidebar-foreground`,href:e.href,target:`_blank`,rel:`noreferrer`,children:[(0,z.jsx)(`span`,{children:e.label}),(0,z.jsx)(_l,{icon:Tc,"aria-hidden":`true`,className:`h-3 w-3 text-muted-foreground`})]})}function Ml(){let e=Bs();return(0,z.jsxs)(`div`,{className:`grid h-[100dvh] min-h-0 overflow-hidden bg-background text-foreground lg:grid-cols-[228px_minmax(0,1fr)]`,children:[(0,z.jsx)(kl,{activePage:e.activePage,evalsEnabled:e.evalsEnabled,hasAgents:e.hasAgents,knowledgeEnabled:e.knowledgeEnabled,mcpsEnabled:e.mcpsEnabled,memoryEnabled:e.memoryEnabled,pipelinesEnabled:e.pipelinesEnabled,sandboxesEnabled:e.sandboxesEnabled,sessionsEnabled:e.sessionsEnabled,status:e.status,statusEnabled:e.statusEnabled,toolsEnabled:e.toolsEnabled,tracesEnabled:e.tracesEnabled,knowledgeTab:e.knowledgeTab,onNavigate:e.navigatePage,onNavigateKnowledgeTab:e.navigateKnowledgeTab}),(0,z.jsxs)(`main`,{className:`grid h-[100dvh] min-w-0 grid-rows-[52px_minmax(0,1fr)] overflow-hidden bg-background/80`,children:[(0,z.jsx)(Al,{activePage:e.activePage,selectedAgentLabel:e.activePage===`sandboxes`?`Sandboxes`:e.selectedAgent?.name??e.selectedAgent?.id??`Agent`,sessionsEnabled:e.sessionsEnabled,theme:e.theme,onNavigate:e.navigatePage,onNewSession:()=>e.startNewChat(),onToggleTheme:e.toggleTheme}),(0,z.jsx)(Vr,{})]}),(0,z.jsx)(C.Suspense,{fallback:null,children:(0,z.jsx)($s,{session:e.deleteCandidate,onOpenChange:t=>{t||e.setDeleteCandidate(void 0)},onConfirm:t=>{e.sessions.deleteSession(t).finally(()=>{e.setDeleteCandidate(void 0)})}})})]})}function Nl(e){let t=Bs(),{activateRoute:n}=t;return(0,C.useEffect)(()=>{n(e)},[n,e]),t}function Pl(e){switch(e){case`dynamic-context`:case`dynamic-tools`:case`retrieval-log`:case`static-context`:return e;default:return`static-context`}}function Fl(){let e=Nl(`agents`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Gs,{agents:e.agents,selectedAgentId:e.selectedAgentId})})}function Il(e){let[t,n]=(0,C.useState)(``),[r,i]=(0,C.useState)(),[a,o]=(0,C.useState)(`idle`);async function c(){let n=t||e.evals[0]?.id||``;if(!(n.length===0||a===`running`)){o(`running`),i(void 0),e.onError(``);try{let t=await fetch(`/evals/${encodeURIComponent(n)}/runs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({})});if(!t.ok)throw Error(await Ho(t,`Eval run failed`));i(await t.json()),e.onStatus(`Connected`)}catch(t){e.onError(s(t))}finally{o(`idle`)}}}return(0,z.jsx)(Ks,{evals:e.evals,selectedEvalId:t,enabled:e.enabled,runState:a,result:r,onSelectEval:e=>{n(e),i(void 0)},onRun:()=>void c()})}function Ll(){let e=Nl(`evals`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Il,{evals:e.evals,enabled:e.evalsEnabled,onError:e.setError,onStatus:e.setStatus})})}function Rl(e){let[t,n]=(0,C.useState)(``),[r,i]=(0,C.useState)(),[a,o]=(0,C.useState)(`idle`),c=(0,C.useCallback)(async t=>{if(!e.enabled||t.length===0){i(void 0);return}o(`loading`);try{let e=await fetch(`/agents/${encodeURIComponent(t)}/tools`);if(!e.ok)throw Error(`Tools failed with HTTP ${e.status}`);i(await e.json())}catch(t){e.onError(s(t)),i(void 0)}finally{o(`idle`)}},[e.enabled,e.onError]);return(0,C.useEffect)(()=>{e.active&&c(t||e.selectedAgentId)},[e.active,c,e.selectedAgentId,t]),(0,z.jsx)(tc,{agents:e.agents,selectedAgentId:t||e.selectedAgentId,summary:r,enabled:e.enabled,loading:a===`loading`,onSelectAgent:e=>{n(e),c(e)}})}function zl(e){let[t,n]=(0,C.useState)(``),[r,i]=(0,C.useState)(),[a,o]=(0,C.useState)(`idle`),c=(0,C.useCallback)(async t=>{if(!e.enabled||t.length===0){i(void 0);return}o(`loading`);try{let e=await fetch(`/agents/${encodeURIComponent(t)}/mcps`);if(!e.ok)throw Error(`MCPs failed with HTTP ${e.status}`);i(await e.json())}catch(t){e.onError(s(t)),i(void 0)}finally{o(`idle`)}},[e.enabled,e.onError]);return(0,C.useEffect)(()=>{e.active&&c(t||e.selectedAgentId)},[e.active,c,t,e.selectedAgentId]),(0,z.jsx)(Js,{agents:e.agents,selectedAgentId:t||e.selectedAgentId,summary:r,enabled:e.enabled,loading:a===`loading`,onSelectAgent:e=>{n(e),c(e)}})}function G(e){let[t,n]=(0,C.useState)(),[r,i]=(0,C.useState)(`idle`),a=(0,C.useCallback)(async()=>{if(!e.enabled){n(void 0);return}i(`loading`);try{let e=await fetch(`/knowledge?limit=25`);if(!e.ok)throw Error(`Knowledge failed with HTTP ${e.status}`);n(await e.json())}catch(t){e.onError(s(t))}finally{i(`idle`)}},[e.enabled,e.onError]);return(0,C.useEffect)(()=>{e.active&&a()},[e.active,a]),(0,z.jsx)(qs,{activeTab:e.activeTab,enabled:e.enabled,summary:t,loading:r===`loading`,onOpenTrace:e.onOpenTrace,onRefresh:()=>void a()})}function K(){let e=Nl(`knowledge`),{setKnowledgeTab:t}=e,n=Pl(cr({strict:!1}).tab);return(0,C.useEffect)(()=>{t(n)},[t,n]),(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(G,{active:!0,activeTab:n,enabled:e.knowledgeEnabled,onError:e.setError,onOpenTrace:e.traces.selectTrace})})}function q(){let e=Nl(`mcps`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(zl,{active:!0,agents:e.agents,enabled:e.mcpsEnabled,selectedAgentId:e.selectedAgent?.id||e.selectedAgentId,onError:e.setError})})}function J(){let e=Nl(`memory`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Ys,{agents:e.agents,enabled:e.memoryEnabled})})}var Y=da({endpoint:e=>e.endpoint,method:`POST`,format:`jsonl`,headers:{"content-type":`application/json`},body:e=>JSON.stringify(e.body)});function Bl(e){let[t,n]=(0,C.useState)(``),[r,i]=(0,C.useState)(),[a,o]=(0,C.useState)([]),[c,l]=(0,C.useState)([]),[u,d]=(0,C.useState)(`"Hello from Studio"`),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(``),[g,_]=(0,C.useState)(`idle`),[v,y]=(0,C.useState)(`idle`),[b,x]=(0,C.useState)(`idle`),[S,w]=(0,C.useState)(`idle`),T=(0,C.useRef)(0),E=(0,C.useRef)(0),D=(0,C.useCallback)(async t=>{if(!e.enabled||t.length===0)return E.current+=1,o([]),[];let n=E.current+1;E.current=n,y(`loading`);try{let e=new URLSearchParams({limit:`1000`}),r=await fetch(`/pipelines/${encodeURIComponent(t)}/logs?${e}`);if(!r.ok)throw Error(`Pipeline logs failed with HTTP ${r.status}`);let i=await r.json();return E.current===n&&o(i.logs),i.logs}catch(t){return E.current===n&&(e.onError(s(t)),o([])),[]}finally{E.current===n&&y(`idle`)}},[e.enabled,e.onError]),O=(0,C.useCallback)(async t=>{if(!e.enabled||t.length===0)return l([]),[];x(`loading`);try{let e=new URLSearchParams({limit:`50`}),n=await fetch(`/pipelines/${encodeURIComponent(t)}/runs?${e}`);if(!n.ok)throw Error(`Pipeline runs failed with HTTP ${n.status}`);let r=await n.json();return l(r.runs),r.runs}catch(t){return e.onError(s(t)),l([]),[]}finally{x(`idle`)}},[e.enabled,e.onError]),k=(0,C.useCallback)(async t=>{if(!e.enabled||t.length===0){T.current+=1,i(void 0),o([]),l([]);return}let r=T.current+1;T.current=r,_(`loading`),e.onError(``);try{let e=await fetch(`/pipelines/${encodeURIComponent(t)}`);if(!e.ok)throw Error(`Pipeline load failed with HTTP ${e.status}`);let a=await e.json();if(T.current!==r)return;n(t),i(a),await Promise.all([D(t),O(t)])}catch(t){T.current===r&&(e.onError(s(t)),i(void 0))}finally{T.current===r&&_(`idle`)}},[D,O,e.enabled,e.onError]);(0,C.useEffect)(()=>{if(!e.active)return;let n=t||e.pipelines[0]?.id||``;n.length>0&&k(n)},[e.active,e.pipelines,k,t]);async function A(e){for await(let t of e){if(Qr(t)){t.log.runId!==void 0&&h(e=>e||t.log.runId||``),ee(t.log),await is();continue}if($r(t)){p(Hl(t.output)),await is();continue}if(ei(t))throw Error(JSON.stringify(t.error))}}async function j(){let n=t||e.pipelines[0]?.id||``;if(n.length===0||S===`running`)return;let r;try{r=JSON.parse(u)}catch{e.onError(`Pipeline input must be valid JSON`);return}w(`running`),p(``),h(``),e.onError(``);try{await A(Y.send({endpoint:`/pipelines/${encodeURIComponent(n)}/runs`,body:{input:r,stream:!0,metadata:{source:`anvia-studio`}}})),await Promise.all([D(n),O(n)]),e.onStatus(`Connected`)}catch(t){e.onError(Vl(t,`Pipeline run failed`))}finally{w(`idle`)}}async function M(n){let r=t||e.pipelines[0]?.id||``;if(!(r.length===0||n.length===0||S===`running`)){w(`running`),p(``),h(``),e.onError(``);try{await A(Y.send({endpoint:`/pipelines/${encodeURIComponent(r)}/runs/${encodeURIComponent(n)}/replay`,body:{stream:!0,metadata:{source:`anvia-studio`}}})),await Promise.all([D(r),O(r)]),e.onStatus(`Connected`)}catch(t){e.onError(Vl(t,`Pipeline replay failed`))}finally{w(`idle`)}}}function N(e){n(e),p(``),h(``),k(e)}function ee(e){o(t=>t.some(t=>t.id===e.id)?t:[...t,e].sort((e,t)=>e.sequence-t.sequence))}return{selectedPipelineId:t,pipelineDetail:r,pipelineLogs:a,pipelineRuns:c,activePipelineRunId:m,pipelineRunInput:u,pipelineRunOutput:f,pipelineDetailLoadState:g,pipelineLogLoadState:v,pipelineRunLoadState:b,pipelineRunState:S,setPipelineRunInput:d,selectPipeline:N,runPipeline:j,replayPipelineRun:M}}function Vl(e,t){return e instanceof Yi?Wo(e,t):s(e)}function Hl(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function Ul(e){let t=Bl({active:e.active,enabled:e.enabled,pipelines:e.pipelines,onError:e.onError,onStatus:e.onStatus});return(0,z.jsx)(Xs,{pipelines:e.pipelines,selectedPipelineId:t.selectedPipelineId,detail:t.pipelineDetail,logs:t.pipelineLogs,activeRunId:t.activePipelineRunId,runs:t.pipelineRuns,enabled:e.enabled,detailLoading:t.pipelineDetailLoadState===`loading`,logsLoading:t.pipelineLogLoadState===`loading`,runsLoading:t.pipelineRunLoadState===`loading`,runState:t.pipelineRunState,runInput:t.pipelineRunInput,runOutput:t.pipelineRunOutput,theme:e.theme,activeTab:e.activeTab,onSelectPipeline:t.selectPipeline,onRunInputChange:t.setPipelineRunInput,onRun:()=>void t.runPipeline(),onTabChange:e.onTabChange,onReplayRun:e=>void t.replayPipelineRun(e)})}function Wl(){let e=Nl(`pipelines`),[t,n]=(0,C.useState)(()=>Gl());(0,C.useEffect)(()=>{function e(){n(Gl())}return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let r=(0,C.useCallback)(e=>{n(e);let t=new URL(window.location.href);t.searchParams.set(`tab`,e);let r=`${t.pathname}${t.search}${t.hash}`;`${window.location.pathname}${window.location.search}${window.location.hash}`!==r&&window.history.pushState(null,``,r)},[]);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Ul,{active:!0,activeTab:t,pipelines:e.pipelines,enabled:e.pipelinesEnabled,theme:e.theme,onError:e.setError,onStatus:e.setStatus,onTabChange:r})})}function Gl(){return Kl(window.location.search)}function Kl(e){let t=new URLSearchParams(e).get(`tab`);return t===`metadata`||t===`runs`||t===`logs`?t:`input`}var ql=Object.defineProperty,Jl=(e,t)=>ql(e,`name`,{value:t,configurable:!0});function Yl(e,[t,n]){return Math.min(n,Math.max(t,e))}Jl(Yl,`clamp`);var Xl=Object.defineProperty,Zl=(e,t)=>Xl(e,`name`,{value:t,configurable:!0}),Ql=!!(typeof window<`u`&&window.document&&window.document.createElement);function $l(e,t,{checkForDefaultPrevented:n=!0}={}){return Zl(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Zl($l,`composeEventHandlers`);function eu(e){if(!Ql)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Zl(eu,`getOwnerWindow`);function tu(e){if(!Ql)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Zl(tu,`getOwnerDocument`);function nu(e,t=!1){let{activeElement:n}=tu(e);if(!n?.nodeName)return null;if(ru(n)&&n.contentDocument)return nu(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=tu(n).getElementById(e);if(t)return t}}return n}Zl(nu,`getActiveElement`);function ru(e){return e.tagName===`IFRAME`}Zl(ru,`isFrame`);var iu=Object.defineProperty,X=(e,t)=>iu(e,`name`,{value:t,configurable:!0});function au(e,t){let n=C.createContext(t);n.displayName=e+`Context`;let r=X(e=>{let{children:t,...r}=e,i=C.useMemo(()=>r,Object.values(r));return(0,z.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=C.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return X(i,`useContext`),[r,i]}X(au,`createContext`);function ou(e,t=[]){let n=[];function r(t,r){let i=C.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=X(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=C.useMemo(()=>o,Object.values(o));return(0,z.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=C.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return X(s,`useContext`),[o,s]}X(r,`createContext`);let i=X(()=>{let t=n.map(e=>C.createContext(e));return X(function(n){let r=n?.[e]||t;return C.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,su(i,...t)]}X(ou,`createContextScope`);function su(...e){let t=e[0];if(e.length===1)return t;let n=X(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return X(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}X(su,`composeContextScopes`);var cu=Object.defineProperty,lu=(e,t)=>cu(e,`name`,{value:t,configurable:!0});function uu(e){let t=e+`CollectionProvider`,[n,r]=ou(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=lu(e=>{let{scope:t,children:n}=e,r=C.useRef(null),a=C.useRef(new Map).current;return(0,z.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=$c(s),l=C.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,z.jsx)(c,{ref:Xc(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=$c(u),p=C.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=C.useRef(null),s=Xc(t,o),c=a(u,n);return C.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,z.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return C.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return lu(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}lu(uu,`createCollection`);var du=new WeakMap,fu=class e extends Map{static{lu(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],du.set(this,!0)}set(e,t){return du.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=hu(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t===void 0?!1:this.delete(t)}at(e){let t=pu(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=pu(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return pu(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function pu(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=mu(e,t);return n===-1?void 0:e[n]}lu(pu,`at`);function mu(e,t){let n=e.length,r=hu(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}lu(mu,`toSafeIndex`);function hu(e){return e!==e||e===0?0:Math.trunc(e)}lu(hu,`toSafeInteger`);function gu(e){let t=e+`CollectionProvider`,[n,r]=ou(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new fu,setItemMap:lu(()=>void 0,`setItemMap`)}),o=lu(({state:e,...t})=>e?(0,z.jsx)(c,{...t,state:e}):(0,z.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=lu(e=>{let t=h();return(0,z.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=lu(e=>{let{scope:t,children:n,state:r}=e,a=C.useRef(null),[o,s]=C.useState(null),c=Xc(a,s),[l,u]=r;return C.useEffect(()=>{if(!o)return;let e=bu(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,z.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=$c(l),d=C.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,z.jsx)(u,{ref:Xc(t,a(l,n).collectionRef),children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=$c(f),m=C.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=C.useRef(null),[s,c]=C.useState(null),l=Xc(t,o,c),{setItemMap:u}=a(f,n),d=C.useRef(i);_u(d.current,i)||(d.current=i);let m=d.current;return C.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(yu):(t.set(s,{...e,element:s}),t.toSorted(yu)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new fu(e)))}},[s,m,u]),(0,z.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return C.useState(new fu)}lu(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return lu(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}lu(gu,`createCollection`);function _u(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}lu(_u,`shallowEqual`);function vu(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}lu(vu,`isElementPreceding`);function yu(e,t){return!e[1].element||!t[1].element?0:vu(e[1].element,t[1].element)?-1:1}lu(yu,`sortByDocumentPosition`);function bu(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}lu(bu,`getChildListObserver`);var xu=Object.defineProperty,Su=(e,t)=>xu(e,`name`,{value:t,configurable:!0}),Cu=C.createContext(void 0);function wu(e){let t=C.useContext(Cu);return e||t||`ltr`}Su(wu,`useDirection`);var Tu=Object.defineProperty,Eu=(e,t)=>Tu(e,`name`,{value:t,configurable:!0}),Du=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=$c(`Primitive.${t}`),r=C.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,z.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ou(e,t){e&&pr.flushSync(()=>e.dispatchEvent(t))}Eu(Ou,`dispatchDiscreteCustomEvent`);var ku=Object.defineProperty,Au=(e,t)=>ku(e,`name`,{value:t,configurable:!0});function ju(e){let t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>((...e)=>t.current?.(...e)),[])}Au(ju,`useCallbackRef`);var Mu=Object.defineProperty,Nu=(e,t)=>Mu(e,`name`,{value:t,configurable:!0}),Pu=`dismissableLayer.update`,Fu=`dismissableLayer.pointerDownOutside`,Iu=`dismissableLayer.focusOutside`,Lu,Ru=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),zu=C.forwardRef(Nu(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=C.useContext(Ru),[d,f]=C.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=C.useState({}),h=Xc(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=C.useRef(!1),w=Hu(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:C.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),T=Uu(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?y===g.length-1:!1,D=ju(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return C.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),C.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Lu=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Wu(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Lu))}},[d,p,n,u]),C.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Wu())},[d,u]),C.useEffect(()=>{let e=Nu(()=>m({}),`handleUpdate`);return document.addEventListener(Pu,e),()=>document.removeEventListener(Pu,e)},[]),(0,z.jsx)(Du.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:$l(e.onFocusCapture,T.onFocusCapture),onBlurCapture:$l(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:$l(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Bu(){let e=C.useContext(Ru),[t,n]=C.useState(null);return C.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Nu(Bu,`useDismissableLayerSurface`);var Vu=Nu(()=>!0,`IS_TRUE`);function Hu(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Vu}=t,s=ju(e),c=C.useRef(!1),l=C.useRef(!1),u=C.useRef(new Map),d=C.useRef(()=>{});return C.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Nu(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Nu(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)}Nu(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Nu(p,`handleInteractionBubble`);let m=Nu(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Z(Fu,s,p,{discrete:!0})};if(Nu(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:Nu(()=>c.current=!0,`onPointerDownCapture`)}}Nu(Hu,`usePointerDownOutside`);function Uu(e,t=globalThis?.document){let n=ju(e),r=C.useRef(!1);return C.useEffect(()=>{let e=Nu(e=>{e.target&&!r.current&&Z(Iu,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Nu(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Nu(()=>r.current=!1,`onBlurCapture`)}}Nu(Uu,`useFocusOutside`);function Wu(){let e=new CustomEvent(Pu);document.dispatchEvent(e)}Nu(Wu,`dispatchUpdate`);function Z(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?Ou(i,a):i.dispatchEvent(a)}Nu(Z,`handleAndDispatchCustomEvent`);var Gu=Object.defineProperty,Ku=(e,t)=>Gu(e,`name`,{value:t,configurable:!0}),qu=0,Ju=null;function Yu(e){return Xu(),e.children}Ku(Yu,`FocusGuards`);function Xu(){C.useEffect(()=>{Ju||={start:Zu(),end:Zu()};let{start:e,end:t}=Ju;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),qu++,()=>{qu===1&&(Ju?.start.remove(),Ju?.end.remove(),Ju=null),qu=Math.max(0,qu-1)}},[])}Ku(Xu,`useFocusGuards`);function Zu(){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}Ku(Zu,`createFocusGuard`);var Qu=Object.defineProperty,$u=(e,t)=>Qu(e,`name`,{value:t,configurable:!0}),ed=`focusScope.autoFocusOnMount`,td=`focusScope.autoFocusOnUnmount`,nd={bubbles:!1,cancelable:!0},rd=C.forwardRef($u(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=C.useState(null),l=ju(i),u=ju(a),d=C.useRef(null),f=Xc(t,c),p=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ud(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ud(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ud(s)};$u(e,`handleFocusIn`),$u(t,`handleFocusOut`),$u(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),C.useEffect(()=>{if(s){dd.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ed,nd);s.addEventListener(ed,l),s.dispatchEvent(t),t.defaultPrevented||(id(md(od(s)),{select:!0}),document.activeElement===e&&ud(s))}return()=>{s.removeEventListener(ed,l),setTimeout(()=>{let t=new CustomEvent(td,nd);s.addEventListener(td,u),s.dispatchEvent(t),t.defaultPrevented||ud(e??document.body,{select:!0}),s.removeEventListener(td,u),dd.remove(p)},0)}}},[s,l,u,p]);let m=C.useCallback(e=>{if(!n&&!r||p.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]=ad(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ud(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ud(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,z.jsx)(Du.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function id(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ud(r,{select:t}),document.activeElement!==n)return}$u(id,`focusFirst`);function ad(e){let t=od(e);return[sd(t,e),sd(t.reverse(),e)]}$u(ad,`getTabbableEdges`);function od(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:$u(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}$u(od,`getTabbableCandidates`);function sd(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):cd(r,{upTo:t})))return r}$u(sd,`findVisible`);function cd(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}$u(cd,`isHidden`);function ld(e){return e instanceof HTMLInputElement&&`select`in e}$u(ld,`isSelectableInput`);function ud(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ld(e)&&t&&e.select()}}$u(ud,`focus`);var dd=fd();function fd(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=pd(e,t),e.unshift(t)},remove(t){e=pd(e,t),e[0]?.resume()}}}$u(fd,`createFocusScopesStack`);function pd(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}$u(pd,`arrayRemove`);function md(e){return e.filter(e=>e.tagName!==`A`)}$u(md,`removeLinks`);var hd=globalThis?.document?C.useLayoutEffect:()=>{},gd=Object.defineProperty,_d=(e,t)=>gd(e,`name`,{value:t,configurable:!0}),vd=C.useId||(()=>void 0),yd=0;function Q(e){let[t,n]=C.useState(vd());return hd(()=>{e||n(e=>e??String(yd++))},[e]),e||(t?`radix-${t}`:``)}_d(Q,`useId`);var bd=[`top`,`right`,`bottom`,`left`],xd=Math.min,Sd=Math.max,Cd=Math.round,wd=Math.floor,Td=e=>({x:e,y:e}),Ed={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Dd(e,t,n){return Sd(e,xd(t,n))}function Od(e,t){return typeof e==`function`?e(t):e}function kd(e){return e.split(`-`)[0]}function Ad(e){return e.split(`-`)[1]}function jd(e){return e===`x`?`y`:`x`}function Md(e){return e===`y`?`height`:`width`}function $(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Nd(e){return jd($(e))}function Pd(e,t,n){n===void 0&&(n=!1);let r=Ad(e),i=Nd(e),a=Md(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ud(o)),[o,Ud(o)]}function Fd(e){let t=Ud(e);return[Id(e),t,Id(t)]}function Id(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ld=[`left`,`right`],Rd=[`right`,`left`],zd=[`top`,`bottom`],Bd=[`bottom`,`top`];function Vd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Rd:Ld:t?Ld:Rd;case`left`:case`right`:return t?zd:Bd;default:return[]}}function Hd(e,t,n,r){let i=Ad(e),a=Vd(kd(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Id)))),a}function Ud(e){let t=kd(e);return Ed[t]+e.slice(t.length)}function Wd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Wd(e)}function Kd(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 qd(e,t,n){let{reference:r,floating:i}=e,a=$(t),o=Nd(t),s=Md(o),c=kd(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}}switch(Ad(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Jd(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}=Od(t,e),p=Gd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Kd(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=Kd(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 Yd=50,Xd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Jd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=qd(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<Yd&&(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}=qd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Zd=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}=Od(e,t)||{};if(l==null)return{};let d=Gd(u),f={x:n,y:r},p=Nd(i),m=Md(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=xd(d[_],T),D=xd(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Dd(O,A,k),M=!c.arrow&&Ad(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Qd=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}=Od(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=kd(r),_=$(o),v=kd(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ud(o)]:Fd(o)),x=p!==`none`;!d&&x&&b.push(...Hd(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=Pd(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`&&_!==$(t))||T.every(e=>$(e.placement)===_?e.overflows[0]>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=$(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function $d(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ef(e){return bd.some(t=>e[t]>=0)}var tf=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Od(e,t);switch(i){case`referenceHidden`:{let e=$d(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ef(e)}}}case`escaped`:{let e=$d(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ef(e)}}}default:return{}}}}},nf=new Set([`left`,`top`]);async function rf(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=kd(n),s=Ad(n),c=$(n)===`y`,l=nf.has(o)?-1:1,u=a&&c?-1:1,d=Od(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var af=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await rf(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},of=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Od(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=$(kd(i)),p=jd(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Dd(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Dd(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},sf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Od(e,t),u={x:n,y:r},d=$(i),f=jd(d),p=u[f],m=u[d],h=Od(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=nf.has(kd(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},cf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Od(e,t),u=await o.detectOverflow(t,l),d=kd(i),f=Ad(i),p=$(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=xd(h-u[g],v),x=xd(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Sd(u.left,0),t=Sd(u.right,0),n=Sd(u.top,0),r=Sd(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Sd(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Sd(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function lf(){return typeof window<`u`}function uf(e){return pf(e)?(e.nodeName||``).toLowerCase():`#document`}function df(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ff(e){return((pf(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function pf(e){return lf()?e instanceof Node||e instanceof df(e).Node:!1}function mf(e){return lf()?e instanceof Element||e instanceof df(e).Element:!1}function hf(e){return lf()?e instanceof HTMLElement||e instanceof df(e).HTMLElement:!1}function gf(e){return!lf()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof df(e).ShadowRoot}function _f(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Of(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function vf(e){return/^(table|td|th)$/.test(uf(e))}function yf(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var bf=/transform|translate|scale|rotate|perspective|filter/,xf=/paint|layout|strict|content/,Sf=e=>!!e&&e!==`none`,Cf;function wf(e){let t=mf(e)?Of(e):e;return Sf(t.transform)||Sf(t.translate)||Sf(t.scale)||Sf(t.rotate)||Sf(t.perspective)||!Ef()&&(Sf(t.backdropFilter)||Sf(t.filter))||bf.test(t.willChange||``)||xf.test(t.contain||``)}function Tf(e){let t=Af(e);for(;hf(t)&&!Df(t);){if(wf(t))return t;if(yf(t))return null;t=Af(t)}return null}function Ef(){return Cf??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Cf}function Df(e){return/^(html|body|#document)$/.test(uf(e))}function Of(e){return df(e).getComputedStyle(e)}function kf(e){return mf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Af(e){if(uf(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||gf(e)&&e.host||ff(e);return gf(t)?t.host:t}function jf(e){let t=Af(e);return Df(t)?e.ownerDocument?e.ownerDocument.body:e.body:hf(t)&&_f(t)?t:jf(t)}function Mf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=jf(e),i=r===e.ownerDocument?.body,a=df(r);if(i){let e=Nf(a);return t.concat(a,a.visualViewport||[],_f(r)?r:[],e&&n?Mf(e):[])}else return t.concat(r,Mf(r,[],n))}function Nf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pf(e){let t=Of(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=hf(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Cd(n)!==a||Cd(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ff(e){return mf(e)?e:e.contextElement}function If(e){let t=Ff(e);if(!hf(t))return Td(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Pf(t),o=(a?Cd(n.width):n.width)/r,s=(a?Cd(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Lf=Td(0);function Rf(e){let t=df(e);return!Ef()||!t.visualViewport?Lf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==df(e)?!1:t}function Bf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ff(e),o=Td(1);t&&(r?mf(r)&&(o=If(r)):o=If(e));let s=zf(a,n,r)?Rf(a):Td(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){let e=df(a),t=r&&mf(r)?df(r):r,n=e,i=Nf(n);for(;i&&r&&t!==n;){let e=If(i),t=i.getBoundingClientRect(),r=Of(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=df(i),i=Nf(n)}}return Kd({width:u,height:d,x:c,y:l})}function Vf(e,t){let n=kf(e).scrollLeft;return t?t.left+n:Bf(ff(e)).left+n}function Hf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Vf(e,n),y:n.top+t.scrollTop}}function Uf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ff(r),s=t?yf(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Td(1),u=Td(0),d=hf(r);if((d||!d&&!a)&&((uf(r)!==`body`||_f(o))&&(c=kf(r)),d)){let e=Bf(r);l=If(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Hf(o,c):Td(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 Wf(e){return Array.from(e.getClientRects())}function Gf(e){let t=ff(e),n=kf(e),r=e.ownerDocument.body,i=Sd(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Sd(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Vf(e),s=-n.scrollTop;return Of(r).direction===`rtl`&&(o+=Sd(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Kf=25;function qf(e,t){let n=df(e),r=ff(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ef();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Vf(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Kf&&(a-=o)}else l<=Kf&&(a+=l);return{width:a,height:o,x:s,y:c}}function Jf(e,t){let n=Bf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=hf(e)?If(e):Td(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Yf(e,t,n){let r;if(t===`viewport`)r=qf(e,n);else if(t===`document`)r=Gf(ff(e));else if(mf(t))r=Jf(t,n);else{let n=Rf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Kd(r)}function Xf(e,t){let n=Af(e);return n===t||!mf(n)||Df(n)?!1:Of(n).position===`fixed`||Xf(n,t)}function Zf(e,t){let n=t.get(e);if(n)return n;let r=Mf(e,[],!1).filter(e=>mf(e)&&uf(e)!==`body`),i=null,a=Of(e).position===`fixed`,o=a?Af(e):e;for(;mf(o)&&!Df(o);){let t=Of(o),n=wf(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||_f(o)&&!n&&Xf(e,o))?r=r.filter(e=>e!==o):i=t,o=Af(o)}return t.set(e,r),r}function Qf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?yf(t)?[]:Zf(t,this._c):[].concat(n),r],o=Yf(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=Yf(t,a[e],i);s=Sd(n.top,s),c=xd(n.right,c),l=xd(n.bottom,l),u=Sd(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function $f(e){let{width:t,height:n}=Pf(e);return{width:t,height:n}}function ep(e,t,n){let r=hf(t),i=ff(t),a=n===`fixed`,o=Bf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Td(0);function l(){c.x=Vf(i)}if(r||!r&&!a)if((uf(t)!==`body`||_f(i))&&(s=kf(t)),r){let e=Bf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Hf(i,s):Td(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function tp(e){return Of(e).position===`static`}function np(e,t){if(!hf(e)||Of(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ff(e)===n&&(n=n.ownerDocument.body),n}function rp(e,t){let n=df(e);if(yf(e))return n;if(!hf(e)){let t=Af(e);for(;t&&!Df(t);){if(mf(t)&&!tp(t))return t;t=Af(t)}return n}let r=np(e,t);for(;r&&vf(r)&&tp(r);)r=np(r,t);return r&&Df(r)&&tp(r)&&!wf(r)?n:r||Tf(e)||n}var ip=async function(e){let t=this.getOffsetParent||rp,n=this.getDimensions,r=await n(e.floating);return{reference:ep(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ap(e){return Of(e).direction===`rtl`}var op={convertOffsetParentRelativeRectToViewportRelativeRect:Uf,getDocumentElement:ff,getClippingRect:Qf,getOffsetParent:rp,getElementRects:ip,getClientRects:Wf,getDimensions:$f,getScale:If,isElement:mf,isRTL:ap};function sp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cp(e,t){let n=null,r,i=ff(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=wd(d),h=wd(i.clientWidth-(u+f)),g=wd(i.clientHeight-(d+p)),_=wd(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Sd(0,xd(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!sp(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function lp(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=Ff(e),u=i||a?[...l?Mf(l):[],...t?Mf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cp(l,n):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?Bf(e):null;c&&g();function g(){let t=Bf(e);h&&!sp(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 up=af,dp=of,fp=Qd,pp=cf,mp=tf,hp=Zd,gp=sf,_p=(e,t,n)=>{let r=new Map,i={platform:op,...n},a={...i.platform,_c:r};return Xd(e,t,{...i,platform:a})},vp=typeof document<`u`?C.useLayoutEffect:function(){};function yp(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(!yp(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)&&!yp(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function bp(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xp(e,t){let n=bp(e);return Math.round(t*n)/n}function Sp(e){let t=C.useRef(e);return vp(()=>{t.current=e}),t}function Cp(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]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=C.useState(r);yp(f,r)||p(r);let[m,h]=C.useState(null),[g,_]=C.useState(null),v=C.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=C.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),b=a||m,x=o||g,S=C.useRef(null),w=C.useRef(null),T=C.useRef(u),E=c!=null,D=Sp(c),O=Sp(i),k=Sp(l),A=C.useCallback(()=>{if(!S.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),_p(S.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!yp(T.current,t)&&(T.current=t,pr.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);vp(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=C.useRef(!1);vp(()=>(j.current=!0,()=>{j.current=!1}),[]),vp(()=>{if(b&&(S.current=b),x&&(w.current=x),b&&x){if(D.current)return D.current(b,x,A);A()}},[b,x,A,D,E]);let M=C.useMemo(()=>({reference:S,floating:w,setReference:v,setFloating:y}),[v,y]),N=C.useMemo(()=>({reference:b,floating:x}),[b,x]),ee=C.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=xp(N.floating,u.x),r=xp(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...bp(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var wp=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:hp({element:r.current,padding:i}).fn(n):r?hp({element:r,padding:i}).fn(n):{}}}},Tp=(e,t)=>{let n=up(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ep=(e,t)=>{let n=dp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dp=(e,t)=>({fn:gp(e).fn,options:[e,t]}),Op=(e,t)=>{let n=fp(e);return{name:n.name,fn:n.fn,options:[e,t]}},kp=(e,t)=>{let n=pp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ap=(e,t)=>{let n=mp(e);return{name:n.name,fn:n.fn,options:[e,t]}},jp=(e,t)=>{let n=wp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mp=Object.defineProperty,Np=(e,t)=>Mp(e,`name`,{value:t,configurable:!0});function Pp(e){let[t,n]=C.useState(void 0);return hd(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}Np(Pp,`useSize`);var Fp=Object.defineProperty,Ip=(e,t)=>Fp(e,`name`,{value:t,configurable:!0}),Lp=`Popper`,[Rp,zp]=ou(Lp),[Bp,Vp]=Rp(Lp),Hp=Ip(e=>{let{__scopePopper:t,children:n}=e,[r,i]=C.useState(null),[a,o]=C.useState(void 0);return(0,z.jsx)(Bp,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Up=`PopperAnchor`,Wp=C.forwardRef(Ip(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Vp(Up,n),o=C.useRef(null),s=a.onAnchorChange,c=Xc(t,C.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=C.useRef(null);C.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Zp(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,z.jsx)(Du.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Gp=`PopperContent`,[Kp,qp]=Rp(Gp),Jp=C.forwardRef(Ip(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Vp(Gp,n),[_,v]=C.useState(null),y=Xc(t,v),[b,x]=C.useState(null),S=Pp(b),w=S?.width??0,T=S?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Yp),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:ee,middlewareData:te}=Cp({strategy:`fixed`,placement:E,whileElementsMounted:Ip((...e)=>lp(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Tp({mainAxis:i+T,alignmentAxis:o}),c&&Ep({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Dp():void 0,...A}),c&&Op({...A}),kp({...A,apply:Ip(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&jp({element:b,padding:s}),Xp({arrowWidth:w,arrowHeight:T}),f&&Ap({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),P=g.setPlacementState;hd(()=>(P(N),()=>{P(void 0)}),[N,P]);let[F,ne]=Zp(N),re=ju(m);hd(()=>{ee&&re?.()},[ee,re]);let ie=te.arrow?.x,ae=te.arrow?.y,I=te.arrow?.centerOffset!==0,[L,oe]=C.useState();return hd(()=>{_&&oe(window.getComputedStyle(_).zIndex)},[_]),(0,z.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:ee?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:L,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(` `),...te.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,z.jsx)(Kp,{scope:n,placedSide:F,placedAlign:ne,onArrowChange:x,arrowX:ie,arrowY:ae,shouldHideArrow:I,children:(0,z.jsx)(Du.div,{"data-side":F,"data-align":ne,...h,ref:y,style:{...h.style,animation:ee?h.style?.animation:`none`}})})})},`PopperContent`));function Yp(e){return e!==null}Ip(Yp,`isNotNull`);var Xp=Ip(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Zp(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Zp(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Ip(Zp,`getSideAndAlignFromPlacement`);var Qp=Hp,$p=Wp,em=Jp,tm=Object.defineProperty,nm=C.forwardRef(((e,t)=>tm(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=C.useState(!1);hd(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?pr.createPortal((0,z.jsx)(Du.div,{...r,ref:t}),o):null},`Portal`)),rm=Object.defineProperty,im=(e,t)=>rm(e,`name`,{value:t,configurable:!0});function am(e,t){return C.useReducer((e,n)=>t[e][n]??e,e)}im(am,`useStateMachine`);var om=im(e=>{let{present:t,children:n}=e,r=sm(t),i=typeof n==`function`?n({present:r.isPresent}):C.Children.only(n),a=lm(r.ref,dm(i));return typeof n==`function`||r.isPresent?C.cloneElement(i,{ref:a}):null},`Presence`);function sm(e){let[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),a=C.useRef(`none`),o=C.useRef(void 0),[s,c]=am(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return C.useEffect(()=>{s===`mounted`?(a.current=o.current??um(r.current),o.current=void 0):a.current=`none`},[s]),hd(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=um(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]),hd(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=im(a=>{let o=um(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=im(e=>{e.target===t&&(a.current=um(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)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:C.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=um(t)}else r.current=null;n(e)},[])}}im(sm,`usePresence`);function cm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}im(cm,`setRef`);function lm(...e){let t=C.useRef(e);return t.current=e,C.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=cm(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():cm(n[e],null)}}},[])}im(lm,`useStableComposedRefs`);function um(e){return e?.animationName||`none`}im(um,`getAnimationName`);function dm(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)}im(dm,`getElementRef`);var fm=Object.defineProperty,pm=(e,t)=>fm(e,`name`,{value:t,configurable:!0}),mm=C.useEffectEvent,hm=C.useInsertionEffect;function gm(e){if(typeof mm==`function`)return mm(e);let t=C.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof hm==`function`?hm(()=>{t.current=e}):hd(()=>{t.current=e}),C.useMemo(()=>((...e)=>t.current?.(...e)),[])}pm(gm,`useEffectEvent`);var _m=Object.defineProperty,vm=(e,t)=>_m(e,`name`,{value:t,configurable:!0}),ym=C.useInsertionEffect||hd;function bm({prop:e,defaultProp:t,onChange:n=vm(()=>{},`onChange`),caller:r}){let[i,a,o]=xm({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,C.useCallback(t=>{if(s){let n=Sm(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}vm(bm,`useControllableState`);function xm({defaultProp:e,onChange:t}){let[n,r]=C.useState(e),i=C.useRef(n),a=C.useRef(t);return ym(()=>{a.current=t},[t]),C.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}vm(xm,`useUncontrolledState`);function Sm(e){return typeof e==`function`}vm(Sm,`isFunction`);var Cm=Symbol(`RADIX:SYNC_STATE`);function wm(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=gm(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=C.useReducer((t,n)=>{if(n.type===Cm)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=C.useRef(p);C.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=C.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return C.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Cm,state:i})},[i,d.state,c]),[h,f]}vm(wm,`useControllableStateReducer`);var Tm=Object.defineProperty,Em=(e,t)=>Tm(e,`name`,{value:t,configurable:!0});function Dm(e){let t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Em(Dm,`usePrevious`);var Om=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),km=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Am=new WeakMap,jm=new WeakMap,Mm={},Nm=0,Pm=function(e){return e&&(e.host||Pm(e.parentNode))},Fm=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Pm(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})},Im=function(e,t,n,r){var i=Fm(t,Array.isArray(e)?e:[e]);Mm[n]||(Mm[n]=new WeakMap);var a=Mm[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=(Am.get(e)||0)+1,l=(a.get(e)||0)+1;Am.set(e,c),a.set(e,l),o.push(e),c===1&&i&&jm.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(),Nm++,function(){o.forEach(function(e){var t=Am.get(e)-1,i=a.get(e)-1;Am.set(e,t),a.set(e,i),t||(jm.has(e)||e.removeAttribute(r),jm.delete(e)),i||e.removeAttribute(n)}),Nm--,Nm||(Am=new WeakMap,Am=new WeakMap,jm=new WeakMap,Mm={})}},Lm=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||km(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Im(r,i,n,`aria-hidden`)):function(){return null}},Rm=function(){return Rm=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},Rm.apply(this,arguments)};function zm(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 Bm(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 Vm=`right-scroll-bar-position`,Hm=`width-before-scroll-bar`,Um=`with-scroll-bars-hidden`,Wm=`--removed-body-scroll-bar-size`;function Gm(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Km(e,t){var n=(0,C.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 qm=typeof window<`u`?C.useLayoutEffect:C.useEffect,Jm=new WeakMap;function Ym(e,t){var n=Km(t||null,function(t){return e.forEach(function(e){return Gm(e,t)})});return qm(function(){var t=Jm.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Gm(e,null)}),i.forEach(function(e){r.has(e)||Gm(e,a)})}Jm.set(n,e)},[e]),n}function Xm(e){return e}function Zm(e,t){t===void 0&&(t=Xm);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 Qm(e){e===void 0&&(e={});var t=Zm(null);return t.options=Rm({async:!0,ssr:!1},e),t}var $m=function(e){var t=e.sideCar,n=zm(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 C.createElement(r,Rm({},n))};$m.isSideCarExport=!0;function eh(e,t){return e.useMedium(t),$m}var th=Qm(),nh=function(){},rh=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:nh,onWheelCapture:nh,onTouchMoveCapture:nh}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=zm(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ym([n,t]),w=Rm(Rm({},b),i);return C.createElement(C.Fragment,null,u&&C.createElement(x,{sideCar:th,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?C.cloneElement(C.Children.only(s),Rm(Rm({},w),{ref:S})):C.createElement(v,Rm({},w,{className:c,ref:S}),s))});rh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},rh.classNames={fullWidth:Hm,zeroRight:Vm};var ih,ah=function(){if(ih)return ih;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function oh(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ah();return t&&e.setAttribute(`nonce`,t),e}function sh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ch(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var lh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=oh())&&(sh(t,n),ch(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},uh=function(){var e=lh();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dh=function(){var e=uh();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},fh={left:0,top:0,right:0,gap:0},ph=function(e){return parseInt(e||``,10)||0},mh=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[ph(n),ph(r),ph(i)]},hh=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return fh;var t=mh(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])}},gh=dh(),_h=`data-scroll-locked`,vh=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
15
|
+
`):typeof e.type==`string`?e.type:``:``}function is(){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>e())})})}function as(e){let{attachments:t,messages:n,onActivePageChange:r,onAttachmentsChange:i,onBeforeRun:a,onError:c,onPromptChange:u,onRunStateChange:d,onSessionTraceSummariesChange:f,onStatus:p,promptRef:m,runState:h,selectedAgent:g,selectedAgentId:_,selectedModelRef:v,sessions:y,sessionsEnabled:b,traces:x,transcript:S}=e,w=(0,C.useRef)(void 0),T=(0,C.useRef)(void 0),E=(0,C.useRef)(!1),D=(0,C.useRef)(!1),O=(0,C.useRef)(void 0),k=(0,C.useRef)(Promise.resolve()),[A,j]=(0,C.useState)(void 0),M=ho({transport:fa({endpoint:e=>`/agents/${encodeURIComponent(e.agentId)}/runs`,method:`POST`,format:`jsonl`,headers:{"content-type":`application/json`},body:e=>{let{agentId:t,...n}=e;return JSON.stringify(n)},mapEvent:e=>e}),createRequest:({coreMessages:e})=>{let t=w.current;if(t===void 0)throw Error(`Missing playground run request`);let n=t.useTextMessage?t.promptText:e.at(-1);if(n===void 0)throw Error(`Missing playground prompt message`);return os(t,n)},eventToDelta:()=>void 0,eventToFinal:()=>void 0,humanInput:{eventToApproval:e=>e.type===`tool_approval_request`||e.type===`tool_approval_result`?e.approval:void 0,eventToQuestion:e=>e.type===`tool_question_request`||e.type===`tool_question_result`?e.question:void 0,decideApproval:async e=>{let t=await fetch(`/approvals/${encodeURIComponent(e.approvalId)}/decision`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({approved:e.approved})});if(!t.ok)throw Error(`Approval decision failed with HTTP ${t.status}`);let n=await t.json();return ss(S,n),n},answerQuestion:async e=>{let t=await fetch(`/questions/${encodeURIComponent(e.questionId)}/answer`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({answers:e.answers})});if(!t.ok)throw Error(`Question answer failed with HTTP ${t.status}`);let n=await t.json();return cs(S,n),n}},onEvent(e){D.current||F(e)&&(k.current=k.current.then(is))},onError(e){if(E.current||D.current)return;D.current=!0,T.current=e;let t=Uo(e);c(t),S.appendAssistantError(t),ne()}});async function N(e){let l=e.trim(),C=t,A=g?.id??_;if(l.length===0&&C.length===0||A.length===0||h===`running`||M.status===`streaming`)return;E.current=!1,D.current=!1,d(`running`),a(),r(`playground`),c(``),u(``),i([]),requestAnimationFrame(()=>Zo(m.current));let N=C.length===0?{text:l}:li(l,C);S.setMessages(e=>{let t={entryId:Qo(),kind:`message`,role:`user`,text:l};return C.length>0&&(t.attachments=ui(C)),[...e,t,{entryId:Qo(),kind:`message`,role:`assistant`,text:``,tone:`pending`}]});try{let e=b&&y.selectedSessionId.length===0,t=e?(await y.createSession(o(l),{updatePath:!1})).id:y.selectedSessionId,r=b?void 0:Yo(n);T.current=void 0,k.current=Promise.resolve();let i={source:`anvia-studio`};v.length>0&&(i.studioModel=v);let a={agentId:A,promptText:l,useTextMessage:C.length===0,stream:!0,metadata:i};t.length>0&&(a.sessionId=t),r!==void 0&&(a.history=r),v.length>0&&(a.model=v),w.current=a;let s=Date.now();if(O.current=s,j(s),await M.sendMessage(N),await k.current,T.current===void 0){if(await y.loadAllSessions(),t.length>0){y.setSelectedSessionId(t);let[n]=await Promise.all([x.loadSessionTraceSummaries(t),y.loadSessionLogs(t)]);f(n),S.setMessages(e=>ni(e,n)),e&&y.openSessionPath(t)}p(E.current?`Stopped`:`Connected`)}}catch(e){if(!E.current&&!D.current){D.current=!0;let t=s(e);c(t),S.appendAssistantError(t),ne()}}finally{ne(),w.current=void 0,M.reset(),d(`idle`)}}function ee(){if(M.status!==`streaming`||D.current)return;E.current=!0,D.current=!0;let e=re();M.stop(),S.cancelPendingRun(e??0),p(`Stopping`)}function te(e,t){c(``),(t?M.approveTool(e):M.rejectTool(e)).catch(e=>c(s(e)))}function P(e,t){c(``),M.answerToolQuestion(e,t).catch(e=>c(s(e)))}function F(e){if(e.type===`text_delta`)return S.appendAssistantText(e.delta),!0;if(e.type===`reasoning_delta`)return S.appendReasoningText(e.delta,e.id),!0;if(e.type===`tool_call`)return S.appendToolCall(e.toolCall.function.name,l(e.toolCall.function.arguments),e.toolCall.callId??e.toolCall.id),!0;if(e.type===`tool_result`){let t={toolName:e.toolName,callId:e.toolCallId,args:e.args,result:e.result};return e.structuredResult!==void 0&&(t.structuredResult=e.structuredResult),S.appendToolResult(t),!0}if(e.type===`agent_tool_event`)return S.appendAgentToolEvent(e),!0;if(e.type===`tool_approval_request`||e.type===`tool_approval_result`)return S.updateToolApproval(e.approval),!0;if(e.type===`tool_question_request`||e.type===`tool_question_result`)return S.updateToolQuestion(e.question),!0;if(e.type===`session_log`)return y.appendSessionLogEntry(e.log),!0;if(e.type===`final`)return D.current=!0,e.trace?.traceId!==void 0&&S.assignAssistantTraceId(e.trace.traceId),S.clearPendingAssistant(),ne(),!0;if(e.type===`error`){D.current=!0;let t=Go(e.error);return T.current=e.error,c(t),S.appendAssistantError(t),ne(),!0}return!1}function ne(){let e=re();e!==void 0&&S.completeRun(e)}function re(){let e=O.current;if(e!==void 0)return O.current=void 0,j(void 0),Date.now()-e}return{answeringQuestions:new Set(M.answeringQuestions),decidingApprovals:new Set(M.decidingApprovals),isStreaming:M.status===`streaming`,workingStartedAt:A,answerToolQuestion:P,decideToolApproval:te,runPrompt:N,stopPrompt:ee}}function os(e,t){let n={agentId:e.agentId,message:t,stream:e.stream,metadata:e.metadata};return e.sessionId!==void 0&&(n.sessionId=e.sessionId),e.history!==void 0&&(n.history=e.history),e.model!==void 0&&(n.model=e.model),n}function ss(e,t){let n=ls(t);n!==void 0&&e.updateToolApproval(n)}function cs(e,t){let n=us(t);n!==void 0&&e.updateToolQuestion(n)}function ls(e){if(e.requestedAt===void 0)return;let t={id:e.id,toolName:e.toolName,status:e.status,requestedAt:e.requestedAt};return e.callId!==void 0&&(t.callId=e.callId),e.resolvedAt!==void 0&&(t.resolvedAt=e.resolvedAt),e.reason!==void 0&&(t.reason=e.reason),t}function us(e){if(e.requestedAt===void 0)return;let t={id:e.id,toolName:e.toolName,status:e.status,requestedAt:e.requestedAt,questions:e.questions};return e.callId!==void 0&&(t.callId=e.callId),e.answeredAt!==void 0&&(t.answeredAt=e.answeredAt),e.cancelledAt!==void 0&&(t.cancelledAt=e.cancelledAt),e.answers!==void 0&&(t.answers=e.answers),t}function ds(){let[e,t]=(0,C.useState)([]);return{messages:e,setMessages:t,appendAgentToolEvent:e=>t(t=>ws(t,e)),appendAssistantError:e=>t(t=>hs(t,e)),appendAssistantText:e=>t(t=>ms(t,e)),appendReasoningText:(e,n)=>t(t=>xs(t,e,n)),appendToolCall:(e,n,r)=>t(t=>Ss(t,e,n,r)),appendToolResult:e=>t(t=>Cs(t,e)),assignAssistantTraceId:e=>t(t=>gs(t,e)),cancelPendingRun:e=>t(t=>fs(t,new Date().toISOString(),e)),clearPendingAssistant:()=>t(e=>Ts(e)),completeRun:e=>t(t=>ps(t,e)),updateToolApproval:e=>t(t=>_s(t,e)),updateToolQuestion:e=>t(t=>vs(t,e))}}function fs(e,t,n){let r=Ts(e),i=-1;for(let e=r.length-1;e>=0;--e){let t=r[e];if(t?.kind===`message`&&t.role===`user`){i=e;break}}if(i<0)return ps(r,n);for(let e=i+1;e<r.length;e+=1){let n=r[e];if(n?.kind!==`tool`)continue;let i={...n};n.approval?.status===`pending`&&(i.approval={...n.approval,status:`cancelled`,resolvedAt:t,reason:`Run cancelled in Anvia Studio.`}),n.question?.status===`pending`&&(i.question={...n.question,status:`cancelled`,cancelledAt:t}),r[e]=i}return ps(r,n)}function ps(e,t){let n=[...e],r=Math.max(0,t);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t?.kind===`message`&&t.role===`assistant`){if(t.tone===`pending`){let{tone:i,...a}=t;n[e]={...a,durationMs:r}}else n[e]={...t,durationMs:r};return n}if(t?.kind===`message`&&t.role===`user`)break}return n.push({entryId:Qo(),kind:`message`,role:`assistant`,text:``,durationMs:r}),n}function ms(e,t){let n=[...e],r=n.at(-1);if(r?.kind===`message`&&r.role===`assistant`)if(r.tone===`pending`){let{tone:e,...i}=r;n[n.length-1]={...i,text:t}}else n[n.length-1]={...r,text:`${r.text}${t}`};else n.push({entryId:Qo(),kind:`message`,role:`assistant`,text:t});return n}function hs(e,t){let n=[...e],r=n.at(-1),i={entryId:r?.kind===`message`&&r.role===`assistant`&&r.tone===`pending`?r.entryId:Qo(),kind:`message`,role:`assistant`,text:t,tone:`error`};return r?.kind===`message`&&r.role===`assistant`&&r.tone===`pending`?(n[n.length-1]=i,n):[...n,i]}function gs(e,t){let n=[...e];for(let e=n.length-1;e>=0;--e){let r=n[e];if(r?.kind===`message`&&r.role===`assistant`){n[e]={...r,traceId:t};break}}return n}function _s(e,t){let n=Ts(e),r=ts(n,t.toolName,t.callId),i=ys(t);if(r<0){let e={entryId:Qo(),kind:`tool`,toolName:t.toolName,approval:i};return t.callId!==void 0&&(e.callId=t.callId),n.push(e),n}let a=n[r];return a!==void 0&&a.kind===`tool`&&(n[r]={...a,approval:i}),n}function vs(e,t){let n=Ts(e),r=ts(n,t.toolName,t.callId),i=bs(t);if(r<0){let e={entryId:Qo(),kind:`tool`,toolName:t.toolName,question:i};return t.callId!==void 0&&(e.callId=t.callId),n.push(e),n}let a=n[r];return a!==void 0&&a.kind===`tool`&&(n[r]={...a,question:i}),n}function ys(e){let t={id:e.id,status:e.status,requestedAt:e.requestedAt};return e.resolvedAt!==void 0&&(t.resolvedAt=e.resolvedAt),e.reason!==void 0&&(t.reason=e.reason),t}function bs(e){let t={id:e.id,status:e.status,requestedAt:e.requestedAt,questions:e.questions};return e.answeredAt!==void 0&&(t.answeredAt=e.answeredAt),e.answers!==void 0&&(t.answers=e.answers),t}function xs(e,t,n){let r=Ts(e),i=r.at(-1);if(i?.kind===`reasoning`&&(i.reasoningId??``)===(n??``))r[r.length-1]={...i,text:`${i.text}${t}`};else{let e={entryId:Qo(),kind:`reasoning`,text:t};n!==void 0&&(e.reasoningId=n),r.push(e)}return r}function Ss(e,t,n,r){let i={entryId:Qo(),kind:`tool`,toolName:t};return r!==void 0&&(i.callId=r),n.length>0&&(i.args=n),[...Ts(e),i]}function Cs(e,t){let n=Ts(e),r=es(n,t.toolName,t.callId);if(r>=0){let e=n[r];if(e!==void 0&&e.kind===`tool`){let i={...e,args:e.args??t.args,result:t.result};return t.structuredResult!==void 0&&(i.structuredResult=t.structuredResult),n[r]=i,n}}let i={entryId:Qo(),kind:`tool`,toolName:t.toolName,args:t.args,result:t.result};return t.callId!==void 0&&(i.callId=t.callId),t.structuredResult!==void 0&&(i.structuredResult=t.structuredResult),n.push(i),n}function ws(e,t){let n=Es(t);if(n===void 0)return e;let r=Ts(e),i=es(r,t.toolName,t.toolCallId);if(i<0){let e={entryId:Qo(),kind:`tool`,toolName:t.toolName,childEvents:[n]};return t.toolCallId!==void 0&&(e.callId=t.toolCallId),r.push(e),r}let a=r[i];if(a===void 0||a.kind!==`tool`)return r;let o=[...a.childEvents??[]];return Ds(o,n),r[i]={...a,childEvents:o},r}function Ts(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.kind===`message`&&n.role===`assistant`&&n.tone===`pending`&&n.text.trim().length===0)return e.filter((e,n)=>n!==t)}return[...e]}function Es(e){let t=e.event;if(t.type===`text_delta`){let n={kind:`message`,agentId:e.agentId,text:t.delta};return e.agentName!==void 0&&(n.agentName=e.agentName),n}if(t.type===`reasoning_delta`){let n={kind:`reasoning`,agentId:e.agentId,text:t.delta};return e.agentName!==void 0&&(n.agentName=e.agentName),t.id!==void 0&&(n.reasoningId=t.id),n}if(t.type===`tool_call`){let n={kind:`tool`,agentId:e.agentId,toolName:t.toolCall.function.name,args:l(t.toolCall.function.arguments)};e.agentName!==void 0&&(n.agentName=e.agentName);let r=t.toolCall.callId??t.toolCall.id;return r!==void 0&&(n.callId=r),n}if(t.type===`tool_result`){let n={kind:`tool`,agentId:e.agentId,toolName:t.toolName,args:t.args,result:t.result};return e.agentName!==void 0&&(n.agentName=e.agentName),t.toolCallId!==void 0&&(n.callId=t.toolCallId),t.structuredResult!==void 0&&(n.structuredResult=t.structuredResult),n}if(t.type===`error`){let n={kind:`message`,agentId:e.agentId,text:`Error: ${s(t.error)}`};return e.agentName!==void 0&&(n.agentName=e.agentName),n}}function Ds(e,t){if(t.kind===`message`){let n=e.at(-1);n?.kind===`message`&&n.agentId===t.agentId?e[e.length-1]={...n,text:`${n.text}${t.text}`}:e.push(t);return}if(t.kind===`reasoning`){let n=e.at(-1);n?.kind===`reasoning`&&n.agentId===t.agentId&&(n.reasoningId??``)===(t.reasoningId??``)?e[e.length-1]={...n,text:`${n.text}${t.text}`}:e.push(t);return}let n=Os(e,t);if(n<0){e.push(t);return}let r=e[n];if(r?.kind===`tool`){let i={...r};r.args===void 0&&t.args!==void 0&&(i.args=t.args),t.result!==void 0&&(i.result=t.result),e[n]=i}}function Os(e,t){for(let n=e.length-1;n>=0;--n){let r=e[n];if(!(r?.kind!==`tool`||r.agentId!==t.agentId||r.toolName!==t.toolName||r.result!==void 0)&&(t.callId===void 0||r.callId===t.callId))return n}return-1}function ks(e){let{currentAgentId:t,enabled:n,loadSessionTraceSummaries:r,runState:i,selectedModelRef:a,onError:o,onSessionCreated:c,onSessionDeleted:l,onSessionLoaded:u,onStatus:d}=e,[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)([]),[g,_]=(0,C.useState)([]),[v,y]=(0,C.useState)(`idle`),[b,x]=(0,C.useState)(`idle`),S=(0,C.useRef)(``),w=(0,C.useCallback)(async()=>{if(!n){h([]);return}try{let e=await fetch(`/sessions?limit=100`);if(!e.ok)throw Error(`Sessions failed with HTTP ${e.status}`);h((await e.json()).sessions)}catch(e){o(s(e))}},[n,o]);(0,C.useEffect)(()=>{w()},[w]);let T=(0,C.useCallback)(async e=>{if(!n)return _([]),[];x(`loading`);try{let t=new URLSearchParams({limit:`1000`}),n=await fetch(`/sessions/${encodeURIComponent(e)}/logs?${t}`);if(!n.ok)throw Error(`Session logs failed with HTTP ${n.status}`);let r=await n.json();return _(r.logs),r.logs}catch(e){return o(s(e)),_([]),[]}finally{x(`idle`)}},[n,o]),E=(0,C.useCallback)(async(e,n={})=>{let r={source:`anvia-studio`};a.length>0&&(r[Xr]=a);let i=await fetch(`/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agentId:t,title:e,metadata:r})});if(!i.ok)throw Error(await Ho(i,`Session create failed`));let o=await i.json();return p(o.id),h(e=>[o,...e.filter(e=>e.id!==o.id)]),n.updatePath!==!1&&c(o.id),await T(o.id),o},[t,T,c,a]),D=(0,C.useCallback)(async(e,t={})=>{if(i!==`running`){S.current=e,y(`loading`),o(``);try{let n=await fetch(`/sessions/${encodeURIComponent(e)}`);if(!n.ok)throw Error(`Session load failed with HTTP ${n.status}`);let i=await n.json(),[a]=await Promise.all([r(i.id),T(i.id)]);if(S.current!==e)return;p(i.id),u(i,a,t),d(`Connected`)}catch(t){S.current===e&&o(s(t))}finally{S.current===e&&y(`idle`)}}},[T,r,o,u,d,i]),O=(0,C.useCallback)(async e=>{if(i!==`running`){o(``);try{let t=await fetch(`/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`});if(!t.ok)throw Error(`Session delete failed with HTTP ${t.status}`);let n=f===e.id;h(t=>t.filter(t=>t.id!==e.id)),n&&(p(``),_([])),l(e.id,n),d(`Connected`)}catch(e){o(s(e))}}},[o,l,d,i,f]),k=(0,C.useCallback)(()=>{p(``),_([])},[]),A=(0,C.useCallback)(e=>{_(t=>t.some(t=>t.id===e.id)?t:[...t,e].sort((e,t)=>e.sequence-t.sequence))},[]);return(0,C.useMemo)(()=>({allSessions:m,selectedSessionId:f,sessionLogs:g,sessionLoadState:v,sessionLogLoadState:b,appendSessionLogEntry:A,clearSelectedSession:k,createSession:E,deleteSession:O,loadAllSessions:w,loadSession:D,loadSessionLogs:T,openSessionPath:c,setSelectedSessionId:p}),[m,A,k,E,O,w,D,T,c,f,v,b,g])}function As(e,t){return!0}function js(e,t){return e}var Ms=document.getElementById(`anvia-ui`),Ns=Ms?.dataset.uiPath??`/ui`,Ps=Ms?.dataset.uiCompatPath??`/ui`,Fs=`${Ls(Ns)||Ls(Ps)||`/ui`}/assets/logo.png`,Is=`static-context`;function Ls(e){return e===`/`?``:e.replace(/\/+$/,``)}function Rs(e){let{activePage:t,enabled:n,onError:r,onNavigateTracing:i,onOpenTrace:a,onOpenTraceIndex:o,onOpenTraceSession:c}=e,[l,u]=(0,C.useState)([]),[d,f]=(0,C.useState)(()=>e.initialTraceId),[p,m]=(0,C.useState)(()=>e.initialTraceSessionId),[h,g]=(0,C.useState)(`idle`),_=(0,C.useCallback)(async()=>{if(!n){u([]);return}g(`loading`);try{let e=new URLSearchParams({include:`detail`,limit:`50`}),t=await fetch(`/traces?${e.toString()}`);if(!t.ok)throw Error(`Traces failed with HTTP ${t.status}`);let n=(await t.json()).traces;if(d.length>0&&!n.some(e=>e.id===d)){let e=await fetch(`/traces/${encodeURIComponent(d)}`);if(e.ok){u([await e.json(),...n]);return}}u(n)}catch(e){r(s(e))}finally{g(`idle`)}},[n,r,d]),v=(0,C.useCallback)(async(e,t={})=>{if(n){g(`loading`);try{let n=new URLSearchParams({include:`detail`,limit:`50`,sessionId:e}),r=await fetch(`/traces?${n.toString()}`);if(!r.ok)throw Error(`Session traces failed with HTTP ${r.status}`);let a=[...(await r.json()).traces].sort((e,t)=>Date.parse(e.startedAt)-Date.parse(t.startedAt));u(a);let o=a[0]?.id;if(o===void 0){f(``),m(e),t.updatePath!==!1&&c(e);return}i(),f(o),m(e),t.updatePath!==!1&&c(e)}catch(e){r(s(e))}finally{g(`idle`)}}},[n,r,i,c]),y=(0,C.useCallback)(async e=>{if(!n)return[];let t=new URLSearchParams({limit:`100`}),r=await fetch(`/sessions/${encodeURIComponent(e)}/traces?${t}`);return r.ok?(await r.json()).traces:[]},[n]);(0,C.useEffect)(()=>{t!==`tracing`||p!==void 0||_()},[t,_,p]);let b=(0,C.useCallback)((e,t)=>{f(e),m(t)},[]),x=(0,C.useCallback)(()=>{f(``),m(void 0)},[]),S=(0,C.useCallback)(e=>{if(i(),f(e),m(void 0),e.length===0){o();return}a(e)},[i,a,o]),w=(0,C.useCallback)(e=>{u(t=>t.filter(t=>t.sessionId!==e))},[]);return(0,C.useMemo)(()=>({traces:l,selectedTraceId:d,traceSessionDetailId:p,traceLoadState:h,clearTraceSelection:x,loadSessionTraceSummaries:y,loadTraces:_,removeSessionTraces:w,selectTrace:S,setTraceLocation:b,showSessionTraces:v}),[x,y,_,w,S,d,b,v,h,p,l])}var zs=(0,C.createContext)(void 0);function Bs(){let e=(0,C.useContext)(zs);if(e===void 0)throw Error(`StudioConsoleContext is missing`);return e}var Vs=`modulepreload`,Hs=function(e){return`/ui/`+e},Us={},Ws=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Hs(t,n),t in Us)return;Us[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Vs,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Gs=(0,C.lazy)(()=>Ws(()=>import(`./agents-page-Bbbg-x2R.js`).then(e=>({default:e.AgentsPage})),__vite__mapDeps([0,1,2]))),Ks=(0,C.lazy)(()=>Ws(()=>import(`./evals-page-DkyqKUak.js`).then(e=>({default:e.EvalsPage})),__vite__mapDeps([3,1]))),qs=(0,C.lazy)(()=>Ws(()=>import(`./knowledge-page-BsIEmgbK.js`).then(e=>({default:e.KnowledgePage})),__vite__mapDeps([4,1,5,6,2]))),Js=(0,C.lazy)(()=>Ws(()=>import(`./mcps-page-CLkKV3gQ.js`).then(e=>({default:e.McpsPage})),__vite__mapDeps([7,1,2,8,5,6]))),Ys=(0,C.lazy)(()=>Ws(()=>import(`./memory-page-B6wO-dfj.js`).then(e=>({default:e.MemoryPage})),__vite__mapDeps([9,1,5,6,10,2]))),Xs=(0,C.lazy)(()=>Ws(()=>import(`./pipelines-page-DBrdwSHs.js`).then(e=>({default:e.PipelinesPage})),__vite__mapDeps([11,1,5,6,12]))),Zs=(0,C.lazy)(()=>Ws(()=>import(`./sessions-page-BEVnUUFi.js`).then(e=>({default:e.SessionsPage})),__vite__mapDeps([13,1,6]))),Qs=(0,C.lazy)(()=>Ws(()=>import(`./sandboxes-page-B9Tqi3T9.js`).then(e=>({default:e.SandboxesPage})),__vite__mapDeps([14,1,6]))),$s=(0,C.lazy)(()=>Ws(()=>import(`./sessions-page-BEVnUUFi.js`).then(e=>({default:e.DeleteSessionDialog})),__vite__mapDeps([13,1,6]))),ec=(0,C.lazy)(()=>Ws(()=>import(`./status-page-CqcN8K2V.js`).then(e=>({default:e.StatusPage})),__vite__mapDeps([15,1,5,6,2]))),tc=(0,C.lazy)(()=>Ws(()=>import(`./tools-page-zkT-hZtg.js`).then(e=>({default:e.ToolsPage})),__vite__mapDeps([16,1,2,8,5,6]))),nc=(0,C.lazy)(()=>Ws(()=>import(`./trace-browser-BrJaIgIn.js`).then(e=>({default:e.TraceBrowser})),__vite__mapDeps([17,1,2,6])));function W(){return(0,z.jsx)(`section`,{className:`grid h-full min-h-0 place-items-center bg-background/45 text-sm font-medium text-muted-foreground`,children:`Loading`})}var rc=[[`path`,{d:`M4.31802 19.682C3 18.364 3 16.2426 3 12C3 7.75736 3 5.63604 4.31802 4.31802C5.63604 3 7.75736 3 12 3C16.2426 3 18.364 3 19.682 4.31802C21 5.63604 21 7.75736 21 12C21 16.2426 21 18.364 19.682 19.682C18.364 21 16.2426 21 12 21C7.75736 21 5.63604 21 4.31802 19.682Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 14L9.79289 11.2071C10.1834 10.8166 10.8166 10.8166 11.2071 11.2071L12.7929 12.7929C13.1834 13.1834 13.8166 13.1834 14.2071 12.7929L17 10`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],ic=[[`path`,{d:`M13 2H11C7.22876 2 5.34315 2 4.17157 3.17157C3 4.34315 3 6.22876 3 10V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V10C21 6.22876 21 4.34315 19.8284 3.17157C18.6569 2 16.7712 2 13 2Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M21 12H3`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M15 7H9`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M15 17H9`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}]],ac=[[`path`,{d:`M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],oc=[[`path`,{d:`M5.5 12.002H19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M10.9999 18.002C10.9999 18.002 4.99998 13.583 4.99997 12.0019C4.99996 10.4208 11 6.00195 11 6.00195`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],sc=[[`path`,{d:`M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],cc=[[`path`,{d:`M11 6H15.5C17.9853 6 20 8.01472 20 10.5C20 12.9853 17.9853 15 15.5 15H4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6.99998 12C6.99998 12 4.00001 14.2095 4 15C3.99999 15.7906 7 18 7 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],lc=[[`path`,{d:`M12 5.5V19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 11C18 11 13.5811 5.00001 12 5C10.4188 4.99999 6 11 6 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],uc=[[`path`,{d:`M19.5 12.0001V13.5001C19.5 17.6422 16.1421 21.0001 12 21.0001C7.85786 21.0001 4.5 17.6422 4.5 13.5001V8C4.5 5.23858 6.73858 3 9.5 3C12.2614 3 14.5 5.23858 14.5 8V13.5C14.5 14.8807 13.3807 16 12 16C10.6193 16 9.5 14.8807 9.5 13.5V9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],dc=[[`path`,{d:`M5.33333 3.00001C7.79379 2.99657 10.1685 3.88709 12 5.5V21C10.1685 19.3871 7.79379 18.4966 5.33333 18.5C3.77132 18.5 2.99032 18.5 2.64526 18.2792C2.4381 18.1466 2.35346 18.0619 2.22086 17.8547C2 17.5097 2 16.8941 2 15.6629V6.40322C2 4.97543 2 4.26154 2.54874 3.68286C3.09748 3.10418 3.65923 3.07432 4.78272 3.0146C4.965 3.00491 5.14858 3.00001 5.33333 3.00001Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18.6667 3.00001C16.2062 2.99657 13.8315 3.88709 12 5.5V21C13.8315 19.3871 16.2062 18.4966 18.6667 18.5C20.2287 18.5 21.0097 18.5 21.3547 18.2792C21.5619 18.1466 21.6465 18.0619 21.7791 17.8547C22 17.5097 22 16.8941 22 15.6629V6.40322C22 4.97543 22 4.26154 21.4513 3.68286C20.9025 3.10418 20.3408 3.07432 19.2173 3.0146C19.035 3.00491 18.8514 3.00001 18.6667 3.00001Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M19 7.32566C18.8893 7.32211 18.7782 7.32032 18.6667 7.32032C18.1048 7.31954 17.5475 7.36537 17 7.45576M19 11.0067C18.8893 11.0032 18.7782 11.0014 18.6667 11.0014C17.401 10.9996 16.158 11.2344 15 11.6824M19 14.501C18.8893 14.4975 18.7782 14.4957 18.6667 14.4957C17.401 14.4939 16.158 14.7287 15 15.1767`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M5 7.32566C5.11067 7.32211 5.22179 7.32032 5.33333 7.32032C5.89518 7.31954 6.45255 7.36537 7 7.45576M5 11.0067C5.11067 11.0032 5.22179 11.0014 5.33333 11.0014C6.599 10.9996 7.84198 11.2344 9 11.6824M5 14.501C5.11067 14.4975 5.22179 14.4957 5.33333 14.4957C6.599 14.4939 7.84198 14.7287 9 15.1767`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],fc=[[`path`,{d:`M18 6L6.00081 17.9992M17.9992 18L6 6.00085`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],pc=[[`path`,{d:`M4 15L4 19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 9L12 19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M22 22L2 22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M20 13L20 19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M5.60009 8.79993C5.23521 8.31419 4.6543 8 4 8C2.89543 8 2 8.89543 2 10C2 11.1046 2.89543 12 4 12C5.10457 12 6 11.1046 6 10C6 9.54973 5.8512 9.13421 5.60009 8.79993ZM5.60009 8.79993L10.3999 5.20007M10.3999 5.20007C10.7648 5.68581 11.3457 6 12 6C12.783 6 13.4609 5.55006 13.7892 4.89462M10.3999 5.20007C10.1488 4.86579 10 4.45027 10 4C10 2.89543 10.8954 2 12 2C13.1046 2 14 2.89543 14 4C14 4.32158 13.9241 4.62543 13.7892 4.89462M13.7892 4.89462L18.2108 7.10538M18.2108 7.10538C18.0759 7.37457 18 7.67842 18 8C18 9.10457 18.8954 10 20 10C21.1046 10 22 9.10457 22 8C22 6.89543 21.1046 6 20 6C19.217 6 18.5391 6.44994 18.2108 7.10538Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`4`}]],mc=[[`path`,{d:`M2 10.5C2 9.72921 2.01346 8.97679 2.03909 8.2503C2.12282 5.87683 2.16469 4.69009 3.13007 3.71745C4.09545 2.74481 5.3157 2.6926 7.7562 2.58819C9.09517 2.5309 10.5209 2.5 12 2.5C13.4791 2.5 14.9048 2.5309 16.2438 2.58819C18.6843 2.6926 19.9046 2.74481 20.8699 3.71745C21.8353 4.69009 21.8772 5.87683 21.9609 8.2503C21.9865 8.97679 22 9.72921 22 10.5C22 11.2708 21.9865 12.0232 21.9609 12.7497C21.8772 15.1232 21.8353 16.3099 20.8699 17.2826C19.9046 18.2552 18.6843 18.3074 16.2437 18.4118C15.5098 18.4432 14.7498 18.4667 13.9693 18.4815C13.2282 18.4955 12.8576 18.5026 12.532 18.6266C12.2064 18.7506 11.9325 18.9855 11.3845 19.4553L9.20503 21.3242C9.07273 21.4376 8.90419 21.5 8.72991 21.5C8.32679 21.5 8 21.1732 8 20.7701V18.4219C7.91842 18.4186 7.83715 18.4153 7.75619 18.4118C5.31569 18.3074 4.09545 18.2552 3.13007 17.2825C2.16469 16.3099 2.12282 15.1232 2.03909 12.7497C2.01346 12.0232 2 11.2708 2 10.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12.1257 10.5H12.0007M8.125 10.5H8M16.125 10.5H16M12.2507 10.5C12.2507 10.6381 12.1388 10.75 12.0007 10.75C11.8627 10.75 11.7507 10.6381 11.7507 10.5C11.7507 10.3619 11.8627 10.25 12.0007 10.25C12.1388 10.25 12.2507 10.3619 12.2507 10.5ZM8.25 10.5C8.25 10.6381 8.13807 10.75 8 10.75C7.86193 10.75 7.75 10.6381 7.75 10.5C7.75 10.3619 7.86193 10.25 8 10.25C8.13807 10.25 8.25 10.3619 8.25 10.5ZM16.25 10.5C16.25 10.6381 16.1381 10.75 16 10.75C15.8619 10.75 15.75 10.6381 15.75 10.5C15.75 10.3619 15.8619 10.25 16 10.25C16.1381 10.25 16.25 10.3619 16.25 10.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],hc=[[`path`,{d:`M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17.0001 9.00004 17.0001C9.41425 17.0001 9.74759 16.6523 10.4143 15.9568L19 7.00006`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],gc=[[`path`,{d:`M7.5 7.5L8.72654 8.55719C9.24218 9.00163 9.5 9.22386 9.5 9.5C9.5 9.77614 9.24218 9.99836 8.72654 10.4428L7.5 11.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M11.5 12.5H15.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 21C15.7497 21 17.6246 21 18.9389 20.0451C19.3634 19.7367 19.7367 19.3634 20.0451 18.9389C21 17.6246 21 15.7497 21 12C21 8.25027 21 6.3754 20.0451 5.06107C19.7367 4.6366 19.3634 4.26331 18.9389 3.95491C17.6246 3 15.7497 3 12 3C8.25027 3 6.3754 3 5.06107 3.95491C4.6366 4.26331 4.26331 4.6366 3.95491 5.06107C3 6.3754 3 8.25027 3 12C3 15.7497 3 17.6246 3.95491 18.9389C4.26331 19.3634 4.6366 19.7367 5.06107 20.0451C6.3754 21 8.25027 21 12 21Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],_c=[[`path`,{d:`M15 5H9C6.09433 5 4.64149 5 3.62036 5.73563C3.27976 5.981 2.981 6.27976 2.73563 6.62036C2 7.64149 2 9.09433 2 12C2 14.9057 2 16.3585 2.73563 17.3796C2.981 17.7202 3.27976 18.019 3.62036 18.2644C4.64149 19 6.09433 19 9 19H15C17.9057 19 19.3585 19 20.3796 18.2644C20.7202 18.019 21.019 17.7202 21.2644 17.3796C22 16.3585 22 14.9057 22 12C22 9.09433 22 7.64149 21.2644 6.62036C21.019 6.27976 20.7202 5.981 20.3796 5.73563C19.3585 5 17.9057 5 15 5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 9V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M14 9V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M10 9V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M6 9V15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],vc=[[`path`,{d:`M9 15C9 12.1716 9 10.7574 9.87868 9.87868C10.7574 9 12.1716 9 15 9L16 9C18.8284 9 20.2426 9 21.1213 9.87868C22 10.7574 22 12.1716 22 15V16C22 18.8284 22 20.2426 21.1213 21.1213C20.2426 22 18.8284 22 16 22H15C12.1716 22 10.7574 22 9.87868 21.1213C9 20.2426 9 18.8284 9 16L9 15Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16.9999 9C16.9975 6.04291 16.9528 4.51121 16.092 3.46243C15.9258 3.25989 15.7401 3.07418 15.5376 2.90796C14.4312 2 12.7875 2 9.5 2C6.21252 2 4.56878 2 3.46243 2.90796C3.25989 3.07417 3.07418 3.25989 2.90796 3.46243C2 4.56878 2 6.21252 2 9.5C2 12.7875 2 14.4312 2.90796 15.5376C3.07417 15.7401 3.25989 15.9258 3.46243 16.092C4.51121 16.9528 6.04291 16.9975 9 16.9999`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],yc=[[`path`,{d:`M11 10.6667C11 10.6667 11.75 10.6667 12.5 12C12.5 12 14.8824 8.66667 17 8`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 11V9C7 5.70017 7 4.05025 8.02513 3.02513C9.05025 2 10.7002 2 14 2C17.2998 2 18.9497 2 19.9749 3.02513C21 4.05025 21 5.70017 21 9V11C21 14.2998 21 15.9497 19.9749 16.9749C18.9497 18 17.2998 18 14 18C10.7002 18 9.05025 18 8.02513 16.9749C7 15.9497 7 14.2998 7 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M3 6V15C3 18.2998 3 19.9497 4.02513 20.9749C5.05025 22 6.70017 22 10 22H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],bc=[[`path`,{d:`M4 12C4 8.22876 4 6.34315 5.17157 5.17157C6.34315 4 8.22876 4 12 4C15.7712 4 17.6569 4 18.8284 5.17157C20 6.34315 20 8.22876 20 12C20 15.7712 20 17.6569 18.8284 18.8284C17.6569 20 15.7712 20 12 20C8.22876 20 6.34315 20 5.17157 18.8284C4 17.6569 4 15.7712 4 12Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.5 2V4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M14.5 2V4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M9.5 20V22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M14.5 20V22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M13 9L9 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M15 13L13 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M22 14.5L20 14.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`7`}],[`path`,{d:`M4 9.5L2 9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`8`}],[`path`,{d:`M4 14.5L2 14.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`9`}],[`path`,{d:`M22 9.5L20 9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`10`}]],xc=[[`path`,{d:`M10 8.00024C13.866 8.00024 17 6.6571 17 5.00024C17 3.34339 13.866 2.00024 10 2.00024C6.13401 2.00024 3 3.34339 3 5.00024C3 6.6571 6.13401 8.00024 10 8.00024Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M10 14.0002C6.13401 14.0002 3 12.6571 3 11.0002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M10 20.0002C6.13401 20.0002 3 18.6571 3 17.0002V5.00024`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M18 15.0001V10.6516C18 10.2918 17.7083 10.0001 17.3485 10.0002C17.1308 10.0003 16.9275 10.1091 16.8067 10.2903L13.1289 15.807C13.0449 15.9331 13 16.0812 13 16.2327C13 16.6567 13.3437 17.0003 13.7676 17.0003L16 17.0003L16 21.3488C16 21.7086 16.2917 22.0003 16.6515 22.0002C16.8692 22.0001 17.0725 21.8913 17.1933 21.7101L20.8711 16.1934C20.9551 16.0673 21 15.9192 21 15.7677C21 15.3437 20.6563 15.0001 20.2324 15.0001H18Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M6 10.4896V10.4996`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M6 16.4899V16.4999`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],Sc=[[`ellipse`,{cx:`12`,cy:`5`,rx:`8`,ry:`3`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 10.842C7.60158 11.0229 8.27434 11.1718 9 11.282`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M20 12C20 13.6569 16.4183 15 12 15C7.58172 15 4 13.6569 4 12`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M7 17.842C7.60158 18.0229 8.27434 18.1718 9 18.282`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M20 5V19C20 20.6569 16.4183 22 12 22C7.58172 22 4 20.6569 4 19V5`,stroke:`currentColor`,strokeWidth:`1.5`,key:`4`}]],Cc=[[`path`,{d:`M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.5 16.5L9.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M14.5 16.5L14.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}]],wc=[[`path`,{d:`M2.99969 17.0002C2.99969 17.9302 2.99969 18.3952 3.10192 18.7767C3.37932 19.8119 4.18796 20.6206 5.22324 20.898C5.60474 21.0002 6.06972 21.0002 6.99969 21.0002L16.9997 21.0002C17.9297 21.0002 18.3947 21.0002 18.7762 20.898C19.8114 20.6206 20.6201 19.8119 20.8975 18.7767C20.9997 18.3952 20.9997 17.9302 20.9997 17.0002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16.4998 11.5002C16.4998 11.5002 13.1856 16.0002 11.9997 16.0002C10.8139 16.0002 7.49976 11.5002 7.49976 11.5002M11.9997 15.0002V3.00016`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Tc=[[`path`,{d:`M15 3H18C19.4142 3 20.1213 3 20.5607 3.43934C21 3.87868 21 4.58579 21 6V9M20 4L11 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20 13C20 16.7712 20 18.6569 18.8284 19.8284C17.6569 21 15.7712 21 12 21H11C7.22876 21 5.34315 21 4.17157 19.8284C3 18.6569 3 16.7712 3 13V12C3 8.22876 3 6.34315 4.17157 5.17157C5.34315 4 7.22876 4 11 4`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],Ec=[[`path`,{d:`M8 7L16 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 11L12 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Dc=[[`path`,{d:`M2.5 20V8.87695C2.5 7.58945 2.5 6.9457 2.78533 6.47048C2.9541 6.18939 3.18939 5.9541 3.47048 5.78533C3.9457 5.5 4.59449 5.5 5.89206 5.5C6.52339 5.5 6.83906 5.5 7.12612 5.58819C7.31759 5.64702 7.49914 5.73428 7.66469 5.84705C7.91289 6.01611 8.10859 6.26074 8.5 6.75C8.89141 7.23926 9.08711 7.48389 9.33531 7.65295C9.50086 7.76572 9.68241 7.85298 9.87388 7.91181C10.1609 8 10.4742 8 11.1008 8H15C16.4045 8 17.1067 8 17.6111 8.33706C17.8295 8.48298 18.017 8.67048 18.1629 8.88886C18.5 9.39331 18.5 10.0955 18.5 11.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M4.42028 14.0144L3.63368 16.0144C2.65618 18.4998 2.16743 19.7425 2.7524 20.6213C3.33737 21.5 4.65337 21.5 7.28537 21.5H15.1903C16.4249 21.5 17.0422 21.5 17.5295 21.1795C18.0169 20.859 18.2702 20.2865 18.7769 19.1415L19.6618 17.1415C20.7866 14.5992 21.349 13.3281 20.7679 12.4141C20.1868 11.5 18.8163 11.5 16.0752 11.5H8.07196C6.78232 11.5 6.1375 11.5 5.63811 11.8439C5.13872 12.1877 4.89924 12.7966 4.42028 14.0144Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M11.5 4.51456C12.4151 3.28409 13.6662 2.55594 15.5125 2.50161C16.1155 2.48386 16.7152 2.61395 17.2682 2.85544C18.5748 3.42601 19.4185 4.15644 20 5.5L21.5 3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Oc=[[`circle`,{cx:`12`,cy:`14`,r:`2`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20.0007 20C21.2561 18.3287 22 16.2512 22 14C22 12.5778 21.7031 11.2249 21.1679 10M3.99927 20C2.74389 18.3287 2 16.2512 2 14C2 8.47715 6.47715 4 12 4C13.4222 4 14.7751 4.2969 16 4.83209`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M13.5 12.5L19 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],kc=[[`path`,{d:`M7 19H13C15.8284 19 17.2426 19 18.1213 18.1213C19 17.2426 19 15.8284 19 13V10M19 10C19.7002 10 21.0085 11.9943 21.5 12.5M19 10C18.2998 10 16.9915 11.9943 16.5 12.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5 7L5 17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`circle`,{cx:`5`,cy:`5`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`3`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`4`}]],Ac=[[`path`,{d:`M2 11.4C2 10.2417 2.24173 10 3.4 10H20.6C21.7583 10 22 10.2417 22 11.4V12.6C22 13.7583 21.7583 14 20.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2 19.4C2 18.2417 2.24173 18 3.4 18H20.6C21.7583 18 22 18.2417 22 19.4V20.6C22 21.7583 21.7583 22 20.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}]],jc=[[`path`,{d:`M12 3V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 18V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21 12L18 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6 12L3 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M18.3635 5.63672L16.2422 7.75804`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M7.75804 16.2422L5.63672 18.3635`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M18.3635 18.3635L16.2422 16.2422`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M7.75804 7.75804L5.63672 5.63672`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`7`}]],Mc=[[`path`,{d:`M21.5 14.0784C20.3003 14.7189 18.9301 15.0821 17.4751 15.0821C12.7491 15.0821 8.91792 11.2509 8.91792 6.52485C8.91792 5.06986 9.28105 3.69968 9.92163 2.5C5.66765 3.49698 2.5 7.31513 2.5 11.8731C2.5 17.1899 6.8101 21.5 12.1269 21.5C16.6849 21.5 20.503 18.3324 21.5 14.0784Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Nc=[[`path`,{d:`M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M11 13.4625C14 14.955 17 12.8198 17 10.3934C17 7.96698 14.7614 6 12 6C9.23858 6 7 7.96698 7 10.3934C7 11.3826 7.37209 12.2955 8 13.0298M11 13.4625V9.90523M11 13.4625V15.8456C11 16.8264 11 17.3168 10.7732 17.5868C10.1251 18.3583 9 17.9399 8.5 17.2275`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Pc=[[`path`,{d:`M18.8906 12.846C18.5371 14.189 16.8667 15.138 13.5257 17.0361C10.296 18.8709 8.6812 19.7884 7.37983 19.4196C6.8418 19.2671 6.35159 18.9776 5.95624 18.5787C5 17.6139 5 15.7426 5 12C5 8.2574 5 6.3861 5.95624 5.42132C6.35159 5.02245 6.8418 4.73288 7.37983 4.58042C8.6812 4.21165 10.296 5.12907 13.5257 6.96393C16.8667 8.86197 18.5371 9.811 18.8906 11.154C19.0365 11.7084 19.0365 12.2916 18.8906 12.846Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Fc=[[`path`,{d:`M15.5 2V6M8.5 6V2`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6.00446 7.61331C5.93719 6.74273 6.63957 6 7.53014 6H16.4699C17.3604 6 18.0628 6.74273 17.9955 7.61331L17.8117 9.99197C17.6796 11.7019 17.1011 13.3498 16.132 14.7773L15.5312 15.6622C14.9638 16.4979 14.0077 17 12.9838 17H11.0162C9.99228 17 9.03617 16.4979 8.46881 15.6622L7.86803 14.7773C6.89885 13.3498 6.32041 11.7019 6.18827 9.99197L6.00446 7.61331Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 17V22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M11 9H13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Ic=[[`path`,{d:`M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Lc=[[`path`,{d:`M12 4V2`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20 22C20 17.5817 16.4183 14 12 14C7.58172 14 4 17.5817 4 22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.375 8.25H9.25M9.5 8.25C9.5 8.38807 9.38807 8.5 9.25 8.5C9.11193 8.5 9 8.38807 9 8.25C9 8.11193 9.11193 8 9.25 8C9.38807 8 9.5 8.11193 9.5 8.25Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M14.875 8.25H14.75M15 8.25C15 8.38807 14.8881 8.5 14.75 8.5C14.6119 8.5 14.5 8.38807 14.5 8.25C14.5 8.11193 14.6119 8 14.75 8C14.8881 8 15 8.11193 15 8.25Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M15.1538 4H8.84615C7.59095 4 6.96334 4 6.47397 4.22025C5.91693 4.47095 5.47095 4.91693 5.22025 5.47397C5 5.96334 5 6.59095 5 7.84615C5 9.85448 5 10.8586 5.3524 11.6417C5.75353 12.5329 6.46709 13.2465 7.35835 13.6476C8.14135 14 9.14552 14 11.1538 14H12.8462C14.8545 14 15.8586 14 16.6417 13.6476C17.5329 13.2465 18.2465 12.5329 18.6476 11.6417C19 10.8586 19 9.85448 19 7.84615C19 6.59095 19 5.96334 18.7797 5.47397C18.529 4.91693 18.0831 4.47095 17.526 4.22025C17.0367 4 16.4091 4 15.1538 4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],Rc=[[`path`,{d:`M2.5 9H6.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2.5 14H6.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2.5 4H18.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M18.5355 17.0355L21.5 20M20 13.5C20 10.7386 17.7614 8.5 15 8.5C12.2386 8.5 10 10.7386 10 13.5C10 16.2614 12.2386 18.5 15 18.5C17.7614 18.5 20 16.2614 20 13.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],zc=[[`path`,{d:`M15.5 12C15.5 13.933 13.933 15.5 12 15.5C10.067 15.5 8.5 13.933 8.5 12C8.5 10.067 10.067 8.5 12 8.5C13.933 8.5 15.5 10.067 15.5 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M21.011 14.0965C21.5329 13.9558 21.7939 13.8854 21.8969 13.7508C22 13.6163 22 13.3998 22 12.9669V11.0332C22 10.6003 22 10.3838 21.8969 10.2493C21.7938 10.1147 21.5329 10.0443 21.011 9.90358C19.0606 9.37759 17.8399 7.33851 18.3433 5.40087C18.4817 4.86799 18.5509 4.60156 18.4848 4.44529C18.4187 4.28902 18.2291 4.18134 17.8497 3.96596L16.125 2.98673C15.7528 2.77539 15.5667 2.66972 15.3997 2.69222C15.2326 2.71472 15.0442 2.90273 14.6672 3.27873C13.208 4.73448 10.7936 4.73442 9.33434 3.27864C8.95743 2.90263 8.76898 2.71463 8.60193 2.69212C8.43489 2.66962 8.24877 2.77529 7.87653 2.98663L6.15184 3.96587C5.77253 4.18123 5.58287 4.28891 5.51678 4.44515C5.45068 4.6014 5.51987 4.86787 5.65825 5.4008C6.16137 7.3385 4.93972 9.37763 2.98902 9.9036C2.46712 10.0443 2.20617 10.1147 2.10308 10.2492C2 10.3838 2 10.6003 2 11.0332V12.9669C2 13.3998 2 13.6163 2.10308 13.7508C2.20615 13.8854 2.46711 13.9558 2.98902 14.0965C4.9394 14.6225 6.16008 16.6616 5.65672 18.5992C5.51829 19.1321 5.44907 19.3985 5.51516 19.5548C5.58126 19.7111 5.77092 19.8188 6.15025 20.0341L7.87495 21.0134C8.24721 21.2247 8.43334 21.3304 8.6004 21.3079C8.76746 21.2854 8.95588 21.0973 9.33271 20.7213C10.7927 19.2644 13.2088 19.2643 14.6689 20.7212C15.0457 21.0973 15.2341 21.2853 15.4012 21.3078C15.5682 21.3303 15.7544 21.2246 16.1266 21.0133L17.8513 20.034C18.2307 19.8187 18.4204 19.711 18.4864 19.5547C18.5525 19.3984 18.4833 19.132 18.3448 18.5991C17.8412 16.6616 19.0609 14.6226 21.011 14.0965Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],Bc=[[`path`,{d:`M18.7088 3.49534C16.8165 2.55382 14.5009 2 12 2C9.4991 2 7.1835 2.55382 5.29116 3.49534C4.36318 3.95706 3.89919 4.18792 3.4496 4.91378C3 5.63965 3 6.34248 3 7.74814V11.2371C3 16.9205 7.54236 20.0804 10.173 21.4338C10.9067 21.8113 11.2735 22 12 22C12.7265 22 13.0933 21.8113 13.8269 21.4338C16.4576 20.0804 21 16.9205 21 11.2371L21 7.74814C21 6.34249 21 5.63966 20.5504 4.91378C20.1008 4.18791 19.6368 3.95706 18.7088 3.49534Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Vc=[[`path`,{d:`M4 12C4 8.72077 4 7.08116 4.81382 5.91891C5.1149 5.48891 5.48891 5.1149 5.91891 4.81382C7.08116 4 8.72077 4 12 4C15.2792 4 16.9188 4 18.0811 4.81382C18.5111 5.1149 18.8851 5.48891 19.1862 5.91891C20 7.08116 20 8.72077 20 12C20 15.2792 20 16.9188 19.1862 18.0811C18.8851 18.5111 18.5111 18.8851 18.0811 19.1862C16.9188 20 15.2792 20 12 20C8.72077 20 7.08116 20 5.91891 19.1862C5.48891 18.8851 5.1149 18.5111 4.81382 18.0811C4 16.9188 4 15.2792 4 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}]],Hc=[[`path`,{d:`M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 2C11.6227 2.33333 11.0945 3.2 12 4M12 20C12.3773 20.3333 12.9055 21.2 12 22M19.5 4.50271C18.9685 4.46982 17.9253 4.72293 18.0042 5.99847M5.49576 17.5C5.52865 18.0315 5.27555 19.0747 4 18.9958M5.00271 4.5C4.96979 5.03202 5.22315 6.0763 6.5 5.99729M18 17.5026C18.5315 17.4715 19.5747 17.7108 19.4958 18.9168M22 12C21.6667 11.6227 20.8 11.0945 20 12M4 11.5C3.66667 11.8773 2.8 12.4055 2 11.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],Uc=[[`path`,{d:`M13 11L18 6`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 7L17 5L19.5 3.5L20.5 4.5L19 7Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M4.02513 8.97487C3.01416 7.96391 2.75095 6.48836 3.23548 5.23548L4.65748 6.65748H6.65748V4.65748L5.23548 3.23548C6.48836 2.75095 7.96391 3.01416 8.97487 4.02513C9.98621 5.03647 10.2493 6.51274 9.76398 7.76593L16.2341 14.236C17.4873 13.7507 18.9635 14.0138 19.9749 15.0251C20.9858 16.0361 21.2491 17.5116 20.7645 18.7645L19.3425 17.3425L17.3425 17.3425V19.3425L18.7645 20.7645C17.5116 21.2491 16.0361 20.9858 15.0251 19.9749C14.0145 18.9643 13.7511 17.4895 14.2349 16.2369L7.76312 9.76507C6.51053 10.2489 5.03571 9.98546 4.02513 8.97487Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M12.203 14.5L6.59897 20.1041C6.07115 20.6319 5.2154 20.6319 4.68758 20.1041L3.89586 19.3124C3.36805 18.7846 3.36805 17.9288 3.89586 17.401L9.49994 11.7969`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Wc=[[`path`,{d:`M6 5.5C6 4.56538 6 4.09808 6.20096 3.75C6.33261 3.52197 6.52197 3.33261 6.75 3.20096C7.09808 3 7.56538 3 8.5 3H11.5C12.4346 3 12.9019 3 13.25 3.20096C13.478 3.33261 13.6674 3.52197 13.799 3.75C14 4.09808 14 4.56538 14 5.5C14 6.43462 14 6.90192 13.799 7.25C13.6674 7.47803 13.478 7.66739 13.25 7.79904C12.9019 8 12.4346 8 11.5 8H8.5C7.56538 8 7.09808 8 6.75 7.79904C6.52197 7.66739 6.33261 7.47803 6.20096 7.25C6 6.90192 6 6.43462 6 5.5Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6 15.5C6 14.5654 6 14.0981 6.20096 13.75C6.33261 13.522 6.52197 13.3326 6.75 13.201C7.09808 13 7.56538 13 8.5 13H11.5C12.4346 13 12.9019 13 13.25 13.201C13.478 13.3326 13.6674 13.522 13.799 13.75C14 14.0981 14 14.5654 14 15.5C14 16.4346 14 16.9019 13.799 17.25C13.6674 17.478 13.478 17.6674 13.25 17.799C12.9019 18 12.4346 18 11.5 18H8.5C7.56538 18 7.09808 18 6.75 17.799C6.52197 17.6674 6.33261 17.478 6.20096 17.25C6 16.9019 6 16.4346 6 15.5Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M20.8398 17.1408C21.6133 16.3673 22 15.9806 22 15.5C22 15.0194 21.6133 14.6327 20.8398 13.8592L20.6408 13.6602C19.8673 12.8867 19.4806 12.5 19 12.5C18.5194 12.5 18.1327 12.8867 17.3592 13.6602L17.1602 13.8592C16.3867 14.6327 16 15.0194 16 15.5C16 15.9806 16.3867 16.3673 17.1602 17.1408L17.3592 17.3398C18.1327 18.1133 18.5194 18.5 19 18.5C19.4806 18.5 19.8673 18.1133 20.6408 17.3398L20.8398 17.1408Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6.006 5.5H2.00781M2.00781 5.5V2M2.00781 5.5V12C2.00781 13.1037 1.85651 14.4679 2.89627 15.1629C3.40049 15.5 4.1024 15.5 5.50623 15.5M14.0024 15.5H16.0015M19.0001 12.5V9.5C19.0001 7.61438 19.0001 6.67157 18.4146 6.08579C17.8291 5.5 16.8867 5.5 15.0019 5.5H14.0024`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M22.0001 22C21.0682 22 20.6023 22 20.2348 21.8695C19.7447 21.6955 19.3554 21.3618 19.1524 20.9417C19.0001 20.6267 19.0001 20.2273 19.0001 19.4286V19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],Gc=[[`path`,{d:`M20.3584 13.3567C19.1689 14.546 16.9308 14.4998 13.4992 14.4998C11.2914 14.4998 9.50138 12.7071 9.50024 10.4993C9.50024 7.07001 9.454 4.83065 10.6435 3.64138C11.8329 2.45212 12.3583 2.50027 17.6274 2.50027C18.1366 2.49809 18.3929 3.11389 18.0329 3.47394L15.3199 6.18714C14.6313 6.87582 14.6294 7.99233 15.3181 8.68092C16.0068 9.36952 17.1234 9.36959 17.8122 8.68109L20.5259 5.96855C20.886 5.60859 21.5019 5.86483 21.4997 6.37395C21.4997 11.6422 21.5479 12.1675 20.3584 13.3567Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M13.5 14.5L7.32842 20.6716C6.22386 21.7761 4.433 21.7761 3.32843 20.6716C2.22386 19.567 2.22386 17.7761 3.32843 16.6716L9.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5.50896 18.5H5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,key:`2`}]],Kc=Object.defineProperty,qc=(e,t)=>Kc(e,`name`,{value:t,configurable:!0});function Jc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}qc(Jc,`setRef`);function Yc(...e){return t=>{let n=!1,r=e.map(e=>{let r=Jc(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():Jc(e[t],null)}}}}qc(Yc,`composeRefs`);function Xc(...e){return C.useCallback(Yc(...e),e)}qc(Xc,`useComposedRefs`);var Zc=Object.defineProperty,Qc=(e,t)=>Zc(e,`name`,{value:t,configurable:!0});function $c(e){let t=C.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];cl(r)&&typeof fl==`function`&&(r=fl(r._payload)),C.Children.forEach(r,e=>{if(ol(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;cl(n)&&typeof fl==`function`&&(n=fl(n._payload)),a=rl(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=C.cloneElement(a,void 0,s):!o&&C.Children.count(r)===1&&C.isValidElement(r)&&(a=r);let c=a?al(a):void 0,l=Xc(n,c);if(!a){if(r||r===0)throw Error(o?dl(e):ul(e));return r}let u=il(i,a.props??{});return a.type!==C.Fragment&&(u.ref=n?l:c),C.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Qc($c,`createSlot`);var el=$c(`Slot`),tl=Symbol.for(`radix.slottable`);function nl(e){let t=Qc(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=tl,t}Qc(nl,`createSlottable`);var rl=Qc((e,t)=>{if(`child`in e.props){let t=e.props.child;return C.isValidElement(t)?C.cloneElement(t,void 0,e.props.children(t.props.children)):null}return C.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function il(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(` `))}return{...e,...n}}Qc(il,`mergeProps`);function al(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)}Qc(al,`getElementRef`);function ol(e){return C.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===tl}Qc(ol,`isSlottable`);var sl=Symbol.for(`react.lazy`);function cl(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===sl&&`_payload`in e&&ll(e._payload)}Qc(cl,`isLazyComponent`);function ll(e){return typeof e==`object`&&!!e&&`then`in e}Qc(ll,`isPromiseLike`);var ul=Qc(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),dl=Qc(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),fl=C.use,pl=n(`inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-semibold shadow-none transition duration-200 ease-out active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-ring/35 focus-visible:ring-offset-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`border border-foreground/45 bg-foreground text-background hover:bg-foreground/90`,ghost:`border border-transparent bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground`,destructive:`border border-destructive bg-destructive text-destructive-foreground hover:bg-destructive/90`,secondary:`border border-border/80 bg-secondary text-secondary-foreground hover:border-muted-foreground/45 hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 px-3`,icon:`h-8 w-8 p-0`,sm:`h-8 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function ml({className:e,variant:t,size:n,asChild:r=!1,...i}){return(0,z.jsx)(r?el:`button`,{className:a(pl({variant:t,size:n,className:e})),...i})}var hl={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`},gl=(0,C.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n,absoluteStrokeWidth:r=!1,className:i=``,altIcon:a,showAlt:o=!1,icon:s,primaryColor:c,secondaryColor:l,disableSecondaryOpacity:u=!1,...d},f)=>{let p=n===void 0?void 0:r?Number(n)*24/Number(t):n,m=p===void 0?{}:{strokeWidth:p,stroke:`currentColor`};return(0,C.createElement)(`svg`,{ref:f,...hl,width:t,height:t,color:c||e,className:i,...m,...d},[...o&&a?a:s].sort(([,e],[,t])=>{let n=e.opacity!==void 0;return t.opacity===void 0?n?-1:0:1}).map(([t,n])=>{let r=n.opacity!==void 0,i=r&&!u?n.opacity:void 0,a=l?{...n.stroke===void 0?{fill:r?l:c||e}:{stroke:r?l:c||e}}:{};return(0,C.createElement)(t,{...n,...m,...a,opacity:i,key:n.key})}))});gl.displayName=`HugeiconsIcon`;function _l({color:e=`currentColor`,strokeWidth:t=1.5,...n}){return(0,z.jsx)(gl,{color:e,strokeWidth:t,...n})}function vl(e){return e.flatMap(e=>e.sources.map((t,n)=>({key:`${e.agentId}:${xl(t,n)}`,agentId:e.agentId,agentName:e.agentName??e.agentId,source:bl(t,n)})))}var yl=[{id:`static-context`,label:`Static Context`},{id:`dynamic-context`,label:`Dynamic Context`},{id:`dynamic-tools`,label:`Dynamic Tools`},{id:`retrieval-log`,label:`Retrieval Log`}];function bl(e,t){return e.sourceId===void 0?{...e,sourceId:Sl(e,t)}:e}function xl(e,t=0){return e.sourceId??Sl(e,t)}function Sl(e,t){switch(e.kind){case`static_context`:return`static-context`;case`dynamic_context`:return`dynamic-context-${e.registrationIndex??t}`;case`dynamic_tools`:return`dynamic-tools-${e.registrationIndex??t}`}}function Cl(e){switch(e){case`static_context`:return`Static context`;case`dynamic_context`:return`Dynamic context`;case`dynamic_tools`:return`Dynamic tools`}}function wl(e){switch(e){case`static-context`:return`static_context`;case`dynamic-context`:return`dynamic_context`;case`dynamic-tools`:return`dynamic_tools`;case`retrieval-log`:return}}function Tl(e){return yl.find(t=>t.id===e)?.label??`Knowledge`}function El(e){let t=Dl(e.icon);return(0,z.jsxs)(ml,{className:a(`studio-sidebar-nav-button h-9 min-h-9 w-full justify-start gap-3 rounded-lg bg-transparent px-2.5 py-0.5 text-base font-medium text-sidebar-foreground/62 shadow-none transition duration-200 hover:text-sidebar-foreground active:translate-y-px [&_svg]:h-[17px] [&_svg]:w-[17px]`,e.active&&`studio-sidebar-nav-button-active text-sidebar-accent-foreground`),variant:`ghost`,type:`button`,disabled:e.disabled,onClick:e.onClick,children:[(0,z.jsx)(_l,{icon:t}),(0,z.jsx)(`span`,{children:e.label})]})}function Dl(e){switch(e){case`activity`:return rc;case`bot`:return Lc;case`book-open-text`:return dc;case`container`:return _c;case`database`:return Sc;case`database-lightning`:return xc;case`gauge`:return Oc;case`list`:return Ac;case`message`:return mc;case`plug`:return Fc;case`search-list`:return Rc;case`shield`:return Bc;case`tools`:return Uc;case`wrench`:return Gc;case`workflow`:return Wc}}var Ol={"static-context":`book-open-text`,"dynamic-context":`database-lightning`,"dynamic-tools":`tools`,"retrieval-log":`search-list`};function kl(e){return(0,z.jsxs)(`aside`,{className:`flex h-[100dvh] min-h-0 flex-col overflow-hidden border-r border-sidebar-border bg-sidebar text-sidebar-foreground`,children:[(0,z.jsx)(`div`,{className:`flex h-15 items-center px-4`,children:(0,z.jsxs)(`div`,{className:`studio-logo-lockup min-w-0`,children:[(0,z.jsx)(`img`,{className:`h-auto w-[92px] shrink-0 object-contain`,src:Fs,alt:`Anvia`}),(0,z.jsx)(`span`,{className:`studio-logo-badge`,children:`Studio`})]})}),(0,z.jsxs)(`nav`,{className:`grid gap-0.5 px-3 py-3`,"aria-label":`Main`,children:[(0,z.jsx)(`div`,{className:`px-2.5 pb-1.5 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground opacity-50`,children:`Workspace`}),(0,z.jsx)(El,{active:e.activePage===`playground`,disabled:!e.hasAgents,icon:`message`,label:`Chat`,onClick:()=>e.onNavigate(`playground`)}),(0,z.jsx)(El,{active:e.activePage===`pipelines`,disabled:!e.pipelinesEnabled,icon:`workflow`,label:`Pipelines`,onClick:()=>e.onNavigate(`pipelines`)}),(0,z.jsx)(El,{active:e.activePage===`evals`,disabled:!e.evalsEnabled,icon:`gauge`,label:`Evals`,onClick:()=>e.onNavigate(`evals`)}),(0,z.jsx)(El,{active:e.activePage===`sessions`,disabled:!e.sessionsEnabled,icon:`list`,label:`Sessions`,onClick:()=>e.onNavigate(`sessions`)}),(0,z.jsx)(El,{active:e.activePage===`tracing`,disabled:!e.tracesEnabled,icon:`activity`,label:`Traces`,onClick:()=>e.onNavigate(`tracing`)})]}),(0,z.jsxs)(`nav`,{className:`grid gap-0.5 px-3 py-3`,"aria-label":`Studio`,children:[(0,z.jsx)(`div`,{className:`px-2.5 pb-1.5 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground opacity-50`,children:`Inspect`}),(0,z.jsx)(El,{active:e.activePage===`agents`,icon:`bot`,label:`Studio`,onClick:()=>e.onNavigate(`agents`)}),(0,z.jsx)(El,{active:e.activePage===`tools`,disabled:!e.toolsEnabled,icon:`wrench`,label:`Tools`,onClick:()=>e.onNavigate(`tools`)}),(0,z.jsx)(El,{active:e.activePage===`sandboxes`,disabled:!e.sandboxesEnabled,icon:`container`,label:`Sandboxes`,onClick:()=>e.onNavigate(`sandboxes`)}),(0,z.jsx)(El,{active:e.activePage===`mcps`,disabled:!e.mcpsEnabled,icon:`plug`,label:`MCPs`,onClick:()=>e.onNavigate(`mcps`)}),yl.map(t=>(0,z.jsx)(El,{active:e.activePage===`knowledge`&&e.knowledgeTab===t.id,disabled:!e.knowledgeEnabled,icon:Ol[t.id],label:t.label,onClick:()=>e.onNavigateKnowledgeTab(t.id)},t.id)),(0,z.jsx)(El,{active:e.activePage===`memory`,disabled:!e.memoryEnabled,icon:`database`,label:`Memory`,onClick:()=>e.onNavigate(`memory`)}),(0,z.jsx)(El,{active:e.activePage===`status`,disabled:!e.statusEnabled,icon:`gauge`,label:`Status`,onClick:()=>e.onNavigate(`status`)})]}),(0,z.jsxs)(`div`,{className:`mt-auto px-3 py-3`,children:[(0,z.jsx)(`nav`,{className:`grid gap-1`,"aria-label":`Anvia links`,children:(0,z.jsx)(jl,{href:`https://anvia.dev/docs`,label:`Anvia Docs`})}),(0,z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:e.status})]})]})}function Al(e){return(0,z.jsx)(`header`,{className:`grid min-h-13 border-b border-border bg-background/88 backdrop-blur`,children:(0,z.jsxs)(`div`,{className:`grid min-h-13 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 py-0 pl-4 pr-6`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:[(0,z.jsx)(`span`,{className:`text-foreground`,children:e.activePage===`playground`?`Agents`:`Studio`}),(0,z.jsx)(`span`,{className:`text-muted-foreground`,children:`/`}),(0,z.jsx)(`span`,{className:`truncate`,children:e.selectedAgentLabel})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(ml,{"aria-label":e.theme===`dark`?`Switch to light theme`:`Switch to dark theme`,className:`h-8 min-h-8 w-8 border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-muted/45 hover:text-foreground`,title:e.theme===`dark`?`Switch to light theme`:`Switch to dark theme`,type:`button`,variant:`ghost`,size:`icon`,onClick:e.onToggleTheme,children:e.theme===`dark`?(0,z.jsx)(_l,{icon:Hc,"aria-hidden":`true`}):(0,z.jsx)(_l,{icon:Mc,"aria-hidden":`true`})}),(0,z.jsx)(ml,{className:`h-8 min-h-8 rounded-lg border border-white bg-white px-3 text-xs text-black shadow-none [box-shadow:none] hover:border-white hover:bg-white/90 hover:text-black focus-visible:ring-0 active:bg-white/85 disabled:bg-muted disabled:text-muted-foreground`,type:`button`,variant:`ghost`,disabled:!e.sessionsEnabled,onClick:e.onNewSession,children:`New session`})]})]})})}function jl(e){return(0,z.jsxs)(`a`,{className:`flex h-8 min-h-8 items-center justify-between rounded-lg px-2 text-xs font-semibold text-sidebar-foreground/62 transition duration-200 hover:bg-sidebar-accent hover:text-sidebar-foreground`,href:e.href,target:`_blank`,rel:`noreferrer`,children:[(0,z.jsx)(`span`,{children:e.label}),(0,z.jsx)(_l,{icon:Tc,"aria-hidden":`true`,className:`h-3 w-3 text-muted-foreground`})]})}function Ml(){let e=Bs();return(0,z.jsxs)(`div`,{className:`grid h-[100dvh] min-h-0 overflow-hidden bg-background text-foreground lg:grid-cols-[228px_minmax(0,1fr)]`,children:[(0,z.jsx)(kl,{activePage:e.activePage,evalsEnabled:e.evalsEnabled,hasAgents:e.hasAgents,knowledgeEnabled:e.knowledgeEnabled,mcpsEnabled:e.mcpsEnabled,memoryEnabled:e.memoryEnabled,pipelinesEnabled:e.pipelinesEnabled,sandboxesEnabled:e.sandboxesEnabled,sessionsEnabled:e.sessionsEnabled,status:e.status,statusEnabled:e.statusEnabled,toolsEnabled:e.toolsEnabled,tracesEnabled:e.tracesEnabled,knowledgeTab:e.knowledgeTab,onNavigate:e.navigatePage,onNavigateKnowledgeTab:e.navigateKnowledgeTab}),(0,z.jsxs)(`main`,{className:`grid h-[100dvh] min-w-0 grid-rows-[52px_minmax(0,1fr)] overflow-hidden bg-background/80`,children:[(0,z.jsx)(Al,{activePage:e.activePage,selectedAgentLabel:e.activePage===`sandboxes`?`Sandboxes`:e.selectedAgent?.name??e.selectedAgent?.id??`Agent`,sessionsEnabled:e.sessionsEnabled,theme:e.theme,onNavigate:e.navigatePage,onNewSession:()=>e.startNewChat(),onToggleTheme:e.toggleTheme}),(0,z.jsx)(Vr,{})]}),(0,z.jsx)(C.Suspense,{fallback:null,children:(0,z.jsx)($s,{session:e.deleteCandidate,onOpenChange:t=>{t||e.setDeleteCandidate(void 0)},onConfirm:t=>{e.sessions.deleteSession(t).finally(()=>{e.setDeleteCandidate(void 0)})}})})]})}function Nl(e){let t=Bs(),{activateRoute:n}=t;return(0,C.useEffect)(()=>{n(e)},[n,e]),t}function Pl(e){switch(e){case`dynamic-context`:case`dynamic-tools`:case`retrieval-log`:case`static-context`:return e;default:return`static-context`}}function Fl(){let e=Nl(`agents`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Gs,{agents:e.agents,selectedAgentId:e.selectedAgentId})})}function Il(e){let[t,n]=(0,C.useState)(``),[r,i]=(0,C.useState)(),[a,o]=(0,C.useState)(`idle`);async function c(){let n=t||e.evals[0]?.id||``;if(!(n.length===0||a===`running`)){o(`running`),i(void 0),e.onError(``);try{let t=await fetch(`/evals/${encodeURIComponent(n)}/runs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({})});if(!t.ok)throw Error(await Ho(t,`Eval run failed`));i(await t.json()),e.onStatus(`Connected`)}catch(t){e.onError(s(t))}finally{o(`idle`)}}}return(0,z.jsx)(Ks,{evals:e.evals,selectedEvalId:t,enabled:e.enabled,runState:a,result:r,onSelectEval:e=>{n(e),i(void 0)},onRun:()=>void c()})}function Ll(){let e=Nl(`evals`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Il,{evals:e.evals,enabled:e.evalsEnabled,onError:e.setError,onStatus:e.setStatus})})}function Rl(e){let[t,n]=(0,C.useState)(``),[r,i]=(0,C.useState)(),[a,o]=(0,C.useState)(`idle`),c=(0,C.useCallback)(async t=>{if(!e.enabled||t.length===0){i(void 0);return}o(`loading`);try{let e=await fetch(`/agents/${encodeURIComponent(t)}/tools`);if(!e.ok)throw Error(`Tools failed with HTTP ${e.status}`);i(await e.json())}catch(t){e.onError(s(t)),i(void 0)}finally{o(`idle`)}},[e.enabled,e.onError]);return(0,C.useEffect)(()=>{e.active&&c(t||e.selectedAgentId)},[e.active,c,e.selectedAgentId,t]),(0,z.jsx)(tc,{agents:e.agents,selectedAgentId:t||e.selectedAgentId,summary:r,enabled:e.enabled,loading:a===`loading`,onSelectAgent:e=>{n(e),c(e)}})}function zl(e){let[t,n]=(0,C.useState)(``),[r,i]=(0,C.useState)(),[a,o]=(0,C.useState)(`idle`),c=(0,C.useCallback)(async t=>{if(!e.enabled||t.length===0){i(void 0);return}o(`loading`);try{let e=await fetch(`/agents/${encodeURIComponent(t)}/mcps`);if(!e.ok)throw Error(`MCPs failed with HTTP ${e.status}`);i(await e.json())}catch(t){e.onError(s(t)),i(void 0)}finally{o(`idle`)}},[e.enabled,e.onError]);return(0,C.useEffect)(()=>{e.active&&c(t||e.selectedAgentId)},[e.active,c,t,e.selectedAgentId]),(0,z.jsx)(Js,{agents:e.agents,selectedAgentId:t||e.selectedAgentId,summary:r,enabled:e.enabled,loading:a===`loading`,onSelectAgent:e=>{n(e),c(e)}})}function G(e){let[t,n]=(0,C.useState)(),[r,i]=(0,C.useState)(`idle`),a=(0,C.useCallback)(async()=>{if(!e.enabled){n(void 0);return}i(`loading`);try{let e=await fetch(`/knowledge?limit=25`);if(!e.ok)throw Error(`Knowledge failed with HTTP ${e.status}`);n(await e.json())}catch(t){e.onError(s(t))}finally{i(`idle`)}},[e.enabled,e.onError]);return(0,C.useEffect)(()=>{e.active&&a()},[e.active,a]),(0,z.jsx)(qs,{activeTab:e.activeTab,enabled:e.enabled,summary:t,loading:r===`loading`,onOpenTrace:e.onOpenTrace,onRefresh:()=>void a()})}function K(){let e=Nl(`knowledge`),{setKnowledgeTab:t}=e,n=Pl(cr({strict:!1}).tab);return(0,C.useEffect)(()=>{t(n)},[t,n]),(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(G,{active:!0,activeTab:n,enabled:e.knowledgeEnabled,onError:e.setError,onOpenTrace:e.traces.selectTrace})})}function q(){let e=Nl(`mcps`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(zl,{active:!0,agents:e.agents,enabled:e.mcpsEnabled,selectedAgentId:e.selectedAgent?.id||e.selectedAgentId,onError:e.setError})})}function J(){let e=Nl(`memory`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Ys,{agents:e.agents,enabled:e.memoryEnabled})})}var Y=da({endpoint:e=>e.endpoint,method:`POST`,format:`jsonl`,headers:{"content-type":`application/json`},body:e=>JSON.stringify(e.body)});function Bl(e){let[t,n]=(0,C.useState)(``),[r,i]=(0,C.useState)(),[a,o]=(0,C.useState)([]),[c,l]=(0,C.useState)([]),[u,d]=(0,C.useState)(`"Hello from Studio"`),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(``),[g,_]=(0,C.useState)(`idle`),[v,y]=(0,C.useState)(`idle`),[b,x]=(0,C.useState)(`idle`),[S,w]=(0,C.useState)(`idle`),T=(0,C.useRef)(0),E=(0,C.useRef)(0),D=(0,C.useCallback)(async t=>{if(!e.enabled||t.length===0)return E.current+=1,o([]),[];let n=E.current+1;E.current=n,y(`loading`);try{let e=new URLSearchParams({limit:`1000`}),r=await fetch(`/pipelines/${encodeURIComponent(t)}/logs?${e}`);if(!r.ok)throw Error(`Pipeline logs failed with HTTP ${r.status}`);let i=await r.json();return E.current===n&&o(i.logs),i.logs}catch(t){return E.current===n&&(e.onError(s(t)),o([])),[]}finally{E.current===n&&y(`idle`)}},[e.enabled,e.onError]),O=(0,C.useCallback)(async t=>{if(!e.enabled||t.length===0)return l([]),[];x(`loading`);try{let e=new URLSearchParams({limit:`50`}),n=await fetch(`/pipelines/${encodeURIComponent(t)}/runs?${e}`);if(!n.ok)throw Error(`Pipeline runs failed with HTTP ${n.status}`);let r=await n.json();return l(r.runs),r.runs}catch(t){return e.onError(s(t)),l([]),[]}finally{x(`idle`)}},[e.enabled,e.onError]),k=(0,C.useCallback)(async t=>{if(!e.enabled||t.length===0){T.current+=1,i(void 0),o([]),l([]);return}let r=T.current+1;T.current=r,_(`loading`),e.onError(``);try{let e=await fetch(`/pipelines/${encodeURIComponent(t)}`);if(!e.ok)throw Error(`Pipeline load failed with HTTP ${e.status}`);let a=await e.json();if(T.current!==r)return;n(t),i(a),await Promise.all([D(t),O(t)])}catch(t){T.current===r&&(e.onError(s(t)),i(void 0))}finally{T.current===r&&_(`idle`)}},[D,O,e.enabled,e.onError]);(0,C.useEffect)(()=>{if(!e.active)return;let n=t||e.pipelines[0]?.id||``;n.length>0&&k(n)},[e.active,e.pipelines,k,t]);async function A(e){for await(let t of e){if(Qr(t)){t.log.runId!==void 0&&h(e=>e||t.log.runId||``),ee(t.log),await is();continue}if($r(t)){p(Hl(t.output)),await is();continue}if(ei(t))throw Error(JSON.stringify(t.error))}}async function j(){let n=t||e.pipelines[0]?.id||``;if(n.length===0||S===`running`)return;let r;try{r=JSON.parse(u)}catch{e.onError(`Pipeline input must be valid JSON`);return}w(`running`),p(``),h(``),e.onError(``);try{await A(Y.send({endpoint:`/pipelines/${encodeURIComponent(n)}/runs`,body:{input:r,stream:!0,metadata:{source:`anvia-studio`}}})),await Promise.all([D(n),O(n)]),e.onStatus(`Connected`)}catch(t){e.onError(Vl(t,`Pipeline run failed`))}finally{w(`idle`)}}async function M(n){let r=t||e.pipelines[0]?.id||``;if(!(r.length===0||n.length===0||S===`running`)){w(`running`),p(``),h(``),e.onError(``);try{await A(Y.send({endpoint:`/pipelines/${encodeURIComponent(r)}/runs/${encodeURIComponent(n)}/replay`,body:{stream:!0,metadata:{source:`anvia-studio`}}})),await Promise.all([D(r),O(r)]),e.onStatus(`Connected`)}catch(t){e.onError(Vl(t,`Pipeline replay failed`))}finally{w(`idle`)}}}function N(e){n(e),p(``),h(``),k(e)}function ee(e){o(t=>t.some(t=>t.id===e.id)?t:[...t,e].sort((e,t)=>e.sequence-t.sequence))}return{selectedPipelineId:t,pipelineDetail:r,pipelineLogs:a,pipelineRuns:c,activePipelineRunId:m,pipelineRunInput:u,pipelineRunOutput:f,pipelineDetailLoadState:g,pipelineLogLoadState:v,pipelineRunLoadState:b,pipelineRunState:S,setPipelineRunInput:d,selectPipeline:N,runPipeline:j,replayPipelineRun:M}}function Vl(e,t){return e instanceof Yi?Wo(e,t):s(e)}function Hl(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function Ul(e){let t=Bl({active:e.active,enabled:e.enabled,pipelines:e.pipelines,onError:e.onError,onStatus:e.onStatus});return(0,z.jsx)(Xs,{pipelines:e.pipelines,selectedPipelineId:t.selectedPipelineId,detail:t.pipelineDetail,logs:t.pipelineLogs,activeRunId:t.activePipelineRunId,runs:t.pipelineRuns,enabled:e.enabled,detailLoading:t.pipelineDetailLoadState===`loading`,logsLoading:t.pipelineLogLoadState===`loading`,runsLoading:t.pipelineRunLoadState===`loading`,runState:t.pipelineRunState,runInput:t.pipelineRunInput,runOutput:t.pipelineRunOutput,theme:e.theme,activeTab:e.activeTab,onSelectPipeline:t.selectPipeline,onRunInputChange:t.setPipelineRunInput,onRun:()=>void t.runPipeline(),onTabChange:e.onTabChange,onReplayRun:e=>void t.replayPipelineRun(e)})}function Wl(){let e=Nl(`pipelines`),[t,n]=(0,C.useState)(()=>Gl());(0,C.useEffect)(()=>{function e(){n(Gl())}return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let r=(0,C.useCallback)(e=>{n(e);let t=new URL(window.location.href);t.searchParams.set(`tab`,e);let r=`${t.pathname}${t.search}${t.hash}`;`${window.location.pathname}${window.location.search}${window.location.hash}`!==r&&window.history.pushState(null,``,r)},[]);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Ul,{active:!0,activeTab:t,pipelines:e.pipelines,enabled:e.pipelinesEnabled,theme:e.theme,onError:e.setError,onStatus:e.setStatus,onTabChange:r})})}function Gl(){return Kl(window.location.search)}function Kl(e){let t=new URLSearchParams(e).get(`tab`);return t===`metadata`||t===`runs`||t===`logs`?t:`input`}var ql=Object.defineProperty,Jl=(e,t)=>ql(e,`name`,{value:t,configurable:!0});function Yl(e,[t,n]){return Math.min(n,Math.max(t,e))}Jl(Yl,`clamp`);var Xl=Object.defineProperty,Zl=(e,t)=>Xl(e,`name`,{value:t,configurable:!0}),Ql=!!(typeof window<`u`&&window.document&&window.document.createElement);function $l(e,t,{checkForDefaultPrevented:n=!0}={}){return Zl(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Zl($l,`composeEventHandlers`);function eu(e){if(!Ql)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Zl(eu,`getOwnerWindow`);function tu(e){if(!Ql)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Zl(tu,`getOwnerDocument`);function nu(e,t=!1){let{activeElement:n}=tu(e);if(!n?.nodeName)return null;if(ru(n)&&n.contentDocument)return nu(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=tu(n).getElementById(e);if(t)return t}}return n}Zl(nu,`getActiveElement`);function ru(e){return e.tagName===`IFRAME`}Zl(ru,`isFrame`);var iu=Object.defineProperty,X=(e,t)=>iu(e,`name`,{value:t,configurable:!0});function au(e,t){let n=C.createContext(t);n.displayName=e+`Context`;let r=X(e=>{let{children:t,...r}=e,i=C.useMemo(()=>r,Object.values(r));return(0,z.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=C.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return X(i,`useContext`),[r,i]}X(au,`createContext`);function ou(e,t=[]){let n=[];function r(t,r){let i=C.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=X(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=C.useMemo(()=>o,Object.values(o));return(0,z.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=C.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return X(s,`useContext`),[o,s]}X(r,`createContext`);let i=X(()=>{let t=n.map(e=>C.createContext(e));return X(function(n){let r=n?.[e]||t;return C.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,su(i,...t)]}X(ou,`createContextScope`);function su(...e){let t=e[0];if(e.length===1)return t;let n=X(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return X(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}X(su,`composeContextScopes`);var cu=Object.defineProperty,lu=(e,t)=>cu(e,`name`,{value:t,configurable:!0});function uu(e){let t=e+`CollectionProvider`,[n,r]=ou(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=lu(e=>{let{scope:t,children:n}=e,r=C.useRef(null),a=C.useRef(new Map).current;return(0,z.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=$c(s),l=C.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,z.jsx)(c,{ref:Xc(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=$c(u),p=C.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=C.useRef(null),s=Xc(t,o),c=a(u,n);return C.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,z.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return C.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return lu(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}lu(uu,`createCollection`);var du=new WeakMap,fu=class e extends Map{static{lu(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],du.set(this,!0)}set(e,t){return du.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=hu(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t===void 0?!1:this.delete(t)}at(e){let t=pu(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=pu(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return pu(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function pu(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=mu(e,t);return n===-1?void 0:e[n]}lu(pu,`at`);function mu(e,t){let n=e.length,r=hu(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}lu(mu,`toSafeIndex`);function hu(e){return e!==e||e===0?0:Math.trunc(e)}lu(hu,`toSafeInteger`);function gu(e){let t=e+`CollectionProvider`,[n,r]=ou(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new fu,setItemMap:lu(()=>void 0,`setItemMap`)}),o=lu(({state:e,...t})=>e?(0,z.jsx)(c,{...t,state:e}):(0,z.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=lu(e=>{let t=h();return(0,z.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=lu(e=>{let{scope:t,children:n,state:r}=e,a=C.useRef(null),[o,s]=C.useState(null),c=Xc(a,s),[l,u]=r;return C.useEffect(()=>{if(!o)return;let e=bu(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,z.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=$c(l),d=C.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,z.jsx)(u,{ref:Xc(t,a(l,n).collectionRef),children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=$c(f),m=C.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=C.useRef(null),[s,c]=C.useState(null),l=Xc(t,o,c),{setItemMap:u}=a(f,n),d=C.useRef(i);_u(d.current,i)||(d.current=i);let m=d.current;return C.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(yu):(t.set(s,{...e,element:s}),t.toSorted(yu)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new fu(e)))}},[s,m,u]),(0,z.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return C.useState(new fu)}lu(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return lu(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}lu(gu,`createCollection`);function _u(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}lu(_u,`shallowEqual`);function vu(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}lu(vu,`isElementPreceding`);function yu(e,t){return!e[1].element||!t[1].element?0:vu(e[1].element,t[1].element)?-1:1}lu(yu,`sortByDocumentPosition`);function bu(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}lu(bu,`getChildListObserver`);var xu=Object.defineProperty,Su=(e,t)=>xu(e,`name`,{value:t,configurable:!0}),Cu=C.createContext(void 0);function wu(e){let t=C.useContext(Cu);return e||t||`ltr`}Su(wu,`useDirection`);var Tu=Object.defineProperty,Eu=(e,t)=>Tu(e,`name`,{value:t,configurable:!0}),Du=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=$c(`Primitive.${t}`),r=C.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,z.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ou(e,t){e&&pr.flushSync(()=>e.dispatchEvent(t))}Eu(Ou,`dispatchDiscreteCustomEvent`);var ku=Object.defineProperty,Au=(e,t)=>ku(e,`name`,{value:t,configurable:!0});function ju(e){let t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>((...e)=>t.current?.(...e)),[])}Au(ju,`useCallbackRef`);var Mu=Object.defineProperty,Nu=(e,t)=>Mu(e,`name`,{value:t,configurable:!0}),Pu=`dismissableLayer.update`,Fu=`dismissableLayer.pointerDownOutside`,Iu=`dismissableLayer.focusOutside`,Lu,Ru=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),zu=C.forwardRef(Nu(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=C.useContext(Ru),[d,f]=C.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=C.useState({}),h=Xc(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=C.useRef(!1),w=Hu(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:C.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),T=Uu(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?y===g.length-1:!1,D=ju(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return C.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),C.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Lu=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Wu(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Lu))}},[d,p,n,u]),C.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Wu())},[d,u]),C.useEffect(()=>{let e=Nu(()=>m({}),`handleUpdate`);return document.addEventListener(Pu,e),()=>document.removeEventListener(Pu,e)},[]),(0,z.jsx)(Du.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:$l(e.onFocusCapture,T.onFocusCapture),onBlurCapture:$l(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:$l(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Bu(){let e=C.useContext(Ru),[t,n]=C.useState(null);return C.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Nu(Bu,`useDismissableLayerSurface`);var Vu=Nu(()=>!0,`IS_TRUE`);function Hu(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Vu}=t,s=ju(e),c=C.useRef(!1),l=C.useRef(!1),u=C.useRef(new Map),d=C.useRef(()=>{});return C.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Nu(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Nu(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)}Nu(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Nu(p,`handleInteractionBubble`);let m=Nu(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Z(Fu,s,p,{discrete:!0})};if(Nu(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:Nu(()=>c.current=!0,`onPointerDownCapture`)}}Nu(Hu,`usePointerDownOutside`);function Uu(e,t=globalThis?.document){let n=ju(e),r=C.useRef(!1);return C.useEffect(()=>{let e=Nu(e=>{e.target&&!r.current&&Z(Iu,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Nu(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Nu(()=>r.current=!1,`onBlurCapture`)}}Nu(Uu,`useFocusOutside`);function Wu(){let e=new CustomEvent(Pu);document.dispatchEvent(e)}Nu(Wu,`dispatchUpdate`);function Z(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?Ou(i,a):i.dispatchEvent(a)}Nu(Z,`handleAndDispatchCustomEvent`);var Gu=Object.defineProperty,Ku=(e,t)=>Gu(e,`name`,{value:t,configurable:!0}),qu=0,Ju=null;function Yu(e){return Xu(),e.children}Ku(Yu,`FocusGuards`);function Xu(){C.useEffect(()=>{Ju||={start:Zu(),end:Zu()};let{start:e,end:t}=Ju;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),qu++,()=>{qu===1&&(Ju?.start.remove(),Ju?.end.remove(),Ju=null),qu=Math.max(0,qu-1)}},[])}Ku(Xu,`useFocusGuards`);function Zu(){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}Ku(Zu,`createFocusGuard`);var Qu=Object.defineProperty,$u=(e,t)=>Qu(e,`name`,{value:t,configurable:!0}),ed=`focusScope.autoFocusOnMount`,td=`focusScope.autoFocusOnUnmount`,nd={bubbles:!1,cancelable:!0},rd=C.forwardRef($u(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=C.useState(null),l=ju(i),u=ju(a),d=C.useRef(null),f=Xc(t,c),p=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ud(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ud(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ud(s)};$u(e,`handleFocusIn`),$u(t,`handleFocusOut`),$u(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),C.useEffect(()=>{if(s){dd.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ed,nd);s.addEventListener(ed,l),s.dispatchEvent(t),t.defaultPrevented||(id(md(od(s)),{select:!0}),document.activeElement===e&&ud(s))}return()=>{s.removeEventListener(ed,l),setTimeout(()=>{let t=new CustomEvent(td,nd);s.addEventListener(td,u),s.dispatchEvent(t),t.defaultPrevented||ud(e??document.body,{select:!0}),s.removeEventListener(td,u),dd.remove(p)},0)}}},[s,l,u,p]);let m=C.useCallback(e=>{if(!n&&!r||p.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]=ad(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ud(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ud(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,z.jsx)(Du.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function id(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ud(r,{select:t}),document.activeElement!==n)return}$u(id,`focusFirst`);function ad(e){let t=od(e);return[sd(t,e),sd(t.reverse(),e)]}$u(ad,`getTabbableEdges`);function od(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:$u(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}$u(od,`getTabbableCandidates`);function sd(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):cd(r,{upTo:t})))return r}$u(sd,`findVisible`);function cd(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}$u(cd,`isHidden`);function ld(e){return e instanceof HTMLInputElement&&`select`in e}$u(ld,`isSelectableInput`);function ud(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ld(e)&&t&&e.select()}}$u(ud,`focus`);var dd=fd();function fd(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=pd(e,t),e.unshift(t)},remove(t){e=pd(e,t),e[0]?.resume()}}}$u(fd,`createFocusScopesStack`);function pd(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}$u(pd,`arrayRemove`);function md(e){return e.filter(e=>e.tagName!==`A`)}$u(md,`removeLinks`);var hd=globalThis?.document?C.useLayoutEffect:()=>{},gd=Object.defineProperty,_d=(e,t)=>gd(e,`name`,{value:t,configurable:!0}),vd=C.useId||(()=>void 0),yd=0;function Q(e){let[t,n]=C.useState(vd());return hd(()=>{e||n(e=>e??String(yd++))},[e]),e||(t?`radix-${t}`:``)}_d(Q,`useId`);var bd=[`top`,`right`,`bottom`,`left`],xd=Math.min,Sd=Math.max,Cd=Math.round,wd=Math.floor,Td=e=>({x:e,y:e}),Ed={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Dd(e,t,n){return Sd(e,xd(t,n))}function Od(e,t){return typeof e==`function`?e(t):e}function kd(e){return e.split(`-`)[0]}function Ad(e){return e.split(`-`)[1]}function jd(e){return e===`x`?`y`:`x`}function Md(e){return e===`y`?`height`:`width`}function $(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Nd(e){return jd($(e))}function Pd(e,t,n){n===void 0&&(n=!1);let r=Ad(e),i=Nd(e),a=Md(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ud(o)),[o,Ud(o)]}function Fd(e){let t=Ud(e);return[Id(e),t,Id(t)]}function Id(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ld=[`left`,`right`],Rd=[`right`,`left`],zd=[`top`,`bottom`],Bd=[`bottom`,`top`];function Vd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Rd:Ld:t?Ld:Rd;case`left`:case`right`:return t?zd:Bd;default:return[]}}function Hd(e,t,n,r){let i=Ad(e),a=Vd(kd(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Id)))),a}function Ud(e){let t=kd(e);return Ed[t]+e.slice(t.length)}function Wd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Wd(e)}function Kd(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 qd(e,t,n){let{reference:r,floating:i}=e,a=$(t),o=Nd(t),s=Md(o),c=kd(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}}switch(Ad(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Jd(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}=Od(t,e),p=Gd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Kd(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=Kd(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 Yd=50,Xd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Jd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=qd(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<Yd&&(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}=qd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Zd=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}=Od(e,t)||{};if(l==null)return{};let d=Gd(u),f={x:n,y:r},p=Nd(i),m=Md(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=xd(d[_],T),D=xd(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Dd(O,A,k),M=!c.arrow&&Ad(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Qd=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}=Od(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=kd(r),_=$(o),v=kd(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ud(o)]:Fd(o)),x=p!==`none`;!d&&x&&b.push(...Hd(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=Pd(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`&&_!==$(t))||T.every(e=>$(e.placement)===_?e.overflows[0]>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=$(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function $d(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ef(e){return bd.some(t=>e[t]>=0)}var tf=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Od(e,t);switch(i){case`referenceHidden`:{let e=$d(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ef(e)}}}case`escaped`:{let e=$d(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ef(e)}}}default:return{}}}}},nf=new Set([`left`,`top`]);async function rf(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=kd(n),s=Ad(n),c=$(n)===`y`,l=nf.has(o)?-1:1,u=a&&c?-1:1,d=Od(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var af=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await rf(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},of=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Od(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=$(kd(i)),p=jd(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Dd(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Dd(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},sf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Od(e,t),u={x:n,y:r},d=$(i),f=jd(d),p=u[f],m=u[d],h=Od(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=nf.has(kd(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},cf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Od(e,t),u=await o.detectOverflow(t,l),d=kd(i),f=Ad(i),p=$(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=xd(h-u[g],v),x=xd(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Sd(u.left,0),t=Sd(u.right,0),n=Sd(u.top,0),r=Sd(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Sd(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Sd(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function lf(){return typeof window<`u`}function uf(e){return pf(e)?(e.nodeName||``).toLowerCase():`#document`}function df(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ff(e){return((pf(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function pf(e){return lf()?e instanceof Node||e instanceof df(e).Node:!1}function mf(e){return lf()?e instanceof Element||e instanceof df(e).Element:!1}function hf(e){return lf()?e instanceof HTMLElement||e instanceof df(e).HTMLElement:!1}function gf(e){return!lf()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof df(e).ShadowRoot}function _f(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Of(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function vf(e){return/^(table|td|th)$/.test(uf(e))}function yf(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var bf=/transform|translate|scale|rotate|perspective|filter/,xf=/paint|layout|strict|content/,Sf=e=>!!e&&e!==`none`,Cf;function wf(e){let t=mf(e)?Of(e):e;return Sf(t.transform)||Sf(t.translate)||Sf(t.scale)||Sf(t.rotate)||Sf(t.perspective)||!Ef()&&(Sf(t.backdropFilter)||Sf(t.filter))||bf.test(t.willChange||``)||xf.test(t.contain||``)}function Tf(e){let t=Af(e);for(;hf(t)&&!Df(t);){if(wf(t))return t;if(yf(t))return null;t=Af(t)}return null}function Ef(){return Cf??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Cf}function Df(e){return/^(html|body|#document)$/.test(uf(e))}function Of(e){return df(e).getComputedStyle(e)}function kf(e){return mf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Af(e){if(uf(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||gf(e)&&e.host||ff(e);return gf(t)?t.host:t}function jf(e){let t=Af(e);return Df(t)?e.ownerDocument?e.ownerDocument.body:e.body:hf(t)&&_f(t)?t:jf(t)}function Mf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=jf(e),i=r===e.ownerDocument?.body,a=df(r);if(i){let e=Nf(a);return t.concat(a,a.visualViewport||[],_f(r)?r:[],e&&n?Mf(e):[])}else return t.concat(r,Mf(r,[],n))}function Nf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pf(e){let t=Of(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=hf(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Cd(n)!==a||Cd(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ff(e){return mf(e)?e:e.contextElement}function If(e){let t=Ff(e);if(!hf(t))return Td(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Pf(t),o=(a?Cd(n.width):n.width)/r,s=(a?Cd(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Lf=Td(0);function Rf(e){let t=df(e);return!Ef()||!t.visualViewport?Lf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==df(e)?!1:t}function Bf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ff(e),o=Td(1);t&&(r?mf(r)&&(o=If(r)):o=If(e));let s=zf(a,n,r)?Rf(a):Td(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){let e=df(a),t=r&&mf(r)?df(r):r,n=e,i=Nf(n);for(;i&&r&&t!==n;){let e=If(i),t=i.getBoundingClientRect(),r=Of(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=df(i),i=Nf(n)}}return Kd({width:u,height:d,x:c,y:l})}function Vf(e,t){let n=kf(e).scrollLeft;return t?t.left+n:Bf(ff(e)).left+n}function Hf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Vf(e,n),y:n.top+t.scrollTop}}function Uf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ff(r),s=t?yf(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Td(1),u=Td(0),d=hf(r);if((d||!d&&!a)&&((uf(r)!==`body`||_f(o))&&(c=kf(r)),d)){let e=Bf(r);l=If(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Hf(o,c):Td(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 Wf(e){return Array.from(e.getClientRects())}function Gf(e){let t=ff(e),n=kf(e),r=e.ownerDocument.body,i=Sd(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Sd(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Vf(e),s=-n.scrollTop;return Of(r).direction===`rtl`&&(o+=Sd(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Kf=25;function qf(e,t){let n=df(e),r=ff(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ef();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Vf(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Kf&&(a-=o)}else l<=Kf&&(a+=l);return{width:a,height:o,x:s,y:c}}function Jf(e,t){let n=Bf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=hf(e)?If(e):Td(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Yf(e,t,n){let r;if(t===`viewport`)r=qf(e,n);else if(t===`document`)r=Gf(ff(e));else if(mf(t))r=Jf(t,n);else{let n=Rf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Kd(r)}function Xf(e,t){let n=Af(e);return n===t||!mf(n)||Df(n)?!1:Of(n).position===`fixed`||Xf(n,t)}function Zf(e,t){let n=t.get(e);if(n)return n;let r=Mf(e,[],!1).filter(e=>mf(e)&&uf(e)!==`body`),i=null,a=Of(e).position===`fixed`,o=a?Af(e):e;for(;mf(o)&&!Df(o);){let t=Of(o),n=wf(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||_f(o)&&!n&&Xf(e,o))?r=r.filter(e=>e!==o):i=t,o=Af(o)}return t.set(e,r),r}function Qf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?yf(t)?[]:Zf(t,this._c):[].concat(n),r],o=Yf(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=Yf(t,a[e],i);s=Sd(n.top,s),c=xd(n.right,c),l=xd(n.bottom,l),u=Sd(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function $f(e){let{width:t,height:n}=Pf(e);return{width:t,height:n}}function ep(e,t,n){let r=hf(t),i=ff(t),a=n===`fixed`,o=Bf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Td(0);function l(){c.x=Vf(i)}if(r||!r&&!a)if((uf(t)!==`body`||_f(i))&&(s=kf(t)),r){let e=Bf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Hf(i,s):Td(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function tp(e){return Of(e).position===`static`}function np(e,t){if(!hf(e)||Of(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ff(e)===n&&(n=n.ownerDocument.body),n}function rp(e,t){let n=df(e);if(yf(e))return n;if(!hf(e)){let t=Af(e);for(;t&&!Df(t);){if(mf(t)&&!tp(t))return t;t=Af(t)}return n}let r=np(e,t);for(;r&&vf(r)&&tp(r);)r=np(r,t);return r&&Df(r)&&tp(r)&&!wf(r)?n:r||Tf(e)||n}var ip=async function(e){let t=this.getOffsetParent||rp,n=this.getDimensions,r=await n(e.floating);return{reference:ep(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ap(e){return Of(e).direction===`rtl`}var op={convertOffsetParentRelativeRectToViewportRelativeRect:Uf,getDocumentElement:ff,getClippingRect:Qf,getOffsetParent:rp,getElementRects:ip,getClientRects:Wf,getDimensions:$f,getScale:If,isElement:mf,isRTL:ap};function sp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cp(e,t){let n=null,r,i=ff(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=wd(d),h=wd(i.clientWidth-(u+f)),g=wd(i.clientHeight-(d+p)),_=wd(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Sd(0,xd(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!sp(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function lp(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=Ff(e),u=i||a?[...l?Mf(l):[],...t?Mf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cp(l,n):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?Bf(e):null;c&&g();function g(){let t=Bf(e);h&&!sp(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 up=af,dp=of,fp=Qd,pp=cf,mp=tf,hp=Zd,gp=sf,_p=(e,t,n)=>{let r=new Map,i={platform:op,...n},a={...i.platform,_c:r};return Xd(e,t,{...i,platform:a})},vp=typeof document<`u`?C.useLayoutEffect:function(){};function yp(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(!yp(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)&&!yp(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function bp(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xp(e,t){let n=bp(e);return Math.round(t*n)/n}function Sp(e){let t=C.useRef(e);return vp(()=>{t.current=e}),t}function Cp(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]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=C.useState(r);yp(f,r)||p(r);let[m,h]=C.useState(null),[g,_]=C.useState(null),v=C.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=C.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),b=a||m,x=o||g,S=C.useRef(null),w=C.useRef(null),T=C.useRef(u),E=c!=null,D=Sp(c),O=Sp(i),k=Sp(l),A=C.useCallback(()=>{if(!S.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),_p(S.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!yp(T.current,t)&&(T.current=t,pr.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);vp(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=C.useRef(!1);vp(()=>(j.current=!0,()=>{j.current=!1}),[]),vp(()=>{if(b&&(S.current=b),x&&(w.current=x),b&&x){if(D.current)return D.current(b,x,A);A()}},[b,x,A,D,E]);let M=C.useMemo(()=>({reference:S,floating:w,setReference:v,setFloating:y}),[v,y]),N=C.useMemo(()=>({reference:b,floating:x}),[b,x]),ee=C.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=xp(N.floating,u.x),r=xp(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...bp(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var wp=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:hp({element:r.current,padding:i}).fn(n):r?hp({element:r,padding:i}).fn(n):{}}}},Tp=(e,t)=>{let n=up(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ep=(e,t)=>{let n=dp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dp=(e,t)=>({fn:gp(e).fn,options:[e,t]}),Op=(e,t)=>{let n=fp(e);return{name:n.name,fn:n.fn,options:[e,t]}},kp=(e,t)=>{let n=pp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ap=(e,t)=>{let n=mp(e);return{name:n.name,fn:n.fn,options:[e,t]}},jp=(e,t)=>{let n=wp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mp=Object.defineProperty,Np=(e,t)=>Mp(e,`name`,{value:t,configurable:!0});function Pp(e){let[t,n]=C.useState(void 0);return hd(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}Np(Pp,`useSize`);var Fp=Object.defineProperty,Ip=(e,t)=>Fp(e,`name`,{value:t,configurable:!0}),Lp=`Popper`,[Rp,zp]=ou(Lp),[Bp,Vp]=Rp(Lp),Hp=Ip(e=>{let{__scopePopper:t,children:n}=e,[r,i]=C.useState(null),[a,o]=C.useState(void 0);return(0,z.jsx)(Bp,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Up=`PopperAnchor`,Wp=C.forwardRef(Ip(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Vp(Up,n),o=C.useRef(null),s=a.onAnchorChange,c=Xc(t,C.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=C.useRef(null);C.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Zp(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,z.jsx)(Du.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Gp=`PopperContent`,[Kp,qp]=Rp(Gp),Jp=C.forwardRef(Ip(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Vp(Gp,n),[_,v]=C.useState(null),y=Xc(t,v),[b,x]=C.useState(null),S=Pp(b),w=S?.width??0,T=S?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Yp),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:ee,middlewareData:te}=Cp({strategy:`fixed`,placement:E,whileElementsMounted:Ip((...e)=>lp(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Tp({mainAxis:i+T,alignmentAxis:o}),c&&Ep({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Dp():void 0,...A}),c&&Op({...A}),kp({...A,apply:Ip(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&jp({element:b,padding:s}),Xp({arrowWidth:w,arrowHeight:T}),f&&Ap({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),P=g.setPlacementState;hd(()=>(P(N),()=>{P(void 0)}),[N,P]);let[F,ne]=Zp(N),re=ju(m);hd(()=>{ee&&re?.()},[ee,re]);let ie=te.arrow?.x,ae=te.arrow?.y,I=te.arrow?.centerOffset!==0,[L,oe]=C.useState();return hd(()=>{_&&oe(window.getComputedStyle(_).zIndex)},[_]),(0,z.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:ee?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:L,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(` `),...te.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,z.jsx)(Kp,{scope:n,placedSide:F,placedAlign:ne,onArrowChange:x,arrowX:ie,arrowY:ae,shouldHideArrow:I,children:(0,z.jsx)(Du.div,{"data-side":F,"data-align":ne,...h,ref:y,style:{...h.style,animation:ee?h.style?.animation:`none`}})})})},`PopperContent`));function Yp(e){return e!==null}Ip(Yp,`isNotNull`);var Xp=Ip(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Zp(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Zp(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Ip(Zp,`getSideAndAlignFromPlacement`);var Qp=Hp,$p=Wp,em=Jp,tm=Object.defineProperty,nm=C.forwardRef(((e,t)=>tm(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=C.useState(!1);hd(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?pr.createPortal((0,z.jsx)(Du.div,{...r,ref:t}),o):null},`Portal`)),rm=Object.defineProperty,im=(e,t)=>rm(e,`name`,{value:t,configurable:!0});function am(e,t){return C.useReducer((e,n)=>t[e][n]??e,e)}im(am,`useStateMachine`);var om=im(e=>{let{present:t,children:n}=e,r=sm(t),i=typeof n==`function`?n({present:r.isPresent}):C.Children.only(n),a=lm(r.ref,dm(i));return typeof n==`function`||r.isPresent?C.cloneElement(i,{ref:a}):null},`Presence`);function sm(e){let[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),a=C.useRef(`none`),o=C.useRef(void 0),[s,c]=am(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return C.useEffect(()=>{s===`mounted`?(a.current=o.current??um(r.current),o.current=void 0):a.current=`none`},[s]),hd(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=um(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]),hd(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=im(a=>{let o=um(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=im(e=>{e.target===t&&(a.current=um(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)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:C.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=um(t)}else r.current=null;n(e)},[])}}im(sm,`usePresence`);function cm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}im(cm,`setRef`);function lm(...e){let t=C.useRef(e);return t.current=e,C.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=cm(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():cm(n[e],null)}}},[])}im(lm,`useStableComposedRefs`);function um(e){return e?.animationName||`none`}im(um,`getAnimationName`);function dm(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)}im(dm,`getElementRef`);var fm=Object.defineProperty,pm=(e,t)=>fm(e,`name`,{value:t,configurable:!0}),mm=C.useEffectEvent,hm=C.useInsertionEffect;function gm(e){if(typeof mm==`function`)return mm(e);let t=C.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof hm==`function`?hm(()=>{t.current=e}):hd(()=>{t.current=e}),C.useMemo(()=>((...e)=>t.current?.(...e)),[])}pm(gm,`useEffectEvent`);var _m=Object.defineProperty,vm=(e,t)=>_m(e,`name`,{value:t,configurable:!0}),ym=C.useInsertionEffect||hd;function bm({prop:e,defaultProp:t,onChange:n=vm(()=>{},`onChange`),caller:r}){let[i,a,o]=xm({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,C.useCallback(t=>{if(s){let n=Sm(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}vm(bm,`useControllableState`);function xm({defaultProp:e,onChange:t}){let[n,r]=C.useState(e),i=C.useRef(n),a=C.useRef(t);return ym(()=>{a.current=t},[t]),C.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}vm(xm,`useUncontrolledState`);function Sm(e){return typeof e==`function`}vm(Sm,`isFunction`);var Cm=Symbol(`RADIX:SYNC_STATE`);function wm(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=gm(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=C.useReducer((t,n)=>{if(n.type===Cm)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=C.useRef(p);C.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=C.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return C.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Cm,state:i})},[i,d.state,c]),[h,f]}vm(wm,`useControllableStateReducer`);var Tm=Object.defineProperty,Em=(e,t)=>Tm(e,`name`,{value:t,configurable:!0});function Dm(e){let t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Em(Dm,`usePrevious`);var Om=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),km=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Am=new WeakMap,jm=new WeakMap,Mm={},Nm=0,Pm=function(e){return e&&(e.host||Pm(e.parentNode))},Fm=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Pm(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})},Im=function(e,t,n,r){var i=Fm(t,Array.isArray(e)?e:[e]);Mm[n]||(Mm[n]=new WeakMap);var a=Mm[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=(Am.get(e)||0)+1,l=(a.get(e)||0)+1;Am.set(e,c),a.set(e,l),o.push(e),c===1&&i&&jm.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(),Nm++,function(){o.forEach(function(e){var t=Am.get(e)-1,i=a.get(e)-1;Am.set(e,t),a.set(e,i),t||(jm.has(e)||e.removeAttribute(r),jm.delete(e)),i||e.removeAttribute(n)}),Nm--,Nm||(Am=new WeakMap,Am=new WeakMap,jm=new WeakMap,Mm={})}},Lm=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||km(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Im(r,i,n,`aria-hidden`)):function(){return null}},Rm=function(){return Rm=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},Rm.apply(this,arguments)};function zm(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 Bm(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 Vm=`right-scroll-bar-position`,Hm=`width-before-scroll-bar`,Um=`with-scroll-bars-hidden`,Wm=`--removed-body-scroll-bar-size`;function Gm(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Km(e,t){var n=(0,C.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 qm=typeof window<`u`?C.useLayoutEffect:C.useEffect,Jm=new WeakMap;function Ym(e,t){var n=Km(t||null,function(t){return e.forEach(function(e){return Gm(e,t)})});return qm(function(){var t=Jm.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Gm(e,null)}),i.forEach(function(e){r.has(e)||Gm(e,a)})}Jm.set(n,e)},[e]),n}function Xm(e){return e}function Zm(e,t){t===void 0&&(t=Xm);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 Qm(e){e===void 0&&(e={});var t=Zm(null);return t.options=Rm({async:!0,ssr:!1},e),t}var $m=function(e){var t=e.sideCar,n=zm(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 C.createElement(r,Rm({},n))};$m.isSideCarExport=!0;function eh(e,t){return e.useMedium(t),$m}var th=Qm(),nh=function(){},rh=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:nh,onWheelCapture:nh,onTouchMoveCapture:nh}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=zm(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ym([n,t]),w=Rm(Rm({},b),i);return C.createElement(C.Fragment,null,u&&C.createElement(x,{sideCar:th,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?C.cloneElement(C.Children.only(s),Rm(Rm({},w),{ref:S})):C.createElement(v,Rm({},w,{className:c,ref:S}),s))});rh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},rh.classNames={fullWidth:Hm,zeroRight:Vm};var ih,ah=function(){if(ih)return ih;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function oh(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ah();return t&&e.setAttribute(`nonce`,t),e}function sh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ch(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var lh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=oh())&&(sh(t,n),ch(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},uh=function(){var e=lh();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dh=function(){var e=uh();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},fh={left:0,top:0,right:0,gap:0},ph=function(e){return parseInt(e||``,10)||0},mh=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[ph(n),ph(r),ph(i)]},hh=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return fh;var t=mh(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])}},gh=dh(),_h=`data-scroll-locked`,vh=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
16
16
|
.${Um} {
|
|
17
17
|
overflow: hidden ${r};
|
|
18
18
|
padding-right: ${s}px ${r};
|
|
@@ -52,5 +52,5 @@ Error generating stack: `+e.message+`
|
|
|
52
52
|
`},yh=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},bh=function(){C.useEffect(function(){return document.body.setAttribute(_h,(yh()+1).toString()),function(){var e=yh()-1;e<=0?document.body.removeAttribute(_h):document.body.setAttribute(_h,e.toString())}},[])},xh=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;bh();var a=C.useMemo(function(){return hh(i)},[i]);return C.createElement(gh,{styles:vh(a,!t,i,n?``:`!important`)})},Sh=!1;if(typeof window<`u`)try{var Ch=Object.defineProperty({},`passive`,{get:function(){return Sh=!0,!0}});window.addEventListener(`test`,Ch,Ch),window.removeEventListener(`test`,Ch,Ch)}catch{Sh=!1}var wh=Sh?{passive:!1}:!1,Th=function(e){return e.tagName===`TEXTAREA`},Eh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Th(e)&&n[t]===`visible`)},Dh=function(e){return Eh(e,`overflowY`)},Oh=function(e){return Eh(e,`overflowX`)},kh=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Mh(e,r)){var i=Nh(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ah=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},jh=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Mh=function(e,t){return e===`v`?Dh(t):Oh(t)},Nh=function(e,t){return e===`v`?Ah(t):jh(t)},Ph=function(e,t){return e===`h`&&t===`rtl`?-1:1},Fh=function(e,t,n,r,i){var a=Ph(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=Nh(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Mh(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},Ih=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Lh=function(e){return[e.deltaX,e.deltaY]},Rh=function(e){return e&&`current`in e?e.current:e},zh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Bh=function(e){return`
|
|
53
53
|
.block-interactivity-${e} {pointer-events: none;}
|
|
54
54
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
55
|
-
`},Vh=0,Hh=[];function Uh(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(Vh++)[0],a=C.useState(dh)[0],o=C.useRef(e);C.useEffect(function(){o.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Bm([e.lockRef.current],(e.shards||[]).map(Rh),!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=C.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ih(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=kh(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=kh(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 Fh(h,t,e,h===`h`?s:c,!0)},[]),c=C.useCallback(function(e){var n=e;if(!(!Hh.length||Hh[Hh.length-1]!==a)){var r=`deltaY`in n?Lh(n):Ih(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&zh(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Rh).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=C.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Wh(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=C.useCallback(function(e){n.current=Ih(e),r.current=void 0},[]),d=C.useCallback(function(t){l(t.type,Lh(t),t.target,s(t,e.lockRef.current))},[]),f=C.useCallback(function(t){l(t.type,Ih(t),t.target,s(t,e.lockRef.current))},[]);C.useEffect(function(){return Hh.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,wh),document.addEventListener(`touchmove`,c,wh),document.addEventListener(`touchstart`,u,wh),function(){Hh=Hh.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,wh),document.removeEventListener(`touchmove`,c,wh),document.removeEventListener(`touchstart`,u,wh)}},[]);var p=e.removeScrollBar,m=e.inert;return C.createElement(C.Fragment,null,m?C.createElement(a,{styles:Bh(i)}):null,p?C.createElement(xh,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Wh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Gh=eh(th,Uh),Kh=C.forwardRef(function(e,t){return C.createElement(rh,Rm({},e,{ref:t,sideCar:Gh}))});Kh.classNames=rh.classNames;var qh=Object.defineProperty,Jh=(e,t)=>qh(e,`name`,{value:t,configurable:!0}),Yh=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Xh=[` `,`Enter`],Zh=`Select`,[Qh,$h,eg]=uu(Zh),[tg,ng]=ou(Zh,[eg,zp]),rg=zp(),[ig,ag]=tg(Zh),[og,sg]=tg(Zh);function cg(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=rg(t),[_,v]=C.useState(null),[y,b]=C.useState(null),[x,S]=C.useState(!1),w=wu(l),[T,E]=bm({prop:r,defaultProp:i??!1,onChange:a,caller:Zh}),[D,O]=bm({prop:o,defaultProp:s,onChange:c,caller:Zh}),k=C.useRef(null),A=C.useRef(D);C.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=Jh(()=>O(A.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,O]);let j=_?!!m||!!_.closest(`form`):!0,[M,N]=C.useState(new Set),ee=Q(),te=Array.from(M).map(e=>e.props.value).join(`;`),P=C.useCallback(e=>{N(t=>new Set(t).add(e))},[]),F=C.useCallback(e=>{N(t=>{let n=new Set(t);return n.delete(e),n})},[]),ne={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:ee,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:M,nativeSelectKey:te,isFormControl:j};return(0,z.jsx)(Qp,{...g,children:(0,z.jsx)(ig,{scope:t,...ne,children:(0,z.jsx)(Qh.Provider,{scope:t,children:(0,z.jsx)(og,{scope:t,onNativeOptionAdd:P,onNativeOptionRemove:F,children:Wg(h)?h(ne):n})})})})}Jh(cg,`SelectProvider`);var lg=Jh(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,z.jsx)(cg,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,z.jsxs)(z.Fragment,{children:[n,e?(0,z.jsx)(Ug,{__scopeSelect:t}):null]})})},`Select`),ug=`SelectTrigger`,dg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=rg(n),o=ag(ug,n),s=o.disabled||r,c=Xc(t,o.onTriggerChange),l=$h(n),u=C.useRef(`touch`),[d,f,p]=Kg(e=>{let t=l().filter(e=>!e.disabled),n=qg(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=Jh(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,z.jsx)($p,{asChild:!0,...a,children:(0,z.jsx)(Du.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Gg(o.value)?``:void 0,...i,ref:c,onClick:$l(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:$l(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:$l(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Yh.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),fg=`SelectValue`,pg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=ag(fg,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Xc(t,c.onValueNodeChange);hd(()=>{l(u)},[l,u]);let f=Gg(c.value);return(0,z.jsx)(Du.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,z.jsx)(C.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),mg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,z.jsx)(Du.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[hg,gg]=tg(`SelectPortal`,{forceMount:void 0}),_g=Jh(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,z.jsx)(hg,{scope:e.__scopeSelect,forceMount:n,children:(0,z.jsx)(nm,{asChild:!0,...r})})},`SelectPortal`),vg=`SelectContent`,yg=C.forwardRef(Jh(function(e,t){let n=gg(vg,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=ag(vg,e.__scopeSelect),[o,s]=C.useState();return hd(()=>{s(new DocumentFragment)},[]),(0,z.jsx)(om,{present:r||a.open,children:({present:e})=>e?(0,z.jsx)(Tg,{...i,ref:t}):(0,z.jsx)(bg,{...i,fragment:o})})},`SelectContent`)),bg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?pr.createPortal((0,z.jsx)(Sg,{scope:n,children:(0,z.jsx)(Qh.Slot,{scope:n,children:(0,z.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),xg=10,[Sg,Cg]=tg(vg),wg=$c(`SelectContent.RemoveScroll`),Tg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=ag(vg,n),[y,b]=C.useState(null),[x,S]=C.useState(null),w=Xc(t,b),[T,E]=C.useState(null),[D,O]=C.useState(null),k=$h(n),[A,j]=C.useState(!1),M=C.useRef(!1);C.useEffect(()=>{if(y)return Lm(y)},[y]),Xu();let N=C.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,x]),ee=C.useCallback(()=>N([T,y]),[N,T,y]);C.useEffect(()=>{A&&ee()},[A,ee]);let{onOpenChange:te,triggerPointerDownPosRef:P}=v;C.useEffect(()=>{if(y){let e={x:0,y:0},t=Jh(t=>{e={x:Math.abs(Math.round(t.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(P.current?.y??0))}},`handlePointerMove`),n=Jh(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||te(!1),document.removeEventListener(`pointermove`,t),P.current=null},`handlePointerUp`);return P.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,te,P]),C.useEffect(()=>{let e=Jh(()=>te(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[te]);let[F,ne]=Kg(e=>{let t=k().filter(e=>!e.disabled),n=qg(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),re=C.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&(E(e),r&&(M.current=!0))},[v.value]),ie=C.useCallback(()=>y?.focus(),[y]),ae=C.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&O(e)},[v.value]),I=r===`popper`?Dg:Eg,L=I===Dg?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,z.jsx)(Sg,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:re,selectedItem:T,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:ee,selectedItemText:D,position:r,isPositioned:A,searchRef:F,children:(0,z.jsx)(Kh,{as:wg,allowPinchZoom:!0,children:(0,z.jsx)(rd,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:$l(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,z.jsx)(zu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,z.jsx)(I,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...L,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:$l(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Eg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=ag(vg,n),o=Cg(vg,n),[s,c]=C.useState(null),[l,u]=C.useState(null),d=Xc(t,u),f=$h(n),p=C.useRef(!1),m=C.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=C.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-xg,d=Yl(a,[xg,Math.max(xg,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-xg,d=Yl(a,[xg,Math.max(xg,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-xg*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-xg,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${xg}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);hd(()=>y(),[y]);let[b,x]=C.useState();return hd(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,z.jsx)(Og,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,z.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,z.jsx)(Du.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Dg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=xg,...a}=e,o=rg(n);return(0,z.jsx)(em,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Og,kg]=tg(vg,{}),Ag=`SelectViewport`,jg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Cg(Ag,n),o=kg(Ag,n),s=Xc(t,a.onViewportChange),c=C.useRef(0);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,z.jsx)(Qh.Slot,{scope:n,children:(0,z.jsx)(Du.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:$l(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-xg*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Mg,Ng]=tg(`SelectGroup`),Pg=`SelectItem`,[Fg,Ig]=tg(Pg),Lg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=ag(Pg,n),c=Cg(Pg,n),l=s.value===r,[u,d]=C.useState(a??``),[f,p]=C.useState(!1),m=Xc(t,ju(e=>c.itemRefCallback?.(e,r,i))),h=Q(),g=C.useRef(`touch`),_=Jh(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,z.jsx)(Fg,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:C.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,z.jsx)(Qh.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,z.jsx)(Du.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:$l(o.onFocus,()=>p(!0)),onBlur:$l(o.onBlur,()=>p(!1)),onClick:$l(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:$l(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:$l(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:$l(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$l(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:$l(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(Xh.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Rg=`SelectItemText`,zg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=ag(Rg,n),s=Cg(Rg,n),c=Ig(Rg,n),l=sg(Rg,n),[u,d]=C.useState(null),f=ju(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Xc(t,d,c.onItemTextChange,f),m=u?.textContent,h=C.useMemo(()=>(0,z.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return hd(()=>(g(h),()=>_(h)),[g,_,h]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Du.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Gg(o.value)?pr.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Bg=`SelectItemIndicator`,Vg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,...r}=e;return Ig(Bg,n).isSelected?(0,z.jsx)(Du.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Hg=`SelectBubbleInput`,Ug=C.forwardRef(Jh(function({__scopeSelect:e,...t},n){let r=ag(Hg,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=C.useRef(null),m=Xc(n,p),h=i??``,g=Dm(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return C.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,z.jsxs)(Du.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Om,...t.style},ref:m,defaultValue:h,children:[Gg(i)&&!_?(0,z.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function Wg(e){return typeof e==`function`}Jh(Wg,`isFunction`);function Gg(e){return e===``||e===void 0}Jh(Gg,`shouldShowPlaceholder`);function Kg(e){let t=ju(e),n=C.useRef(``),r=C.useRef(0),i=C.useCallback(e=>{let i=n.current+e;t(i),Jh((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=C.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Jh(Kg,`useTypeaheadSearch`);function qg(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Jg(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Jh(qg,`findNextItem`);function Jg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Jh(Jg,`wrapArray`);var Yg=lg,Xg=pg;function Zg({className:e,children:t,...n}){return(0,z.jsxs)(dg,{className:a(`flex h-9 w-full items-center justify-between rounded-lg border border-input bg-card/90 px-3 text-sm text-foreground outline-none transition duration-200 hover:border-muted-foreground/45 focus:border-muted-foreground/60 focus:ring-2 focus:ring-muted-foreground/20 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:[t,(0,z.jsx)(mg,{asChild:!0,children:(0,z.jsx)(_l,{icon:ac,className:`h-4 w-4 opacity-60`})})]})}function Qg({className:e,children:t,position:n=`popper`,...r}){return(0,z.jsx)(_g,{children:(0,z.jsx)(yg,{position:n,className:a(`z-50 max-h-80 min-w-[8rem] overflow-hidden rounded-xl border border-border/90 bg-popover/98 text-popover-foreground shadow-xl shadow-black/45 backdrop-blur`,e),...r,children:(0,z.jsx)(jg,{className:`p-1`,children:t})})})}function $g({className:e,children:t,...n}){return(0,z.jsxs)(Lg,{className:a(`relative flex min-h-8 cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-sm outline-none transition data-[disabled]:pointer-events-none data-[highlighted]:bg-muted/65 data-[highlighted]:text-foreground data-[disabled]:opacity-50`,e),...n,children:[(0,z.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,z.jsx)(Vg,{children:(0,z.jsx)(_l,{icon:hc,className:`h-4 w-4`})})}),(0,z.jsx)(zg,{children:t})]})}function e_({className:e,...t}){return(0,z.jsx)(`section`,{className:a(`grid h-full min-h-0 min-w-0 max-h-full max-w-full overflow-hidden bg-background/45`,e),...t})}function t_({className:e,...t}){return(0,z.jsx)(`div`,{className:a(`min-h-0 min-w-0 overflow-hidden rounded-2xl border border-border/80 bg-card/70`,e),...t})}function n_(e){return(0,z.jsxs)(`div`,{className:a(`grid gap-1 rounded-xl border border-border/80 bg-card/45 p-4`,e.className),children:[(0,z.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground`,children:e.label}),(0,z.jsx)(`span`,{className:`text-lg font-semibold tabular-nums text-foreground`,children:e.value})]})}function r_(e){return(0,z.jsx)(`div`,{className:a(`grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center`,e.className),children:(0,z.jsxs)(`div`,{className:`grid max-w-md gap-2`,children:[(0,z.jsx)(`h2`,{className:`m-0 text-base font-semibold text-foreground`,children:e.title}),(0,z.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:e.text})]})})}function i_({className:e,...t}){return(0,z.jsx)(`span`,{className:a(`inline-flex items-center rounded-lg border border-border/80 bg-muted/55 px-2 py-1 text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground`,e),...t})}function a_({className:e,...t}){return(0,z.jsx)(`div`,{className:a(`grid gap-1 rounded-xl border border-border/80 bg-background p-1`,e),...t})}function o_({className:e,...t}){return(0,z.jsx)(`textarea`,{className:a(`min-h-9 w-full resize-none rounded-lg border border-input bg-card/90 px-3 py-2.5 leading-6 text-foreground outline-none transition duration-200 placeholder:text-muted-foreground/65 focus:border-muted-foreground/60 focus:ring-2 focus:ring-muted-foreground/20`,e),...t})}function s_(e){let t=new Map,n=new Map(e.traceSummaries.map(e=>{let t=l_(e);return t===void 0?void 0:[e.id,t]}).filter(e=>e!==void 0)),r=e.logs.filter(e=>e.category===`run`&&(e.event===`run.completed`||e.event===`run.cancelled`||e.event===`run.failed`)).sort((e,t)=>e.sequence-t.sequence).map(u_),i=0;for(let a of e.entries){if(!c_(a))continue;let e=r[i];i+=1;let o=a.traceId===void 0?e:n.get(a.traceId)??e,s=p_(a.durationMs,o);s!==void 0&&t.set(a.entryId,s)}return t}function c_(e){return e.kind===`message`&&e.role===`assistant`&&(e.text.trim().length>0||m_(e.durationMs)!==void 0)&&(!(`tone`in e)||e.tone!==`pending`)}function l_(e){let t=m_(e.durationMs),n=d_(e.usage),r={};return t!==void 0&&(r.durationMs=t),n!==void 0&&(r.usage=n),f_(r)}function u_(e){let t=e.metadata;if(!c(t))return;let n=m_(t.durationMs),r=d_(t.usage),i={};return n!==void 0&&(i.durationMs=n),r!==void 0&&(i.usage=r),f_(i)}function d_(e){if(!c(e))return;let t=h_(e.inputTokens),n=h_(e.outputTokens),r=h_(e.totalTokens)??(t===void 0||n===void 0?void 0:t+n),i={};t!==void 0&&(i.inputTokens=t),n!==void 0&&(i.outputTokens=n),r!==void 0&&(i.totalTokens=r);let a=h_(e.cachedInputTokens),o=h_(e.cacheCreationInputTokens);return a!==void 0&&(i.cachedInputTokens=a),o!==void 0&&(i.cacheCreationInputTokens=o),Object.keys(i).length===0?void 0:i}function f_(e){return e.durationMs===void 0&&e.usage===void 0?void 0:e}function p_(e,t){let n=m_(e);return n===void 0?t:{...t,durationMs:n}}function m_(e){let t=h_(e);return t!==void 0&&t>=0?t:void 0}function h_(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}var g_={getKey(e){return String(e.entryId)},getText(e){if(e.kind===`reasoning`||e.kind===`message`&&e.role===`assistant`)return e.text},withText(e,t){return e.kind===`reasoning`?{...e,text:t}:e.kind===`message`&&e.role===`assistant`?`tone`in e&&e.tone===`pending`?e:{...e,text:t}:e}};function __(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.kind===`message`&&n.role===`assistant`)return n.entryId;if(n?.kind===`message`&&n.role===`user`)return}}function v_(e){let t=e.at(-1);return t?.kind===`message`&&t.role===`assistant`&&`tone`in t&&t.tone===`error`}function y_(e){let[t,n]=(0,C.useState)(()=>Date.now()),r=e.startedAt!==void 0&&e.durationMs===void 0;(0,C.useEffect)(()=>{if(!r)return;n(Date.now());let e=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(e)},[r]);let i=e.durationMs??(e.startedAt===void 0?void 0:t-e.startedAt);return i===void 0?null:(0,z.jsxs)(`span`,{"aria-live":`off`,className:a(`inline-flex items-center gap-1.5 text-xs font-medium tabular-nums text-muted-foreground`,e.className),role:r?`timer`:void 0,children:[r?(0,z.jsx)(_l,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 animate-spin`,icon:jc}):null,b_(i,r?`working`:`finished`)]})}function b_(e,t=`working`){let n=Math.floor((Number.isFinite(e)?Math.max(0,e):0)/1e3),r=Math.floor(n/60),i=n%60,a=r===0?`${i}s`:`${r}m ${i}s`;return`${t===`working`?`Working`:`Finished`} - ${a}`}var x_=(0,C.lazy)(()=>Ws(()=>import(`./transcript-item-oaLLzHaS.js`).then(e=>({default:e.TranscriptItem})),__vite__mapDeps([18,1,5,6,2])));function S_(e){let t=zo(e.messages,{adapter:g_,flushImmediately:v_(e.messages),isStreaming:e.isStreaming,resetKey:e.resetKey}),n=(0,C.useMemo)(()=>new Map(e.messages.map(e=>[e.entryId,e])),[e.messages]),r=(0,C.useMemo)(()=>s_({entries:e.messages,traceSummaries:e.sessionTraceSummaries,logs:e.sessionLogs}),[e.messages,e.sessionLogs,e.sessionTraceSummaries]),i=(0,C.useRef)(e.workingStartedAt),a=e.workingStartedAt??(t.isDraining?i.current:void 0),o=a===void 0?void 0:__(e.messages),s=t.items.some(e=>e.entryId===o)?o:void 0;return(0,C.useEffect)(()=>{e.workingStartedAt!==void 0&&(i.current=e.workingStartedAt),!t.isDraining&&e.workingStartedAt===void 0&&(i.current=void 0)},[e.workingStartedAt,t.isDraining]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(C.Suspense,{fallback:null,children:t.items.map(i=>(0,z.jsx)(x_,{entry:n.get(i.entryId)??i,displayText:g_.getText(i),live:t.liveItemKey===String(i.entryId),metrics:r.get(i.entryId),workingStartedAt:i.entryId===s?a:void 0,decidingApprovals:e.decidingApprovals,answeringQuestions:e.answeringQuestions,onApprovalDecision:e.onApprovalDecision,onQuestionAnswer:e.onQuestionAnswer,onOpenTrace:e.onOpenTrace},i.entryId))}),a!==void 0&&s===void 0?(0,z.jsx)(`article`,{className:`max-w-[min(82ch,100%)] justify-self-start text-foreground`,children:(0,z.jsx)(y_,{startedAt:a})}):null]})}function C_(e){return(0,z.jsxs)(e_,{className:`grid-cols-[minmax(0,1fr)_minmax(0,460px)] max-xl:grid-cols-1`,children:[(0,z.jsx)(`div`,{className:`grid min-h-0 min-w-0`,children:(0,z.jsxs)(`div`,{className:`grid h-full min-h-0 min-w-0 grid-rows-[minmax(0,1fr)_auto]`,children:[(0,z.jsx)(`section`,{className:`min-h-0 overflow-y-auto overflow-x-hidden px-4 py-4 [overflow-anchor:none] [scrollbar-gutter:stable]`,ref:e.transcriptScrollerRef,onScroll:e.onTranscriptScroll,children:(0,z.jsxs)(`div`,{className:`mx-auto grid min-h-full w-full max-w-235 content-start items-start gap-6 pb-8`,"data-studio-transcript-content":``,children:[e.hasMessages?null:(0,z.jsx)(`div`,{className:`grid min-h-96 place-items-center text-sm font-medium text-muted-foreground`,children:(0,z.jsxs)(`div`,{className:`grid max-w-xl gap-4 text-center`,children:[(0,z.jsx)(`div`,{className:`mx-auto h-px w-28 bg-muted/55`}),(0,z.jsx)(`h1`,{className:`m-0 text-4xl font-semibold leading-tight text-foreground text-balance`,children:`What should this agent work on?`}),(0,z.jsx)(`p`,{className:`m-0 text-base leading-7 text-muted-foreground text-pretty`,children:`Choose a prompt below or write a task. Studio will stream the response, tool calls, approvals, and trace data here.`})]})}),(0,z.jsx)(S_,{answeringQuestions:e.answeringQuestions,decidingApprovals:e.decidingApprovals,isStreaming:e.isStreaming,messages:e.messages,resetKey:e.transcriptResetKey,sessionLogs:e.sessionLogs,sessionTraceSummaries:e.sessionTraceSummaries,workingStartedAt:e.workingStartedAt,onApprovalDecision:e.onApprovalDecision,onOpenTrace:e.onOpenTrace,onQuestionAnswer:e.onQuestionAnswer})]})}),(0,z.jsxs)(`form`,{className:`grid gap-3 bg-gradient-to-t from-card via-card/95 to-card/0 px-4 pb-4 pt-2`,onSubmit:t=>{t.preventDefault(),e.onRunPrompt(e.prompt)},children:[e.hasMessages||e.selectedAgentQuickPrompts.length===0?null:(0,z.jsx)(`div`,{className:`mx-auto grid w-full max-w-235 grid-cols-3 gap-2 max-md:grid-cols-1`,children:e.selectedAgentQuickPrompts.map(t=>(0,z.jsx)(ml,{className:`h-auto min-h-16 justify-start whitespace-normal rounded-lg border border-border/80 bg-card/85 px-3 py-2.5 text-left text-sm font-medium leading-5 text-foreground shadow-sm hover:border-border/80 hover:bg-muted/45 hover:text-foreground`,type:`button`,variant:`ghost`,disabled:e.runState===`running`||e.selectedAgentId.length===0,onClick:()=>e.onRunPrompt(t),children:(0,z.jsx)(`span`,{className:`min-w-0 whitespace-normal wrap-break-words`,children:t})},t))}),(0,z.jsxs)(`div`,{className:`mx-auto grid w-full max-w-235 gap-2 rounded-xl border border-border/80 bg-card/95 p-2.5 backdrop-blur`,children:[(0,z.jsx)(o_,{className:`min-h-16 min-w-0 resize-none rounded-lg border-0 bg-transparent px-3 py-3 text-base leading-7 text-foreground shadow-none outline-none ring-0 placeholder:text-muted-foreground/70 focus:border-transparent focus:ring-0`,ref:e.promptRef,rows:1,value:e.prompt,onChange:e.onPromptChange,onKeyDown:e.onPromptKeyDown,placeholder:`Ask anything...`}),e.attachments.length===0?null:(0,z.jsx)(`div`,{className:`flex min-w-0 flex-wrap gap-1.5 px-2`,children:e.attachments.map(t=>(0,z.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border/80 bg-muted/55 px-2 py-1 text-xs font-medium text-muted-foreground`,children:[(0,z.jsxs)(`span`,{className:`min-w-0 truncate`,children:[t.kind===`image`?`Image`:`Doc`,` / `,t.name]}),(0,z.jsx)(ml,{"aria-label":`Remove ${t.name}`,className:`h-5 min-h-5 w-5 rounded-md border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-accent hover:text-foreground [&_svg]:h-3 [&_svg]:w-3`,size:`icon`,type:`button`,variant:`ghost`,onClick:()=>e.onRemovePromptAttachment(t.id),children:(0,z.jsx)(_l,{icon:fc,"aria-hidden":`true`})})]},t.id))}),(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,z.jsx)(`input`,{ref:e.attachmentInputRef,className:`hidden`,type:`file`,multiple:!0,accept:Zr,onChange:e.onAddPromptAttachments}),(0,z.jsx)(ml,{"aria-label":`Attach image or document`,className:`h-8 min-h-8 w-8 border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground`,size:`icon`,type:`button`,variant:`ghost`,disabled:e.runState===`running`,onClick:()=>e.attachmentInputRef.current?.click(),children:(0,z.jsx)(_l,{icon:uc,"aria-hidden":`true`})})]}),(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e.selectedAgentModels.length===0?null:(0,z.jsxs)(Yg,{value:e.selectedModelRef,onValueChange:e.onSelectModel,disabled:e.runState===`running`,children:[(0,z.jsx)(Zg,{"aria-label":`Select model`,className:`flex h-8 min-h-8 w-auto max-w-44 gap-2 border-0 bg-transparent px-2 py-1 text-xs font-medium text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground sm:max-w-72`,children:(0,z.jsx)(Xg,{placeholder:`Model`})}),(0,z.jsx)(Qg,{align:`end`,children:e.selectedAgentModels.map(e=>(0,z.jsx)($g,{value:e.ref,children:ai(e)},e.ref))})]}),e.agents.length>1?(0,z.jsxs)(Yg,{value:e.selectedAgent?.id??e.selectedAgentId,onValueChange:e.onSelectAgent,disabled:e.runState===`running`,children:[(0,z.jsx)(Zg,{"aria-label":`Select agent`,className:`flex h-8 min-h-8 w-auto max-w-64 gap-2 border-0 bg-transparent px-2 py-1 text-xs font-medium text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground`,children:(0,z.jsx)(Xg,{placeholder:`Agent`})}),(0,z.jsx)(Qg,{align:`end`,children:e.agents.map(e=>(0,z.jsx)($g,{value:e.id,children:e.name??e.id},e.id))})]}):null,(0,z.jsx)(ml,{"aria-label":e.isStreaming?`Stop generating`:e.runState===`running`?`Running`:`Send message`,className:`h-9 min-h-9 w-9 rounded-full border-white bg-white text-black hover:bg-white/90`,size:`icon`,type:e.isStreaming?`button`:`submit`,disabled:!e.isStreaming&&(e.runState===`running`||e.selectedAgentId.length===0),onClick:e.isStreaming?e.onStopPrompt:void 0,children:(0,z.jsx)(_l,{fill:e.isStreaming?`currentColor`:void 0,icon:e.isStreaming?Vc:lc})})]})]})]})]})]})}),(0,z.jsx)(w_,{sessions:e.allSessions,selectedSessionId:e.selectedSessionId,runState:e.runState,onDeleteSession:e.onDeleteSession,onLoadSession:e.onLoadSession})]})}function w_(e){return(0,z.jsx)(`aside`,{className:`grid h-full min-h-0 min-w-0 max-h-full overflow-hidden border-l border-sidebar-border bg-sidebar text-sidebar-foreground max-xl:hidden`,"aria-label":`Sessions`,children:(0,z.jsx)(`nav`,{className:`grid min-h-0 content-start gap-0.5 overflow-auto px-3 py-3`,"aria-label":`Sessions`,children:e.sessions.map(t=>(0,z.jsx)(T_,{session:t,active:t.id===e.selectedSessionId,disabled:e.runState===`running`,onDeleteSession:e.onDeleteSession,onLoadSession:e.onLoadSession},t.id))})})}function T_(e){let t=e.session.title??`Untitled chat`;return(0,z.jsxs)(`div`,{className:`group relative min-w-0`,children:[(0,z.jsxs)(ml,{className:a(`studio-sidebar-nav-button h-9 min-h-9 w-full justify-start gap-3 rounded-lg bg-transparent px-2.5 py-0.5 pr-9 text-base font-medium text-sidebar-foreground/62 shadow-none transition duration-200 hover:text-sidebar-foreground active:translate-y-px [&_svg]:h-[17px] [&_svg]:w-[17px]`,e.active&&`studio-sidebar-nav-button-active text-sidebar-accent-foreground`),type:`button`,variant:`ghost`,disabled:e.disabled,onClick:()=>e.onLoadSession(e.session.id),children:[(0,z.jsx)(_l,{icon:mc,"aria-hidden":`true`}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t})]}),(0,z.jsx)(ml,{"aria-label":`Delete ${t}`,className:`absolute right-1 top-1/2 hidden h-7 min-h-7 w-7 -translate-y-1/2 rounded-lg border-0 bg-transparent p-0 text-muted-foreground opacity-70 shadow-none hover:bg-sidebar-accent hover:text-destructive hover:opacity-100 group-hover:inline-flex group-focus-within:inline-flex [&_svg]:h-4 [&_svg]:w-4`,size:`icon`,type:`button`,variant:`ghost`,disabled:e.disabled,onClick:()=>e.onDeleteSession(e.session),children:(0,z.jsx)(_l,{icon:ic,"aria-hidden":`true`})})]})}function E_(){let e=Nl(`playground`),t=cr({strict:!1}).sessionId,n=(0,C.useRef)(null);return(0,C.useEffect)(()=>{if(n.current!==t&&e.pageEnabled(`playground`)){if(e.runState===`running`){n.current=t;return}if(t===void 0){n.current=t,e.startNewChat({updatePath:!1});return}e.sessionsEnabled&&(n.current=t,t!==e.sessions.selectedSessionId&&e.sessions.loadSession(t,{updatePath:!1}))}},[t,e]),(0,z.jsx)(C_,{agents:e.agents,allSessions:e.sessions.allSessions,answeringQuestions:e.answeringQuestions,attachments:e.attachments,decidingApprovals:e.decidingApprovals,hasMessages:e.hasMessages,isStreaming:e.isStreaming,workingStartedAt:e.workingStartedAt,messages:e.messages,prompt:e.prompt,runState:e.runState,selectedAgent:e.selectedAgent,selectedAgentId:e.selectedAgentId,selectedAgentModels:e.selectedAgentModels,selectedAgentQuickPrompts:e.selectedAgentQuickPrompts,selectedModelRef:e.selectedModelRef,selectedSessionId:e.sessions.selectedSessionId,sessionLogs:e.sessions.sessionLogs,sessionTraceSummaries:e.sessionTraceSummaries,attachmentInputRef:e.attachmentInputRef,promptRef:e.promptRef,transcriptScrollerRef:e.transcriptScrollerRef,transcriptResetKey:e.transcriptResetKey,onAddPromptAttachments:e.addPromptAttachments,onApprovalDecision:e.decideToolApproval,onDeleteSession:e.setDeleteCandidate,onLoadSession:t=>void e.sessions.loadSession(t),onOpenTrace:e.traces.selectTrace,onPromptChange:e.updatePrompt,onPromptKeyDown:e.handlePromptKeyDown,onQuestionAnswer:e.answerToolQuestion,onRemovePromptAttachment:e.removePromptAttachment,onRunPrompt:e.runPrompt,onStopPrompt:e.stopPrompt,onSelectAgent:e.selectPlaygroundAgent,onSelectModel:e.setSelectedModelRef,onTranscriptScroll:e.updateTranscriptStickiness})}function D_(){let e=Nl(`sandboxes`),t=cr({strict:!1}),n=ur();return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Qs,{enabled:e.sandboxesEnabled,onError:e.setError,onSelectSandbox:e=>{n({to:`/sandboxes/$sandboxRef`,params:{sandboxRef:e}})},...t.sandboxRef===void 0?{}:{initialSandboxRef:t.sandboxRef}})})}function O_(){let e=Nl(`sessions`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Zs,{agents:e.agents,sessions:e.sessions.allSessions,sessionsEnabled:e.sessionsEnabled,sessionLoadState:e.sessions.sessionLoadState,selectedSessionId:e.sessions.selectedSessionId,onOpenSession:t=>void e.sessions.loadSession(t),onViewSessionTracing:t=>void e.traces.showSessionTraces(t),onDeleteSession:e.setDeleteCandidate})})}function k_(){let e=Nl(`status`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(ec,{enabled:e.statusEnabled})})}function A_(){let e=Nl(`tools`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Rl,{active:!0,agents:e.agents,enabled:e.toolsEnabled,selectedAgentId:e.selectedAgent?.id||e.selectedAgentId,onError:e.setError})})}function j_(){let e=Nl(`tracing`),t=cr({strict:!1}),n=(0,C.useRef)(``);return(0,C.useEffect)(()=>{let r=t.sessionId===void 0?`trace:${t.traceId??``}`:`session:${t.sessionId}`;if(n.current!==r&&e.pageEnabled(`tracing`)){if(n.current=r,t.sessionId!==void 0){e.traces.showSessionTraces(t.sessionId,{updatePath:!1});return}e.traces.setTraceLocation(t.traceId??``,void 0)}},[t.sessionId,t.traceId,e]),(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(nc,{agents:e.agents,traces:e.traces.traces,tracesEnabled:e.tracesEnabled,traceLoadState:e.traces.traceLoadState,selectedTraceId:e.traces.selectedTraceId,traceSessionDetailId:e.traces.traceSessionDetailId,onRefresh:()=>void e.traces.loadTraces(),onSelectTrace:e.traces.selectTrace,onShowSessionTraces:t=>void e.traces.showSessionTraces(t)})})}var M_=Ar({component:Ml}),N_=Or({getParentRoute:()=>M_,path:`/`,component:()=>(0,z.jsx)(dr,{to:`/playground`,replace:!0})}),P_=Or({getParentRoute:()=>M_,path:`playground`,component:E_}),F_=Or({getParentRoute:()=>M_,path:`playground/$sessionId`,component:E_}),I_=Or({getParentRoute:()=>M_,path:`tracing`,component:j_}),L_=Or({getParentRoute:()=>M_,path:`tracing/$traceId`,component:j_}),R_=Or({getParentRoute:()=>M_,path:`tracing/sessions/$sessionId`,component:j_}),z_=Or({getParentRoute:()=>M_,path:`sessions`,component:O_}),B_=Or({getParentRoute:()=>M_,path:`agents`,component:Fl}),V_=Or({getParentRoute:()=>M_,path:`tools`,component:A_}),H_=Or({getParentRoute:()=>M_,path:`sandboxes`,component:D_}),U_=Or({getParentRoute:()=>M_,path:`sandboxes/$sandboxRef`,component:D_}),W_=Or({getParentRoute:()=>M_,path:`mcps`,component:q}),G_=Or({getParentRoute:()=>M_,path:`pipelines`,component:Wl}),K_=Or({getParentRoute:()=>M_,path:`evals`,component:Ll}),q_=Or({getParentRoute:()=>M_,path:`knowledge`,component:K}),J_=Or({getParentRoute:()=>M_,path:`knowledge/$tab`,component:K}),Y_=Or({getParentRoute:()=>M_,path:`memory`,component:J}),X_=Or({getParentRoute:()=>M_,path:`status`,component:k_}),Z_=Kr({routeTree:M_.addChildren([N_,P_,F_,I_,L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_,X_])});function Q_(){let[e,t]=(0,C.useState)(),[n,r]=(0,C.useState)(``),i=ds(),{messages:a,setMessages:o}=i,[c,l]=(0,C.useState)([]),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)([]),[m,h]=(0,C.useState)(`playground`),{theme:g,toggleTheme:_}=bi(),[v,y]=(0,C.useState)(Is),[b,x]=(0,C.useState)(),[S,w]=(0,C.useState)(`Loading`),[,T]=(0,C.useState)(``),[E,D]=(0,C.useState)(`idle`),[O,k]=(0,C.useState)(0),A=(0,C.useRef)(null),j=(0,C.useRef)(null),M=(0,C.useRef)(null),N=(0,C.useRef)(!0);function ee(){let e=M.current;e!==null&&(N.current=e.scrollHeight-e.scrollTop-e.clientHeight<80)}(0,C.useEffect)(()=>{if(m!==`playground`||a.length===0||!N.current)return;let e=window.requestAnimationFrame(()=>{let e=M.current;e!==null&&(e.scrollTop=e.scrollHeight)});return()=>window.cancelAnimationFrame(e)},[m,a]),(0,C.useEffect)(()=>{if(m!==`playground`||typeof ResizeObserver>`u`)return;let e=M.current;if(e===null)return;let t=e.querySelector(`[data-studio-transcript-content]`);if(t===null)return;let n=new ResizeObserver(()=>{N.current&&(e.scrollTop=e.scrollHeight)});return n.observe(t),()=>n.disconnect()},[m]);let te=(0,C.useCallback)(async()=>{w(`Loading`),T(``);try{let e=await fetch(`/config`);if(e.status===401){w(`Authentication required`);return}if(!e.ok)throw Error(`Config failed with HTTP ${e.status}`);let n=await e.json();t(n),r(e=>e||n.agents[0]?.id||``),w(`Connected`)}catch(e){T(s(e)),w(`Config error`)}},[]);(0,C.useEffect)(()=>{te()},[te]);let P=e?.capabilities.sessions?.enabled===!0,F=e?.capabilities.traces?.enabled===!0,ne=e?.capabilities.knowledge?.enabled===!0,re=e?.capabilities.mcps?.enabled===!0,ie=e?.capabilities.tools?.enabled===!0,ae=e?.capabilities.sandboxes?.enabled===!0,I=e?.capabilities.pipelines?.enabled===!0,L=e?.capabilities.evals?.enabled===!0,oe=e?.capabilities.memory?.enabled===!0,se=e?.capabilities.status?.enabled===!0,R=e?.agents??[],ce=e?.pipelines??[],le=e?.evals??[],ue=R.length>0,de=(0,C.useCallback)(()=>{h(`tracing`)},[]),fe=(0,C.useCallback)(e=>{if(e===void 0){Z_.navigate({to:`/playground`});return}Z_.navigate({to:`/playground/$sessionId`,params:{sessionId:e}})},[]),pe=(0,C.useCallback)(()=>{Z_.navigate({to:`/tracing`})},[]),me=Rs({activePage:m,enabled:F,initialTraceId:``,initialTraceSessionId:void 0,onError:T,onNavigateTracing:de,onOpenTrace:(0,C.useCallback)(e=>{Z_.navigate({to:`/tracing/$traceId`,params:{traceId:e}})},[]),onOpenTraceIndex:pe,onOpenTraceSession:(0,C.useCallback)(e=>{Z_.navigate({to:`/tracing/sessions/$sessionId`,params:{sessionId:e}})},[])}),he=(0,C.useMemo)(()=>({hasAgents:ue,sessionsEnabled:P,tracesEnabled:F,toolsEnabled:ie,sandboxesEnabled:ae,mcpsEnabled:re,pipelinesEnabled:I,evalsEnabled:L,memoryEnabled:oe,statusEnabled:se,knowledgeEnabled:ne}),[ue,P,F,ie,ae,re,I,L,oe,se,ne]),ge=R.find(e=>e.id===n)??R[0]??void 0,_e=ge?.id,ve=ge?.quickPrompts??[],{selectedAgentModels:ye,selectedModelRef:be,setSelectedModelRef:xe}=xi({enabled:e?.models!==void 0,selectedAgentId:_e,onError:T}),Se=a.length>0,Ce=(0,C.useCallback)((e,t,n)=>{k(e=>e+1),qo($o(e.transcript)),r(e.agentId),xe(ri(e)),l(t),o(ni(e.transcript,t)),p([]),n.updatePath!==!1&&(h(`playground`),fe(e.id))},[fe,o,xe]),we=(0,C.useCallback)((e,t)=>{me.removeSessionTraces(e),t&&(Jo(),k(e=>e+1),o([]),l([]),d(``),p([]),m===`playground`&&fe(void 0))},[m,fe,o,me]),Te=ks({activePage:m,currentAgentId:ge?.id??n,enabled:P,loadSessionTraceSummaries:me.loadSessionTraceSummaries,runState:E,selectedModelRef:be,onError:T,onSessionCreated:fe,onSessionDeleted:we,onSessionLoaded:Ce,onStatus:w}),{answeringQuestions:Ee,decidingApprovals:De,isStreaming:Oe,workingStartedAt:ke,answerToolQuestion:Ae,decideToolApproval:je,runPrompt:Me,stopPrompt:Ne}=as({attachments:f,messages:a,promptRef:A,runState:E,selectedAgent:ge,selectedAgentId:n,selectedModelRef:be,sessions:Te,sessionsEnabled:P,traces:me,transcript:i,onActivePageChange:h,onAttachmentsChange:p,onBeforeRun:()=>{N.current=!0},onError:T,onPromptChange:d,onRunStateChange:D,onSessionTraceSummariesChange:l,onStatus:w}),Pe=(0,C.useCallback)((e={})=>{E!==`running`&&(Jo(),k(e=>e+1),Te.clearSelectedSession(),o([]),l([]),d(``),p([]),h(`playground`),T(``),e.updatePath!==!1&&fe(void 0),requestAnimationFrame(()=>Zo(A.current)))},[fe,E,Te,o]),Fe=(0,C.useCallback)(e=>{E===`running`||e===n||(r(e),xe(``),Jo(),k(e=>e+1),Te.clearSelectedSession(),o([]),l([]),d(``),p([]),h(`playground`),T(``),fe(void 0),requestAnimationFrame(()=>Zo(A.current)))},[fe,E,n,Te,o,xe]);function Ie(e){d(Xo(e)),Zo(e.currentTarget)}async function Le(e){let t=Array.from(e.currentTarget.files??[]);if(e.currentTarget.value=``,t.length!==0)try{let e=await Promise.all(t.map(oi));p(t=>[...t,...e])}catch(e){T(s(e))}}function Re(e){p(t=>t.filter(t=>t.id!==e))}function ze(e){e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),Me(u))}let Be=(0,C.useCallback)(e=>As(e,he),[he]),Ve=(0,C.useCallback)(e=>{if(As(e,he)){if(h(e),e===`tracing`){me.clearTraceSelection(),Z_.navigate({to:`/tracing`});return}if(e===`knowledge`){me.clearTraceSelection(),Z_.navigate({to:`/knowledge/$tab`,params:{tab:v}});return}if(me.clearTraceSelection(),e===`playground`&&Te.selectedSessionId.length>0){fe(Te.selectedSessionId);return}Z_.navigate({to:`/${e}`})}},[v,fe,he,Te.selectedSessionId,me]),He=(0,C.useCallback)(e=>{Ve(js(e,he))},[Ve,he]);function Ue(e){h(`knowledge`),y(e),me.clearTraceSelection(),Z_.navigate({to:`/knowledge/$tab`,params:{tab:e}})}let We={activePage:m,agents:R,answeringQuestions:Ee,attachments:f,decidingApprovals:De,deleteCandidate:b,evals:le,evalsEnabled:L,hasAgents:ue,hasMessages:Se,isStreaming:Oe,workingStartedAt:ke,knowledgeEnabled:ne,knowledgeTab:v,mcpsEnabled:re,memoryEnabled:oe,messages:a,pageEnabled:Be,pipelines:ce,pipelinesEnabled:I,prompt:u,runState:E,sandboxesEnabled:ae,selectedAgent:ge,selectedAgentId:n,selectedAgentModels:ye,selectedAgentQuickPrompts:ve,selectedModelRef:be,sessionTraceSummaries:c,sessions:Te,sessionsEnabled:P,status:S,statusEnabled:se,theme:g,toolsEnabled:ie,traces:me,tracesEnabled:F,attachmentInputRef:j,promptRef:A,transcriptScrollerRef:M,transcriptResetKey:O,activateRoute:(0,C.useCallback)(e=>{if(!As(e,he)){He(e);return}h(e),e!==`tracing`&&me.clearTraceSelection()},[He,he,me]),navigateFallback:He,navigatePage:Ve,navigateKnowledgeTab:Ue,setDeleteCandidate:x,setError:T,setKnowledgeTab:y,setSelectedModelRef:xe,setStatus:w,startNewChat:Pe,selectPlaygroundAgent:Fe,addPromptAttachments:Le,decideToolApproval:je,updatePrompt:Ie,handlePromptKeyDown:ze,answerToolQuestion:Ae,removePromptAttachment:Re,runPrompt:Me,stopPrompt:Ne,toggleTheme:_,updateTranscriptStickiness:ee};return(0,z.jsx)(zs.Provider,{value:We,children:(0,z.jsx)(Yr,{router:Z_})})}var $_=document.getElementById(`anvia-ui`);$_!==null&&(0,S.createRoot)($_).render((0,z.jsx)(Q_,{}));export{Ec as $,Yl as A,rc as B,zu as C,wu as D,Du as E,Tl as F,pc as G,oc as H,_l as I,vc as J,mc as K,ml as L,xl as M,wl as N,ou as O,Cl as P,wc as Q,$c as R,Xu as S,ju as T,sc as U,ac as V,cc as W,bc as X,yc as Y,Cc as Z,om as _,e_ as a,Lc as at,hd as b,a_ as c,ns as ct,$g as d,b as dt,Dc as et,Zg as f,bm as g,Lm as h,n_ as i,Ic as it,vl as j,$l as k,Yg as l,Ho as lt,Kh as m,o_ as n,Nc as nt,i_ as o,zc as ot,Xg as p,gc as q,r_ as r,Pc as rt,t_ as s,Gc as st,y_ as t,kc as tt,Qg as u,$n as ut,nm as v,Bu as w,rd as x,Q as y,Xc as z};
|
|
56
|
-
//# sourceMappingURL=index-
|
|
55
|
+
`},Vh=0,Hh=[];function Uh(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(Vh++)[0],a=C.useState(dh)[0],o=C.useRef(e);C.useEffect(function(){o.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Bm([e.lockRef.current],(e.shards||[]).map(Rh),!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=C.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ih(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=kh(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=kh(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 Fh(h,t,e,h===`h`?s:c,!0)},[]),c=C.useCallback(function(e){var n=e;if(!(!Hh.length||Hh[Hh.length-1]!==a)){var r=`deltaY`in n?Lh(n):Ih(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&zh(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Rh).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=C.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Wh(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=C.useCallback(function(e){n.current=Ih(e),r.current=void 0},[]),d=C.useCallback(function(t){l(t.type,Lh(t),t.target,s(t,e.lockRef.current))},[]),f=C.useCallback(function(t){l(t.type,Ih(t),t.target,s(t,e.lockRef.current))},[]);C.useEffect(function(){return Hh.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,wh),document.addEventListener(`touchmove`,c,wh),document.addEventListener(`touchstart`,u,wh),function(){Hh=Hh.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,wh),document.removeEventListener(`touchmove`,c,wh),document.removeEventListener(`touchstart`,u,wh)}},[]);var p=e.removeScrollBar,m=e.inert;return C.createElement(C.Fragment,null,m?C.createElement(a,{styles:Bh(i)}):null,p?C.createElement(xh,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Wh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Gh=eh(th,Uh),Kh=C.forwardRef(function(e,t){return C.createElement(rh,Rm({},e,{ref:t,sideCar:Gh}))});Kh.classNames=rh.classNames;var qh=Object.defineProperty,Jh=(e,t)=>qh(e,`name`,{value:t,configurable:!0}),Yh=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Xh=[` `,`Enter`],Zh=`Select`,[Qh,$h,eg]=uu(Zh),[tg,ng]=ou(Zh,[eg,zp]),rg=zp(),[ig,ag]=tg(Zh),[og,sg]=tg(Zh);function cg(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=rg(t),[_,v]=C.useState(null),[y,b]=C.useState(null),[x,S]=C.useState(!1),w=wu(l),[T,E]=bm({prop:r,defaultProp:i??!1,onChange:a,caller:Zh}),[D,O]=bm({prop:o,defaultProp:s,onChange:c,caller:Zh}),k=C.useRef(null),A=C.useRef(D);C.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=Jh(()=>O(A.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,O]);let j=_?!!m||!!_.closest(`form`):!0,[M,N]=C.useState(new Set),ee=Q(),te=Array.from(M).map(e=>e.props.value).join(`;`),P=C.useCallback(e=>{N(t=>new Set(t).add(e))},[]),F=C.useCallback(e=>{N(t=>{let n=new Set(t);return n.delete(e),n})},[]),ne={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:ee,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:M,nativeSelectKey:te,isFormControl:j};return(0,z.jsx)(Qp,{...g,children:(0,z.jsx)(ig,{scope:t,...ne,children:(0,z.jsx)(Qh.Provider,{scope:t,children:(0,z.jsx)(og,{scope:t,onNativeOptionAdd:P,onNativeOptionRemove:F,children:Wg(h)?h(ne):n})})})})}Jh(cg,`SelectProvider`);var lg=Jh(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,z.jsx)(cg,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,z.jsxs)(z.Fragment,{children:[n,e?(0,z.jsx)(Ug,{__scopeSelect:t}):null]})})},`Select`),ug=`SelectTrigger`,dg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=rg(n),o=ag(ug,n),s=o.disabled||r,c=Xc(t,o.onTriggerChange),l=$h(n),u=C.useRef(`touch`),[d,f,p]=Kg(e=>{let t=l().filter(e=>!e.disabled),n=qg(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=Jh(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,z.jsx)($p,{asChild:!0,...a,children:(0,z.jsx)(Du.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Gg(o.value)?``:void 0,...i,ref:c,onClick:$l(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:$l(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:$l(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Yh.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),fg=`SelectValue`,pg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=ag(fg,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Xc(t,c.onValueNodeChange);hd(()=>{l(u)},[l,u]);let f=Gg(c.value);return(0,z.jsx)(Du.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,z.jsx)(C.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),mg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,z.jsx)(Du.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[hg,gg]=tg(`SelectPortal`,{forceMount:void 0}),_g=Jh(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,z.jsx)(hg,{scope:e.__scopeSelect,forceMount:n,children:(0,z.jsx)(nm,{asChild:!0,...r})})},`SelectPortal`),vg=`SelectContent`,yg=C.forwardRef(Jh(function(e,t){let n=gg(vg,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=ag(vg,e.__scopeSelect),[o,s]=C.useState();return hd(()=>{s(new DocumentFragment)},[]),(0,z.jsx)(om,{present:r||a.open,children:({present:e})=>e?(0,z.jsx)(Tg,{...i,ref:t}):(0,z.jsx)(bg,{...i,fragment:o})})},`SelectContent`)),bg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?pr.createPortal((0,z.jsx)(Sg,{scope:n,children:(0,z.jsx)(Qh.Slot,{scope:n,children:(0,z.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),xg=10,[Sg,Cg]=tg(vg),wg=$c(`SelectContent.RemoveScroll`),Tg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=ag(vg,n),[y,b]=C.useState(null),[x,S]=C.useState(null),w=Xc(t,b),[T,E]=C.useState(null),[D,O]=C.useState(null),k=$h(n),[A,j]=C.useState(!1),M=C.useRef(!1);C.useEffect(()=>{if(y)return Lm(y)},[y]),Xu();let N=C.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,x]),ee=C.useCallback(()=>N([T,y]),[N,T,y]);C.useEffect(()=>{A&&ee()},[A,ee]);let{onOpenChange:te,triggerPointerDownPosRef:P}=v;C.useEffect(()=>{if(y){let e={x:0,y:0},t=Jh(t=>{e={x:Math.abs(Math.round(t.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(P.current?.y??0))}},`handlePointerMove`),n=Jh(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||te(!1),document.removeEventListener(`pointermove`,t),P.current=null},`handlePointerUp`);return P.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,te,P]),C.useEffect(()=>{let e=Jh(()=>te(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[te]);let[F,ne]=Kg(e=>{let t=k().filter(e=>!e.disabled),n=qg(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),re=C.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&(E(e),r&&(M.current=!0))},[v.value]),ie=C.useCallback(()=>y?.focus(),[y]),ae=C.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&O(e)},[v.value]),I=r===`popper`?Dg:Eg,L=I===Dg?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,z.jsx)(Sg,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:re,selectedItem:T,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:ee,selectedItemText:D,position:r,isPositioned:A,searchRef:F,children:(0,z.jsx)(Kh,{as:wg,allowPinchZoom:!0,children:(0,z.jsx)(rd,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:$l(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,z.jsx)(zu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,z.jsx)(I,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...L,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:$l(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Eg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=ag(vg,n),o=Cg(vg,n),[s,c]=C.useState(null),[l,u]=C.useState(null),d=Xc(t,u),f=$h(n),p=C.useRef(!1),m=C.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=C.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-xg,d=Yl(a,[xg,Math.max(xg,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-xg,d=Yl(a,[xg,Math.max(xg,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-xg*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-xg,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${xg}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);hd(()=>y(),[y]);let[b,x]=C.useState();return hd(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,z.jsx)(Og,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,z.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,z.jsx)(Du.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Dg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=xg,...a}=e,o=rg(n);return(0,z.jsx)(em,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Og,kg]=tg(vg,{}),Ag=`SelectViewport`,jg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Cg(Ag,n),o=kg(Ag,n),s=Xc(t,a.onViewportChange),c=C.useRef(0);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,z.jsx)(Qh.Slot,{scope:n,children:(0,z.jsx)(Du.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:$l(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-xg*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Mg,Ng]=tg(`SelectGroup`),Pg=`SelectItem`,[Fg,Ig]=tg(Pg),Lg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=ag(Pg,n),c=Cg(Pg,n),l=s.value===r,[u,d]=C.useState(a??``),[f,p]=C.useState(!1),m=Xc(t,ju(e=>c.itemRefCallback?.(e,r,i))),h=Q(),g=C.useRef(`touch`),_=Jh(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,z.jsx)(Fg,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:C.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,z.jsx)(Qh.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,z.jsx)(Du.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:$l(o.onFocus,()=>p(!0)),onBlur:$l(o.onBlur,()=>p(!1)),onClick:$l(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:$l(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:$l(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:$l(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$l(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:$l(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(Xh.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Rg=`SelectItemText`,zg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=ag(Rg,n),s=Cg(Rg,n),c=Ig(Rg,n),l=sg(Rg,n),[u,d]=C.useState(null),f=ju(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Xc(t,d,c.onItemTextChange,f),m=u?.textContent,h=C.useMemo(()=>(0,z.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return hd(()=>(g(h),()=>_(h)),[g,_,h]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Du.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Gg(o.value)?pr.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Bg=`SelectItemIndicator`,Vg=C.forwardRef(Jh(function(e,t){let{__scopeSelect:n,...r}=e;return Ig(Bg,n).isSelected?(0,z.jsx)(Du.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Hg=`SelectBubbleInput`,Ug=C.forwardRef(Jh(function({__scopeSelect:e,...t},n){let r=ag(Hg,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=C.useRef(null),m=Xc(n,p),h=i??``,g=Dm(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return C.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,z.jsxs)(Du.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Om,...t.style},ref:m,defaultValue:h,children:[Gg(i)&&!_?(0,z.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function Wg(e){return typeof e==`function`}Jh(Wg,`isFunction`);function Gg(e){return e===``||e===void 0}Jh(Gg,`shouldShowPlaceholder`);function Kg(e){let t=ju(e),n=C.useRef(``),r=C.useRef(0),i=C.useCallback(e=>{let i=n.current+e;t(i),Jh((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=C.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Jh(Kg,`useTypeaheadSearch`);function qg(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Jg(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Jh(qg,`findNextItem`);function Jg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Jh(Jg,`wrapArray`);var Yg=lg,Xg=pg;function Zg({className:e,children:t,...n}){return(0,z.jsxs)(dg,{className:a(`flex h-9 w-full items-center justify-between rounded-lg border border-input bg-card/90 px-3 text-sm text-foreground outline-none transition duration-200 hover:border-muted-foreground/45 focus:border-muted-foreground/60 focus:ring-2 focus:ring-muted-foreground/20 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:[t,(0,z.jsx)(mg,{asChild:!0,children:(0,z.jsx)(_l,{icon:ac,className:`h-4 w-4 opacity-60`})})]})}function Qg({className:e,children:t,position:n=`popper`,...r}){return(0,z.jsx)(_g,{children:(0,z.jsx)(yg,{position:n,className:a(`z-50 max-h-80 min-w-[8rem] overflow-hidden rounded-xl border border-border/90 bg-popover/98 text-popover-foreground shadow-xl shadow-black/45 backdrop-blur`,e),...r,children:(0,z.jsx)(jg,{className:`p-1`,children:t})})})}function $g({className:e,children:t,...n}){return(0,z.jsxs)(Lg,{className:a(`relative flex min-h-8 cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-sm outline-none transition data-[disabled]:pointer-events-none data-[highlighted]:bg-muted/65 data-[highlighted]:text-foreground data-[disabled]:opacity-50`,e),...n,children:[(0,z.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,z.jsx)(Vg,{children:(0,z.jsx)(_l,{icon:hc,className:`h-4 w-4`})})}),(0,z.jsx)(zg,{children:t})]})}function e_({className:e,...t}){return(0,z.jsx)(`section`,{className:a(`grid h-full min-h-0 min-w-0 max-h-full max-w-full overflow-hidden bg-background/45`,e),...t})}function t_({className:e,...t}){return(0,z.jsx)(`div`,{className:a(`min-h-0 min-w-0 overflow-hidden rounded-2xl border border-border/80 bg-card/70`,e),...t})}function n_(e){return(0,z.jsxs)(`div`,{className:a(`grid gap-1 rounded-xl border border-border/80 bg-card/45 p-4`,e.className),children:[(0,z.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground`,children:e.label}),(0,z.jsx)(`span`,{className:`text-lg font-semibold tabular-nums text-foreground`,children:e.value})]})}function r_(e){return(0,z.jsx)(`div`,{className:a(`grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center`,e.className),children:(0,z.jsxs)(`div`,{className:`grid max-w-md gap-2`,children:[(0,z.jsx)(`h2`,{className:`m-0 text-base font-semibold text-foreground`,children:e.title}),(0,z.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:e.text})]})})}function i_({className:e,...t}){return(0,z.jsx)(`span`,{className:a(`inline-flex items-center rounded-lg border border-border/80 bg-muted/55 px-2 py-1 text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground`,e),...t})}function a_({className:e,...t}){return(0,z.jsx)(`div`,{className:a(`grid gap-1 rounded-xl border border-border/80 bg-background p-1`,e),...t})}function o_({className:e,...t}){return(0,z.jsx)(`textarea`,{className:a(`min-h-9 w-full resize-none rounded-lg border border-input bg-card/90 px-3 py-2.5 leading-6 text-foreground outline-none transition duration-200 placeholder:text-muted-foreground/65 focus:border-muted-foreground/60 focus:ring-2 focus:ring-muted-foreground/20`,e),...t})}function s_(e){let t=new Map,n=new Map(e.traceSummaries.map(e=>{let t=l_(e);return t===void 0?void 0:[e.id,t]}).filter(e=>e!==void 0)),r=e.logs.filter(e=>e.category===`run`&&(e.event===`run.completed`||e.event===`run.cancelled`||e.event===`run.failed`)).sort((e,t)=>e.sequence-t.sequence).map(u_),i=0;for(let a of e.entries){if(!c_(a))continue;let e=r[i];i+=1;let o=a.traceId===void 0?e:n.get(a.traceId)??e,s=p_(a.durationMs,o);s!==void 0&&t.set(a.entryId,s)}return t}function c_(e){return e.kind===`message`&&e.role===`assistant`&&(e.text.trim().length>0||m_(e.durationMs)!==void 0)&&(!(`tone`in e)||e.tone!==`pending`)}function l_(e){let t=m_(e.durationMs),n=d_(e.usage),r={};return t!==void 0&&(r.durationMs=t),n!==void 0&&(r.usage=n),f_(r)}function u_(e){let t=e.metadata;if(!c(t))return;let n=m_(t.durationMs),r=d_(t.usage),i={};return n!==void 0&&(i.durationMs=n),r!==void 0&&(i.usage=r),f_(i)}function d_(e){if(!c(e))return;let t=h_(e.inputTokens),n=h_(e.outputTokens),r=h_(e.totalTokens)??(t===void 0||n===void 0?void 0:t+n),i={};t!==void 0&&(i.inputTokens=t),n!==void 0&&(i.outputTokens=n),r!==void 0&&(i.totalTokens=r);let a=h_(e.cachedInputTokens),o=h_(e.cacheCreationInputTokens);return a!==void 0&&(i.cachedInputTokens=a),o!==void 0&&(i.cacheCreationInputTokens=o),Object.keys(i).length===0?void 0:i}function f_(e){return e.durationMs===void 0&&e.usage===void 0?void 0:e}function p_(e,t){let n=m_(e);return n===void 0?t:{...t,durationMs:n}}function m_(e){let t=h_(e);return t!==void 0&&t>=0?t:void 0}function h_(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}var g_={getKey(e){return String(e.entryId)},getText(e){if(e.kind===`reasoning`||e.kind===`message`&&e.role===`assistant`)return e.text},withText(e,t){return e.kind===`reasoning`?{...e,text:t}:e.kind===`message`&&e.role===`assistant`?`tone`in e&&e.tone===`pending`?e:{...e,text:t}:e}};function __(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.kind===`message`&&n.role===`assistant`)return n.entryId;if(n?.kind===`message`&&n.role===`user`)return}}function v_(e){let t=e.at(-1);return t?.kind===`message`&&t.role===`assistant`&&`tone`in t&&t.tone===`error`}function y_(e){let[t,n]=(0,C.useState)(()=>Date.now()),r=e.startedAt!==void 0&&e.durationMs===void 0;(0,C.useEffect)(()=>{if(!r)return;n(Date.now());let e=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(e)},[r]);let i=e.durationMs??(e.startedAt===void 0?void 0:t-e.startedAt);return i===void 0?null:(0,z.jsxs)(`span`,{"aria-live":`off`,className:a(`inline-flex items-center gap-1.5 text-xs font-medium tabular-nums text-muted-foreground`,e.className),role:r?`timer`:void 0,children:[r?(0,z.jsx)(_l,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 animate-spin`,icon:jc}):null,b_(i,r?`working`:`finished`)]})}function b_(e,t=`working`){let n=Math.floor((Number.isFinite(e)?Math.max(0,e):0)/1e3),r=Math.floor(n/60),i=n%60,a=r===0?`${i}s`:`${r}m ${i}s`;return`${t===`working`?`Working`:`Finished`} - ${a}`}var x_=(0,C.lazy)(()=>Ws(()=>import(`./transcript-item-CHLeQcgs.js`).then(e=>({default:e.TranscriptItem})),__vite__mapDeps([18,1,5,6,2])));function S_(e){let t=zo(e.messages,{adapter:g_,flushImmediately:v_(e.messages),isStreaming:e.isStreaming,resetKey:e.resetKey}),n=(0,C.useMemo)(()=>new Map(e.messages.map(e=>[e.entryId,e])),[e.messages]),r=(0,C.useMemo)(()=>s_({entries:e.messages,traceSummaries:e.sessionTraceSummaries,logs:e.sessionLogs}),[e.messages,e.sessionLogs,e.sessionTraceSummaries]),i=(0,C.useRef)(e.workingStartedAt),a=e.workingStartedAt??(t.isDraining?i.current:void 0),o=a===void 0?void 0:__(e.messages),s=t.items.some(e=>e.entryId===o)?o:void 0;return(0,C.useEffect)(()=>{e.workingStartedAt!==void 0&&(i.current=e.workingStartedAt),!t.isDraining&&e.workingStartedAt===void 0&&(i.current=void 0)},[e.workingStartedAt,t.isDraining]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(C.Suspense,{fallback:null,children:t.items.map(i=>(0,z.jsx)(x_,{entry:n.get(i.entryId)??i,displayText:g_.getText(i),live:t.liveItemKey===String(i.entryId),metrics:r.get(i.entryId),workingStartedAt:i.entryId===s?a:void 0,decidingApprovals:e.decidingApprovals,answeringQuestions:e.answeringQuestions,onApprovalDecision:e.onApprovalDecision,onQuestionAnswer:e.onQuestionAnswer,onOpenTrace:e.onOpenTrace},i.entryId))}),a!==void 0&&s===void 0?(0,z.jsx)(`article`,{className:`max-w-[min(82ch,100%)] justify-self-start text-foreground`,children:(0,z.jsx)(y_,{startedAt:a})}):null]})}function C_(e){return(0,z.jsxs)(e_,{className:`grid-cols-[minmax(0,1fr)_minmax(0,460px)] max-xl:grid-cols-1`,children:[(0,z.jsx)(`div`,{className:`grid min-h-0 min-w-0`,children:(0,z.jsxs)(`div`,{className:`grid h-full min-h-0 min-w-0 grid-rows-[minmax(0,1fr)_auto]`,children:[(0,z.jsx)(`section`,{className:`min-h-0 overflow-y-auto overflow-x-hidden px-4 py-4 [overflow-anchor:none] [scrollbar-gutter:stable]`,ref:e.transcriptScrollerRef,onScroll:e.onTranscriptScroll,children:(0,z.jsxs)(`div`,{className:`mx-auto grid min-h-full w-full max-w-235 content-start items-start gap-6 pb-8`,"data-studio-transcript-content":``,children:[e.hasMessages?null:(0,z.jsx)(`div`,{className:`grid min-h-96 place-items-center text-sm font-medium text-muted-foreground`,children:(0,z.jsxs)(`div`,{className:`grid max-w-xl gap-4 text-center`,children:[(0,z.jsx)(`div`,{className:`mx-auto h-px w-28 bg-muted/55`}),(0,z.jsx)(`h1`,{className:`m-0 text-4xl font-semibold leading-tight text-foreground text-balance`,children:`What should this agent work on?`}),(0,z.jsx)(`p`,{className:`m-0 text-base leading-7 text-muted-foreground text-pretty`,children:`Choose a prompt below or write a task. Studio will stream the response, tool calls, approvals, and trace data here.`})]})}),(0,z.jsx)(S_,{answeringQuestions:e.answeringQuestions,decidingApprovals:e.decidingApprovals,isStreaming:e.isStreaming,messages:e.messages,resetKey:e.transcriptResetKey,sessionLogs:e.sessionLogs,sessionTraceSummaries:e.sessionTraceSummaries,workingStartedAt:e.workingStartedAt,onApprovalDecision:e.onApprovalDecision,onOpenTrace:e.onOpenTrace,onQuestionAnswer:e.onQuestionAnswer})]})}),(0,z.jsxs)(`form`,{className:`grid gap-3 bg-gradient-to-t from-card via-card/95 to-card/0 px-4 pb-4 pt-2`,onSubmit:t=>{t.preventDefault(),e.onRunPrompt(e.prompt)},children:[e.hasMessages||e.selectedAgentQuickPrompts.length===0?null:(0,z.jsx)(`div`,{className:`mx-auto grid w-full max-w-235 grid-cols-3 gap-2 max-md:grid-cols-1`,children:e.selectedAgentQuickPrompts.map(t=>(0,z.jsx)(ml,{className:`h-auto min-h-16 justify-start whitespace-normal rounded-lg border border-border/80 bg-card/85 px-3 py-2.5 text-left text-sm font-medium leading-5 text-foreground shadow-sm hover:border-border/80 hover:bg-muted/45 hover:text-foreground`,type:`button`,variant:`ghost`,disabled:e.runState===`running`||e.selectedAgentId.length===0,onClick:()=>e.onRunPrompt(t),children:(0,z.jsx)(`span`,{className:`min-w-0 whitespace-normal wrap-break-words`,children:t})},t))}),(0,z.jsxs)(`div`,{className:`mx-auto grid w-full max-w-235 gap-2 rounded-xl border border-border/80 bg-card/95 p-2.5 backdrop-blur`,children:[(0,z.jsx)(o_,{className:`min-h-16 min-w-0 resize-none rounded-lg border-0 bg-transparent px-3 py-3 text-base leading-7 text-foreground shadow-none outline-none ring-0 placeholder:text-muted-foreground/70 focus:border-transparent focus:ring-0`,ref:e.promptRef,rows:1,value:e.prompt,onChange:e.onPromptChange,onKeyDown:e.onPromptKeyDown,placeholder:`Ask anything...`}),e.attachments.length===0?null:(0,z.jsx)(`div`,{className:`flex min-w-0 flex-wrap gap-1.5 px-2`,children:e.attachments.map(t=>(0,z.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border/80 bg-muted/55 px-2 py-1 text-xs font-medium text-muted-foreground`,children:[(0,z.jsxs)(`span`,{className:`min-w-0 truncate`,children:[t.kind===`image`?`Image`:`Doc`,` / `,t.name]}),(0,z.jsx)(ml,{"aria-label":`Remove ${t.name}`,className:`h-5 min-h-5 w-5 rounded-md border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-accent hover:text-foreground [&_svg]:h-3 [&_svg]:w-3`,size:`icon`,type:`button`,variant:`ghost`,onClick:()=>e.onRemovePromptAttachment(t.id),children:(0,z.jsx)(_l,{icon:fc,"aria-hidden":`true`})})]},t.id))}),(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,z.jsx)(`input`,{ref:e.attachmentInputRef,className:`hidden`,type:`file`,multiple:!0,accept:Zr,onChange:e.onAddPromptAttachments}),(0,z.jsx)(ml,{"aria-label":`Attach image or document`,className:`h-8 min-h-8 w-8 border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground`,size:`icon`,type:`button`,variant:`ghost`,disabled:e.runState===`running`,onClick:()=>e.attachmentInputRef.current?.click(),children:(0,z.jsx)(_l,{icon:uc,"aria-hidden":`true`})})]}),(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e.selectedAgentModels.length===0?null:(0,z.jsxs)(Yg,{value:e.selectedModelRef,onValueChange:e.onSelectModel,disabled:e.runState===`running`,children:[(0,z.jsx)(Zg,{"aria-label":`Select model`,className:`flex h-8 min-h-8 w-auto max-w-44 gap-2 border-0 bg-transparent px-2 py-1 text-xs font-medium text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground sm:max-w-72`,children:(0,z.jsx)(Xg,{placeholder:`Model`})}),(0,z.jsx)(Qg,{align:`end`,children:e.selectedAgentModels.map(e=>(0,z.jsx)($g,{value:e.ref,children:ai(e)},e.ref))})]}),e.agents.length>1?(0,z.jsxs)(Yg,{value:e.selectedAgent?.id??e.selectedAgentId,onValueChange:e.onSelectAgent,disabled:e.runState===`running`,children:[(0,z.jsx)(Zg,{"aria-label":`Select agent`,className:`flex h-8 min-h-8 w-auto max-w-64 gap-2 border-0 bg-transparent px-2 py-1 text-xs font-medium text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground`,children:(0,z.jsx)(Xg,{placeholder:`Agent`})}),(0,z.jsx)(Qg,{align:`end`,children:e.agents.map(e=>(0,z.jsx)($g,{value:e.id,children:e.name??e.id},e.id))})]}):null,(0,z.jsx)(ml,{"aria-label":e.isStreaming?`Stop generating`:e.runState===`running`?`Running`:`Send message`,className:`h-9 min-h-9 w-9 rounded-full border-white bg-white text-black hover:bg-white/90`,size:`icon`,type:e.isStreaming?`button`:`submit`,disabled:!e.isStreaming&&(e.runState===`running`||e.selectedAgentId.length===0),onClick:e.isStreaming?e.onStopPrompt:void 0,children:(0,z.jsx)(_l,{fill:e.isStreaming?`currentColor`:void 0,icon:e.isStreaming?Vc:lc})})]})]})]})]})]})}),(0,z.jsx)(w_,{sessions:e.allSessions,selectedSessionId:e.selectedSessionId,runState:e.runState,onDeleteSession:e.onDeleteSession,onLoadSession:e.onLoadSession})]})}function w_(e){return(0,z.jsx)(`aside`,{className:`grid h-full min-h-0 min-w-0 max-h-full overflow-hidden border-l border-sidebar-border bg-sidebar text-sidebar-foreground max-xl:hidden`,"aria-label":`Sessions`,children:(0,z.jsx)(`nav`,{className:`grid min-h-0 content-start gap-0.5 overflow-auto px-3 py-3`,"aria-label":`Sessions`,children:e.sessions.map(t=>(0,z.jsx)(T_,{session:t,active:t.id===e.selectedSessionId,disabled:e.runState===`running`,onDeleteSession:e.onDeleteSession,onLoadSession:e.onLoadSession},t.id))})})}function T_(e){let t=e.session.title??`Untitled chat`;return(0,z.jsxs)(`div`,{className:`group relative min-w-0`,children:[(0,z.jsxs)(ml,{className:a(`studio-sidebar-nav-button h-9 min-h-9 w-full justify-start gap-3 rounded-lg bg-transparent px-2.5 py-0.5 pr-9 text-base font-medium text-sidebar-foreground/62 shadow-none transition duration-200 hover:text-sidebar-foreground active:translate-y-px [&_svg]:h-[17px] [&_svg]:w-[17px]`,e.active&&`studio-sidebar-nav-button-active text-sidebar-accent-foreground`),type:`button`,variant:`ghost`,disabled:e.disabled,onClick:()=>e.onLoadSession(e.session.id),children:[(0,z.jsx)(_l,{icon:mc,"aria-hidden":`true`}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t})]}),(0,z.jsx)(ml,{"aria-label":`Delete ${t}`,className:`absolute right-1 top-1/2 hidden h-7 min-h-7 w-7 -translate-y-1/2 rounded-lg border-0 bg-transparent p-0 text-muted-foreground opacity-70 shadow-none hover:bg-sidebar-accent hover:text-destructive hover:opacity-100 group-hover:inline-flex group-focus-within:inline-flex [&_svg]:h-4 [&_svg]:w-4`,size:`icon`,type:`button`,variant:`ghost`,disabled:e.disabled,onClick:()=>e.onDeleteSession(e.session),children:(0,z.jsx)(_l,{icon:ic,"aria-hidden":`true`})})]})}function E_(){let e=Nl(`playground`),t=cr({strict:!1}).sessionId,n=(0,C.useRef)(null);return(0,C.useEffect)(()=>{if(n.current!==t&&e.pageEnabled(`playground`)){if(e.runState===`running`){n.current=t;return}if(t===void 0){n.current=t,e.startNewChat({updatePath:!1});return}e.sessionsEnabled&&(n.current=t,t!==e.sessions.selectedSessionId&&e.sessions.loadSession(t,{updatePath:!1}))}},[t,e]),(0,z.jsx)(C_,{agents:e.agents,allSessions:e.sessions.allSessions,answeringQuestions:e.answeringQuestions,attachments:e.attachments,decidingApprovals:e.decidingApprovals,hasMessages:e.hasMessages,isStreaming:e.isStreaming,workingStartedAt:e.workingStartedAt,messages:e.messages,prompt:e.prompt,runState:e.runState,selectedAgent:e.selectedAgent,selectedAgentId:e.selectedAgentId,selectedAgentModels:e.selectedAgentModels,selectedAgentQuickPrompts:e.selectedAgentQuickPrompts,selectedModelRef:e.selectedModelRef,selectedSessionId:e.sessions.selectedSessionId,sessionLogs:e.sessions.sessionLogs,sessionTraceSummaries:e.sessionTraceSummaries,attachmentInputRef:e.attachmentInputRef,promptRef:e.promptRef,transcriptScrollerRef:e.transcriptScrollerRef,transcriptResetKey:e.transcriptResetKey,onAddPromptAttachments:e.addPromptAttachments,onApprovalDecision:e.decideToolApproval,onDeleteSession:e.setDeleteCandidate,onLoadSession:t=>void e.sessions.loadSession(t),onOpenTrace:e.traces.selectTrace,onPromptChange:e.updatePrompt,onPromptKeyDown:e.handlePromptKeyDown,onQuestionAnswer:e.answerToolQuestion,onRemovePromptAttachment:e.removePromptAttachment,onRunPrompt:e.runPrompt,onStopPrompt:e.stopPrompt,onSelectAgent:e.selectPlaygroundAgent,onSelectModel:e.setSelectedModelRef,onTranscriptScroll:e.updateTranscriptStickiness})}function D_(){let e=Nl(`sandboxes`),t=cr({strict:!1}),n=ur();return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Qs,{enabled:e.sandboxesEnabled,onError:e.setError,onSelectSandbox:e=>{n({to:`/sandboxes/$sandboxRef`,params:{sandboxRef:e}})},...t.sandboxRef===void 0?{}:{initialSandboxRef:t.sandboxRef}})})}function O_(){let e=Nl(`sessions`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Zs,{agents:e.agents,sessions:e.sessions.allSessions,sessionsEnabled:e.sessionsEnabled,sessionLoadState:e.sessions.sessionLoadState,selectedSessionId:e.sessions.selectedSessionId,onOpenSession:t=>void e.sessions.loadSession(t),onViewSessionTracing:t=>void e.traces.showSessionTraces(t),onDeleteSession:e.setDeleteCandidate})})}function k_(){let e=Nl(`status`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(ec,{enabled:e.statusEnabled})})}function A_(){let e=Nl(`tools`);return(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(Rl,{active:!0,agents:e.agents,enabled:e.toolsEnabled,selectedAgentId:e.selectedAgent?.id||e.selectedAgentId,onError:e.setError})})}function j_(){let e=Nl(`tracing`),t=cr({strict:!1}),n=(0,C.useRef)(``);return(0,C.useEffect)(()=>{let r=t.sessionId===void 0?`trace:${t.traceId??``}`:`session:${t.sessionId}`;if(n.current!==r&&e.pageEnabled(`tracing`)){if(n.current=r,t.sessionId!==void 0){e.traces.showSessionTraces(t.sessionId,{updatePath:!1});return}e.traces.setTraceLocation(t.traceId??``,void 0)}},[t.sessionId,t.traceId,e]),(0,z.jsx)(C.Suspense,{fallback:(0,z.jsx)(W,{}),children:(0,z.jsx)(nc,{agents:e.agents,traces:e.traces.traces,tracesEnabled:e.tracesEnabled,traceLoadState:e.traces.traceLoadState,selectedTraceId:e.traces.selectedTraceId,traceSessionDetailId:e.traces.traceSessionDetailId,onRefresh:()=>void e.traces.loadTraces(),onSelectTrace:e.traces.selectTrace,onShowSessionTraces:t=>void e.traces.showSessionTraces(t)})})}var M_=Ar({component:Ml}),N_=Or({getParentRoute:()=>M_,path:`/`,component:()=>(0,z.jsx)(dr,{to:`/playground`,replace:!0})}),P_=Or({getParentRoute:()=>M_,path:`playground`,component:E_}),F_=Or({getParentRoute:()=>M_,path:`playground/$sessionId`,component:E_}),I_=Or({getParentRoute:()=>M_,path:`tracing`,component:j_}),L_=Or({getParentRoute:()=>M_,path:`tracing/$traceId`,component:j_}),R_=Or({getParentRoute:()=>M_,path:`tracing/sessions/$sessionId`,component:j_}),z_=Or({getParentRoute:()=>M_,path:`sessions`,component:O_}),B_=Or({getParentRoute:()=>M_,path:`agents`,component:Fl}),V_=Or({getParentRoute:()=>M_,path:`tools`,component:A_}),H_=Or({getParentRoute:()=>M_,path:`sandboxes`,component:D_}),U_=Or({getParentRoute:()=>M_,path:`sandboxes/$sandboxRef`,component:D_}),W_=Or({getParentRoute:()=>M_,path:`mcps`,component:q}),G_=Or({getParentRoute:()=>M_,path:`pipelines`,component:Wl}),K_=Or({getParentRoute:()=>M_,path:`evals`,component:Ll}),q_=Or({getParentRoute:()=>M_,path:`knowledge`,component:K}),J_=Or({getParentRoute:()=>M_,path:`knowledge/$tab`,component:K}),Y_=Or({getParentRoute:()=>M_,path:`memory`,component:J}),X_=Or({getParentRoute:()=>M_,path:`status`,component:k_}),Z_=Kr({routeTree:M_.addChildren([N_,P_,F_,I_,L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_,X_])});function Q_(){let[e,t]=(0,C.useState)(),[n,r]=(0,C.useState)(``),i=ds(),{messages:a,setMessages:o}=i,[c,l]=(0,C.useState)([]),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)([]),[m,h]=(0,C.useState)(`playground`),{theme:g,toggleTheme:_}=bi(),[v,y]=(0,C.useState)(Is),[b,x]=(0,C.useState)(),[S,w]=(0,C.useState)(`Loading`),[,T]=(0,C.useState)(``),[E,D]=(0,C.useState)(`idle`),[O,k]=(0,C.useState)(0),A=(0,C.useRef)(null),j=(0,C.useRef)(null),M=(0,C.useRef)(null),N=(0,C.useRef)(!0);function ee(){let e=M.current;e!==null&&(N.current=e.scrollHeight-e.scrollTop-e.clientHeight<80)}(0,C.useEffect)(()=>{if(m!==`playground`||a.length===0||!N.current)return;let e=window.requestAnimationFrame(()=>{let e=M.current;e!==null&&(e.scrollTop=e.scrollHeight)});return()=>window.cancelAnimationFrame(e)},[m,a]),(0,C.useEffect)(()=>{if(m!==`playground`||typeof ResizeObserver>`u`)return;let e=M.current;if(e===null)return;let t=e.querySelector(`[data-studio-transcript-content]`);if(t===null)return;let n=new ResizeObserver(()=>{N.current&&(e.scrollTop=e.scrollHeight)});return n.observe(t),()=>n.disconnect()},[m]);let te=(0,C.useCallback)(async()=>{w(`Loading`),T(``);try{let e=await fetch(`/config`);if(e.status===401){w(`Authentication required`);return}if(!e.ok)throw Error(`Config failed with HTTP ${e.status}`);let n=await e.json();t(n),r(e=>e||n.agents[0]?.id||``),w(`Connected`)}catch(e){T(s(e)),w(`Config error`)}},[]);(0,C.useEffect)(()=>{te()},[te]);let P=e?.capabilities.sessions?.enabled===!0,F=e?.capabilities.traces?.enabled===!0,ne=e?.capabilities.knowledge?.enabled===!0,re=e?.capabilities.mcps?.enabled===!0,ie=e?.capabilities.tools?.enabled===!0,ae=e?.capabilities.sandboxes?.enabled===!0,I=e?.capabilities.pipelines?.enabled===!0,L=e?.capabilities.evals?.enabled===!0,oe=e?.capabilities.memory?.enabled===!0,se=e?.capabilities.status?.enabled===!0,R=e?.agents??[],ce=e?.pipelines??[],le=e?.evals??[],ue=R.length>0,de=(0,C.useCallback)(()=>{h(`tracing`)},[]),fe=(0,C.useCallback)(e=>{if(e===void 0){Z_.navigate({to:`/playground`});return}Z_.navigate({to:`/playground/$sessionId`,params:{sessionId:e}})},[]),pe=(0,C.useCallback)(()=>{Z_.navigate({to:`/tracing`})},[]),me=Rs({activePage:m,enabled:F,initialTraceId:``,initialTraceSessionId:void 0,onError:T,onNavigateTracing:de,onOpenTrace:(0,C.useCallback)(e=>{Z_.navigate({to:`/tracing/$traceId`,params:{traceId:e}})},[]),onOpenTraceIndex:pe,onOpenTraceSession:(0,C.useCallback)(e=>{Z_.navigate({to:`/tracing/sessions/$sessionId`,params:{sessionId:e}})},[])}),he=(0,C.useMemo)(()=>({hasAgents:ue,sessionsEnabled:P,tracesEnabled:F,toolsEnabled:ie,sandboxesEnabled:ae,mcpsEnabled:re,pipelinesEnabled:I,evalsEnabled:L,memoryEnabled:oe,statusEnabled:se,knowledgeEnabled:ne}),[ue,P,F,ie,ae,re,I,L,oe,se,ne]),ge=R.find(e=>e.id===n)??R[0]??void 0,_e=ge?.id,ve=ge?.quickPrompts??[],{selectedAgentModels:ye,selectedModelRef:be,setSelectedModelRef:xe}=xi({enabled:e?.models!==void 0,selectedAgentId:_e,onError:T}),Se=a.length>0,Ce=(0,C.useCallback)((e,t,n)=>{k(e=>e+1),qo($o(e.transcript)),r(e.agentId),xe(ri(e)),l(t),o(ni(e.transcript,t)),p([]),n.updatePath!==!1&&(h(`playground`),fe(e.id))},[fe,o,xe]),we=(0,C.useCallback)((e,t)=>{me.removeSessionTraces(e),t&&(Jo(),k(e=>e+1),o([]),l([]),d(``),p([]),m===`playground`&&fe(void 0))},[m,fe,o,me]),Te=ks({activePage:m,currentAgentId:ge?.id??n,enabled:P,loadSessionTraceSummaries:me.loadSessionTraceSummaries,runState:E,selectedModelRef:be,onError:T,onSessionCreated:fe,onSessionDeleted:we,onSessionLoaded:Ce,onStatus:w}),{answeringQuestions:Ee,decidingApprovals:De,isStreaming:Oe,workingStartedAt:ke,answerToolQuestion:Ae,decideToolApproval:je,runPrompt:Me,stopPrompt:Ne}=as({attachments:f,messages:a,promptRef:A,runState:E,selectedAgent:ge,selectedAgentId:n,selectedModelRef:be,sessions:Te,sessionsEnabled:P,traces:me,transcript:i,onActivePageChange:h,onAttachmentsChange:p,onBeforeRun:()=>{N.current=!0},onError:T,onPromptChange:d,onRunStateChange:D,onSessionTraceSummariesChange:l,onStatus:w}),Pe=(0,C.useCallback)((e={})=>{E!==`running`&&(Jo(),k(e=>e+1),Te.clearSelectedSession(),o([]),l([]),d(``),p([]),h(`playground`),T(``),e.updatePath!==!1&&fe(void 0),requestAnimationFrame(()=>Zo(A.current)))},[fe,E,Te,o]),Fe=(0,C.useCallback)(e=>{E===`running`||e===n||(r(e),xe(``),Jo(),k(e=>e+1),Te.clearSelectedSession(),o([]),l([]),d(``),p([]),h(`playground`),T(``),fe(void 0),requestAnimationFrame(()=>Zo(A.current)))},[fe,E,n,Te,o,xe]);function Ie(e){d(Xo(e)),Zo(e.currentTarget)}async function Le(e){let t=Array.from(e.currentTarget.files??[]);if(e.currentTarget.value=``,t.length!==0)try{let e=await Promise.all(t.map(oi));p(t=>[...t,...e])}catch(e){T(s(e))}}function Re(e){p(t=>t.filter(t=>t.id!==e))}function ze(e){e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),Me(u))}let Be=(0,C.useCallback)(e=>As(e,he),[he]),Ve=(0,C.useCallback)(e=>{if(As(e,he)){if(h(e),e===`tracing`){me.clearTraceSelection(),Z_.navigate({to:`/tracing`});return}if(e===`knowledge`){me.clearTraceSelection(),Z_.navigate({to:`/knowledge/$tab`,params:{tab:v}});return}if(me.clearTraceSelection(),e===`playground`&&Te.selectedSessionId.length>0){fe(Te.selectedSessionId);return}Z_.navigate({to:`/${e}`})}},[v,fe,he,Te.selectedSessionId,me]),He=(0,C.useCallback)(e=>{Ve(js(e,he))},[Ve,he]);function Ue(e){h(`knowledge`),y(e),me.clearTraceSelection(),Z_.navigate({to:`/knowledge/$tab`,params:{tab:e}})}let We={activePage:m,agents:R,answeringQuestions:Ee,attachments:f,decidingApprovals:De,deleteCandidate:b,evals:le,evalsEnabled:L,hasAgents:ue,hasMessages:Se,isStreaming:Oe,workingStartedAt:ke,knowledgeEnabled:ne,knowledgeTab:v,mcpsEnabled:re,memoryEnabled:oe,messages:a,pageEnabled:Be,pipelines:ce,pipelinesEnabled:I,prompt:u,runState:E,sandboxesEnabled:ae,selectedAgent:ge,selectedAgentId:n,selectedAgentModels:ye,selectedAgentQuickPrompts:ve,selectedModelRef:be,sessionTraceSummaries:c,sessions:Te,sessionsEnabled:P,status:S,statusEnabled:se,theme:g,toolsEnabled:ie,traces:me,tracesEnabled:F,attachmentInputRef:j,promptRef:A,transcriptScrollerRef:M,transcriptResetKey:O,activateRoute:(0,C.useCallback)(e=>{if(!As(e,he)){He(e);return}h(e),e!==`tracing`&&me.clearTraceSelection()},[He,he,me]),navigateFallback:He,navigatePage:Ve,navigateKnowledgeTab:Ue,setDeleteCandidate:x,setError:T,setKnowledgeTab:y,setSelectedModelRef:xe,setStatus:w,startNewChat:Pe,selectPlaygroundAgent:Fe,addPromptAttachments:Le,decideToolApproval:je,updatePrompt:Ie,handlePromptKeyDown:ze,answerToolQuestion:Ae,removePromptAttachment:Re,runPrompt:Me,stopPrompt:Ne,toggleTheme:_,updateTranscriptStickiness:ee};return(0,z.jsx)(zs.Provider,{value:We,children:(0,z.jsx)(Yr,{router:Z_})})}var $_=document.getElementById(`anvia-ui`);$_!==null&&(0,S.createRoot)($_).render((0,z.jsx)(Q_,{}));export{Ec as $,Yl as A,rc as B,zu as C,wu as D,Du as E,Tl as F,pc as G,oc as H,_l as I,vc as J,mc as K,ml as L,xl as M,wl as N,ou as O,Cl as P,wc as Q,$c as R,Xu as S,ju as T,sc as U,ac as V,cc as W,bc as X,yc as Y,Cc as Z,om as _,e_ as a,Lc as at,hd as b,a_ as c,ns as ct,$g as d,b as dt,Dc as et,Zg as f,bm as g,Lm as h,n_ as i,Ic as it,vl as j,$l as k,Yg as l,Ho as lt,Kh as m,o_ as n,Nc as nt,i_ as o,zc as ot,Xg as p,gc as q,r_ as r,Pc as rt,t_ as s,Gc as st,y_ as t,kc as tt,Qg as u,$n as ut,nm as v,Bu as w,rd as x,Q as y,Xc as z};
|
|
56
|
+
//# sourceMappingURL=index-DuJGKHsF.js.map
|