@railtownai/railtracks-visualizer 0.0.25 → 0.0.26

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/cjs/index.js CHANGED
@@ -12,7 +12,7 @@ const Pl=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperC
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
14
  */
15
- var $l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Al=e.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:s,...l},c)=>e.createElement("svg",{ref:c,...$l,width:n,height:n,stroke:t,strokeWidth:r?24*Number(o)/Number(n):o,className:Rl("lucide",i),...!a&&!Ol(l)&&{"aria-hidden":"true"},...l},[...s.map(([t,n])=>e.createElement(t,n)),...Array.isArray(a)?a:[a]])),Tl=(t,n)=>{const o=e.forwardRef(({className:o,...r},i)=>{return e.createElement(Al,{ref:i,iconNode:n,className:Rl(`lucide-${a=Pl(t),a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${t}`,o),...r});var a});return o.displayName=Pl(t),o},Dl=Tl("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),zl=Tl("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Il=Tl("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Ll=Tl("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),jl=Tl("cloud-lightning",[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]]),Bl=Tl("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Fl=Tl("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),Hl=Tl("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Vl=Tl("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Wl=Tl("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Yl=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),Xl="-ms-",Zl="-moz-",Kl="-webkit-",ql="comm",Ul="rule",Gl="decl",Ql="@keyframes",Jl=Math.abs,ec=String.fromCharCode,tc=Object.assign;function nc(e){return e.trim()}function oc(e,t,n){return e.replace(t,n)}function rc(e,t){return e.indexOf(t)}function ic(e,t){return 0|e.charCodeAt(t)}function ac(e,t,n){return e.slice(t,n)}function sc(e){return e.length}function lc(e){return e.length}function cc(e,t){return t.push(e),e}var uc=1,dc=1,fc=0,pc=0,hc=0,mc="";function gc(e,t,n,o,r,i,a){return{value:e,root:t,parent:n,type:o,props:r,children:i,line:uc,column:dc,length:a,return:""}}function yc(e,t){return tc(gc("",null,null,"",null,null,0),e,{length:-e.length},t)}function vc(){return hc=pc>0?ic(mc,--pc):0,dc--,10===hc&&(dc=1,uc--),hc}function bc(){return hc=pc<fc?ic(mc,pc++):0,dc++,10===hc&&(dc=1,uc++),hc}function xc(){return ic(mc,pc)}function wc(){return pc}function Ec(e,t){return ac(mc,e,t)}function kc(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Sc(e){return uc=dc=1,fc=sc(mc=e),pc=0,[]}function Cc(e){return mc="",e}function _c(e){return nc(Ec(pc-1,Pc(91===e?e+2:40===e?e+1:e)))}function Nc(e){for(;(hc=xc())&&hc<33;)bc();return kc(e)>2||kc(hc)>3?"":" "}function Mc(e,t){for(;--t&&bc()&&!(hc<48||hc>102||hc>57&&hc<65||hc>70&&hc<97););return Ec(e,wc()+(t<6&&32==xc()&&32==bc()))}function Pc(e){for(;bc();)switch(hc){case e:return pc;case 34:case 39:34!==e&&39!==e&&Pc(hc);break;case 40:41===e&&Pc(e);break;case 92:bc()}return pc}function Rc(e,t){for(;bc()&&e+hc!==57&&(e+hc!==84||47!==xc()););return"/*"+Ec(t,pc-1)+"*"+ec(47===e?e:bc())}function Oc(e){for(;!kc(xc());)bc();return Ec(e,pc)}function $c(e){return Cc(Ac("",null,null,null,[""],e=Sc(e),0,[0],e))}function Ac(e,t,n,o,r,i,a,s,l){for(var c=0,u=0,d=a,f=0,p=0,h=0,m=1,g=1,y=1,v=0,b="",x=r,w=i,E=o,k=b;g;)switch(h=v,v=bc()){case 40:if(108!=h&&58==ic(k,d-1)){-1!=rc(k+=oc(_c(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:k+=_c(v);break;case 9:case 10:case 13:case 32:k+=Nc(h);break;case 92:k+=Mc(wc()-1,7);continue;case 47:switch(xc()){case 42:case 47:cc(Dc(Rc(bc(),wc()),t,n),l);break;default:k+="/"}break;case 123*m:s[c++]=sc(k)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(k=oc(k,/\f/g,"")),p>0&&sc(k)-d&&cc(p>32?zc(k+";",o,n,d-1):zc(oc(k," ","")+";",o,n,d-2),l);break;case 59:k+=";";default:if(cc(E=Tc(k,t,n,c,u,r,s,b,x=[],w=[],d),i),123===v)if(0===u)Ac(k,t,E,E,x,i,d,s,w);else switch(99===f&&110===ic(k,3)?100:f){case 100:case 108:case 109:case 115:Ac(e,E,E,o&&cc(Tc(e,E,E,0,0,r,s,b,r,x=[],d),w),r,w,d,s,o?x:w);break;default:Ac(k,E,E,E,[""],w,0,s,w)}}c=u=p=0,m=y=1,b=k="",d=a;break;case 58:d=1+sc(k),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==vc())continue;switch(k+=ec(v),v*m){case 38:y=u>0?1:(k+="\f",-1);break;case 44:s[c++]=(sc(k)-1)*y,y=1;break;case 64:45===xc()&&(k+=_c(bc())),f=xc(),u=d=sc(b=k+=Oc(wc())),v++;break;case 45:45===h&&2==sc(k)&&(m=0)}}return i}function Tc(e,t,n,o,r,i,a,s,l,c,u){for(var d=r-1,f=0===r?i:[""],p=lc(f),h=0,m=0,g=0;h<o;++h)for(var y=0,v=ac(e,d+1,d=Jl(m=a[h])),b=e;y<p;++y)(b=nc(m>0?f[y]+" "+v:oc(v,/&\f/g,f[y])))&&(l[g++]=b);return gc(e,t,n,0===r?Ul:s,l,c,u)}function Dc(e,t,n){return gc(e,t,n,ql,ec(hc),ac(e,2,-2),0)}function zc(e,t,n,o){return gc(e,t,n,Gl,ac(e,0,o),ac(e,o+1,-1),o)}function Ic(e,t){for(var n="",o=lc(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function Lc(e,t,n,o){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Gl:return e.return=e.return||e.value;case ql:return"";case Ql:return e.return=e.value+"{"+Ic(e.children,o)+"}";case Ul:e.value=e.props.join(",")}return sc(n=Ic(e.children,o))?e.return=e.value+"{"+n+"}":""}var jc=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var o=e(n);return t.set(n,o),o}};function Bc(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Fc=function(e,t,n){for(var o=0,r=0;o=r,r=xc(),38===o&&12===r&&(t[n]=1),!kc(r);)bc();return Ec(e,pc)},Hc=function(e,t){return Cc(function(e,t){var n=-1,o=44;do{switch(kc(o)){case 0:38===o&&12===xc()&&(t[n]=1),e[n]+=Fc(pc-1,t,n);break;case 2:e[n]+=_c(o);break;case 4:if(44===o){e[++n]=58===xc()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=ec(o)}}while(o=bc());return e}(Sc(e),t))},Vc=new WeakMap,Wc=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Vc.get(n))&&!o){Vc.set(e,!0);for(var r=[],i=Hc(t,r),a=n.props,s=0,l=0;s<i.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=r[s]?i[s].replace(/&\f/g,a[c]):a[c]+" "+i[s]}}},Yc=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Xc(e,t){switch(function(e,t){return 45^ic(e,0)?(((t<<2^ic(e,0))<<2^ic(e,1))<<2^ic(e,2))<<2^ic(e,3):0}(e,t)){case 5103:return Kl+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Kl+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Kl+e+Zl+e+Xl+e+e;case 6828:case 4268:return Kl+e+Xl+e+e;case 6165:return Kl+e+Xl+"flex-"+e+e;case 5187:return Kl+e+oc(e,/(\w+).+(:[^]+)/,Kl+"box-$1$2"+Xl+"flex-$1$2")+e;case 5443:return Kl+e+Xl+"flex-item-"+oc(e,/flex-|-self/,"")+e;case 4675:return Kl+e+Xl+"flex-line-pack"+oc(e,/align-content|flex-|-self/,"")+e;case 5548:return Kl+e+Xl+oc(e,"shrink","negative")+e;case 5292:return Kl+e+Xl+oc(e,"basis","preferred-size")+e;case 6060:return Kl+"box-"+oc(e,"-grow","")+Kl+e+Xl+oc(e,"grow","positive")+e;case 4554:return Kl+oc(e,/([^-])(transform)/g,"$1"+Kl+"$2")+e;case 6187:return oc(oc(oc(e,/(zoom-|grab)/,Kl+"$1"),/(image-set)/,Kl+"$1"),e,"")+e;case 5495:case 3959:return oc(e,/(image-set\([^]*)/,Kl+"$1$`$1");case 4968:return oc(oc(e,/(.+:)(flex-)?(.*)/,Kl+"box-pack:$3"+Xl+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Kl+e+e;case 4095:case 3583:case 4068:case 2532:return oc(e,/(.+)-inline(.+)/,Kl+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(sc(e)-1-t>6)switch(ic(e,t+1)){case 109:if(45!==ic(e,t+4))break;case 102:return oc(e,/(.+:)(.+)-([^]+)/,"$1"+Kl+"$2-$3$1"+Zl+(108==ic(e,t+3)?"$3":"$2-$3"))+e;case 115:return~rc(e,"stretch")?Xc(oc(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==ic(e,t+1))break;case 6444:switch(ic(e,sc(e)-3-(~rc(e,"!important")&&10))){case 107:return oc(e,":",":"+Kl)+e;case 101:return oc(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Kl+(45===ic(e,14)?"inline-":"")+"box$3$1"+Kl+"$2$3$1"+Xl+"$2box$3")+e}break;case 5936:switch(ic(e,t+11)){case 114:return Kl+e+Xl+oc(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Kl+e+Xl+oc(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Kl+e+Xl+oc(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Kl+e+Xl+e+e}return e}var Zc=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case Gl:e.return=Xc(e.value,e.length);break;case Ql:return Ic([yc(e,{value:oc(e.value,"@","@"+Kl)})],o);case Ul:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ic([yc(e,{props:[oc(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return Ic([yc(e,{props:[oc(t,/:(plac\w+)/,":"+Kl+"input-$1")]}),yc(e,{props:[oc(t,/:(plac\w+)/,":-moz-$1")]}),yc(e,{props:[oc(t,/:(plac\w+)/,Xl+"input-$1")]})],o)}return""})}}],Kc=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var o,r,i=e.stylisPlugins||Zc,a={},s=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;s.push(e)});var l,c,u=[Lc,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=lc(e);return function(n,o,r,i){for(var a="",s=0;s<t;s++)a+=e[s](n,o,r,i)||"";return a}}([Wc,Yc].concat(i,u));r=function(e,t,n,o){l=n,Ic($c(e?e+"{"+t.styles+"}":t.styles),d),o&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Yl({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:r};return f.sheet.hydrate(s),f};function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},qc.apply(null,arguments)}var Uc=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)};var Gc={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Qc=/[A-Z]|^ms/g,Jc=/_EMO_([^_]+?)_([^]*?)_EMO_/g,eu=function(e){return 45===e.charCodeAt(1)},tu=function(e){return null!=e&&"boolean"!=typeof e},nu=Bc(function(e){return eu(e)?e:e.replace(Qc,"-$&").toLowerCase()}),ou=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Jc,function(e,t,n){return iu={name:t,styles:n,next:iu},t})}return 1===Gc[e]||eu(e)||"number"!=typeof t||0===t?t:t+"px"};function ru(e,t,n){if(null==n)return"";var o=n;if(void 0!==o.__emotion_styles)return o;switch(typeof n){case"boolean":return"";case"object":var r=n;if(1===r.anim)return iu={name:r.name,styles:r.styles,next:iu},r.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)iu={name:a.name,styles:a.styles,next:iu},a=a.next;return i.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=ru(e,t,n[r])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?o+=i+"{"+t[s]+"}":tu(s)&&(o+=nu(i)+":"+ou(i,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=ru(e,t,a);switch(i){case"animation":case"animationName":o+=nu(i)+":"+l+";";break;default:o+=i+"{"+l+"}"}}else for(var c=0;c<a.length;c++)tu(a[c])&&(o+=nu(i)+":"+ou(i,a[c])+";")}return o}(e,t,n);case"function":if(void 0!==e){var s=iu,l=n(e);return iu=s,ru(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var iu,au=/label:\s*([^\s;{]+)\s*(;|$)/g;var su=!!i.useInsertionEffect&&i.useInsertionEffect||function(e){return e()},lu=i.createContext("undefined"!=typeof HTMLElement?Kc({key:"css"}):null);lu.Provider;var cu=i.createContext({}),uu=jc(function(e){return jc(function(t){return function(e,t){return"function"==typeof t?t(e):qc({},e,t)}(e,t)})}),du=function(e){var t=i.useContext(cu);return e.theme!==t&&(t=uu(t)(e.theme)),i.createElement(cu.Provider,{value:t},e.children)};const fu={colors:{background:"hsl(0 0% 100%)",foreground:"hsl(222.2 84% 4.9%)",card:"hsl(0 0% 100%)",cardForeground:"hsl(222.2 84% 4.9%)",popover:"hsl(0 0% 100%)",popoverForeground:"hsl(222.2 84% 4.9%)",primary:"hsl(221.2 83.2% 53.3%)",primaryForeground:"hsl(210 40% 98%)",secondary:"hsl(210 40% 96%)",secondaryForeground:"hsl(222.2 84% 4.9%)",muted:"hsl(210 40% 96%)",mutedForeground:"hsl(215.4 16.3% 46.9%)",accent:"hsl(210 40% 96%)",accentForeground:"hsl(222.2 84% 4.9%)",destructive:"hsl(0 84.2% 60.2%)",destructiveForeground:"hsl(210 40% 98%)",success:"hsl(142.1 76.2% 36.3%)",successForeground:"hsl(210 40% 98%)",border:"hsl(214.3 31.8% 91.4%)",mutedBorder:"hsl(214.3 31.8% 91.4%)",input:"hsl(214.3 31.8% 91.4%)",ring:"hsl(221.2 83.2% 53.3%)"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{sm:"calc(var(--radius) - 4px)",md:"calc(var(--radius) - 2px)",lg:"var(--radius)",xl:"0.75rem"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"},transitions:{fast:"0.15s ease-in-out",normal:"0.2s ease-in-out",slow:"0.3s ease-in-out"}},pu={colors:{background:"hsl(222.2 84% 4.9%)",foreground:"hsl(210 40% 98%)",card:"hsl(222.2 84% 4.9%)",cardForeground:"hsl(210 40% 98%)",popover:"hsl(222.2 84% 4.9%)",popoverForeground:"hsl(210 40% 98%)",primary:"hsl(217.2 91.2% 59.8%)",primaryForeground:"hsl(222.2 84% 4.9%)",secondary:"hsl(217.2 32.6% 17.5%)",secondaryForeground:"hsl(210 40% 98%)",muted:"hsl(217.2 32.6% 17.5%)",mutedForeground:"hsl(215 20.2% 65.1%)",accent:"hsl(217.2 32.6% 17.5%)",accentForeground:"hsl(210 40% 98%)",destructive:"hsl(0 62.8% 30.6%)",destructiveForeground:"hsl(210 40% 98%)",success:"hsl(142.1 76.2% 36.3%)",successForeground:"hsl(210 40% 98%)",border:"hsl(217.2 32.6% 17.5%)",mutedBorder:"hsl(217.2 32.6% 5%)",input:"hsl(217.2 32.6% 17.5%)",ring:"hsl(224.3 76.3% 94.1%)"},spacing:fu.spacing,borderRadius:fu.borderRadius,fontSize:fu.fontSize,fontWeight:fu.fontWeight,shadows:fu.shadows,transitions:fu.transitions},hu=fu,mu=e.createContext(void 0),gu=()=>{const t=e.useContext(mu);return void 0===t?{theme:fu,setTheme:()=>{console.warn("Theme context not available. setTheme called but ignored.")},isDarkMode:!1}:t},yu=({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:a,targetPosition:s,style:l={},markerEnd:c,bidirectional:u=!1,data:d,clientToSvgCoords:f,svgRef:p})=>{e.useState(!1);const{theme:h}=gu(),m=h.colors,[g,y,v]=e.useMemo(()=>gr({sourceX:n,sourceY:o,targetX:r,targetY:i}),[n,o,r,i]),b={...l,stroke:(()=>{const e=d?.details?.state,t=d?.details?.status,n=d?.details?.output;return"Error"===e||"Error"===t||"string"==typeof n&&n.includes("ERROR:")?m.destructive:m.mutedForeground})(),strokeWidth:l.strokeWidth||2};return e.createElement(e.Fragment,null,e.createElement(fs,{path:g,style:b}))};var vu=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,bu=Bc(function(e){return vu.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),xu=function(e){return"theme"!==e},wu=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?bu:xu},Eu=function(e,t,n){var o;if(t){var r=t.shouldForwardProp;o=e.__emotion_forwardProp&&r?function(t){return e.__emotion_forwardProp(t)&&r(t)}:r}return"function"!=typeof o&&n&&(o=e.__emotion_forwardProp),o},ku=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return Uc(t,n,o),su(function(){return function(e,t,n){Uc(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)}),null},Su=function t(n,o){var r,a,s=n.__emotion_real===n,l=s&&n.__emotion_base||n;void 0!==o&&(r=o.label,a=o.target);var c=Eu(n,o,s),u=c||wu(l),d=!u("as");return function(){var f=arguments,p=s&&void 0!==n.__emotion_styles?n.__emotion_styles.slice(0):[];if(void 0!==r&&p.push("label:"+r+";"),null==f[0]||void 0===f[0].raw)p.push.apply(p,f);else{var h=f[0];p.push(h[0]);for(var m=f.length,g=1;g<m;g++)p.push(f[g],h[g])}var y,v=(y=function(e,t,n){var o,r,s,f,h=d&&e.as||l,m="",g=[],y=e;if(null==e.theme){for(var v in y={},e)y[v]=e[v];y.theme=i.useContext(cu)}"string"==typeof e.className?(o=t.registered,r=g,s=e.className,f="",s.split(" ").forEach(function(e){void 0!==o[e]?r.push(o[e]+";"):e&&(f+=e+" ")}),m=f):null!=e.className&&(m=e.className+" ");var b=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,r="";iu=void 0;var i=e[0];null==i||void 0===i.raw?(o=!1,r+=ru(n,t,i)):r+=i[0];for(var a=1;a<e.length;a++)r+=ru(n,t,e[a]),o&&(r+=i[a]);au.lastIndex=0;for(var s,l="";null!==(s=au.exec(r));)l+="-"+s[1];var c=function(e){for(var t,n=0,o=0,r=e.length;r>=4;++o,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:iu}}(p.concat(g),t.registered,y);m+=t.key+"-"+b.name,void 0!==a&&(m+=" "+a);var x=d&&void 0===c?wu(h):u,w={};for(var E in e)d&&"as"===E||x(E)&&(w[E]=e[E]);return w.className=m,n&&(w.ref=n),i.createElement(i.Fragment,null,i.createElement(ku,{cache:t,serialized:b,isStringTag:"string"==typeof h}),i.createElement(h,w))},e.forwardRef(function(t,n){var o=e.useContext(lu);return y(t,o,n)}));return v.displayName=void 0!==r?r:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",v.defaultProps=n.defaultProps,v.__emotion_real=v,v.__emotion_base=l,v.__emotion_styles=p,v.__emotion_forwardProp=c,Object.defineProperty(v,"toString",{value:function(){return"."+a}}),v.withComponent=function(e,n){return t(e,qc({},o,n,{shouldForwardProp:Eu(v,n,!0)})).apply(void 0,p)},v}}.bind(null);function Cu(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Cu(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function _u(e){return e.split(/[-_\s]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function Nu(e){if(null==e)return"$0.00";if(Math.abs(e)<.01&&0!==e){const t=e.toString().split(".")[1]?.length||0,n=Math.max(3,Math.min(t,2));return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:Math.min(3,n),maximumFractionDigits:n}).format(e)}const t=e.toString().split(".")[1]?.length||0,n=Math.max(2,Math.min(t,2));return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:n}).format(e)}function Mu(e){if(e<1)return`${Math.round(1e3*e)}ms`;if(e<60)return`${e.toFixed(1)}s`;return`${Math.floor(e/60)}m ${Math.round(e%60/1e3)}s`}function Pu(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}function Ru(e,t,n="#000000"){return e?.colors?.[t]?e.colors[t]:(console.warn(`Theme color '${t}' not found, using fallback: ${n}`),n)}function Ou(e,t,n="1rem"){return e?.spacing?.[t]?e.spacing[t]:(console.warn(`Theme spacing '${t}' not found, using fallback: ${n}`),n)}function $u(e){return e||(console.warn("Theme is undefined, using default light theme"),{colors:{background:"hsl(0 0% 100%)",foreground:"hsl(222.2 84% 4.9%)",card:"hsl(0 0% 100%)",cardForeground:"hsl(222.2 84% 4.9%)",popover:"hsl(0 0% 100%)",popoverForeground:"hsl(222.2 84% 4.9%)",primary:"hsl(221.2 83.2% 53.3%)",primaryForeground:"hsl(210 40% 98%)",secondary:"hsl(210 40% 96%)",secondaryForeground:"hsl(222.2 84% 4.9%)",muted:"hsl(210 40% 96%)",mutedForeground:"hsl(215.4 16.3% 46.9%)",accent:"hsl(210 40% 96%)",accentForeground:"hsl(222.2 84% 4.9%)",destructive:"hsl(0 84.2% 60.2%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(214.3 31.8% 91.4%)",mutedBorder:"hsl(214.3 31.8% 91.4%)",input:"hsl(214.3 31.8% 91.4%)",ring:"hsl(221.2 83.2% 53.3%)"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"}})}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){Su[e]=Su(e)});const Au=e=>{const{content:t}=e;if("string"==typeof t)return"string";if(!t||"object"!=typeof t)return"other";if(Array.isArray(t)&&t.length>0){const e=t[0];if(e?.identifier&&e?.name&&e?.arguments)return"toolCallList"}return t.identifier&&t.name&&void 0!==t.result?"toolResponse":"other"},Tu=e=>e.map(e=>{const t=Object.entries(e.arguments).map(([e,t])=>`${e}: ${JSON.stringify(t)}`).join(", ");return`${e.name}(${t})`}).join("\n"),Du=Su.div`
15
+ var $l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Al=e.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:s,...l},c)=>e.createElement("svg",{ref:c,...$l,width:n,height:n,stroke:t,strokeWidth:r?24*Number(o)/Number(n):o,className:Rl("lucide",i),...!a&&!Ol(l)&&{"aria-hidden":"true"},...l},[...s.map(([t,n])=>e.createElement(t,n)),...Array.isArray(a)?a:[a]])),Tl=(t,n)=>{const o=e.forwardRef(({className:o,...r},i)=>{return e.createElement(Al,{ref:i,iconNode:n,className:Rl(`lucide-${a=Pl(t),a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${t}`,o),...r});var a});return o.displayName=Pl(t),o},Dl=Tl("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),zl=Tl("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Il=Tl("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Ll=Tl("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),jl=Tl("cloud-lightning",[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]]),Bl=Tl("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Fl=Tl("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),Hl=Tl("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Vl=Tl("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Wl=Tl("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Yl=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),Xl="-ms-",Zl="-moz-",Kl="-webkit-",ql="comm",Ul="rule",Gl="decl",Ql="@keyframes",Jl=Math.abs,ec=String.fromCharCode,tc=Object.assign;function nc(e){return e.trim()}function oc(e,t,n){return e.replace(t,n)}function rc(e,t){return e.indexOf(t)}function ic(e,t){return 0|e.charCodeAt(t)}function ac(e,t,n){return e.slice(t,n)}function sc(e){return e.length}function lc(e){return e.length}function cc(e,t){return t.push(e),e}var uc=1,dc=1,fc=0,pc=0,hc=0,mc="";function gc(e,t,n,o,r,i,a){return{value:e,root:t,parent:n,type:o,props:r,children:i,line:uc,column:dc,length:a,return:""}}function yc(e,t){return tc(gc("",null,null,"",null,null,0),e,{length:-e.length},t)}function vc(){return hc=pc>0?ic(mc,--pc):0,dc--,10===hc&&(dc=1,uc--),hc}function bc(){return hc=pc<fc?ic(mc,pc++):0,dc++,10===hc&&(dc=1,uc++),hc}function xc(){return ic(mc,pc)}function wc(){return pc}function Ec(e,t){return ac(mc,e,t)}function kc(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Sc(e){return uc=dc=1,fc=sc(mc=e),pc=0,[]}function Cc(e){return mc="",e}function _c(e){return nc(Ec(pc-1,Pc(91===e?e+2:40===e?e+1:e)))}function Nc(e){for(;(hc=xc())&&hc<33;)bc();return kc(e)>2||kc(hc)>3?"":" "}function Mc(e,t){for(;--t&&bc()&&!(hc<48||hc>102||hc>57&&hc<65||hc>70&&hc<97););return Ec(e,wc()+(t<6&&32==xc()&&32==bc()))}function Pc(e){for(;bc();)switch(hc){case e:return pc;case 34:case 39:34!==e&&39!==e&&Pc(hc);break;case 40:41===e&&Pc(e);break;case 92:bc()}return pc}function Rc(e,t){for(;bc()&&e+hc!==57&&(e+hc!==84||47!==xc()););return"/*"+Ec(t,pc-1)+"*"+ec(47===e?e:bc())}function Oc(e){for(;!kc(xc());)bc();return Ec(e,pc)}function $c(e){return Cc(Ac("",null,null,null,[""],e=Sc(e),0,[0],e))}function Ac(e,t,n,o,r,i,a,s,l){for(var c=0,u=0,d=a,f=0,p=0,h=0,m=1,g=1,y=1,v=0,b="",x=r,w=i,E=o,k=b;g;)switch(h=v,v=bc()){case 40:if(108!=h&&58==ic(k,d-1)){-1!=rc(k+=oc(_c(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:k+=_c(v);break;case 9:case 10:case 13:case 32:k+=Nc(h);break;case 92:k+=Mc(wc()-1,7);continue;case 47:switch(xc()){case 42:case 47:cc(Dc(Rc(bc(),wc()),t,n),l);break;default:k+="/"}break;case 123*m:s[c++]=sc(k)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(k=oc(k,/\f/g,"")),p>0&&sc(k)-d&&cc(p>32?zc(k+";",o,n,d-1):zc(oc(k," ","")+";",o,n,d-2),l);break;case 59:k+=";";default:if(cc(E=Tc(k,t,n,c,u,r,s,b,x=[],w=[],d),i),123===v)if(0===u)Ac(k,t,E,E,x,i,d,s,w);else switch(99===f&&110===ic(k,3)?100:f){case 100:case 108:case 109:case 115:Ac(e,E,E,o&&cc(Tc(e,E,E,0,0,r,s,b,r,x=[],d),w),r,w,d,s,o?x:w);break;default:Ac(k,E,E,E,[""],w,0,s,w)}}c=u=p=0,m=y=1,b=k="",d=a;break;case 58:d=1+sc(k),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==vc())continue;switch(k+=ec(v),v*m){case 38:y=u>0?1:(k+="\f",-1);break;case 44:s[c++]=(sc(k)-1)*y,y=1;break;case 64:45===xc()&&(k+=_c(bc())),f=xc(),u=d=sc(b=k+=Oc(wc())),v++;break;case 45:45===h&&2==sc(k)&&(m=0)}}return i}function Tc(e,t,n,o,r,i,a,s,l,c,u){for(var d=r-1,f=0===r?i:[""],p=lc(f),h=0,m=0,g=0;h<o;++h)for(var y=0,v=ac(e,d+1,d=Jl(m=a[h])),b=e;y<p;++y)(b=nc(m>0?f[y]+" "+v:oc(v,/&\f/g,f[y])))&&(l[g++]=b);return gc(e,t,n,0===r?Ul:s,l,c,u)}function Dc(e,t,n){return gc(e,t,n,ql,ec(hc),ac(e,2,-2),0)}function zc(e,t,n,o){return gc(e,t,n,Gl,ac(e,0,o),ac(e,o+1,-1),o)}function Ic(e,t){for(var n="",o=lc(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function Lc(e,t,n,o){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Gl:return e.return=e.return||e.value;case ql:return"";case Ql:return e.return=e.value+"{"+Ic(e.children,o)+"}";case Ul:e.value=e.props.join(",")}return sc(n=Ic(e.children,o))?e.return=e.value+"{"+n+"}":""}var jc=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var o=e(n);return t.set(n,o),o}};function Bc(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Fc=function(e,t,n){for(var o=0,r=0;o=r,r=xc(),38===o&&12===r&&(t[n]=1),!kc(r);)bc();return Ec(e,pc)},Hc=function(e,t){return Cc(function(e,t){var n=-1,o=44;do{switch(kc(o)){case 0:38===o&&12===xc()&&(t[n]=1),e[n]+=Fc(pc-1,t,n);break;case 2:e[n]+=_c(o);break;case 4:if(44===o){e[++n]=58===xc()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=ec(o)}}while(o=bc());return e}(Sc(e),t))},Vc=new WeakMap,Wc=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Vc.get(n))&&!o){Vc.set(e,!0);for(var r=[],i=Hc(t,r),a=n.props,s=0,l=0;s<i.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=r[s]?i[s].replace(/&\f/g,a[c]):a[c]+" "+i[s]}}},Yc=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Xc(e,t){switch(function(e,t){return 45^ic(e,0)?(((t<<2^ic(e,0))<<2^ic(e,1))<<2^ic(e,2))<<2^ic(e,3):0}(e,t)){case 5103:return Kl+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Kl+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Kl+e+Zl+e+Xl+e+e;case 6828:case 4268:return Kl+e+Xl+e+e;case 6165:return Kl+e+Xl+"flex-"+e+e;case 5187:return Kl+e+oc(e,/(\w+).+(:[^]+)/,Kl+"box-$1$2"+Xl+"flex-$1$2")+e;case 5443:return Kl+e+Xl+"flex-item-"+oc(e,/flex-|-self/,"")+e;case 4675:return Kl+e+Xl+"flex-line-pack"+oc(e,/align-content|flex-|-self/,"")+e;case 5548:return Kl+e+Xl+oc(e,"shrink","negative")+e;case 5292:return Kl+e+Xl+oc(e,"basis","preferred-size")+e;case 6060:return Kl+"box-"+oc(e,"-grow","")+Kl+e+Xl+oc(e,"grow","positive")+e;case 4554:return Kl+oc(e,/([^-])(transform)/g,"$1"+Kl+"$2")+e;case 6187:return oc(oc(oc(e,/(zoom-|grab)/,Kl+"$1"),/(image-set)/,Kl+"$1"),e,"")+e;case 5495:case 3959:return oc(e,/(image-set\([^]*)/,Kl+"$1$`$1");case 4968:return oc(oc(e,/(.+:)(flex-)?(.*)/,Kl+"box-pack:$3"+Xl+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Kl+e+e;case 4095:case 3583:case 4068:case 2532:return oc(e,/(.+)-inline(.+)/,Kl+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(sc(e)-1-t>6)switch(ic(e,t+1)){case 109:if(45!==ic(e,t+4))break;case 102:return oc(e,/(.+:)(.+)-([^]+)/,"$1"+Kl+"$2-$3$1"+Zl+(108==ic(e,t+3)?"$3":"$2-$3"))+e;case 115:return~rc(e,"stretch")?Xc(oc(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==ic(e,t+1))break;case 6444:switch(ic(e,sc(e)-3-(~rc(e,"!important")&&10))){case 107:return oc(e,":",":"+Kl)+e;case 101:return oc(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Kl+(45===ic(e,14)?"inline-":"")+"box$3$1"+Kl+"$2$3$1"+Xl+"$2box$3")+e}break;case 5936:switch(ic(e,t+11)){case 114:return Kl+e+Xl+oc(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Kl+e+Xl+oc(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Kl+e+Xl+oc(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Kl+e+Xl+e+e}return e}var Zc=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case Gl:e.return=Xc(e.value,e.length);break;case Ql:return Ic([yc(e,{value:oc(e.value,"@","@"+Kl)})],o);case Ul:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ic([yc(e,{props:[oc(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return Ic([yc(e,{props:[oc(t,/:(plac\w+)/,":"+Kl+"input-$1")]}),yc(e,{props:[oc(t,/:(plac\w+)/,":-moz-$1")]}),yc(e,{props:[oc(t,/:(plac\w+)/,Xl+"input-$1")]})],o)}return""})}}],Kc=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var o,r,i=e.stylisPlugins||Zc,a={},s=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;s.push(e)});var l,c,u=[Lc,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=lc(e);return function(n,o,r,i){for(var a="",s=0;s<t;s++)a+=e[s](n,o,r,i)||"";return a}}([Wc,Yc].concat(i,u));r=function(e,t,n,o){l=n,Ic($c(e?e+"{"+t.styles+"}":t.styles),d),o&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Yl({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:r};return f.sheet.hydrate(s),f};function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},qc.apply(null,arguments)}var Uc=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)};var Gc={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Qc=/[A-Z]|^ms/g,Jc=/_EMO_([^_]+?)_([^]*?)_EMO_/g,eu=function(e){return 45===e.charCodeAt(1)},tu=function(e){return null!=e&&"boolean"!=typeof e},nu=Bc(function(e){return eu(e)?e:e.replace(Qc,"-$&").toLowerCase()}),ou=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Jc,function(e,t,n){return iu={name:t,styles:n,next:iu},t})}return 1===Gc[e]||eu(e)||"number"!=typeof t||0===t?t:t+"px"};function ru(e,t,n){if(null==n)return"";var o=n;if(void 0!==o.__emotion_styles)return o;switch(typeof n){case"boolean":return"";case"object":var r=n;if(1===r.anim)return iu={name:r.name,styles:r.styles,next:iu},r.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)iu={name:a.name,styles:a.styles,next:iu},a=a.next;return i.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=ru(e,t,n[r])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?o+=i+"{"+t[s]+"}":tu(s)&&(o+=nu(i)+":"+ou(i,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=ru(e,t,a);switch(i){case"animation":case"animationName":o+=nu(i)+":"+l+";";break;default:o+=i+"{"+l+"}"}}else for(var c=0;c<a.length;c++)tu(a[c])&&(o+=nu(i)+":"+ou(i,a[c])+";")}return o}(e,t,n);case"function":if(void 0!==e){var s=iu,l=n(e);return iu=s,ru(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var iu,au=/label:\s*([^\s;{]+)\s*(;|$)/g;var su=!!i.useInsertionEffect&&i.useInsertionEffect||function(e){return e()},lu=i.createContext("undefined"!=typeof HTMLElement?Kc({key:"css"}):null);lu.Provider;var cu=i.createContext({}),uu=jc(function(e){return jc(function(t){return function(e,t){return"function"==typeof t?t(e):qc({},e,t)}(e,t)})}),du=function(e){var t=i.useContext(cu);return e.theme!==t&&(t=uu(t)(e.theme)),i.createElement(cu.Provider,{value:t},e.children)};const fu={colors:{background:"hsl(0 0% 100%)",foreground:"hsl(222.2 84% 4.9%)",card:"hsl(0 0% 100%)",cardForeground:"hsl(222.2 84% 4.9%)",popover:"hsl(0 0% 100%)",popoverForeground:"hsl(222.2 84% 4.9%)",primary:"hsl(221.2 83.2% 53.3%)",primaryForeground:"hsl(210 40% 98%)",secondary:"hsl(210 40% 96%)",secondaryForeground:"hsl(222.2 84% 4.9%)",muted:"hsl(210 40% 96%)",mutedForeground:"hsl(215.4 16.3% 46.9%)",accent:"hsl(210 40% 96%)",accentForeground:"hsl(222.2 84% 4.9%)",destructive:"hsl(0 84.2% 60.2%)",destructiveForeground:"hsl(210 40% 98%)",success:"hsl(142.1 76.2% 36.3%)",successForeground:"hsl(210 40% 98%)",border:"hsl(214.3 31.8% 91.4%)",mutedBorder:"hsl(214.3 31.8% 91.4%)",input:"hsl(214.3 31.8% 91.4%)",ring:"hsl(221.2 83.2% 53.3%)"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{sm:"calc(var(--radius) - 4px)",md:"calc(var(--radius) - 2px)",lg:"var(--radius)",xl:"0.75rem"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"},transitions:{fast:"0.15s ease-in-out",normal:"0.2s ease-in-out",slow:"0.3s ease-in-out"}},pu={colors:{background:"hsl(222.2 84% 4.9%)",foreground:"hsl(210 40% 98%)",card:"hsl(222.2 84% 4.9%)",cardForeground:"hsl(210 40% 98%)",popover:"hsl(222.2 84% 4.9%)",popoverForeground:"hsl(210 40% 98%)",primary:"hsl(217.2 91.2% 59.8%)",primaryForeground:"hsl(222.2 84% 4.9%)",secondary:"hsl(217.2 32.6% 17.5%)",secondaryForeground:"hsl(210 40% 98%)",muted:"hsl(217.2 32.6% 17.5%)",mutedForeground:"hsl(215 20.2% 65.1%)",accent:"hsl(217.2 32.6% 17.5%)",accentForeground:"hsl(210 40% 98%)",destructive:"hsl(0 62.8% 30.6%)",destructiveForeground:"hsl(210 40% 98%)",success:"hsl(142.1 76.2% 36.3%)",successForeground:"hsl(210 40% 98%)",border:"hsl(217.2 32.6% 17.5%)",mutedBorder:"hsl(217.2 32.6% 5%)",input:"hsl(217.2 32.6% 17.5%)",ring:"hsl(224.3 76.3% 94.1%)"},spacing:fu.spacing,borderRadius:fu.borderRadius,fontSize:fu.fontSize,fontWeight:fu.fontWeight,shadows:fu.shadows,transitions:fu.transitions},hu=fu,mu=e.createContext(void 0),gu=()=>{const t=e.useContext(mu);return void 0===t?{theme:fu,setTheme:()=>{console.warn("Theme context not available. setTheme called but ignored.")},isDarkMode:!1}:t},yu=({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:a,targetPosition:s,style:l={},markerEnd:c,bidirectional:u=!1,data:d,clientToSvgCoords:f,svgRef:p})=>{e.useState(!1);const{theme:h}=gu(),m=h.colors,[g]=e.useMemo(()=>Cr({sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:a,targetPosition:s}),[n,o,r,i,a,s]),y={...l,stroke:(()=>{const e=d?.details?.state,t=d?.details?.status,n=d?.details?.output;return"Error"===e||"Error"===t||"string"==typeof n&&n.includes("ERROR:")?m.destructive:m.mutedForeground})(),strokeWidth:l.strokeWidth||2};return e.createElement(e.Fragment,null,e.createElement(fs,{path:g,style:y}))};var vu=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,bu=Bc(function(e){return vu.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),xu=function(e){return"theme"!==e},wu=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?bu:xu},Eu=function(e,t,n){var o;if(t){var r=t.shouldForwardProp;o=e.__emotion_forwardProp&&r?function(t){return e.__emotion_forwardProp(t)&&r(t)}:r}return"function"!=typeof o&&n&&(o=e.__emotion_forwardProp),o},ku=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return Uc(t,n,o),su(function(){return function(e,t,n){Uc(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)}),null},Su=function t(n,o){var r,a,s=n.__emotion_real===n,l=s&&n.__emotion_base||n;void 0!==o&&(r=o.label,a=o.target);var c=Eu(n,o,s),u=c||wu(l),d=!u("as");return function(){var f=arguments,p=s&&void 0!==n.__emotion_styles?n.__emotion_styles.slice(0):[];if(void 0!==r&&p.push("label:"+r+";"),null==f[0]||void 0===f[0].raw)p.push.apply(p,f);else{var h=f[0];p.push(h[0]);for(var m=f.length,g=1;g<m;g++)p.push(f[g],h[g])}var y,v=(y=function(e,t,n){var o,r,s,f,h=d&&e.as||l,m="",g=[],y=e;if(null==e.theme){for(var v in y={},e)y[v]=e[v];y.theme=i.useContext(cu)}"string"==typeof e.className?(o=t.registered,r=g,s=e.className,f="",s.split(" ").forEach(function(e){void 0!==o[e]?r.push(o[e]+";"):e&&(f+=e+" ")}),m=f):null!=e.className&&(m=e.className+" ");var b=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,r="";iu=void 0;var i=e[0];null==i||void 0===i.raw?(o=!1,r+=ru(n,t,i)):r+=i[0];for(var a=1;a<e.length;a++)r+=ru(n,t,e[a]),o&&(r+=i[a]);au.lastIndex=0;for(var s,l="";null!==(s=au.exec(r));)l+="-"+s[1];var c=function(e){for(var t,n=0,o=0,r=e.length;r>=4;++o,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:iu}}(p.concat(g),t.registered,y);m+=t.key+"-"+b.name,void 0!==a&&(m+=" "+a);var x=d&&void 0===c?wu(h):u,w={};for(var E in e)d&&"as"===E||x(E)&&(w[E]=e[E]);return w.className=m,n&&(w.ref=n),i.createElement(i.Fragment,null,i.createElement(ku,{cache:t,serialized:b,isStringTag:"string"==typeof h}),i.createElement(h,w))},e.forwardRef(function(t,n){var o=e.useContext(lu);return y(t,o,n)}));return v.displayName=void 0!==r?r:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",v.defaultProps=n.defaultProps,v.__emotion_real=v,v.__emotion_base=l,v.__emotion_styles=p,v.__emotion_forwardProp=c,Object.defineProperty(v,"toString",{value:function(){return"."+a}}),v.withComponent=function(e,n){return t(e,qc({},o,n,{shouldForwardProp:Eu(v,n,!0)})).apply(void 0,p)},v}}.bind(null);function Cu(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Cu(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function _u(e){return e.split(/[-_\s]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function Nu(e){if(null==e)return"$0.00";if(Math.abs(e)<.01&&0!==e){const t=e.toString().split(".")[1]?.length||0,n=Math.max(3,Math.min(t,2));return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:Math.min(3,n),maximumFractionDigits:n}).format(e)}const t=e.toString().split(".")[1]?.length||0,n=Math.max(2,Math.min(t,2));return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:n}).format(e)}function Mu(e){if(e<1)return`${Math.round(1e3*e)}ms`;if(e<60)return`${e.toFixed(1)}s`;return`${Math.floor(e/60)}m ${Math.round(e%60/1e3)}s`}function Pu(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}function Ru(e,t,n="#000000"){return e?.colors?.[t]?e.colors[t]:(console.warn(`Theme color '${t}' not found, using fallback: ${n}`),n)}function Ou(e,t,n="1rem"){return e?.spacing?.[t]?e.spacing[t]:(console.warn(`Theme spacing '${t}' not found, using fallback: ${n}`),n)}function $u(e){return e||(console.warn("Theme is undefined, using default light theme"),{colors:{background:"hsl(0 0% 100%)",foreground:"hsl(222.2 84% 4.9%)",card:"hsl(0 0% 100%)",cardForeground:"hsl(222.2 84% 4.9%)",popover:"hsl(0 0% 100%)",popoverForeground:"hsl(222.2 84% 4.9%)",primary:"hsl(221.2 83.2% 53.3%)",primaryForeground:"hsl(210 40% 98%)",secondary:"hsl(210 40% 96%)",secondaryForeground:"hsl(222.2 84% 4.9%)",muted:"hsl(210 40% 96%)",mutedForeground:"hsl(215.4 16.3% 46.9%)",accent:"hsl(210 40% 96%)",accentForeground:"hsl(222.2 84% 4.9%)",destructive:"hsl(0 84.2% 60.2%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(214.3 31.8% 91.4%)",mutedBorder:"hsl(214.3 31.8% 91.4%)",input:"hsl(214.3 31.8% 91.4%)",ring:"hsl(221.2 83.2% 53.3%)"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"}})}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){Su[e]=Su(e)});const Au=e=>{const{content:t}=e;if("string"==typeof t)return"string";if(!t||"object"!=typeof t)return"other";if(Array.isArray(t)&&t.length>0){const e=t[0];if(e?.identifier&&e?.name&&e?.arguments)return"toolCallList"}return t.identifier&&t.name&&void 0!==t.result?"toolResponse":"other"},Tu=e=>e.map(e=>{const t=Object.entries(e.arguments).map(([e,t])=>`${e}: ${JSON.stringify(t)}`).join(", ");return`${e.name}(${t})`}).join("\n"),Du=Su.div`
16
16
  position: relative;
17
17
  display: inline-block;
18
18
  `,zu=Su.div`
@@ -352,7 +352,7 @@ var $l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
352
352
  border: 1px solid ${e=>e.themeColors.border};
353
353
  `,Pd=Su.span`
354
354
  color: ${e=>e.themeColors.mutedForeground};
355
- `,Rd=(e,t=["input","output"],n=[])=>Object.entries(e).filter(([e])=>!n.includes(e)).sort(([e],[n])=>{const o=t.indexOf(e),r=t.indexOf(n);return-1!==o&&-1!==r?o-r:-1!==o?-1:-1!==r?1:e.localeCompare(n)}),Od=({data:t,label:n,depth:o,maxDepth:r,path:i,priorityKeys:a,excludeKeys:s,expanded:l})=>{const[c,u]=e.useState(l||!1),{theme:d}=gu(),f=d.colors,p=null!==t&&"object"==typeof t&&!Array.isArray(t),h=Array.isArray(t),m=(p||h)&&o<r,g=m&&Object.keys(t).length>0;return e.createElement(md,null,e.createElement(gd,{isExpandable:m,themeColors:f,onClick:e=>{e.stopPropagation(),m&&u(!c)},style:{paddingLeft:12*o+8+"px"}},e.createElement(yd,{themeColors:f},m&&g?c?e.createElement(zl,{size:12}):e.createElement(Il,{size:12}):e.createElement("div",{style:{width:"12px",height:"12px"}})),e.createElement(vd,{themeColors:f},n,":"),!m&&e.createElement(bd,{valueType:(y=t,null===y?"null":void 0===y?"undefined":typeof y),themeColors:f},(e=>null===e?"null":void 0===e?"undefined":"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?e.toString():Array.isArray(e)?`Array(${e.length})`:"object"==typeof e?`Object(${Object.keys(e).length})`:String(e))(t)),m&&!g&&e.createElement(xd,{themeColors:f},h?"[]":"{}"),m&&g&&!c&&e.createElement(xd,{themeColors:f},h?`[${Object.keys(t).length} items]`:`{${Object.keys(t).length} keys}`)),c&&g&&e.createElement(wd,{themeColors:f},Rd(t,a,s).map(([t,n])=>e.createElement(Od,{key:`${i}.${t}`,data:n,label:t,depth:o+1,maxDepth:r,path:`${i}.${t}`,priorityKeys:a,excludeKeys:s,expanded:l}))));var y},$d=({data:t,maxDepth:n=4,initialExpanded:o=!1,expanded:r=!1,className:i="",priorityKeys:a=["input","output"],excludeKeys:s=[]})=>{const{theme:l}=gu(),c=l.colors;return null==t?e.createElement(Sd,{themeColors:c,className:i},"No data available"):"object"!=typeof t?e.createElement(Cd,{themeColors:c,className:i},e.createElement(_d,{themeColors:c},"Value:")," ",e.createElement(Nd,{themeColors:c},String(t))):0===Object.keys(t).length?e.createElement(Md,{themeColors:c,className:i},e.createElement(Pd,{themeColors:c},Array.isArray(t)?"Empty array":"Empty object")):e.createElement(Ed,{themeColors:c,className:i},e.createElement(kd,null,(()=>{const o=Rd(t,a,s);return 0===o.length?e.createElement(Md,{themeColors:c},e.createElement(Pd,{themeColors:c},Array.isArray(t)?"Empty array":"Empty object")):o.map(([t,o])=>e.createElement(Od,{key:t,data:o,label:t,depth:0,maxDepth:n,path:t,priorityKeys:a,excludeKeys:s,expanded:r}))})()))},Ad=({data:t})=>{const[n,o]=e.useState(!1),r=Au(t),i=()=>{o(!n)};switch(console.log(r),r){case"string":return e.createElement(Dd,null,e.createElement(rd,{label:"Output",content:t.content,isExpanded:n,onToggle:i}));case"toolResponse":return e.createElement(Dd,null,e.createElement(Td,null,"Output - Tool Response"),e.createElement($d,{data:t,expanded:!0}));case"toolCallList":const o=Tu(t.content);return e.createElement(e.Fragment,null,e.createElement(Dd,null,e.createElement(Td,null,e.createElement("span",null,"Output - Tool Calls"),e.createElement("span",{style:{display:"flex",alignItems:"center",gap:"0.25rem"}},e.createElement(jl,{size:14}),t.content.length)),e.createElement(ud,{content:o,language:"tool-calls",showHeader:!1})));default:return e.createElement(e.Fragment,null,e.createElement(Dd,null,e.createElement(Td,null,"Output"),e.createElement($d,{data:t,expanded:!0})))}},Td=Su.span`
355
+ `,Rd=(e,t=["input","output"],n=[])=>Object.entries(e).filter(([e])=>!n.includes(e)).sort(([e],[n])=>{const o=t.indexOf(e),r=t.indexOf(n);return-1!==o&&-1!==r?o-r:-1!==o?-1:-1!==r?1:e.localeCompare(n)}),Od=({data:t,label:n,depth:o,maxDepth:r,path:i,priorityKeys:a,excludeKeys:s,expanded:l})=>{const[c,u]=e.useState(l||!1),{theme:d}=gu(),f=d.colors,p=null!==t&&"object"==typeof t&&!Array.isArray(t),h=Array.isArray(t),m=(p||h)&&o<r,g=m&&Object.keys(t).length>0;return e.createElement(md,null,e.createElement(gd,{isExpandable:m,themeColors:f,onClick:e=>{e.stopPropagation(),m&&u(!c)},style:{paddingLeft:12*o+8+"px"}},e.createElement(yd,{themeColors:f},m&&g?c?e.createElement(zl,{size:12}):e.createElement(Il,{size:12}):e.createElement("div",{style:{width:"12px",height:"12px"}})),e.createElement(vd,{themeColors:f},n,":"),!m&&e.createElement(bd,{valueType:(y=t,null===y?"null":void 0===y?"undefined":typeof y),themeColors:f},(e=>null===e?"null":void 0===e?"undefined":"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?e.toString():Array.isArray(e)?`Array(${e.length})`:"object"==typeof e?`Object(${Object.keys(e).length})`:String(e))(t)),m&&!g&&e.createElement(xd,{themeColors:f},h?"[]":"{}"),m&&g&&!c&&e.createElement(xd,{themeColors:f},h?`[${Object.keys(t).length} items]`:`{${Object.keys(t).length} keys}`)),c&&g&&e.createElement(wd,{themeColors:f},Rd(t,a,s).map(([t,n])=>e.createElement(Od,{key:`${i}.${t}`,data:n,label:t,depth:o+1,maxDepth:r,path:`${i}.${t}`,priorityKeys:a,excludeKeys:s,expanded:l}))));var y},$d=({data:t,maxDepth:n=4,initialExpanded:o=!1,expanded:r=!1,className:i="",priorityKeys:a=["input","output"],excludeKeys:s=[]})=>{const{theme:l}=gu(),c=l.colors;return null==t?e.createElement(Sd,{themeColors:c,className:i},"No data available"):"object"!=typeof t?e.createElement(Cd,{themeColors:c,className:i},e.createElement(_d,{themeColors:c},"Value:")," ",e.createElement(Nd,{themeColors:c},String(t))):0===Object.keys(t).length?e.createElement(Md,{themeColors:c,className:i},e.createElement(Pd,{themeColors:c},Array.isArray(t)?"Empty array":"Empty object")):e.createElement(Ed,{themeColors:c,className:i},e.createElement(kd,null,(()=>{const o=Rd(t,a,s);return 0===o.length?e.createElement(Md,{themeColors:c},e.createElement(Pd,{themeColors:c},Array.isArray(t)?"Empty array":"Empty object")):o.map(([t,o])=>e.createElement(Od,{key:t,data:o,label:t,depth:0,maxDepth:n,path:t,priorityKeys:a,excludeKeys:s,expanded:r}))})()))},Ad=({data:t})=>{const[n,o]=e.useState(!1),r=()=>{o(!n)};switch(Au(t)){case"string":return e.createElement(Dd,null,e.createElement(rd,{label:"Output",content:t.content,isExpanded:n,onToggle:r}));case"toolResponse":return e.createElement(Dd,null,e.createElement(Td,null,"Output - Tool Response"),e.createElement($d,{data:t,expanded:!0}));case"toolCallList":const o=Tu(t.content);return e.createElement(e.Fragment,null,e.createElement(Dd,null,e.createElement(Td,null,e.createElement("span",null,"Output - Tool Calls"),e.createElement("span",{style:{display:"flex",alignItems:"center",gap:"0.25rem"}},e.createElement(jl,{size:14}),t.content.length)),e.createElement(ud,{content:o,language:"tool-calls",showHeader:!1})));default:return e.createElement(e.Fragment,null,e.createElement(Dd,null,e.createElement(Td,null,"Output"),e.createElement($d,{data:t,expanded:!0})))}},Td=Su.span`
356
356
  margin: 0;
357
357
  padding: 0;
358
358
  font-size: 0.75rem;
@@ -677,10 +677,11 @@ var $l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
677
677
  opacity: 0.5;
678
678
  }
679
679
  }
680
- `,Xf=({stamps:t,currentStep:n,onStepChange:o,onToggle:r})=>{const{theme:i}=gu(),a=t.length>0?Math.max(...t.map(e=>e.step)):0,s=t.length>0?Math.min(...t.map(e=>e.step)):0,l=a-s+1,c=e=>e<5e3?"latencyLow":e<=3e4?"latencyMedium":"latencyHigh";return e.createElement(Df,{theme:i},e.createElement(zf,{theme:i},e.createElement(If,{theme:i},"Timeline"),r&&e.createElement(Lf,{onClick:r,title:"Collapse Panel",theme:i},e.createElement(Hl,{size:16}))),e.createElement(jf,null,Array.from({length:l},(r,a)=>{const l=s+a,u=l===n,d=l<n,f=t.some(e=>e.step===l),p=(e=>{const n=t.filter(t=>t.step===e);if(0===n.length)return null;const o=e-1,r=t.filter(e=>e.step===o);return 0===r.length?null:Math.min(...n.map(e=>e.time))-Math.max(...r.map(e=>e.time))})(l),h=(e=>{const n=t.filter(t=>t.step===e);return 0===n.length?`Step ${e}`:n[0]?.identifier||`Step ${e}`})(l);return e.createElement(Bf,{key:l,isActive:u,isPast:d,hasStep:f,onClick:()=>f&&o(l),theme:i},e.createElement(Ff,null,e.createElement(Hf,{isActive:u,isPast:d,hasStep:f,theme:i}),e.createElement(Vf,{isActive:u,theme:i},"Step ",l),p&&e.createElement("div",{style:{marginLeft:"auto"}},e.createElement(ju,{variant:c(p)},Mu(p)))),e.createElement(Wf,{hasStep:f,theme:i},f?h:"No activity"),u&&e.createElement(Yf,{theme:i}))})))};function Zf(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}function Kf(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function qf(...e){return t=>{let n=!1;const o=e.map(e=>{const o=Kf(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():Kf(e[t],null)}}}}function Uf(...e){return i.useCallback(qf(...e),e)}function Gf(e,n=[]){let o=[];const r=()=>{const t=o.map(e=>i.createContext(e));return function(n){const o=n?.[e]||t;return i.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return r.scopeName=e,[function(n,r){const a=i.createContext(r),s=o.length;o=[...o,r];const l=n=>{const{scope:o,children:r,...l}=n,c=o?.[e]?.[s]||a,u=i.useMemo(()=>l,Object.values(l));return t.jsx(c.Provider,{value:u,children:r})};return l.displayName=n+"Provider",[l,function(t,o){const l=o?.[e]?.[s]||a,c=i.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},Qf(r,...n)]}function Qf(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]}),{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Jf=globalThis?.document?i.useLayoutEffect:()=>{},ep=i[" useId ".trim().toString()]||(()=>{}),tp=0;function np(e){const[t,n]=i.useState(ep());return Jf(()=>{e||n(e=>e??String(tp++))},[e]),e||(t?`radix-${t}`:"")}var op=i[" useInsertionEffect ".trim().toString()]||Jf;function rp({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,a,s]=function({defaultProp:e,onChange:t}){const[n,o]=i.useState(e),r=i.useRef(n),a=i.useRef(t);return op(()=>{a.current=t},[t]),i.useEffect(()=>{r.current!==n&&(a.current?.(n),r.current=n)},[n,r]),[n,o,a]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:r;{const t=i.useRef(void 0!==e);i.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,o])}const u=i.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[l,e,a,s]);return[c,u]}function ip(e){const n=ap(e),o=i.forwardRef((e,o)=>{const{children:r,...a}=e,s=i.Children.toArray(r),l=s.find(lp);if(l){const e=l.props.children,r=s.map(t=>t===l?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t);return t.jsx(n,{...a,ref:o,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(n,{...a,ref:o,children:r})});return o.displayName=`${e}.Slot`,o}function ap(e){const t=i.forwardRef((e,t)=>{const{children:n,...o}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),r=function(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...e)=>{const t=i(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...i}:"className"===o&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==i.Fragment&&(r.ref=t?qf(t,e):e),i.cloneElement(n,r)}return i.Children.count(n)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sp=Symbol("radix.slottable");function lp(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===sp}var cp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{const o=ip(`Primitive.${n}`),r=i.forwardRef((e,r)=>{const{asChild:i,...a}=e,s=i?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...a,ref:r})});return r.displayName=`Primitive.${n}`,{...e,[n]:r}},{});function up(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...e)=>t.current?.(...e),[])}var dp,fp="dismissableLayer.update",pp="dismissableLayer.pointerDownOutside",hp="dismissableLayer.focusOutside",mp=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gp=i.forwardRef((e,n)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(mp),[f,p]=i.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Uf(n,e=>p(e)),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=f?y.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=x>=b,k=function(e,t=globalThis?.document){const n=up(e),o=i.useRef(!1),r=i.useRef(()=>{});return i.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let o=function(){bp(pp,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",r.current),r.current=o,t.addEventListener("click",r.current,{once:!0})):o()}else t.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...d.branches].some(e=>e.contains(t));E&&!n&&(a?.(e),l?.(e),e.defaultPrevented||c?.())},h),S=function(e,t=globalThis?.document){const n=up(e),o=i.useRef(!1);return i.useEffect(()=>{const e=e=>{if(e.target&&!o.current){bp(hp,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},h);return function(e,t=globalThis?.document){const n=up(e);i.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{x===d.layers.size-1&&(r?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},h),i.useEffect(()=>{if(f)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(dp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),vp(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=dp)}},[f,h,o,d]),i.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),vp())},[f,d]),i.useEffect(()=>{const e=()=>m({});return document.addEventListener(fp,e),()=>document.removeEventListener(fp,e)},[]),t.jsx(cp.div,{...u,ref:g,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:Zf(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Zf(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Zf(e.onPointerDownCapture,k.onPointerDownCapture)})});gp.displayName="DismissableLayer";var yp=i.forwardRef((e,n)=>{const o=i.useContext(mp),r=i.useRef(null),a=Uf(n,r);return i.useEffect(()=>{const e=r.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),t.jsx(cp.div,{...e,ref:a})});function vp(){const e=new CustomEvent(fp);document.dispatchEvent(e)}function bp(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}(r,i):r.dispatchEvent(i)}yp.displayName="DismissableLayerBranch";var xp="focusScope.autoFocusOnMount",wp="focusScope.autoFocusOnUnmount",Ep={bubbles:!1,cancelable:!0},kp=i.forwardRef((e,n)=>{const{loop:o=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...l}=e,[c,u]=i.useState(null),d=up(a),f=up(s),p=i.useRef(null),h=Uf(n,e=>u(e)),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?p.current=t:Np(p.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Np(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Np(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return c&&o.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[r,c,m.paused]),i.useEffect(()=>{if(c){Mp.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(xp,Ep);c.addEventListener(xp,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Np(o,{select:t}),document.activeElement!==n)return}((e=Sp(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Np(c))}return()=>{c.removeEventListener(xp,d),setTimeout(()=>{const e=new CustomEvent(wp,Ep);c.addEventListener(wp,f),c.dispatchEvent(e),e.defaultPrevented||Np(t??document.body,{select:!0}),c.removeEventListener(wp,f),Mp.remove(m)},0)}}var e},[c,d,f,m]);const g=i.useCallback(e=>{if(!o&&!r)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,i]=function(e){const t=Sp(e),n=Cp(t,e),o=Cp(t.reverse(),e);return[n,o]}(t);r&&i?e.shiftKey||n!==i?e.shiftKey&&n===r&&(e.preventDefault(),o&&Np(i,{select:!0})):(e.preventDefault(),o&&Np(r,{select:!0})):n===t&&e.preventDefault()}},[o,r,m.paused]);return t.jsx(cp.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})});function Sp(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Cp(e,t){for(const n of e)if(!_p(n,{upTo:t}))return n}function _p(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Np(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}kp.displayName="FocusScope";var Mp=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Pp(e,t),e.unshift(t)},remove(t){e=Pp(e,t),e[0]?.resume()}}}();function Pp(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var Rp=i.forwardRef((e,o)=>{const{container:r,...a}=e,[s,l]=i.useState(!1);Jf(()=>l(!0),[]);const c=r||s&&globalThis?.document?.body;return c?n.createPortal(t.jsx(cp.div,{...a,ref:o}),c):null});Rp.displayName="Portal";var Op=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=i.useState(),o=i.useRef(null),r=i.useRef(e),a=i.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return i.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const e=$p(o.current);a.current="mounted"===l?e:"none"},[l]),Jf(()=>{const t=o.current,n=r.current;if(n!==e){const o=a.current,i=$p(t);if(e)c("MOUNT");else if("none"===i||"none"===t?.display)c("UNMOUNT");else{c(n&&o!==i?"ANIMATION_OUT":"UNMOUNT")}r.current=e}},[e,c]),Jf(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=i=>{const a=$p(o.current).includes(CSS.escape(i.animationName));if(i.target===t&&a&&(c("ANIMATION_END"),!r.current)){const o=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=o)})}},s=e=>{e.target===t&&(a.current=$p(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),r="function"==typeof n?n({present:o.isPresent}):i.Children.only(n),a=Uf(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(r));return"function"==typeof n||o.isPresent?i.cloneElement(r,{ref:a}):null};function $p(e){return e?.animationName||"none"}Op.displayName="Presence";var Ap=0;function Tp(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Dp()),document.body.insertAdjacentElement("beforeend",e[1]??Dp()),Ap++,()=>{1===Ap&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Ap--}},[])}function Dp(){const 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}var zp=function(){return zp=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},zp.apply(this,arguments)};function Ip(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;var Lp="right-scroll-bar-position",jp="width-before-scroll-bar";function Bp(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Fp="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,Hp=new WeakMap;function Vp(t,n){var o,r,i,a=(o=n||null,r=function(e){return t.forEach(function(t){return Bp(t,e)})},(i=e.useState(function(){return{value:o,callback:r,facade:{get current(){return i.value},set current(e){var t=i.value;t!==e&&(i.value=e,i.callback(e,t))}}}})[0]).callback=r,i.facade);return Fp(function(){var e=Hp.get(a);if(e){var n=new Set(e),o=new Set(t),r=a.current;n.forEach(function(e){o.has(e)||Bp(e,null)}),o.forEach(function(e){n.has(e)||Bp(e,r)})}Hp.set(a,t)},[t]),a}function Wp(e){return e}var Yp=function(e){var t=e.sideCar,n=Ip(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return i.createElement(o,zp({},n))};Yp.isSideCarExport=!0;var Xp=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Wp);var n=[],o=!1,r={read:function(){if(o)throw new 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 r=t(e,o);return n.push(r),function(){n=n.filter(function(e){return e!==r})}},assignSyncMedium:function(e){for(o=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){o=!0;var t=[];if(n.length){var r=n;n=[],r.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return r}(null);return t.options=zp({async:!0,ssr:!1},e),t}(),Zp=function(){},Kp=i.forwardRef(function(e,t){var n=i.useRef(null),o=i.useState({onScrollCapture:Zp,onWheelCapture:Zp,onTouchMoveCapture:Zp}),r=o[0],a=o[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,b=void 0===v?"div":v,x=e.gapMode,w=Ip(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,k=Vp([n,t]),S=zp(zp({},w),r);return i.createElement(i.Fragment,null,d&&i.createElement(E,{sideCar:Xp,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:n,gapMode:x}),s?i.cloneElement(i.Children.only(l),zp(zp({},S),{ref:k})):i.createElement(b,zp({},S,{className:c,ref:k}),l))});Kp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Kp.classNames={fullWidth:jp,zeroRight:Lp};function qp(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Up=function(){var e=0,t=null;return{add:function(n){var o,r;0==e&&(t=qp())&&(r=n,(o=t).styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Gp=function(){var e,t=(e=Up(),function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,o=e.dynamic;return t(n,o),null}},Qp={left:0,top:0,right:0,gap:0},Jp=function(e){return parseInt(e||"",10)||0},eh=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Qp;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],o=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[Jp(n),Jp(o),Jp(r)]}(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},th=Gp(),nh="data-scroll-locked",oh=function(e,t,n,o){var r=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(o,";\n padding-right: ").concat(s,"px ").concat(o,";\n }\n body[").concat(nh,"] {\n overflow: hidden ").concat(o,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(o,";"),"margin"===n&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(o,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Lp," {\n right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(jp," {\n margin-right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Lp," .").concat(Lp," {\n right: 0 ").concat(o,";\n }\n \n .").concat(jp," .").concat(jp," {\n margin-right: 0 ").concat(o,";\n }\n \n body[").concat(nh,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},rh=function(){var e=parseInt(document.body.getAttribute(nh)||"0",10);return isFinite(e)?e:0},ih=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=void 0===o?"margin":o;i.useEffect(function(){return document.body.setAttribute(nh,(rh()+1).toString()),function(){var e=rh()-1;e<=0?document.body.removeAttribute(nh):document.body.setAttribute(nh,e.toString())}},[]);var a=i.useMemo(function(){return eh(r)},[r]);return i.createElement(th,{styles:oh(a,!t,r,n?"":"!important")})},ah=!1;if("undefined"!=typeof window)try{var sh=Object.defineProperty({},"passive",{get:function(){return ah=!0,!0}});window.addEventListener("test",sh,sh),window.removeEventListener("test",sh,sh)}catch(e){ah=!1}var lh=!!ah&&{passive:!1},ch=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},uh=function(e,t){var n=t.ownerDocument,o=t;do{if("undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot&&(o=o.host),dh(e,o)){var r=fh(e,o);if(r[1]>r[2])return!0}o=o.parentNode}while(o&&o!==n.body);return!1},dh=function(e,t){return"v"===e?function(e){return ch(e,"overflowY")}(t):function(e){return ch(e,"overflowX")}(t)},fh=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},ph=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hh=function(e){return[e.deltaX,e.deltaY]},mh=function(e){return e&&"current"in e?e.current:e},gh=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},yh=0,vh=[];function bh(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var xh,wh=(xh=function(e){var t=i.useRef([]),n=i.useRef([0,0]),o=i.useRef(),r=i.useState(yh++)[0],a=i.useState(Gp)[0],s=i.useRef(e);i.useEffect(function(){s.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var t=function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(mh),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var r,i=ph(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=uh(d,u);if(!f)return!0;if(f?r=d:(r="v"===d?"h":"v",f=uh(d,u)),!f)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=r),!r)return!0;var p=o.current||r;return function(e,t,n,o,r){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*o,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,f=0;do{if(!s)break;var p=fh(e,s),h=p[0],m=p[1]-p[2]-i*h;(h||m)&&dh(e,s)&&(d+=m,f+=h);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(r&&Math.abs(d)<1||!r&&a>d)||!u&&(r&&Math.abs(f)<1||!r&&-a>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=i.useCallback(function(e){var n=e;if(vh.length&&vh[vh.length-1]===a){var o="deltaY"in n?hh(n):ph(n),r=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,r=o,t[0]===r[0]&&t[1]===r[1]);var t,r})[0];if(r&&r.should)n.cancelable&&n.preventDefault();else if(!r){var i=(s.current.shards||[]).map(mh).filter(Boolean).filter(function(e){return e.contains(n.target)});(i.length>0?l(n,i[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=i.useCallback(function(e,n,o,r){var i={name:e,delta:n,target:o,should:r,shadowParent:bh(o)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),d=i.useCallback(function(e){n.current=ph(e),o.current=void 0},[]),f=i.useCallback(function(t){u(t.type,hh(t),t.target,l(t,e.lockRef.current))},[]),p=i.useCallback(function(t){u(t.type,ph(t),t.target,l(t,e.lockRef.current))},[]);i.useEffect(function(){return vh.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,lh),document.addEventListener("touchmove",c,lh),document.addEventListener("touchstart",d,lh),function(){vh=vh.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,lh),document.removeEventListener("touchmove",c,lh),document.removeEventListener("touchstart",d,lh)}},[]);var h=e.removeScrollBar,m=e.inert;return i.createElement(i.Fragment,null,m?i.createElement(a,{styles:gh(r)}):null,h?i.createElement(ih,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Xp.useMedium(xh),Yp),Eh=i.forwardRef(function(e,t){return i.createElement(Kp,zp({},e,{ref:t,sideCar:wh}))});Eh.classNames=Kp.classNames;var kh=Eh,Sh=new WeakMap,Ch=new WeakMap,_h={},Nh=0,Mh=function(e){return e&&(e.host||Mh(e.parentNode))},Ph=function(e,t,n,o){var r=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Mh(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);_h[n]||(_h[n]=new WeakMap);var i=_h[n],a=[],s=new Set,l=new Set(r),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};r.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(o),r=null!==t&&"false"!==t,l=(Sh.get(e)||0)+1,c=(i.get(e)||0)+1;Sh.set(e,l),i.set(e,c),a.push(e),1===l&&r&&Ch.set(e,!0),1===c&&e.setAttribute(n,"true"),r||e.setAttribute(o,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),Nh++,function(){a.forEach(function(e){var t=Sh.get(e)-1,r=i.get(e)-1;Sh.set(e,t),i.set(e,r),t||(Ch.has(e)||e.removeAttribute(o),Ch.delete(e)),r||e.removeAttribute(n)}),--Nh||(Sh=new WeakMap,Sh=new WeakMap,Ch=new WeakMap,_h={})}},Rh=function(e,t,n){void 0===n&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Ph(o,r,n,"aria-hidden")):function(){return null}},Oh="Dialog",[$h,Ah]=Gf(Oh),[Th,Dh]=$h(Oh),zh=e=>{const{__scopeDialog:n,children:o,open:r,defaultOpen:a,onOpenChange:s,modal:l=!0}=e,c=i.useRef(null),u=i.useRef(null),[d,f]=rp({prop:r,defaultProp:a??!1,onChange:s,caller:Oh});return t.jsx(Th,{scope:n,triggerRef:c,contentRef:u,contentId:np(),titleId:np(),descriptionId:np(),open:d,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(e=>!e),[f]),modal:l,children:o})};zh.displayName=Oh;var Ih="DialogTrigger",Lh=i.forwardRef((e,n)=>{const{__scopeDialog:o,...r}=e,i=Dh(Ih,o),a=Uf(n,i.triggerRef);return t.jsx(cp.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":rm(i.open),...r,ref:a,onClick:Zf(e.onClick,i.onOpenToggle)})});Lh.displayName=Ih;var jh="DialogPortal",[Bh,Fh]=$h(jh,{forceMount:void 0}),Hh=e=>{const{__scopeDialog:n,forceMount:o,children:r,container:a}=e,s=Dh(jh,n);return t.jsx(Bh,{scope:n,forceMount:o,children:i.Children.map(r,e=>t.jsx(Op,{present:o||s.open,children:t.jsx(Rp,{asChild:!0,container:a,children:e})}))})};Hh.displayName=jh;var Vh="DialogOverlay",Wh=i.forwardRef((e,n)=>{const o=Fh(Vh,e.__scopeDialog),{forceMount:r=o.forceMount,...i}=e,a=Dh(Vh,e.__scopeDialog);return a.modal?t.jsx(Op,{present:r||a.open,children:t.jsx(Xh,{...i,ref:n})}):null});Wh.displayName=Vh;var Yh=ip("DialogOverlay.RemoveScroll"),Xh=i.forwardRef((e,n)=>{const{__scopeDialog:o,...r}=e,i=Dh(Vh,o);return t.jsx(kh,{as:Yh,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(cp.div,{"data-state":rm(i.open),...r,ref:n,style:{pointerEvents:"auto",...r.style}})})}),Zh="DialogContent",Kh=i.forwardRef((e,n)=>{const o=Fh(Zh,e.__scopeDialog),{forceMount:r=o.forceMount,...i}=e,a=Dh(Zh,e.__scopeDialog);return t.jsx(Op,{present:r||a.open,children:a.modal?t.jsx(qh,{...i,ref:n}):t.jsx(Uh,{...i,ref:n})})});Kh.displayName=Zh;var qh=i.forwardRef((e,n)=>{const o=Dh(Zh,e.__scopeDialog),r=i.useRef(null),a=Uf(n,o.contentRef,r);return i.useEffect(()=>{const e=r.current;if(e)return Rh(e)},[]),t.jsx(Gh,{...e,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Zf(e.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Zf(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Zf(e.onFocusOutside,e=>e.preventDefault())})}),Uh=i.forwardRef((e,n)=>{const o=Dh(Zh,e.__scopeDialog),r=i.useRef(!1),a=i.useRef(!1);return t.jsx(Gh,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||o.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const n=t.target,i=o.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),Gh=i.forwardRef((e,n)=>{const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:s,...l}=e,c=Dh(Zh,o),u=i.useRef(null),d=Uf(n,u);return Tp(),t.jsxs(t.Fragment,{children:[t.jsx(kp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:s,children:t.jsx(gp,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":rm(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(lm,{titleId:c.titleId}),t.jsx(cm,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Qh="DialogTitle",Jh=i.forwardRef((e,n)=>{const{__scopeDialog:o,...r}=e,i=Dh(Qh,o);return t.jsx(cp.h2,{id:i.titleId,...r,ref:n})});Jh.displayName=Qh;var em="DialogDescription",tm=i.forwardRef((e,n)=>{const{__scopeDialog:o,...r}=e,i=Dh(em,o);return t.jsx(cp.p,{id:i.descriptionId,...r,ref:n})});tm.displayName=em;var nm="DialogClose",om=i.forwardRef((e,n)=>{const{__scopeDialog:o,...r}=e,i=Dh(nm,o);return t.jsx(cp.button,{type:"button",...r,ref:n,onClick:Zf(e.onClick,()=>i.onOpenChange(!1))})});function rm(e){return e?"open":"closed"}om.displayName=nm;var im="DialogTitleWarning",[am,sm]=function(e,n){const o=i.createContext(n),r=e=>{const{children:n,...r}=e,a=i.useMemo(()=>r,Object.values(r));return t.jsx(o.Provider,{value:a,children:n})};return r.displayName=e+"Provider",[r,function(t){const r=i.useContext(o);if(r)return r;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(im,{contentName:Zh,titleName:Qh,docsSlug:"dialog"}),lm=({titleId:e})=>{const t=sm(im),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},cm=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${sm("DialogDescriptionWarning").contentName}}.`;return i.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");if(t&&o){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},um=zh,dm=Lh,fm=Hh,pm=Wh,hm=Kh,mm=Jh,gm=tm,ym=om;const vm=um,bm=dm,xm=fm,wm=i.forwardRef(({className:e,...t},n)=>i.createElement(pm,{style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"hsla(var(--background), 0.8)",backdropFilter:"blur(4px)"},className:e,...t,ref:n}));wm.displayName=pm.displayName;const Em=(e="right")=>{const t={position:"fixed",zIndex:50,gap:"16px",backgroundColor:"hsl(var(--background))",padding:"24px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",transition:"all 0.3s ease-in-out"};switch(e){case"top":return{...t,left:0,right:0,top:0,borderBottom:"1px solid hsl(var(--border))"};case"bottom":return{...t,left:0,right:0,bottom:0,borderTop:"1px solid hsl(var(--border))"};case"left":return{...t,top:0,bottom:0,left:0,height:"100%",width:"75%",borderRight:"1px solid hsl(var(--border))",maxWidth:"384px"};default:return{...t,top:0,bottom:0,right:0,height:"100%",width:"75%",borderLeft:"1px solid hsl(var(--border))",maxWidth:"384px"}}},km=i.forwardRef(({side:e="right",className:t,children:n,...o},r)=>i.createElement(xm,null,i.createElement(wm,null),i.createElement(hm,{ref:r,style:Em(e),className:t,...o},n,i.createElement(ym,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px"},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},i.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),i.createElement("span",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close")))));km.displayName=hm.displayName;i.forwardRef(({className:e,...t},n)=>i.createElement(mm,{ref:n,style:{fontSize:"18px",fontWeight:600,color:"hsl(var(--foreground))"},className:e,...t})).displayName=mm.displayName;i.forwardRef(({className:e,...t},n)=>i.createElement(gm,{ref:n,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:e,...t})).displayName=gm.displayName;const Sm=(e,t,n={})=>{const{minNodeSpacing:o=200,containerWidth:r=600}=n;if(!e||0===e.length)return new Map;new Map(e.map(e=>[e.identifier,e]));const i=new Map,a=new Map;e.forEach(e=>i.set(e.identifier,[])),t.length>0?t.forEach(e=>{e.source&&e.target&&(i.get(e.source)?.push(e.target),a.set(e.target,e.source))}):e.forEach(e=>{e.parent&&e.parent.identifier!==e.identifier&&(i.get(e.parent.identifier)?.push(e.identifier),a.set(e.identifier,e.parent.identifier))});const s=e.filter(e=>!a.has(e.identifier)),l=new Map,c=(e,t)=>{l.set(e,t);for(const n of i.get(e)||[])c(n,t+1)};s.forEach(e=>c(e.identifier,0));const u=[];e.forEach(e=>{const t=l.get(e.identifier)??0;u[t]||(u[t]=[]),u[t].push(e.identifier)});const d=new Map,f=200,p=Math.max(250,o+50),h=e=>{const t=i.get(e)||[];if(0===t.length)return d.set(e,f),f;let n=0;for(const e of t)n+=h(e);return n+=(t.length-1)*p,d.set(e,n),n};s.forEach(e=>h(e.identifier));const m=new Map,g=Math.max(400,o+200),y=(e,t,n)=>{const o=d.get(e)||f,r=n*g+100,a=i.get(e)||[];if(0===a.length)m.set(e,{x:t+o/2-100,y:r});else{let o=t;for(const e of a){const t=d.get(e)||f;y(e,o,n+1),o+=t+p}const i=a[0],s=a[a.length-1],l=m.get(i),c=m.get(s),u=(l.x+c.x)/2;m.set(e,{x:u,y:r})}};let v=0;for(const e of s)v+=d.get(e.identifier)||f;s.length>1&&(v+=(s.length-1)*p*2);let b=Math.max(0,(r-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const x=o,w=Array.from(m.keys());for(let e=0;e<w.length;e++)for(let t=e+1;t<w.length;t++){const n=m.get(w[e]),o=m.get(w[t]);if(Math.sqrt((o.x-n.x)**2+(o.y-n.y)**2)<x){const e=o.x-n.x,t=o.y-n.y,r=Math.sqrt(e*e+t*t);if(r>0){const i=x/r,a=(e*i-e)/2,s=(t*i-t)/2;n.x-=a,n.y-=s,o.x+=a,o.y+=s}else n.x-=x/2,o.x+=x/2}}return m},Cm={Agent:Tf,Tool:Tf,Coordinator:Tf},_m=({flowData:t,width:n="100%",height:o="1000px",className:r="",defaultZoom:i=1,defaultPan:a={x:0,y:0},disableAutoFit:s=!0,showTimeline:l=!1,minNodeSpacing:c=400,onInspect:u})=>{const{theme:d,isDarkMode:f}=gu(),p=d.colors,h=t;if(!h)return e.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:`1px solid ${p.border}`,borderRadius:"8px",background:p.muted,position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:r},e.createElement("div",{style:{textAlign:"center"}},e.createElement("div",{style:{fontSize:"16px",color:p.mutedForeground,marginBottom:"8px"}},"No flow data available"),e.createElement("div",{style:{fontSize:"14px",color:p.mutedForeground}},"Please provide flowData prop")));const m=e.useRef(null),g=e.useRef(null),[y,v]=e.useState({width:"number"==typeof n?n:1200,height:"number"==typeof o?o:600}),[b,x]=e.useState(0),[w,E]=e.useState(!1),k=e.useRef(null),[S,C]=e.useState(!1),_=e.useMemo(()=>{const e=h.stamps||h.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[h.stamps,h.steps]);e.useEffect(()=>(w?k.current=setInterval(()=>{x(e=>e>=_?(E(!1),e):e+1)},250):k.current&&(clearInterval(k.current),k.current=null),()=>{k.current&&clearInterval(k.current)}),[w,_]),e.useEffect(()=>{const e=h.stamps||h.steps||[];e.length>0&&x(Math.max(...e.map(e=>e.step)))},[h.stamps,h.steps]),e.useEffect(()=>{const e=()=>{if(m.current){const e=m.current.getBoundingClientRect();v({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof o?o:600)})}};if(e(),window.ResizeObserver&&m.current){const t=new ResizeObserver(e);return t.observe(m.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,o]);const N=e.useMemo(()=>{if(!h.nodes)return new Map;const e=Math.max(y.width||800,1200);return Sm(h.nodes,h.edges||[],{minNodeSpacing:c,containerWidth:e})},[h.nodes,h.edges,y.width,c]),M=e.useCallback(e=>h.nodes?h.nodes.filter(t=>t.stamp.step<=e):[],[h.nodes]),P=e.useCallback(e=>(h.edges||[]).filter(t=>t.stamp.step<=e),[h.edges]),R=e.useMemo(()=>{const e=M(b),t=P(b);return e.map(e=>{const n=N.get(e.identifier)||{x:0,y:0},o=e.stamp.step===b,r="Tool"===e.node_type?t.filter(t=>t.target===e.identifier&&t.details).map(e=>e.details):void 0;return{id:e.identifier,type:e.node_type||"Agent",position:n,data:{label:e.name||e.node_type,nodeType:e.node_type,details:e.details,isActive:o,id:e.identifier,edges:t,edgeDetails:r,onInspect:u},style:{filter:o?"drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3))":"none"}}})},[N,b,M,P,u]),O=e.useMemo(()=>P(b).filter(e=>e.source&&e.target).map(e=>{const t=e.stamp.step===b;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:t,bidirectional:!0,style:{stroke:t?p.primary:p.mutedForeground,strokeWidth:t?3:2},label:e.stamp?.identifier?Pu(String(e.stamp.identifier),50):void 0,data:{label:e.stamp?.identifier?Pu(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:e.stamp?.step,time:e.stamp?.time,details:e.details}}}),[b,P,p.primary,p.mutedForeground]),[$,A,T]=function(t){const[n,o]=e.useState(t),r=e.useCallback(e=>o(t=>ha(e,t)),[]);return[n,o,r]}(R),[D,z,I]=function(t){const[n,o]=e.useState(t),r=e.useCallback(e=>o(t=>ma(e,t)),[]);return[n,o,r]}(O);e.useEffect(()=>{A(R)},[R,A]),e.useEffect(()=>{z(O)},[O,z]);const L=e.useCallback(e=>z(t=>xr(e,t)),[z]),j=e.useCallback(e=>{x(e),E(!1)},[]);e.useCallback(()=>{E(e=>!e)},[]);const B=(e,t)=>{if(!g.current)return{x:0,y:0};const n=g.current.createSVGPoint();n.x=e,n.y=t;const o=n.matrixTransform(g.current.getScreenCTM()?.inverse());return{x:o.x,y:o.y}},F=Na();return e.useEffect(()=>{if(s||!F||0===R.length)return;const e=new Map;O.forEach(t=>{const n=e.get(t.source)||0;e.set(t.source,n+1);const o=e.get(t.target)||0;e.set(t.target,o+1)});let t="",n=0;e.forEach((e,o)=>{e>n&&(n=e,t=o)}),!t&&R.length>0&&(t=R[0].id),t&&setTimeout(()=>{F.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:i,maxZoom:1})},500)},[R,O,F,s,i]),e.createElement("div",{ref:m,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:`1px solid ${p.border}`,borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px",background:p.background},className:r},l&&e.createElement(vm,{open:S,onOpenChange:C},e.createElement(bm,{asChild:!0},e.createElement("button",{style:{position:"absolute",top:"16px",left:"16px",zIndex:50,width:"40px",height:"40px",backgroundColor:p.card,border:`1px solid ${p.border}`,borderRadius:"8px",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease-in-out",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=p.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=p.card},title:"Open Timeline"},e.createElement(Hl,{size:20,style:{color:p.mutedForeground}}))),e.createElement(xm,null,e.createElement(hm,{style:{position:"fixed",top:0,bottom:0,left:0,height:"100%",width:"280px",zIndex:50,backgroundColor:p.background,borderRight:`1px solid ${p.border}`,boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",transition:"all 0.3s ease-in-out",padding:0},onPointerDownOutside:e=>e.preventDefault()},e.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%"}},e.createElement("div",{style:{flex:1,overflowY:"auto"}},e.createElement(Xf,{stamps:h.stamps||h.steps||[],currentStep:b,onStepChange:j}))),e.createElement(ym,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px",color:p.mutedForeground},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},e.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),e.createElement("span",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close"))))),e.createElement(il,{colorMode:f?"dark":"light",nodes:$,edges:D,onNodesChange:T,onEdgesChange:I,onConnect:L,nodeTypes:Cm,edgeTypes:{default:t=>e.createElement(yu,{...t,clientToSvgCoords:B,svgRef:g})},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:a.x,y:a.y,zoom:i},onInit:()=>{if(m.current){const e=m.current.querySelector("svg");e&&(g.current=e)}}},e.createElement(dl,{variant:rl.Lines,color:p.mutedBorder,gap:16})),e.createElement("style",null,`\n .react-flow__edge-label {\n font-size: 10px;\n background: ${p.card};\n color: ${p.cardForeground};\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid ${p.border};\n max-width: 150px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .react-flow__edge {\n cursor: default !important;\n }\n\n .react-flow__edge-path {\n cursor: default !important;\n }\n `))};function Nm(e,[t,n]){return Math.min(n,Math.max(t,e))}var Mm=i.createContext(void 0);const Pm=["top","right","bottom","left"],Rm=Math.min,Om=Math.max,$m=Math.round,Am=Math.floor,Tm=e=>({x:e,y:e}),Dm={left:"right",right:"left",bottom:"top",top:"bottom"},zm={start:"end",end:"start"};function Im(e,t,n){return Om(e,Rm(t,n))}function Lm(e,t){return"function"==typeof e?e(t):e}function jm(e){return e.split("-")[0]}function Bm(e){return e.split("-")[1]}function Fm(e){return"x"===e?"y":"x"}function Hm(e){return"y"===e?"height":"width"}const Vm=new Set(["top","bottom"]);function Wm(e){return Vm.has(jm(e))?"y":"x"}function Ym(e){return Fm(Wm(e))}function Xm(e){return e.replace(/start|end/g,e=>zm[e])}const Zm=["left","right"],Km=["right","left"],qm=["top","bottom"],Um=["bottom","top"];function Gm(e,t,n,o){const r=Bm(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Km:Zm:t?Zm:Km;case"left":case"right":return t?qm:Um;default:return[]}}(jm(e),"start"===n,o);return r&&(i=i.map(e=>e+"-"+r),t&&(i=i.concat(i.map(Xm)))),i}function Qm(e){return e.replace(/left|right|bottom|top/g,e=>Dm[e])}function Jm(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function eg(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function tg(e,t,n){let{reference:o,floating:r}=e;const i=Wm(t),a=Ym(t),s=Hm(a),l=jm(t),c="y"===i,u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[s]/2-r[s]/2;let p;switch(l){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(Bm(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1)}return p}async function ng(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Lm(t,e),h=Jm(p),m=s[f?"floating"===d?"reference":"floating":d],g=eg(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},x=eg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.x}}function og(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rg(e){return Pm.some(t=>e[t]>=0)}const ig=new Set(["left","top"]);function ag(){return"undefined"!=typeof window}function sg(e){return ug(e)?(e.nodeName||"").toLowerCase():"#document"}function lg(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function cg(e){var t;return null==(t=(ug(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ug(e){return!!ag()&&(e instanceof Node||e instanceof lg(e).Node)}function dg(e){return!!ag()&&(e instanceof Element||e instanceof lg(e).Element)}function fg(e){return!!ag()&&(e instanceof HTMLElement||e instanceof lg(e).HTMLElement)}function pg(e){return!(!ag()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof lg(e).ShadowRoot)}const hg=new Set(["inline","contents"]);function mg(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ng(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!hg.has(r)}const gg=new Set(["table","td","th"]);function yg(e){return gg.has(sg(e))}const vg=[":popover-open",":modal"];function bg(e){return vg.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const xg=["transform","translate","scale","rotate","perspective"],wg=["transform","translate","scale","rotate","perspective","filter"],Eg=["paint","layout","strict","content"];function kg(e){const t=Sg(),n=dg(e)?Ng(e):e;return xg.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||wg.some(e=>(n.willChange||"").includes(e))||Eg.some(e=>(n.contain||"").includes(e))}function Sg(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Cg=new Set(["html","body","#document"]);function _g(e){return Cg.has(sg(e))}function Ng(e){return lg(e).getComputedStyle(e)}function Mg(e){return dg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pg(e){if("html"===sg(e))return e;const t=e.assignedSlot||e.parentNode||pg(e)&&e.host||cg(e);return pg(t)?t.host:t}function Rg(e){const t=Pg(e);return _g(t)?e.ownerDocument?e.ownerDocument.body:e.body:fg(t)&&mg(t)?t:Rg(t)}function Og(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Rg(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),a=lg(r);if(i){const e=$g(a);return t.concat(a,a.visualViewport||[],mg(r)?r:[],e&&n?Og(e):[])}return t.concat(r,Og(r,[],n))}function $g(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ag(e){const t=Ng(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=fg(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,s=$m(n)!==i||$m(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function Tg(e){return dg(e)?e:e.contextElement}function Dg(e){const t=Tg(e);if(!fg(t))return Tm(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Ag(t);let a=(i?$m(n.width):n.width)/o,s=(i?$m(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const zg=Tm(0);function Ig(e){const t=lg(e);return Sg()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:zg}function Lg(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=Tg(e);let a=Tm(1);t&&(o?dg(o)&&(a=Dg(o)):a=Dg(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==lg(e))&&t}(i,n,o)?Ig(i):Tm(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(i){const e=lg(i),t=o&&dg(o)?lg(o):o;let n=e,r=$g(n);for(;r&&o&&t!==n;){const e=Dg(r),t=r.getBoundingClientRect(),o=Ng(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=lg(r),r=$g(n)}}return eg({width:u,height:d,x:l,y:c})}function jg(e,t){const n=Mg(e).scrollLeft;return t?t.left+n:Lg(cg(e)).left+n}function Bg(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jg(e,n),y:n.top+t.scrollTop}}const Fg=new Set(["absolute","fixed"]);function Hg(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=lg(e),o=cg(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;const e=Sg();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=jg(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(o.clientWidth-t.clientWidth-r);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=cg(e),n=Mg(e),o=e.ownerDocument.body,r=Om(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Om(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+jg(e);const s=-n.scrollTop;return"rtl"===Ng(o).direction&&(a+=Om(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:s}}(cg(e));else if(dg(t))o=function(e,t){const n=Lg(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=fg(e)?Dg(e):Tm(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=Ig(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return eg(o)}function Vg(e,t){const n=Pg(e);return!(n===t||!dg(n)||_g(n))&&("fixed"===Ng(n).position||Vg(n,t))}function Wg(e,t,n){const o=fg(t),r=cg(t),i="fixed"===n,a=Lg(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Tm(0);function c(){l.x=jg(r)}if(o||!o&&!i)if(("body"!==sg(t)||mg(r))&&(s=Mg(t)),o){const e=Lg(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&c();i&&!o&&r&&c();const u=!r||o||i?Tm(0):Bg(r,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function Yg(e){return"static"===Ng(e).position}function Xg(e,t){if(!fg(e)||"fixed"===Ng(e).position)return null;if(t)return t(e);let n=e.offsetParent;return cg(e)===n&&(n=n.ownerDocument.body),n}function Zg(e,t){const n=lg(e);if(bg(e))return n;if(!fg(e)){let t=Pg(e);for(;t&&!_g(t);){if(dg(t)&&!Yg(t))return t;t=Pg(t)}return n}let o=Xg(e,t);for(;o&&yg(o)&&Yg(o);)o=Xg(o,t);return o&&_g(o)&&Yg(o)&&!kg(o)?n:o||function(e){let t=Pg(e);for(;fg(t)&&!_g(t);){if(kg(t))return t;if(bg(t))return null;t=Pg(t)}return null}(e)||n}const Kg={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,a=cg(o),s=!!t&&bg(t.floating);if(o===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Tm(1);const u=Tm(0),d=fg(o);if((d||!d&&!i)&&(("body"!==sg(o)||mg(a))&&(l=Mg(o)),fg(o))){const e=Lg(o);c=Dg(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const f=!a||d||i?Tm(0):Bg(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:cg,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i="clippingAncestors"===n?bg(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Og(e,[],!1).filter(e=>dg(e)&&"body"!==sg(e)),r=null;const i="fixed"===Ng(e).position;let a=i?Pg(e):e;for(;dg(a)&&!_g(a);){const t=Ng(a),n=kg(a);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&Fg.has(r.position)||mg(a)&&!n&&Vg(e,a))?o=o.filter(e=>e!==a):r=t,a=Pg(a)}return t.set(e,o),o}(t,this._c):[].concat(n),a=[...i,o],s=a[0],l=a.reduce((e,n)=>{const o=Hg(t,n,r);return e.top=Om(o.top,e.top),e.right=Rm(o.right,e.right),e.bottom=Rm(o.bottom,e.bottom),e.left=Om(o.left,e.left),e},Hg(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Zg,getElementRects:async function(e){const t=this.getOffsetParent||Zg,n=this.getDimensions,o=await n(e.floating);return{reference:Wg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ag(e);return{width:t,height:n}},getScale:Dg,isElement:dg,isRTL:function(e){return"rtl"===Ng(e).direction}};function qg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ug(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=Tg(e),u=r||i?[...c?Og(c):[],...Og(t)]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,o=null;const r=cg(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const h={rootMargin:-Am(d)+"px "+-Am(r.clientWidth-(u+f))+"px "+-Am(r.clientHeight-(d+p))+"px "+-Am(u)+"px",threshold:Om(0,Rm(1,l))||1};let m=!0;function g(t){const o=t[0].intersectionRatio;if(o!==l){if(!m)return a();o?a(!1,o):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==o||qg(c,e.getBoundingClientRect())||a(),m=!1}try{o=new IntersectionObserver(g,{...h,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,h)}o.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;a&&(h=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?Lg(e):null;return l&&function t(){const o=Lg(e);m&&!qg(m,o)&&n();m=o,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Gg=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),a=jm(n),s=Bm(n),l="y"===Wm(n),c=ig.has(a)?-1:1,u=i&&l?-1:1,d=Lm(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}},Qg=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Lm(e,t),c={x:n,y:o},u=await ng(t,l),d=Wm(jm(r)),f=Fm(d);let p=c[f],h=c[d];if(i){const e="y"===f?"bottom":"right";p=Im(p+u["y"===f?"top":"left"],p,p-u[e])}if(a){const e="y"===d?"bottom":"right";h=Im(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[f]:i,[d]:a}}}}}},Jg=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Lm(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=jm(r),v=Wm(s),b=jm(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[Qm(s)]:function(e){const t=Qm(e);return[Xm(e),t,Xm(t)]}(s)),E="none"!==h;!f&&E&&w.push(...Gm(s,m,h,x));const k=[s,...w],S=await ng(t,g),C=[];let _=(null==(o=i.flip)?void 0:o.overflows)||[];if(u&&C.push(S[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=Bm(e),r=Ym(e),i=Hm(r);let a="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Qm(a)),[a,Qm(a)]}(r,a,x);C.push(S[e[0]],S[e[1]])}if(_=[..._,{placement:r,overflows:C}],!C.every(e=>e<=0)){var N,M;const e=((null==(N=i.flip)?void 0:N.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&v!==Wm(t))||_.every(e=>Wm(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:_},reset:{placement:t}}}let n=null==(M=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=_.filter(e=>{if(E){const t=Wm(e.placement);return t===v||"y"===t}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])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},ey=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=Lm(e,t),u=await ng(t,c),d=jm(r),f=Bm(r),p="y"===Wm(r),{width:h,height:m}=i.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=m-u.top-u.bottom,b=h-u.left-u.right,x=Rm(m-u[g],v),w=Rm(h-u[y],b),E=!t.middlewareData.shift;let k=x,S=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=b),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(k=v),E&&!f){const e=Om(u.left,0),t=Om(u.right,0),n=Om(u.top,0),o=Om(u.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:Om(u.left,u.right)):k=m-2*(0!==n||0!==o?n+o:Om(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:k});const C=await a.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},ty=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Lm(e,t);switch(o){case"referenceHidden":{const e=og(await ng(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:rg(e)}}}case"escaped":{const e=og(await ng(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:rg(e)}}}default:return{}}}}},ny=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Lm(e,t)||{};if(null==c)return{};const d=Jm(u),f={x:n,y:o},p=Ym(r),h=Hm(p),m=await a.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[p]-f[p]-i.floating[h],w=f[p]-i.reference[p],E=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let k=E?E[b]:0;k&&await(null==a.isElement?void 0:a.isElement(E))||(k=s.floating[b]||i.floating[h]);const S=x/2-w/2,C=k/2-m[h]/2-1,_=Rm(d[y],C),N=Rm(d[v],C),M=_,P=k-m[h]-N,R=k/2-m[h]/2+S,O=Im(M,R,P),$=!l.arrow&&null!=Bm(r)&&R!==O&&i.reference[h]/2-(R<M?_:N)-m[h]/2<0,A=$?R<M?R-M:R-P:0;return{[p]:f[p]+A,data:{[p]:O,centerOffset:R-O-A,...$&&{alignmentOffset:A}},reset:$}}}),oy=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Lm(e,t),u={x:n,y:o},d=Wm(r),f=Fm(d);let p=u[f],h=u[d];const m=Lm(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,n=i.reference[f]+i.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,v;const e="y"===f?"width":"height",t=ig.has(jm(r)),n=i.reference[d]-i.floating[e]+(t&&(null==(y=a.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),o=i.reference[d]+i.reference[e]+(t?0:(null==(v=a.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>o&&(h=o)}return{[f]:p,[d]:h}}}},ry=(e,t,n)=>{const o=new Map,r={platform:Kg,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=tg(c,o,l),f=o,p={},h=0;for(let n=0;n<s.length;n++){const{name:i,fn:m}=s[n],{x:g,y:y,data:v,reset:b}=await m({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,p={...p,[i]:{...p[i],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:u,y:d}=tg(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var iy="undefined"!=typeof document?e.useLayoutEffect:function(){};function ay(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!ay(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!ay(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function sy(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ly(e,t){const n=sy(e);return Math.round(t*n)/n}function cy(e){const t=i.useRef(e);return iy(()=>{t.current=e}),t}const uy=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:o}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?ny({element:n.current,padding:o}).fn(t):{}:n?ny({element:n,padding:o}).fn(t):{};var r}}),dy=(e,t)=>({...Gg(e),options:[e,t]}),fy=(e,t)=>({...Qg(e),options:[e,t]}),py=(e,t)=>({...oy(e),options:[e,t]}),hy=(e,t)=>({...Jg(e),options:[e,t]}),my=(e,t)=>({...ey(e),options:[e,t]}),gy=(e,t)=>({...ty(e),options:[e,t]}),yy=(e,t)=>({...uy(e),options:[e,t]});var vy=i.forwardRef((e,n)=>{const{children:o,width:r=10,height:i=5,...a}=e;return t.jsx(cp.svg,{...a,ref:n,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});vy.displayName="Arrow";var by=vy;function xy(e){const[t,n]=i.useState(void 0);return Jf(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,i;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var wy="Popper",[Ey,ky]=Gf(wy),[Sy,Cy]=Ey(wy),_y=e=>{const{__scopePopper:n,children:o}=e,[r,a]=i.useState(null);return t.jsx(Sy,{scope:n,anchor:r,onAnchorChange:a,children:o})};_y.displayName=wy;var Ny="PopperAnchor",My=i.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:r,...a}=e,s=Cy(Ny,o),l=i.useRef(null),c=Uf(n,l),u=i.useRef(null);return i.useEffect(()=>{const e=u.current;u.current=r?.current||l.current,e!==u.current&&s.onAnchorChange(u.current)}),r?null:t.jsx(cp.div,{...a,ref:c})});My.displayName=Ny;var Py="PopperContent",[Ry,Oy]=Ey(Py),$y=i.forwardRef((e,n)=>{const{__scopePopper:o,side:r="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,b=Cy(Py,o),[x,w]=i.useState(null),E=Uf(n,e=>w(e)),[k,S]=i.useState(null),C=xy(k),_=C?.width??0,N=C?.height??0,M=r+("center"!==l?"-"+l:""),P="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},R=Array.isArray(f)?f:[f],O=R.length>0,$={padding:P,boundary:R.filter(zy),altBoundary:O},{refs:A,floatingStyles:T,placement:D,isPositioned:z,middlewareData:I}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,p]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=i.useState(o);ay(h,o)||m(o);const[g,y]=i.useState(null),[v,b]=i.useState(null),x=i.useCallback(e=>{e!==S.current&&(S.current=e,y(e))},[]),w=i.useCallback(e=>{e!==C.current&&(C.current=e,b(e))},[]),E=s||g,k=l||v,S=i.useRef(null),C=i.useRef(null),_=i.useRef(f),N=null!=u,M=cy(u),P=cy(r),R=cy(d),O=i.useCallback(()=>{if(!S.current||!C.current)return;const e={placement:t,strategy:n,middleware:h};P.current&&(e.platform=P.current),ry(S.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==R.current};$.current&&!ay(_.current,t)&&(_.current=t,a.flushSync(()=>{p(t)}))})},[h,t,n,P,R]);iy(()=>{!1===d&&_.current.isPositioned&&(_.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const $=i.useRef(!1);iy(()=>($.current=!0,()=>{$.current=!1}),[]),iy(()=>{if(E&&(S.current=E),k&&(C.current=k),E&&k){if(M.current)return M.current(E,k,O);O()}},[E,k,O,M,N]);const A=i.useMemo(()=>({reference:S,floating:C,setReference:x,setFloating:w}),[x,w]),T=i.useMemo(()=>({reference:E,floating:k}),[E,k]),D=i.useMemo(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=ly(T.floating,f.x),o=ly(T.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+o+"px)",...sy(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}},[n,c,T.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:O,refs:A,elements:T,floatingStyles:D}),[f,O,A,T,D])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>Ug(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[dy({mainAxis:s+N,alignmentAxis:c}),d&&fy({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?py():void 0,...$}),d&&hy({...$}),my({...$,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${r}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),k&&yy({element:k,padding:u}),Iy({arrowWidth:_,arrowHeight:N}),m&&gy({strategy:"referenceHidden",...$})]}),[L,j]=Ly(D),B=up(y);Jf(()=>{z&&B?.()},[z,B]);const F=I.arrow?.x,H=I.arrow?.y,V=0!==I.arrow?.centerOffset,[W,Y]=i.useState();return Jf(()=>{x&&Y(window.getComputedStyle(x).zIndex)},[x]),t.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:z?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Ry,{scope:o,placedSide:L,onArrowChange:S,arrowX:F,arrowY:H,shouldHideArrow:V,children:t.jsx(cp.div,{"data-side":L,"data-align":j,...v,ref:E,style:{...v.style,animation:z?void 0:"none"}})})})});$y.displayName=Py;var Ay="PopperArrow",Ty={top:"bottom",right:"left",bottom:"top",left:"right"},Dy=i.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,i=Oy(Ay,o),a=Ty[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(by,{...r,ref:n,style:{...r.style,display:"block"}})})});function zy(e){return null!==e}Dy.displayName=Ay;var Iy=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,i=0!==r.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[l,c]=Ly(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(r.arrow?.x??0)+a/2,f=(r.arrow?.y??0)+s/2;let p="",h="";return"bottom"===l?(p=i?u:`${d}px`,h=-s+"px"):"top"===l?(p=i?u:`${d}px`,h=`${o.floating.height+s}px`):"right"===l?(p=-s+"px",h=i?u:`${f}px`):"left"===l&&(p=`${o.floating.width+s}px`,h=i?u:`${f}px`),{data:{x:p,y:h}}}});function Ly(e){const[t,n="center"]=e.split("-");return[t,n]}var jy=_y,By=My,Fy=$y,Hy=Dy;function Vy(e){const t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Wy=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"});i.forwardRef((e,n)=>t.jsx(cp.span,{...e,ref:n,style:{...Wy,...e.style}})).displayName="VisuallyHidden";var Yy=[" ","Enter","ArrowUp","ArrowDown"],Xy=[" ","Enter"],Zy="Select",[Ky,qy,Uy]=function(n){const o=n+"CollectionProvider",[r,i]=Gf(o),[a,s]=r(o,{collectionRef:{current:null},itemMap:new Map}),l=n=>{const{scope:o,children:r}=n,i=e.useRef(null),s=e.useRef(new Map).current;return t.jsx(a,{scope:o,itemMap:s,collectionRef:i,children:r})};l.displayName=o;const c=n+"CollectionSlot",u=ip(c),d=e.forwardRef((e,n)=>{const{scope:o,children:r}=e,i=Uf(n,s(c,o).collectionRef);return t.jsx(u,{ref:i,children:r})});d.displayName=c;const f=n+"CollectionItemSlot",p="data-radix-collection-item",h=ip(f),m=e.forwardRef((n,o)=>{const{scope:r,children:i,...a}=n,l=e.useRef(null),c=Uf(o,l),u=s(f,r);return e.useEffect(()=>(u.itemMap.set(l,{ref:l,...a}),()=>{u.itemMap.delete(l)})),t.jsx(h,{[p]:"",ref:c,children:i})});return m.displayName=f,[{Provider:l,Slot:d,ItemSlot:m},function(t){const o=s(n+"CollectionConsumer",t);return e.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},i]}(Zy),[Gy,Qy]=Gf(Zy,[Uy,ky]),Jy=ky(),[ev,tv]=Gy(Zy),[nv,ov]=Gy(Zy),rv=e=>{const{__scopeSelect:n,children:o,open:r,defaultOpen:a,onOpenChange:s,value:l,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:h,required:m,form:g}=e,y=Jy(n),[v,b]=i.useState(null),[x,w]=i.useState(null),[E,k]=i.useState(!1),S=function(e){const t=i.useContext(Mm);return e||t||"ltr"}(d),[C,_]=rp({prop:r,defaultProp:a??!1,onChange:s,caller:Zy}),[N,M]=rp({prop:l,defaultProp:c,onChange:u,caller:Zy}),P=i.useRef(null),R=!v||(g||!!v.closest("form")),[O,$]=i.useState(new Set),A=Array.from(O).map(e=>e.props.value).join(";");return t.jsx(jy,{...y,children:t.jsxs(ev,{required:m,scope:n,trigger:v,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:E,onValueNodeHasChildrenChange:k,contentId:np(),value:N,onValueChange:M,open:C,onOpenChange:_,dir:S,triggerPointerDownPosRef:P,disabled:h,children:[t.jsx(Ky.Provider,{scope:n,children:t.jsx(nv,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback(e=>{$(t=>new Set(t).add(e))},[]),onNativeOptionRemove:i.useCallback(e=>{$(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:o})}),R?t.jsxs(Wv,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:p,value:N,onChange:e=>M(e.target.value),disabled:h,form:g,children:[void 0===N?t.jsx("option",{value:""}):null,Array.from(O)]},A):null]})})};rv.displayName=Zy;var iv="SelectTrigger",av=i.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:r=!1,...a}=e,s=Jy(o),l=tv(iv,o),c=l.disabled||r,u=Uf(n,l.onTriggerChange),d=qy(o),f=i.useRef("touch"),[p,h,m]=Xv(e=>{const t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),o=Zv(t,e,n);void 0!==o&&l.onValueChange(o.value)}),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(By,{asChild:!0,...s,children:t.jsx(cp.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Yv(l.value)?"":void 0,...a,ref:u,onClick:Zf(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:Zf(a.onPointerDown,e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:Zf(a.onKeyDown,e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||Yy.includes(e.key)&&(g(),e.preventDefault())})})})});av.displayName=iv;var sv="SelectValue",lv=i.forwardRef((e,n)=>{const{__scopeSelect:o,className:r,style:i,children:a,placeholder:s="",...l}=e,c=tv(sv,o),{onValueNodeHasChildrenChange:u}=c,d=void 0!==a,f=Uf(n,c.onValueNodeChange);return Jf(()=>{u(d)},[u,d]),t.jsx(cp.span,{...l,ref:f,style:{pointerEvents:"none"},children:Yv(c.value)?t.jsx(t.Fragment,{children:s}):a})});lv.displayName=sv;var cv=i.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,...i}=e;return t.jsx(cp.span,{"aria-hidden":!0,...i,ref:n,children:r||"▼"})});cv.displayName="SelectIcon";var uv=e=>t.jsx(Rp,{asChild:!0,...e});uv.displayName="SelectPortal";var dv="SelectContent",fv=i.forwardRef((e,n)=>{const o=tv(dv,e.__scopeSelect),[r,s]=i.useState();if(Jf(()=>{s(new DocumentFragment)},[]),!o.open){const n=r;return n?a.createPortal(t.jsx(hv,{scope:e.__scopeSelect,children:t.jsx(Ky.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx(yv,{...e,ref:n})});fv.displayName=dv;var pv=10,[hv,mv]=Gy(dv),gv=ip("SelectContent.RemoveScroll"),yv=i.forwardRef((e,n)=>{const{__scopeSelect:o,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=e,x=tv(dv,o),[w,E]=i.useState(null),[k,S]=i.useState(null),C=Uf(n,e=>E(e)),[_,N]=i.useState(null),[M,P]=i.useState(null),R=qy(o),[O,$]=i.useState(!1),A=i.useRef(!1);i.useEffect(()=>{if(w)return Rh(w)},[w]),Tp();const T=i.useCallback(e=>{const[t,...n]=R().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&k&&(k.scrollTop=0),n===o&&k&&(k.scrollTop=k.scrollHeight),n?.focus(),document.activeElement!==r)return}},[R,k]),D=i.useCallback(()=>T([_,w]),[T,_,w]);i.useEffect(()=>{O&&D()},[O,D]);const{onOpenChange:z,triggerPointerDownPosRef:I}=x;i.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||z(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,z,I]),i.useEffect(()=>{const e=()=>z(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);const[L,j]=Xv(e=>{const t=R().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=Zv(t,e,n);o&&setTimeout(()=>o.ref.current.focus())}),B=i.useCallback((e,t,n)=>{const o=!A.current&&!n;(void 0!==x.value&&x.value===t||o)&&(N(e),o&&(A.current=!0))},[x.value]),F=i.useCallback(()=>w?.focus(),[w]),H=i.useCallback((e,t,n)=>{const o=!A.current&&!n;(void 0!==x.value&&x.value===t||o)&&P(e)},[x.value]),V="popper"===r?bv:vv,W=V===bv?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return t.jsx(hv,{scope:o,content:w,viewport:k,onViewportChange:S,itemRefCallback:B,selectedItem:_,onItemLeave:F,itemTextRefCallback:H,focusSelectedItem:D,selectedItemText:M,position:r,isPositioned:O,searchRef:L,children:t.jsx(kh,{as:gv,allowPinchZoom:!0,children:t.jsx(kp,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Zf(a,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(gp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(V,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...W,onPlaced:()=>$(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Zf(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||j(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=R().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>T(t)),e.preventDefault()}})})})})})})});yv.displayName="SelectContentImpl";var vv=i.forwardRef((e,n)=>{const{__scopeSelect:o,onPlaced:r,...a}=e,s=tv(dv,o),l=mv(dv,o),[c,u]=i.useState(null),[d,f]=i.useState(null),p=Uf(n,e=>f(e)),h=qy(o),m=i.useRef(!1),g=i.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=l,w=i.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&y&&v&&b){const e=s.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),o=b.getBoundingClientRect();if("rtl"!==s.dir){const r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,l=Math.max(s,t.width),u=window.innerWidth-pv,d=Nm(i,[pv,Math.max(pv,u-l)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{const r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,l=Math.max(s,t.width),u=window.innerWidth-pv,d=Nm(i,[pv,Math.max(pv,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const i=h(),a=window.innerHeight-2*pv,l=y.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=f+p+l+parseInt(u.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,x),E=window.getComputedStyle(y),k=parseInt(E.paddingTop,10),S=parseInt(E.paddingBottom,10),C=e.top+e.height/2-pv,_=a-C,N=v.offsetHeight/2,M=f+p+(v.offsetTop+N),P=x-M;if(M<=C){const e=i.length>0&&v===i[i.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,n=M+Math.max(_,N+(e?S:0)+t+g);c.style.height=n+"px"}else{const e=i.length>0&&v===i[0].ref.current;c.style.top="0px";const t=Math.max(C,f+y.offsetTop+(e?k:0)+N)+P;c.style.height=t+"px",y.scrollTop=M-C+y.offsetTop}c.style.margin=`${pv}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=a+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,c,d,y,v,b,s.dir,r]);Jf(()=>w(),[w]);const[E,k]=i.useState();Jf(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const S=i.useCallback(e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)},[w,x]);return t.jsx(xv,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:S,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:t.jsx(cp.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});vv.displayName="SelectItemAlignedPosition";var bv=i.forwardRef((e,n)=>{const{__scopeSelect:o,align:r="start",collisionPadding:i=pv,...a}=e,s=Jy(o);return t.jsx(Fy,{...s,...a,ref:n,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)"}})});bv.displayName="SelectPopperPosition";var[xv,wv]=Gy(dv,{}),Ev="SelectViewport",kv=i.forwardRef((e,n)=>{const{__scopeSelect:o,nonce:r,...a}=e,s=mv(Ev,o),l=wv(Ev,o),c=Uf(n,s.onViewportChange),u=i.useRef(0);return t.jsxs(t.Fragment,{children:[t.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}),t.jsx(Ky.Slot,{scope:o,children:t.jsx(cp.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Zf(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=l;if(o?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*pv,r=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),a=Math.max(r,i);if(a<o){const r=a+e,i=Math.min(o,r),s=r-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});kv.displayName=Ev;var Sv="SelectGroup",[Cv,_v]=Gy(Sv);i.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,i=np();return t.jsx(Cv,{scope:o,id:i,children:t.jsx(cp.div,{role:"group","aria-labelledby":i,...r,ref:n})})}).displayName=Sv;var Nv="SelectLabel",Mv=i.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,i=_v(Nv,o);return t.jsx(cp.div,{id:i.id,...r,ref:n})});Mv.displayName=Nv;var Pv="SelectItem",[Rv,Ov]=Gy(Pv),$v=i.forwardRef((e,n)=>{const{__scopeSelect:o,value:r,disabled:a=!1,textValue:s,...l}=e,c=tv(Pv,o),u=mv(Pv,o),d=c.value===r,[f,p]=i.useState(s??""),[h,m]=i.useState(!1),g=Uf(n,e=>u.itemRefCallback?.(e,r,a)),y=np(),v=i.useRef("touch"),b=()=>{a||(c.onValueChange(r),c.onOpenChange(!1))};if(""===r)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(Rv,{scope:o,value:r,disabled:a,textId:y,isSelected:d,onItemTextChange:i.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:t.jsx(Ky.ItemSlot,{scope:o,value:r,disabled:a,textValue:f,children:t.jsx(cp.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:g,onFocus:Zf(l.onFocus,()=>m(!0)),onBlur:Zf(l.onBlur,()=>m(!1)),onClick:Zf(l.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:Zf(l.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:Zf(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Zf(l.onPointerMove,e=>{v.current=e.pointerType,a?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Zf(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Zf(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(Xy.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});$v.displayName=Pv;var Av="SelectItemText",Tv=i.forwardRef((e,n)=>{const{__scopeSelect:o,className:r,style:s,...l}=e,c=tv(Av,o),u=mv(Av,o),d=Ov(Av,o),f=ov(Av,o),[p,h]=i.useState(null),m=Uf(n,e=>h(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=p?.textContent,y=i.useMemo(()=>t.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=f;return Jf(()=>(v(y),()=>b(y)),[v,b,y]),t.jsxs(t.Fragment,{children:[t.jsx(cp.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?a.createPortal(l.children,c.valueNode):null]})});Tv.displayName=Av;var Dv="SelectItemIndicator",zv=i.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return Ov(Dv,o).isSelected?t.jsx(cp.span,{"aria-hidden":!0,...r,ref:n}):null});zv.displayName=Dv;var Iv="SelectScrollUpButton",Lv=i.forwardRef((e,n)=>{const o=mv(Iv,e.__scopeSelect),r=wv(Iv,e.__scopeSelect),[a,s]=i.useState(!1),l=Uf(n,r.onScrollButtonChange);return Jf(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?t.jsx(Fv,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Lv.displayName=Iv;var jv="SelectScrollDownButton",Bv=i.forwardRef((e,n)=>{const o=mv(jv,e.__scopeSelect),r=wv(jv,e.__scopeSelect),[a,s]=i.useState(!1),l=Uf(n,r.onScrollButtonChange);return Jf(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?t.jsx(Fv,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Bv.displayName=jv;var Fv=i.forwardRef((e,n)=>{const{__scopeSelect:o,onAutoScroll:r,...a}=e,s=mv("SelectScrollButton",o),l=i.useRef(null),c=qy(o),u=i.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return i.useEffect(()=>()=>u(),[u]),Jf(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),t.jsx(cp.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:Zf(a.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(r,50))}),onPointerMove:Zf(a.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(r,50))}),onPointerLeave:Zf(a.onPointerLeave,()=>{u()})})}),Hv=i.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return t.jsx(cp.div,{"aria-hidden":!0,...r,ref:n})});Hv.displayName="SelectSeparator";var Vv="SelectArrow";i.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,i=Jy(o),a=tv(Vv,o),s=mv(Vv,o);return a.open&&"popper"===s.position?t.jsx(Hy,{...i,...r,ref:n}):null}).displayName=Vv;var Wv=i.forwardRef(({__scopeSelect:e,value:n,...o},r)=>{const a=i.useRef(null),s=Uf(r,a),l=Vy(n);return i.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,o=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==n&&o){const t=new Event("change",{bubbles:!0});o.call(e,n),e.dispatchEvent(t)}},[l,n]),t.jsx(cp.select,{...o,style:{...Wy,...o.style},ref:s,defaultValue:n})});function Yv(e){return""===e||void 0===e}function Xv(e){const t=up(e),n=i.useRef(""),o=i.useRef(0),r=i.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),a=i.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,a]}function Zv(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0]),r=o?t[0]:t,i=n?e.indexOf(n):-1;let a=function(e,t){return e.map((n,o)=>e[(t+o)%e.length])}(e,Math.max(i,0));1===r.length&&(a=a.filter(e=>e!==n));const s=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return s!==n?s:void 0}Wv.displayName="SelectBubbleInput";var Kv=av,qv=cv,Uv=uv,Gv=fv,Qv=kv,Jv=Mv,eb=$v,tb=Tv,nb=zv,ob=Lv,rb=Bv,ib=Hv;const ab=rv,sb=lv,lb=Su(Kv)`
680
+ `,Xf=({stamps:t,currentStep:n,onStepChange:o,onToggle:r})=>{const{theme:i}=gu(),a=t.length>0?Math.max(...t.map(e=>e.step)):0,s=t.length>0?Math.min(...t.map(e=>e.step)):0,l=a-s+1,c=e=>e<5e3?"latencyLow":e<=3e4?"latencyMedium":"latencyHigh";return e.createElement(Df,{theme:i},e.createElement(zf,{theme:i},e.createElement(If,{theme:i},"Timeline"),r&&e.createElement(Lf,{onClick:r,title:"Collapse Panel",theme:i},e.createElement(Hl,{size:16}))),e.createElement(jf,null,Array.from({length:l},(r,a)=>{const l=s+a,u=l===n,d=l<n,f=t.some(e=>e.step===l),p=(e=>{const n=t.filter(t=>t.step===e);if(0===n.length)return null;const o=e-1,r=t.filter(e=>e.step===o);return 0===r.length?null:Math.min(...n.map(e=>e.time))-Math.max(...r.map(e=>e.time))})(l),h=(e=>{const n=t.filter(t=>t.step===e);return 0===n.length?`Step ${e}`:n[0]?.identifier||`Step ${e}`})(l);return e.createElement(Bf,{key:l,isActive:u,isPast:d,hasStep:f,onClick:()=>f&&o(l),theme:i},e.createElement(Ff,null,e.createElement(Hf,{isActive:u,isPast:d,hasStep:f,theme:i}),e.createElement(Vf,{isActive:u,theme:i},"Step ",l),p&&e.createElement("div",{style:{marginLeft:"auto"}},e.createElement(ju,{variant:c(p)},Mu(p)))),e.createElement(Wf,{hasStep:f,theme:i},f?h:"No activity"),u&&e.createElement(Yf,{theme:i}))})))};function Zf(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}function Kf(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function qf(...e){return t=>{let n=!1;const o=e.map(e=>{const o=Kf(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():Kf(e[t],null)}}}}function Uf(...e){return i.useCallback(qf(...e),e)}function Gf(e,n=[]){let o=[];const r=()=>{const t=o.map(e=>i.createContext(e));return function(n){const o=n?.[e]||t;return i.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return r.scopeName=e,[function(n,r){const a=i.createContext(r),s=o.length;o=[...o,r];const l=n=>{const{scope:o,children:r,...l}=n,c=o?.[e]?.[s]||a,u=i.useMemo(()=>l,Object.values(l));return t.jsx(c.Provider,{value:u,children:r})};return l.displayName=n+"Provider",[l,function(t,o){const l=o?.[e]?.[s]||a,c=i.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},Qf(r,...n)]}function Qf(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]}),{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Jf=globalThis?.document?i.useLayoutEffect:()=>{},ep=i[" useId ".trim().toString()]||(()=>{}),tp=0;function np(e){const[t,n]=i.useState(ep());return Jf(()=>{e||n(e=>e??String(tp++))},[e]),e||(t?`radix-${t}`:"")}var op=i[" useInsertionEffect ".trim().toString()]||Jf;function rp({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,a,s]=function({defaultProp:e,onChange:t}){const[n,o]=i.useState(e),r=i.useRef(n),a=i.useRef(t);return op(()=>{a.current=t},[t]),i.useEffect(()=>{r.current!==n&&(a.current?.(n),r.current=n)},[n,r]),[n,o,a]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:r;{const t=i.useRef(void 0!==e);i.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,o])}const u=i.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[l,e,a,s]);return[c,u]}function ip(e){const n=ap(e),o=i.forwardRef((e,o)=>{const{children:r,...a}=e,s=i.Children.toArray(r),l=s.find(lp);if(l){const e=l.props.children,r=s.map(t=>t===l?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t);return t.jsx(n,{...a,ref:o,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(n,{...a,ref:o,children:r})});return o.displayName=`${e}.Slot`,o}function ap(e){const t=i.forwardRef((e,t)=>{const{children:n,...o}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),r=function(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...e)=>{const t=i(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...i}:"className"===o&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==i.Fragment&&(r.ref=t?qf(t,e):e),i.cloneElement(n,r)}return i.Children.count(n)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sp=Symbol("radix.slottable");function lp(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===sp}var cp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{const o=ip(`Primitive.${n}`),r=i.forwardRef((e,r)=>{const{asChild:i,...a}=e,s=i?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...a,ref:r})});return r.displayName=`Primitive.${n}`,{...e,[n]:r}},{});function up(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...e)=>t.current?.(...e),[])}var dp,fp="dismissableLayer.update",pp="dismissableLayer.pointerDownOutside",hp="dismissableLayer.focusOutside",mp=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gp=i.forwardRef((e,n)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(mp),[f,p]=i.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Uf(n,e=>p(e)),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=f?y.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=x>=b,k=function(e,t=globalThis?.document){const n=up(e),o=i.useRef(!1),r=i.useRef(()=>{});return i.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let o=function(){bp(pp,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",r.current),r.current=o,t.addEventListener("click",r.current,{once:!0})):o()}else t.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...d.branches].some(e=>e.contains(t));E&&!n&&(a?.(e),l?.(e),e.defaultPrevented||c?.())},h),S=function(e,t=globalThis?.document){const n=up(e),o=i.useRef(!1);return i.useEffect(()=>{const e=e=>{if(e.target&&!o.current){bp(hp,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},h);return function(e,t=globalThis?.document){const n=up(e);i.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{x===d.layers.size-1&&(r?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},h),i.useEffect(()=>{if(f)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(dp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),vp(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=dp)}},[f,h,o,d]),i.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),vp())},[f,d]),i.useEffect(()=>{const e=()=>m({});return document.addEventListener(fp,e),()=>document.removeEventListener(fp,e)},[]),t.jsx(cp.div,{...u,ref:g,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:Zf(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Zf(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Zf(e.onPointerDownCapture,k.onPointerDownCapture)})});gp.displayName="DismissableLayer";var yp=i.forwardRef((e,n)=>{const o=i.useContext(mp),r=i.useRef(null),a=Uf(n,r);return i.useEffect(()=>{const e=r.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),t.jsx(cp.div,{...e,ref:a})});function vp(){const e=new CustomEvent(fp);document.dispatchEvent(e)}function bp(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}(r,i):r.dispatchEvent(i)}yp.displayName="DismissableLayerBranch";var xp="focusScope.autoFocusOnMount",wp="focusScope.autoFocusOnUnmount",Ep={bubbles:!1,cancelable:!0},kp=i.forwardRef((e,n)=>{const{loop:o=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...l}=e,[c,u]=i.useState(null),d=up(a),f=up(s),p=i.useRef(null),h=Uf(n,e=>u(e)),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?p.current=t:Np(p.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Np(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Np(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return c&&o.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[r,c,m.paused]),i.useEffect(()=>{if(c){Mp.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(xp,Ep);c.addEventListener(xp,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Np(o,{select:t}),document.activeElement!==n)return}((e=Sp(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Np(c))}return()=>{c.removeEventListener(xp,d),setTimeout(()=>{const e=new CustomEvent(wp,Ep);c.addEventListener(wp,f),c.dispatchEvent(e),e.defaultPrevented||Np(t??document.body,{select:!0}),c.removeEventListener(wp,f),Mp.remove(m)},0)}}var e},[c,d,f,m]);const g=i.useCallback(e=>{if(!o&&!r)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,i]=function(e){const t=Sp(e),n=Cp(t,e),o=Cp(t.reverse(),e);return[n,o]}(t);r&&i?e.shiftKey||n!==i?e.shiftKey&&n===r&&(e.preventDefault(),o&&Np(i,{select:!0})):(e.preventDefault(),o&&Np(r,{select:!0})):n===t&&e.preventDefault()}},[o,r,m.paused]);return t.jsx(cp.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})});function Sp(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Cp(e,t){for(const n of e)if(!_p(n,{upTo:t}))return n}function _p(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Np(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}kp.displayName="FocusScope";var Mp=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Pp(e,t),e.unshift(t)},remove(t){e=Pp(e,t),e[0]?.resume()}}}();function Pp(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var Rp=i.forwardRef((e,o)=>{const{container:r,...a}=e,[s,l]=i.useState(!1);Jf(()=>l(!0),[]);const c=r||s&&globalThis?.document?.body;return c?n.createPortal(t.jsx(cp.div,{...a,ref:o}),c):null});Rp.displayName="Portal";var Op=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=i.useState(),o=i.useRef(null),r=i.useRef(e),a=i.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return i.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const e=$p(o.current);a.current="mounted"===l?e:"none"},[l]),Jf(()=>{const t=o.current,n=r.current;if(n!==e){const o=a.current,i=$p(t);if(e)c("MOUNT");else if("none"===i||"none"===t?.display)c("UNMOUNT");else{c(n&&o!==i?"ANIMATION_OUT":"UNMOUNT")}r.current=e}},[e,c]),Jf(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=i=>{const a=$p(o.current).includes(CSS.escape(i.animationName));if(i.target===t&&a&&(c("ANIMATION_END"),!r.current)){const o=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=o)})}},s=e=>{e.target===t&&(a.current=$p(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),r="function"==typeof n?n({present:o.isPresent}):i.Children.only(n),a=Uf(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(r));return"function"==typeof n||o.isPresent?i.cloneElement(r,{ref:a}):null};function $p(e){return e?.animationName||"none"}Op.displayName="Presence";var Ap=0;function Tp(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Dp()),document.body.insertAdjacentElement("beforeend",e[1]??Dp()),Ap++,()=>{1===Ap&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Ap--}},[])}function Dp(){const 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}var zp=function(){return zp=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},zp.apply(this,arguments)};function Ip(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;var Lp="right-scroll-bar-position",jp="width-before-scroll-bar";function Bp(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Fp="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,Hp=new WeakMap;function Vp(t,n){var o,r,i,a=(o=n||null,r=function(e){return t.forEach(function(t){return Bp(t,e)})},(i=e.useState(function(){return{value:o,callback:r,facade:{get current(){return i.value},set current(e){var t=i.value;t!==e&&(i.value=e,i.callback(e,t))}}}})[0]).callback=r,i.facade);return Fp(function(){var e=Hp.get(a);if(e){var n=new Set(e),o=new Set(t),r=a.current;n.forEach(function(e){o.has(e)||Bp(e,null)}),o.forEach(function(e){n.has(e)||Bp(e,r)})}Hp.set(a,t)},[t]),a}function Wp(e){return e}var Yp=function(e){var t=e.sideCar,n=Ip(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return i.createElement(o,zp({},n))};Yp.isSideCarExport=!0;var Xp=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Wp);var n=[],o=!1,r={read:function(){if(o)throw new 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 r=t(e,o);return n.push(r),function(){n=n.filter(function(e){return e!==r})}},assignSyncMedium:function(e){for(o=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){o=!0;var t=[];if(n.length){var r=n;n=[],r.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return r}(null);return t.options=zp({async:!0,ssr:!1},e),t}(),Zp=function(){},Kp=i.forwardRef(function(e,t){var n=i.useRef(null),o=i.useState({onScrollCapture:Zp,onWheelCapture:Zp,onTouchMoveCapture:Zp}),r=o[0],a=o[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,b=void 0===v?"div":v,x=e.gapMode,w=Ip(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,k=Vp([n,t]),S=zp(zp({},w),r);return i.createElement(i.Fragment,null,d&&i.createElement(E,{sideCar:Xp,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:n,gapMode:x}),s?i.cloneElement(i.Children.only(l),zp(zp({},S),{ref:k})):i.createElement(b,zp({},S,{className:c,ref:k}),l))});Kp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Kp.classNames={fullWidth:jp,zeroRight:Lp};function qp(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Up=function(){var e=0,t=null;return{add:function(n){var o,r;0==e&&(t=qp())&&(r=n,(o=t).styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Gp=function(){var e,t=(e=Up(),function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,o=e.dynamic;return t(n,o),null}},Qp={left:0,top:0,right:0,gap:0},Jp=function(e){return parseInt(e||"",10)||0},eh=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Qp;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],o=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[Jp(n),Jp(o),Jp(r)]}(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},th=Gp(),nh="data-scroll-locked",oh=function(e,t,n,o){var r=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(o,";\n padding-right: ").concat(s,"px ").concat(o,";\n }\n body[").concat(nh,"] {\n overflow: hidden ").concat(o,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(o,";"),"margin"===n&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(o,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Lp," {\n right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(jp," {\n margin-right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Lp," .").concat(Lp," {\n right: 0 ").concat(o,";\n }\n \n .").concat(jp," .").concat(jp," {\n margin-right: 0 ").concat(o,";\n }\n \n body[").concat(nh,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},rh=function(){var e=parseInt(document.body.getAttribute(nh)||"0",10);return isFinite(e)?e:0},ih=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=void 0===o?"margin":o;i.useEffect(function(){return document.body.setAttribute(nh,(rh()+1).toString()),function(){var e=rh()-1;e<=0?document.body.removeAttribute(nh):document.body.setAttribute(nh,e.toString())}},[]);var a=i.useMemo(function(){return eh(r)},[r]);return i.createElement(th,{styles:oh(a,!t,r,n?"":"!important")})},ah=!1;if("undefined"!=typeof window)try{var sh=Object.defineProperty({},"passive",{get:function(){return ah=!0,!0}});window.addEventListener("test",sh,sh),window.removeEventListener("test",sh,sh)}catch(e){ah=!1}var lh=!!ah&&{passive:!1},ch=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},uh=function(e,t){var n=t.ownerDocument,o=t;do{if("undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot&&(o=o.host),dh(e,o)){var r=fh(e,o);if(r[1]>r[2])return!0}o=o.parentNode}while(o&&o!==n.body);return!1},dh=function(e,t){return"v"===e?function(e){return ch(e,"overflowY")}(t):function(e){return ch(e,"overflowX")}(t)},fh=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},ph=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hh=function(e){return[e.deltaX,e.deltaY]},mh=function(e){return e&&"current"in e?e.current:e},gh=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},yh=0,vh=[];function bh(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var xh,wh=(xh=function(e){var t=i.useRef([]),n=i.useRef([0,0]),o=i.useRef(),r=i.useState(yh++)[0],a=i.useState(Gp)[0],s=i.useRef(e);i.useEffect(function(){s.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var t=function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(mh),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var r,i=ph(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=uh(d,u);if(!f)return!0;if(f?r=d:(r="v"===d?"h":"v",f=uh(d,u)),!f)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=r),!r)return!0;var p=o.current||r;return function(e,t,n,o,r){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*o,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,f=0;do{if(!s)break;var p=fh(e,s),h=p[0],m=p[1]-p[2]-i*h;(h||m)&&dh(e,s)&&(d+=m,f+=h);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(r&&Math.abs(d)<1||!r&&a>d)||!u&&(r&&Math.abs(f)<1||!r&&-a>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=i.useCallback(function(e){var n=e;if(vh.length&&vh[vh.length-1]===a){var o="deltaY"in n?hh(n):ph(n),r=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,r=o,t[0]===r[0]&&t[1]===r[1]);var t,r})[0];if(r&&r.should)n.cancelable&&n.preventDefault();else if(!r){var i=(s.current.shards||[]).map(mh).filter(Boolean).filter(function(e){return e.contains(n.target)});(i.length>0?l(n,i[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=i.useCallback(function(e,n,o,r){var i={name:e,delta:n,target:o,should:r,shadowParent:bh(o)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),d=i.useCallback(function(e){n.current=ph(e),o.current=void 0},[]),f=i.useCallback(function(t){u(t.type,hh(t),t.target,l(t,e.lockRef.current))},[]),p=i.useCallback(function(t){u(t.type,ph(t),t.target,l(t,e.lockRef.current))},[]);i.useEffect(function(){return vh.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,lh),document.addEventListener("touchmove",c,lh),document.addEventListener("touchstart",d,lh),function(){vh=vh.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,lh),document.removeEventListener("touchmove",c,lh),document.removeEventListener("touchstart",d,lh)}},[]);var h=e.removeScrollBar,m=e.inert;return i.createElement(i.Fragment,null,m?i.createElement(a,{styles:gh(r)}):null,h?i.createElement(ih,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Xp.useMedium(xh),Yp),Eh=i.forwardRef(function(e,t){return i.createElement(Kp,zp({},e,{ref:t,sideCar:wh}))});Eh.classNames=Kp.classNames;var kh=Eh,Sh=new WeakMap,Ch=new WeakMap,_h={},Nh=0,Mh=function(e){return e&&(e.host||Mh(e.parentNode))},Ph=function(e,t,n,o){var r=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Mh(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);_h[n]||(_h[n]=new WeakMap);var i=_h[n],a=[],s=new Set,l=new Set(r),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};r.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(o),r=null!==t&&"false"!==t,l=(Sh.get(e)||0)+1,c=(i.get(e)||0)+1;Sh.set(e,l),i.set(e,c),a.push(e),1===l&&r&&Ch.set(e,!0),1===c&&e.setAttribute(n,"true"),r||e.setAttribute(o,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),Nh++,function(){a.forEach(function(e){var t=Sh.get(e)-1,r=i.get(e)-1;Sh.set(e,t),i.set(e,r),t||(Ch.has(e)||e.removeAttribute(o),Ch.delete(e)),r||e.removeAttribute(n)}),--Nh||(Sh=new WeakMap,Sh=new WeakMap,Ch=new WeakMap,_h={})}},Rh=function(e,t,n){void 0===n&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Ph(o,r,n,"aria-hidden")):function(){return null}},Oh="Dialog",[$h,Ah]=Gf(Oh),[Th,Dh]=$h(Oh),zh=e=>{const{__scopeDialog:n,children:o,open:r,defaultOpen:a,onOpenChange:s,modal:l=!0}=e,c=i.useRef(null),u=i.useRef(null),[d,f]=rp({prop:r,defaultProp:a??!1,onChange:s,caller:Oh});return t.jsx(Th,{scope:n,triggerRef:c,contentRef:u,contentId:np(),titleId:np(),descriptionId:np(),open:d,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(e=>!e),[f]),modal:l,children:o})};zh.displayName=Oh;var Ih="DialogTrigger",Lh=i.forwardRef((e,n)=>{const{__scopeDialog:o,...r}=e,i=Dh(Ih,o),a=Uf(n,i.triggerRef);return t.jsx(cp.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":rm(i.open),...r,ref:a,onClick:Zf(e.onClick,i.onOpenToggle)})});Lh.displayName=Ih;var jh="DialogPortal",[Bh,Fh]=$h(jh,{forceMount:void 0}),Hh=e=>{const{__scopeDialog:n,forceMount:o,children:r,container:a}=e,s=Dh(jh,n);return t.jsx(Bh,{scope:n,forceMount:o,children:i.Children.map(r,e=>t.jsx(Op,{present:o||s.open,children:t.jsx(Rp,{asChild:!0,container:a,children:e})}))})};Hh.displayName=jh;var Vh="DialogOverlay",Wh=i.forwardRef((e,n)=>{const o=Fh(Vh,e.__scopeDialog),{forceMount:r=o.forceMount,...i}=e,a=Dh(Vh,e.__scopeDialog);return a.modal?t.jsx(Op,{present:r||a.open,children:t.jsx(Xh,{...i,ref:n})}):null});Wh.displayName=Vh;var Yh=ip("DialogOverlay.RemoveScroll"),Xh=i.forwardRef((e,n)=>{const{__scopeDialog:o,...r}=e,i=Dh(Vh,o);return t.jsx(kh,{as:Yh,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(cp.div,{"data-state":rm(i.open),...r,ref:n,style:{pointerEvents:"auto",...r.style}})})}),Zh="DialogContent",Kh=i.forwardRef((e,n)=>{const o=Fh(Zh,e.__scopeDialog),{forceMount:r=o.forceMount,...i}=e,a=Dh(Zh,e.__scopeDialog);return t.jsx(Op,{present:r||a.open,children:a.modal?t.jsx(qh,{...i,ref:n}):t.jsx(Uh,{...i,ref:n})})});Kh.displayName=Zh;var qh=i.forwardRef((e,n)=>{const o=Dh(Zh,e.__scopeDialog),r=i.useRef(null),a=Uf(n,o.contentRef,r);return i.useEffect(()=>{const e=r.current;if(e)return Rh(e)},[]),t.jsx(Gh,{...e,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Zf(e.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Zf(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Zf(e.onFocusOutside,e=>e.preventDefault())})}),Uh=i.forwardRef((e,n)=>{const o=Dh(Zh,e.__scopeDialog),r=i.useRef(!1),a=i.useRef(!1);return t.jsx(Gh,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||o.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const n=t.target,i=o.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),Gh=i.forwardRef((e,n)=>{const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:s,...l}=e,c=Dh(Zh,o),u=i.useRef(null),d=Uf(n,u);return Tp(),t.jsxs(t.Fragment,{children:[t.jsx(kp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:s,children:t.jsx(gp,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":rm(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(lm,{titleId:c.titleId}),t.jsx(cm,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Qh="DialogTitle",Jh=i.forwardRef((e,n)=>{const{__scopeDialog:o,...r}=e,i=Dh(Qh,o);return t.jsx(cp.h2,{id:i.titleId,...r,ref:n})});Jh.displayName=Qh;var em="DialogDescription",tm=i.forwardRef((e,n)=>{const{__scopeDialog:o,...r}=e,i=Dh(em,o);return t.jsx(cp.p,{id:i.descriptionId,...r,ref:n})});tm.displayName=em;var nm="DialogClose",om=i.forwardRef((e,n)=>{const{__scopeDialog:o,...r}=e,i=Dh(nm,o);return t.jsx(cp.button,{type:"button",...r,ref:n,onClick:Zf(e.onClick,()=>i.onOpenChange(!1))})});function rm(e){return e?"open":"closed"}om.displayName=nm;var im="DialogTitleWarning",[am,sm]=function(e,n){const o=i.createContext(n),r=e=>{const{children:n,...r}=e,a=i.useMemo(()=>r,Object.values(r));return t.jsx(o.Provider,{value:a,children:n})};return r.displayName=e+"Provider",[r,function(t){const r=i.useContext(o);if(r)return r;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(im,{contentName:Zh,titleName:Qh,docsSlug:"dialog"}),lm=({titleId:e})=>{const t=sm(im),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},cm=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${sm("DialogDescriptionWarning").contentName}}.`;return i.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");if(t&&o){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},um=zh,dm=Lh,fm=Hh,pm=Wh,hm=Kh,mm=Jh,gm=tm,ym=om;const vm=um,bm=dm,xm=fm,wm=i.forwardRef(({className:e,...t},n)=>i.createElement(pm,{style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"hsla(var(--background), 0.8)",backdropFilter:"blur(4px)"},className:e,...t,ref:n}));wm.displayName=pm.displayName;const Em=(e="right")=>{const t={position:"fixed",zIndex:50,gap:"16px",backgroundColor:"hsl(var(--background))",padding:"24px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",transition:"all 0.3s ease-in-out"};switch(e){case"top":return{...t,left:0,right:0,top:0,borderBottom:"1px solid hsl(var(--border))"};case"bottom":return{...t,left:0,right:0,bottom:0,borderTop:"1px solid hsl(var(--border))"};case"left":return{...t,top:0,bottom:0,left:0,height:"100%",width:"75%",borderRight:"1px solid hsl(var(--border))",maxWidth:"384px"};default:return{...t,top:0,bottom:0,right:0,height:"100%",width:"75%",borderLeft:"1px solid hsl(var(--border))",maxWidth:"384px"}}},km=i.forwardRef(({side:e="right",className:t,children:n,...o},r)=>i.createElement(xm,null,i.createElement(wm,null),i.createElement(hm,{ref:r,style:Em(e),className:t,...o},n,i.createElement(ym,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px"},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},i.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),i.createElement("span",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close")))));km.displayName=hm.displayName;i.forwardRef(({className:e,...t},n)=>i.createElement(mm,{ref:n,style:{fontSize:"18px",fontWeight:600,color:"hsl(var(--foreground))"},className:e,...t})).displayName=mm.displayName;i.forwardRef(({className:e,...t},n)=>i.createElement(gm,{ref:n,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:e,...t})).displayName=gm.displayName;const Sm=(e,t,n={})=>{const{minNodeSpacing:o=200,containerWidth:r=600}=n;if(!e||0===e.length)return new Map;new Map(e.map(e=>[e.identifier,e]));const i=new Map,a=new Map;e.forEach(e=>i.set(e.identifier,[])),t.length>0?t.forEach(e=>{e.source&&e.target&&(i.get(e.source)?.push(e.target),a.set(e.target,e.source))}):e.forEach(e=>{e.parent&&e.parent.identifier!==e.identifier&&(i.get(e.parent.identifier)?.push(e.identifier),a.set(e.identifier,e.parent.identifier))});const s=e.filter(e=>!a.has(e.identifier)),l=new Map,c=(e,t)=>{l.set(e,t);for(const n of i.get(e)||[])c(n,t+1)};s.forEach(e=>c(e.identifier,0));const u=[];e.forEach(e=>{const t=l.get(e.identifier)??0;u[t]||(u[t]=[]),u[t].push(e.identifier)});const d=new Map,f=200,p=Math.max(250,o+50),h=e=>{const t=i.get(e)||[];if(0===t.length)return d.set(e,f),f;let n=0;for(const e of t)n+=h(e);return n+=(t.length-1)*p,d.set(e,n),n};s.forEach(e=>h(e.identifier));const m=new Map,g=Math.max(400,o+200),y=(e,t,n)=>{const o=d.get(e)||f,r=n*g+100,a=i.get(e)||[];if(0===a.length)m.set(e,{x:t+o/2-100,y:r});else{let o=t;for(const e of a){const t=d.get(e)||f;y(e,o,n+1),o+=t+p}const i=a[0],s=a[a.length-1],l=m.get(i),c=m.get(s),u=(l.x+c.x)/2;m.set(e,{x:u,y:r})}};let v=0;for(const e of s)v+=d.get(e.identifier)||f;s.length>1&&(v+=(s.length-1)*p*2);let b=Math.max(0,(r-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const x=o,w=Array.from(m.keys());for(let e=0;e<w.length;e++)for(let t=e+1;t<w.length;t++){const n=m.get(w[e]),o=m.get(w[t]);if(Math.sqrt((o.x-n.x)**2+(o.y-n.y)**2)<x){const e=o.x-n.x,t=o.y-n.y,r=Math.sqrt(e*e+t*t);if(r>0){const i=x/r,a=(e*i-e)/2,s=(t*i-t)/2;n.x-=a,n.y-=s,o.x+=a,o.y+=s}else n.x-=x/2,o.x+=x/2}}return m},Cm={Agent:Tf,Tool:Tf,Coordinator:Tf},_m=({flowData:t,width:n="100%",height:o="1000px",className:r="",defaultZoom:i=1,defaultPan:a={x:0,y:0},disableAutoFit:s=!0,showTimeline:l=!1,minNodeSpacing:c=400,onInspect:u})=>{const{theme:d,isDarkMode:f}=gu(),p=d.colors,h=t;if(!h)return e.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:`1px solid ${p.border}`,borderRadius:"8px",background:p.muted,position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:r},e.createElement("div",{style:{textAlign:"center"}},e.createElement("div",{style:{fontSize:"16px",color:p.mutedForeground,marginBottom:"8px"}},"No flow data available"),e.createElement("div",{style:{fontSize:"14px",color:p.mutedForeground}},"Please provide flowData prop")));const m=e.useRef(null),g=e.useRef(null),[y,v]=e.useState({width:"number"==typeof n?n:1200,height:"number"==typeof o?o:600}),[b,x]=e.useState(0),[w,E]=e.useState(!1),k=e.useRef(null),[S,C]=e.useState(!1),_=e.useMemo(()=>{const e=h.stamps||h.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[h.stamps,h.steps]);e.useEffect(()=>(w?k.current=setInterval(()=>{x(e=>e>=_?(E(!1),e):e+1)},250):k.current&&(clearInterval(k.current),k.current=null),()=>{k.current&&clearInterval(k.current)}),[w,_]),e.useEffect(()=>{const e=h.stamps||h.steps||[];e.length>0&&x(Math.max(...e.map(e=>e.step)))},[h.stamps,h.steps]),e.useEffect(()=>{const e=()=>{if(m.current){const e=m.current.getBoundingClientRect();v({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof o?o:600)})}};if(e(),window.ResizeObserver&&m.current){const t=new ResizeObserver(e);return t.observe(m.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,o]);const N=e.useMemo(()=>{if(!h.nodes)return new Map;const e=Math.max(y.width||800,1200);return Sm(h.nodes,h.edges||[],{minNodeSpacing:c,containerWidth:e})},[h.nodes,h.edges,y.width,c]),M=e.useCallback(e=>h.nodes?h.nodes.filter(t=>t.stamp.step<=e):[],[h.nodes]),P=e.useCallback(e=>(h.edges||[]).filter(t=>t.stamp.step<=e),[h.edges]),R=e.useMemo(()=>{const e=M(b),t=P(b);return e.map(e=>{const n=N.get(e.identifier)||{x:0,y:0},o=e.stamp.step===b,r="Tool"===e.node_type?t.filter(t=>t.target===e.identifier&&t.details).map(e=>e.details):void 0;return{id:e.identifier,type:e.node_type||"Agent",position:n,data:{label:e.name||e.node_type,nodeType:e.node_type,details:e.details,isActive:o,id:e.identifier,edges:t,edgeDetails:r,onInspect:u},style:{filter:o?"drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3))":"none"}}})},[N,b,M,P,u]),O=e.useMemo(()=>P(b).filter(e=>e.source&&e.target).map(e=>{const t=e.stamp.step===b;return{id:e.identifier,type:"smoothstep",source:e.source,target:e.target,animated:t,bidirectional:!0,style:{stroke:t?p.primary:p.mutedForeground,strokeWidth:t?3:2},label:e.stamp?.identifier?Pu(String(e.stamp.identifier),50):void 0,data:{label:e.stamp?.identifier?Pu(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:e.stamp?.step,time:e.stamp?.time,details:e.details}}}),[b,P,p.primary,p.mutedForeground]),[$,A,T]=function(t){const[n,o]=e.useState(t),r=e.useCallback(e=>o(t=>ha(e,t)),[]);return[n,o,r]}(R),[D,z,I]=function(t){const[n,o]=e.useState(t),r=e.useCallback(e=>o(t=>ma(e,t)),[]);return[n,o,r]}(O);e.useEffect(()=>{A(R)},[R,A]),e.useEffect(()=>{z(O)},[O,z]);const L=e.useCallback(e=>z(t=>xr(e,t)),[z]),j=e.useCallback(e=>{x(e),E(!1)},[]);e.useCallback(()=>{E(e=>!e)},[]);const B=(e,t)=>{if(!g.current)return{x:0,y:0};const n=g.current.createSVGPoint();n.x=e,n.y=t;const o=n.matrixTransform(g.current.getScreenCTM()?.inverse());return{x:o.x,y:o.y}},F=Na();return e.useEffect(()=>{if(s||!F||0===R.length)return;const e=new Map;O.forEach(t=>{const n=e.get(t.source)||0;e.set(t.source,n+1);const o=e.get(t.target)||0;e.set(t.target,o+1)});let t="",n=0;e.forEach((e,o)=>{e>n&&(n=e,t=o)}),!t&&R.length>0&&(t=R[0].id),t&&setTimeout(()=>{F.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:i,maxZoom:1})},500)},[R,O,F,s,i]),e.createElement("div",{ref:m,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:`1px solid ${p.border}`,borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px",background:p.background},className:r},l&&e.createElement(vm,{open:S,onOpenChange:C},e.createElement(bm,{asChild:!0},e.createElement("button",{style:{position:"absolute",top:"16px",left:"16px",zIndex:50,width:"40px",height:"40px",backgroundColor:p.card,border:`1px solid ${p.border}`,borderRadius:"8px",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease-in-out",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=p.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=p.card},title:"Open Timeline"},e.createElement(Hl,{size:20,style:{color:p.mutedForeground}}))),e.createElement(xm,null,e.createElement(hm,{style:{position:"fixed",top:0,bottom:0,left:0,height:"100%",width:"280px",zIndex:50,backgroundColor:p.background,borderRight:`1px solid ${p.border}`,boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",transition:"all 0.3s ease-in-out",padding:0},onPointerDownOutside:e=>e.preventDefault()},e.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%"}},e.createElement("div",{style:{flex:1,overflowY:"auto"}},e.createElement(Xf,{stamps:h.stamps||h.steps||[],currentStep:b,onStepChange:j}))),e.createElement(ym,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px",color:p.mutedForeground},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},e.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),e.createElement("span",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close"))))),e.createElement(il,{colorMode:f?"dark":"light",nodes:$,edges:D,onNodesChange:T,onEdgesChange:I,onConnect:L,nodeTypes:Cm,edgeTypes:{smoothstep:t=>e.createElement(yu,{...t,clientToSvgCoords:B,svgRef:g})},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:a.x,y:a.y,zoom:i},onInit:()=>{if(m.current){const e=m.current.querySelector("svg");e&&(g.current=e)}}},e.createElement(dl,{variant:rl.Lines,color:p.mutedBorder,gap:16})),e.createElement("style",null,`\n .react-flow__edge-label {\n font-size: 10px;\n background: ${p.card};\n color: ${p.cardForeground};\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid ${p.border};\n max-width: 150px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .react-flow__edge {\n cursor: default !important;\n }\n\n .react-flow__edge-path {\n cursor: default !important;\n }\n `))};function Nm(e,[t,n]){return Math.min(n,Math.max(t,e))}var Mm=i.createContext(void 0);const Pm=["top","right","bottom","left"],Rm=Math.min,Om=Math.max,$m=Math.round,Am=Math.floor,Tm=e=>({x:e,y:e}),Dm={left:"right",right:"left",bottom:"top",top:"bottom"},zm={start:"end",end:"start"};function Im(e,t,n){return Om(e,Rm(t,n))}function Lm(e,t){return"function"==typeof e?e(t):e}function jm(e){return e.split("-")[0]}function Bm(e){return e.split("-")[1]}function Fm(e){return"x"===e?"y":"x"}function Hm(e){return"y"===e?"height":"width"}const Vm=new Set(["top","bottom"]);function Wm(e){return Vm.has(jm(e))?"y":"x"}function Ym(e){return Fm(Wm(e))}function Xm(e){return e.replace(/start|end/g,e=>zm[e])}const Zm=["left","right"],Km=["right","left"],qm=["top","bottom"],Um=["bottom","top"];function Gm(e,t,n,o){const r=Bm(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Km:Zm:t?Zm:Km;case"left":case"right":return t?qm:Um;default:return[]}}(jm(e),"start"===n,o);return r&&(i=i.map(e=>e+"-"+r),t&&(i=i.concat(i.map(Xm)))),i}function Qm(e){return e.replace(/left|right|bottom|top/g,e=>Dm[e])}function Jm(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function eg(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function tg(e,t,n){let{reference:o,floating:r}=e;const i=Wm(t),a=Ym(t),s=Hm(a),l=jm(t),c="y"===i,u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[s]/2-r[s]/2;let p;switch(l){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(Bm(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1)}return p}async function ng(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Lm(t,e),h=Jm(p),m=s[f?"floating"===d?"reference":"floating":d],g=eg(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},x=eg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.x}}function og(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rg(e){return Pm.some(t=>e[t]>=0)}const ig=new Set(["left","top"]);function ag(){return"undefined"!=typeof window}function sg(e){return ug(e)?(e.nodeName||"").toLowerCase():"#document"}function lg(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function cg(e){var t;return null==(t=(ug(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ug(e){return!!ag()&&(e instanceof Node||e instanceof lg(e).Node)}function dg(e){return!!ag()&&(e instanceof Element||e instanceof lg(e).Element)}function fg(e){return!!ag()&&(e instanceof HTMLElement||e instanceof lg(e).HTMLElement)}function pg(e){return!(!ag()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof lg(e).ShadowRoot)}const hg=new Set(["inline","contents"]);function mg(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ng(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!hg.has(r)}const gg=new Set(["table","td","th"]);function yg(e){return gg.has(sg(e))}const vg=[":popover-open",":modal"];function bg(e){return vg.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const xg=["transform","translate","scale","rotate","perspective"],wg=["transform","translate","scale","rotate","perspective","filter"],Eg=["paint","layout","strict","content"];function kg(e){const t=Sg(),n=dg(e)?Ng(e):e;return xg.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||wg.some(e=>(n.willChange||"").includes(e))||Eg.some(e=>(n.contain||"").includes(e))}function Sg(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Cg=new Set(["html","body","#document"]);function _g(e){return Cg.has(sg(e))}function Ng(e){return lg(e).getComputedStyle(e)}function Mg(e){return dg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pg(e){if("html"===sg(e))return e;const t=e.assignedSlot||e.parentNode||pg(e)&&e.host||cg(e);return pg(t)?t.host:t}function Rg(e){const t=Pg(e);return _g(t)?e.ownerDocument?e.ownerDocument.body:e.body:fg(t)&&mg(t)?t:Rg(t)}function Og(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Rg(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),a=lg(r);if(i){const e=$g(a);return t.concat(a,a.visualViewport||[],mg(r)?r:[],e&&n?Og(e):[])}return t.concat(r,Og(r,[],n))}function $g(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ag(e){const t=Ng(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=fg(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,s=$m(n)!==i||$m(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function Tg(e){return dg(e)?e:e.contextElement}function Dg(e){const t=Tg(e);if(!fg(t))return Tm(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Ag(t);let a=(i?$m(n.width):n.width)/o,s=(i?$m(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const zg=Tm(0);function Ig(e){const t=lg(e);return Sg()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:zg}function Lg(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=Tg(e);let a=Tm(1);t&&(o?dg(o)&&(a=Dg(o)):a=Dg(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==lg(e))&&t}(i,n,o)?Ig(i):Tm(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(i){const e=lg(i),t=o&&dg(o)?lg(o):o;let n=e,r=$g(n);for(;r&&o&&t!==n;){const e=Dg(r),t=r.getBoundingClientRect(),o=Ng(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=lg(r),r=$g(n)}}return eg({width:u,height:d,x:l,y:c})}function jg(e,t){const n=Mg(e).scrollLeft;return t?t.left+n:Lg(cg(e)).left+n}function Bg(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jg(e,n),y:n.top+t.scrollTop}}const Fg=new Set(["absolute","fixed"]);function Hg(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=lg(e),o=cg(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;const e=Sg();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=jg(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(o.clientWidth-t.clientWidth-r);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=cg(e),n=Mg(e),o=e.ownerDocument.body,r=Om(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Om(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+jg(e);const s=-n.scrollTop;return"rtl"===Ng(o).direction&&(a+=Om(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:s}}(cg(e));else if(dg(t))o=function(e,t){const n=Lg(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=fg(e)?Dg(e):Tm(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=Ig(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return eg(o)}function Vg(e,t){const n=Pg(e);return!(n===t||!dg(n)||_g(n))&&("fixed"===Ng(n).position||Vg(n,t))}function Wg(e,t,n){const o=fg(t),r=cg(t),i="fixed"===n,a=Lg(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Tm(0);function c(){l.x=jg(r)}if(o||!o&&!i)if(("body"!==sg(t)||mg(r))&&(s=Mg(t)),o){const e=Lg(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&c();i&&!o&&r&&c();const u=!r||o||i?Tm(0):Bg(r,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function Yg(e){return"static"===Ng(e).position}function Xg(e,t){if(!fg(e)||"fixed"===Ng(e).position)return null;if(t)return t(e);let n=e.offsetParent;return cg(e)===n&&(n=n.ownerDocument.body),n}function Zg(e,t){const n=lg(e);if(bg(e))return n;if(!fg(e)){let t=Pg(e);for(;t&&!_g(t);){if(dg(t)&&!Yg(t))return t;t=Pg(t)}return n}let o=Xg(e,t);for(;o&&yg(o)&&Yg(o);)o=Xg(o,t);return o&&_g(o)&&Yg(o)&&!kg(o)?n:o||function(e){let t=Pg(e);for(;fg(t)&&!_g(t);){if(kg(t))return t;if(bg(t))return null;t=Pg(t)}return null}(e)||n}const Kg={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,a=cg(o),s=!!t&&bg(t.floating);if(o===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Tm(1);const u=Tm(0),d=fg(o);if((d||!d&&!i)&&(("body"!==sg(o)||mg(a))&&(l=Mg(o)),fg(o))){const e=Lg(o);c=Dg(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const f=!a||d||i?Tm(0):Bg(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:cg,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i="clippingAncestors"===n?bg(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Og(e,[],!1).filter(e=>dg(e)&&"body"!==sg(e)),r=null;const i="fixed"===Ng(e).position;let a=i?Pg(e):e;for(;dg(a)&&!_g(a);){const t=Ng(a),n=kg(a);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&Fg.has(r.position)||mg(a)&&!n&&Vg(e,a))?o=o.filter(e=>e!==a):r=t,a=Pg(a)}return t.set(e,o),o}(t,this._c):[].concat(n),a=[...i,o],s=a[0],l=a.reduce((e,n)=>{const o=Hg(t,n,r);return e.top=Om(o.top,e.top),e.right=Rm(o.right,e.right),e.bottom=Rm(o.bottom,e.bottom),e.left=Om(o.left,e.left),e},Hg(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Zg,getElementRects:async function(e){const t=this.getOffsetParent||Zg,n=this.getDimensions,o=await n(e.floating);return{reference:Wg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ag(e);return{width:t,height:n}},getScale:Dg,isElement:dg,isRTL:function(e){return"rtl"===Ng(e).direction}};function qg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ug(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=Tg(e),u=r||i?[...c?Og(c):[],...Og(t)]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,o=null;const r=cg(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const h={rootMargin:-Am(d)+"px "+-Am(r.clientWidth-(u+f))+"px "+-Am(r.clientHeight-(d+p))+"px "+-Am(u)+"px",threshold:Om(0,Rm(1,l))||1};let m=!0;function g(t){const o=t[0].intersectionRatio;if(o!==l){if(!m)return a();o?a(!1,o):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==o||qg(c,e.getBoundingClientRect())||a(),m=!1}try{o=new IntersectionObserver(g,{...h,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,h)}o.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;a&&(h=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?Lg(e):null;return l&&function t(){const o=Lg(e);m&&!qg(m,o)&&n();m=o,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Gg=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),a=jm(n),s=Bm(n),l="y"===Wm(n),c=ig.has(a)?-1:1,u=i&&l?-1:1,d=Lm(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}},Qg=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Lm(e,t),c={x:n,y:o},u=await ng(t,l),d=Wm(jm(r)),f=Fm(d);let p=c[f],h=c[d];if(i){const e="y"===f?"bottom":"right";p=Im(p+u["y"===f?"top":"left"],p,p-u[e])}if(a){const e="y"===d?"bottom":"right";h=Im(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[f]:i,[d]:a}}}}}},Jg=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Lm(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=jm(r),v=Wm(s),b=jm(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[Qm(s)]:function(e){const t=Qm(e);return[Xm(e),t,Xm(t)]}(s)),E="none"!==h;!f&&E&&w.push(...Gm(s,m,h,x));const k=[s,...w],S=await ng(t,g),C=[];let _=(null==(o=i.flip)?void 0:o.overflows)||[];if(u&&C.push(S[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=Bm(e),r=Ym(e),i=Hm(r);let a="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Qm(a)),[a,Qm(a)]}(r,a,x);C.push(S[e[0]],S[e[1]])}if(_=[..._,{placement:r,overflows:C}],!C.every(e=>e<=0)){var N,M;const e=((null==(N=i.flip)?void 0:N.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&v!==Wm(t))||_.every(e=>Wm(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:_},reset:{placement:t}}}let n=null==(M=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=_.filter(e=>{if(E){const t=Wm(e.placement);return t===v||"y"===t}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])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},ey=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=Lm(e,t),u=await ng(t,c),d=jm(r),f=Bm(r),p="y"===Wm(r),{width:h,height:m}=i.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=m-u.top-u.bottom,b=h-u.left-u.right,x=Rm(m-u[g],v),w=Rm(h-u[y],b),E=!t.middlewareData.shift;let k=x,S=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=b),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(k=v),E&&!f){const e=Om(u.left,0),t=Om(u.right,0),n=Om(u.top,0),o=Om(u.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:Om(u.left,u.right)):k=m-2*(0!==n||0!==o?n+o:Om(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:k});const C=await a.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},ty=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Lm(e,t);switch(o){case"referenceHidden":{const e=og(await ng(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:rg(e)}}}case"escaped":{const e=og(await ng(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:rg(e)}}}default:return{}}}}},ny=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Lm(e,t)||{};if(null==c)return{};const d=Jm(u),f={x:n,y:o},p=Ym(r),h=Hm(p),m=await a.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[p]-f[p]-i.floating[h],w=f[p]-i.reference[p],E=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let k=E?E[b]:0;k&&await(null==a.isElement?void 0:a.isElement(E))||(k=s.floating[b]||i.floating[h]);const S=x/2-w/2,C=k/2-m[h]/2-1,_=Rm(d[y],C),N=Rm(d[v],C),M=_,P=k-m[h]-N,R=k/2-m[h]/2+S,O=Im(M,R,P),$=!l.arrow&&null!=Bm(r)&&R!==O&&i.reference[h]/2-(R<M?_:N)-m[h]/2<0,A=$?R<M?R-M:R-P:0;return{[p]:f[p]+A,data:{[p]:O,centerOffset:R-O-A,...$&&{alignmentOffset:A}},reset:$}}}),oy=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Lm(e,t),u={x:n,y:o},d=Wm(r),f=Fm(d);let p=u[f],h=u[d];const m=Lm(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,n=i.reference[f]+i.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,v;const e="y"===f?"width":"height",t=ig.has(jm(r)),n=i.reference[d]-i.floating[e]+(t&&(null==(y=a.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),o=i.reference[d]+i.reference[e]+(t?0:(null==(v=a.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>o&&(h=o)}return{[f]:p,[d]:h}}}},ry=(e,t,n)=>{const o=new Map,r={platform:Kg,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=tg(c,o,l),f=o,p={},h=0;for(let n=0;n<s.length;n++){const{name:i,fn:m}=s[n],{x:g,y:y,data:v,reset:b}=await m({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,p={...p,[i]:{...p[i],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:u,y:d}=tg(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var iy="undefined"!=typeof document?e.useLayoutEffect:function(){};function ay(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!ay(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!ay(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function sy(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ly(e,t){const n=sy(e);return Math.round(t*n)/n}function cy(e){const t=i.useRef(e);return iy(()=>{t.current=e}),t}const uy=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:o}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?ny({element:n.current,padding:o}).fn(t):{}:n?ny({element:n,padding:o}).fn(t):{};var r}}),dy=(e,t)=>({...Gg(e),options:[e,t]}),fy=(e,t)=>({...Qg(e),options:[e,t]}),py=(e,t)=>({...oy(e),options:[e,t]}),hy=(e,t)=>({...Jg(e),options:[e,t]}),my=(e,t)=>({...ey(e),options:[e,t]}),gy=(e,t)=>({...ty(e),options:[e,t]}),yy=(e,t)=>({...uy(e),options:[e,t]});var vy=i.forwardRef((e,n)=>{const{children:o,width:r=10,height:i=5,...a}=e;return t.jsx(cp.svg,{...a,ref:n,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});vy.displayName="Arrow";var by=vy;function xy(e){const[t,n]=i.useState(void 0);return Jf(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,i;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var wy="Popper",[Ey,ky]=Gf(wy),[Sy,Cy]=Ey(wy),_y=e=>{const{__scopePopper:n,children:o}=e,[r,a]=i.useState(null);return t.jsx(Sy,{scope:n,anchor:r,onAnchorChange:a,children:o})};_y.displayName=wy;var Ny="PopperAnchor",My=i.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:r,...a}=e,s=Cy(Ny,o),l=i.useRef(null),c=Uf(n,l),u=i.useRef(null);return i.useEffect(()=>{const e=u.current;u.current=r?.current||l.current,e!==u.current&&s.onAnchorChange(u.current)}),r?null:t.jsx(cp.div,{...a,ref:c})});My.displayName=Ny;var Py="PopperContent",[Ry,Oy]=Ey(Py),$y=i.forwardRef((e,n)=>{const{__scopePopper:o,side:r="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,b=Cy(Py,o),[x,w]=i.useState(null),E=Uf(n,e=>w(e)),[k,S]=i.useState(null),C=xy(k),_=C?.width??0,N=C?.height??0,M=r+("center"!==l?"-"+l:""),P="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},R=Array.isArray(f)?f:[f],O=R.length>0,$={padding:P,boundary:R.filter(zy),altBoundary:O},{refs:A,floatingStyles:T,placement:D,isPositioned:z,middlewareData:I}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,p]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=i.useState(o);ay(h,o)||m(o);const[g,y]=i.useState(null),[v,b]=i.useState(null),x=i.useCallback(e=>{e!==S.current&&(S.current=e,y(e))},[]),w=i.useCallback(e=>{e!==C.current&&(C.current=e,b(e))},[]),E=s||g,k=l||v,S=i.useRef(null),C=i.useRef(null),_=i.useRef(f),N=null!=u,M=cy(u),P=cy(r),R=cy(d),O=i.useCallback(()=>{if(!S.current||!C.current)return;const e={placement:t,strategy:n,middleware:h};P.current&&(e.platform=P.current),ry(S.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==R.current};$.current&&!ay(_.current,t)&&(_.current=t,a.flushSync(()=>{p(t)}))})},[h,t,n,P,R]);iy(()=>{!1===d&&_.current.isPositioned&&(_.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const $=i.useRef(!1);iy(()=>($.current=!0,()=>{$.current=!1}),[]),iy(()=>{if(E&&(S.current=E),k&&(C.current=k),E&&k){if(M.current)return M.current(E,k,O);O()}},[E,k,O,M,N]);const A=i.useMemo(()=>({reference:S,floating:C,setReference:x,setFloating:w}),[x,w]),T=i.useMemo(()=>({reference:E,floating:k}),[E,k]),D=i.useMemo(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=ly(T.floating,f.x),o=ly(T.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+o+"px)",...sy(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}},[n,c,T.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:O,refs:A,elements:T,floatingStyles:D}),[f,O,A,T,D])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>Ug(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[dy({mainAxis:s+N,alignmentAxis:c}),d&&fy({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?py():void 0,...$}),d&&hy({...$}),my({...$,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${r}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),k&&yy({element:k,padding:u}),Iy({arrowWidth:_,arrowHeight:N}),m&&gy({strategy:"referenceHidden",...$})]}),[L,j]=Ly(D),B=up(y);Jf(()=>{z&&B?.()},[z,B]);const F=I.arrow?.x,H=I.arrow?.y,V=0!==I.arrow?.centerOffset,[W,Y]=i.useState();return Jf(()=>{x&&Y(window.getComputedStyle(x).zIndex)},[x]),t.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:z?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Ry,{scope:o,placedSide:L,onArrowChange:S,arrowX:F,arrowY:H,shouldHideArrow:V,children:t.jsx(cp.div,{"data-side":L,"data-align":j,...v,ref:E,style:{...v.style,animation:z?void 0:"none"}})})})});$y.displayName=Py;var Ay="PopperArrow",Ty={top:"bottom",right:"left",bottom:"top",left:"right"},Dy=i.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,i=Oy(Ay,o),a=Ty[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(by,{...r,ref:n,style:{...r.style,display:"block"}})})});function zy(e){return null!==e}Dy.displayName=Ay;var Iy=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,i=0!==r.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[l,c]=Ly(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(r.arrow?.x??0)+a/2,f=(r.arrow?.y??0)+s/2;let p="",h="";return"bottom"===l?(p=i?u:`${d}px`,h=-s+"px"):"top"===l?(p=i?u:`${d}px`,h=`${o.floating.height+s}px`):"right"===l?(p=-s+"px",h=i?u:`${f}px`):"left"===l&&(p=`${o.floating.width+s}px`,h=i?u:`${f}px`),{data:{x:p,y:h}}}});function Ly(e){const[t,n="center"]=e.split("-");return[t,n]}var jy=_y,By=My,Fy=$y,Hy=Dy;function Vy(e){const t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Wy=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"});i.forwardRef((e,n)=>t.jsx(cp.span,{...e,ref:n,style:{...Wy,...e.style}})).displayName="VisuallyHidden";var Yy=[" ","Enter","ArrowUp","ArrowDown"],Xy=[" ","Enter"],Zy="Select",[Ky,qy,Uy]=function(n){const o=n+"CollectionProvider",[r,i]=Gf(o),[a,s]=r(o,{collectionRef:{current:null},itemMap:new Map}),l=n=>{const{scope:o,children:r}=n,i=e.useRef(null),s=e.useRef(new Map).current;return t.jsx(a,{scope:o,itemMap:s,collectionRef:i,children:r})};l.displayName=o;const c=n+"CollectionSlot",u=ip(c),d=e.forwardRef((e,n)=>{const{scope:o,children:r}=e,i=Uf(n,s(c,o).collectionRef);return t.jsx(u,{ref:i,children:r})});d.displayName=c;const f=n+"CollectionItemSlot",p="data-radix-collection-item",h=ip(f),m=e.forwardRef((n,o)=>{const{scope:r,children:i,...a}=n,l=e.useRef(null),c=Uf(o,l),u=s(f,r);return e.useEffect(()=>(u.itemMap.set(l,{ref:l,...a}),()=>{u.itemMap.delete(l)})),t.jsx(h,{[p]:"",ref:c,children:i})});return m.displayName=f,[{Provider:l,Slot:d,ItemSlot:m},function(t){const o=s(n+"CollectionConsumer",t);return e.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},i]}(Zy),[Gy,Qy]=Gf(Zy,[Uy,ky]),Jy=ky(),[ev,tv]=Gy(Zy),[nv,ov]=Gy(Zy),rv=e=>{const{__scopeSelect:n,children:o,open:r,defaultOpen:a,onOpenChange:s,value:l,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:h,required:m,form:g}=e,y=Jy(n),[v,b]=i.useState(null),[x,w]=i.useState(null),[E,k]=i.useState(!1),S=function(e){const t=i.useContext(Mm);return e||t||"ltr"}(d),[C,_]=rp({prop:r,defaultProp:a??!1,onChange:s,caller:Zy}),[N,M]=rp({prop:l,defaultProp:c,onChange:u,caller:Zy}),P=i.useRef(null),R=!v||(g||!!v.closest("form")),[O,$]=i.useState(new Set),A=Array.from(O).map(e=>e.props.value).join(";");return t.jsx(jy,{...y,children:t.jsxs(ev,{required:m,scope:n,trigger:v,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:E,onValueNodeHasChildrenChange:k,contentId:np(),value:N,onValueChange:M,open:C,onOpenChange:_,dir:S,triggerPointerDownPosRef:P,disabled:h,children:[t.jsx(Ky.Provider,{scope:n,children:t.jsx(nv,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback(e=>{$(t=>new Set(t).add(e))},[]),onNativeOptionRemove:i.useCallback(e=>{$(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:o})}),R?t.jsxs(Wv,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:p,value:N,onChange:e=>M(e.target.value),disabled:h,form:g,children:[void 0===N?t.jsx("option",{value:""}):null,Array.from(O)]},A):null]})})};rv.displayName=Zy;var iv="SelectTrigger",av=i.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:r=!1,...a}=e,s=Jy(o),l=tv(iv,o),c=l.disabled||r,u=Uf(n,l.onTriggerChange),d=qy(o),f=i.useRef("touch"),[p,h,m]=Xv(e=>{const t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),o=Zv(t,e,n);void 0!==o&&l.onValueChange(o.value)}),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(By,{asChild:!0,...s,children:t.jsx(cp.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Yv(l.value)?"":void 0,...a,ref:u,onClick:Zf(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:Zf(a.onPointerDown,e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:Zf(a.onKeyDown,e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||Yy.includes(e.key)&&(g(),e.preventDefault())})})})});av.displayName=iv;var sv="SelectValue",lv=i.forwardRef((e,n)=>{const{__scopeSelect:o,className:r,style:i,children:a,placeholder:s="",...l}=e,c=tv(sv,o),{onValueNodeHasChildrenChange:u}=c,d=void 0!==a,f=Uf(n,c.onValueNodeChange);return Jf(()=>{u(d)},[u,d]),t.jsx(cp.span,{...l,ref:f,style:{pointerEvents:"none"},children:Yv(c.value)?t.jsx(t.Fragment,{children:s}):a})});lv.displayName=sv;var cv=i.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,...i}=e;return t.jsx(cp.span,{"aria-hidden":!0,...i,ref:n,children:r||"▼"})});cv.displayName="SelectIcon";var uv=e=>t.jsx(Rp,{asChild:!0,...e});uv.displayName="SelectPortal";var dv="SelectContent",fv=i.forwardRef((e,n)=>{const o=tv(dv,e.__scopeSelect),[r,s]=i.useState();if(Jf(()=>{s(new DocumentFragment)},[]),!o.open){const n=r;return n?a.createPortal(t.jsx(hv,{scope:e.__scopeSelect,children:t.jsx(Ky.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx(yv,{...e,ref:n})});fv.displayName=dv;var pv=10,[hv,mv]=Gy(dv),gv=ip("SelectContent.RemoveScroll"),yv=i.forwardRef((e,n)=>{const{__scopeSelect:o,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=e,x=tv(dv,o),[w,E]=i.useState(null),[k,S]=i.useState(null),C=Uf(n,e=>E(e)),[_,N]=i.useState(null),[M,P]=i.useState(null),R=qy(o),[O,$]=i.useState(!1),A=i.useRef(!1);i.useEffect(()=>{if(w)return Rh(w)},[w]),Tp();const T=i.useCallback(e=>{const[t,...n]=R().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&k&&(k.scrollTop=0),n===o&&k&&(k.scrollTop=k.scrollHeight),n?.focus(),document.activeElement!==r)return}},[R,k]),D=i.useCallback(()=>T([_,w]),[T,_,w]);i.useEffect(()=>{O&&D()},[O,D]);const{onOpenChange:z,triggerPointerDownPosRef:I}=x;i.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||z(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,z,I]),i.useEffect(()=>{const e=()=>z(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);const[L,j]=Xv(e=>{const t=R().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=Zv(t,e,n);o&&setTimeout(()=>o.ref.current.focus())}),B=i.useCallback((e,t,n)=>{const o=!A.current&&!n;(void 0!==x.value&&x.value===t||o)&&(N(e),o&&(A.current=!0))},[x.value]),F=i.useCallback(()=>w?.focus(),[w]),H=i.useCallback((e,t,n)=>{const o=!A.current&&!n;(void 0!==x.value&&x.value===t||o)&&P(e)},[x.value]),V="popper"===r?bv:vv,W=V===bv?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return t.jsx(hv,{scope:o,content:w,viewport:k,onViewportChange:S,itemRefCallback:B,selectedItem:_,onItemLeave:F,itemTextRefCallback:H,focusSelectedItem:D,selectedItemText:M,position:r,isPositioned:O,searchRef:L,children:t.jsx(kh,{as:gv,allowPinchZoom:!0,children:t.jsx(kp,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Zf(a,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(gp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(V,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...W,onPlaced:()=>$(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Zf(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||j(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=R().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>T(t)),e.preventDefault()}})})})})})})});yv.displayName="SelectContentImpl";var vv=i.forwardRef((e,n)=>{const{__scopeSelect:o,onPlaced:r,...a}=e,s=tv(dv,o),l=mv(dv,o),[c,u]=i.useState(null),[d,f]=i.useState(null),p=Uf(n,e=>f(e)),h=qy(o),m=i.useRef(!1),g=i.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=l,w=i.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&y&&v&&b){const e=s.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),o=b.getBoundingClientRect();if("rtl"!==s.dir){const r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,l=Math.max(s,t.width),u=window.innerWidth-pv,d=Nm(i,[pv,Math.max(pv,u-l)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{const r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,l=Math.max(s,t.width),u=window.innerWidth-pv,d=Nm(i,[pv,Math.max(pv,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const i=h(),a=window.innerHeight-2*pv,l=y.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=f+p+l+parseInt(u.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,x),E=window.getComputedStyle(y),k=parseInt(E.paddingTop,10),S=parseInt(E.paddingBottom,10),C=e.top+e.height/2-pv,_=a-C,N=v.offsetHeight/2,M=f+p+(v.offsetTop+N),P=x-M;if(M<=C){const e=i.length>0&&v===i[i.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,n=M+Math.max(_,N+(e?S:0)+t+g);c.style.height=n+"px"}else{const e=i.length>0&&v===i[0].ref.current;c.style.top="0px";const t=Math.max(C,f+y.offsetTop+(e?k:0)+N)+P;c.style.height=t+"px",y.scrollTop=M-C+y.offsetTop}c.style.margin=`${pv}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=a+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,c,d,y,v,b,s.dir,r]);Jf(()=>w(),[w]);const[E,k]=i.useState();Jf(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const S=i.useCallback(e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)},[w,x]);return t.jsx(xv,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:S,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:t.jsx(cp.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});vv.displayName="SelectItemAlignedPosition";var bv=i.forwardRef((e,n)=>{const{__scopeSelect:o,align:r="start",collisionPadding:i=pv,...a}=e,s=Jy(o);return t.jsx(Fy,{...s,...a,ref:n,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)"}})});bv.displayName="SelectPopperPosition";var[xv,wv]=Gy(dv,{}),Ev="SelectViewport",kv=i.forwardRef((e,n)=>{const{__scopeSelect:o,nonce:r,...a}=e,s=mv(Ev,o),l=wv(Ev,o),c=Uf(n,s.onViewportChange),u=i.useRef(0);return t.jsxs(t.Fragment,{children:[t.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}),t.jsx(Ky.Slot,{scope:o,children:t.jsx(cp.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Zf(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=l;if(o?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*pv,r=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),a=Math.max(r,i);if(a<o){const r=a+e,i=Math.min(o,r),s=r-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});kv.displayName=Ev;var Sv="SelectGroup",[Cv,_v]=Gy(Sv);i.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,i=np();return t.jsx(Cv,{scope:o,id:i,children:t.jsx(cp.div,{role:"group","aria-labelledby":i,...r,ref:n})})}).displayName=Sv;var Nv="SelectLabel",Mv=i.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,i=_v(Nv,o);return t.jsx(cp.div,{id:i.id,...r,ref:n})});Mv.displayName=Nv;var Pv="SelectItem",[Rv,Ov]=Gy(Pv),$v=i.forwardRef((e,n)=>{const{__scopeSelect:o,value:r,disabled:a=!1,textValue:s,...l}=e,c=tv(Pv,o),u=mv(Pv,o),d=c.value===r,[f,p]=i.useState(s??""),[h,m]=i.useState(!1),g=Uf(n,e=>u.itemRefCallback?.(e,r,a)),y=np(),v=i.useRef("touch"),b=()=>{a||(c.onValueChange(r),c.onOpenChange(!1))};if(""===r)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(Rv,{scope:o,value:r,disabled:a,textId:y,isSelected:d,onItemTextChange:i.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:t.jsx(Ky.ItemSlot,{scope:o,value:r,disabled:a,textValue:f,children:t.jsx(cp.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:g,onFocus:Zf(l.onFocus,()=>m(!0)),onBlur:Zf(l.onBlur,()=>m(!1)),onClick:Zf(l.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:Zf(l.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:Zf(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Zf(l.onPointerMove,e=>{v.current=e.pointerType,a?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Zf(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Zf(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(Xy.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});$v.displayName=Pv;var Av="SelectItemText",Tv=i.forwardRef((e,n)=>{const{__scopeSelect:o,className:r,style:s,...l}=e,c=tv(Av,o),u=mv(Av,o),d=Ov(Av,o),f=ov(Av,o),[p,h]=i.useState(null),m=Uf(n,e=>h(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=p?.textContent,y=i.useMemo(()=>t.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=f;return Jf(()=>(v(y),()=>b(y)),[v,b,y]),t.jsxs(t.Fragment,{children:[t.jsx(cp.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?a.createPortal(l.children,c.valueNode):null]})});Tv.displayName=Av;var Dv="SelectItemIndicator",zv=i.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return Ov(Dv,o).isSelected?t.jsx(cp.span,{"aria-hidden":!0,...r,ref:n}):null});zv.displayName=Dv;var Iv="SelectScrollUpButton",Lv=i.forwardRef((e,n)=>{const o=mv(Iv,e.__scopeSelect),r=wv(Iv,e.__scopeSelect),[a,s]=i.useState(!1),l=Uf(n,r.onScrollButtonChange);return Jf(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?t.jsx(Fv,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Lv.displayName=Iv;var jv="SelectScrollDownButton",Bv=i.forwardRef((e,n)=>{const o=mv(jv,e.__scopeSelect),r=wv(jv,e.__scopeSelect),[a,s]=i.useState(!1),l=Uf(n,r.onScrollButtonChange);return Jf(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?t.jsx(Fv,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Bv.displayName=jv;var Fv=i.forwardRef((e,n)=>{const{__scopeSelect:o,onAutoScroll:r,...a}=e,s=mv("SelectScrollButton",o),l=i.useRef(null),c=qy(o),u=i.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return i.useEffect(()=>()=>u(),[u]),Jf(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),t.jsx(cp.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:Zf(a.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(r,50))}),onPointerMove:Zf(a.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(r,50))}),onPointerLeave:Zf(a.onPointerLeave,()=>{u()})})}),Hv=i.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return t.jsx(cp.div,{"aria-hidden":!0,...r,ref:n})});Hv.displayName="SelectSeparator";var Vv="SelectArrow";i.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,i=Jy(o),a=tv(Vv,o),s=mv(Vv,o);return a.open&&"popper"===s.position?t.jsx(Hy,{...i,...r,ref:n}):null}).displayName=Vv;var Wv=i.forwardRef(({__scopeSelect:e,value:n,...o},r)=>{const a=i.useRef(null),s=Uf(r,a),l=Vy(n);return i.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,o=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==n&&o){const t=new Event("change",{bubbles:!0});o.call(e,n),e.dispatchEvent(t)}},[l,n]),t.jsx(cp.select,{...o,style:{...Wy,...o.style},ref:s,defaultValue:n})});function Yv(e){return""===e||void 0===e}function Xv(e){const t=up(e),n=i.useRef(""),o=i.useRef(0),r=i.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),a=i.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,a]}function Zv(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0]),r=o?t[0]:t,i=n?e.indexOf(n):-1;let a=function(e,t){return e.map((n,o)=>e[(t+o)%e.length])}(e,Math.max(i,0));1===r.length&&(a=a.filter(e=>e!==n));const s=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return s!==n?s:void 0}Wv.displayName="SelectBubbleInput";var Kv=av,qv=cv,Uv=uv,Gv=fv,Qv=kv,Jv=Mv,eb=$v,tb=Tv,nb=zv,ob=Lv,rb=Bv,ib=Hv;const ab=rv,sb=lv,lb=Su(Kv)`
681
681
  display: flex;
682
682
  height: 2.5rem;
683
683
  width: 100%;
684
+ min-width: 300px;
684
685
  align-items: center;
685
686
  justify-content: space-between;
686
687
  border-radius: ${e=>e.$theme.borderRadius.md};