2&&void 0!==arguments[2]?arguments[2]:1;vs(n<=tv,'Max CSS variable fallback depth detected in property "'.concat(e,'". This may indicate a circular fallback dependency.'));var r=function(e){var t=ev.exec(e);if(!t)return[,];var n=(0,f.Z)(t,3);return[n[1],n[2]]}(e),o=(0,f.Z)(r,2),i=o[0],a=o[1];if(i){var u=window.getComputedStyle(t).getPropertyValue(i);if(u){var s=u.trim();return Td(s)?parseFloat(s):s}return Ks(a)?nv(a,t,n+1):a}}var rv=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),ov=function(e){return rv.has(e)},iv=function(e){return e===Qs||e===cl},av=function(e,t){return parseFloat(e.split(", ")[t])},uv=function(e,t){return function(n,r){var o=r.transform;if("none"===o||!o)return 0;var i=o.match(/^matrix3d\((.+)\)$/);if(i)return av(i[1],t);var a=o.match(/^matrix\((.+)\)$/);return a?av(a[1],e):0}},sv=new Set(["x","y","z"]),lv=Vs.filter((function(e){return!sv.has(e)}));var cv={width:function(e,t){var n=e.x,r=t.paddingLeft,o=void 0===r?"0":r,i=t.paddingRight,a=void 0===i?"0":i;return n.max-n.min-parseFloat(o)-parseFloat(a)},height:function(e,t){var n=e.y,r=t.paddingTop,o=void 0===r?"0":r,i=t.paddingBottom,a=void 0===i?"0":i;return n.max-n.min-parseFloat(o)-parseFloat(a)},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.y,r=t.top;return parseFloat(r)+(n.max-n.min)},right:function(e,t){var n=e.x,r=t.left;return parseFloat(r)+(n.max-n.min)},x:uv(4,13),y:uv(5,14)};cv.translateX=cv.x,cv.translateY=cv.y;var fv=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=hn({},t),r=hn({},r);var o=Object.keys(t).filter(ov),i=[],a=!1,u=[];if(o.forEach((function(o){var s=e.getValue(o);if(e.hasValue(o)){var l,c=n[o],f=Rd(c),d=t[o];if(zl(d)){var p=d.length,h=null===d[0]?1:0;c=d[h],f=Rd(c);for(var v=h;v=0?window.pageYOffset:null,l=function(e,t,n){var r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),a=i.display,u={};"none"===a&&t.setStaticValue("display",e.display||"block"),n.forEach((function(e){u[e]=cv[e](r,i)})),t.render();var s=t.measureViewportBox();return n.forEach((function(n){var r=t.getValue(n);r&&r.jump(u[n]),e[n]=cv[n](s,i)})),e}(t,e,u);return i.length&&i.forEach((function(t){var n=(0,f.Z)(t,2),r=n[0],o=n[1];e.getValue(r).set(o)})),e.render(),Ku&&null!==s&&window.scrollTo({top:s}),{target:l,transitionEnd:r}}return{target:t,transitionEnd:r}};function dv(e,t,n,r){return function(e){return Object.keys(e).some(ov)}(t)?fv(e,t,n,r):{target:t,transitionEnd:r}}var pv=function(e,t,n,r){var o=function(e,t,n){var r=Object.assign({},(Qh(t),t)),o=e.current;if(!(o instanceof Element))return{target:r,transitionEnd:n};for(var i in n&&(n=hn({},n)),e.values.forEach((function(e){var t=e.get();if(Ks(t)){var n=nv(t,o);n&&e.set(n)}})),r){var a=r[i];if(Ks(a)){var u=nv(a,o);u&&(r[i]=u,n||(n={}),void 0===n[i]&&(n[i]=a))}}return{target:r,transitionEnd:n}}(e,t,r);return dv(e,t=o.target,n,r=o.transitionEnd)},hv={current:null},vv={current:!1};var mv=new WeakMap,gv=["willChange"],yv=["children"],bv=Object.keys(Ns),wv=bv.length,kv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],xv=Es.length,Sv=function(){function e(t){var n=this,r=t.parent,o=t.props,i=t.presenceContext,a=t.reducedMotionConfig,u=t.visualState,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,c.Z)(this,e),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=function(){return n.notify("Update",n.latestValues)},this.render=function(){n.current&&(n.triggerBuild(),n.renderInstance(n.current,n.renderState,n.props.style,n.projection))},this.scheduleRender=function(){return rs.render(n.render,!1,!0)};var l=u.latestValues,f=u.renderState;this.latestValues=l,this.baseTarget=hn({},l),this.initialValues=o.initial?hn({},l):{},this.renderState=f,this.parent=r,this.props=o,this.presenceContext=i,this.depth=r?r.depth+1:0,this.reducedMotionConfig=a,this.options=s,this.isControllingVariants=_s(o),this.isVariantNode=Cs(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(r&&r.current);var d=this.scrapeMotionValuesFromProps(o,{}),p=d.willChange,h=mn(d,gv);for(var v in h){var m=h[v];void 0!==l[v]&&Hs(m)&&(m.set(l[v],!1),Sd(p)&&p.add(v))}}return(0,l.Z)(e,[{key:"scrapeMotionValuesFromProps",value:function(e,t){return{}}},{key:"mount",value:function(e){var t=this;this.current=e,mv.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((function(e,n){return t.bindToMotionValue(n,e)})),vv.current||function(){if(vv.current=!0,Ku)if(window.matchMedia){var e=window.matchMedia("(prefers-reduced-motion)"),t=function(){return hv.current=e.matches};e.addListener(t),t()}else hv.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||hv.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}},{key:"unmount",value:function(){for(var e in mv.delete(this.current),this.projection&&this.projection.unmount(),os(this.notifyUpdate),os(this.render),this.valueSubscriptions.forEach((function(e){return e()})),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[e].clear();for(var t in this.features)this.features[t].unmount();this.current=null}},{key:"bindToMotionValue",value:function(e,t){var n=this,r=Us.has(e),o=t.on("change",(function(t){n.latestValues[e]=t,n.props.onUpdate&&rs.update(n.notifyUpdate,!1,!0),r&&n.projection&&(n.projection.isTransformDirty=!0)})),i=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,(function(){o(),i()}))}},{key:"sortNodePosition",value:function(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}},{key:"loadFeatures",value:function(e,t,n,r){for(var o,i,a=this,u=(e.children,mn(e,yv)),s=0;s1&&void 0!==arguments[1])||arguments[1];return this.makeTargetAnimatableFromInstance(e,this.props,t)}},{key:"update",value:function(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(var n=0;n0&&void 0!==arguments[0]&&arguments[0])return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){var e=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(e.initial=this.props.initial),e}for(var t={},n=0;n1?n-1:0),o=1;o0?1:0)}),{},{height:o,transitionEnd:null==a?void 0:a.exit,transition:null!=(t=null==i?void 0:i.exit)?t:Yu(Dv.exit,u)})},enter:function(e){var t,n=e.animateOpacity,r=e.endingHeight,o=e.transition,i=e.transitionEnd,a=e.delay;return hn(hn({},n&&{opacity:1}),{},{height:r,transitionEnd:null==i?void 0:i.enter,transition:null!=(t=null==o?void 0:o.enter)?t:Gu(Dv.enter,a)})}},Zv=(0,r.forwardRef)((function(e,t){var n=e.in,o=e.unmountOnExit,i=e.animateOpacity,a=void 0===i||i,u=e.startingHeight,s=void 0===u?0:u,l=e.endingHeight,c=void 0===l?"auto":l,d=e.style,p=e.className,h=e.transition,v=e.transitionEnd,m=mn(e,Rv),g=(0,r.useState)(!1),y=(0,f.Z)(g,2),b=y[0],w=y[1];(0,r.useEffect)((function(){var e=setTimeout((function(){w(!0)}));return function(){return clearTimeout(e)}}),[]),wn({condition:Number(s)>0&&!!o,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});var k=parseFloat(s.toString())>0,x={startingHeight:s,endingHeight:c,animateOpacity:a,transition:b?h:{enter:{duration:0}},transitionEnd:{enter:null==v?void 0:v.enter,exit:o?null==v?void 0:v.exit:hn(hn({},null==v?void 0:v.exit),{},{display:k?"block":"none"})}},S=!o||n,T=n||o?"enter":"exit";return(0,pa.jsx)(gs,{initial:!1,custom:x,children:S&&(0,pa.jsx)(Av.div,hn(hn({ref:t},m),{},{className:yn("chakra-collapse",p),style:hn({overflow:"hidden",display:"block"},d),custom:x,variants:jv,initial:!!o&&"exit",animate:T,exit:"exit"}))})}));Zv.displayName="Collapse";var Fv=["className","motionProps"],Mv=gn((function(e,t){var n=e.className,r=e.motionProps,o=mn(e,Fv),i=Au().reduceMotion,a=yu(),u=a.getPanelProps,s=a.isOpen,l=u(o,t),c=yn("chakra-accordion__panel",n),f=hu();i||delete l.hidden;var d=(0,pa.jsx)(da.div,hn(hn({},l),{},{__css:f.panel,className:c}));return i?d:(0,pa.jsx)(Zv,hn(hn({in:s},r),{},{children:d}))}));Mv.displayName="AccordionPanel";var Lv=function(e){return"undefined"===typeof e||null===e};function Bv(e){if(function(e,t){return"object"===typeof e&&null!==e&&t in e}(e,"toString")&&"function"===typeof e.toString){var t=e.toString();return"string"===typeof t?t:JSON.stringify(e)}return JSON.stringify(e)}var zv,Vv="Just",Uv="Nothing",qv=function(){function e(t){if((0,c.Z)(this,e),Lv(t))return zv||(this.repr=[Uv],zv=this),zv;this.repr=[Vv,t]}return(0,l.Z)(e,[{key:"variant",get:function(){return this.repr[0]}},{key:"value",get:function(){if(this.repr[0]===Uv)throw new Error("Cannot get the value of `Nothing`");return this.repr[1]}},{key:"isJust",get:function(){return this.repr[0]===Vv}},{key:"isNothing",get:function(){return this.repr[0]===Uv}},{key:"map",value:function(e){return"Just"===this.repr[0]?Wv.just(e(this.repr[1])):this}},{key:"mapOr",value:function(e,t){return"Just"===this.repr[0]?t(this.repr[1]):e}},{key:"mapOrElse",value:function(e,t){return"Just"===this.repr[0]?t(this.repr[1]):e()}},{key:"match",value:function(e){return"Just"===this.repr[0]?e.Just(this.repr[1]):e.Nothing()}},{key:"or",value:function(e){return"Just"===this.repr[0]?this:e}},{key:"orElse",value:function(e){return"Just"===this.repr[0]?this:e()}},{key:"and",value:function(e){return"Just"===this.repr[0]?e:this}},{key:"andThen",value:function(e){return"Just"===this.repr[0]?e(this.repr[1]):this}},{key:"unwrapOr",value:function(e){return"Just"===this.repr[0]?this.repr[1]:e}},{key:"unwrapOrElse",value:function(e){return"Just"===this.repr[0]?this.repr[1]:e()}},{key:"toString",value:function(){return"Just"===this.repr[0]?"Just(".concat(Bv(this.repr[1]),")"):"Nothing"}},{key:"toJSON",value:function(){var e=this.repr[0];return"Just"===e?{variant:e,value:this.repr[1]instanceof Wv?this.repr[1].toJSON():this.repr[1]}:{variant:e}}},{key:"equals",value:function(e){return this.repr[0]===e.repr[0]&&this.repr[1]===e.repr[1]}},{key:"ap",value:function(e){var t=this;return e.andThen((function(e){return t.map((function(t){return t(e)}))}))}},{key:"get",value:function(e){return this.andThen(Hv(e))}}],[{key:"of",value:function(e){return new Wv(e)}},{key:"just",value:function(e){if(Lv(e))throw new Error('attempted to call "just" with '.concat(e));return new Wv(e)}},{key:"nothing",value:function(t){return new e}}]),e}();qv.just;qv.nothing,qv.of;function Hv(e,t){return function(e,t){return void 0!==t?e(t):e}((function(t){return Wv.of(t[e])}),t)}var Wv=qv,Jv=Object.create(null),Gv="Ok",Yv="Err",Kv=function(){function e(t){(0,c.Z)(this,e),this.repr=t}return(0,l.Z)(e,[{key:"variant",get:function(){return this.repr[0]}},{key:"value",get:function(){if(this.repr[0]===Yv)throw new Error("Cannot get the value of Err");return this.repr[1]}},{key:"error",get:function(){if(this.repr[0]===Gv)throw new Error("Cannot get the error of Ok");return this.repr[1]}},{key:"isOk",get:function(){return this.repr[0]===Gv}},{key:"isErr",get:function(){return this.repr[0]===Yv}},{key:"map",value:function(e){return"Ok"===this.repr[0]?Xv.ok(e(this.repr[1])):this}},{key:"mapOr",value:function(e,t){return"Ok"===this.repr[0]?t(this.repr[1]):e}},{key:"mapOrElse",value:function(e,t){return"Ok"===this.repr[0]?t(this.repr[1]):e(this.repr[1])}},{key:"match",value:function(e){return"Ok"===this.repr[0]?e.Ok(this.repr[1]):e.Err(this.repr[1])}},{key:"mapErr",value:function(e){return"Ok"===this.repr[0]?this:Xv.err(e(this.repr[1]))}},{key:"or",value:function(e){return"Ok"===this.repr[0]?this:e}},{key:"orElse",value:function(e){return"Ok"===this.repr[0]?this:e(this.repr[1])}},{key:"and",value:function(e){return"Ok"===this.repr[0]?e:this}},{key:"andThen",value:function(e){return"Ok"===this.repr[0]?e(this.repr[1]):this}},{key:"unwrapOr",value:function(e){return"Ok"===this.repr[0]?this.repr[1]:e}},{key:"unwrapOrElse",value:function(e){return"Ok"===this.repr[0]?this.repr[1]:e(this.repr[1])}},{key:"toString",value:function(){return"".concat(this.repr[0],"(").concat(Bv(this.repr[1]),")")}},{key:"toJSON",value:function(){var e=this.repr[0];return"Ok"===e?{variant:e,value:this.repr[1]}:{variant:e,error:this.repr[1]}}},{key:"equals",value:function(e){return this.repr[0]===e.repr[0]&&this.repr[1]===e.repr[1]}},{key:"ap",value:function(e){var t=this;return e.andThen((function(e){return t.map((function(t){return t(e)}))}))}},{key:"cast",value:function(){return this}}],[{key:"ok",value:function(t){return new e(0===arguments.length?["Ok",Jv]:["Ok",t])}},{key:"err",value:function(t){return Lv(t)?new e(["Err",Jv]):new e(["Err",t])}}]),e}();Kv.ok;Kv.err;var Xv=Kv,$v=Xv;function Qv(e){return null!==e&&void 0!==e}function em(e){return"true"===(e+"").toLowerCase()}function tm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Value is not defined";if(!Qv(e))throw new Error(t)}function nm(e){if("string"!==typeof e)throw new TypeError("Expected a `string`, got `".concat(typeof e,"`"));var t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"),n=new RegExp(t,"g");return e.replace(n,"")}function rm(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":return e.toString();case"object":return null===e?"null":e instanceof Error?e.toString():JSON.stringify(e);case"undefined":return"undefined";case"function":return"function";case"symbol":return"symbol"}}function om(e,t){return im.apply(this,arguments)}function im(){return im=s((0,a.Z)().mark((function e(t,n){var r;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,"function"===typeof t?t():t;case 3:return r=e.sent,e.abrupt("return",$v.ok(r));case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",$v.err(n||rm(e.t0)));case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),im.apply(this,arguments)}var am,um,sm=["message","details"],lm=function(e){var t=e.message,n=e.details,r=mn(e,sm);return(0,pa.jsxs)(Wa,hn(hn({status:"error",overflowY:"auto",maxHeight:"300px",alignItems:"flex-start"},r),{},{children:[(0,pa.jsx)(Ja,{}),(0,pa.jsxs)(va,{flexDirection:"column",width:"100%",gap:"8px",children:[(0,pa.jsxs)(va,{direction:"row",children:[(0,pa.jsx)(Ga,{children:"Error"}),(0,pa.jsx)(Ya,{children:t})]}),Qv(n)&&(0,pa.jsx)(Zu,{allowToggle:!0,children:(0,pa.jsxs)(Mu,{children:[(0,pa.jsx)("h2",{children:(0,pa.jsxs)(Lu,{children:[(0,pa.jsx)(Vu,{as:"span",flex:"1",textAlign:"left",children:"Error details"}),(0,pa.jsx)(Hu,{})]})}),(0,pa.jsx)(Mv,{pb:4,children:(0,pa.jsx)(Vu,{as:"pre",whiteSpace:"pre-wrap",wordBreak:"break-word",children:n})})]})})]})]}))};!function(e){e[e.Unary=0]="Unary",e[e.ServerStreaming=1]="ServerStreaming",e[e.ClientStreaming=2]="ClientStreaming",e[e.BiDiStreaming=3]="BiDiStreaming"}(am||(am={})),function(e){e[e.NoSideEffects=1]="NoSideEffects",e[e.Idempotent=2]="Idempotent"}(um||(um={}));var cm,fm=n(7326);!function(e){e[e.Canceled=1]="Canceled",e[e.Unknown=2]="Unknown",e[e.InvalidArgument=3]="InvalidArgument",e[e.DeadlineExceeded=4]="DeadlineExceeded",e[e.NotFound=5]="NotFound",e[e.AlreadyExists=6]="AlreadyExists",e[e.PermissionDenied=7]="PermissionDenied",e[e.ResourceExhausted=8]="ResourceExhausted",e[e.FailedPrecondition=9]="FailedPrecondition",e[e.Aborted=10]="Aborted",e[e.OutOfRange=11]="OutOfRange",e[e.Unimplemented=12]="Unimplemented",e[e.Internal=13]="Internal",e[e.Unavailable=14]="Unavailable",e[e.DataLoss=15]="DataLoss",e[e.Unauthenticated=16]="Unauthenticated"}(cm||(cm={}));var dm,pm=function(){function e(){(0,c.Z)(this,e)}return(0,l.Z)(e,[{key:"equals",value:function(e){return this.getType().runtime.util.equals(this.getType(),this,e)}},{key:"clone",value:function(){return this.getType().runtime.util.clone(this)}},{key:"fromBinary",value:function(e,t){var n=this.getType().runtime.bin,r=n.makeReadOptions(t);return n.readMessage(this,r.readerFactory(e),e.byteLength,r),this}},{key:"fromJson",value:function(e,t){var n=this.getType(),r=n.runtime.json,o=r.makeReadOptions(t);return r.readMessage(n,e,o,this),this}},{key:"fromJsonString",value:function(e,t){var n;try{n=JSON.parse(e)}catch(r){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(r instanceof Error?r.message:String(r)))}return this.fromJson(n,t)}},{key:"toBinary",value:function(e){var t=this.getType().runtime.bin,n=t.makeWriteOptions(e),r=n.writerFactory();return t.writeMessage(this,r,n),r.finish()}},{key:"toJson",value:function(e){var t=this.getType().runtime.json,n=t.makeWriteOptions(e);return t.writeMessage(this,n)}},{key:"toJsonString",value:function(e){var t,n=this.toJson(e);return JSON.stringify(n,null,null!==(t=null===e||void 0===e?void 0:e.prettySpaces)&&void 0!==t?t:0)}},{key:"toJSON",value:function(){return this.toJson({emitDefaultValues:!0})}},{key:"getType",value:function(){return Object.getPrototypeOf(this).constructor}}]),e}();function hm(e){var t=cm[e];return"string"!=typeof t?e.toString():t[0].toLowerCase()+t.substring(1).replace(/[A-Z]/g,(function(e){return"_"+e.toLowerCase()}))}var vm=function(e){(0,d.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cm.Unknown,i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0;return(0,c.Z)(this,n),r=t.call(this,function(e,t){return e.length?"[".concat(hm(t),"] ").concat(e):"[".concat(hm(t),"]")}(e,o)),r.name="ConnectError",Object.setPrototypeOf((0,fm.Z)(r),(this instanceof n?this.constructor:void 0).prototype),r.rawMessage=e,r.code=o,r.metadata=new Headers(null!==i&&void 0!==i?i:{}),r.details=null!==a&&void 0!==a?a:[],r.cause=u,r}return(0,l.Z)(n,[{key:"findDetails",value:function(e){var t,n="typeName"in e?{findMessage:function(t){return t===e.typeName?e:void 0}}:e,r=[],o=(0,_.Z)(this.details);try{for(o.s();!(t=o.n()).done;){var i=t.value;if(i instanceof pm)n.findMessage(i.getType().typeName)&&r.push(i);else{var a=n.findMessage(i.type);if(a)try{r.push(a.fromBinary(i.value))}catch(Jj){}}}}catch(u){o.e(u)}finally{o.f()}return r}}],[{key:"from",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cm.Unknown;return e instanceof n?e:e instanceof Error?"AbortError"==e.name?new n(e.message,cm.Canceled):new n(e.message,t,void 0,void 0,e):new n(String(e),t,void 0,void 0,e)}}]),n}(b(Error));var mm=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"===typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}},gm=function(e){return this instanceof gm?(this.v=e,this):new gm(e)},ym=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{!function(e){e.value instanceof gm?Promise.resolve(e.value.v).then(s,l):c(i[0][2],e)}(o[e](t))}catch(n){c(i[0][3],n)}}function s(e){u("next",e)}function l(e){u("throw",e)}function c(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}},bm=function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:gm(e[r](t)),done:!1}:o?o(t):t}:o}};var wm=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"===typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}},km=function(e){return this instanceof km?(this.v=e,this):new km(e)},xm=function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:km(e[r](t)),done:!1}:o?o(t):t}:o}},Sm=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{!function(e){e.value instanceof km?Promise.resolve(e.value.v).then(s,l):c(i[0][2],e)}(o[e](t))}catch(n){c(i[0][3],n)}}function s(e){u("next",e)}function l(e){u("throw",e)}function c(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}};function Tm(e,t){return function(e,t){for(var n={},r=0,o=Object.entries(e.methods);r=5){for(u=0,s=1;s<5;s++)u=(u<<8)+n[s];i={flags:n[0],length:u}}if(!(void 0!==i&&n.byteLength>=i.length+5)){o.next=4;break}return o.abrupt("break",12);case 4:return o.next=6,t.read();case 6:if(!(l=o.sent).done){o.next=9;break}return o.abrupt("break",12);case 9:r(l.value);case 10:o.next=1;break;case 12:if(void 0!==i){o.next=18;break}if(0!=n.byteLength){o.next=16;break}return e.close(),o.abrupt("return");case 16:return e.error(new vm("premature end of stream",cm.DataLoss)),o.abrupt("return");case 18:c=n.subarray(5,5+i.length),n=n.subarray(5+i.length),e.enqueue({flags:i.flags,data:c});case 21:case"end":return o.stop()}}),o)})))()}})}function Bm(e,t){var n=new Uint8Array(t.length+5);n.set(t,5);var r=new DataView(n.buffer,n.byteOffset,n.byteLength);return r.setUint8(0,e),r.setUint32(1,t.length),n}var zm="Content-Type",Vm="Content-Length",Um="Content-Encoding",qm="Accept-Encoding",Hm="Connect-Timeout-Ms",Wm="Connect-Protocol-Version",Jm="User-Agent",Gm="1";var Ym=/^application\/(connect\+)?(?:(json)(?:; ?charset=utf-?8)?|(proto))$/i,Km="application/proto",Xm="application/json",$m="application/connect+proto",Qm="application/connect+json";function eg(e,t,n,r){var o=new Headers(null!==r&&void 0!==r?r:{});return void 0!==n&&o.set(Hm,"".concat(n)),o.set(zm,e==am.Unary?t?Km:Xm:t?$m:Qm),o.set(Wm,Gm),o.set(Jm,"connect-es/0.13.2"),o}for(var tg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),ng=[],rg=0;rg>4,a=n,i=2;break;case 2:r[o++]=(15&a)<<4|(60&n)>>2,a=n,i=3;break;case 3:r[o++]=(3&a)<<6|n,i=0}}if(1==i)throw Error("invalid base64 string.");return r.subarray(0,o)},enc:function(e){for(var t,n="",r=0,o=0,i=0;i>2],o=(3&t)<<4,r=1;break;case 1:n+=tg[o|t>>4],o=(15&t)<<2,r=2;break;case 2:n+=tg[o|t>>6],n+=tg[63&t],r=0}return r&&(n+=tg[o],n+="=",1==r&&(n+="=")),n}},ig="application/";function ag(e,t,n){var r="?connect=v".concat(Gm),o=e.header.get(zm);0===(null===o||void 0===o?void 0:o.indexOf(ig))&&(r+="&encoding="+encodeURIComponent(o.slice(ig.length)));var i=e.header.get(Um);null!==i&&"identity"!==i&&(r+="&compression="+encodeURIComponent(i),n=!0),n&&(r+="&base64=1"),r+="&message="+function(e,t){return t?og.enc(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):encodeURIComponent((new TextDecoder).decode(e))}(t,n);var a=e.url+r,u=new Headers(e.header);return[Wm,zm,Vm,Um,qm].forEach((function(e){return u.delete(e)})),Object.assign(Object.assign({},e),{init:Object.assign(Object.assign({},e.init),{method:"GET"}),url:a,header:u})}function ug(e,t,n){var r=function(e){var t=null===e||void 0===e?void 0:e.match(Ym);if(t)return{stream:!!t[1],binary:!!t[3]}}(n.get("Content-Type"));if(200!==t){var o=new vm("HTTP ".concat(t),function(e){switch(e){case 400:return cm.InvalidArgument;case 401:return cm.Unauthenticated;case 403:return cm.PermissionDenied;case 404:return cm.Unimplemented;case 408:return cm.DeadlineExceeded;case 409:return cm.Aborted;case 412:return cm.FailedPrecondition;case 413:case 431:return cm.ResourceExhausted;case 415:return cm.Internal;case 429:case 502:case 503:case 504:return cm.Unavailable;default:return cm.Unknown}}(t),n);if(e==am.Unary&&r&&!r.binary)return{isUnaryError:!0,unaryError:o};throw o}return{isUnaryError:!1}}function sg(e,t,n){if(t&&new Headers(t).forEach((function(e,t){return n.metadata.append(t,e)})),"object"!==typeof e||null==e||Array.isArray(e)||!("code"in e)||"string"!==typeof e.code)throw n;var r=function(e){if(!dm){dm={};for(var t=0,n=Object.values(cm);t1||u(e,t)}))})}function u(e,t){try{!function(e){e.value instanceof fg?Promise.resolve(e.value.v).then(s,l):c(i[0][2],e)}(o[e](t))}catch(n){c(i[0][3],n)}}function s(e){u("next",e)}function l(e){u("throw",e)}function c(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}};function pg(e){var t;!function(){try{new Headers}catch(Jj){throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}();var n=null!==(t=e.useBinaryFormat)&&void 0!==t&&t;return{unary:function(t,r,o,i,u,l){return s((0,a.Z)().mark((function c(){var d,p,h,v;return(0,a.Z)().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return p=Im(r,n,e.jsonOptions,e.binaryOptions),h=p.serialize,v=p.parse,c.next=3,Dm({interceptors:e.interceptors,signal:o,timeoutMs:i,req:{stream:!1,service:t,method:r,url:Mm(e.baseUrl,t,r),init:{method:"POST",credentials:null!==(d=e.credentials)&&void 0!==d?d:"same-origin",redirect:"error",mode:"cors"},header:eg(r.kind,n,i,u),message:l},next:function(){var o=s((0,a.Z)().mark((function o(i){var u,s,l,c,d,p,m,g,y,b,w,k;return(0,a.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=!0===e.useHttpGet&&r.idempotency===um.NoSideEffects,l=null,s?i=ag(i,h(i.message),n):l=h(i.message),c=null!==(u=e.fetch)&&void 0!==u?u:globalThis.fetch,o.next=6,c(i.url,Object.assign(Object.assign({},i.init),{headers:i.header,signal:i.signal,body:l}));case 6:if(d=o.sent,p=ug(r.kind,d.status,d.headers),m=p.isUnaryError,g=p.unaryError,!m){o.next=16;break}return o.t0=sg,o.next=12,d.json();case 12:throw o.t1=o.sent,o.t2=_m.apply(void 0,(0,C.Z)(lg(d.headers))),o.t3=g,(0,o.t0)(o.t1,o.t2,o.t3);case 16:if(y=lg(d.headers),b=(0,f.Z)(y,2),w=b[0],k=b[1],o.t4=t,o.t5=r,o.t6=w,!n){o.next=30;break}return o.t8=v,o.t9=Uint8Array,o.next=25,d.arrayBuffer();case 25:o.t10=o.sent,o.t11=new o.t9(o.t10),o.t7=(0,o.t8)(o.t11),o.next=36;break;case 30:return o.t12=r.O,o.next=33,d.json();case 33:o.t13=o.sent,o.t14=Cm(e.jsonOptions),o.t7=o.t12.fromJson.call(o.t12,o.t13,o.t14);case 36:return o.t15=o.t7,o.t16=k,o.abrupt("return",{stream:!1,service:o.t4,method:o.t5,header:o.t6,message:o.t15,trailer:o.t16});case 39:case"end":return o.stop()}}),o)})));return function(e){return o.apply(this,arguments)}}()});case 3:return c.abrupt("return",c.sent);case 4:case"end":return c.stop()}}),c)})))()},stream:function(t,r,o,i,u,l){return s((0,a.Z)().mark((function c(){var f,d,p,h,v,m,g;return(0,a.Z)().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return g=function(){return g=s((0,a.Z)().mark((function e(t){var n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.kind==am.ServerStreaming){e.next=2;break}throw"The fetch API does not support streaming request bodies";case 2:return e.next=4,t[Symbol.asyncIterator]().next();case 4:if(1!=(n=e.sent).done){e.next=7;break}throw"missing request message";case 7:return e.abrupt("return",Bm(0,p(n.value)));case 8:case"end":return e.stop()}}),e)}))),g.apply(this,arguments)},m=function(e){return g.apply(this,arguments)},v=function(e,t){return dg(this,arguments,(0,a.Z)().mark((function n(){var r,o,i,u,s,l,c;return(0,a.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=Lm(e).getReader(),o=!1;case 2:return n.next=4,fg(r.read());case 4:if(!(i=n.sent).done){n.next=7;break}return n.abrupt("break",21);case 7:if(u=i.value,s=u.flags,l=u.data,2!==(2&s)){n.next=15;break}if(o=!0,!(c=cg(l)).error){n.next=13;break}throw c.error;case 13:return c.metadata.forEach((function(e,n){return t.set(n,e)})),n.abrupt("continue",19);case 15:return n.next=17,fg(h(l));case 17:return n.next=19,n.sent;case 19:n.next=2;break;case 21:if(o){n.next=23;break}throw"missing EndStreamResponse";case 23:case"end":return n.stop()}}),n)})))},d=Im(r,n,e.jsonOptions,e.binaryOptions),p=d.serialize,h=d.parse,c.next=6,jm({interceptors:e.interceptors,timeoutMs:i,signal:o,req:{stream:!0,service:t,method:r,url:Mm(e.baseUrl,t,r),init:{method:"POST",credentials:null!==(f=e.credentials)&&void 0!==f?f:"same-origin",redirect:"error",mode:"cors"},header:eg(r.kind,n,i,u),message:l},next:function(){var t=s((0,a.Z)().mark((function t(n){var o,i,u,s,l;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=null!==(o=e.fetch)&&void 0!==o?o:globalThis.fetch,t.t0=i,t.t1=n.url,t.t2=Object,t.t3=Object.assign({},n.init),t.t4=n.header,t.t5=n.signal,t.next=9,m(n.message);case 9:return t.t6=t.sent,t.t7={headers:t.t4,signal:t.t5,body:t.t6},t.t8=t.t2.assign.call(t.t2,t.t3,t.t7),t.next=14,(0,t.t0)(t.t1,t.t8);case 14:if(u=t.sent,ug(r.kind,u.status,u.headers),null!==u.body){t.next=18;break}throw"missing response body";case 18:return s=new Headers,l=Object.assign(Object.assign({},n),{header:u.headers,trailer:s,message:v(u.body,s)}),t.abrupt("return",l);case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()});case 6:return c.abrupt("return",c.sent);case 7:case"end":return c.stop()}}),c)})))()}}}var hg=n(3913),vg="cloud.kurtosis.com",mg=("".concat("https","://").concat(vg,"/").concat("connect"),Qv("8081")?parseInt("8081"):8081),gg={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_VERSION:"0.85.30-8-g6f743ba0a-dirty",REACT_APP_KURTOSIS_DEFAULT_HOST:"localhost",REACT_APP_KURTOSIS_DEFAULT_EM_API_PORT:"8081",REACT_APP_KURTOSIS_CLOUD_UI_URL:"https://cloud.kurtosis.com",REACT_APP_KURTOSIS_PACKAGE_INDEXER_URL:"https://cloud.kurtosis.com:9770"}.REACT_APP_KURTOSIS_DEFAULT_URL||"http://".concat("localhost",":").concat(mg),yg=n(3371),bg=n(3324),wg=n(302),kg=function(){function e(t,n,r){(0,c.Z)(this,e),this.client=void 0,this.cloudUrl=void 0,this.baseApplicationUrl=void 0,this.client=t,this.cloudUrl=n,this.baseApplicationUrl=r,this.getParentRequestedRoute()}return(0,l.Z)(e,[{key:"getParentRequestedRoute",value:function(){var e=this.cloudUrl.pathname.split("/enclave-manager");if(e[1])return e[1]}},{key:"getCloudUrl",value:function(){return this.cloudUrl}},{key:"isRunningInCloud",value:function(){return this.cloudUrl.host.toLowerCase().includes(vg)}},{key:"getCloudBasePathUrl",value:function(){return"".concat(this.cloudUrl.origin).concat(this.cloudUrl.pathname)}},{key:"getBaseApplicationUrl",value:function(){return this.baseApplicationUrl}},{key:"checkHealth",value:function(){var e=s((0,a.Z)().mark((function e(){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",om(this.client.check({},this.getHeaderOptions())));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getEnclaves",value:function(){var e=s((0,a.Z)().mark((function e(){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",om(this.client.getEnclaves({},this.getHeaderOptions()),"KurtosisClient could not getEnclaves"));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"destroy",value:function(){var e=s((0,a.Z)().mark((function e(t){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",om(this.client.destroyEnclave(new bg.DestroyEnclaveArgs({enclaveIdentifier:t}),this.getHeaderOptions()),"KurtosisClient could not destroy enclave ".concat(t)));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getServices",value:function(){var e=s((0,a.Z)().mark((function e(t){var n=this;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,om((function(){var e=t.apiContainerInfo;tm(e,"Cannot getServices because the passed enclave '".concat(t.name,"' does not have apicInfo"));var r=new wg.GetServicesRequest({apicIpAddress:e.bridgeIpAddress,apicPort:e.grpcPortInsideEnclave});return n.client.getServices(r,n.getHeaderOptions())}),"KurtosisClient could not getServices for ".concat(t.name));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getServiceLogs",value:function(){var e=s((0,a.Z)().mark((function e(t,n,r,o,i,u){var s,l,c=arguments;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=c.length>6&&void 0!==c[6]?c[6]:[],l=new bg.GetServiceLogsArgs({enclaveIdentifier:n.name,serviceUuidSet:r.reduce((function(e,t){return hn(hn({},e),{},(0,h.Z)({},t.serviceUuid,!0))}),{}),followLogs:!Qv(o)||o,conjunctiveFilters:s,numLogLines:Qv(i)?i:1500,returnAllLogs:!!u}),e.abrupt("return",this.client.getServiceLogs(l,hn(hn({},this.getHeaderOptions()),{},{signal:t.signal})));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r,o,i,a){return e.apply(this,arguments)}}()},{key:"getStarlarkRun",value:function(){var e=s((0,a.Z)().mark((function e(t){var n=this;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,om((function(){var e=t.apiContainerInfo;tm(e,"Cannot getStarlarkRun because the passed enclave '".concat(t.name,"' does not have apicInfo"));var r=new wg.GetStarlarkRunRequest({apicIpAddress:e.bridgeIpAddress,apicPort:e.grpcPortInsideEnclave});return n.client.getStarlarkRun(r,n.getHeaderOptions())}),"KurtosisClient could not getStarlarkRun for ".concat(t.name));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"listFilesArtifactNamesAndUuids",value:function(){var e=s((0,a.Z)().mark((function e(t){var n=this;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,om((function(){var e=t.apiContainerInfo;tm(e,"Cannot listFilesArtifactNamesAndUuids because the passed enclave '".concat(t.name,"' does not have apicInfo"));var r=new wg.GetListFilesArtifactNamesAndUuidsRequest({apicIpAddress:e.bridgeIpAddress,apicPort:e.grpcPortInsideEnclave});return n.client.listFilesArtifactNamesAndUuids(r,n.getHeaderOptions())}),"KurtosisClient could not listFilesArtifactNamesAndUuids for ".concat(t.name));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"inspectFilesArtifactContents",value:function(){var e=s((0,a.Z)().mark((function e(t,n){var r=this;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,om((function(){var e=t.apiContainerInfo;tm(e,"Cannot inspect files artifact contents because the passed enclave '".concat(t.name,"' does not have apicInfo"));var o=new wg.InspectFilesArtifactContentsRequest({apicIpAddress:e.bridgeIpAddress,apicPort:e.grpcPortInsideEnclave,fileNamesAndUuid:n});return r.client.inspectFilesArtifactContents(o,r.getHeaderOptions())}),"KurtosisClient could not inspectFilesArtifactContents for ".concat(t.name));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"downloadFilesArtifact",value:function(){var e=s((0,a.Z)().mark((function e(t,n){var r,o;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return tm(r=t.apiContainerInfo,"Cannot download files artifact because the passed enclave '".concat(t.name,"' does not have apicInfo")),o=new wg.DownloadFilesArtifactRequest({apicIpAddress:r.bridgeIpAddress,apicPort:r.grpcPortInsideEnclave,downloadFilesArtifactsArgs:new yg.DownloadFilesArtifactArgs({identifier:n.fileUuid})}),e.abrupt("return",this.client.downloadFilesArtifact(o,this.getHeaderOptions()));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"createEnclave",value:function(){var e=s((0,a.Z)().mark((function e(t,n,r,o){var i=this;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",om((function(){var e=new bg.CreateEnclaveArgs({enclaveName:t,apiContainerLogLevel:n,mode:r?bg.EnclaveMode.PRODUCTION:bg.EnclaveMode.TEST,apiContainerVersionTag:o||""});return i.client.createEnclave(e,i.getHeaderOptions())})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r,o){return e.apply(this,arguments)}}()},{key:"runStarlarkPackage",value:function(){var e=s((0,a.Z)().mark((function e(t,n,r){var o;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new wg.RunStarlarkPackageRequest({apicIpAddress:t.bridgeIpAddress,apicPort:t.grpcPortInsideEnclave,RunStarlarkPackageArgs:new yg.RunStarlarkPackageArgs({dryRun:!1,packageId:n,serializedParams:JSON.stringify(r)})}),e.abrupt("return",this.client.runStarlarkPackage(o,this.getHeaderOptions()));case 2:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()}]),e}();var xg=function(e){(0,d.Z)(n,e);var t=(0,p.Z)(n);function n(e,r,o,i){var a,u;return(0,c.Z)(this,n),(a=t.call(this,Tm(hg.q,pg({baseUrl:(u=e,"".concat("https://cloud.kurtosis.com","/gateway/ips/").concat(u,"/ports/").concat(mg))})),o,i)).token=void 0,a.token=r,a}return(0,l.Z)(n,[{key:"getHeaderOptions",value:function(){var e=new Headers;return e.set("Authorization","Bearer ".concat(this.token)),{headers:e}}}]),n}(kg),Sg=function(e){(0,d.Z)(n,e);var t=(0,p.Z)(n);function n(){(0,c.Z)(this,n);var e=new URL("".concat(window.location.protocol,"//").concat(window.location.host));return t.call(this,Tm(hg.q,pg({baseUrl:gg})),e,e)}return(0,l.Z)(n,[{key:"getHeaderOptions",value:function(){return{}}}]),n}(kg),Tg=(0,r.createContext)({client:null}),Eg=function(e){var t=e.children,n=(0,r.useState)(),o=(0,f.Z)(n,2),i=o[0],u=o[1],l=(0,r.useState)(),c=(0,f.Z)(l,2),d=c[0],p=c[1],h=(0,r.useState)(),v=(0,f.Z)(h,2),m=v[0],g=v[1],y=(0,r.useMemo)((function(){if(Qv(i))return new Proxy(i,{get:function(e,t){return"getEnclaves"===t||"getServices"===t||"getStarlarkRun"===t||"listFilesArtifactNamesAndUuids"===t?new Proxy(e[t],{apply:function(e,t,n){return Reflect.apply(e,t,n).then((function(e){return e.isErr&&console.error(e.error),e}))}}):Reflect.get(e,t)}})}),[i]);return(0,r.useEffect)((function(){var e=function(e){if("jwtToken"===e.data.message){var t=e.data.value;Qv(t)&&p(t)}};return window.addEventListener("message",e),function(){return window.removeEventListener("message",e)}}),[]),(0,r.useEffect)((function(){s((0,a.Z)().mark((function e(){var t,n,r,o,i,s;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=new URLSearchParams(window.location.search),n=em(t.get("require-authentication")),e.prev=2,g(void 0),r=null,n?(tm(o=t.get("api-host"),"The parameter 'api-host' is not defined"),i=Cg(t,"parent-location-path")||new URL(window.location.href),s=Cg(t,"child-location-path")||new URL(window.location.href),Qv(d)&&(r=new xg(o,d,i,s))):r=new Sg,!Qv(r)){e.next=14;break}return e.next=9,r.checkHealth();case 9:if(!e.sent.isErr){e.next=13;break}return g("Cannot reach the enclave manager backend - is the Enclave Manager API running and accessible?"),e.abrupt("return");case 13:u(r);case 14:e.next=20;break;case 16:e.prev=16,e.t0=e.catch(2),console.error(e.t0),g(rm(e.t0));case 20:case"end":return e.stop()}}),e,null,[[2,16]])})))()}),[d]),y?(0,pa.jsx)(Tg.Provider,{value:{client:y},children:t}):(0,pa.jsxs)(va,{width:"100%",direction:"column",alignItems:"center",gap:"1rem",padding:"3rem",children:[!Qv(m)&&(0,pa.jsxs)(pa.Fragment,{children:[(0,pa.jsx)(Ia,{size:"xl"}),(0,pa.jsx)(Pa,{as:"h2",fontSize:"2xl",children:"Connecting to enclave manager..."})]}),Qv(m)&&(0,pa.jsx)(lm,{message:m})]})},_g=function(){var e=(0,r.useContext)(Tg).client;return tm(e,"useKurtosisClient used incorrectly - KurtosisClient is not currently available."),e},Cg=function(e,t){var n=e.get(t);return null===n?null:(tm(n=atob(n),"The parameter ".concat(t,"' is not defined")),new URL(n))};function Ig(e,t){if(!e)throw new Error(t)}var Og=34028234663852886e22,Pg=-34028234663852886e22,Ng=4294967295,Ag=2147483647,Rg=-2147483648;function Dg(e){if("number"!==typeof e)throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>Ag||eNg||e<0)throw new Error("invalid uint 32: "+e)}function Zg(e){if("number"!==typeof e)throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>Og||e>4,0==(128&o))return this.assertBounds(),[e,t];for(var i=3;i<=31;i+=7){var a=this.buf[this.pos++];if(t|=(127&a)<>>r,i=!(o>>>7==0&&0==t),a=255&(i?128|o:o);if(n.push(a),!i)return}var u=e>>>28&15|(7&t)<<4,s=!(t>>3==0);if(n.push(255&(s?128|u:u)),s){for(var l=3;l<31;l+=7){var c=t>>>l,f=!(c>>>7==0),d=255&(f?128|c:c);if(n.push(d),!f)return}n.push(t>>>31&1)}}!function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"}(Fg||(Fg={}));var Wg=4294967296;function Jg(e){var t="-"===e[0];t&&(e=e.slice(1));var n=1e6,r=0,o=0;function i(t,i){var a=Number(e.slice(t,i));o*=n,(r=r*n+a)>=Wg&&(o+=r/Wg|0,r%=Wg)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),t?Kg(r,o):Yg(r,o)}function Gg(e,t){var n=function(e,t){return{lo:e>>>0,hi:t>>>0}}(e,t);if(e=n.lo,(t=n.hi)<=2097151)return String(Wg*t+e);var r=16777215&(e>>>24|t<<8),o=t>>16&65535,i=(16777215&e)+6777216*r+6710656*o,a=r+8147497*o,u=2*o,s=1e7;return i>=s&&(a+=Math.floor(i/s),i%=s),a>=s&&(u+=Math.floor(a/s),a%=s),u.toString()+Xg(a)+Xg(i)}function Yg(e,t){return{lo:0|e,hi:0|t}}function Kg(e,t){return t=~t,e?e=1+~e:t+=1,Yg(e,t)}var Xg=function(e){var t=String(e);return"0000000".slice(t.length)+t};function $g(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(var n=0;n<9;n++)t.push(127&e|128),e>>=7;t.push(1)}}function Qg(){var e=this.buf[this.pos++],t=127&e;if(0==(128&e))return this.assertBounds(),t;if(t|=(127&(e=this.buf[this.pos++]))<<7,0==(128&e))return this.assertBounds(),t;if(t|=(127&(e=this.buf[this.pos++]))<<14,0==(128&e))return this.assertBounds(),t;if(t|=(127&(e=this.buf[this.pos++]))<<21,0==(128&e))return this.assertBounds(),t;t|=(15&(e=this.buf[this.pos++]))<<28;for(var n=5;0!==(128&e)&&n<10;n++)e=this.buf[this.pos++];if(0!=(128&e))throw new Error("invalid varint");return this.assertBounds(),t>>>0}var ey,ty=function(){var e=new DataView(new ArrayBuffer(8));if("function"===typeof BigInt&&"function"===typeof e.getBigInt64&&"function"===typeof e.getBigUint64&&"function"===typeof e.setBigInt64&&"function"===typeof e.setBigUint64&&("object"!=typeof process||"1"!=={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_VERSION:"0.85.30-8-g6f743ba0a-dirty",REACT_APP_KURTOSIS_DEFAULT_HOST:"localhost",REACT_APP_KURTOSIS_DEFAULT_EM_API_PORT:"8081",REACT_APP_KURTOSIS_CLOUD_UI_URL:"https://cloud.kurtosis.com",REACT_APP_KURTOSIS_PACKAGE_INDEXER_URL:"https://cloud.kurtosis.com:9770"}.BUF_BIGINT_DISABLE)){var t=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),r=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse:function(e){var r="bigint"==typeof e?e:BigInt(e);if(r>n||ro||t>>0)}},{key:"raw",value:function(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}},{key:"uint32",value:function(e){for(jg(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}},{key:"int32",value:function(e){return Dg(e),$g(e,this.buf),this}},{key:"bool",value:function(e){return this.buf.push(e?1:0),this}},{key:"bytes",value:function(e){return this.uint32(e.byteLength),this.raw(e)}},{key:"string",value:function(e){var t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}},{key:"float",value:function(e){Zg(e);var t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}},{key:"double",value:function(e){var t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}},{key:"fixed32",value:function(e){jg(e);var t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}},{key:"sfixed32",value:function(e){Dg(e);var t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}},{key:"sint32",value:function(e){return Dg(e),$g(e=(e<<1^e>>31)>>>0,this.buf),this}},{key:"sfixed64",value:function(e){var t=new Uint8Array(8),n=new DataView(t.buffer),r=ty.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}},{key:"fixed64",value:function(e){var t=new Uint8Array(8),n=new DataView(t.buffer),r=ty.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}},{key:"int64",value:function(e){var t=ty.enc(e);return Hg(t.lo,t.hi,this.buf),this}},{key:"sint64",value:function(e){var t=ty.enc(e),n=t.hi>>31;return Hg(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}},{key:"uint64",value:function(e){var t=ty.uEnc(e);return Hg(t.lo,t.hi,this.buf),this}}]),e}(),ry=function(){function e(t,n){(0,c.Z)(this,e),this.varint64=qg,this.uint32=Qg,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=null!==n&&void 0!==n?n:new TextDecoder}return(0,l.Z)(e,[{key:"tag",value:function(){var e=this.uint32(),t=e>>>3,n=7&e;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}},{key:"skip",value:function(e){var t=this.pos;switch(e){case ey.Varint:for(;128&this.buf[this.pos++];);break;case ey.Bit64:this.pos+=4;case ey.Bit32:this.pos+=4;break;case ey.LengthDelimited:var n=this.uint32();this.pos+=n;break;case ey.StartGroup:for(var r;(r=this.tag()[1])!==ey.EndGroup;)this.skip(r);break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(t,this.pos)}},{key:"assertBounds",value:function(){if(this.pos>this.len)throw new RangeError("premature EOF")}},{key:"int32",value:function(){return 0|this.uint32()}},{key:"sint32",value:function(){var e=this.uint32();return e>>>1^-(1&e)}},{key:"int64",value:function(){return ty.dec.apply(ty,(0,C.Z)(this.varint64()))}},{key:"uint64",value:function(){return ty.uDec.apply(ty,(0,C.Z)(this.varint64()))}},{key:"sint64",value:function(){var e=this.varint64(),t=(0,f.Z)(e,2),n=t[0],r=t[1],o=-(1&n);return n=(n>>>1|(1&r)<<31)^o,r=r>>>1^o,ty.dec(n,r)}},{key:"bool",value:function(){var e=this.varint64(),t=(0,f.Z)(e,2),n=t[0],r=t[1];return 0!==n||0!==r}},{key:"fixed32",value:function(){return this.view.getUint32((this.pos+=4)-4,!0)}},{key:"sfixed32",value:function(){return this.view.getInt32((this.pos+=4)-4,!0)}},{key:"fixed64",value:function(){return ty.uDec(this.sfixed32(),this.sfixed32())}},{key:"sfixed64",value:function(){return ty.dec(this.sfixed32(),this.sfixed32())}},{key:"float",value:function(){return this.view.getFloat32((this.pos+=4)-4,!0)}},{key:"double",value:function(){return this.view.getFloat64((this.pos+=8)-8,!0)}},{key:"bytes",value:function(){var e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}},{key:"string",value:function(){return this.textDecoder.decode(this.bytes())}}]),e}();function oy(e,t){return t instanceof pm||!e.fieldWrapper?t:e.fieldWrapper.wrapField(t)}Fg.DOUBLE,Fg.FLOAT,Fg.INT64,Fg.UINT64,Fg.INT32,Fg.UINT32,Fg.BOOL,Fg.STRING,Fg.BYTES;function iy(e,t,n){if(t===n)return!0;if(e==Fg.BYTES){if(!(t instanceof Uint8Array)||!(n instanceof Uint8Array))return!1;if(t.length!==n.length)return!1;for(var r=0;r100?"string":'"'.concat(e.split('"').join('\\"'),'"');default:return String(e)}}function Ey(e,t){switch(e){case Fg.DOUBLE:case Fg.FLOAT:if(null===t)return 0;if("NaN"===t)return Number.NaN;if("Infinity"===t)return Number.POSITIVE_INFINITY;if("-Infinity"===t)return Number.NEGATIVE_INFINITY;if(""===t)break;if("string"==typeof t&&t.trim().length!==t.length)break;if("string"!=typeof t&&"number"!=typeof t)break;var n=Number(t);if(Number.isNaN(n))break;if(!Number.isFinite(n))break;return e==Fg.FLOAT&&Zg(n),n;case Fg.INT32:case Fg.FIXED32:case Fg.SFIXED32:case Fg.SINT32:case Fg.UINT32:if(null===t)return 0;var r;if("number"==typeof t?r=t:"string"==typeof t&&t.length>0&&t.trim().length===t.length&&(r=Number(t)),void 0===r)break;return e==Fg.UINT32?jg(r):Dg(r),r;case Fg.INT64:case Fg.SFIXED64:case Fg.SINT64:if(null===t)return ty.zero;if("number"!=typeof t&&"string"!=typeof t)break;return ty.parse(t);case Fg.FIXED64:case Fg.UINT64:if(null===t)return ty.zero;if("number"!=typeof t&&"string"!=typeof t)break;return ty.uParse(t);case Fg.BOOL:if(null===t)return!1;if("boolean"!==typeof t)break;return t;case Fg.STRING:if(null===t)return"";if("string"!==typeof t)break;try{encodeURIComponent(t)}catch(o){throw new Error("invalid UTF8")}return t;case Fg.BYTES:if(null===t||""===t)return new Uint8Array(0);if("string"!==typeof t)break;return og.dec(t)}throw new Error}function _y(e,t,n){if(null===t)return 0;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":var r=e.findName(t);if(r||n)return null===r||void 0===r?void 0:r.no}throw new Error("cannot decode enum ".concat(e.typeName," from JSON: ").concat(Ty(t)))}function Cy(e,t,n,r){var o;if(void 0===t)return t;if(0!==t||n){if(r)return t;if("google.protobuf.NullValue"==e.typeName)return null;var i=e.findNumber(t);return null!==(o=null===i||void 0===i?void 0:i.name)&&void 0!==o?o:t}}function Iy(e,t,n){if(void 0!==t)switch(e){case Fg.INT32:case Fg.SFIXED32:case Fg.SINT32:case Fg.FIXED32:case Fg.UINT32:return Ig("number"==typeof t),0!=t||n?t:void 0;case Fg.FLOAT:case Fg.DOUBLE:return Ig("number"==typeof t),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":0!==t||n?t:void 0;case Fg.STRING:return Ig("string"==typeof t),t.length>0||n?t:void 0;case Fg.BOOL:return Ig("boolean"==typeof t),t||n?t:void 0;case Fg.UINT64:case Fg.FIXED64:case Fg.INT64:case Fg.SFIXED64:case Fg.SINT64:return Ig("bigint"==typeof t||"string"==typeof t||"number"==typeof t),n||0!=t?t.toString(10):void 0;case Fg.BYTES:return Ig(t instanceof Uint8Array),n||t.byteLength>0?og.enc(t):void 0}}function Oy(e){if(void 0===e)return e;if(e instanceof pm)return e.clone();if(e instanceof Uint8Array){var t=new Uint8Array(e.byteLength);return t.set(e),t}return e}function Py(e){return e instanceof Uint8Array?e:new Uint8Array(e)}var Ny=function(){function e(t,n){(0,c.Z)(this,e),this._fields=t,this._normalizer=n}return(0,l.Z)(e,[{key:"findJsonName",value:function(e){if(!this.jsonNames){var t,n={},r=(0,_.Z)(this.list());try{for(r.s();!(t=r.n()).done;){var o=t.value;n[o.jsonName]=n[o.name]=o}}catch(i){r.e(i)}finally{r.f()}this.jsonNames=n}return this.jsonNames[e]}},{key:"find",value:function(e){if(!this.numbers){var t,n={},r=(0,_.Z)(this.list());try{for(r.s();!(t=r.n()).done;){var o=t.value;n[o.no]=o}}catch(i){r.e(i)}finally{r.f()}this.numbers=n}return this.numbers[e]}},{key:"list",value:function(){return this.all||(this.all=this._normalizer(this._fields)),this.all}},{key:"byNumber",value:function(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((function(e,t){return e.no-t.no}))),this.numbersAsc}},{key:"byMember",value:function(){if(!this.members){this.members=[];var e,t,n=this.members,r=(0,_.Z)(this.list());try{for(r.s();!(t=r.n()).done;){var o=t.value;o.oneof?o.oneof!==e&&(e=o.oneof,n.push(e)):n.push(o)}}catch(i){r.e(i)}finally{r.f()}}return this.members}}]),e}();function Ay(e,t){var n=jy(e);return t?n:By(Ly(n))}function Ry(e){return Ay(e,!1)}var Dy=jy;function jy(e){for(var t=!1,n=[],r=0;r0&&(w+=": ".concat(D.message)),new Error(w)}}m.push(b)}}catch(j){g.e(j)}finally{g.f()}}else if("map"==c.kind){if(null===l)continue;if(Array.isArray(l)||"object"!=typeof l)throw new Error("cannot decode field ".concat(e.typeName,".").concat(c.name," from JSON: ").concat(this.debug(l)));for(var k=p[d],x=0,S=Object.entries(l);x0&&(O+=": ".concat(D.message)),new Error(O)}}try{k[Ey(c.K,c.K==Fg.BOOL?"true"==E||"false"!=E&&E:E).toString()]=I}catch(D){var P="cannot decode map key for field ".concat(e.typeName,".").concat(c.name," from JSON: ").concat(this.debug(l));throw D instanceof Error&&D.message.length>0&&(P+=": ".concat(D.message)),new Error(P)}}}else switch(c.kind){case"message":var N=c.T;if(null===l&&"google.protobuf.Value"!=N.typeName){if(c.oneof)throw new Error("cannot decode field ".concat(e.typeName,".").concat(c.name,' from JSON: null is invalid for oneof field "').concat(s,'"'));continue}p[d]instanceof pm?p[d].fromJson(l,n):(p[d]=N.fromJson(l,n),N.fieldWrapper&&!c.oneof&&(p[d]=N.fieldWrapper.unwrapField(p[d])));break;case"enum":var A=_y(c.T,l,n.ignoreUnknownFields);void 0!==A&&(p[d]=A);break;case"scalar":try{p[d]=Ey(c.T,l)}catch(D){var R="cannot decode field ".concat(e.typeName,".").concat(c.name," from JSON: ").concat(this.debug(l));throw D instanceof Error&&D.message.length>0&&(R+=": ".concat(D.message)),new Error(R)}}}else if(!n.ignoreUnknownFields)throw new Error("cannot decode message ".concat(e.typeName,' from JSON: key "').concat(s,'" is unknown'))}return r},writeMessage:function(e,n){var r,o=e.getType(),i={};try{var a,u=(0,_.Z)(o.fields.byMember());try{for(u.s();!(a=u.n()).done;){var s=a.value,l=void 0;if("oneof"==s.kind){var c=e[s.localName];if(void 0===c.value)continue;if(!(r=s.findField(c.case)))throw"oneof case not found: "+c.case;l=t(r,c.value,n)}else l=t(r=s,e[r.localName],n);void 0!==l&&(i[n.useProtoFieldName?r.name:r.jsonName]=l)}}catch(p){u.e(p)}finally{u.f()}}catch(h){var f=r?"cannot encode field ".concat(o.typeName,".").concat(r.name," to JSON"):"cannot encode message ".concat(o.typeName," to JSON"),d=h instanceof Error?h.message:String(h);throw new Error(f+(d.length>0?": ".concat(d):""))}return i},readScalar:Ey,writeScalar:Iy,debug:Ty}}((function(e,t){return function(n,r,o){if("map"==n.kind){var i={};switch(n.V.kind){case"scalar":for(var a=0,u=Object.entries(r);a0?i:void 0}if(n.repeated){var E=[];switch(n.kind){case"scalar":for(var _=0;_0?E:void 0}switch(n.kind){case"scalar":return t(n.T,r,!!n.oneof||n.opt||o.emitDefaultValues);case"enum":return e(n.T,r,!!n.oneof||n.opt||o.emitDefaultValues,o.enumAsInteger);case"message":return void 0!==r?oy(n.T,r).toJson(o):void 0}}})),Object.assign(Object.assign({},{makeReadOptions:fy,makeWriteOptions:dy,listUnknownFields:function(e){var t;return null!==(t=e[sy])&&void 0!==t?t:[]},discardUnknownFields:function(e){delete e[sy]},writeUnknownFields:function(e,t){var n=e[sy];if(n){var r,o=(0,_.Z)(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;t.tag(i.no,i.wireType).raw(i.data)}}catch(a){o.e(a)}finally{o.f()}}},onUnknownField:function(e,t,n,r){var o=e;Array.isArray(o[sy])||(o[sy]=[]),o[sy].push({no:t,wireType:n,data:r})},readMessage:function(e,t,n,r){for(var o=e.getType(),i=void 0===n?t.len:t.pos+n;t.posDate.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=ty.parse(r/1e3),this.nanos=0,n[7]&&(this.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9),this}},{key:"toJson",value:function(e){var t=1e3*Number(this.seconds);if(tDate.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");var n="Z";if(this.nanos>0){var r=(this.nanos+1e9).toString().substring(1);n="000000"===r.substring(3)?"."+r.substring(0,3)+"Z":"000"===r.substring(6)?"."+r.substring(0,6)+"Z":"."+r+"Z"}return new Date(t).toISOString().replace(".000Z",n)}},{key:"toDate",value:function(){return new Date(1e3*Number(this.seconds)+Math.ceil(this.nanos/1e6))}}],[{key:"now",value:function(){return n.fromDate(new Date)}},{key:"fromDate",value:function(e){var t=e.getTime();return new n({seconds:ty.parse(Math.floor(t/1e3)),nanos:t%1e3*1e6})}},{key:"fromBinary",value:function(e,t){return(new n).fromBinary(e,t)}},{key:"fromJson",value:function(e,t){return(new n).fromJson(e,t)}},{key:"fromJsonString",value:function(e,t){return(new n).fromJsonString(e,t)}},{key:"equals",value:function(e,t){return Vy.util.equals(n,e,t)}}]),n}(pm);Hy.runtime=Vy,Hy.typeName="google.protobuf.Timestamp",Hy.fields=Vy.util.newFieldList((function(){return[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]}));var Wy=function(e){return e[e.BOOL=0]="BOOL",e[e.STRING=1]="STRING",e[e.INTEGER=2]="INTEGER",e[e.DICT=4]="DICT",e[e.JSON=5]="JSON",e[e.LIST=6]="LIST",e}({});Vy.util.setEnumType(Wy,"kurtosis_package_indexer.ArgumentValueType",[{no:0,name:"BOOL"},{no:1,name:"STRING"},{no:2,name:"INTEGER"},{no:4,name:"DICT"},{no:5,name:"JSON"},{no:6,name:"LIST"}]);var Jy=function(e){(0,d.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,c.Z)(this,n),(r=t.call(this)).repositoryMetadata=void 0,Vy.util.initPartial(e,(0,fm.Z)(r)),r}return(0,l.Z)(n,null,[{key:"fromBinary",value:function(e,t){return(new n).fromBinary(e,t)}},{key:"fromJson",value:function(e,t){return(new n).fromJson(e,t)}},{key:"fromJsonString",value:function(e,t){return(new n).fromJsonString(e,t)}},{key:"equals",value:function(e,t){return Vy.util.equals(n,e,t)}}]),n}(pm);Jy.runtime=Vy,Jy.typeName="kurtosis_package_indexer.ReadPackageRequest",Jy.fields=Vy.util.newFieldList((function(){return[{no:1,name:"repository_metadata",kind:"message",T:Qy}]}));var Gy=function(e){(0,d.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,c.Z)(this,n),(r=t.call(this)).package=void 0,Vy.util.initPartial(e,(0,fm.Z)(r)),r}return(0,l.Z)(n,null,[{key:"fromBinary",value:function(e,t){return(new n).fromBinary(e,t)}},{key:"fromJson",value:function(e,t){return(new n).fromJson(e,t)}},{key:"fromJsonString",value:function(e,t){return(new n).fromJsonString(e,t)}},{key:"equals",value:function(e,t){return Vy.util.equals(n,e,t)}}]),n}(pm);Gy.runtime=Vy,Gy.typeName="kurtosis_package_indexer.ReadPackageResponse",Gy.fields=Vy.util.newFieldList((function(){return[{no:1,name:"package",kind:"message",T:Ky,opt:!0}]}));var Yy=function(e){(0,d.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,c.Z)(this,n),(r=t.call(this)).packages=[],Vy.util.initPartial(e,(0,fm.Z)(r)),r}return(0,l.Z)(n,null,[{key:"fromBinary",value:function(e,t){return(new n).fromBinary(e,t)}},{key:"fromJson",value:function(e,t){return(new n).fromJson(e,t)}},{key:"fromJsonString",value:function(e,t){return(new n).fromJsonString(e,t)}},{key:"equals",value:function(e,t){return Vy.util.equals(n,e,t)}}]),n}(pm);Yy.runtime=Vy,Yy.typeName="kurtosis_package_indexer.GetPackagesResponse",Yy.fields=Vy.util.newFieldList((function(){return[{no:1,name:"packages",kind:"message",T:Ky,repeated:!0}]}));var Ky=function(e){(0,d.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,c.Z)(this,n),(r=t.call(this)).name="",r.args=[],r.stars=ty.zero,r.description="",r.url=void 0,r.entrypointDescription="",r.returnsDescription="",r.repositoryMetadata=void 0,r.parsingResult="",r.parsingTime=void 0,r.version="",Vy.util.initPartial(e,(0,fm.Z)(r)),r}return(0,l.Z)(n,null,[{key:"fromBinary",value:function(e,t){return(new n).fromBinary(e,t)}},{key:"fromJson",value:function(e,t){return(new n).fromJson(e,t)}},{key:"fromJsonString",value:function(e,t){return(new n).fromJsonString(e,t)}},{key:"equals",value:function(e,t){return Vy.util.equals(n,e,t)}}]),n}(pm);Ky.runtime=Vy,Ky.typeName="kurtosis_package_indexer.KurtosisPackage",Ky.fields=Vy.util.newFieldList((function(){return[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"args",kind:"message",T:Xy,repeated:!0},{no:3,name:"stars",kind:"scalar",T:4},{no:4,name:"description",kind:"scalar",T:9},{no:5,name:"url",kind:"scalar",T:9,opt:!0},{no:6,name:"entrypoint_description",kind:"scalar",T:9},{no:7,name:"returns_description",kind:"scalar",T:9},{no:8,name:"repository_metadata",kind:"message",T:Qy},{no:9,name:"parsing_result",kind:"scalar",T:9},{no:10,name:"parsing_time",kind:"message",T:Hy},{no:11,name:"version",kind:"scalar",T:9}]}));var Xy=function(e){(0,d.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,c.Z)(this,n),(r=t.call(this)).name="",r.isRequired=!1,r.description="",r.typeV2=void 0,r.defaultValue=void 0,Vy.util.initPartial(e,(0,fm.Z)(r)),r}return(0,l.Z)(n,null,[{key:"fromBinary",value:function(e,t){return(new n).fromBinary(e,t)}},{key:"fromJson",value:function(e,t){return(new n).fromJson(e,t)}},{key:"fromJsonString",value:function(e,t){return(new n).fromJsonString(e,t)}},{key:"equals",value:function(e,t){return Vy.util.equals(n,e,t)}}]),n}(pm);Xy.runtime=Vy,Xy.typeName="kurtosis_package_indexer.PackageArg",Xy.fields=Vy.util.newFieldList((function(){return[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"is_required",kind:"scalar",T:8},{no:4,name:"description",kind:"scalar",T:9},{no:5,name:"typeV2",kind:"message",T:$y},{no:6,name:"defaultValue",kind:"scalar",T:9,opt:!0}]}));var $y=function(e){(0,d.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,c.Z)(this,n),(r=t.call(this)).topLevelType=Wy.BOOL,r.innerType1=void 0,r.innerType2=void 0,Vy.util.initPartial(e,(0,fm.Z)(r)),r}return(0,l.Z)(n,null,[{key:"fromBinary",value:function(e,t){return(new n).fromBinary(e,t)}},{key:"fromJson",value:function(e,t){return(new n).fromJson(e,t)}},{key:"fromJsonString",value:function(e,t){return(new n).fromJsonString(e,t)}},{key:"equals",value:function(e,t){return Vy.util.equals(n,e,t)}}]),n}(pm);$y.runtime=Vy,$y.typeName="kurtosis_package_indexer.PackageArgumentType",$y.fields=Vy.util.newFieldList((function(){return[{no:1,name:"top_level_type",kind:"enum",T:Vy.getEnumType(Wy)},{no:2,name:"inner_type_1",kind:"enum",T:Vy.getEnumType(Wy),opt:!0},{no:3,name:"inner_type_2",kind:"enum",T:Vy.getEnumType(Wy),opt:!0}]}));var Qy=function(e){(0,d.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,c.Z)(this,n),(r=t.call(this)).baseUrl="",r.owner="",r.name="",r.rootPath="",Vy.util.initPartial(e,(0,fm.Z)(r)),r}return(0,l.Z)(n,null,[{key:"fromBinary",value:function(e,t){return(new n).fromBinary(e,t)}},{key:"fromJson",value:function(e,t){return(new n).fromJson(e,t)}},{key:"fromJsonString",value:function(e,t){return(new n).fromJsonString(e,t)}},{key:"equals",value:function(e,t){return Vy.util.equals(n,e,t)}}]),n}(pm);Qy.runtime=Vy,Qy.typeName="kurtosis_package_indexer.PackageRepository",Qy.fields=Vy.util.newFieldList((function(){return[{no:1,name:"base_url",kind:"scalar",T:9},{no:2,name:"owner",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"root_path",kind:"scalar",T:9}]}));var eb={typeName:"kurtosis_package_indexer.KurtosisPackageIndexer",methods:{isAvailable:{name:"IsAvailable",I:qy,O:qy,kind:am.Unary},getPackages:{name:"GetPackages",I:qy,O:Yy,kind:am.Unary},reindex:{name:"Reindex",I:qy,O:qy,kind:am.Unary},readPackage:{name:"ReadPackage",I:Jy,O:Gy,kind:am.Unary}}},tb=function(){function e(){var t=this;(0,c.Z)(this,e),this.client=void 0,this.getPackages=s((0,a.Z)().mark((function e(){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",om((function(){return t.client.getPackages({})})));case 1:case"end":return e.stop()}}),e)}))),this.readPackage=function(){var e=s((0,a.Z)().mark((function e(n){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",om((function(){return t.client.readPackage(new Jy({repositoryMetadata:t.parsePackageUrl(n)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.client=Tm(eb,pg({baseUrl:"https://cloud.kurtosis.com:9770"}))}return(0,l.Z)(e,[{key:"parsePackageUrl",value:function(e){var t=e.split("/");if(t.length<3)throw Error("Illegal url, invalid number of components: ".concat(e));if(t[1].length<1||t[2].length<1)throw Error("Illegal url, empty components: ".concat(e));return new Qy({baseUrl:"github.com",owner:t[1],name:t[2],rootPath:t.filter((function(e,t){return t>2&&e.length>0})).join("/")+"/"})}}]),e}(),nb=(0,r.createContext)({client:null}),rb=function(e){var t=e.children,n=(0,r.useMemo)((function(){return new Proxy(new tb,{get:function(e,t){return"getPackages"===t||"readPackage"===t?new Proxy(e[t],{apply:function(e,t,n){return Reflect.apply(e,t,n).then((function(e){return e.isErr&&console.error(e.error),e}))}}):Reflect.get(e,t)}})}),[]);return(0,pa.jsx)(nb.Provider,{value:{client:n},children:t})},ob=function(){var e=(0,r.useContext)(nb).client;return tm(e,"useKurtosisPackageIndexerClient used incorrectly - KurtosisPackageIndexerClient is not currently available."),e};function ib(e){var t=e.viewBox,n=void 0===t?"0 0 24 24":t,o=e.d,i=e.displayName,a=e.defaultProps,u=void 0===a?{}:a,s=r.Children.toArray(e.path),l=gn((function(e,t){return(0,pa.jsx)(Ra,hn(hn(hn({ref:t,viewBox:n},u),e),{},{children:s.length?s:(0,pa.jsx)("path",{fill:"currentColor",d:o})}))}));return l.displayName=i,l}var ab=ib({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"}),ub=ja({name:"BreadcrumbStylesContext",errorMessage:"useBreadcrumbStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),sb=(0,f.Z)(ub,2),lb=sb[0],cb=sb[1];function fb(e){return r.Children.toArray(e).filter((function(e){return(0,r.isValidElement)(e)}))}var db=["children","spacing","separator","className","listProps"],pb=gn((function(e,t){var n=Ea("Breadcrumb",e),o=mo(e),i=o.children,a=o.spacing,u=void 0===a?"0.5rem":a,s=o.separator,l=void 0===s?"/":s,c=o.className,f=o.listProps,d=mn(o,db),p=fb(i),h=p.length,v=p.map((function(e,t){return(0,r.cloneElement)(e,{separator:l,spacing:u,isLastChild:h===t+1})})),m=yn("chakra-breadcrumb",c);return(0,pa.jsx)(da.nav,hn(hn({ref:t,"aria-label":"breadcrumb",className:m,__css:n.container},d),{},{children:(0,pa.jsx)(lb,{value:n,children:(0,pa.jsx)(da.ol,hn(hn({className:"chakra-breadcrumb__list"},f),{},{__css:hn({display:"flex",alignItems:"center"},n.list),children:v}))})}))}));pb.displayName="Breadcrumb";var hb=["isCurrentPage","as","className","href"],vb=gn((function(e,t){var n=e.isCurrentPage,r=e.as,o=e.className,i=e.href,a=mn(e,hb),u=cb(),s=hn({ref:t,as:r,className:yn("chakra-breadcrumb__link",o)},a);return n?(0,pa.jsx)(da.span,hn({"aria-current":"page",__css:u.link},s)):(0,pa.jsx)(da.a,hn({__css:u.link,href:i},s))}));vb.displayName="BreadcrumbLink";var mb=["spacing"],gb=gn((function(e,t){var n=e.spacing,r=mn(e,mb),o=hn({mx:n},cb().separator);return(0,pa.jsx)(da.span,hn(hn({ref:t,role:"presentation"},r),{},{__css:o}))}));gb.displayName="BreadcrumbSeparator";var yb=["isCurrentPage","separator","isLastChild","spacing","children","className"],bb=gn((function(e,t){var n=e.isCurrentPage,o=e.separator,i=e.isLastChild,a=e.spacing,u=e.children,s=e.className,l=mn(e,yb),c=fb(u).map((function(e){return e.type===vb?(0,r.cloneElement)(e,{isCurrentPage:n}):e.type===gb?(0,r.cloneElement)(e,{spacing:a,children:e.props.children||o}):e})),f=hn({display:"inline-flex",alignItems:"center"},cb().item),d=yn("chakra-breadcrumb__list-item",s);return(0,pa.jsxs)(da.li,hn(hn({ref:t,className:d},l),{},{__css:f,children:[c,!i&&(0,pa.jsx)(gb,{spacing:a,children:o})]}))}));bb.displayName="BreadcrumbItem";var wb=ja({strict:!1,name:"ButtonGroupContext"}),kb=(0,f.Z)(wb,2),xb=kb[0],Sb=kb[1],Tb=["children","className"];function Eb(e){var t=e.children,n=e.className,o=mn(e,Tb),i=(0,r.isValidElement)(t)?(0,r.cloneElement)(t,{"aria-hidden":!0,focusable:!1}):t,a=yn("chakra-button__icon",n);return(0,pa.jsx)(da.span,hn(hn({display:"inline-flex",alignSelf:"center",flexShrink:0},o),{},{className:a,children:i}))}Eb.displayName="ButtonIcon";var _b=["label","placement","spacing","children","className","__css"];function Cb(e){var t=e.label,n=e.placement,o=e.spacing,i=void 0===o?"0.5rem":o,a=e.children,u=void 0===a?(0,pa.jsx)(Ia,{color:"currentColor",width:"1em",height:"1em"}):a,s=e.className,l=e.__css,c=mn(e,_b),f=yn("chakra-button__spinner",s),d="start"===n?"marginEnd":"marginStart",p=(0,r.useMemo)((function(){var e;return hn((e={display:"flex",alignItems:"center",position:t?"relative":"absolute"},(0,h.Z)(e,d,t?i:0),(0,h.Z)(e,"fontSize","1em"),(0,h.Z)(e,"lineHeight","normal"),e),l)}),[l,t,d,i]);return(0,pa.jsx)(da.div,hn(hn({className:f},c),{},{__css:p,children:u}))}Cb.displayName="ButtonSpinner";var Ib=["isDisabled","isLoading","isActive","children","leftIcon","rightIcon","loadingText","iconSpacing","type","spinner","spinnerPlacement","className","as"],Ob=gn((function(e,t){var n=Sb(),o=Ta("Button",hn(hn({},n),e)),i=mo(e),a=i.isDisabled,u=void 0===a?null==n?void 0:n.isDisabled:a,s=i.isLoading,l=i.isActive,c=i.children,d=i.leftIcon,p=i.rightIcon,h=i.loadingText,v=i.iconSpacing,m=void 0===v?"0.5rem":v,g=i.type,y=i.spinner,b=i.spinnerPlacement,w=void 0===b?"start":b,k=i.className,x=i.as,S=mn(i,Ib),T=(0,r.useMemo)((function(){var e=hn(hn({},null==o?void 0:o._focus),{},{zIndex:1});return hn(hn({display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none"},o),!!n&&{_focus:e})}),[o,n]),E=function(e){var t=(0,r.useState)(!e),n=(0,f.Z)(t,2),o=n[0],i=n[1],a=(0,r.useCallback)((function(e){e&&i("BUTTON"===e.tagName)}),[]);return{ref:a,type:o?"button":void 0}}(x),_=E.ref,C=E.type,I={rightIcon:p,leftIcon:d,iconSpacing:m,children:c};return(0,pa.jsxs)(da.button,hn(hn({ref:iu(t,_),as:x,type:null!=g?g:C,"data-active":Sn(l),"data-loading":Sn(s),__css:T,className:yn("chakra-button",k)},S),{},{disabled:u||s,children:[s&&"start"===w&&(0,pa.jsx)(Cb,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:m,children:y}),s?h||(0,pa.jsx)(da.span,{opacity:0,children:(0,pa.jsx)(Pb,hn({},I))}):(0,pa.jsx)(Pb,hn({},I)),s&&"end"===w&&(0,pa.jsx)(Cb,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:m,children:y})]}))}));function Pb(e){var t=e.leftIcon,n=e.rightIcon,r=e.children,o=e.iconSpacing;return(0,pa.jsxs)(pa.Fragment,{children:[t&&(0,pa.jsx)(Eb,{marginEnd:o,children:t}),r,n&&(0,pa.jsx)(Eb,{marginStart:o,children:n})]})}Ob.displayName="Button";var Nb=["size","colorScheme","variant","className","spacing","isAttached","isDisabled","orientation"],Ab={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},Rb={horizontal:function(e){return{"& > *:not(style) ~ *:not(style)":{marginStart:e}}},vertical:function(e){return{"& > *:not(style) ~ *:not(style)":{marginTop:e}}}},Db=gn((function(e,t){var n=e.size,o=e.colorScheme,i=e.variant,a=e.className,u=e.spacing,s=void 0===u?"0.5rem":u,l=e.isAttached,c=e.isDisabled,f=e.orientation,d=void 0===f?"horizontal":f,p=mn(e,Nb),h=yn("chakra-button__group",a),v=(0,r.useMemo)((function(){return{size:n,colorScheme:o,variant:i,isDisabled:c}}),[n,o,i,c]),m=hn({display:"inline-flex"},l?Ab[d]:Rb[d](s)),g="vertical"===d;return(0,pa.jsx)(xb,{value:v,children:(0,pa.jsx)(da.div,hn({ref:t,role:"group",__css:m,className:h,"data-attached":l?"":void 0,"data-orientation":d,flexDir:g?"column":void 0},p))})}));function jb(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.timeout,n=void 0===t?300:t,o=e.preventDefault,i=void 0===o?function(){return!0}:o,a=(0,r.useState)([]),u=(0,f.Z)(a,2),s=u[0],l=u[1],c=(0,r.useRef)(),d=function(){c.current&&(clearTimeout(c.current),c.current=null)};return(0,r.useEffect)((function(){return d}),[]),function(e){return function(t){if("Backspace"===t.key){var r=(0,C.Z)(s);return r.pop(),void l(r)}if(function(e){var t=e.key;return 1===t.length||t.length>1&&/[^a-zA-Z0-9]/.test(t)}(t)){var o=s.concat(t.key);i(t)&&(t.preventDefault(),t.stopPropagation()),l(o),e(o.join("")),d(),c.current=setTimeout((function(){l([]),c.current=null}),n)}}}}Db.displayName="ButtonGroup";var Zb=["ref","isDisabled","isFocusable","clickOnEnter","clickOnSpace","onMouseDown","onMouseUp","onClick","onKeyDown","onKeyUp","tabIndex","onMouseOver","onMouseLeave"];function Fb(e){var t=e.target,n=t.tagName,r=t.isContentEditable;return"INPUT"!==n&&"TEXTAREA"!==n&&!0!==r}function Mb(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ref,n=e.isDisabled,o=e.isFocusable,i=e.clickOnEnter,a=void 0===i||i,u=e.clickOnSpace,s=void 0===u||u,l=e.onMouseDown,c=e.onMouseUp,d=e.onClick,p=e.onKeyDown,h=e.onKeyUp,v=e.tabIndex,m=e.onMouseOver,g=e.onMouseLeave,y=mn(e,Zb),b=(0,r.useState)(!0),w=(0,f.Z)(b,2),k=w[0],x=w[1],S=(0,r.useState)(!1),T=(0,f.Z)(S,2),E=T[0],_=T[1],C=function(){var e=(0,r.useRef)(new Map),t=e.current,n=(0,r.useCallback)((function(t,n,r,o){e.current.set(r,{type:n,el:t,options:o}),t.addEventListener(n,r,o)}),[]),o=(0,r.useCallback)((function(t,n,r,o){t.removeEventListener(n,r,o),e.current.delete(r)}),[]);return(0,r.useEffect)((function(){return function(){t.forEach((function(e,t){o(e.el,e.type,t,e.options)}))}}),[o,t]),{add:n,remove:o}}(),I=k?v:v||0,O=n&&!o,P=(0,r.useCallback)((function(e){if(n)return e.stopPropagation(),void e.preventDefault();e.currentTarget.focus(),null==d||d(e)}),[n,d]),N=(0,r.useCallback)((function(e){E&&Fb(e)&&(e.preventDefault(),e.stopPropagation(),_(!1),C.remove(document,"keyup",N,!1))}),[E,C]),A=(0,r.useCallback)((function(e){if(null==p||p(e),!(n||e.defaultPrevented||e.metaKey)&&Fb(e.nativeEvent)&&!k){var t=a&&"Enter"===e.key;if(s&&" "===e.key&&(e.preventDefault(),_(!0)),t)e.preventDefault(),e.currentTarget.click();C.add(document,"keyup",N,!1)}}),[n,k,p,a,s,C,N]),R=(0,r.useCallback)((function(e){(null==h||h(e),n||e.defaultPrevented||e.metaKey)||Fb(e.nativeEvent)&&!k&&s&&" "===e.key&&(e.preventDefault(),_(!1),e.currentTarget.click())}),[s,k,n,h]),D=(0,r.useCallback)((function(e){0===e.button&&(_(!1),C.remove(document,"mouseup",D,!1))}),[C]),j=(0,r.useCallback)((function(e){if(0===e.button){if(n)return e.stopPropagation(),void e.preventDefault();k||_(!0),e.currentTarget.focus({preventScroll:!0}),C.add(document,"mouseup",D,!1),null==l||l(e)}}),[n,k,l,C,D]),Z=(0,r.useCallback)((function(e){0===e.button&&(k||_(!1),null==c||c(e))}),[c,k]),F=(0,r.useCallback)((function(e){n?e.preventDefault():null==m||m(e)}),[n,m]),M=(0,r.useCallback)((function(e){E&&(e.preventDefault(),_(!1)),null==g||g(e)}),[E,g]),L=ou(t,(function(e){e&&"BUTTON"!==e.tagName&&x(!1)}));return hn(hn({},y),{},k?{ref:L,type:"button","aria-disabled":O?void 0:n,disabled:O,onClick:P,onMouseDown:l,onMouseUp:c,onKeyUp:h,onKeyDown:p,onMouseOver:m,onMouseLeave:g}:{ref:L,role:"button","data-active":Sn(E),"aria-disabled":n?"true":void 0,tabIndex:O?void 0:I,onClick:P,onMouseDown:j,onMouseUp:Z,onKeyUp:R,onKeyDown:A,onMouseOver:F,onMouseLeave:M})}function Lb(e){return null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Bb(e){var t;return!!Lb(e)&&e instanceof(null!=(t=e.ownerDocument.defaultView)?t:window).HTMLElement}function zb(e){return Lb(e)?e.ownerDocument:document}var Vb=function(e){return e.hasAttribute("tabindex")},Ub=function(e){return Vb(e)&&-1===e.tabIndex};function qb(e){return!(!e.parentElement||!qb(e.parentElement))||e.hidden}function Hb(e){if(!Bb(e)||qb(e)||function(e){return!0===Boolean(e.getAttribute("disabled"))||!0===Boolean(e.getAttribute("aria-disabled"))}(e))return!1;var t=e.localName;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;var n={a:function(){return e.hasAttribute("href")},audio:function(){return e.hasAttribute("controls")},video:function(){return e.hasAttribute("controls")}};return t in n?n[t]():!!function(e){var t=e.getAttribute("contenteditable");return"false"!==t&&null!=t}(e)||Vb(e)}var Wb=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"].join(),Jb=function(e){return e.offsetWidth>0&&e.offsetHeight>0};function Gb(e){var t=Array.from(e.querySelectorAll(Wb));return t.unshift(e),t.filter((function(e){return Hb(e)&&Jb(e)}))}function Yb(e,t,n,o){var i=Tu(n);return(0,r.useEffect)((function(){var r="function"===typeof e?e():null!=e?e:document;if(n&&r)return r.addEventListener(t,i,o),function(){r.removeEventListener(t,i,o)}}),[t,e,o,i,n]),function(){var n="function"===typeof e?e():null!=e?e:document;null==n||n.removeEventListener(t,i,o)}}var Kb=Boolean(null==globalThis?void 0:globalThis.document)?r.useLayoutEffect:r.useEffect;function Xb(e,t){var n=(0,r.useRef)(!1),o=(0,r.useRef)(!1);(0,r.useEffect)((function(){if(n.current&&o.current)return e();o.current=!0}),t),(0,r.useEffect)((function(){return n.current=!0,function(){n.current=!1}}),[])}function $b(e){var t=e.current;if(!t)return!1;var n,r=function(e){return zb(e).activeElement}(t);return!!r&&(!t.contains(r)&&!(!((n=r)&&Bb(n)&&Hb(n))||Ub(n)))}function Qb(e,t){var n=t.shouldFocus,r=t.visible,o=t.focusRef,i=n&&!r;Xb((function(){if(i&&!$b(e)){var t,n=(null==o?void 0:o.current)||e.current;return n?(t=requestAnimationFrame((function(){n.focus({preventScroll:!0})})),function(){cancelAnimationFrame(t)}):void 0}}),[i,e,o])}var ew={preventScroll:!0,shouldFocus:!1};var tw=function(e,t){return{var:e,varRef:t?"var(".concat(e,", ").concat(t,")"):"var(".concat(e,")")}},nw={arrowShadowColor:tw("--popper-arrow-shadow-color"),arrowSize:tw("--popper-arrow-size","8px"),arrowSizeHalf:tw("--popper-arrow-size-half"),arrowBg:tw("--popper-arrow-bg"),transformOrigin:tw("--popper-transform-origin"),arrowOffset:tw("--popper-arrow-offset")};var rw={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},ow={scroll:!0,resize:!0};var iw={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;t.styles.popper.width="".concat(t.rects.reference.width,"px")},effect:function(e){var t=e.state;return function(){var e=t.elements.reference;t.elements.popper.style.width="".concat(e.offsetWidth,"px")}}},aw={name:"transformOrigin",enabled:!0,phase:"write",fn:function(e){var t=e.state;uw(t)},effect:function(e){var t=e.state;return function(){uw(t)}}},uw=function(e){var t;e.elements.popper.style.setProperty(nw.transformOrigin.var,(t=e.placement,rw[t]))},sw={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:function(e){var t=e.state;lw(t)}},lw=function(e){var t;if(e.placement){var n=cw(e.placement);if((null==(t=e.elements)?void 0:t.arrow)&&n){var r,o;Object.assign(e.elements.arrow.style,(r={},(0,h.Z)(r,n.property,n.value),(0,h.Z)(r,"width",nw.arrowSize.varRef),(0,h.Z)(r,"height",nw.arrowSize.varRef),(0,h.Z)(r,"zIndex",-1),r));var i=(o={},(0,h.Z)(o,nw.arrowSizeHalf.var,"calc(".concat(nw.arrowSize.varRef," / 2 - 1px)")),(0,h.Z)(o,nw.arrowOffset.var,"calc(".concat(nw.arrowSizeHalf.varRef," * -1)")),o);for(var a in i)e.elements.arrow.style.setProperty(a,i[a])}}},cw=function(e){return e.startsWith("top")?{property:"bottom",value:nw.arrowOffset.varRef}:e.startsWith("bottom")?{property:"top",value:nw.arrowOffset.varRef}:e.startsWith("left")?{property:"right",value:nw.arrowOffset.varRef}:e.startsWith("right")?{property:"left",value:nw.arrowOffset.varRef}:void 0},fw={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:function(e){var t=e.state;dw(t)},effect:function(e){var t=e.state;return function(){dw(t)}}},dw=function(e){if(e.elements.arrow){var t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(t){var n,r=(n=e.placement).includes("top")?"1px 1px 0px 0 var(--popper-arrow-shadow-color)":n.includes("bottom")?"-1px -1px 0px 0 var(--popper-arrow-shadow-color)":n.includes("right")?"-1px 1px 0px 0 var(--popper-arrow-shadow-color)":n.includes("left")?"1px -1px 0px 0 var(--popper-arrow-shadow-color)":void 0;r&&t.style.setProperty("--popper-arrow-default-shadow",r),Object.assign(t.style,{transform:"rotate(45deg)",background:nw.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})}}},pw={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},hw={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function vw(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function mw(e){return e instanceof vw(e).Element||e instanceof Element}function gw(e){return e instanceof vw(e).HTMLElement||e instanceof HTMLElement}function yw(e){return"undefined"!==typeof ShadowRoot&&(e instanceof vw(e).ShadowRoot||e instanceof ShadowRoot)}var bw=Math.max,ww=Math.min,kw=Math.round;function xw(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Sw(){return!/^((?!chrome|android).)*safari/i.test(xw())}function Tw(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&gw(e)&&(o=e.offsetWidth>0&&kw(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&kw(r.height)/e.offsetHeight||1);var a=(mw(e)?vw(e):window).visualViewport,u=!Sw()&&n,s=(r.left+(u&&a?a.offsetLeft:0))/o,l=(r.top+(u&&a?a.offsetTop:0))/i,c=r.width/o,f=r.height/i;return{width:c,height:f,top:l,right:s+c,bottom:l+f,left:s,x:s,y:l}}function Ew(e){var t=vw(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function _w(e){return e?(e.nodeName||"").toLowerCase():null}function Cw(e){return((mw(e)?e.ownerDocument:e.document)||window.document).documentElement}function Iw(e){return Tw(Cw(e)).left+Ew(e).scrollLeft}function Ow(e){return vw(e).getComputedStyle(e)}function Pw(e){var t=Ow(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Nw(e,t,n){void 0===n&&(n=!1);var r=gw(t),o=gw(t)&&function(e){var t=e.getBoundingClientRect(),n=kw(t.width)/e.offsetWidth||1,r=kw(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),i=Cw(t),a=Tw(e,o,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(r||!r&&!n)&&(("body"!==_w(t)||Pw(i))&&(u=function(e){return e!==vw(e)&&gw(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:Ew(e);var t}(t)),gw(t)?((s=Tw(t,!0)).x+=t.clientLeft,s.y+=t.clientTop):i&&(s.x=Iw(i))),{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function Aw(e){var t=Tw(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Rw(e){return"html"===_w(e)?e:e.assignedSlot||e.parentNode||(yw(e)?e.host:null)||Cw(e)}function Dw(e){return["html","body","#document"].indexOf(_w(e))>=0?e.ownerDocument.body:gw(e)&&Pw(e)?e:Dw(Rw(e))}function jw(e,t){var n;void 0===t&&(t=[]);var r=Dw(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=vw(r),a=o?[i].concat(i.visualViewport||[],Pw(r)?r:[]):r,u=t.concat(a);return o?u:u.concat(jw(Rw(a)))}function Zw(e){return["table","td","th"].indexOf(_w(e))>=0}function Fw(e){return gw(e)&&"fixed"!==Ow(e).position?e.offsetParent:null}function Mw(e){for(var t=vw(e),n=Fw(e);n&&Zw(n)&&"static"===Ow(n).position;)n=Fw(n);return n&&("html"===_w(n)||"body"===_w(n)&&"static"===Ow(n).position)?t:n||function(e){var t=/firefox/i.test(xw());if(/Trident/i.test(xw())&&gw(e)&&"fixed"===Ow(e).position)return null;var n=Rw(e);for(yw(n)&&(n=n.host);gw(n)&&["html","body"].indexOf(_w(n))<0;){var r=Ow(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var Lw="top",Bw="bottom",zw="right",Vw="left",Uw="auto",qw=[Lw,Bw,zw,Vw],Hw="start",Ww="end",Jw="clippingParents",Gw="viewport",Yw="popper",Kw="reference",Xw=qw.reduce((function(e,t){return e.concat([t+"-"+Hw,t+"-"+Ww])}),[]),$w=[].concat(qw,[Uw]).reduce((function(e,t){return e.concat([t,t+"-"+Hw,t+"-"+Ww])}),[]),Qw=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ek(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function tk(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var nk={placement:"bottom",modifiers:[],strategy:"absolute"};function rk(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ck(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?uk(o):null,a=o?sk(o):null,u=n.x+n.width/2-r.width/2,s=n.y+n.height/2-r.height/2;switch(i){case Lw:t={x:u,y:n.y-r.height};break;case Bw:t={x:u,y:n.y+n.height};break;case zw:t={x:n.x+n.width,y:s};break;case Vw:t={x:n.x-r.width,y:s};break;default:t={x:n.x,y:n.y}}var l=i?lk(i):null;if(null!=l){var c="y"===l?"height":"width";switch(a){case Hw:t[l]=t[l]-(n[c]/2-r[c]/2);break;case Ww:t[l]=t[l]+(n[c]/2-r[c]/2)}}return t}var fk={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ck({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},dk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function pk(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,u=e.position,s=e.gpuAcceleration,l=e.adaptive,c=e.roundOffsets,f=e.isFixed,d=a.x,p=void 0===d?0:d,h=a.y,v=void 0===h?0:h,m="function"===typeof c?c({x:p,y:v}):{x:p,y:v};p=m.x,v=m.y;var g=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=Vw,w=Lw,k=window;if(l){var x=Mw(n),S="clientHeight",T="clientWidth";if(x===vw(n)&&"static"!==Ow(x=Cw(n)).position&&"absolute"===u&&(S="scrollHeight",T="scrollWidth"),o===Lw||(o===Vw||o===zw)&&i===Ww)w=Bw,v-=(f&&x===k&&k.visualViewport?k.visualViewport.height:x[S])-r.height,v*=s?1:-1;if(o===Vw||(o===Lw||o===Bw)&&i===Ww)b=zw,p-=(f&&x===k&&k.visualViewport?k.visualViewport.width:x[T])-r.width,p*=s?1:-1}var E,_=Object.assign({position:u},l&&dk),C=!0===c?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:kw(n*o)/o||0,y:kw(r*o)/o||0}}({x:p,y:v},vw(n)):{x:p,y:v};return p=C.x,v=C.y,s?Object.assign({},_,((E={})[w]=y?"0":"",E[b]=g?"0":"",E.transform=(k.devicePixelRatio||1)<=1?"translate("+p+"px, "+v+"px)":"translate3d("+p+"px, "+v+"px, 0)",E)):Object.assign({},_,((t={})[w]=y?v+"px":"",t[b]=g?p+"px":"",t.transform="",t))}var hk={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,u=n.roundOffsets,s=void 0===u||u,l={placement:uk(t.placement),variation:sk(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,pk(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,pk(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var vk={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];gw(o)&&_w(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});gw(r)&&_w(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var mk={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=$w.reduce((function(e,n){return e[n]=function(e,t,n){var r=uk(e),o=[Vw,Lw].indexOf(r)>=0?-1:1,i="function"===typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],u=i[1];return a=a||0,u=(u||0)*o,[Vw,zw].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}(n,t.rects,i),e}),{}),u=a[t.placement],s=u.x,l=u.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},gk={left:"right",right:"left",bottom:"top",top:"bottom"};function yk(e){return e.replace(/left|right|bottom|top/g,(function(e){return gk[e]}))}var bk={start:"end",end:"start"};function wk(e){return e.replace(/start|end/g,(function(e){return bk[e]}))}function kk(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&yw(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function xk(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Sk(e,t,n){return t===Gw?xk(function(e,t){var n=vw(e),r=Cw(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,u=0,s=0;if(o){i=o.width,a=o.height;var l=Sw();(l||!l&&"fixed"===t)&&(u=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:u+Iw(e),y:s}}(e,n)):mw(t)?function(e,t){var n=Tw(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):xk(function(e){var t,n=Cw(e),r=Ew(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=bw(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=bw(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-r.scrollLeft+Iw(e),s=-r.scrollTop;return"rtl"===Ow(o||n).direction&&(u+=bw(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:u,y:s}}(Cw(e)))}function Tk(e,t,n,r){var o="clippingParents"===t?function(e){var t=jw(Rw(e)),n=["absolute","fixed"].indexOf(Ow(e).position)>=0&&gw(e)?Mw(e):e;return mw(n)?t.filter((function(e){return mw(e)&&kk(e,n)&&"body"!==_w(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],u=i.reduce((function(t,n){var o=Sk(e,n,r);return t.top=bw(o.top,t.top),t.right=ww(o.right,t.right),t.bottom=ww(o.bottom,t.bottom),t.left=bw(o.left,t.left),t}),Sk(e,a,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function Ek(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function _k(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Ck(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,u=n.boundary,s=void 0===u?Jw:u,l=n.rootBoundary,c=void 0===l?Gw:l,f=n.elementContext,d=void 0===f?Yw:f,p=n.altBoundary,h=void 0!==p&&p,v=n.padding,m=void 0===v?0:v,g=Ek("number"!==typeof m?m:_k(m,qw)),y=d===Yw?Kw:Yw,b=e.rects.popper,w=e.elements[h?y:d],k=Tk(mw(w)?w:w.contextElement||Cw(e.elements.popper),s,c,a),x=Tw(e.elements.reference),S=ck({reference:x,element:b,strategy:"absolute",placement:o}),T=xk(Object.assign({},b,S)),E=d===Yw?T:x,_={top:k.top-E.top+g.top,bottom:E.bottom-k.bottom+g.bottom,left:k.left-E.left+g.left,right:E.right-k.right+g.right},C=e.modifiersData.offset;if(d===Yw&&C){var I=C[o];Object.keys(_).forEach((function(e){var t=[zw,Bw].indexOf(e)>=0?1:-1,n=[Lw,Bw].indexOf(e)>=0?"y":"x";_[e]+=I[n]*t}))}return _}var Ik={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,u=void 0===a||a,s=n.fallbackPlacements,l=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=void 0===p||p,v=n.allowedAutoPlacements,m=t.options.placement,g=uk(m),y=s||(g===m||!h?[yk(m)]:function(e){if(uk(e)===Uw)return[];var t=yk(e);return[wk(e),t,wk(t)]}(m)),b=[m].concat(y).reduce((function(e,n){return e.concat(uk(n)===Uw?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,u=n.flipVariations,s=n.allowedAutoPlacements,l=void 0===s?$w:s,c=sk(r),f=c?u?Xw:Xw.filter((function(e){return sk(e)===c})):qw,d=f.filter((function(e){return l.indexOf(e)>=0}));0===d.length&&(d=f);var p=d.reduce((function(t,n){return t[n]=Ck(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[uk(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:c,rootBoundary:f,padding:l,flipVariations:h,allowedAutoPlacements:v}):n)}),[]),w=t.rects.reference,k=t.rects.popper,x=new Map,S=!0,T=b[0],E=0;E=0,P=O?"width":"height",N=Ck(t,{placement:_,boundary:c,rootBoundary:f,altBoundary:d,padding:l}),A=O?I?zw:Vw:I?Bw:Lw;w[P]>k[P]&&(A=yk(A));var R=yk(A),D=[];if(i&&D.push(N[C]<=0),u&&D.push(N[A]<=0,N[R]<=0),D.every((function(e){return e}))){T=_,S=!1;break}x.set(_,D)}if(S)for(var j=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return T=t,"break"},Z=h?3:1;Z>0;Z--){if("break"===j(Z))break}t.placement!==T&&(t.modifiersData[r]._skip=!0,t.placement=T,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ok(e,t,n){return bw(e,ww(t,n))}var Pk={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,u=void 0!==a&&a,s=n.boundary,l=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,p=void 0===d||d,h=n.tetherOffset,v=void 0===h?0:h,m=Ck(t,{boundary:s,rootBoundary:l,padding:f,altBoundary:c}),g=uk(t.placement),y=sk(t.placement),b=!y,w=lk(g),k="x"===w?"y":"x",x=t.modifiersData.popperOffsets,S=t.rects.reference,T=t.rects.popper,E="function"===typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,_="number"===typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(x){if(i){var O,P="y"===w?Lw:Vw,N="y"===w?Bw:zw,A="y"===w?"height":"width",R=x[w],D=R+m[P],j=R-m[N],Z=p?-T[A]/2:0,F=y===Hw?S[A]:T[A],M=y===Hw?-T[A]:-S[A],L=t.elements.arrow,B=p&&L?Aw(L):{width:0,height:0},z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=z[P],U=z[N],q=Ok(0,S[A],B[A]),H=b?S[A]/2-Z-q-V-_.mainAxis:F-q-V-_.mainAxis,W=b?-S[A]/2+Z+q+U+_.mainAxis:M+q+U+_.mainAxis,J=t.elements.arrow&&Mw(t.elements.arrow),G=J?"y"===w?J.clientTop||0:J.clientLeft||0:0,Y=null!=(O=null==C?void 0:C[w])?O:0,K=R+W-Y,X=Ok(p?ww(D,R+H-Y-G):D,R,p?bw(j,K):j);x[w]=X,I[w]=X-R}if(u){var $,Q="x"===w?Lw:Vw,ee="x"===w?Bw:zw,te=x[k],ne="y"===k?"height":"width",re=te+m[Q],oe=te-m[ee],ie=-1!==[Lw,Vw].indexOf(g),ae=null!=($=null==C?void 0:C[k])?$:0,ue=ie?re:te-S[ne]-T[ne]-ae+_.altAxis,se=ie?te+S[ne]+T[ne]-ae-_.altAxis:oe,le=p&&ie?function(e,t,n){var r=Ok(e,t,n);return r>n?n:r}(ue,te,se):Ok(p?ue:re,te,p?se:oe);x[k]=le,I[k]=le-te}t.modifiersData[r]=I}},requiresIfExists:["offset"]};var Nk={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,u=uk(n.placement),s=lk(u),l=[Vw,zw].indexOf(u)>=0?"height":"width";if(i&&a){var c=function(e,t){return Ek("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:_k(e,qw))}(o.padding,n),f=Aw(i),d="y"===s?Lw:Vw,p="y"===s?Bw:zw,h=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],v=a[s]-n.rects.reference[s],m=Mw(i),g=m?"y"===s?m.clientHeight||0:m.clientWidth||0:0,y=h/2-v/2,b=c[d],w=g-f[l]-c[p],k=g/2-f[l]/2+y,x=Ok(b,k,w),S=s;n.modifiersData[r]=((t={})[S]=x,t.centerOffset=x-k,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!==typeof r||(r=t.elements.popper.querySelector(r)))&&kk(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ak(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Rk(e){return[Lw,zw,Bw,Vw].some((function(t){return e[t]>=0}))}var Dk={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Ck(t,{elementContext:"reference"}),u=Ck(t,{altBoundary:!0}),s=Ak(a,r),l=Ak(u,o,i),c=Rk(s),f=Rk(l);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}},jk=ok({defaultModifiers:[ak,fk,hk,vk,mk,Ik,Pk,Nk,Dk]}),Zk=["size","shadowColor","bg","style"];function Fk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.enabled,n=void 0===t||t,o=e.modifiers,i=e.placement,a=void 0===i?"bottom":i,u=e.strategy,s=void 0===u?"absolute":u,l=e.arrowPadding,c=void 0===l?8:l,f=e.eventListeners,d=void 0===f||f,p=e.offset,h=e.gutter,v=void 0===h?8:h,m=e.flip,g=void 0===m||m,y=e.boundary,b=void 0===y?"clippingParents":y,w=e.preventOverflow,k=void 0===w||w,x=e.matchWidth,S=e.direction,T=void 0===S?"ltr":S,E=(0,r.useRef)(null),_=(0,r.useRef)(null),I=(0,r.useRef)(null),O=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ltr",o=(null==(t=pw[e])?void 0:t[r])||e;return"ltr"===r?o:null!=(n=hw[e])?n:o}(a,T),P=(0,r.useRef)((function(){})),N=(0,r.useCallback)((function(){var e,t;n&&E.current&&_.current&&(null==(e=P.current)||e.call(P),I.current=jk(E.current,_.current,{placement:O,modifiers:[fw,sw,aw,hn(hn({},iw),{},{enabled:!!x}),hn({name:"eventListeners"},(t=d,"object"===typeof t?{enabled:!0,options:hn(hn({},ow),t)}:{enabled:t,options:ow})),{name:"arrow",options:{padding:c}},{name:"offset",options:{offset:null!=p?p:[0,v]}},{name:"flip",enabled:!!g,options:{padding:8}},{name:"preventOverflow",enabled:!!k,options:{boundary:b}}].concat((0,C.Z)(null!=o?o:[])),strategy:s}),I.current.forceUpdate(),P.current=I.current.destroy)}),[O,n,o,x,d,c,p,v,g,k,b,s]);(0,r.useEffect)((function(){return function(){var e;E.current||_.current||(null==(e=I.current)||e.destroy(),I.current=null)}}),[]);var A=(0,r.useCallback)((function(e){E.current=e,N()}),[N]),R=(0,r.useCallback)((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return hn(hn({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:ou(A,e)})}),[A]),D=(0,r.useCallback)((function(e){_.current=e,N()}),[N]),j=(0,r.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return hn(hn({},e),{},{ref:ou(D,t),style:hn(hn({},e.style),{},{position:s,minWidth:x?void 0:"max-content",inset:"0 auto auto 0"})})}),[s,D,x]),Z=(0,r.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e.size,e.shadowColor,e.bg,e.style;return hn(hn({},mn(e,Zk)),{},{ref:t,"data-popper-arrow":"",style:Mk(e)})}),[]),F=(0,r.useCallback)((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return hn(hn({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:e,"data-popper-arrow-inner":""})}),[]);return{update:function(){var e;null==(e=I.current)||e.update()},forceUpdate:function(){var e;null==(e=I.current)||e.forceUpdate()},transformOrigin:nw.transformOrigin.varRef,referenceRef:A,popperRef:D,getPopperProps:j,getArrowProps:Z,getArrowInnerProps:F,getReferenceProps:R}}function Mk(e){var t=e.size,n=e.shadowColor,r=e.bg,o=hn(hn({},e.style),{},{position:"absolute"});return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function Lk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onClose,n=e.onOpen,o=e.isOpen,i=e.id,a=Tu(n),u=Tu(t),s=(0,r.useState)(e.defaultIsOpen||!1),l=(0,f.Z)(s,2),c=l[0],d=l[1],p=void 0!==o?o:c,h=void 0!==o,v=(0,r.useId)(),m=null!=i?i:"disclosure-".concat(v),g=(0,r.useCallback)((function(){h||d(!1),null==u||u()}),[h,u]),y=(0,r.useCallback)((function(){h||d(!0),null==a||a()}),[h,a]),b=(0,r.useCallback)((function(){p?g():y()}),[p,y,g]);return{isOpen:p,onOpen:y,onClose:g,onToggle:b,isControlled:h,getButtonProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hn(hn({},e),{},{"aria-expanded":p,"aria-controls":m,onClick:function(t){var n;null==(n=e.onClick)||n.call(e,t),b()}})},getDisclosureProps:function(){return hn(hn({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{hidden:!p,id:m})}}}function Bk(e,t){var n,r=e.target;if(r&&!zk(r).contains(r))return!1;return!(null==(n=t.current)?void 0:n.contains(r))}function zk(e){var t;return null!=(t=null==e?void 0:e.ownerDocument)?t:document}function Vk(e){var t=e.isOpen,n=e.ref,o=(0,r.useState)(t),i=(0,f.Z)(o,2),a=i[0],u=i[1],s=(0,r.useState)(!1),l=(0,f.Z)(s,2),c=l[0],d=l[1];return(0,r.useEffect)((function(){c||(u(t),d(!0))}),[t,c,a]),Yb((function(){return n.current}),"animationend",(function(){u(t)})),{present:!(!t&&!a),onComplete:function(){var e,t=function(e){var t,n;return null!=(n=null==(t=zb(e))?void 0:t.defaultView)?n:window}(n.current),r=new t.CustomEvent("animationend",{bubbles:!0});null==(e=n.current)||e.dispatchEvent(r)}}}function Uk(e){var t=e.wasSelected,n=e.enabled,r=e.isSelected,o=e.mode;return!n||(!!r||!("keepMounted"!==(void 0===o?"unmount":o)||!t))}var qk=["id","closeOnSelect","closeOnBlur","initialFocusRef","autoSelect","isLazy","isOpen","defaultIsOpen","onClose","onOpen","placement","lazyBehavior","direction","computePositionOnMount"],Hk=["onMouseEnter","onMouseMove","onMouseLeave","onClick","onFocus","isDisabled","isFocusable","closeOnSelect","type"],Wk=cu(),Jk=(0,f.Z)(Wk,4),Gk=Jk[0],Yk=Jk[1],Kk=Jk[2],Xk=Jk[3],$k=ja({strict:!1,name:"MenuContext"}),Qk=(0,f.Z)($k,2),ex=Qk[0],tx=Qk[1];function nx(e){var t;return null!=(t=null==e?void 0:e.ownerDocument)?t:document}function rx(e){return nx(e).activeElement===e}function ox(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.id,n=e.closeOnSelect,o=void 0===n||n,i=e.closeOnBlur,a=void 0===i||i,u=e.initialFocusRef,s=e.autoSelect,l=void 0===s||s,c=e.isLazy,d=e.isOpen,p=e.defaultIsOpen,h=e.onClose,v=e.onOpen,m=e.placement,g=void 0===m?"bottom-start":m,y=e.lazyBehavior,b=void 0===y?"unmount":y,w=e.direction,k=e.computePositionOnMount,x=void 0!==k&&k,S=mn(e,qk),T=(0,r.useRef)(null),E=(0,r.useRef)(null),_=Kk(),C=(0,r.useCallback)((function(){requestAnimationFrame((function(){var e;null==(e=T.current)||e.focus({preventScroll:!1})}))}),[]),I=(0,r.useCallback)((function(){var e=setTimeout((function(){var e;if(u)null==(e=u.current)||e.focus();else{var t=_.firstEnabled();t&&L(t.index)}}));W.current.add(e)}),[_,u]),O=(0,r.useCallback)((function(){var e=setTimeout((function(){var e=_.lastEnabled();e&&L(e.index)}));W.current.add(e)}),[_]),P=Lk({isOpen:d,defaultIsOpen:p,onClose:h,onOpen:(0,r.useCallback)((function(){null==v||v(),l?I():C()}),[l,I,C,v])}),N=P.isOpen,A=P.onOpen,R=P.onClose,D=P.onToggle;!function(e){var t=e.ref,n=e.handler,o=e.enabled,i=void 0===o||o,a=Tu(n),u=(0,r.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;(0,r.useEffect)((function(){if(i){var e=function(e){Bk(e,t)&&(u.isPointerDown=!0)},r=function(e){u.ignoreEmulatedMouseEvents?u.ignoreEmulatedMouseEvents=!1:u.isPointerDown&&n&&Bk(e,t)&&(u.isPointerDown=!1,a(e))},o=function(e){u.ignoreEmulatedMouseEvents=!0,n&&u.isPointerDown&&Bk(e,t)&&(u.isPointerDown=!1,a(e))},s=zk(t.current);return s.addEventListener("mousedown",e,!0),s.addEventListener("mouseup",r,!0),s.addEventListener("touchstart",e,!0),s.addEventListener("touchend",o,!0),function(){s.removeEventListener("mousedown",e,!0),s.removeEventListener("mouseup",r,!0),s.removeEventListener("touchstart",e,!0),s.removeEventListener("touchend",o,!0)}}}),[n,t,a,u,i])}({enabled:N&&a,ref:T,handler:function(e){var t;(null==(t=E.current)?void 0:t.contains(e.target))||R()}});var j=Fk(hn(hn({},S),{},{enabled:N||x,placement:g,direction:w})),Z=(0,r.useState)(-1),F=(0,f.Z)(Z,2),M=F[0],L=F[1];Xb((function(){N||L(-1)}),[N]),Qb(T,{focusRef:E,visible:N,shouldFocus:!0});var B=Vk({isOpen:N,ref:T}),z=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.onMouseEnter,o=e.onMouseMove,i=e.onMouseLeave,a=e.onClick,u=e.onFocus,s=e.isDisabled,l=e.isFocusable,c=e.closeOnSelect,f=e.type,d=mn(e,Hk),p=tx(),h=p.setFocusedIndex,v=p.focusedIndex,m=p.closeOnSelect,g=p.onClose,y=p.menuRef,b=p.isOpen,w=p.menuId,k=p.rafId,x=(0,r.useRef)(null),S="".concat(w,"-menuitem-").concat((0,r.useId)()),T=Xk({disabled:s&&!l}),E=T.index,_=T.register,C=(0,r.useCallback)((function(e){null==n||n(e),s||h(E)}),[h,E,s,n]),I=(0,r.useCallback)((function(e){null==o||o(e),x.current&&!rx(x.current)&&C(e)}),[C,o]),O=(0,r.useCallback)((function(e){null==i||i(e),s||h(-1)}),[h,s,i]),P=(0,r.useCallback)((function(e){null==a||a(e),ix(e.currentTarget)&&(null!=c?c:m)&&g()}),[g,a,m,c]),N=(0,r.useCallback)((function(e){null==u||u(e),h(E)}),[h,u,E]),A=E===v,R=s&&!l;Xb((function(){if(b)return A&&!R&&x.current?(k.current&&cancelAnimationFrame(k.current),k.current=requestAnimationFrame((function(){var e;null==(e=x.current)||e.focus({preventScroll:!0}),k.current=null}))):y.current&&!rx(y.current)&&y.current.focus({preventScroll:!0}),function(){k.current&&cancelAnimationFrame(k.current)}}),[A,R,y,b]);var D=Mb({onClick:P,onFocus:N,onMouseEnter:C,onMouseMove:I,onMouseLeave:O,ref:ou(_,x,t),isDisabled:s,isFocusable:l});return hn(hn(hn({},d),D),{},{type:null!=f?f:D.type,id:S,role:"menuitem",tabIndex:A?0:-1})}var ux=["descendants"],sx=ja({name:"MenuStylesContext",errorMessage:"useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),lx=(0,f.Z)(sx,2),cx=lx[0],fx=lx[1],dx=function(e){var t=e.children,n=Ea("Menu",e),o=mo(e),i=ba().direction,a=ox(hn(hn({},o),{},{direction:i})),u=a.descendants,s=mn(a,ux),l=(0,r.useMemo)((function(){return s}),[s]),c=l.isOpen,f=l.onClose,d=l.forceUpdate;return(0,pa.jsx)(Gk,{value:u,children:(0,pa.jsx)(ex,{value:l,children:(0,pa.jsx)(cx,{value:n,children:kn(t,{isOpen:c,onClose:f,forceUpdate:d})})})})};dx.displayName="Menu";var px=["children","as"],hx=gn((function(e,t){var n=fx();return(0,pa.jsx)(da.button,hn(hn({ref:t},e),{},{__css:hn({display:"inline-flex",appearance:"none",alignItems:"center",outline:0},n.button)}))})),vx=gn((function(e,t){e.children;var n=e.as,o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=tx(),o=n.onToggle,i=n.popper,a=n.openAndFocusFirstItem,u=n.openAndFocusLastItem,s=(0,r.useCallback)((function(e){var t=e.key,n={Enter:a,ArrowDown:a,ArrowUp:u}[t];n&&(e.preventDefault(),e.stopPropagation(),n(e))}),[a,u]);return hn(hn({},e),{},{ref:ou(n.buttonRef,t,i.referenceRef),id:n.buttonId,"data-active":Sn(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:En(e.onClick,o),onKeyDown:En(e.onKeyDown,s)})}(mn(e,px),t),i=n||hx;return(0,pa.jsx)(i,hn(hn({},o),{},{className:yn("chakra-menu__menu-button",e.className),children:(0,pa.jsx)(da.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})}))}));vx.displayName="MenuButton";var mx=["icon","children","isRound","aria-label"],gx=gn((function(e,t){var n=e.icon,o=e.children,i=e.isRound,a=e["aria-label"],u=mn(e,mx),s=n||o,l=(0,r.isValidElement)(s)?(0,r.cloneElement)(s,{"aria-hidden":!0,focusable:!1}):null;return(0,pa.jsx)(Ob,hn(hn({padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":a},u),{},{children:l}))}));gx.displayName="IconButton";var yx=["rootProps","motionProps"],bx={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},wx=da(Av.div),kx=gn((function(e,t){var n,o,i=e.rootProps,a=e.motionProps,u=mn(e,yx),s=tx(),l=s.isOpen,c=s.onTransitionEnd,f=s.unstable__animationState,d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=tx();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within