diff --git a/assets/connect-modal.entry-CtT8IFxW.js b/assets/connect-modal.entry-DFVxUKHn.js similarity index 99% rename from assets/connect-modal.entry-CtT8IFxW.js rename to assets/connect-modal.entry-DFVxUKHn.js index 72eec43..3878452 100644 --- a/assets/connect-modal.entry-CtT8IFxW.js +++ b/assets/connect-modal.entry-DFVxUKHn.js @@ -1 +1 @@ -import{r as x,s as u,g as m,h as e,a as g}from"./index-BSMds1u_.js";const b="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTcgNyAxMCAxME0xNyA3IDcgMTciIHN0cm9rZT0iIzI0MjYyOSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",f=()=>{const t=!!window.chrome,r=window.navigator,i=r.vendor,a=typeof window.opr<"u",n=r.userAgent.includes("Edge"),o=/CriOS/.exec(r.userAgent),s=r.userAgent.includes("Mobile");return o?!1:t!==null&&typeof t<"u"&&i==="Google Inc."&&a===!1&&n===!1&&s===!1},v=()=>f()?"Chrome":window.navigator.userAgent.includes("Firefox")?"Firefox":null,y=()=>window.navigator.userAgent.includes("Mobile")?window.navigator.userAgent.includes("iPhone")?"IOS":"Android":null,_='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.14 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:host{all:initial}.modal-container{color:#74777d;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}.modal-body{-ms-overflow-style:none;scrollbar-width:none}.modal-body::-webkit-scrollbar{display:none}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.static{position:static}.fixed{position:fixed}.inset-0{inset:0}.z-\\[8999\\]{z-index:8999}.z-\\[9000\\]{z-index:9000}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.box-border{box-sizing:border-box}.flex{display:flex}.aspect-square{aspect-ratio:1/1}.h-full{height:100%}.max-h-\\[calc\\(100\\%-24px\\)\\]{max-height:calc(100% - 24px)}.w-full{width:100%}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.basis-9{flex-basis:2.25rem}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-3{gap:.75rem}.space-x-\\[5px\\]>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(5px*(1 - var(--tw-space-x-reverse)));margin-right:calc(5px*var(--tw-space-x-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-\\[10px\\]>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(10px*var(--tw-space-y-reverse));margin-top:calc(10px*(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-y-scroll{overflow-y:scroll}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-xl{border-radius:.75rem}.rounded-b-none{border-bottom-left-radius:0;border-bottom-right-radius:0}.border{border-width:1px}.border-\\[\\#333\\]{--tw-border-opacity:1;border-color:rgb(51 51 51/var(--tw-border-opacity))}.border-\\[\\#EFEFF2\\]{--tw-border-opacity:1;border-color:rgb(239 239 242/var(--tw-border-opacity))}.bg-\\[\\#00000040\\]{background-color:#00000040}.bg-\\[\\#323232\\]{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.p-1{padding:.25rem}.p-6{padding:1.5rem}.p-\\[14px\\]{padding:14px}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.align-text-bottom{vertical-align:text-bottom}.text-\\[9px\\]{font-size:9px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.leading-snug{line-height:1.375}.text-\\[\\#242629\\]{--tw-text-opacity:1;color:rgb(36 38 41/var(--tw-text-opacity))}.text-\\[\\#EFEFEF\\]{--tw-text-opacity:1;color:rgb(239 239 239/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-\\[0_1px_2px_0_\\#0000000A\\]{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[0_1px_2px_0_\\#0000000A\\]{--tw-shadow:0 1px 2px 0 #0000000a;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.shadow-\\[0_4px_5px_0_\\#00000005\\2c 0_16px_40px_0_\\#00000014\\]{--tw-shadow:0 4px 5px 0 #00000005,0 16px 40px 0 #00000014;--tw-shadow-colored:0 4px 5px 0 var(--tw-shadow-color),0 16px 40px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-\\[\\#FFBD7A\\]{outline-color:#ffbd7a}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-duration:.15s;animation-name:enter}.fade-in{--tw-enter-opacity:0}.slide-in-from-bottom{--tw-enter-translate-y:100%}.hover\\:bg-\\[\\#0C0C0D\\]:hover{--tw-bg-opacity:1;background-color:rgb(12 12 13/var(--tw-bg-opacity))}.hover\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\\:text-\\[\\#242629\\]:hover{--tw-text-opacity:1;color:rgb(36 38 41/var(--tw-text-opacity))}.hover\\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:shadow-\\[0_1px_2px_0_\\#00000010\\]:hover{--tw-shadow:0 1px 2px 0 #00000010;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.hover\\:shadow-\\[0_1px_2px_0_\\#00000010\\]:hover,.hover\\:shadow-\\[0_8px_16px_0_\\#00000020\\]:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:shadow-\\[0_8px_16px_0_\\#00000020\\]:hover{--tw-shadow:0 8px 16px 0 #00000020;--tw-shadow-colored:0 8px 16px 0 var(--tw-shadow-color)}.focus\\:underline:focus{text-decoration-line:underline}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-\\[3px\\]:focus{outline-width:3px}.active\\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width:768px){.md\\:max-h-\\[calc\\(100\\%-48px\\)\\]{max-height:calc(100% - 48px)}.md\\:w-\\[400px\\]{width:400px}.md\\:items-center{align-items:center}.md\\:justify-center{justify-content:center}.md\\:rounded-b-2xl{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}.md\\:zoom-in-50{--tw-enter-scale:.5}.md\\:slide-in-from-bottom-0{--tw-enter-translate-y:0px}}',k=class{constructor(t){x(this,t),this.defaultProviders=void 0,this.installedProviders=void 0,this.persistSelection=void 0,this.callback=void 0,this.cancelCallback=void 0}handleSelectProvider(t){this.persistSelection&&u(t),this.callback(m(t))}handleCloseModal(){this.cancelCallback()}getBrowserUrl(t){var r;return(r=t.chromeWebStoreUrl)!==null&&r!==void 0?r:t.mozillaAddOnsUrl}getMobileUrl(t){var r;return(r=t.iOSAppStoreUrl)!==null&&r!==void 0?r:t.googlePlayStoreUrl}getInstallUrl(t,r,i){var a,n,o,s,l,d,c,w,p,h;return i==="IOS"?(n=(a=t.iOSAppStoreUrl)!==null&&a!==void 0?a:this.getBrowserUrl(t))!==null&&n!==void 0?n:t.webUrl:r==="Chrome"?(s=(o=t.chromeWebStoreUrl)!==null&&o!==void 0?o:this.getMobileUrl(t))!==null&&s!==void 0?s:t.webUrl:r==="Firefox"?(d=(l=t.mozillaAddOnsUrl)!==null&&l!==void 0?l:this.getMobileUrl(t))!==null&&d!==void 0?d:t.webUrl:i==="Android"?(w=(c=t.googlePlayStoreUrl)!==null&&c!==void 0?c:this.getBrowserUrl(t))!==null&&w!==void 0?w:t.webUrl:(h=(p=this.getBrowserUrl(t))!==null&&p!==void 0?p:t.webUrl)!==null&&h!==void 0?h:this.getMobileUrl(t)}render(){const t=v(),r=y(),i=this.defaultProviders.filter(o=>this.installedProviders.findIndex(s=>s.id===o.id)===-1),a=this.installedProviders.length>0,n=i.length>0;return e("div",{class:"modal-container animate-in fade-in fixed inset-0 z-[8999] box-border flex h-full w-full items-end bg-[#00000040] md:items-center md:justify-center"},e("div",{class:"fixed inset-0 z-[8999]",onClick:()=>this.handleCloseModal()}),e("div",{class:"modal-body animate-in md:zoom-in-50 slide-in-from-bottom md:slide-in-from-bottom-0 z-[9000] box-border flex max-h-[calc(100%-24px)] w-full max-w-full cursor-default flex-col overflow-y-scroll rounded-2xl rounded-b-none bg-white p-6 text-sm leading-snug shadow-[0_4px_5px_0_#00000005,0_16px_40px_0_#00000014] md:max-h-[calc(100%-48px)] md:w-[400px] md:rounded-b-2xl"},e("div",{class:"flex flex-col space-y-[10px]"},e("div",{class:"flex items-center"},e("div",{class:"flex-1 text-xl font-medium text-[#242629]"},"Connect a wallet"),e("button",{class:"rounded-full bg-transparent p-1 transition-colors hover:bg-gray-100 active:scale-95",onClick:()=>this.handleCloseModal()},e("span",{class:"sr-only"},"Close popup"),e("img",{src:b}))),a?e("p",null,"Select the wallet you want to connect to."):e("p",null,"You don't have any wallets in your browser that support this app. You need to install a wallet to proceed.")),!r&&!t&&e("div",{class:"mx-auto mt-4 rounded-xl bg-gray-200 px-3 py-1.5 text-sm font-medium text-gray-500"},"Unfortunately, your browser isn't supported"),a&&e("div",{class:"mt-6"},e("p",{class:"mb-4 text-sm font-medium"},"Installed wallets"),e("ul",{class:"space-y-3"},this.installedProviders.map(o=>e("li",{class:"flex items-center gap-3 rounded-[10px] border border-[#EFEFF2] p-[14px]"},e("div",{class:"aspect-square basis-9 overflow-hidden"},e("img",{src:o.icon,class:"h-full w-full rounded-[10px] bg-gray-700"})),e("div",{class:"flex-1"},e("div",{class:"text-sm font-medium text-[#242629]"},o.name),o.webUrl&&e("a",{href:o.webUrl,class:"text-sm",rel:"noopener noreferrer"},new URL(o.webUrl).hostname)),e("button",{class:"rounded-[10px] border border-[#333] bg-[#323232] px-4 py-2 text-sm font-medium text-[#EFEFEF] shadow-[0_1px_2px_0_#0000000A] outline-[#FFBD7A] transition-all hover:bg-[#0C0C0D] hover:text-white hover:shadow-[0_8px_16px_0_#00000020] focus:outline focus:outline-[3px] active:scale-95",onClick:()=>this.handleSelectProvider(o.id)},"Connect"))))),n&&e("div",{class:"mt-6"},a?e("p",{class:"mb-4 text-sm font-medium"},"Other wallets"):e("div",{class:"mb-5 flex justify-between"},e("p",{class:"text-sm font-medium"},"Recommended wallets"),e("a",{class:"flex cursor-pointer items-center space-x-[5px] text-xs transition-colors hover:text-[#242629] hover:underline focus:underline",href:"https://docs.hiro.so/what-is-a-wallet",rel:"noopener noreferrer",target:"_blank"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none"},e("path",{stroke:"#74777D","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.2",d:"M8.006 15a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z"}),e("path",{stroke:"#74777D","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.2",d:"M5.97 5.9a2.1 2.1 0 0 1 4.08.7c0 1.4-2.1 2.1-2.1 2.1M8.006 11.5h.01"})),e("p",null,"What is a wallet? ",e("span",{class:"align-text-bottom text-[9px]"},"↗")))),e("ul",{class:"space-y-3"},i.map(o=>e("li",{class:"flex items-center gap-3 rounded-[10px] border border-[#EFEFF2] p-[14px]"},e("div",{class:"aspect-square basis-9 overflow-hidden"},e("img",{src:o.icon,class:"h-full w-full rounded-[10px] bg-gray-700"})),e("div",{class:"flex-1"},e("div",{class:"text-sm font-medium text-[#242629]"},o.name),o.webUrl&&e("a",{href:o.webUrl,class:"text-sm",rel:"noopener noreferrer"},new URL(o.webUrl).hostname)),this.getInstallUrl(o,t,r)&&e("a",{class:"rounded-[10px] border border-[#EFEFF2] px-4 py-2 text-sm font-medium shadow-[0_1px_2px_0_#0000000A] outline-[#FFBD7A] transition-colors hover:text-[#242629] hover:shadow-[0_1px_2px_0_#00000010] focus:outline focus:outline-[3px] active:scale-95",href:this.getInstallUrl(o,t,r),rel:"noopener noreferrer",target:"_blank"},"Install →")))))))}static get assetsDirs(){return["assets"]}get modalEl(){return g(this)}};k.style=_;export{k as connect_modal}; +import{r as x,s as u,g as m,h as e,a as g}from"./index-BM6lgRg1.js";const b="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTcgNyAxMCAxME0xNyA3IDcgMTciIHN0cm9rZT0iIzI0MjYyOSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",f=()=>{const t=!!window.chrome,r=window.navigator,i=r.vendor,a=typeof window.opr<"u",n=r.userAgent.includes("Edge"),o=/CriOS/.exec(r.userAgent),s=r.userAgent.includes("Mobile");return o?!1:t!==null&&typeof t<"u"&&i==="Google Inc."&&a===!1&&n===!1&&s===!1},v=()=>f()?"Chrome":window.navigator.userAgent.includes("Firefox")?"Firefox":null,y=()=>window.navigator.userAgent.includes("Mobile")?window.navigator.userAgent.includes("iPhone")?"IOS":"Android":null,_='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.14 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:host{all:initial}.modal-container{color:#74777d;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}.modal-body{-ms-overflow-style:none;scrollbar-width:none}.modal-body::-webkit-scrollbar{display:none}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.static{position:static}.fixed{position:fixed}.inset-0{inset:0}.z-\\[8999\\]{z-index:8999}.z-\\[9000\\]{z-index:9000}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.box-border{box-sizing:border-box}.flex{display:flex}.aspect-square{aspect-ratio:1/1}.h-full{height:100%}.max-h-\\[calc\\(100\\%-24px\\)\\]{max-height:calc(100% - 24px)}.w-full{width:100%}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.basis-9{flex-basis:2.25rem}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-3{gap:.75rem}.space-x-\\[5px\\]>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(5px*(1 - var(--tw-space-x-reverse)));margin-right:calc(5px*var(--tw-space-x-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-\\[10px\\]>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(10px*var(--tw-space-y-reverse));margin-top:calc(10px*(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-y-scroll{overflow-y:scroll}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-xl{border-radius:.75rem}.rounded-b-none{border-bottom-left-radius:0;border-bottom-right-radius:0}.border{border-width:1px}.border-\\[\\#333\\]{--tw-border-opacity:1;border-color:rgb(51 51 51/var(--tw-border-opacity))}.border-\\[\\#EFEFF2\\]{--tw-border-opacity:1;border-color:rgb(239 239 242/var(--tw-border-opacity))}.bg-\\[\\#00000040\\]{background-color:#00000040}.bg-\\[\\#323232\\]{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.p-1{padding:.25rem}.p-6{padding:1.5rem}.p-\\[14px\\]{padding:14px}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.align-text-bottom{vertical-align:text-bottom}.text-\\[9px\\]{font-size:9px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.leading-snug{line-height:1.375}.text-\\[\\#242629\\]{--tw-text-opacity:1;color:rgb(36 38 41/var(--tw-text-opacity))}.text-\\[\\#EFEFEF\\]{--tw-text-opacity:1;color:rgb(239 239 239/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-\\[0_1px_2px_0_\\#0000000A\\]{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[0_1px_2px_0_\\#0000000A\\]{--tw-shadow:0 1px 2px 0 #0000000a;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.shadow-\\[0_4px_5px_0_\\#00000005\\2c 0_16px_40px_0_\\#00000014\\]{--tw-shadow:0 4px 5px 0 #00000005,0 16px 40px 0 #00000014;--tw-shadow-colored:0 4px 5px 0 var(--tw-shadow-color),0 16px 40px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-\\[\\#FFBD7A\\]{outline-color:#ffbd7a}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-duration:.15s;animation-name:enter}.fade-in{--tw-enter-opacity:0}.slide-in-from-bottom{--tw-enter-translate-y:100%}.hover\\:bg-\\[\\#0C0C0D\\]:hover{--tw-bg-opacity:1;background-color:rgb(12 12 13/var(--tw-bg-opacity))}.hover\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\\:text-\\[\\#242629\\]:hover{--tw-text-opacity:1;color:rgb(36 38 41/var(--tw-text-opacity))}.hover\\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:shadow-\\[0_1px_2px_0_\\#00000010\\]:hover{--tw-shadow:0 1px 2px 0 #00000010;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.hover\\:shadow-\\[0_1px_2px_0_\\#00000010\\]:hover,.hover\\:shadow-\\[0_8px_16px_0_\\#00000020\\]:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:shadow-\\[0_8px_16px_0_\\#00000020\\]:hover{--tw-shadow:0 8px 16px 0 #00000020;--tw-shadow-colored:0 8px 16px 0 var(--tw-shadow-color)}.focus\\:underline:focus{text-decoration-line:underline}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-\\[3px\\]:focus{outline-width:3px}.active\\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width:768px){.md\\:max-h-\\[calc\\(100\\%-48px\\)\\]{max-height:calc(100% - 48px)}.md\\:w-\\[400px\\]{width:400px}.md\\:items-center{align-items:center}.md\\:justify-center{justify-content:center}.md\\:rounded-b-2xl{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}.md\\:zoom-in-50{--tw-enter-scale:.5}.md\\:slide-in-from-bottom-0{--tw-enter-translate-y:0px}}',k=class{constructor(t){x(this,t),this.defaultProviders=void 0,this.installedProviders=void 0,this.persistSelection=void 0,this.callback=void 0,this.cancelCallback=void 0}handleSelectProvider(t){this.persistSelection&&u(t),this.callback(m(t))}handleCloseModal(){this.cancelCallback()}getBrowserUrl(t){var r;return(r=t.chromeWebStoreUrl)!==null&&r!==void 0?r:t.mozillaAddOnsUrl}getMobileUrl(t){var r;return(r=t.iOSAppStoreUrl)!==null&&r!==void 0?r:t.googlePlayStoreUrl}getInstallUrl(t,r,i){var a,n,o,s,l,d,c,w,p,h;return i==="IOS"?(n=(a=t.iOSAppStoreUrl)!==null&&a!==void 0?a:this.getBrowserUrl(t))!==null&&n!==void 0?n:t.webUrl:r==="Chrome"?(s=(o=t.chromeWebStoreUrl)!==null&&o!==void 0?o:this.getMobileUrl(t))!==null&&s!==void 0?s:t.webUrl:r==="Firefox"?(d=(l=t.mozillaAddOnsUrl)!==null&&l!==void 0?l:this.getMobileUrl(t))!==null&&d!==void 0?d:t.webUrl:i==="Android"?(w=(c=t.googlePlayStoreUrl)!==null&&c!==void 0?c:this.getBrowserUrl(t))!==null&&w!==void 0?w:t.webUrl:(h=(p=this.getBrowserUrl(t))!==null&&p!==void 0?p:t.webUrl)!==null&&h!==void 0?h:this.getMobileUrl(t)}render(){const t=v(),r=y(),i=this.defaultProviders.filter(o=>this.installedProviders.findIndex(s=>s.id===o.id)===-1),a=this.installedProviders.length>0,n=i.length>0;return e("div",{class:"modal-container animate-in fade-in fixed inset-0 z-[8999] box-border flex h-full w-full items-end bg-[#00000040] md:items-center md:justify-center"},e("div",{class:"fixed inset-0 z-[8999]",onClick:()=>this.handleCloseModal()}),e("div",{class:"modal-body animate-in md:zoom-in-50 slide-in-from-bottom md:slide-in-from-bottom-0 z-[9000] box-border flex max-h-[calc(100%-24px)] w-full max-w-full cursor-default flex-col overflow-y-scroll rounded-2xl rounded-b-none bg-white p-6 text-sm leading-snug shadow-[0_4px_5px_0_#00000005,0_16px_40px_0_#00000014] md:max-h-[calc(100%-48px)] md:w-[400px] md:rounded-b-2xl"},e("div",{class:"flex flex-col space-y-[10px]"},e("div",{class:"flex items-center"},e("div",{class:"flex-1 text-xl font-medium text-[#242629]"},"Connect a wallet"),e("button",{class:"rounded-full bg-transparent p-1 transition-colors hover:bg-gray-100 active:scale-95",onClick:()=>this.handleCloseModal()},e("span",{class:"sr-only"},"Close popup"),e("img",{src:b}))),a?e("p",null,"Select the wallet you want to connect to."):e("p",null,"You don't have any wallets in your browser that support this app. You need to install a wallet to proceed.")),!r&&!t&&e("div",{class:"mx-auto mt-4 rounded-xl bg-gray-200 px-3 py-1.5 text-sm font-medium text-gray-500"},"Unfortunately, your browser isn't supported"),a&&e("div",{class:"mt-6"},e("p",{class:"mb-4 text-sm font-medium"},"Installed wallets"),e("ul",{class:"space-y-3"},this.installedProviders.map(o=>e("li",{class:"flex items-center gap-3 rounded-[10px] border border-[#EFEFF2] p-[14px]"},e("div",{class:"aspect-square basis-9 overflow-hidden"},e("img",{src:o.icon,class:"h-full w-full rounded-[10px] bg-gray-700"})),e("div",{class:"flex-1"},e("div",{class:"text-sm font-medium text-[#242629]"},o.name),o.webUrl&&e("a",{href:o.webUrl,class:"text-sm",rel:"noopener noreferrer"},new URL(o.webUrl).hostname)),e("button",{class:"rounded-[10px] border border-[#333] bg-[#323232] px-4 py-2 text-sm font-medium text-[#EFEFEF] shadow-[0_1px_2px_0_#0000000A] outline-[#FFBD7A] transition-all hover:bg-[#0C0C0D] hover:text-white hover:shadow-[0_8px_16px_0_#00000020] focus:outline focus:outline-[3px] active:scale-95",onClick:()=>this.handleSelectProvider(o.id)},"Connect"))))),n&&e("div",{class:"mt-6"},a?e("p",{class:"mb-4 text-sm font-medium"},"Other wallets"):e("div",{class:"mb-5 flex justify-between"},e("p",{class:"text-sm font-medium"},"Recommended wallets"),e("a",{class:"flex cursor-pointer items-center space-x-[5px] text-xs transition-colors hover:text-[#242629] hover:underline focus:underline",href:"https://docs.hiro.so/what-is-a-wallet",rel:"noopener noreferrer",target:"_blank"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none"},e("path",{stroke:"#74777D","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.2",d:"M8.006 15a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z"}),e("path",{stroke:"#74777D","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.2",d:"M5.97 5.9a2.1 2.1 0 0 1 4.08.7c0 1.4-2.1 2.1-2.1 2.1M8.006 11.5h.01"})),e("p",null,"What is a wallet? ",e("span",{class:"align-text-bottom text-[9px]"},"↗")))),e("ul",{class:"space-y-3"},i.map(o=>e("li",{class:"flex items-center gap-3 rounded-[10px] border border-[#EFEFF2] p-[14px]"},e("div",{class:"aspect-square basis-9 overflow-hidden"},e("img",{src:o.icon,class:"h-full w-full rounded-[10px] bg-gray-700"})),e("div",{class:"flex-1"},e("div",{class:"text-sm font-medium text-[#242629]"},o.name),o.webUrl&&e("a",{href:o.webUrl,class:"text-sm",rel:"noopener noreferrer"},new URL(o.webUrl).hostname)),this.getInstallUrl(o,t,r)&&e("a",{class:"rounded-[10px] border border-[#EFEFF2] px-4 py-2 text-sm font-medium shadow-[0_1px_2px_0_#0000000A] outline-[#FFBD7A] transition-colors hover:text-[#242629] hover:shadow-[0_1px_2px_0_#00000010] focus:outline focus:outline-[3px] active:scale-95",href:this.getInstallUrl(o,t,r),rel:"noopener noreferrer",target:"_blank"},"Install →")))))))}static get assetsDirs(){return["assets"]}get modalEl(){return g(this)}};k.style=_;export{k as connect_modal}; diff --git a/assets/index-BSMds1u_.js b/assets/index-BM6lgRg1.js similarity index 89% rename from assets/index-BSMds1u_.js rename to assets/index-BM6lgRg1.js index 019c8bd..2081f22 100644 --- a/assets/index-BSMds1u_.js +++ b/assets/index-BM6lgRg1.js @@ -6,7 +6,7 @@ function PL(e,t){for(var n=0;n>>1,ge=H[te];if(0>>1;tei(ke,I))Nei(Xe,ke)?(H[te]=Xe,H[Ne]=I,te=Ne):(H[te]=ke,H[be]=I,te=be);else if(Nei(Xe,I))H[te]=Xe,H[Ne]=I,te=Ne;else break e}}return X}function i(H,X){var I=H.sortIndex-X.sortIndex;return I!==0?I:H.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,u=a.now();e.unstable_now=function(){return a.now()-u}}var l=[],f=[],p=1,m=null,y=3,w=!1,b=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(H){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=H)r(f),X.sortIndex=X.expirationTime,t(l,X);else break;X=n(f)}}function T(H){if(x=!1,E(H),!b)if(n(l)!==null)b=!0,K(B);else{var X=n(f);X!==null&&Q(T,X.startTime-H)}}function B(H,X){b=!1,x&&(x=!1,O(v),v=-1),w=!0;var I=y;try{for(E(X),m=n(l);m!==null&&(!(m.expirationTime>X)||H&&!M());){var te=m.callback;if(typeof te=="function"){m.callback=null,y=m.priorityLevel;var ge=te(m.expirationTime<=X);X=e.unstable_now(),typeof ge=="function"?m.callback=ge:m===n(l)&&r(l),E(X)}else r(l);m=n(l)}if(m!==null)var oe=!0;else{var be=n(f);be!==null&&Q(T,be.startTime-X),oe=!1}return oe}finally{m=null,y=I,w=!1}}var A=!1,U=null,v=-1,R=5,C=-1;function M(){return!(e.unstable_now()-CH||125te?(H.sortIndex=I,t(f,H),n(l)===null&&H===n(f)&&(x?(O(v),v=-1):x=!0,Q(T,I-te))):(H.sortIndex=ge,t(l,H),b||w||(b=!0,K(B))),H},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(H){var X=y;return function(){var I=y;y=X;try{return H.apply(this,arguments)}finally{y=I}}}}(mv)),mv}var p2;function DL(){return p2||(p2=1,pv.exports=jL()),pv.exports}/** + */var h2;function jL(){return h2||(h2=1,function(e){function t(H,X){var I=H.length;H.push(X);e:for(;0>>1,ge=H[te];if(0>>1;tei(ke,I))Nei(Xe,ke)?(H[te]=Xe,H[Ne]=I,te=Ne):(H[te]=ke,H[be]=I,te=be);else if(Nei(Xe,I))H[te]=Xe,H[Ne]=I,te=Ne;else break e}}return X}function i(H,X){var I=H.sortIndex-X.sortIndex;return I!==0?I:H.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,u=a.now();e.unstable_now=function(){return a.now()-u}}var l=[],f=[],p=1,m=null,y=3,w=!1,b=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(H){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=H)r(f),X.sortIndex=X.expirationTime,t(l,X);else break;X=n(f)}}function T(H){if(x=!1,E(H),!b)if(n(l)!==null)b=!0,K(B);else{var X=n(f);X!==null&&Q(T,X.startTime-H)}}function B(H,X){b=!1,x&&(x=!1,O(v),v=-1),w=!0;var I=y;try{for(E(X),m=n(l);m!==null&&(!(m.expirationTime>X)||H&&!M());){var te=m.callback;if(typeof te=="function"){m.callback=null,y=m.priorityLevel;var ge=te(m.expirationTime<=X);X=e.unstable_now(),typeof ge=="function"?m.callback=ge:m===n(l)&&r(l),E(X)}else r(l);m=n(l)}if(m!==null)var oe=!0;else{var be=n(f);be!==null&&Q(T,be.startTime-X),oe=!1}return oe}finally{m=null,y=I,w=!1}}var A=!1,U=null,v=-1,R=5,C=-1;function M(){return!(e.unstable_now()-CH||125te?(H.sortIndex=I,t(f,H),n(l)===null&&H===n(f)&&(x?(O(v),v=-1):x=!0,Q(T,I-te))):(H.sortIndex=ge,t(l,H),b||w||(b=!0,K(B))),H},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(H){var X=y;return function(){var I=y;y=X;try{return H.apply(this,arguments)}finally{y=I}}}}(mv)),mv}var p2;function DL(){return p2||(p2=1,pv.exports=jL()),pv.exports}/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function PL(e,t){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function y(s){return l.call(m,s)?!0:l.call(p,s)?!1:f.test(s)?m[s]=!0:(p[s]=!0,!1)}function w(s,c,h,g){if(h!==null&&h.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return g?!1:h!==null?!h.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function b(s,c,h,g){if(c===null||typeof c>"u"||w(s,c,h,g))return!0;if(g)return!1;if(h!==null)switch(h.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function x(s,c,h,g,S,_,F){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=g,this.attributeNamespace=S,this.mustUseProperty=h,this.propertyName=s,this.type=c,this.sanitizeURL=_,this.removeEmptyString=F}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){k[s]=new x(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var c=s[0];k[c]=new x(c,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){k[s]=new x(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){k[s]=new x(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){k[s]=new x(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){k[s]=new x(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){k[s]=new x(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){k[s]=new x(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){k[s]=new x(s,5,!1,s.toLowerCase(),null,!1,!1)});var O=/[\-:]([a-z])/g;function N(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var c=s.replace(O,N);k[c]=new x(c,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var c=s.replace(O,N);k[c]=new x(c,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var c=s.replace(O,N);k[c]=new x(c,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){k[s]=new x(s,1,!1,s.toLowerCase(),null,!1,!1)}),k.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){k[s]=new x(s,1,!1,s.toLowerCase(),null,!0,!0)});function E(s,c,h,g){var S=k.hasOwnProperty(c)?k[c]:null;(S!==null?S.type!==0:g||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function y(s){return l.call(m,s)?!0:l.call(p,s)?!1:f.test(s)?m[s]=!0:(p[s]=!0,!1)}function w(s,c,h,g){if(h!==null&&h.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return g?!1:h!==null?!h.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function b(s,c,h,g){if(c===null||typeof c>"u"||w(s,c,h,g))return!0;if(g)return!1;if(h!==null)switch(h.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function x(s,c,h,g,S,k,F){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=g,this.attributeNamespace=S,this.mustUseProperty=h,this.propertyName=s,this.type=c,this.sanitizeURL=k,this.removeEmptyString=F}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){_[s]=new x(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var c=s[0];_[c]=new x(c,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){_[s]=new x(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){_[s]=new x(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){_[s]=new x(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){_[s]=new x(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){_[s]=new x(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){_[s]=new x(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){_[s]=new x(s,5,!1,s.toLowerCase(),null,!1,!1)});var O=/[\-:]([a-z])/g;function N(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var c=s.replace(O,N);_[c]=new x(c,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var c=s.replace(O,N);_[c]=new x(c,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var c=s.replace(O,N);_[c]=new x(c,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){_[s]=new x(s,1,!1,s.toLowerCase(),null,!1,!1)}),_.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){_[s]=new x(s,1,!1,s.toLowerCase(),null,!0,!0)});function E(s,c,h,g){var S=_.hasOwnProperty(c)?_[c]:null;(S!==null?S.type!==0:g||!(2W||S[F]!==_[W]){var Y=` -`+S[F].replace(" at new "," at ");return s.displayName&&Y.includes("")&&(Y=Y.replace("",s.displayName)),Y}while(1<=F&&0<=W);break}}}finally{oe=!1,Error.prepareStackTrace=h}return(s=s?s.displayName||s.name:"")?ge(s):""}function ke(s){switch(s.tag){case 5:return ge(s.type);case 16:return ge("Lazy");case 13:return ge("Suspense");case 19:return ge("SuspenseList");case 0:case 2:case 15:return s=be(s.type,!1),s;case 11:return s=be(s.type.render,!1),s;case 1:return s=be(s.type,!0),s;default:return""}}function Ne(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case U:return"Fragment";case A:return"Portal";case R:return"Profiler";case v:return"StrictMode";case P:return"Suspense";case D:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case M:return(s.displayName||"Context")+".Consumer";case C:return(s._context.displayName||"Context")+".Provider";case J:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case q:return c=s.displayName||null,c!==null?c:Ne(s.type)||"Memo";case K:c=s._payload,s=s._init;try{return Ne(s(c))}catch{}}return null}function Xe(s){var c=s.type;switch(s.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=c.render,s=s.displayName||s.name||"",c.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ne(c);case 8:return c===v?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function Ze(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Nt(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function nn(s){var c=Nt(s)?"checked":"value",h=Object.getOwnPropertyDescriptor(s.constructor.prototype,c),g=""+s[c];if(!s.hasOwnProperty(c)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var S=h.get,_=h.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return S.call(this)},set:function(F){g=""+F,_.call(this,F)}}),Object.defineProperty(s,c,{enumerable:h.enumerable}),{getValue:function(){return g},setValue:function(F){g=""+F},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function kt(s){s._valueTracker||(s._valueTracker=nn(s))}function En(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var h=c.getValue(),g="";return s&&(g=Nt(s)?s.checked?"true":"false":s.value),s=g,s!==h?(c.setValue(s),!0):!1}function Rt(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Ct(s,c){var h=c.checked;return I({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??s._wrapperState.initialChecked})}function gt(s,c){var h=c.defaultValue==null?"":c.defaultValue,g=c.checked!=null?c.checked:c.defaultChecked;h=Ze(c.value!=null?c.value:h),s._wrapperState={initialChecked:g,initialValue:h,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function hn(s,c){c=c.checked,c!=null&&E(s,"checked",c,!1)}function An(s,c){hn(s,c);var h=Ze(c.value),g=c.type;if(h!=null)g==="number"?(h===0&&s.value===""||s.value!=h)&&(s.value=""+h):s.value!==""+h&&(s.value=""+h);else if(g==="submit"||g==="reset"){s.removeAttribute("value");return}c.hasOwnProperty("value")?zn(s,c.type,h):c.hasOwnProperty("defaultValue")&&zn(s,c.type,Ze(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(s.defaultChecked=!!c.defaultChecked)}function cr(s,c,h){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var g=c.type;if(!(g!=="submit"&&g!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+s._wrapperState.initialValue,h||c===s.value||(s.value=c),s.defaultValue=c}h=s.name,h!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,h!==""&&(s.name=h)}function zn(s,c,h){(c!=="number"||Rt(s.ownerDocument)!==s)&&(h==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+h&&(s.defaultValue=""+h))}var qt=Array.isArray;function on(s,c,h,g){if(s=s.options,c){c={};for(var S=0;S"+c.valueOf().toString()+"",c=Tt.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;c.firstChild;)s.appendChild(c.firstChild)}});function Sr(s,c){if(c){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=c;return}}s.textContent=c}var ur={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Kr=["Webkit","ms","Moz","O"];Object.keys(ur).forEach(function(s){Kr.forEach(function(c){c=c+s.charAt(0).toUpperCase()+s.substring(1),ur[c]=ur[s]})});function le(s,c,h){return c==null||typeof c=="boolean"||c===""?"":h||typeof c!="number"||c===0||ur.hasOwnProperty(s)&&ur[s]?(""+c).trim():c+"px"}function z(s,c){s=s.style;for(var h in c)if(c.hasOwnProperty(h)){var g=h.indexOf("--")===0,S=le(h,c[h],g);h==="float"&&(h="cssFloat"),g?s.setProperty(h,S):s[h]=S}}var ne=I({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pe(s,c){if(c){if(ne[s]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,s));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function Ce(s,c){if(s.indexOf("-")===-1)return typeof c.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Re=null;function je(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Je=null,Le=null,Qe=null;function dt(s){if(s=Mp(s)){if(typeof Je!="function")throw Error(n(280));var c=s.stateNode;c&&(c=dy(c),Je(s.stateNode,s.type,c))}}function Xt(s){Le?Qe?Qe.push(s):Qe=[s]:Le=s}function V(){if(Le){var s=Le,c=Qe;if(Qe=Le=null,dt(s),c)for(s=0;s>>=0,s===0?32:31-(Pb(s)/Mb|0)|0}var Xu=64,Af=4194304;function Xl(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Ff(s,c){var h=s.pendingLanes;if(h===0)return 0;var g=0,S=s.suspendedLanes,_=s.pingedLanes,F=h&268435455;if(F!==0){var W=F&~S;W!==0?g=Xl(W):(_&=F,_!==0&&(g=Xl(_)))}else F=h&~S,F!==0?g=Xl(F):_!==0&&(g=Xl(_));if(g===0)return 0;if(c!==0&&c!==g&&!(c&S)&&(S=g&-g,_=c&-c,S>=_||S===16&&(_&4194240)!==0))return c;if(g&4&&(g|=h&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=g;0h;h++)c.push(s);return c}function Zl(s,c,h){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-fi(c),s[c]=h}function Db(s,c){var h=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var g=s.eventTimes;for(s=s.expirationTimes;0=Tp),tR=" ",nR=!1;function rR(s,c){switch(s){case"keyup":return C6.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iR(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Lf=!1;function A6(s,c){switch(s){case"compositionend":return iR(c);case"keypress":return c.which!==32?null:(nR=!0,tR);case"textInput":return s=c.data,s===tR&&nR?null:s;default:return null}}function F6(s,c){if(Lf)return s==="compositionend"||!zb&&rR(s,c)?(s=_p(),id=Ho=lo=null,Lf=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:h,offset:c-s};s=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=dR(h)}}function hR(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?hR(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function pR(){for(var s=window,c=Rt();c instanceof s.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)s=c.contentWindow;else break;c=Rt(s.document)}return c}function Gb(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}function $6(s){var c=pR(),h=s.focusedElem,g=s.selectionRange;if(c!==h&&h&&h.ownerDocument&&hR(h.ownerDocument.documentElement,h)){if(g!==null&&Gb(h)){if(c=g.start,s=g.end,s===void 0&&(s=c),"selectionStart"in h)h.selectionStart=c,h.selectionEnd=Math.min(s,h.value.length);else if(s=(c=h.ownerDocument||document)&&c.defaultView||window,s.getSelection){s=s.getSelection();var S=h.textContent.length,_=Math.min(g.start,S);g=g.end===void 0?_:Math.min(g.end,S),!s.extend&&_>g&&(S=g,g=_,_=S),S=fR(h,_);var F=fR(h,g);S&&F&&(s.rangeCount!==1||s.anchorNode!==S.node||s.anchorOffset!==S.offset||s.focusNode!==F.node||s.focusOffset!==F.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),s.removeAllRanges(),_>g?(s.addRange(c),s.extend(F.node,F.offset)):(c.setEnd(F.node,F.offset),s.addRange(c)))}}for(c=[],s=h;s=s.parentNode;)s.nodeType===1&&c.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h=document.documentMode,Bf=null,Kb=null,Ep=null,Qb=!1;function mR(s,c,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Qb||Bf==null||Bf!==Rt(g)||(g=Bf,"selectionStart"in g&&Gb(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Ep&&Cp(Ep,g)||(Ep=g,g=cy(Kb,"onSelect"),0qf||(s.current=cS[qf],cS[qf]=null,qf--)}function sn(s,c){qf++,cS[qf]=s.current,s.current=c}var ol={},Ir=il(ol),Qr=il(!1),cd=ol;function Uf(s,c){var h=s.type.contextTypes;if(!h)return ol;var g=s.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===c)return g.__reactInternalMemoizedMaskedChildContext;var S={},_;for(_ in h)S[_]=c[_];return g&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=S),S}function Yr(s){return s=s.childContextTypes,s!=null}function fy(){mn(Qr),mn(Ir)}function ER(s,c,h){if(Ir.current!==ol)throw Error(n(168));sn(Ir,c),sn(Qr,h)}function AR(s,c,h){var g=s.stateNode;if(c=c.childContextTypes,typeof g.getChildContext!="function")return h;g=g.getChildContext();for(var S in g)if(!(S in c))throw Error(n(108,Xe(s)||"Unknown",S));return I({},h,g)}function hy(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ol,cd=Ir.current,sn(Ir,s),sn(Qr,Qr.current),!0}function FR(s,c,h){var g=s.stateNode;if(!g)throw Error(n(169));h?(s=AR(s,c,cd),g.__reactInternalMemoizedMergedChildContext=s,mn(Qr),mn(Ir),sn(Ir,s)):mn(Qr),sn(Qr,h)}var Rs=null,py=!1,uS=!1;function IR(s){Rs===null?Rs=[s]:Rs.push(s)}function Z6(s){py=!0,IR(s)}function sl(){if(!uS&&Rs!==null){uS=!0;var s=0,c=At;try{var h=Rs;for(At=1;s>=F,S-=F,Ts=1<<32-fi(c)+S|h<pt?(fr=ut,ut=null):fr=ut.sibling;var Dt=Se(re,ut,se[pt],Oe);if(Dt===null){ut===null&&(ut=fr);break}s&&ut&&Dt.alternate===null&&c(re,ut),ee=_(Dt,ee,pt),ct===null?tt=Dt:ct.sibling=Dt,ct=Dt,ut=fr}if(pt===se.length)return h(re,ut),vn&&ld(re,pt),tt;if(ut===null){for(;ptpt?(fr=ut,ut=null):fr=ut.sibling;var ml=Se(re,ut,Dt.value,Oe);if(ml===null){ut===null&&(ut=fr);break}s&&ut&&ml.alternate===null&&c(re,ut),ee=_(ml,ee,pt),ct===null?tt=ml:ct.sibling=ml,ct=ml,ut=fr}if(Dt.done)return h(re,ut),vn&&ld(re,pt),tt;if(ut===null){for(;!Dt.done;pt++,Dt=se.next())Dt=_e(re,Dt.value,Oe),Dt!==null&&(ee=_(Dt,ee,pt),ct===null?tt=Dt:ct.sibling=Dt,ct=Dt);return vn&&ld(re,pt),tt}for(ut=g(re,ut);!Dt.done;pt++,Dt=se.next())Dt=De(ut,re,pt,Dt.value,Oe),Dt!==null&&(s&&Dt.alternate!==null&&ut.delete(Dt.key===null?pt:Dt.key),ee=_(Dt,ee,pt),ct===null?tt=Dt:ct.sibling=Dt,ct=Dt);return s&&ut.forEach(function(IL){return c(re,IL)}),vn&&ld(re,pt),tt}function Dn(re,ee,se,Oe){if(typeof se=="object"&&se!==null&&se.type===U&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case B:e:{for(var tt=se.key,ct=ee;ct!==null;){if(ct.key===tt){if(tt=se.type,tt===U){if(ct.tag===7){h(re,ct.sibling),ee=S(ct,se.props.children),ee.return=re,re=ee;break e}}else if(ct.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===K&&VR(tt)===ct.type){h(re,ct.sibling),ee=S(ct,se.props),ee.ref=Lp(re,ct,se),ee.return=re,re=ee;break e}h(re,ct);break}else c(re,ct);ct=ct.sibling}se.type===U?(ee=wd(se.props.children,re.mode,Oe,se.key),ee.return=re,re=ee):(Oe=qy(se.type,se.key,se.props,null,re.mode,Oe),Oe.ref=Lp(re,ee,se),Oe.return=re,re=Oe)}return F(re);case A:e:{for(ct=se.key;ee!==null;){if(ee.key===ct)if(ee.tag===4&&ee.stateNode.containerInfo===se.containerInfo&&ee.stateNode.implementation===se.implementation){h(re,ee.sibling),ee=S(ee,se.children||[]),ee.return=re,re=ee;break e}else{h(re,ee);break}else c(re,ee);ee=ee.sibling}ee=sv(se,re.mode,Oe),ee.return=re,re=ee}return F(re);case K:return ct=se._init,Dn(re,ee,ct(se._payload),Oe)}if(qt(se))return We(re,ee,se,Oe);if(X(se))return Ye(re,ee,se,Oe);_y(re,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,ee!==null&&ee.tag===6?(h(re,ee.sibling),ee=S(ee,se),ee.return=re,re=ee):(h(re,ee),ee=ov(se,re.mode,Oe),ee.return=re,re=ee),F(re)):h(re,ee)}return Dn}var Kf=GR(!0),KR=GR(!1),Bp={},Wo=il(Bp),jp=il(Bp),Dp=il(Bp);function fd(s){if(s===Bp)throw Error(n(174));return s}function _S(s,c){switch(sn(Dp,c),sn(jp,s),sn(Wo,Bp),s=c.nodeType,s){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:ht(null,"");break;default:s=s===8?c.parentNode:c,c=s.namespaceURI||null,s=s.tagName,c=ht(c,s)}mn(Wo),sn(Wo,c)}function Qf(){mn(Wo),mn(jp),mn(Dp)}function QR(s){fd(Dp.current);var c=fd(Wo.current),h=ht(c,s.type);c!==h&&(sn(jp,s),sn(Wo,h))}function kS(s){jp.current===s&&(mn(Wo),mn(jp))}var Tn=il(0);function ky(s){for(var c=s;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var RS=[];function TS(){for(var s=0;sh?h:4,s(!0);var g=OS.transition;OS.transition={};try{s(!1),c()}finally{At=h,OS.transition=g}}function pT(){return Hi().memoizedState}function rL(s,c,h){var g=fl(s);if(h={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null},mT(s))gT(c,h);else if(h=DR(s,c,h,g),h!==null){var S=Ur();yo(h,s,g,S),yT(h,c,g)}}function iL(s,c,h){var g=fl(s),S={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null};if(mT(s))gT(c,S);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var F=c.lastRenderedState,W=_(F,h);if(S.hasEagerState=!0,S.eagerState=W,fo(W,F)){var Y=c.interleaved;Y===null?(S.next=S,bS(c)):(S.next=Y.next,Y.next=S),c.interleaved=S;return}}catch{}finally{}h=DR(s,c,S,g),h!==null&&(S=Ur(),yo(h,s,g,S),yT(h,c,g))}}function mT(s){var c=s.alternate;return s===On||c!==null&&c===On}function gT(s,c){Jp=Ty=!0;var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}function yT(s,c,h){if(h&4194240){var g=c.lanes;g&=s.pendingLanes,h|=g,c.lanes=h,Zu(s,h)}}var Cy={readContext:Ui,useCallback:Pr,useContext:Pr,useEffect:Pr,useImperativeHandle:Pr,useInsertionEffect:Pr,useLayoutEffect:Pr,useMemo:Pr,useReducer:Pr,useRef:Pr,useState:Pr,useDebugValue:Pr,useDeferredValue:Pr,useTransition:Pr,useMutableSource:Pr,useSyncExternalStore:Pr,useId:Pr,unstable_isNewReconciler:!1},oL={readContext:Ui,useCallback:function(s,c){return Vo().memoizedState=[s,c===void 0?null:c],s},useContext:Ui,useEffect:sT,useImperativeHandle:function(s,c,h){return h=h!=null?h.concat([s]):null,Oy(4194308,4,uT.bind(null,c,s),h)},useLayoutEffect:function(s,c){return Oy(4194308,4,s,c)},useInsertionEffect:function(s,c){return Oy(4,2,s,c)},useMemo:function(s,c){var h=Vo();return c=c===void 0?null:c,s=s(),h.memoizedState=[s,c],s},useReducer:function(s,c,h){var g=Vo();return c=h!==void 0?h(c):c,g.memoizedState=g.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},g.queue=s,s=s.dispatch=rL.bind(null,On,s),[g.memoizedState,s]},useRef:function(s){var c=Vo();return s={current:s},c.memoizedState=s},useState:iT,useDebugValue:PS,useDeferredValue:function(s){return Vo().memoizedState=s},useTransition:function(){var s=iT(!1),c=s[0];return s=nL.bind(null,s[1]),Vo().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,h){var g=On,S=Vo();if(vn){if(h===void 0)throw Error(n(407));h=h()}else{if(h=c(),dr===null)throw Error(n(349));hd&30||ZR(g,c,h)}S.memoizedState=h;var _={value:h,getSnapshot:c};return S.queue=_,sT(tT.bind(null,g,_,s),[s]),g.flags|=2048,Up(9,eT.bind(null,g,_,h,c),void 0,null),h},useId:function(){var s=Vo(),c=dr.identifierPrefix;if(vn){var h=Os,g=Ts;h=(g&~(1<<32-fi(g)-1)).toString(32)+h,c=":"+c+"R"+h,h=$p++,0<\/script>",s=s.removeChild(s.firstChild)):typeof g.is=="string"?s=F.createElement(h,{is:g.is}):(s=F.createElement(h),h==="select"&&(F=s,g.multiple?F.multiple=!0:g.size&&(F.size=g.size))):s=F.createElementNS(s,h),s[zo]=c,s[Pp]=g,PT(s,c,!1,!1),c.stateNode=s;e:{switch(F=Ce(h,g),h){case"dialog":pn("cancel",s),pn("close",s),S=g;break;case"iframe":case"object":case"embed":pn("load",s),S=g;break;case"video":case"audio":for(S=0;Seh&&(c.flags|=128,g=!0,Hp(_,!1),c.lanes=4194304)}else{if(!g)if(s=ky(F),s!==null){if(c.flags|=128,g=!0,h=s.updateQueue,h!==null&&(c.updateQueue=h,c.flags|=4),Hp(_,!0),_.tail===null&&_.tailMode==="hidden"&&!F.alternate&&!vn)return Mr(c),null}else 2*Rn()-_.renderingStartTime>eh&&h!==1073741824&&(c.flags|=128,g=!0,Hp(_,!1),c.lanes=4194304);_.isBackwards?(F.sibling=c.child,c.child=F):(h=_.last,h!==null?h.sibling=F:c.child=F,_.last=F)}return _.tail!==null?(c=_.tail,_.rendering=c,_.tail=c.sibling,_.renderingStartTime=Rn(),c.sibling=null,h=Tn.current,sn(Tn,g?h&1|2:h&1),c):(Mr(c),null);case 22:case 23:return nv(),g=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==g&&(c.flags|=8192),g&&c.mode&1?yi&1073741824&&(Mr(c),c.subtreeFlags&6&&(c.flags|=8192)):Mr(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function hL(s,c){switch(dS(c),c.tag){case 1:return Yr(c.type)&&fy(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Qf(),mn(Qr),mn(Ir),TS(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return kS(c),null;case 13:if(mn(Tn),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Wf()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return mn(Tn),null;case 4:return Qf(),null;case 10:return yS(c.type._context),null;case 22:case 23:return nv(),null;case 24:return null;default:return null}}var Fy=!1,Lr=!1,pL=typeof WeakSet=="function"?WeakSet:Set,He=null;function Xf(s,c){var h=s.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(g){Fn(s,c,g)}else h.current=null}function HS(s,c,h){try{h()}catch(g){Fn(s,c,g)}}var BT=!1;function mL(s,c){if(nS=ue,s=pR(),Gb(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var S=g.anchorOffset,_=g.focusNode;g=g.focusOffset;try{h.nodeType,_.nodeType}catch{h=null;break e}var F=0,W=-1,Y=-1,he=0,ve=0,_e=s,Se=null;t:for(;;){for(var De;_e!==h||S!==0&&_e.nodeType!==3||(W=F+S),_e!==_||g!==0&&_e.nodeType!==3||(Y=F+g),_e.nodeType===3&&(F+=_e.nodeValue.length),(De=_e.firstChild)!==null;)Se=_e,_e=De;for(;;){if(_e===s)break t;if(Se===h&&++he===S&&(W=F),Se===_&&++ve===g&&(Y=F),(De=_e.nextSibling)!==null)break;_e=Se,Se=_e.parentNode}_e=De}h=W===-1||Y===-1?null:{start:W,end:Y}}else h=null}h=h||{start:0,end:0}}else h=null;for(rS={focusedElem:s,selectionRange:h},ue=!1,He=c;He!==null;)if(c=He,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,He=s;else for(;He!==null;){c=He;try{var We=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(We!==null){var Ye=We.memoizedProps,Dn=We.memoizedState,re=c.stateNode,ee=re.getSnapshotBeforeUpdate(c.elementType===c.type?Ye:po(c.type,Ye),Dn);re.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var se=c.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Oe){Fn(c,c.return,Oe)}if(s=c.sibling,s!==null){s.return=c.return,He=s;break}He=c.return}return We=BT,BT=!1,We}function zp(s,c,h){var g=c.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var S=g=g.next;do{if((S.tag&s)===s){var _=S.destroy;S.destroy=void 0,_!==void 0&&HS(c,h,_)}S=S.next}while(S!==g)}}function Iy(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&s)===s){var g=h.create;h.destroy=g()}h=h.next}while(h!==c)}}function zS(s){var c=s.ref;if(c!==null){var h=s.stateNode;switch(s.tag){case 5:s=h;break;default:s=h}typeof c=="function"?c(s):c.current=s}}function jT(s){var c=s.alternate;c!==null&&(s.alternate=null,jT(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&(delete c[zo],delete c[Pp],delete c[aS],delete c[Y6],delete c[X6])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function DT(s){return s.tag===5||s.tag===3||s.tag===4}function JT(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||DT(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function WS(s,c,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,c?h.nodeType===8?h.parentNode.insertBefore(s,c):h.insertBefore(s,c):(h.nodeType===8?(c=h.parentNode,c.insertBefore(s,h)):(c=h,c.appendChild(s)),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=ly));else if(g!==4&&(s=s.child,s!==null))for(WS(s,c,h),s=s.sibling;s!==null;)WS(s,c,h),s=s.sibling}function VS(s,c,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,c?h.insertBefore(s,c):h.appendChild(s);else if(g!==4&&(s=s.child,s!==null))for(VS(s,c,h),s=s.sibling;s!==null;)VS(s,c,h),s=s.sibling}var xr=null,mo=!1;function ul(s,c,h){for(h=h.child;h!==null;)$T(s,c,h),h=h.sibling}function $T(s,c,h){if(Di&&typeof Di.onCommitFiberUnmount=="function")try{Di.onCommitFiberUnmount(Yu,h)}catch{}switch(h.tag){case 5:Lr||Xf(h,c);case 6:var g=xr,S=mo;xr=null,ul(s,c,h),xr=g,mo=S,xr!==null&&(mo?(s=xr,h=h.stateNode,s.nodeType===8?s.parentNode.removeChild(h):s.removeChild(h)):xr.removeChild(h.stateNode));break;case 18:xr!==null&&(mo?(s=xr,h=h.stateNode,s.nodeType===8?sS(s.parentNode,h):s.nodeType===1&&sS(s,h),rd(s)):sS(xr,h.stateNode));break;case 4:g=xr,S=mo,xr=h.stateNode.containerInfo,mo=!0,ul(s,c,h),xr=g,mo=S;break;case 0:case 11:case 14:case 15:if(!Lr&&(g=h.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){S=g=g.next;do{var _=S,F=_.destroy;_=_.tag,F!==void 0&&(_&2||_&4)&&HS(h,c,F),S=S.next}while(S!==g)}ul(s,c,h);break;case 1:if(!Lr&&(Xf(h,c),g=h.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=h.memoizedProps,g.state=h.memoizedState,g.componentWillUnmount()}catch(W){Fn(h,c,W)}ul(s,c,h);break;case 21:ul(s,c,h);break;case 22:h.mode&1?(Lr=(g=Lr)||h.memoizedState!==null,ul(s,c,h),Lr=g):ul(s,c,h);break;default:ul(s,c,h)}}function qT(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var h=s.stateNode;h===null&&(h=s.stateNode=new pL),c.forEach(function(g){var S=kL.bind(null,s,g);h.has(g)||(h.add(g),g.then(S,S))})}}function go(s,c){var h=c.deletions;if(h!==null)for(var g=0;gS&&(S=F),g&=~_}if(g=S,g=Rn()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*yL(g/1960))-g,10s?16:s,dl===null)var g=!1;else{if(s=dl,dl=null,jy=0,Bt&6)throw Error(n(331));var S=Bt;for(Bt|=4,He=s.current;He!==null;){var _=He,F=_.child;if(He.flags&16){var W=_.deletions;if(W!==null){for(var Y=0;YRn()-QS?gd(s,0):KS|=h),ei(s,c)}function t2(s,c){c===0&&(s.mode&1?(c=Af,Af<<=1,!(Af&130023424)&&(Af=4194304)):c=1);var h=Ur();s=Ns(s,c),s!==null&&(Zl(s,c,h),ei(s,h))}function _L(s){var c=s.memoizedState,h=0;c!==null&&(h=c.retryLane),t2(s,h)}function kL(s,c){var h=0;switch(s.tag){case 13:var g=s.stateNode,S=s.memoizedState;S!==null&&(h=S.retryLane);break;case 19:g=s.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(c),t2(s,h)}var n2;n2=function(s,c,h){if(s!==null)if(s.memoizedProps!==c.pendingProps||Qr.current)Xr=!0;else{if(!(s.lanes&h)&&!(c.flags&128))return Xr=!1,dL(s,c,h);Xr=!!(s.flags&131072)}else Xr=!1,vn&&c.flags&1048576&&PR(c,gy,c.index);switch(c.lanes=0,c.tag){case 2:var g=c.type;Ay(s,c),s=c.pendingProps;var S=Uf(c,Ir.current);Gf(c,h),S=CS(null,c,g,s,S,h);var _=ES();return c.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Yr(g)?(_=!0,hy(c)):_=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,SS(c),S.updater=xy,c.stateNode=S,S._reactInternals=c,xS(c,g,s,h),c=jS(null,c,g,!0,_,h)):(c.tag=0,vn&&_&&lS(c),qr(null,c,S,h),c=c.child),c;case 16:g=c.elementType;e:{switch(Ay(s,c),s=c.pendingProps,S=g._init,g=S(g._payload),c.type=g,S=c.tag=TL(g),s=po(g,s),S){case 0:c=BS(null,c,g,s,h);break e;case 1:c=NT(null,c,g,s,h);break e;case 11:c=_T(null,c,g,s,h);break e;case 14:c=kT(null,c,g,po(g.type,s),h);break e}throw Error(n(306,g,""))}return c;case 0:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:po(g,S),BS(s,c,g,S,h);case 1:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:po(g,S),NT(s,c,g,S,h);case 3:e:{if(CT(c),s===null)throw Error(n(387));g=c.pendingProps,_=c.memoizedState,S=_.element,JR(s,c),vy(c,g,null,h);var F=c.memoizedState;if(g=F.element,_.isDehydrated)if(_={element:g,isDehydrated:!1,cache:F.cache,pendingSuspenseBoundaries:F.pendingSuspenseBoundaries,transitions:F.transitions},c.updateQueue.baseState=_,c.memoizedState=_,c.flags&256){S=Yf(Error(n(423)),c),c=ET(s,c,g,h,S);break e}else if(g!==S){S=Yf(Error(n(424)),c),c=ET(s,c,g,h,S);break e}else for(gi=rl(c.stateNode.containerInfo.firstChild),mi=c,vn=!0,ho=null,h=KR(c,null,g,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Wf(),g===S){c=Es(s,c,h);break e}qr(s,c,g,h)}c=c.child}return c;case 5:return QR(c),s===null&&hS(c),g=c.type,S=c.pendingProps,_=s!==null?s.memoizedProps:null,F=S.children,iS(g,S)?F=null:_!==null&&iS(g,_)&&(c.flags|=32),OT(s,c),qr(s,c,F,h),c.child;case 6:return s===null&&hS(c),null;case 13:return AT(s,c,h);case 4:return _S(c,c.stateNode.containerInfo),g=c.pendingProps,s===null?c.child=Kf(c,null,g,h):qr(s,c,g,h),c.child;case 11:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:po(g,S),_T(s,c,g,S,h);case 7:return qr(s,c,c.pendingProps,h),c.child;case 8:return qr(s,c,c.pendingProps.children,h),c.child;case 12:return qr(s,c,c.pendingProps.children,h),c.child;case 10:e:{if(g=c.type._context,S=c.pendingProps,_=c.memoizedProps,F=S.value,sn(wy,g._currentValue),g._currentValue=F,_!==null)if(fo(_.value,F)){if(_.children===S.children&&!Qr.current){c=Es(s,c,h);break e}}else for(_=c.child,_!==null&&(_.return=c);_!==null;){var W=_.dependencies;if(W!==null){F=_.child;for(var Y=W.firstContext;Y!==null;){if(Y.context===g){if(_.tag===1){Y=Cs(-1,h&-h),Y.tag=2;var he=_.updateQueue;if(he!==null){he=he.shared;var ve=he.pending;ve===null?Y.next=Y:(Y.next=ve.next,ve.next=Y),he.pending=Y}}_.lanes|=h,Y=_.alternate,Y!==null&&(Y.lanes|=h),wS(_.return,h,c),W.lanes|=h;break}Y=Y.next}}else if(_.tag===10)F=_.type===c.type?null:_.child;else if(_.tag===18){if(F=_.return,F===null)throw Error(n(341));F.lanes|=h,W=F.alternate,W!==null&&(W.lanes|=h),wS(F,h,c),F=_.sibling}else F=_.child;if(F!==null)F.return=_;else for(F=_;F!==null;){if(F===c){F=null;break}if(_=F.sibling,_!==null){_.return=F.return,F=_;break}F=F.return}_=F}qr(s,c,S.children,h),c=c.child}return c;case 9:return S=c.type,g=c.pendingProps.children,Gf(c,h),S=Ui(S),g=g(S),c.flags|=1,qr(s,c,g,h),c.child;case 14:return g=c.type,S=po(g,c.pendingProps),S=po(g.type,S),kT(s,c,g,S,h);case 15:return RT(s,c,c.type,c.pendingProps,h);case 17:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:po(g,S),Ay(s,c),c.tag=1,Yr(g)?(s=!0,hy(c)):s=!1,Gf(c,h),zR(c,g,S),xS(c,g,S,h),jS(null,c,g,!0,s,h);case 19:return IT(s,c,h);case 22:return TT(s,c,h)}throw Error(n(156,c.tag))};function r2(s,c){return gp(s,c)}function RL(s,c,h,g){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wi(s,c,h,g){return new RL(s,c,h,g)}function iv(s){return s=s.prototype,!(!s||!s.isReactComponent)}function TL(s){if(typeof s=="function")return iv(s)?1:0;if(s!=null){if(s=s.$$typeof,s===J)return 11;if(s===q)return 14}return 2}function pl(s,c){var h=s.alternate;return h===null?(h=Wi(s.tag,c,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=c,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&14680064,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,c=s.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h}function qy(s,c,h,g,S,_){var F=2;if(g=s,typeof s=="function")iv(s)&&(F=1);else if(typeof s=="string")F=5;else e:switch(s){case U:return wd(h.children,S,_,c);case v:F=8,S|=8;break;case R:return s=Wi(12,h,c,S|2),s.elementType=R,s.lanes=_,s;case P:return s=Wi(13,h,c,S),s.elementType=P,s.lanes=_,s;case D:return s=Wi(19,h,c,S),s.elementType=D,s.lanes=_,s;case Q:return Uy(h,S,_,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:F=10;break e;case M:F=9;break e;case J:F=11;break e;case q:F=14;break e;case K:F=16,g=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return c=Wi(F,h,c,S),c.elementType=s,c.type=g,c.lanes=_,c}function wd(s,c,h,g){return s=Wi(7,s,g,c),s.lanes=h,s}function Uy(s,c,h,g){return s=Wi(22,s,g,c),s.elementType=Q,s.lanes=h,s.stateNode={isHidden:!1},s}function ov(s,c,h){return s=Wi(6,s,null,c),s.lanes=h,s}function sv(s,c,h){return c=Wi(4,s.children!==null?s.children:[],s.key,c),c.lanes=h,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function OL(s,c,h,g,S){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=If(0),this.expirationTimes=If(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=If(0),this.identifierPrefix=g,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function av(s,c,h,g,S,_,F,W,Y){return s=new OL(s,c,h,W,Y),c===1?(c=1,_===!0&&(c|=8)):c=0,_=Wi(3,null,null,c),s.current=_,_.stateNode=s,_.memoizedState={element:g,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},SS(_),s}function NL(s,c,h){var g=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),hv.exports=JL(),hv.exports}var y2;function $L(){if(y2)return Qy;y2=1;var e=PI();return Qy.createRoot=e.createRoot,Qy.hydrateRoot=e.hydrateRoot,Qy}var qL=$L();const UL=Ju(qL);/** +`),k=g.stack.split(` +`),F=S.length-1,W=k.length-1;1<=F&&0<=W&&S[F]!==k[W];)W--;for(;1<=F&&0<=W;F--,W--)if(S[F]!==k[W]){if(F!==1||W!==1)do if(F--,W--,0>W||S[F]!==k[W]){var Y=` +`+S[F].replace(" at new "," at ");return s.displayName&&Y.includes("")&&(Y=Y.replace("",s.displayName)),Y}while(1<=F&&0<=W);break}}}finally{oe=!1,Error.prepareStackTrace=h}return(s=s?s.displayName||s.name:"")?ge(s):""}function ke(s){switch(s.tag){case 5:return ge(s.type);case 16:return ge("Lazy");case 13:return ge("Suspense");case 19:return ge("SuspenseList");case 0:case 2:case 15:return s=be(s.type,!1),s;case 11:return s=be(s.type.render,!1),s;case 1:return s=be(s.type,!0),s;default:return""}}function Ne(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case U:return"Fragment";case A:return"Portal";case R:return"Profiler";case v:return"StrictMode";case P:return"Suspense";case D:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case M:return(s.displayName||"Context")+".Consumer";case C:return(s._context.displayName||"Context")+".Provider";case J:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case q:return c=s.displayName||null,c!==null?c:Ne(s.type)||"Memo";case K:c=s._payload,s=s._init;try{return Ne(s(c))}catch{}}return null}function Xe(s){var c=s.type;switch(s.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=c.render,s=s.displayName||s.name||"",c.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ne(c);case 8:return c===v?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function Ze(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Nt(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function nn(s){var c=Nt(s)?"checked":"value",h=Object.getOwnPropertyDescriptor(s.constructor.prototype,c),g=""+s[c];if(!s.hasOwnProperty(c)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var S=h.get,k=h.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return S.call(this)},set:function(F){g=""+F,k.call(this,F)}}),Object.defineProperty(s,c,{enumerable:h.enumerable}),{getValue:function(){return g},setValue:function(F){g=""+F},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function kt(s){s._valueTracker||(s._valueTracker=nn(s))}function En(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var h=c.getValue(),g="";return s&&(g=Nt(s)?s.checked?"true":"false":s.value),s=g,s!==h?(c.setValue(s),!0):!1}function Rt(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Ct(s,c){var h=c.checked;return I({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??s._wrapperState.initialChecked})}function gt(s,c){var h=c.defaultValue==null?"":c.defaultValue,g=c.checked!=null?c.checked:c.defaultChecked;h=Ze(c.value!=null?c.value:h),s._wrapperState={initialChecked:g,initialValue:h,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function hn(s,c){c=c.checked,c!=null&&E(s,"checked",c,!1)}function An(s,c){hn(s,c);var h=Ze(c.value),g=c.type;if(h!=null)g==="number"?(h===0&&s.value===""||s.value!=h)&&(s.value=""+h):s.value!==""+h&&(s.value=""+h);else if(g==="submit"||g==="reset"){s.removeAttribute("value");return}c.hasOwnProperty("value")?zn(s,c.type,h):c.hasOwnProperty("defaultValue")&&zn(s,c.type,Ze(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(s.defaultChecked=!!c.defaultChecked)}function cr(s,c,h){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var g=c.type;if(!(g!=="submit"&&g!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+s._wrapperState.initialValue,h||c===s.value||(s.value=c),s.defaultValue=c}h=s.name,h!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,h!==""&&(s.name=h)}function zn(s,c,h){(c!=="number"||Rt(s.ownerDocument)!==s)&&(h==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+h&&(s.defaultValue=""+h))}var qt=Array.isArray;function on(s,c,h,g){if(s=s.options,c){c={};for(var S=0;S"+c.valueOf().toString()+"",c=Tt.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;c.firstChild;)s.appendChild(c.firstChild)}});function Sr(s,c){if(c){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=c;return}}s.textContent=c}var ur={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Kr=["Webkit","ms","Moz","O"];Object.keys(ur).forEach(function(s){Kr.forEach(function(c){c=c+s.charAt(0).toUpperCase()+s.substring(1),ur[c]=ur[s]})});function le(s,c,h){return c==null||typeof c=="boolean"||c===""?"":h||typeof c!="number"||c===0||ur.hasOwnProperty(s)&&ur[s]?(""+c).trim():c+"px"}function z(s,c){s=s.style;for(var h in c)if(c.hasOwnProperty(h)){var g=h.indexOf("--")===0,S=le(h,c[h],g);h==="float"&&(h="cssFloat"),g?s.setProperty(h,S):s[h]=S}}var ne=I({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pe(s,c){if(c){if(ne[s]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,s));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function Ce(s,c){if(s.indexOf("-")===-1)return typeof c.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Re=null;function je(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Je=null,Le=null,Qe=null;function dt(s){if(s=Mp(s)){if(typeof Je!="function")throw Error(n(280));var c=s.stateNode;c&&(c=dy(c),Je(s.stateNode,s.type,c))}}function Xt(s){Le?Qe?Qe.push(s):Qe=[s]:Le=s}function V(){if(Le){var s=Le,c=Qe;if(Qe=Le=null,dt(s),c)for(s=0;s>>=0,s===0?32:31-(Pb(s)/Mb|0)|0}var Zu=64,Ff=4194304;function Xl(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function If(s,c){var h=s.pendingLanes;if(h===0)return 0;var g=0,S=s.suspendedLanes,k=s.pingedLanes,F=h&268435455;if(F!==0){var W=F&~S;W!==0?g=Xl(W):(k&=F,k!==0&&(g=Xl(k)))}else F=h&~S,F!==0?g=Xl(F):k!==0&&(g=Xl(k));if(g===0)return 0;if(c!==0&&c!==g&&!(c&S)&&(S=g&-g,k=c&-c,S>=k||S===16&&(k&4194240)!==0))return c;if(g&4&&(g|=h&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=g;0h;h++)c.push(s);return c}function Zl(s,c,h){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-fi(c),s[c]=h}function Db(s,c){var h=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var g=s.eventTimes;for(s=s.expirationTimes;0=Tp),tR=" ",nR=!1;function rR(s,c){switch(s){case"keyup":return C6.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iR(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Bf=!1;function A6(s,c){switch(s){case"compositionend":return iR(c);case"keypress":return c.which!==32?null:(nR=!0,tR);case"textInput":return s=c.data,s===tR&&nR?null:s;default:return null}}function F6(s,c){if(Bf)return s==="compositionend"||!zb&&rR(s,c)?(s=_p(),id=Ho=lo=null,Bf=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:h,offset:c-s};s=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=dR(h)}}function hR(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?hR(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function pR(){for(var s=window,c=Rt();c instanceof s.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)s=c.contentWindow;else break;c=Rt(s.document)}return c}function Gb(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}function $6(s){var c=pR(),h=s.focusedElem,g=s.selectionRange;if(c!==h&&h&&h.ownerDocument&&hR(h.ownerDocument.documentElement,h)){if(g!==null&&Gb(h)){if(c=g.start,s=g.end,s===void 0&&(s=c),"selectionStart"in h)h.selectionStart=c,h.selectionEnd=Math.min(s,h.value.length);else if(s=(c=h.ownerDocument||document)&&c.defaultView||window,s.getSelection){s=s.getSelection();var S=h.textContent.length,k=Math.min(g.start,S);g=g.end===void 0?k:Math.min(g.end,S),!s.extend&&k>g&&(S=g,g=k,k=S),S=fR(h,k);var F=fR(h,g);S&&F&&(s.rangeCount!==1||s.anchorNode!==S.node||s.anchorOffset!==S.offset||s.focusNode!==F.node||s.focusOffset!==F.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),s.removeAllRanges(),k>g?(s.addRange(c),s.extend(F.node,F.offset)):(c.setEnd(F.node,F.offset),s.addRange(c)))}}for(c=[],s=h;s=s.parentNode;)s.nodeType===1&&c.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h=document.documentMode,jf=null,Kb=null,Ep=null,Qb=!1;function mR(s,c,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Qb||jf==null||jf!==Rt(g)||(g=jf,"selectionStart"in g&&Gb(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Ep&&Cp(Ep,g)||(Ep=g,g=cy(Kb,"onSelect"),0Uf||(s.current=cS[Uf],cS[Uf]=null,Uf--)}function sn(s,c){Uf++,cS[Uf]=s.current,s.current=c}var sl={},Ir=ol(sl),Qr=ol(!1),cd=sl;function Hf(s,c){var h=s.type.contextTypes;if(!h)return sl;var g=s.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===c)return g.__reactInternalMemoizedMaskedChildContext;var S={},k;for(k in h)S[k]=c[k];return g&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=S),S}function Yr(s){return s=s.childContextTypes,s!=null}function fy(){mn(Qr),mn(Ir)}function ER(s,c,h){if(Ir.current!==sl)throw Error(n(168));sn(Ir,c),sn(Qr,h)}function AR(s,c,h){var g=s.stateNode;if(c=c.childContextTypes,typeof g.getChildContext!="function")return h;g=g.getChildContext();for(var S in g)if(!(S in c))throw Error(n(108,Xe(s)||"Unknown",S));return I({},h,g)}function hy(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||sl,cd=Ir.current,sn(Ir,s),sn(Qr,Qr.current),!0}function FR(s,c,h){var g=s.stateNode;if(!g)throw Error(n(169));h?(s=AR(s,c,cd),g.__reactInternalMemoizedMergedChildContext=s,mn(Qr),mn(Ir),sn(Ir,s)):mn(Qr),sn(Qr,h)}var Rs=null,py=!1,uS=!1;function IR(s){Rs===null?Rs=[s]:Rs.push(s)}function Z6(s){py=!0,IR(s)}function al(){if(!uS&&Rs!==null){uS=!0;var s=0,c=At;try{var h=Rs;for(At=1;s>=F,S-=F,Ts=1<<32-fi(c)+S|h<pt?(fr=ut,ut=null):fr=ut.sibling;var Dt=Se(re,ut,se[pt],Oe);if(Dt===null){ut===null&&(ut=fr);break}s&&ut&&Dt.alternate===null&&c(re,ut),ee=k(Dt,ee,pt),ct===null?tt=Dt:ct.sibling=Dt,ct=Dt,ut=fr}if(pt===se.length)return h(re,ut),vn&&ld(re,pt),tt;if(ut===null){for(;ptpt?(fr=ut,ut=null):fr=ut.sibling;var gl=Se(re,ut,Dt.value,Oe);if(gl===null){ut===null&&(ut=fr);break}s&&ut&&gl.alternate===null&&c(re,ut),ee=k(gl,ee,pt),ct===null?tt=gl:ct.sibling=gl,ct=gl,ut=fr}if(Dt.done)return h(re,ut),vn&&ld(re,pt),tt;if(ut===null){for(;!Dt.done;pt++,Dt=se.next())Dt=_e(re,Dt.value,Oe),Dt!==null&&(ee=k(Dt,ee,pt),ct===null?tt=Dt:ct.sibling=Dt,ct=Dt);return vn&&ld(re,pt),tt}for(ut=g(re,ut);!Dt.done;pt++,Dt=se.next())Dt=De(ut,re,pt,Dt.value,Oe),Dt!==null&&(s&&Dt.alternate!==null&&ut.delete(Dt.key===null?pt:Dt.key),ee=k(Dt,ee,pt),ct===null?tt=Dt:ct.sibling=Dt,ct=Dt);return s&&ut.forEach(function(IL){return c(re,IL)}),vn&&ld(re,pt),tt}function Dn(re,ee,se,Oe){if(typeof se=="object"&&se!==null&&se.type===U&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case B:e:{for(var tt=se.key,ct=ee;ct!==null;){if(ct.key===tt){if(tt=se.type,tt===U){if(ct.tag===7){h(re,ct.sibling),ee=S(ct,se.props.children),ee.return=re,re=ee;break e}}else if(ct.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===K&&VR(tt)===ct.type){h(re,ct.sibling),ee=S(ct,se.props),ee.ref=Lp(re,ct,se),ee.return=re,re=ee;break e}h(re,ct);break}else c(re,ct);ct=ct.sibling}se.type===U?(ee=wd(se.props.children,re.mode,Oe,se.key),ee.return=re,re=ee):(Oe=qy(se.type,se.key,se.props,null,re.mode,Oe),Oe.ref=Lp(re,ee,se),Oe.return=re,re=Oe)}return F(re);case A:e:{for(ct=se.key;ee!==null;){if(ee.key===ct)if(ee.tag===4&&ee.stateNode.containerInfo===se.containerInfo&&ee.stateNode.implementation===se.implementation){h(re,ee.sibling),ee=S(ee,se.children||[]),ee.return=re,re=ee;break e}else{h(re,ee);break}else c(re,ee);ee=ee.sibling}ee=sv(se,re.mode,Oe),ee.return=re,re=ee}return F(re);case K:return ct=se._init,Dn(re,ee,ct(se._payload),Oe)}if(qt(se))return We(re,ee,se,Oe);if(X(se))return Ye(re,ee,se,Oe);_y(re,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,ee!==null&&ee.tag===6?(h(re,ee.sibling),ee=S(ee,se),ee.return=re,re=ee):(h(re,ee),ee=ov(se,re.mode,Oe),ee.return=re,re=ee),F(re)):h(re,ee)}return Dn}var Qf=GR(!0),KR=GR(!1),Bp={},Wo=ol(Bp),jp=ol(Bp),Dp=ol(Bp);function fd(s){if(s===Bp)throw Error(n(174));return s}function _S(s,c){switch(sn(Dp,c),sn(jp,s),sn(Wo,Bp),s=c.nodeType,s){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:ht(null,"");break;default:s=s===8?c.parentNode:c,c=s.namespaceURI||null,s=s.tagName,c=ht(c,s)}mn(Wo),sn(Wo,c)}function Yf(){mn(Wo),mn(jp),mn(Dp)}function QR(s){fd(Dp.current);var c=fd(Wo.current),h=ht(c,s.type);c!==h&&(sn(jp,s),sn(Wo,h))}function kS(s){jp.current===s&&(mn(Wo),mn(jp))}var Tn=ol(0);function ky(s){for(var c=s;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var RS=[];function TS(){for(var s=0;sh?h:4,s(!0);var g=OS.transition;OS.transition={};try{s(!1),c()}finally{At=h,OS.transition=g}}function pT(){return Hi().memoizedState}function rL(s,c,h){var g=hl(s);if(h={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null},mT(s))gT(c,h);else if(h=DR(s,c,h,g),h!==null){var S=Ur();yo(h,s,g,S),yT(h,c,g)}}function iL(s,c,h){var g=hl(s),S={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null};if(mT(s))gT(c,S);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=c.lastRenderedReducer,k!==null))try{var F=c.lastRenderedState,W=k(F,h);if(S.hasEagerState=!0,S.eagerState=W,fo(W,F)){var Y=c.interleaved;Y===null?(S.next=S,bS(c)):(S.next=Y.next,Y.next=S),c.interleaved=S;return}}catch{}finally{}h=DR(s,c,S,g),h!==null&&(S=Ur(),yo(h,s,g,S),yT(h,c,g))}}function mT(s){var c=s.alternate;return s===On||c!==null&&c===On}function gT(s,c){Jp=Ty=!0;var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}function yT(s,c,h){if(h&4194240){var g=c.lanes;g&=s.pendingLanes,h|=g,c.lanes=h,el(s,h)}}var Cy={readContext:Ui,useCallback:Pr,useContext:Pr,useEffect:Pr,useImperativeHandle:Pr,useInsertionEffect:Pr,useLayoutEffect:Pr,useMemo:Pr,useReducer:Pr,useRef:Pr,useState:Pr,useDebugValue:Pr,useDeferredValue:Pr,useTransition:Pr,useMutableSource:Pr,useSyncExternalStore:Pr,useId:Pr,unstable_isNewReconciler:!1},oL={readContext:Ui,useCallback:function(s,c){return Vo().memoizedState=[s,c===void 0?null:c],s},useContext:Ui,useEffect:sT,useImperativeHandle:function(s,c,h){return h=h!=null?h.concat([s]):null,Oy(4194308,4,uT.bind(null,c,s),h)},useLayoutEffect:function(s,c){return Oy(4194308,4,s,c)},useInsertionEffect:function(s,c){return Oy(4,2,s,c)},useMemo:function(s,c){var h=Vo();return c=c===void 0?null:c,s=s(),h.memoizedState=[s,c],s},useReducer:function(s,c,h){var g=Vo();return c=h!==void 0?h(c):c,g.memoizedState=g.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},g.queue=s,s=s.dispatch=rL.bind(null,On,s),[g.memoizedState,s]},useRef:function(s){var c=Vo();return s={current:s},c.memoizedState=s},useState:iT,useDebugValue:PS,useDeferredValue:function(s){return Vo().memoizedState=s},useTransition:function(){var s=iT(!1),c=s[0];return s=nL.bind(null,s[1]),Vo().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,h){var g=On,S=Vo();if(vn){if(h===void 0)throw Error(n(407));h=h()}else{if(h=c(),dr===null)throw Error(n(349));hd&30||ZR(g,c,h)}S.memoizedState=h;var k={value:h,getSnapshot:c};return S.queue=k,sT(tT.bind(null,g,k,s),[s]),g.flags|=2048,Up(9,eT.bind(null,g,k,h,c),void 0,null),h},useId:function(){var s=Vo(),c=dr.identifierPrefix;if(vn){var h=Os,g=Ts;h=(g&~(1<<32-fi(g)-1)).toString(32)+h,c=":"+c+"R"+h,h=$p++,0<\/script>",s=s.removeChild(s.firstChild)):typeof g.is=="string"?s=F.createElement(h,{is:g.is}):(s=F.createElement(h),h==="select"&&(F=s,g.multiple?F.multiple=!0:g.size&&(F.size=g.size))):s=F.createElementNS(s,h),s[zo]=c,s[Pp]=g,PT(s,c,!1,!1),c.stateNode=s;e:{switch(F=Ce(h,g),h){case"dialog":pn("cancel",s),pn("close",s),S=g;break;case"iframe":case"object":case"embed":pn("load",s),S=g;break;case"video":case"audio":for(S=0;Sth&&(c.flags|=128,g=!0,Hp(k,!1),c.lanes=4194304)}else{if(!g)if(s=ky(F),s!==null){if(c.flags|=128,g=!0,h=s.updateQueue,h!==null&&(c.updateQueue=h,c.flags|=4),Hp(k,!0),k.tail===null&&k.tailMode==="hidden"&&!F.alternate&&!vn)return Mr(c),null}else 2*Rn()-k.renderingStartTime>th&&h!==1073741824&&(c.flags|=128,g=!0,Hp(k,!1),c.lanes=4194304);k.isBackwards?(F.sibling=c.child,c.child=F):(h=k.last,h!==null?h.sibling=F:c.child=F,k.last=F)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=Rn(),c.sibling=null,h=Tn.current,sn(Tn,g?h&1|2:h&1),c):(Mr(c),null);case 22:case 23:return nv(),g=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==g&&(c.flags|=8192),g&&c.mode&1?yi&1073741824&&(Mr(c),c.subtreeFlags&6&&(c.flags|=8192)):Mr(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function hL(s,c){switch(dS(c),c.tag){case 1:return Yr(c.type)&&fy(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Yf(),mn(Qr),mn(Ir),TS(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return kS(c),null;case 13:if(mn(Tn),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Vf()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return mn(Tn),null;case 4:return Yf(),null;case 10:return yS(c.type._context),null;case 22:case 23:return nv(),null;case 24:return null;default:return null}}var Fy=!1,Lr=!1,pL=typeof WeakSet=="function"?WeakSet:Set,He=null;function Zf(s,c){var h=s.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(g){Fn(s,c,g)}else h.current=null}function HS(s,c,h){try{h()}catch(g){Fn(s,c,g)}}var BT=!1;function mL(s,c){if(nS=ue,s=pR(),Gb(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var S=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{h.nodeType,k.nodeType}catch{h=null;break e}var F=0,W=-1,Y=-1,he=0,ve=0,_e=s,Se=null;t:for(;;){for(var De;_e!==h||S!==0&&_e.nodeType!==3||(W=F+S),_e!==k||g!==0&&_e.nodeType!==3||(Y=F+g),_e.nodeType===3&&(F+=_e.nodeValue.length),(De=_e.firstChild)!==null;)Se=_e,_e=De;for(;;){if(_e===s)break t;if(Se===h&&++he===S&&(W=F),Se===k&&++ve===g&&(Y=F),(De=_e.nextSibling)!==null)break;_e=Se,Se=_e.parentNode}_e=De}h=W===-1||Y===-1?null:{start:W,end:Y}}else h=null}h=h||{start:0,end:0}}else h=null;for(rS={focusedElem:s,selectionRange:h},ue=!1,He=c;He!==null;)if(c=He,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,He=s;else for(;He!==null;){c=He;try{var We=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(We!==null){var Ye=We.memoizedProps,Dn=We.memoizedState,re=c.stateNode,ee=re.getSnapshotBeforeUpdate(c.elementType===c.type?Ye:po(c.type,Ye),Dn);re.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var se=c.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Oe){Fn(c,c.return,Oe)}if(s=c.sibling,s!==null){s.return=c.return,He=s;break}He=c.return}return We=BT,BT=!1,We}function zp(s,c,h){var g=c.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var S=g=g.next;do{if((S.tag&s)===s){var k=S.destroy;S.destroy=void 0,k!==void 0&&HS(c,h,k)}S=S.next}while(S!==g)}}function Iy(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&s)===s){var g=h.create;h.destroy=g()}h=h.next}while(h!==c)}}function zS(s){var c=s.ref;if(c!==null){var h=s.stateNode;switch(s.tag){case 5:s=h;break;default:s=h}typeof c=="function"?c(s):c.current=s}}function jT(s){var c=s.alternate;c!==null&&(s.alternate=null,jT(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&(delete c[zo],delete c[Pp],delete c[aS],delete c[Y6],delete c[X6])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function DT(s){return s.tag===5||s.tag===3||s.tag===4}function JT(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||DT(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function WS(s,c,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,c?h.nodeType===8?h.parentNode.insertBefore(s,c):h.insertBefore(s,c):(h.nodeType===8?(c=h.parentNode,c.insertBefore(s,h)):(c=h,c.appendChild(s)),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=ly));else if(g!==4&&(s=s.child,s!==null))for(WS(s,c,h),s=s.sibling;s!==null;)WS(s,c,h),s=s.sibling}function VS(s,c,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,c?h.insertBefore(s,c):h.appendChild(s);else if(g!==4&&(s=s.child,s!==null))for(VS(s,c,h),s=s.sibling;s!==null;)VS(s,c,h),s=s.sibling}var xr=null,mo=!1;function ll(s,c,h){for(h=h.child;h!==null;)$T(s,c,h),h=h.sibling}function $T(s,c,h){if(Di&&typeof Di.onCommitFiberUnmount=="function")try{Di.onCommitFiberUnmount(Xu,h)}catch{}switch(h.tag){case 5:Lr||Zf(h,c);case 6:var g=xr,S=mo;xr=null,ll(s,c,h),xr=g,mo=S,xr!==null&&(mo?(s=xr,h=h.stateNode,s.nodeType===8?s.parentNode.removeChild(h):s.removeChild(h)):xr.removeChild(h.stateNode));break;case 18:xr!==null&&(mo?(s=xr,h=h.stateNode,s.nodeType===8?sS(s.parentNode,h):s.nodeType===1&&sS(s,h),rd(s)):sS(xr,h.stateNode));break;case 4:g=xr,S=mo,xr=h.stateNode.containerInfo,mo=!0,ll(s,c,h),xr=g,mo=S;break;case 0:case 11:case 14:case 15:if(!Lr&&(g=h.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){S=g=g.next;do{var k=S,F=k.destroy;k=k.tag,F!==void 0&&(k&2||k&4)&&HS(h,c,F),S=S.next}while(S!==g)}ll(s,c,h);break;case 1:if(!Lr&&(Zf(h,c),g=h.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=h.memoizedProps,g.state=h.memoizedState,g.componentWillUnmount()}catch(W){Fn(h,c,W)}ll(s,c,h);break;case 21:ll(s,c,h);break;case 22:h.mode&1?(Lr=(g=Lr)||h.memoizedState!==null,ll(s,c,h),Lr=g):ll(s,c,h);break;default:ll(s,c,h)}}function qT(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var h=s.stateNode;h===null&&(h=s.stateNode=new pL),c.forEach(function(g){var S=kL.bind(null,s,g);h.has(g)||(h.add(g),g.then(S,S))})}}function go(s,c){var h=c.deletions;if(h!==null)for(var g=0;gS&&(S=F),g&=~k}if(g=S,g=Rn()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*yL(g/1960))-g,10s?16:s,fl===null)var g=!1;else{if(s=fl,fl=null,jy=0,Bt&6)throw Error(n(331));var S=Bt;for(Bt|=4,He=s.current;He!==null;){var k=He,F=k.child;if(He.flags&16){var W=k.deletions;if(W!==null){for(var Y=0;YRn()-QS?gd(s,0):KS|=h),ei(s,c)}function t2(s,c){c===0&&(s.mode&1?(c=Ff,Ff<<=1,!(Ff&130023424)&&(Ff=4194304)):c=1);var h=Ur();s=Ns(s,c),s!==null&&(Zl(s,c,h),ei(s,h))}function _L(s){var c=s.memoizedState,h=0;c!==null&&(h=c.retryLane),t2(s,h)}function kL(s,c){var h=0;switch(s.tag){case 13:var g=s.stateNode,S=s.memoizedState;S!==null&&(h=S.retryLane);break;case 19:g=s.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(c),t2(s,h)}var n2;n2=function(s,c,h){if(s!==null)if(s.memoizedProps!==c.pendingProps||Qr.current)Xr=!0;else{if(!(s.lanes&h)&&!(c.flags&128))return Xr=!1,dL(s,c,h);Xr=!!(s.flags&131072)}else Xr=!1,vn&&c.flags&1048576&&PR(c,gy,c.index);switch(c.lanes=0,c.tag){case 2:var g=c.type;Ay(s,c),s=c.pendingProps;var S=Hf(c,Ir.current);Kf(c,h),S=CS(null,c,g,s,S,h);var k=ES();return c.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Yr(g)?(k=!0,hy(c)):k=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,SS(c),S.updater=xy,c.stateNode=S,S._reactInternals=c,xS(c,g,s,h),c=jS(null,c,g,!0,k,h)):(c.tag=0,vn&&k&&lS(c),qr(null,c,S,h),c=c.child),c;case 16:g=c.elementType;e:{switch(Ay(s,c),s=c.pendingProps,S=g._init,g=S(g._payload),c.type=g,S=c.tag=TL(g),s=po(g,s),S){case 0:c=BS(null,c,g,s,h);break e;case 1:c=NT(null,c,g,s,h);break e;case 11:c=_T(null,c,g,s,h);break e;case 14:c=kT(null,c,g,po(g.type,s),h);break e}throw Error(n(306,g,""))}return c;case 0:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:po(g,S),BS(s,c,g,S,h);case 1:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:po(g,S),NT(s,c,g,S,h);case 3:e:{if(CT(c),s===null)throw Error(n(387));g=c.pendingProps,k=c.memoizedState,S=k.element,JR(s,c),vy(c,g,null,h);var F=c.memoizedState;if(g=F.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:F.cache,pendingSuspenseBoundaries:F.pendingSuspenseBoundaries,transitions:F.transitions},c.updateQueue.baseState=k,c.memoizedState=k,c.flags&256){S=Xf(Error(n(423)),c),c=ET(s,c,g,h,S);break e}else if(g!==S){S=Xf(Error(n(424)),c),c=ET(s,c,g,h,S);break e}else for(gi=il(c.stateNode.containerInfo.firstChild),mi=c,vn=!0,ho=null,h=KR(c,null,g,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Vf(),g===S){c=Es(s,c,h);break e}qr(s,c,g,h)}c=c.child}return c;case 5:return QR(c),s===null&&hS(c),g=c.type,S=c.pendingProps,k=s!==null?s.memoizedProps:null,F=S.children,iS(g,S)?F=null:k!==null&&iS(g,k)&&(c.flags|=32),OT(s,c),qr(s,c,F,h),c.child;case 6:return s===null&&hS(c),null;case 13:return AT(s,c,h);case 4:return _S(c,c.stateNode.containerInfo),g=c.pendingProps,s===null?c.child=Qf(c,null,g,h):qr(s,c,g,h),c.child;case 11:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:po(g,S),_T(s,c,g,S,h);case 7:return qr(s,c,c.pendingProps,h),c.child;case 8:return qr(s,c,c.pendingProps.children,h),c.child;case 12:return qr(s,c,c.pendingProps.children,h),c.child;case 10:e:{if(g=c.type._context,S=c.pendingProps,k=c.memoizedProps,F=S.value,sn(wy,g._currentValue),g._currentValue=F,k!==null)if(fo(k.value,F)){if(k.children===S.children&&!Qr.current){c=Es(s,c,h);break e}}else for(k=c.child,k!==null&&(k.return=c);k!==null;){var W=k.dependencies;if(W!==null){F=k.child;for(var Y=W.firstContext;Y!==null;){if(Y.context===g){if(k.tag===1){Y=Cs(-1,h&-h),Y.tag=2;var he=k.updateQueue;if(he!==null){he=he.shared;var ve=he.pending;ve===null?Y.next=Y:(Y.next=ve.next,ve.next=Y),he.pending=Y}}k.lanes|=h,Y=k.alternate,Y!==null&&(Y.lanes|=h),wS(k.return,h,c),W.lanes|=h;break}Y=Y.next}}else if(k.tag===10)F=k.type===c.type?null:k.child;else if(k.tag===18){if(F=k.return,F===null)throw Error(n(341));F.lanes|=h,W=F.alternate,W!==null&&(W.lanes|=h),wS(F,h,c),F=k.sibling}else F=k.child;if(F!==null)F.return=k;else for(F=k;F!==null;){if(F===c){F=null;break}if(k=F.sibling,k!==null){k.return=F.return,F=k;break}F=F.return}k=F}qr(s,c,S.children,h),c=c.child}return c;case 9:return S=c.type,g=c.pendingProps.children,Kf(c,h),S=Ui(S),g=g(S),c.flags|=1,qr(s,c,g,h),c.child;case 14:return g=c.type,S=po(g,c.pendingProps),S=po(g.type,S),kT(s,c,g,S,h);case 15:return RT(s,c,c.type,c.pendingProps,h);case 17:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:po(g,S),Ay(s,c),c.tag=1,Yr(g)?(s=!0,hy(c)):s=!1,Kf(c,h),zR(c,g,S),xS(c,g,S,h),jS(null,c,g,!0,s,h);case 19:return IT(s,c,h);case 22:return TT(s,c,h)}throw Error(n(156,c.tag))};function r2(s,c){return gp(s,c)}function RL(s,c,h,g){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wi(s,c,h,g){return new RL(s,c,h,g)}function iv(s){return s=s.prototype,!(!s||!s.isReactComponent)}function TL(s){if(typeof s=="function")return iv(s)?1:0;if(s!=null){if(s=s.$$typeof,s===J)return 11;if(s===q)return 14}return 2}function ml(s,c){var h=s.alternate;return h===null?(h=Wi(s.tag,c,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=c,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&14680064,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,c=s.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h}function qy(s,c,h,g,S,k){var F=2;if(g=s,typeof s=="function")iv(s)&&(F=1);else if(typeof s=="string")F=5;else e:switch(s){case U:return wd(h.children,S,k,c);case v:F=8,S|=8;break;case R:return s=Wi(12,h,c,S|2),s.elementType=R,s.lanes=k,s;case P:return s=Wi(13,h,c,S),s.elementType=P,s.lanes=k,s;case D:return s=Wi(19,h,c,S),s.elementType=D,s.lanes=k,s;case Q:return Uy(h,S,k,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:F=10;break e;case M:F=9;break e;case J:F=11;break e;case q:F=14;break e;case K:F=16,g=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return c=Wi(F,h,c,S),c.elementType=s,c.type=g,c.lanes=k,c}function wd(s,c,h,g){return s=Wi(7,s,g,c),s.lanes=h,s}function Uy(s,c,h,g){return s=Wi(22,s,g,c),s.elementType=Q,s.lanes=h,s.stateNode={isHidden:!1},s}function ov(s,c,h){return s=Wi(6,s,null,c),s.lanes=h,s}function sv(s,c,h){return c=Wi(4,s.children!==null?s.children:[],s.key,c),c.lanes=h,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function OL(s,c,h,g,S){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Pf(0),this.expirationTimes=Pf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pf(0),this.identifierPrefix=g,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function av(s,c,h,g,S,k,F,W,Y){return s=new OL(s,c,h,W,Y),c===1?(c=1,k===!0&&(c|=8)):c=0,k=Wi(3,null,null,c),s.current=k,k.stateNode=s,k.memoizedState={element:g,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},SS(k),s}function NL(s,c,h){var g=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),hv.exports=JL(),hv.exports}var y2;function $L(){if(y2)return Qy;y2=1;var e=PI();return Qy.createRoot=e.createRoot,Qy.hydrateRoot=e.hydrateRoot,Qy}var qL=$L();const UL=Ju(qL);/** * @remix-run/router v1.6.3 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+_.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Wt(){return Wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Eh(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function zL(){return Math.random().toString(36).substr(2,8)}function b2(e,t){return{usr:e.state,key:e.key,idx:t}}function Xm(e,t,n,r){return n===void 0&&(n=null),Wt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Jl(t):t,{state:n,key:t&&t.key||r||zL()})}function uf(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Jl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function WL(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,u=ir.Pop,l=null,f=p();f==null&&(f=0,a.replaceState(Wt({},a.state,{idx:f}),""));function p(){return(a.state||{idx:null}).idx}function m(){u=ir.Pop;let k=p(),O=k==null?null:k-f;f=k,l&&l({action:u,location:x.location,delta:O})}function y(k,O){u=ir.Push;let N=Xm(x.location,k,O);f=p()+1;let E=b2(N,f),T=x.createHref(N);try{a.pushState(E,"",T)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;i.location.assign(T)}o&&l&&l({action:u,location:x.location,delta:1})}function w(k,O){u=ir.Replace;let N=Xm(x.location,k,O);f=p();let E=b2(N,f),T=x.createHref(N);a.replaceState(E,"",T),o&&l&&l({action:u,location:x.location,delta:0})}function b(k){let O=i.location.origin!=="null"?i.location.origin:i.location.href,N=typeof k=="string"?k:uf(k);return Ft(O,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,O)}let x={get action(){return u},get location(){return e(i,a)},listen(k){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(w2,m),l=k,()=>{i.removeEventListener(w2,m),l=null}},createHref(k){return t(i,k)},createURL:b,encodeLocation(k){let O=b(k);return{pathname:O.pathname,search:O.search,hash:O.hash}},push:y,replace:w,go(k){return a.go(k)}};return x}var or;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(or||(or={}));const VL=new Set(["lazy","caseSensitive","path","id","index","children"]);function GL(e){return e.index===!0}function jx(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let a=[...n,o],u=typeof i.id=="string"?i.id:a.join("-");if(Ft(i.index!==!0||!i.children,"Cannot specify children on an index route"),Ft(!r[u],'Found a route id collision on id "'+u+`". Route id's must be globally unique within Data Router usages`),GL(i)){let l=Wt({},i,t(i),{id:u});return r[u]=l,l}else{let l=Wt({},i,t(i),{id:u,children:void 0});return r[u]=l,i.children&&(l.children=jx(i.children,t,a,r)),l}})}function ph(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Jl(t):t,i=Xh(r.pathname||"/",n);if(i==null)return null;let o=MI(e);KL(o);let a=null;for(let u=0;a==null&&u{let l={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(Ft(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let f=Iu([r,l.relativePath]),p=n.concat(l);o.children&&o.children.length>0&&(Ft(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),MI(o.children,t,p,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:nB(f,o.index),routesMeta:p})};return e.forEach((o,a)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))i(o,a);else for(let l of LI(o.path))i(o,a,l)}),t}function LI(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=LI(r.join("/")),u=[];return u.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&u.push(...a),u.map(l=>e.startsWith("/")&&l===""?"/":l)}function KL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:rB(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const QL=/^:\w+$/,YL=3,XL=2,ZL=1,eB=10,tB=-2,S2=e=>e==="*";function nB(e,t){let n=e.split("/"),r=n.length;return n.some(S2)&&(r+=tB),t&&(r+=XL),n.filter(i=>!S2(i)).reduce((i,o)=>i+(QL.test(o)?YL:o===""?ZL:eB),r)}function rB(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function iB(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let a=0;a{if(p==="*"){let y=u[m]||"";a=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}return f[p]=cB(u[m]||"",p),f},{}),pathname:o,pathnameBase:a,pattern:e}}function sB(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Eh(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(a,u)=>(r.push(u),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function aB(e){try{return decodeURI(e)}catch(t){return Eh(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function cB(e,t){try{return decodeURIComponent(e)}catch(n){return Eh(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function Xh(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function uB(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Jl(e):e;return{pathname:n?n.startsWith("/")?n:lB(n,t):t,search:fB(r),hash:hB(i)}}function lB(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function gv(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function xg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kw(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Jl(e):(i=Wt({},e),Ft(!i.pathname||!i.pathname.includes("?"),gv("?","pathname","search",i)),Ft(!i.pathname||!i.pathname.includes("#"),gv("#","pathname","hash",i)),Ft(!i.search||!i.search.includes("#"),gv("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,u;if(r||a==null)u=n;else{let m=t.length-1;if(a.startsWith("..")){let y=a.split("/");for(;y[0]==="..";)y.shift(),m-=1;i.pathname=y.join("/")}u=m>=0?t[m]:"/"}let l=uB(i,u),f=a&&a!=="/"&&a.endsWith("/"),p=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(f||p)&&(l.pathname+="/"),l}const Iu=e=>e.join("/").replace(/\/\/+/g,"/"),dB=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),fB=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hB=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class r_{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function BI(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const jI=["post","put","patch","delete"],pB=new Set(jI),mB=["get",...jI],gB=new Set(mB),yB=new Set([301,302,303,307,308]),wB=new Set([307,308]),yv={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},bB={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},v2={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},DI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,SB=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function vB(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Ft(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let le=e.detectErrorBoundary;i=z=>({hasErrorBoundary:le(z)})}else i=SB;let o={},a=jx(e.routes,i,void 0,o),u,l=e.basename||"/",f=Wt({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),p=null,m=new Set,y=null,w=null,b=null,x=e.hydrationData!=null,k=ph(a,e.history.location,l),O=null;if(k==null){let le=To(404,{pathname:e.history.location.pathname}),{matches:z,route:ne}=N2(a);k=z,O={[ne.id]:le}}let N=!k.some(le=>le.route.lazy)&&(!k.some(le=>le.route.loader)||e.hydrationData!=null),E,T={historyAction:e.history.action,location:e.history.location,matches:k,initialized:N,navigation:yv,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||O,fetchers:new Map,blockers:new Map},B=ir.Pop,A=!1,U,v=!1,R=!1,C=[],M=[],J=new Map,P=0,D=-1,q=new Map,K=new Set,Q=new Map,H=new Map,X=new Map,I=!1;function te(){return p=e.history.listen(le=>{let{action:z,location:ne,delta:pe}=le;if(I){I=!1;return}Eh(X.size===0||pe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ce=ht({currentLocation:T.location,nextLocation:ne,historyAction:z});if(Ce&&pe!=null){I=!0,e.history.go(pe*-1),it(Ce,{state:"blocked",location:ne,proceed(){it(Ce,{state:"proceeding",proceed:void 0,reset:void 0,location:ne}),e.history.go(pe)},reset(){Be(Ce),be({blockers:new Map(E.state.blockers)})}});return}return Ze(z,ne)}),T.initialized||Ze(ir.Pop,T.location),E}function ge(){p&&p(),m.clear(),U&&U.abort(),T.fetchers.forEach((le,z)=>zn(z)),T.blockers.forEach((le,z)=>Be(z))}function oe(le){return m.add(le),()=>m.delete(le)}function be(le){T=Wt({},T,le),m.forEach(z=>z(T))}function ke(le,z){var ne,pe;let Ce=T.actionData!=null&&T.navigation.formMethod!=null&&Ru(T.navigation.formMethod)&&T.navigation.state==="loading"&&((ne=le.state)==null?void 0:ne._isRedirect)!==!0,Re;z.actionData?Object.keys(z.actionData).length>0?Re=z.actionData:Re=null:Ce?Re=T.actionData:Re=null;let je=z.loaderData?O2(T.loaderData,z.loaderData,z.matches||[],z.errors):T.loaderData;for(let[Le]of X)Be(Le);let Je=A===!0||T.navigation.formMethod!=null&&Ru(T.navigation.formMethod)&&((pe=le.state)==null?void 0:pe._isRedirect)!==!0;u&&(a=u,u=void 0),be(Wt({},z,{actionData:Re,loaderData:je,historyAction:B,location:le,initialized:!0,navigation:yv,revalidation:"idle",restoreScrollPosition:ur(le,z.matches||T.matches),preventScrollReset:Je,blockers:new Map(T.blockers)})),v||B===ir.Pop||(B===ir.Push?e.history.push(le,le.state):B===ir.Replace&&e.history.replace(le,le.state)),B=ir.Pop,A=!1,v=!1,R=!1,C=[],M=[]}async function Ne(le,z){if(typeof le=="number"){e.history.go(le);return}let ne=Dx(T.location,T.matches,l,f.v7_prependBasename,le,z==null?void 0:z.fromRouteId,z==null?void 0:z.relative),{path:pe,submission:Ce,error:Re}=x2(f.v7_normalizeFormMethod,!1,ne,z),je=T.location,Je=Xm(T.location,pe,z&&z.state);Je=Wt({},Je,e.history.encodeLocation(Je));let Le=z&&z.replace!=null?z.replace:void 0,Qe=ir.Push;Le===!0?Qe=ir.Replace:Le===!1||Ce!=null&&Ru(Ce.formMethod)&&Ce.formAction===T.location.pathname+T.location.search&&(Qe=ir.Replace);let dt=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,Xt=ht({currentLocation:je,nextLocation:Je,historyAction:Qe});if(Xt){it(Xt,{state:"blocked",location:Je,proceed(){it(Xt,{state:"proceeding",proceed:void 0,reset:void 0,location:Je}),Ne(le,z)},reset(){Be(Xt),be({blockers:new Map(T.blockers)})}});return}return await Ze(Qe,Je,{submission:Ce,pendingError:Re,preventScrollReset:dt,replace:z&&z.replace})}function Xe(){if(An(),be({revalidation:"loading"}),T.navigation.state!=="submitting"){if(T.navigation.state==="idle"){Ze(T.historyAction,T.location,{startUninterruptedRevalidation:!0});return}Ze(B||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation})}}async function Ze(le,z,ne){U&&U.abort(),U=null,B=le,v=(ne&&ne.startUninterruptedRevalidation)===!0,Sr(T.location,T.matches),A=(ne&&ne.preventScrollReset)===!0;let pe=u||a,Ce=ne&&ne.overrideNavigation,Re=ph(pe,z,l);if(!Re){let V=To(404,{pathname:z.pathname}),{matches:L,route:G}=N2(pe);Tt(),ke(z,{matches:L,loaderData:{},errors:{[G.id]:V}});return}if(T.initialized&&!R&&TB(T.location,z)&&!(ne&&ne.submission&&Ru(ne.submission.formMethod))){ke(z,{matches:Re});return}U=new AbortController;let je=Xp(e.history,z,U.signal,ne&&ne.submission),Je,Le;if(ne&&ne.pendingError)Le={[mh(Re).route.id]:ne.pendingError};else if(ne&&ne.submission&&Ru(ne.submission.formMethod)){let V=await Nt(je,z,ne.submission,Re,{replace:ne.replace});if(V.shortCircuited)return;Je=V.pendingActionData,Le=V.pendingActionError,Ce=Wt({state:"loading",location:z},ne.submission),je=new Request(je.url,{signal:je.signal})}let{shortCircuited:Qe,loaderData:dt,errors:Xt}=await nn(je,z,Re,Ce,ne&&ne.submission,ne&&ne.fetcherSubmission,ne&&ne.replace,Je,Le);Qe||(U=null,ke(z,Wt({matches:Re},Je?{actionData:Je}:{},{loaderData:dt,errors:Xt})))}async function Nt(le,z,ne,pe,Ce){An();let Re=Wt({state:"submitting",location:z},ne);be({navigation:Re});let je,Je=Jx(pe,z);if(!Je.route.action&&!Je.route.lazy)je={type:or.error,error:To(405,{method:le.method,pathname:z.pathname,routeId:Je.route.id})};else if(je=await Yp("action",le,Je,pe,o,i,l),le.signal.aborted)return{shortCircuited:!0};if(_h(je)){let Le;return Ce&&Ce.replace!=null?Le=Ce.replace:Le=je.location===T.location.pathname+T.location.search,await gt(T,je,{submission:ne,replace:Le}),{shortCircuited:!0}}if(Um(je)){let Le=mh(pe,Je.route.id);return(Ce&&Ce.replace)!==!0&&(B=ir.Push),{pendingActionData:{},pendingActionError:{[Le.route.id]:je.error}}}if(Xd(je))throw To(400,{type:"defer-action"});return{pendingActionData:{[Je.route.id]:je.data}}}async function nn(le,z,ne,pe,Ce,Re,je,Je,Le){let Qe=pe;Qe||(Qe=Wt({state:"loading",location:z,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Ce));let dt=Ce||Re?Ce||Re:Qe.formMethod&&Qe.formAction&&Qe.formData&&Qe.formEncType?{formMethod:Qe.formMethod,formAction:Qe.formAction,formData:Qe.formData,formEncType:Qe.formEncType}:void 0,Xt=u||a,[V,L]=_2(e.history,T,ne,dt,z,R,C,M,Q,Xt,l,Je,Le);if(Tt(Ke=>!(ne&&ne.some(Et=>Et.route.id===Ke))||V&&V.some(Et=>Et.route.id===Ke)),V.length===0&&L.length===0){let Ke=ae();return ke(z,Wt({matches:ne,loaderData:{},errors:Le||null},Je?{actionData:Je}:{},Ke?{fetchers:new Map(T.fetchers)}:{})),{shortCircuited:!0}}if(!v){L.forEach(Et=>{let Ut=T.fetchers.get(Et.key),Lt={state:"loading",data:Ut&&Ut.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};T.fetchers.set(Et.key,Lt)});let Ke=Je||T.actionData;be(Wt({navigation:Qe},Ke?Object.keys(Ke).length===0?{actionData:null}:{actionData:Ke}:{},L.length>0?{fetchers:new Map(T.fetchers)}:{}))}D=++P,L.forEach(Ke=>{Ke.controller&&J.set(Ke.key,Ke.controller)});let G=()=>L.forEach(Ke=>qt(Ke.key));U&&U.signal.addEventListener("abort",G);let{results:Z,loaderResults:de,fetcherResults:me}=await hn(T.matches,ne,V,L,le);if(le.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",G),L.forEach(Ke=>J.delete(Ke.key));let Te=C2(Z);if(Te)return await gt(T,Te,{replace:je}),{shortCircuited:!0};let{loaderData:Ae,errors:nt}=T2(T,ne,V,de,Le,L,me,H);H.forEach((Ke,Et)=>{Ke.subscribe(Ut=>{(Ut||Ke.done)&&H.delete(Et)})});let ze=ae(),st=Ee(D),ot=ze||st||L.length>0;return Wt({loaderData:Ae,errors:nt},ot?{fetchers:new Map(T.fetchers)}:{})}function kt(le){return T.fetchers.get(le)||bB}function En(le,z,ne,pe){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");J.has(le)&&qt(le);let Ce=u||a,Re=Dx(T.location,T.matches,l,f.v7_prependBasename,ne,z,pe==null?void 0:pe.relative),je=ph(Ce,Re,l);if(!je){cr(le,z,To(404,{pathname:Re}));return}let{path:Je,submission:Le}=x2(f.v7_normalizeFormMethod,!0,Re,pe),Qe=Jx(je,Je);if(A=(pe&&pe.preventScrollReset)===!0,Le&&Ru(Le.formMethod)){Rt(le,z,Je,Qe,je,Le);return}Q.set(le,{routeId:z,path:Je}),Ct(le,z,Je,Qe,je,Le)}async function Rt(le,z,ne,pe,Ce,Re){if(An(),Q.delete(le),!pe.route.action&&!pe.route.lazy){let Lt=To(405,{method:Re.formMethod,pathname:ne,routeId:z});cr(le,z,Lt);return}let je=T.fetchers.get(le),Je=Wt({state:"submitting"},Re,{data:je&&je.data," _hasFetcherDoneAnything ":!0});T.fetchers.set(le,Je),be({fetchers:new Map(T.fetchers)});let Le=new AbortController,Qe=Xp(e.history,ne,Le.signal,Re);J.set(le,Le);let dt=await Yp("action",Qe,pe,Ce,o,i,l);if(Qe.signal.aborted){J.get(le)===Le&&J.delete(le);return}if(_h(dt)){J.delete(le),K.add(le);let Lt=Wt({state:"loading"},Re,{data:void 0," _hasFetcherDoneAnything ":!0});return T.fetchers.set(le,Lt),be({fetchers:new Map(T.fetchers)}),gt(T,dt,{submission:Re,isFetchActionRedirect:!0})}if(Um(dt)){cr(le,z,dt.error);return}if(Xd(dt))throw To(400,{type:"defer-action"});let Xt=T.navigation.location||T.location,V=Xp(e.history,Xt,Le.signal),L=u||a,G=T.navigation.state!=="idle"?ph(L,T.navigation.location,l):T.matches;Ft(G,"Didn't find any matches after fetcher action");let Z=++P;q.set(le,Z);let de=Wt({state:"loading",data:dt.data},Re,{" _hasFetcherDoneAnything ":!0});T.fetchers.set(le,de);let[me,Te]=_2(e.history,T,G,Re,Xt,R,C,M,Q,L,l,{[pe.route.id]:dt.data},void 0);Te.filter(Lt=>Lt.key!==le).forEach(Lt=>{let Wn=Lt.key,Xn=T.fetchers.get(Wn),di={state:"loading",data:Xn&&Xn.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};T.fetchers.set(Wn,di),Lt.controller&&J.set(Wn,Lt.controller)}),be({fetchers:new Map(T.fetchers)});let Ae=()=>Te.forEach(Lt=>qt(Lt.key));Le.signal.addEventListener("abort",Ae);let{results:nt,loaderResults:ze,fetcherResults:st}=await hn(T.matches,G,me,Te,V);if(Le.signal.aborted)return;Le.signal.removeEventListener("abort",Ae),q.delete(le),J.delete(le),Te.forEach(Lt=>J.delete(Lt.key));let ot=C2(nt);if(ot)return gt(T,ot);let{loaderData:Ke,errors:Et}=T2(T,T.matches,me,ze,void 0,Te,st,H);if(T.fetchers.has(le)){let Lt={state:"idle",data:dt.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};T.fetchers.set(le,Lt)}let Ut=Ee(Z);T.navigation.state==="loading"&&Z>D?(Ft(B,"Expected pending action"),U&&U.abort(),ke(T.navigation.location,{matches:G,loaderData:Ke,errors:Et,fetchers:new Map(T.fetchers)})):(be(Wt({errors:Et,loaderData:O2(T.loaderData,Ke,G,Et)},Ut||Te.length>0?{fetchers:new Map(T.fetchers)}:{})),R=!1)}async function Ct(le,z,ne,pe,Ce,Re){let je=T.fetchers.get(le),Je=Wt({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Re,{data:je&&je.data," _hasFetcherDoneAnything ":!0});T.fetchers.set(le,Je),be({fetchers:new Map(T.fetchers)});let Le=new AbortController,Qe=Xp(e.history,ne,Le.signal);J.set(le,Le);let dt=await Yp("loader",Qe,pe,Ce,o,i,l);if(Xd(dt)&&(dt=await UI(dt,Qe.signal,!0)||dt),J.get(le)===Le&&J.delete(le),Qe.signal.aborted)return;if(_h(dt)){K.add(le),await gt(T,dt);return}if(Um(dt)){let V=mh(T.matches,z);T.fetchers.delete(le),be({fetchers:new Map(T.fetchers),errors:{[V.route.id]:dt.error}});return}Ft(!Xd(dt),"Unhandled fetcher deferred data");let Xt={state:"idle",data:dt.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};T.fetchers.set(le,Xt),be({fetchers:new Map(T.fetchers)})}async function gt(le,z,ne){let{submission:pe,replace:Ce,isFetchActionRedirect:Re}=ne===void 0?{}:ne;z.revalidate&&(R=!0);let je=Xm(le.location,z.location,Wt({_isRedirect:!0},Re?{_isFetchActionRedirect:!0}:{}));if(Ft(je,"Expected a location on the redirect navigation"),DI.test(z.location)&&n){let V=e.history.createURL(z.location),L=Xh(V.pathname,l)==null;if(t.location.origin!==V.origin||L){Ce?t.location.replace(z.location):t.location.assign(z.location);return}}U=null;let Je=Ce===!0?ir.Replace:ir.Push,{formMethod:Le,formAction:Qe,formEncType:dt,formData:Xt}=le.navigation;!pe&&Le&&Qe&&Xt&&dt&&(pe={formMethod:Le,formAction:Qe,formEncType:dt,formData:Xt}),wB.has(z.status)&&pe&&Ru(pe.formMethod)?await Ze(Je,je,{submission:Wt({},pe,{formAction:z.location}),preventScrollReset:A}):Re?await Ze(Je,je,{overrideNavigation:{state:"loading",location:je,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},fetcherSubmission:pe,preventScrollReset:A}):await Ze(Je,je,{overrideNavigation:{state:"loading",location:je,formMethod:pe?pe.formMethod:void 0,formAction:pe?pe.formAction:void 0,formEncType:pe?pe.formEncType:void 0,formData:pe?pe.formData:void 0},preventScrollReset:A})}async function hn(le,z,ne,pe,Ce){let Re=await Promise.all([...ne.map(Le=>Yp("loader",Ce,Le,z,o,i,l)),...pe.map(Le=>Le.matches&&Le.match&&Le.controller?Yp("loader",Xp(e.history,Le.path,Le.controller.signal),Le.match,Le.matches,o,i,l):{type:or.error,error:To(404,{pathname:Le.path})})]),je=Re.slice(0,ne.length),Je=Re.slice(ne.length);return await Promise.all([E2(le,ne,je,je.map(()=>Ce.signal),!1,T.loaderData),E2(le,pe.map(Le=>Le.match),Je,pe.map(Le=>Le.controller?Le.controller.signal:null),!0)]),{results:Re,loaderResults:je,fetcherResults:Je}}function An(){R=!0,C.push(...Tt()),Q.forEach((le,z)=>{J.has(z)&&(M.push(z),qt(z))})}function cr(le,z,ne){let pe=mh(T.matches,z);zn(le),be({errors:{[pe.route.id]:ne},fetchers:new Map(T.fetchers)})}function zn(le){let z=T.fetchers.get(le);J.has(le)&&!(z&&z.state==="loading"&&q.has(le))&&qt(le),Q.delete(le),q.delete(le),K.delete(le),T.fetchers.delete(le)}function qt(le){let z=J.get(le);Ft(z,"Expected fetch controller: "+le),z.abort(),J.delete(le)}function on(le){for(let z of le){let pe={state:"idle",data:kt(z).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};T.fetchers.set(z,pe)}}function ae(){let le=[],z=!1;for(let ne of K){let pe=T.fetchers.get(ne);Ft(pe,"Expected fetcher: "+ne),pe.state==="loading"&&(K.delete(ne),le.push(ne),z=!0)}return on(le),z}function Ee(le){let z=[];for(let[ne,pe]of q)if(pe0}function Pe(le,z){let ne=T.blockers.get(le)||v2;return X.get(le)!==z&&X.set(le,z),ne}function Be(le){T.blockers.delete(le),X.delete(le)}function it(le,z){let ne=T.blockers.get(le)||v2;Ft(ne.state==="unblocked"&&z.state==="blocked"||ne.state==="blocked"&&z.state==="blocked"||ne.state==="blocked"&&z.state==="proceeding"||ne.state==="blocked"&&z.state==="unblocked"||ne.state==="proceeding"&&z.state==="unblocked","Invalid blocker state transition: "+ne.state+" -> "+z.state),T.blockers.set(le,z),be({blockers:new Map(T.blockers)})}function ht(le){let{currentLocation:z,nextLocation:ne,historyAction:pe}=le;if(X.size===0)return;X.size>1&&Eh(!1,"A router only supports one blocker at a time");let Ce=Array.from(X.entries()),[Re,je]=Ce[Ce.length-1],Je=T.blockers.get(Re);if(!(Je&&Je.state==="proceeding")&&je({currentLocation:z,nextLocation:ne,historyAction:pe}))return Re}function Tt(le){let z=[];return H.forEach((ne,pe)=>{(!le||le(pe))&&(ne.cancel(),z.push(pe),H.delete(pe))}),z}function Bn(le,z,ne){if(y=le,b=z,w=ne||(pe=>pe.key),!x&&T.navigation===yv){x=!0;let pe=ur(T.location,T.matches);pe!=null&&be({restoreScrollPosition:pe})}return()=>{y=null,b=null,w=null}}function Sr(le,z){if(y&&w&&b){let ne=z.map(Ce=>A2(Ce,T.loaderData)),pe=w(le,ne)||le.key;y[pe]=b()}}function ur(le,z){if(y&&w&&b){let ne=z.map(Re=>A2(Re,T.loaderData)),pe=w(le,ne)||le.key,Ce=y[pe];if(typeof Ce=="number")return Ce}return null}function Kr(le){o={},u=jx(le,i,void 0,o)}return E={get basename(){return l},get state(){return T},get routes(){return a},initialize:te,subscribe:oe,enableScrollRestoration:Bn,navigate:Ne,fetch:En,revalidate:Xe,createHref:le=>e.history.createHref(le),encodeLocation:le=>e.history.encodeLocation(le),getFetcher:kt,deleteFetcher:zn,dispose:ge,getBlocker:Pe,deleteBlocker:Be,_internalFetchControllers:J,_internalActiveDeferreds:H,_internalSetRoutes:Kr},E}function xB(e){return e!=null&&"formData"in e}function Dx(e,t,n,r,i,o,a){let u,l;if(o!=null&&a!=="path"){u=[];for(let p of t)if(u.push(p),p.route.id===o){l=p;break}}else u=t,l=t[t.length-1];let f=kw(i||".",xg(u).map(p=>p.pathnameBase),Xh(e.pathname,n)||e.pathname,a==="path");return i==null&&(f.search=e.search,f.hash=e.hash),(i==null||i===""||i===".")&&l&&l.route.index&&!i_(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:Iu([n,f.pathname])),uf(f)}function x2(e,t,n,r){if(!r||!xB(r))return{path:n};if(r.formMethod&&!CB(r.formMethod))return{path:n,error:To(405,{method:r.formMethod})};let i;if(r.formData){let u=r.formMethod||"get";if(i={formMethod:e?u.toUpperCase():u.toLowerCase(),formAction:qI(n),formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:r.formData},Ru(i.formMethod))return{path:n,submission:i}}let o=Jl(n),a=$I(r.formData);return t&&o.search&&i_(o.search)&&a.append("index",""),o.search="?"+a,{path:uf(o),submission:i}}function _B(e,t){let n=e;if(t){let r=e.findIndex(i=>i.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function _2(e,t,n,r,i,o,a,u,l,f,p,m,y){let w=y?Object.values(y)[0]:m?Object.values(m)[0]:void 0,b=e.createURL(t.location),x=e.createURL(i),k=y?Object.keys(y)[0]:void 0,N=_B(n,k).filter((T,B)=>{if(T.route.lazy)return!0;if(T.route.loader==null)return!1;if(kB(t.loaderData,t.matches[B],T)||a.some(v=>v===T.route.id))return!0;let A=t.matches[B],U=T;return k2(T,Wt({currentUrl:b,currentParams:A.params,nextUrl:x,nextParams:U.params},r,{actionResult:w,defaultShouldRevalidate:o||b.pathname+b.search===x.pathname+x.search||b.search!==x.search||JI(A,U)}))}),E=[];return l.forEach((T,B)=>{if(!n.some(R=>R.route.id===T.routeId))return;let A=ph(f,T.path,p);if(!A){E.push({key:B,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let U=Jx(A,T.path);if(u.includes(B)){E.push({key:B,routeId:T.routeId,path:T.path,matches:A,match:U,controller:new AbortController});return}k2(U,Wt({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:w,defaultShouldRevalidate:o}))&&E.push({key:B,routeId:T.routeId,path:T.path,matches:A,match:U,controller:new AbortController})}),[N,E]}function kB(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function JI(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function k2(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function R2(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];Ft(i,"No route found in manifest");let o={};for(let a in r){let l=i[a]!==void 0&&a!=="hasErrorBoundary";Eh(!l,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!VL.has(a)&&(o[a]=r[a])}Object.assign(i,o),Object.assign(i,Wt({},t(i),{lazy:void 0}))}async function Yp(e,t,n,r,i,o,a,u,l,f){u===void 0&&(u=!1),l===void 0&&(l=!1);let p,m,y,w=k=>{let O,N=new Promise((E,T)=>O=T);return y=()=>O(),t.signal.addEventListener("abort",y),Promise.race([k({request:t,params:n.params,context:f}),N])};try{let k=n.route[e];if(n.route.lazy)if(k)m=(await Promise.all([w(k),R2(n.route,o,i)]))[0];else if(await R2(n.route,o,i),k=n.route[e],k)m=await w(k);else if(e==="action"){let O=new URL(t.url),N=O.pathname+O.search;throw To(405,{method:t.method,pathname:N,routeId:n.route.id})}else return{type:or.data,data:void 0};else if(k)m=await w(k);else{let O=new URL(t.url),N=O.pathname+O.search;throw To(404,{pathname:N})}Ft(m!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(k){p=or.error,m=k}finally{y&&t.signal.removeEventListener("abort",y)}if(NB(m)){let k=m.status;if(yB.has(k)){let E=m.headers.get("Location");if(Ft(E,"Redirects returned/thrown from loaders/actions must have a Location header"),!DI.test(E))E=Dx(new URL(t.url),r.slice(0,r.indexOf(n)+1),a,!0,E);else if(!u){let T=new URL(t.url),B=E.startsWith("//")?new URL(T.protocol+E):new URL(E),A=Xh(B.pathname,a)!=null;B.origin===T.origin&&A&&(E=B.pathname+B.search+B.hash)}if(u)throw m.headers.set("Location",E),m;return{type:or.redirect,status:k,location:E,revalidate:m.headers.get("X-Remix-Revalidate")!==null}}if(l)throw{type:p||or.data,response:m};let O,N=m.headers.get("Content-Type");return N&&/\bapplication\/json\b/.test(N)?O=await m.json():O=await m.text(),p===or.error?{type:p,error:new r_(k,m.statusText,O),headers:m.headers}:{type:or.data,data:O,statusCode:m.status,headers:m.headers}}if(p===or.error)return{type:p,error:m};if(OB(m)){var b,x;return{type:or.deferred,deferredData:m,statusCode:(b=m.init)==null?void 0:b.status,headers:((x=m.init)==null?void 0:x.headers)&&new Headers(m.init.headers)}}return{type:or.data,data:m}}function Xp(e,t,n,r){let i=e.createURL(qI(t)).toString(),o={signal:n};if(r&&Ru(r.formMethod)){let{formMethod:a,formEncType:u,formData:l}=r;o.method=a.toUpperCase(),o.body=u==="application/x-www-form-urlencoded"?$I(l):l}return new Request(i,o)}function $I(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,r instanceof File?r.name:r);return t}function RB(e,t,n,r,i){let o={},a=null,u,l=!1,f={};return n.forEach((p,m)=>{let y=t[m].route.id;if(Ft(!_h(p),"Cannot handle redirect results in processLoaderData"),Um(p)){let w=mh(e,y),b=p.error;r&&(b=Object.values(r)[0],r=void 0),a=a||{},a[w.route.id]==null&&(a[w.route.id]=b),o[y]=void 0,l||(l=!0,u=BI(p.error)?p.error.status:500),p.headers&&(f[y]=p.headers)}else Xd(p)?(i.set(y,p.deferredData),o[y]=p.deferredData.data):o[y]=p.data,p.statusCode!=null&&p.statusCode!==200&&!l&&(u=p.statusCode),p.headers&&(f[y]=p.headers)}),r&&(a=r,o[Object.keys(r)[0]]=void 0),{loaderData:o,errors:a,statusCode:u||200,loaderHeaders:f}}function T2(e,t,n,r,i,o,a,u){let{loaderData:l,errors:f}=RB(t,n,r,i,u);for(let p=0;pr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function N2(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function To(e,t){let{pathname:n,routeId:r,method:i,type:o}=t===void 0?{}:t,a="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(a="Bad Request",i&&n&&r?u="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"&&(u="defer() is not supported in actions")):e===403?(a="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",u='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",i&&n&&r?u="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(u='Invalid request method "'+i.toUpperCase()+'"')),new r_(e||500,a,new Error(u),!0)}function C2(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(_h(n))return n}}function qI(e){let t=typeof e=="string"?Jl(e):e;return uf(Wt({},t,{hash:""}))}function TB(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Xd(e){return e.type===or.deferred}function Um(e){return e.type===or.error}function _h(e){return(e&&e.type)===or.redirect}function OB(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function NB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function CB(e){return gB.has(e.toLowerCase())}function Ru(e){return pB.has(e.toLowerCase())}async function E2(e,t,n,r,i,o){for(let a=0;am.route.id===l.route.id),p=f!=null&&!JI(f,l)&&(o&&o[l.route.id])!==void 0;if(Xd(u)&&(i||p)){let m=r[a];Ft(m,"Expected an AbortSignal for revalidating fetcher deferred result"),await UI(u,m,i).then(y=>{y&&(n[a]=y||n[a])})}}}async function UI(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:or.data,data:e.deferredData.unwrappedData}}catch(i){return{type:or.error,error:i}}return{type:or.data,data:e.deferredData.data}}}function i_(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function A2(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Jx(e,t){let n=typeof t=="string"?Jl(t).search:t.search;if(e[e.length-1].route.index&&i_(n||""))return e[e.length-1];let r=xg(e);return r[r.length-1]}/** + */function Wt(){return Wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function uf(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function zL(){return Math.random().toString(36).substr(2,8)}function b2(e,t){return{usr:e.state,key:e.key,idx:t}}function Xm(e,t,n,r){return n===void 0&&(n=null),Wt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?$u(t):t,{state:n,key:t&&t.key||r||zL()})}function lf(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function $u(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function WL(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,u=ir.Pop,l=null,f=p();f==null&&(f=0,a.replaceState(Wt({},a.state,{idx:f}),""));function p(){return(a.state||{idx:null}).idx}function m(){u=ir.Pop;let _=p(),O=_==null?null:_-f;f=_,l&&l({action:u,location:x.location,delta:O})}function y(_,O){u=ir.Push;let N=Xm(x.location,_,O);n&&n(N,_),f=p()+1;let E=b2(N,f),T=x.createHref(N);try{a.pushState(E,"",T)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;i.location.assign(T)}o&&l&&l({action:u,location:x.location,delta:1})}function w(_,O){u=ir.Replace;let N=Xm(x.location,_,O);n&&n(N,_),f=p();let E=b2(N,f),T=x.createHref(N);a.replaceState(E,"",T),o&&l&&l({action:u,location:x.location,delta:0})}function b(_){let O=i.location.origin!=="null"?i.location.origin:i.location.href,N=typeof _=="string"?_:lf(_);return Ft(O,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,O)}let x={get action(){return u},get location(){return e(i,a)},listen(_){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(w2,m),l=_,()=>{i.removeEventListener(w2,m),l=null}},createHref(_){return t(i,_)},createURL:b,encodeLocation(_){let O=b(_);return{pathname:O.pathname,search:O.search,hash:O.hash}},push:y,replace:w,go(_){return a.go(_)}};return x}var or;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(or||(or={}));const VL=new Set(["lazy","caseSensitive","path","id","index","children"]);function GL(e){return e.index===!0}function jx(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let a=[...n,o],u=typeof i.id=="string"?i.id:a.join("-");if(Ft(i.index!==!0||!i.children,"Cannot specify children on an index route"),Ft(!r[u],'Found a route id collision on id "'+u+`". Route id's must be globally unique within Data Router usages`),GL(i)){let l=Wt({},i,t(i),{id:u});return r[u]=l,l}else{let l=Wt({},i,t(i),{id:u,children:void 0});return r[u]=l,i.children&&(l.children=jx(i.children,t,a,r)),l}})}function mh(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?$u(t):t,i=Xh(r.pathname||"/",n);if(i==null)return null;let o=MI(e);KL(o);let a=null;for(let u=0;a==null&&u{let l={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(Ft(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let f=Iu([r,l.relativePath]),p=n.concat(l);o.children&&o.children.length>0&&(Ft(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),MI(o.children,t,p,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:nB(f,o.index),routesMeta:p})};return e.forEach((o,a)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))i(o,a);else for(let l of LI(o.path))i(o,a,l)}),t}function LI(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=LI(r.join("/")),u=[];return u.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&u.push(...a),u.map(l=>e.startsWith("/")&&l===""?"/":l)}function KL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:rB(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const QL=/^:\w+$/,YL=3,XL=2,ZL=1,eB=10,tB=-2,S2=e=>e==="*";function nB(e,t){let n=e.split("/"),r=n.length;return n.some(S2)&&(r+=tB),t&&(r+=XL),n.filter(i=>!S2(i)).reduce((i,o)=>i+(QL.test(o)?YL:o===""?ZL:eB),r)}function rB(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function iB(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let a=0;a{if(p==="*"){let y=u[m]||"";a=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}return f[p]=cB(u[m]||"",p),f},{}),pathname:o,pathnameBase:a,pattern:e}}function sB(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),uf(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(a,u)=>(r.push(u),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function aB(e){try{return decodeURI(e)}catch(t){return uf(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function cB(e,t){try{return decodeURIComponent(e)}catch(n){return uf(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function Xh(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function uB(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?$u(e):e;return{pathname:n?n.startsWith("/")?n:lB(n,t):t,search:fB(r),hash:hB(i)}}function lB(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function gv(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function xg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kw(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=$u(e):(i=Wt({},e),Ft(!i.pathname||!i.pathname.includes("?"),gv("?","pathname","search",i)),Ft(!i.pathname||!i.pathname.includes("#"),gv("#","pathname","hash",i)),Ft(!i.search||!i.search.includes("#"),gv("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,u;if(r||a==null)u=n;else{let m=t.length-1;if(a.startsWith("..")){let y=a.split("/");for(;y[0]==="..";)y.shift(),m-=1;i.pathname=y.join("/")}u=m>=0?t[m]:"/"}let l=uB(i,u),f=a&&a!=="/"&&a.endsWith("/"),p=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(f||p)&&(l.pathname+="/"),l}const Iu=e=>e.join("/").replace(/\/\/+/g,"/"),dB=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),fB=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hB=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class r_{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function BI(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const jI=["post","put","patch","delete"],pB=new Set(jI),mB=["get",...jI],gB=new Set(mB),yB=new Set([301,302,303,307,308]),wB=new Set([307,308]),yv={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},bB={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},v2={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},DI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,SB=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function vB(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Ft(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let le=e.detectErrorBoundary;i=z=>({hasErrorBoundary:le(z)})}else i=SB;let o={},a=jx(e.routes,i,void 0,o),u,l=e.basename||"/",f=Wt({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),p=null,m=new Set,y=null,w=null,b=null,x=e.hydrationData!=null,_=mh(a,e.history.location,l),O=null;if(_==null){let le=To(404,{pathname:e.history.location.pathname}),{matches:z,route:ne}=N2(a);_=z,O={[ne.id]:le}}let N=!_.some(le=>le.route.lazy)&&(!_.some(le=>le.route.loader)||e.hydrationData!=null),E,T={historyAction:e.history.action,location:e.history.location,matches:_,initialized:N,navigation:yv,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||O,fetchers:new Map,blockers:new Map},B=ir.Pop,A=!1,U,v=!1,R=!1,C=[],M=[],J=new Map,P=0,D=-1,q=new Map,K=new Set,Q=new Map,H=new Map,X=new Map,I=!1;function te(){return p=e.history.listen(le=>{let{action:z,location:ne,delta:pe}=le;if(I){I=!1;return}uf(X.size===0||pe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ce=ht({currentLocation:T.location,nextLocation:ne,historyAction:z});if(Ce&&pe!=null){I=!0,e.history.go(pe*-1),it(Ce,{state:"blocked",location:ne,proceed(){it(Ce,{state:"proceeding",proceed:void 0,reset:void 0,location:ne}),e.history.go(pe)},reset(){Be(Ce),be({blockers:new Map(E.state.blockers)})}});return}return Ze(z,ne)}),T.initialized||Ze(ir.Pop,T.location),E}function ge(){p&&p(),m.clear(),U&&U.abort(),T.fetchers.forEach((le,z)=>zn(z)),T.blockers.forEach((le,z)=>Be(z))}function oe(le){return m.add(le),()=>m.delete(le)}function be(le){T=Wt({},T,le),m.forEach(z=>z(T))}function ke(le,z){var ne,pe;let Ce=T.actionData!=null&&T.navigation.formMethod!=null&&Ru(T.navigation.formMethod)&&T.navigation.state==="loading"&&((ne=le.state)==null?void 0:ne._isRedirect)!==!0,Re;z.actionData?Object.keys(z.actionData).length>0?Re=z.actionData:Re=null:Ce?Re=T.actionData:Re=null;let je=z.loaderData?O2(T.loaderData,z.loaderData,z.matches||[],z.errors):T.loaderData;for(let[Le]of X)Be(Le);let Je=A===!0||T.navigation.formMethod!=null&&Ru(T.navigation.formMethod)&&((pe=le.state)==null?void 0:pe._isRedirect)!==!0;u&&(a=u,u=void 0),be(Wt({},z,{actionData:Re,loaderData:je,historyAction:B,location:le,initialized:!0,navigation:yv,revalidation:"idle",restoreScrollPosition:ur(le,z.matches||T.matches),preventScrollReset:Je,blockers:new Map(T.blockers)})),v||B===ir.Pop||(B===ir.Push?e.history.push(le,le.state):B===ir.Replace&&e.history.replace(le,le.state)),B=ir.Pop,A=!1,v=!1,R=!1,C=[],M=[]}async function Ne(le,z){if(typeof le=="number"){e.history.go(le);return}let ne=Dx(T.location,T.matches,l,f.v7_prependBasename,le,z==null?void 0:z.fromRouteId,z==null?void 0:z.relative),{path:pe,submission:Ce,error:Re}=x2(f.v7_normalizeFormMethod,!1,ne,z),je=T.location,Je=Xm(T.location,pe,z&&z.state);Je=Wt({},Je,e.history.encodeLocation(Je));let Le=z&&z.replace!=null?z.replace:void 0,Qe=ir.Push;Le===!0?Qe=ir.Replace:Le===!1||Ce!=null&&Ru(Ce.formMethod)&&Ce.formAction===T.location.pathname+T.location.search&&(Qe=ir.Replace);let dt=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,Xt=ht({currentLocation:je,nextLocation:Je,historyAction:Qe});if(Xt){it(Xt,{state:"blocked",location:Je,proceed(){it(Xt,{state:"proceeding",proceed:void 0,reset:void 0,location:Je}),Ne(le,z)},reset(){Be(Xt),be({blockers:new Map(T.blockers)})}});return}return await Ze(Qe,Je,{submission:Ce,pendingError:Re,preventScrollReset:dt,replace:z&&z.replace})}function Xe(){if(An(),be({revalidation:"loading"}),T.navigation.state!=="submitting"){if(T.navigation.state==="idle"){Ze(T.historyAction,T.location,{startUninterruptedRevalidation:!0});return}Ze(B||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation})}}async function Ze(le,z,ne){U&&U.abort(),U=null,B=le,v=(ne&&ne.startUninterruptedRevalidation)===!0,Sr(T.location,T.matches),A=(ne&&ne.preventScrollReset)===!0;let pe=u||a,Ce=ne&&ne.overrideNavigation,Re=mh(pe,z,l);if(!Re){let V=To(404,{pathname:z.pathname}),{matches:L,route:G}=N2(pe);Tt(),ke(z,{matches:L,loaderData:{},errors:{[G.id]:V}});return}if(T.initialized&&!R&&TB(T.location,z)&&!(ne&&ne.submission&&Ru(ne.submission.formMethod))){ke(z,{matches:Re});return}U=new AbortController;let je=Xp(e.history,z,U.signal,ne&&ne.submission),Je,Le;if(ne&&ne.pendingError)Le={[gh(Re).route.id]:ne.pendingError};else if(ne&&ne.submission&&Ru(ne.submission.formMethod)){let V=await Nt(je,z,ne.submission,Re,{replace:ne.replace});if(V.shortCircuited)return;Je=V.pendingActionData,Le=V.pendingActionError,Ce=Wt({state:"loading",location:z},ne.submission),je=new Request(je.url,{signal:je.signal})}let{shortCircuited:Qe,loaderData:dt,errors:Xt}=await nn(je,z,Re,Ce,ne&&ne.submission,ne&&ne.fetcherSubmission,ne&&ne.replace,Je,Le);Qe||(U=null,ke(z,Wt({matches:Re},Je?{actionData:Je}:{},{loaderData:dt,errors:Xt})))}async function Nt(le,z,ne,pe,Ce){An();let Re=Wt({state:"submitting",location:z},ne);be({navigation:Re});let je,Je=Jx(pe,z);if(!Je.route.action&&!Je.route.lazy)je={type:or.error,error:To(405,{method:le.method,pathname:z.pathname,routeId:Je.route.id})};else if(je=await Yp("action",le,Je,pe,o,i,l),le.signal.aborted)return{shortCircuited:!0};if(kh(je)){let Le;return Ce&&Ce.replace!=null?Le=Ce.replace:Le=je.location===T.location.pathname+T.location.search,await gt(T,je,{submission:ne,replace:Le}),{shortCircuited:!0}}if(Um(je)){let Le=gh(pe,Je.route.id);return(Ce&&Ce.replace)!==!0&&(B=ir.Push),{pendingActionData:{},pendingActionError:{[Le.route.id]:je.error}}}if(Xd(je))throw To(400,{type:"defer-action"});return{pendingActionData:{[Je.route.id]:je.data}}}async function nn(le,z,ne,pe,Ce,Re,je,Je,Le){let Qe=pe;Qe||(Qe=Wt({state:"loading",location:z,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Ce));let dt=Ce||Re?Ce||Re:Qe.formMethod&&Qe.formAction&&Qe.formData&&Qe.formEncType?{formMethod:Qe.formMethod,formAction:Qe.formAction,formData:Qe.formData,formEncType:Qe.formEncType}:void 0,Xt=u||a,[V,L]=_2(e.history,T,ne,dt,z,R,C,M,Q,Xt,l,Je,Le);if(Tt(Ke=>!(ne&&ne.some(Et=>Et.route.id===Ke))||V&&V.some(Et=>Et.route.id===Ke)),V.length===0&&L.length===0){let Ke=ae();return ke(z,Wt({matches:ne,loaderData:{},errors:Le||null},Je?{actionData:Je}:{},Ke?{fetchers:new Map(T.fetchers)}:{})),{shortCircuited:!0}}if(!v){L.forEach(Et=>{let Ut=T.fetchers.get(Et.key),Lt={state:"loading",data:Ut&&Ut.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};T.fetchers.set(Et.key,Lt)});let Ke=Je||T.actionData;be(Wt({navigation:Qe},Ke?Object.keys(Ke).length===0?{actionData:null}:{actionData:Ke}:{},L.length>0?{fetchers:new Map(T.fetchers)}:{}))}D=++P,L.forEach(Ke=>{Ke.controller&&J.set(Ke.key,Ke.controller)});let G=()=>L.forEach(Ke=>qt(Ke.key));U&&U.signal.addEventListener("abort",G);let{results:Z,loaderResults:de,fetcherResults:me}=await hn(T.matches,ne,V,L,le);if(le.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",G),L.forEach(Ke=>J.delete(Ke.key));let Te=C2(Z);if(Te)return await gt(T,Te,{replace:je}),{shortCircuited:!0};let{loaderData:Ae,errors:nt}=T2(T,ne,V,de,Le,L,me,H);H.forEach((Ke,Et)=>{Ke.subscribe(Ut=>{(Ut||Ke.done)&&H.delete(Et)})});let ze=ae(),st=Ee(D),ot=ze||st||L.length>0;return Wt({loaderData:Ae,errors:nt},ot?{fetchers:new Map(T.fetchers)}:{})}function kt(le){return T.fetchers.get(le)||bB}function En(le,z,ne,pe){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");J.has(le)&&qt(le);let Ce=u||a,Re=Dx(T.location,T.matches,l,f.v7_prependBasename,ne,z,pe==null?void 0:pe.relative),je=mh(Ce,Re,l);if(!je){cr(le,z,To(404,{pathname:Re}));return}let{path:Je,submission:Le}=x2(f.v7_normalizeFormMethod,!0,Re,pe),Qe=Jx(je,Je);if(A=(pe&&pe.preventScrollReset)===!0,Le&&Ru(Le.formMethod)){Rt(le,z,Je,Qe,je,Le);return}Q.set(le,{routeId:z,path:Je}),Ct(le,z,Je,Qe,je,Le)}async function Rt(le,z,ne,pe,Ce,Re){if(An(),Q.delete(le),!pe.route.action&&!pe.route.lazy){let Lt=To(405,{method:Re.formMethod,pathname:ne,routeId:z});cr(le,z,Lt);return}let je=T.fetchers.get(le),Je=Wt({state:"submitting"},Re,{data:je&&je.data," _hasFetcherDoneAnything ":!0});T.fetchers.set(le,Je),be({fetchers:new Map(T.fetchers)});let Le=new AbortController,Qe=Xp(e.history,ne,Le.signal,Re);J.set(le,Le);let dt=await Yp("action",Qe,pe,Ce,o,i,l);if(Qe.signal.aborted){J.get(le)===Le&&J.delete(le);return}if(kh(dt)){J.delete(le),K.add(le);let Lt=Wt({state:"loading"},Re,{data:void 0," _hasFetcherDoneAnything ":!0});return T.fetchers.set(le,Lt),be({fetchers:new Map(T.fetchers)}),gt(T,dt,{submission:Re,isFetchActionRedirect:!0})}if(Um(dt)){cr(le,z,dt.error);return}if(Xd(dt))throw To(400,{type:"defer-action"});let Xt=T.navigation.location||T.location,V=Xp(e.history,Xt,Le.signal),L=u||a,G=T.navigation.state!=="idle"?mh(L,T.navigation.location,l):T.matches;Ft(G,"Didn't find any matches after fetcher action");let Z=++P;q.set(le,Z);let de=Wt({state:"loading",data:dt.data},Re,{" _hasFetcherDoneAnything ":!0});T.fetchers.set(le,de);let[me,Te]=_2(e.history,T,G,Re,Xt,R,C,M,Q,L,l,{[pe.route.id]:dt.data},void 0);Te.filter(Lt=>Lt.key!==le).forEach(Lt=>{let Wn=Lt.key,Xn=T.fetchers.get(Wn),di={state:"loading",data:Xn&&Xn.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};T.fetchers.set(Wn,di),Lt.controller&&J.set(Wn,Lt.controller)}),be({fetchers:new Map(T.fetchers)});let Ae=()=>Te.forEach(Lt=>qt(Lt.key));Le.signal.addEventListener("abort",Ae);let{results:nt,loaderResults:ze,fetcherResults:st}=await hn(T.matches,G,me,Te,V);if(Le.signal.aborted)return;Le.signal.removeEventListener("abort",Ae),q.delete(le),J.delete(le),Te.forEach(Lt=>J.delete(Lt.key));let ot=C2(nt);if(ot)return gt(T,ot);let{loaderData:Ke,errors:Et}=T2(T,T.matches,me,ze,void 0,Te,st,H);if(T.fetchers.has(le)){let Lt={state:"idle",data:dt.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};T.fetchers.set(le,Lt)}let Ut=Ee(Z);T.navigation.state==="loading"&&Z>D?(Ft(B,"Expected pending action"),U&&U.abort(),ke(T.navigation.location,{matches:G,loaderData:Ke,errors:Et,fetchers:new Map(T.fetchers)})):(be(Wt({errors:Et,loaderData:O2(T.loaderData,Ke,G,Et)},Ut||Te.length>0?{fetchers:new Map(T.fetchers)}:{})),R=!1)}async function Ct(le,z,ne,pe,Ce,Re){let je=T.fetchers.get(le),Je=Wt({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Re,{data:je&&je.data," _hasFetcherDoneAnything ":!0});T.fetchers.set(le,Je),be({fetchers:new Map(T.fetchers)});let Le=new AbortController,Qe=Xp(e.history,ne,Le.signal);J.set(le,Le);let dt=await Yp("loader",Qe,pe,Ce,o,i,l);if(Xd(dt)&&(dt=await UI(dt,Qe.signal,!0)||dt),J.get(le)===Le&&J.delete(le),Qe.signal.aborted)return;if(kh(dt)){K.add(le),await gt(T,dt);return}if(Um(dt)){let V=gh(T.matches,z);T.fetchers.delete(le),be({fetchers:new Map(T.fetchers),errors:{[V.route.id]:dt.error}});return}Ft(!Xd(dt),"Unhandled fetcher deferred data");let Xt={state:"idle",data:dt.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};T.fetchers.set(le,Xt),be({fetchers:new Map(T.fetchers)})}async function gt(le,z,ne){let{submission:pe,replace:Ce,isFetchActionRedirect:Re}=ne===void 0?{}:ne;z.revalidate&&(R=!0);let je=Xm(le.location,z.location,Wt({_isRedirect:!0},Re?{_isFetchActionRedirect:!0}:{}));if(Ft(je,"Expected a location on the redirect navigation"),DI.test(z.location)&&n){let V=e.history.createURL(z.location),L=Xh(V.pathname,l)==null;if(t.location.origin!==V.origin||L){Ce?t.location.replace(z.location):t.location.assign(z.location);return}}U=null;let Je=Ce===!0?ir.Replace:ir.Push,{formMethod:Le,formAction:Qe,formEncType:dt,formData:Xt}=le.navigation;!pe&&Le&&Qe&&Xt&&dt&&(pe={formMethod:Le,formAction:Qe,formEncType:dt,formData:Xt}),wB.has(z.status)&&pe&&Ru(pe.formMethod)?await Ze(Je,je,{submission:Wt({},pe,{formAction:z.location}),preventScrollReset:A}):Re?await Ze(Je,je,{overrideNavigation:{state:"loading",location:je,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},fetcherSubmission:pe,preventScrollReset:A}):await Ze(Je,je,{overrideNavigation:{state:"loading",location:je,formMethod:pe?pe.formMethod:void 0,formAction:pe?pe.formAction:void 0,formEncType:pe?pe.formEncType:void 0,formData:pe?pe.formData:void 0},preventScrollReset:A})}async function hn(le,z,ne,pe,Ce){let Re=await Promise.all([...ne.map(Le=>Yp("loader",Ce,Le,z,o,i,l)),...pe.map(Le=>Le.matches&&Le.match&&Le.controller?Yp("loader",Xp(e.history,Le.path,Le.controller.signal),Le.match,Le.matches,o,i,l):{type:or.error,error:To(404,{pathname:Le.path})})]),je=Re.slice(0,ne.length),Je=Re.slice(ne.length);return await Promise.all([E2(le,ne,je,je.map(()=>Ce.signal),!1,T.loaderData),E2(le,pe.map(Le=>Le.match),Je,pe.map(Le=>Le.controller?Le.controller.signal:null),!0)]),{results:Re,loaderResults:je,fetcherResults:Je}}function An(){R=!0,C.push(...Tt()),Q.forEach((le,z)=>{J.has(z)&&(M.push(z),qt(z))})}function cr(le,z,ne){let pe=gh(T.matches,z);zn(le),be({errors:{[pe.route.id]:ne},fetchers:new Map(T.fetchers)})}function zn(le){let z=T.fetchers.get(le);J.has(le)&&!(z&&z.state==="loading"&&q.has(le))&&qt(le),Q.delete(le),q.delete(le),K.delete(le),T.fetchers.delete(le)}function qt(le){let z=J.get(le);Ft(z,"Expected fetch controller: "+le),z.abort(),J.delete(le)}function on(le){for(let z of le){let pe={state:"idle",data:kt(z).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};T.fetchers.set(z,pe)}}function ae(){let le=[],z=!1;for(let ne of K){let pe=T.fetchers.get(ne);Ft(pe,"Expected fetcher: "+ne),pe.state==="loading"&&(K.delete(ne),le.push(ne),z=!0)}return on(le),z}function Ee(le){let z=[];for(let[ne,pe]of q)if(pe0}function Pe(le,z){let ne=T.blockers.get(le)||v2;return X.get(le)!==z&&X.set(le,z),ne}function Be(le){T.blockers.delete(le),X.delete(le)}function it(le,z){let ne=T.blockers.get(le)||v2;Ft(ne.state==="unblocked"&&z.state==="blocked"||ne.state==="blocked"&&z.state==="blocked"||ne.state==="blocked"&&z.state==="proceeding"||ne.state==="blocked"&&z.state==="unblocked"||ne.state==="proceeding"&&z.state==="unblocked","Invalid blocker state transition: "+ne.state+" -> "+z.state),T.blockers.set(le,z),be({blockers:new Map(T.blockers)})}function ht(le){let{currentLocation:z,nextLocation:ne,historyAction:pe}=le;if(X.size===0)return;X.size>1&&uf(!1,"A router only supports one blocker at a time");let Ce=Array.from(X.entries()),[Re,je]=Ce[Ce.length-1],Je=T.blockers.get(Re);if(!(Je&&Je.state==="proceeding")&&je({currentLocation:z,nextLocation:ne,historyAction:pe}))return Re}function Tt(le){let z=[];return H.forEach((ne,pe)=>{(!le||le(pe))&&(ne.cancel(),z.push(pe),H.delete(pe))}),z}function Bn(le,z,ne){if(y=le,b=z,w=ne||(pe=>pe.key),!x&&T.navigation===yv){x=!0;let pe=ur(T.location,T.matches);pe!=null&&be({restoreScrollPosition:pe})}return()=>{y=null,b=null,w=null}}function Sr(le,z){if(y&&w&&b){let ne=z.map(Ce=>A2(Ce,T.loaderData)),pe=w(le,ne)||le.key;y[pe]=b()}}function ur(le,z){if(y&&w&&b){let ne=z.map(Re=>A2(Re,T.loaderData)),pe=w(le,ne)||le.key,Ce=y[pe];if(typeof Ce=="number")return Ce}return null}function Kr(le){o={},u=jx(le,i,void 0,o)}return E={get basename(){return l},get state(){return T},get routes(){return a},initialize:te,subscribe:oe,enableScrollRestoration:Bn,navigate:Ne,fetch:En,revalidate:Xe,createHref:le=>e.history.createHref(le),encodeLocation:le=>e.history.encodeLocation(le),getFetcher:kt,deleteFetcher:zn,dispose:ge,getBlocker:Pe,deleteBlocker:Be,_internalFetchControllers:J,_internalActiveDeferreds:H,_internalSetRoutes:Kr},E}function xB(e){return e!=null&&"formData"in e}function Dx(e,t,n,r,i,o,a){let u,l;if(o!=null&&a!=="path"){u=[];for(let p of t)if(u.push(p),p.route.id===o){l=p;break}}else u=t,l=t[t.length-1];let f=kw(i||".",xg(u).map(p=>p.pathnameBase),Xh(e.pathname,n)||e.pathname,a==="path");return i==null&&(f.search=e.search,f.hash=e.hash),(i==null||i===""||i===".")&&l&&l.route.index&&!i_(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:Iu([n,f.pathname])),lf(f)}function x2(e,t,n,r){if(!r||!xB(r))return{path:n};if(r.formMethod&&!CB(r.formMethod))return{path:n,error:To(405,{method:r.formMethod})};let i;if(r.formData){let u=r.formMethod||"get";if(i={formMethod:e?u.toUpperCase():u.toLowerCase(),formAction:qI(n),formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:r.formData},Ru(i.formMethod))return{path:n,submission:i}}let o=$u(n),a=$I(r.formData);return t&&o.search&&i_(o.search)&&a.append("index",""),o.search="?"+a,{path:lf(o),submission:i}}function _B(e,t){let n=e;if(t){let r=e.findIndex(i=>i.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function _2(e,t,n,r,i,o,a,u,l,f,p,m,y){let w=y?Object.values(y)[0]:m?Object.values(m)[0]:void 0,b=e.createURL(t.location),x=e.createURL(i),_=y?Object.keys(y)[0]:void 0,N=_B(n,_).filter((T,B)=>{if(T.route.lazy)return!0;if(T.route.loader==null)return!1;if(kB(t.loaderData,t.matches[B],T)||a.some(v=>v===T.route.id))return!0;let A=t.matches[B],U=T;return k2(T,Wt({currentUrl:b,currentParams:A.params,nextUrl:x,nextParams:U.params},r,{actionResult:w,defaultShouldRevalidate:o||b.pathname+b.search===x.pathname+x.search||b.search!==x.search||JI(A,U)}))}),E=[];return l.forEach((T,B)=>{if(!n.some(R=>R.route.id===T.routeId))return;let A=mh(f,T.path,p);if(!A){E.push({key:B,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let U=Jx(A,T.path);if(u.includes(B)){E.push({key:B,routeId:T.routeId,path:T.path,matches:A,match:U,controller:new AbortController});return}k2(U,Wt({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:w,defaultShouldRevalidate:o}))&&E.push({key:B,routeId:T.routeId,path:T.path,matches:A,match:U,controller:new AbortController})}),[N,E]}function kB(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function JI(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function k2(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function R2(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];Ft(i,"No route found in manifest");let o={};for(let a in r){let l=i[a]!==void 0&&a!=="hasErrorBoundary";uf(!l,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!VL.has(a)&&(o[a]=r[a])}Object.assign(i,o),Object.assign(i,Wt({},t(i),{lazy:void 0}))}async function Yp(e,t,n,r,i,o,a,u,l,f){u===void 0&&(u=!1),l===void 0&&(l=!1);let p,m,y,w=_=>{let O,N=new Promise((E,T)=>O=T);return y=()=>O(),t.signal.addEventListener("abort",y),Promise.race([_({request:t,params:n.params,context:f}),N])};try{let _=n.route[e];if(n.route.lazy)if(_)m=(await Promise.all([w(_),R2(n.route,o,i)]))[0];else if(await R2(n.route,o,i),_=n.route[e],_)m=await w(_);else if(e==="action"){let O=new URL(t.url),N=O.pathname+O.search;throw To(405,{method:t.method,pathname:N,routeId:n.route.id})}else return{type:or.data,data:void 0};else if(_)m=await w(_);else{let O=new URL(t.url),N=O.pathname+O.search;throw To(404,{pathname:N})}Ft(m!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(_){p=or.error,m=_}finally{y&&t.signal.removeEventListener("abort",y)}if(NB(m)){let _=m.status;if(yB.has(_)){let E=m.headers.get("Location");if(Ft(E,"Redirects returned/thrown from loaders/actions must have a Location header"),!DI.test(E))E=Dx(new URL(t.url),r.slice(0,r.indexOf(n)+1),a,!0,E);else if(!u){let T=new URL(t.url),B=E.startsWith("//")?new URL(T.protocol+E):new URL(E),A=Xh(B.pathname,a)!=null;B.origin===T.origin&&A&&(E=B.pathname+B.search+B.hash)}if(u)throw m.headers.set("Location",E),m;return{type:or.redirect,status:_,location:E,revalidate:m.headers.get("X-Remix-Revalidate")!==null}}if(l)throw{type:p||or.data,response:m};let O,N=m.headers.get("Content-Type");return N&&/\bapplication\/json\b/.test(N)?O=await m.json():O=await m.text(),p===or.error?{type:p,error:new r_(_,m.statusText,O),headers:m.headers}:{type:or.data,data:O,statusCode:m.status,headers:m.headers}}if(p===or.error)return{type:p,error:m};if(OB(m)){var b,x;return{type:or.deferred,deferredData:m,statusCode:(b=m.init)==null?void 0:b.status,headers:((x=m.init)==null?void 0:x.headers)&&new Headers(m.init.headers)}}return{type:or.data,data:m}}function Xp(e,t,n,r){let i=e.createURL(qI(t)).toString(),o={signal:n};if(r&&Ru(r.formMethod)){let{formMethod:a,formEncType:u,formData:l}=r;o.method=a.toUpperCase(),o.body=u==="application/x-www-form-urlencoded"?$I(l):l}return new Request(i,o)}function $I(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,r instanceof File?r.name:r);return t}function RB(e,t,n,r,i){let o={},a=null,u,l=!1,f={};return n.forEach((p,m)=>{let y=t[m].route.id;if(Ft(!kh(p),"Cannot handle redirect results in processLoaderData"),Um(p)){let w=gh(e,y),b=p.error;r&&(b=Object.values(r)[0],r=void 0),a=a||{},a[w.route.id]==null&&(a[w.route.id]=b),o[y]=void 0,l||(l=!0,u=BI(p.error)?p.error.status:500),p.headers&&(f[y]=p.headers)}else Xd(p)?(i.set(y,p.deferredData),o[y]=p.deferredData.data):o[y]=p.data,p.statusCode!=null&&p.statusCode!==200&&!l&&(u=p.statusCode),p.headers&&(f[y]=p.headers)}),r&&(a=r,o[Object.keys(r)[0]]=void 0),{loaderData:o,errors:a,statusCode:u||200,loaderHeaders:f}}function T2(e,t,n,r,i,o,a,u){let{loaderData:l,errors:f}=RB(t,n,r,i,u);for(let p=0;pr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function N2(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function To(e,t){let{pathname:n,routeId:r,method:i,type:o}=t===void 0?{}:t,a="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(a="Bad Request",i&&n&&r?u="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"&&(u="defer() is not supported in actions")):e===403?(a="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",u='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",i&&n&&r?u="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(u='Invalid request method "'+i.toUpperCase()+'"')),new r_(e||500,a,new Error(u),!0)}function C2(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(kh(n))return n}}function qI(e){let t=typeof e=="string"?$u(e):e;return lf(Wt({},t,{hash:""}))}function TB(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Xd(e){return e.type===or.deferred}function Um(e){return e.type===or.error}function kh(e){return(e&&e.type)===or.redirect}function OB(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function NB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function CB(e){return gB.has(e.toLowerCase())}function Ru(e){return pB.has(e.toLowerCase())}async function E2(e,t,n,r,i,o){for(let a=0;am.route.id===l.route.id),p=f!=null&&!JI(f,l)&&(o&&o[l.route.id])!==void 0;if(Xd(u)&&(i||p)){let m=r[a];Ft(m,"Expected an AbortSignal for revalidating fetcher deferred result"),await UI(u,m,i).then(y=>{y&&(n[a]=y||n[a])})}}}async function UI(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:or.data,data:e.deferredData.unwrappedData}}catch(i){return{type:or.error,error:i}}return{type:or.data,data:e.deferredData.data}}}function i_(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function A2(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Jx(e,t){let n=typeof t=="string"?$u(t).search:t.search;if(e[e.length-1].route.index&&i_(n||""))return e[e.length-1];let r=xg(e);return r[r.length-1]}/** * React Router v6.13.0 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+_.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function $x(){return $x=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.pathnameBase)),a=$.useRef(!1);return WI(()=>{a.current=!0}),$.useCallback(function(l,f){if(f===void 0&&(f={}),!a.current)return;if(typeof l=="number"){n.go(l);return}let p=kw(l,JSON.parse(o),i,f.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Iu([t,p.pathname])),(f.replace?n.replace:n.push)(p,f.state,f)},[t,n,o,i,e])}const IB=$.createContext(null);function PB(e){let t=$.useContext(ls).outlet;return t&&$.createElement(IB.Provider,{value:e},t)}function VI(){let{matches:e}=$.useContext(ls),t=e[e.length-1];return t?t.params:{}}function GI(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=$.useContext(ls),{pathname:i}=tp(),o=JSON.stringify(xg(r).map(a=>a.pathnameBase));return $.useMemo(()=>kw(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function MB(e,t,n){ep()||Ft(!1);let{navigator:r}=$.useContext(Zh),{matches:i}=$.useContext(ls),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let l=tp(),f;f=l;let p=f.pathname||"/",m=u==="/"?p:p.slice(u.length)||"/",y=ph(e,{pathname:m});return JB(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:Iu([u,r.encodeLocation?r.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?u:Iu([u,r.encodeLocation?r.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,n)}function LB(){let e=HB(),t=BI(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return $.createElement($.Fragment,null,$.createElement("h2",null,"Unexpected Application Error!"),$.createElement("h3",{style:{fontStyle:"italic"}},t),n?$.createElement("pre",{style:i},n):null,null)}const BB=$.createElement(LB,null);class jB extends $.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?$.createElement(ls.Provider,{value:this.props.routeContext},$.createElement(zI.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function DB(e){let{routeContext:t,match:n,children:r}=e,i=$.useContext(Rw);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),$.createElement(ls.Provider,{value:t},r)}function JB(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let o=e,a=(r=n)==null?void 0:r.errors;if(a!=null){let u=o.findIndex(l=>l.route.id&&(a==null?void 0:a[l.route.id]));u>=0||Ft(!1),o=o.slice(0,Math.min(o.length,u+1))}return o.reduceRight((u,l,f)=>{let p=l.route.id?a==null?void 0:a[l.route.id]:null,m=null;n&&(m=l.route.errorElement||BB);let y=t.concat(o.slice(0,f+1)),w=()=>{let b;return p?b=m:l.route.Component?b=$.createElement(l.route.Component,null):l.route.element?b=l.route.element:b=u,$.createElement(DB,{match:l,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:b})};return n&&(l.route.ErrorBoundary||l.route.errorElement||f===0)?$.createElement(jB,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):w()},null)}var qx;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(qx||(qx={}));var Zm;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(Zm||(Zm={}));function $B(e){let t=$.useContext(Rw);return t||Ft(!1),t}function qB(e){let t=$.useContext(HI);return t||Ft(!1),t}function UB(e){let t=$.useContext(ls);return t||Ft(!1),t}function KI(e){let t=UB(),n=t.matches[t.matches.length-1];return n.route.id||Ft(!1),n.route.id}function HB(){var e;let t=$.useContext(zI),n=qB(Zm.UseRouteError),r=KI(Zm.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function zB(){let{router:e}=$B(qx.UseNavigateStable),t=KI(Zm.UseNavigateStable),n=$.useRef(!1);return WI(()=>{n.current=!0}),$.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,$x({fromRouteId:t},o)))},[e,t])}function WB(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=$.useState(n.state),{v7_startTransition:a}=r||{},u=$.useCallback(m=>{a&&F2?F2(()=>o(m)):o(m)},[o,a]);$.useLayoutEffect(()=>n.subscribe(u),[n,u]);let l=$.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:m=>n.navigate(m),push:(m,y,w)=>n.navigate(m,{state:y,preventScrollReset:w==null?void 0:w.preventScrollReset}),replace:(m,y,w)=>n.navigate(m,{replace:!0,state:y,preventScrollReset:w==null?void 0:w.preventScrollReset})}),[n]),f=n.basename||"/",p=$.useMemo(()=>({router:n,navigator:l,static:!1,basename:f}),[n,l,f]);return $.createElement($.Fragment,null,$.createElement(Rw.Provider,{value:p},$.createElement(HI.Provider,{value:i},$.createElement(KB,{basename:f,location:i.location,navigationType:i.historyAction,navigator:l},i.initialized?$.createElement(VB,{routes:n.routes,state:i}):t))),null)}function VB(e){let{routes:t,state:n}=e;return MB(t,void 0,n)}function GB(e){let{to:t,replace:n,state:r,relative:i}=e;ep()||Ft(!1);let{matches:o}=$.useContext(ls),{pathname:a}=tp(),u=$l(),l=kw(t,xg(o).map(p=>p.pathnameBase),a,i==="path"),f=JSON.stringify(l);return $.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function s_(e){return PB(e.context)}function KB(e){let{basename:t="/",children:n=null,location:r,navigationType:i=ir.Pop,navigator:o,static:a=!1}=e;ep()&&Ft(!1);let u=t.replace(/^\/*/,"/"),l=$.useMemo(()=>({basename:u,navigator:o,static:a}),[u,o,a]);typeof r=="string"&&(r=Jl(r));let{pathname:f="/",search:p="",hash:m="",state:y=null,key:w="default"}=r,b=$.useMemo(()=>{let x=Xh(f,u);return x==null?null:{location:{pathname:x,search:p,hash:m,state:y,key:w},navigationType:i}},[u,f,p,m,y,w,i]);return b==null?null:$.createElement(Zh.Provider,{value:l},$.createElement(o_.Provider,{children:n,value:b}))}var I2;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(I2||(I2={}));new Promise(()=>{});function QB(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:$.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:$.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + */function $x(){return $x=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.pathnameBase)),a=$.useRef(!1);return WI(()=>{a.current=!0}),$.useCallback(function(l,f){if(f===void 0&&(f={}),!a.current)return;if(typeof l=="number"){n.go(l);return}let p=kw(l,JSON.parse(o),i,f.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Iu([t,p.pathname])),(f.replace?n.replace:n.push)(p,f.state,f)},[t,n,o,i,e])}const IB=$.createContext(null);function PB(e){let t=$.useContext(ls).outlet;return t&&$.createElement(IB.Provider,{value:e},t)}function VI(){let{matches:e}=$.useContext(ls),t=e[e.length-1];return t?t.params:{}}function GI(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=$.useContext(ls),{pathname:i}=tp(),o=JSON.stringify(xg(r).map(a=>a.pathnameBase));return $.useMemo(()=>kw(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function MB(e,t,n){ep()||Ft(!1);let{navigator:r}=$.useContext(Zh),{matches:i}=$.useContext(ls),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let l=tp(),f;f=l;let p=f.pathname||"/",m=u==="/"?p:p.slice(u.length)||"/",y=mh(e,{pathname:m});return JB(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:Iu([u,r.encodeLocation?r.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?u:Iu([u,r.encodeLocation?r.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,n)}function LB(){let e=HB(),t=BI(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return $.createElement($.Fragment,null,$.createElement("h2",null,"Unexpected Application Error!"),$.createElement("h3",{style:{fontStyle:"italic"}},t),n?$.createElement("pre",{style:i},n):null,null)}const BB=$.createElement(LB,null);class jB extends $.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?$.createElement(ls.Provider,{value:this.props.routeContext},$.createElement(zI.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function DB(e){let{routeContext:t,match:n,children:r}=e,i=$.useContext(Rw);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),$.createElement(ls.Provider,{value:t},r)}function JB(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let o=e,a=(r=n)==null?void 0:r.errors;if(a!=null){let u=o.findIndex(l=>l.route.id&&(a==null?void 0:a[l.route.id]));u>=0||Ft(!1),o=o.slice(0,Math.min(o.length,u+1))}return o.reduceRight((u,l,f)=>{let p=l.route.id?a==null?void 0:a[l.route.id]:null,m=null;n&&(m=l.route.errorElement||BB);let y=t.concat(o.slice(0,f+1)),w=()=>{let b;return p?b=m:l.route.Component?b=$.createElement(l.route.Component,null):l.route.element?b=l.route.element:b=u,$.createElement(DB,{match:l,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:b})};return n&&(l.route.ErrorBoundary||l.route.errorElement||f===0)?$.createElement(jB,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):w()},null)}var qx;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(qx||(qx={}));var Zm;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(Zm||(Zm={}));function $B(e){let t=$.useContext(Rw);return t||Ft(!1),t}function qB(e){let t=$.useContext(HI);return t||Ft(!1),t}function UB(e){let t=$.useContext(ls);return t||Ft(!1),t}function KI(e){let t=UB(),n=t.matches[t.matches.length-1];return n.route.id||Ft(!1),n.route.id}function HB(){var e;let t=$.useContext(zI),n=qB(Zm.UseRouteError),r=KI(Zm.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function zB(){let{router:e}=$B(qx.UseNavigateStable),t=KI(Zm.UseNavigateStable),n=$.useRef(!1);return WI(()=>{n.current=!0}),$.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,$x({fromRouteId:t},o)))},[e,t])}function WB(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=$.useState(n.state),{v7_startTransition:a}=r||{},u=$.useCallback(m=>{a&&F2?F2(()=>o(m)):o(m)},[o,a]);$.useLayoutEffect(()=>n.subscribe(u),[n,u]);let l=$.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:m=>n.navigate(m),push:(m,y,w)=>n.navigate(m,{state:y,preventScrollReset:w==null?void 0:w.preventScrollReset}),replace:(m,y,w)=>n.navigate(m,{replace:!0,state:y,preventScrollReset:w==null?void 0:w.preventScrollReset})}),[n]),f=n.basename||"/",p=$.useMemo(()=>({router:n,navigator:l,static:!1,basename:f}),[n,l,f]);return $.createElement($.Fragment,null,$.createElement(Rw.Provider,{value:p},$.createElement(HI.Provider,{value:i},$.createElement(KB,{basename:f,location:i.location,navigationType:i.historyAction,navigator:l},i.initialized?$.createElement(VB,{routes:n.routes,state:i}):t))),null)}function VB(e){let{routes:t,state:n}=e;return MB(t,void 0,n)}function GB(e){let{to:t,replace:n,state:r,relative:i}=e;ep()||Ft(!1);let{matches:o}=$.useContext(ls),{pathname:a}=tp(),u=$l(),l=kw(t,xg(o).map(p=>p.pathnameBase),a,i==="path"),f=JSON.stringify(l);return $.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function s_(e){return PB(e.context)}function KB(e){let{basename:t="/",children:n=null,location:r,navigationType:i=ir.Pop,navigator:o,static:a=!1}=e;ep()&&Ft(!1);let u=t.replace(/^\/*/,"/"),l=$.useMemo(()=>({basename:u,navigator:o,static:a}),[u,o,a]);typeof r=="string"&&(r=$u(r));let{pathname:f="/",search:p="",hash:m="",state:y=null,key:w="default"}=r,b=$.useMemo(()=>{let x=Xh(f,u);return x==null?null:{location:{pathname:x,search:p,hash:m,state:y,key:w},navigationType:i}},[u,f,p,m,y,w,i]);return b==null?null:$.createElement(Zh.Provider,{value:l},$.createElement(o_.Provider,{children:n,value:b}))}var I2;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(I2||(I2={}));new Promise(()=>{});function QB(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:$.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:$.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** * React Router DOM v6.13.0 * * Copyright (c) Remix Software Inc. @@ -64,25 +64,25 @@ Error generating stack: `+_.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function eg(){return eg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function XB(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ZB(e,t){return e.button===0&&(!t||t==="_self")&&!XB(e)}function Ux(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function ej(e,t){let n=Ux(e);if(t)for(let r of t.keys())n.has(r)||t.getAll(r).forEach(i=>{n.append(r,i)});return n}const tj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function nj(e,t){return vB({basename:void 0,future:eg({},void 0,{v7_prependBasename:!0}),history:HL({window:void 0}),hydrationData:rj(),routes:e,mapRouteProperties:QB}).initialize()}function rj(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=eg({},t,{errors:ij(t.errors)})),t}function ij(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new r_(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){let o=new Error(i.message);o.stack="",n[r]=o}else n[r]=i;return n}const oj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ah=$.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:a,state:u,target:l,to:f,preventScrollReset:p}=t,m=YB(t,tj),{basename:y}=$.useContext(Zh),w,b=!1;if(typeof f=="string"&&sj.test(f)&&(w=f,oj))try{let N=new URL(window.location.href),E=f.startsWith("//")?new URL(N.protocol+f):new URL(f),T=Xh(E.pathname,y);E.origin===N.origin&&T!=null?f=T+E.search+E.hash:b=!0}catch{}let x=AB(f,{relative:i}),k=aj(f,{replace:a,state:u,target:l,preventScrollReset:p,relative:i});function O(N){r&&r(N),N.defaultPrevented||k(N)}return $.createElement("a",eg({},m,{href:w||x,onClick:b||o?r:O,ref:n,target:l}))});var P2;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(P2||(P2={}));var M2;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(M2||(M2={}));function aj(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a}=t===void 0?{}:t,u=$l(),l=tp(),f=GI(e,{relative:a});return $.useCallback(p=>{if(ZB(p,n)){p.preventDefault();let m=r!==void 0?r:uf(l)===uf(f);u(e,{replace:m,state:i,preventScrollReset:o,relative:a})}},[l,u,f,r,i,n,e,o,a])}function cj(e){let t=$.useRef(Ux(e)),n=$.useRef(!1),r=tp(),i=$.useMemo(()=>ej(r.search,n.current?null:t.current),[r.search]),o=$l(),a=$.useCallback((u,l)=>{const f=Ux(typeof u=="function"?u(i):u);n.current=!0,o("?"+f,l)},[o,i]);return[i,a]}function ln(){return ln=Object.assign||function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function wf(e,t){return t||(t=e.slice(0)),e.raw=t,e}function uj(e){if(e.sheet)return e.sheet;for(var t=0;t0?Tr(np,--si):0,Fh--,Kn===10&&(Fh=1,Ow--),Kn}function Ei(){return Kn=si2||ng(Kn)>3?"":" "}function xj(e,t){for(;--t&&Ei()&&!(Kn<48||Kn>102||Kn>57&&Kn<65||Kn>70&&Kn<97););return _g(e,A0()+(t<6&&rs()==32&&Ei()==32))}function zx(e){for(;Ei();)switch(Kn){case e:return si;case 34:case 39:e!==34&&e!==39&&zx(Kn);break;case 40:e===41&&zx(e);break;case 92:Ei();break}return si}function _j(e,t){for(;Ei()&&e+Kn!==57;)if(e+Kn===84&&rs()===47)break;return"/*"+_g(t,si-1)+"*"+Tw(e===47?e:Ei())}function kj(e){for(;!ng(rs());)Ei();return _g(e,si)}function Rj(e){return t4(I0("",null,null,null,[""],e=e4(e),0,[0],e))}function I0(e,t,n,r,i,o,a,u,l){for(var f=0,p=0,m=a,y=0,w=0,b=0,x=1,k=1,O=1,N=0,E="",T=i,B=o,A=r,U=E;k;)switch(b=N,N=Ei()){case 40:if(b!=108&&Tr(U,m-1)==58){Hx(U+=zt(F0(N),"&","&\f"),"&\f")!=-1&&(O=-1);break}case 34:case 39:case 91:U+=F0(N);break;case 9:case 10:case 13:case 32:U+=vj(b);break;case 92:U+=xj(A0()-1,7);continue;case 47:switch(rs()){case 42:case 47:Yy(Tj(_j(Ei(),A0()),t,n),l);break;default:U+="/"}break;case 123*x:u[f++]=Qo(U)*O;case 125*x:case 59:case 0:switch(N){case 0:case 125:k=0;case 59+p:O==-1&&(U=zt(U,/\f/g,"")),w>0&&Qo(U)-m&&Yy(w>32?B2(U+";",r,n,m-1):B2(zt(U," ","")+";",r,n,m-2),l);break;case 59:U+=";";default:if(Yy(A=L2(U,t,n,f,p,i,u,E,T=[],B=[],m),o),N===123)if(p===0)I0(U,t,A,A,T,o,m,u,B);else switch(y===99&&Tr(U,3)===110?100:y){case 100:case 108:case 109:case 115:I0(e,A,A,r&&Yy(L2(e,A,A,0,0,i,u,E,i,T=[],m),B),i,B,m,u,r?T:B);break;default:I0(U,A,A,A,[""],B,0,u,B)}}f=p=w=0,x=O=1,E=U="",m=a;break;case 58:m=1+Qo(U),w=b;default:if(x<1){if(N==123)--x;else if(N==125&&x++==0&&Sj()==125)continue}switch(U+=Tw(N),N*x){case 38:O=p>0?1:(U+="\f",-1);break;case 44:u[f++]=(Qo(U)-1)*O,O=1;break;case 64:rs()===45&&(U+=F0(Ei())),y=rs(),p=m=Qo(E=U+=kj(A0())),N++;break;case 45:b===45&&Qo(U)==2&&(x=0)}}return o}function L2(e,t,n,r,i,o,a,u,l,f,p){for(var m=i-1,y=i===0?o:[""],w=u_(y),b=0,x=0,k=0;b0?y[O]+" "+N:zt(N,/&\f/g,y[O])))&&(l[k++]=E);return Nw(e,t,n,i===0?a_:u,l,f,p)}function Tj(e,t,n){return Nw(e,t,n,QI,Tw(bj()),tg(e,2,-2),0)}function B2(e,t,n,r){return Nw(e,t,n,c_,tg(e,0,r),tg(e,r+1,-1),r)}function kh(e,t){for(var n="",r=u_(e),i=0;i6)switch(Tr(e,t+1)){case 109:if(Tr(e,t+4)!==45)break;case 102:return zt(e,/(.+:)(.+)-([^]+)/,"$1"+Ht+"$2-$3$1"+U0+(Tr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Hx(e,"stretch")?n4(zt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Tr(e,t+1)!==115)break;case 6444:switch(Tr(e,Qo(e)-3-(~Hx(e,"!important")&&10))){case 107:return zt(e,":",":"+Ht)+e;case 101:return zt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ht+(Tr(e,14)===45?"inline-":"")+"box$3$1"+Ht+"$2$3$1"+jr+"$2box$3")+e}break;case 5936:switch(Tr(e,t+11)){case 114:return Ht+e+jr+zt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ht+e+jr+zt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ht+e+jr+zt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ht+e+jr+e+e}return e}var Lj=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case c_:t.return=n4(t.value,t.length);break;case YI:return kh([Zp(t,{value:zt(t.value,"@","@"+Ht)})],i);case a_:if(t.length)return wj(t.props,function(o){switch(yj(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return kh([Zp(t,{props:[zt(o,/:(read-\w+)/,":"+U0+"$1")]})],i);case"::placeholder":return kh([Zp(t,{props:[zt(o,/:(plac\w+)/,":"+Ht+"input-$1")]}),Zp(t,{props:[zt(o,/:(plac\w+)/,":"+U0+"$1")]}),Zp(t,{props:[zt(o,/:(plac\w+)/,jr+"input-$1")]})],i)}return""})}},Bj=[Lj],jj=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(x){var k=x.getAttribute("data-emotion");k.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var i=t.stylisPlugins||Bj,o={},a,u=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(x){for(var k=x.getAttribute("data-emotion").split(" "),O=1;O=0)&&(n[i]=e[i]);return n}function XB(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ZB(e,t){return e.button===0&&(!t||t==="_self")&&!XB(e)}function Ux(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function ej(e,t){let n=Ux(e);if(t)for(let r of t.keys())n.has(r)||t.getAll(r).forEach(i=>{n.append(r,i)});return n}const tj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function nj(e,t){return vB({basename:void 0,future:eg({},void 0,{v7_prependBasename:!0}),history:HL({window:void 0}),hydrationData:rj(),routes:e,mapRouteProperties:QB}).initialize()}function rj(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=eg({},t,{errors:ij(t.errors)})),t}function ij(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new r_(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){let o=new Error(i.message);o.stack="",n[r]=o}else n[r]=i;return n}const oj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ah=$.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:a,state:u,target:l,to:f,preventScrollReset:p}=t,m=YB(t,tj),{basename:y}=$.useContext(Zh),w,b=!1;if(typeof f=="string"&&sj.test(f)&&(w=f,oj))try{let N=new URL(window.location.href),E=f.startsWith("//")?new URL(N.protocol+f):new URL(f),T=Xh(E.pathname,y);E.origin===N.origin&&T!=null?f=T+E.search+E.hash:b=!0}catch{}let x=AB(f,{relative:i}),_=aj(f,{replace:a,state:u,target:l,preventScrollReset:p,relative:i});function O(N){r&&r(N),N.defaultPrevented||_(N)}return $.createElement("a",eg({},m,{href:w||x,onClick:b||o?r:O,ref:n,target:l}))});var P2;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(P2||(P2={}));var M2;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(M2||(M2={}));function aj(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a}=t===void 0?{}:t,u=$l(),l=tp(),f=GI(e,{relative:a});return $.useCallback(p=>{if(ZB(p,n)){p.preventDefault();let m=r!==void 0?r:lf(l)===lf(f);u(e,{replace:m,state:i,preventScrollReset:o,relative:a})}},[l,u,f,r,i,n,e,o,a])}function cj(e){let t=$.useRef(Ux(e)),n=$.useRef(!1),r=tp(),i=$.useMemo(()=>ej(r.search,n.current?null:t.current),[r.search]),o=$l(),a=$.useCallback((u,l)=>{const f=Ux(typeof u=="function"?u(i):u);n.current=!0,o("?"+f,l)},[o,i]);return[i,a]}function ln(){return ln=Object.assign||function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function bf(e,t){return t||(t=e.slice(0)),e.raw=t,e}function uj(e){if(e.sheet)return e.sheet;for(var t=0;t0?Tr(np,--si):0,Fh--,Kn===10&&(Fh=1,Ow--),Kn}function Ei(){return Kn=si2||ng(Kn)>3?"":" "}function xj(e,t){for(;--t&&Ei()&&!(Kn<48||Kn>102||Kn>57&&Kn<65||Kn>70&&Kn<97););return _g(e,A0()+(t<6&&rs()==32&&Ei()==32))}function zx(e){for(;Ei();)switch(Kn){case e:return si;case 34:case 39:e!==34&&e!==39&&zx(Kn);break;case 40:e===41&&zx(e);break;case 92:Ei();break}return si}function _j(e,t){for(;Ei()&&e+Kn!==57;)if(e+Kn===84&&rs()===47)break;return"/*"+_g(t,si-1)+"*"+Tw(e===47?e:Ei())}function kj(e){for(;!ng(rs());)Ei();return _g(e,si)}function Rj(e){return t4(I0("",null,null,null,[""],e=e4(e),0,[0],e))}function I0(e,t,n,r,i,o,a,u,l){for(var f=0,p=0,m=a,y=0,w=0,b=0,x=1,_=1,O=1,N=0,E="",T=i,B=o,A=r,U=E;_;)switch(b=N,N=Ei()){case 40:if(b!=108&&Tr(U,m-1)==58){Hx(U+=zt(F0(N),"&","&\f"),"&\f")!=-1&&(O=-1);break}case 34:case 39:case 91:U+=F0(N);break;case 9:case 10:case 13:case 32:U+=vj(b);break;case 92:U+=xj(A0()-1,7);continue;case 47:switch(rs()){case 42:case 47:Yy(Tj(_j(Ei(),A0()),t,n),l);break;default:U+="/"}break;case 123*x:u[f++]=Qo(U)*O;case 125*x:case 59:case 0:switch(N){case 0:case 125:_=0;case 59+p:O==-1&&(U=zt(U,/\f/g,"")),w>0&&Qo(U)-m&&Yy(w>32?B2(U+";",r,n,m-1):B2(zt(U," ","")+";",r,n,m-2),l);break;case 59:U+=";";default:if(Yy(A=L2(U,t,n,f,p,i,u,E,T=[],B=[],m),o),N===123)if(p===0)I0(U,t,A,A,T,o,m,u,B);else switch(y===99&&Tr(U,3)===110?100:y){case 100:case 108:case 109:case 115:I0(e,A,A,r&&Yy(L2(e,A,A,0,0,i,u,E,i,T=[],m),B),i,B,m,u,r?T:B);break;default:I0(U,A,A,A,[""],B,0,u,B)}}f=p=w=0,x=O=1,E=U="",m=a;break;case 58:m=1+Qo(U),w=b;default:if(x<1){if(N==123)--x;else if(N==125&&x++==0&&Sj()==125)continue}switch(U+=Tw(N),N*x){case 38:O=p>0?1:(U+="\f",-1);break;case 44:u[f++]=(Qo(U)-1)*O,O=1;break;case 64:rs()===45&&(U+=F0(Ei())),y=rs(),p=m=Qo(E=U+=kj(A0())),N++;break;case 45:b===45&&Qo(U)==2&&(x=0)}}return o}function L2(e,t,n,r,i,o,a,u,l,f,p){for(var m=i-1,y=i===0?o:[""],w=u_(y),b=0,x=0,_=0;b0?y[O]+" "+N:zt(N,/&\f/g,y[O])))&&(l[_++]=E);return Nw(e,t,n,i===0?a_:u,l,f,p)}function Tj(e,t,n){return Nw(e,t,n,QI,Tw(bj()),tg(e,2,-2),0)}function B2(e,t,n,r){return Nw(e,t,n,c_,tg(e,0,r),tg(e,r+1,-1),r)}function Rh(e,t){for(var n="",r=u_(e),i=0;i6)switch(Tr(e,t+1)){case 109:if(Tr(e,t+4)!==45)break;case 102:return zt(e,/(.+:)(.+)-([^]+)/,"$1"+Ht+"$2-$3$1"+U0+(Tr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Hx(e,"stretch")?n4(zt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Tr(e,t+1)!==115)break;case 6444:switch(Tr(e,Qo(e)-3-(~Hx(e,"!important")&&10))){case 107:return zt(e,":",":"+Ht)+e;case 101:return zt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ht+(Tr(e,14)===45?"inline-":"")+"box$3$1"+Ht+"$2$3$1"+jr+"$2box$3")+e}break;case 5936:switch(Tr(e,t+11)){case 114:return Ht+e+jr+zt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ht+e+jr+zt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ht+e+jr+zt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ht+e+jr+e+e}return e}var Lj=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case c_:t.return=n4(t.value,t.length);break;case YI:return Rh([Zp(t,{value:zt(t.value,"@","@"+Ht)})],i);case a_:if(t.length)return wj(t.props,function(o){switch(yj(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Rh([Zp(t,{props:[zt(o,/:(read-\w+)/,":"+U0+"$1")]})],i);case"::placeholder":return Rh([Zp(t,{props:[zt(o,/:(plac\w+)/,":"+Ht+"input-$1")]}),Zp(t,{props:[zt(o,/:(plac\w+)/,":"+U0+"$1")]}),Zp(t,{props:[zt(o,/:(plac\w+)/,jr+"input-$1")]})],i)}return""})}},Bj=[Lj],jj=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(x){var _=x.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var i=t.stylisPlugins||Bj,o={},a,u=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(x){for(var _=x.getAttribute("data-emotion").split(" "),O=1;O<_.length;O++)o[_[O]]=!0;u.push(x)});var l,f=[Pj,Mj];{var p,m=[Oj,Cj(function(x){p.insert(x)})],y=Nj(f.concat(i,m)),w=function(_){return Rh(Rj(_),y)};l=function(_,O,N,E){p=N,w(_?_+"{"+O.styles+"}":O.styles),E&&(b.inserted[O.name]=!0)}}var b={key:n,sheet:new dj({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return b.sheet.hydrate(u),b};function Wx(){return Wx=Object.assign?Object.assign.bind():function(e){for(var t=1;t=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var zj={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Wj=/[A-Z]|^ms/g,Vj=/_EMO_([^_]+?)_([^]*?)_EMO_/g,o4=function(t){return t.charCodeAt(1)===45},U2=function(t){return t!=null&&typeof t!="boolean"},Sv=Ej(function(e){return o4(e)?e:e.replace(Wj,"-$&").toLowerCase()}),H2=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Vj,function(r,i,o){return Yo={name:i,styles:o,next:Yo},i})}return zj[t]!==1&&!o4(t)&&typeof n=="number"&&n!==0?n+"px":n};function rg(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Yo={name:n.name,styles:n.styles,next:Yo},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Yo={name:r.name,styles:r.styles,next:Yo},r=r.next;var i=n.styles+";";return i}return Gj(e,t,n)}case"function":{if(e!==void 0){var o=Yo,a=n(e);return Yo=o,rg(e,t,a)}break}}return n}function Gj(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i=0)&&(n[i]=e[i]);return n}function Nu(e,t,n,r,i){var o=t&&typeof t=="string"?t.split("."):[t];for(r=0;r=0){if(typeof n=="string"&&n.startsWith("-")){var r=n.substring(1),i=Nu(t,r,r);return"-"+i}return Nu(t,n,n)}var o=Math.abs(n),a=Nu(t,o,o);return typeof a=="string"?"-"+a:Number(a)*-1},uD=["margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginInlineStart","top","bottom","left","right"].reduce(function(e,t){var n;return Cl({},e,(n={},n[t]=cD,n))},{}),lD=function(t){return function(n){var r={},i=n&&n.breakpoints||sD,o=[null].concat(i.map(function(m){return"@media screen and (min-width: "+m+")"}));for(var a in t){var u=a,l=t[u];if(typeof l=="function"&&(l=l(n||{})),l!=null){if(!Array.isArray(l)){r[u]=l;continue}for(var f=0;f{let x=!1,k=!1,O=!1;for(let N=0;N(n.lastIndex=0,y.replace(n,b=>w(b))),p=(y,w)=>(a.lastIndex=0,u.lastIndex=0,y.replace(a,(b,x)=>w(x)).replace(u,b=>w(b))),m=(y,w)=>{if(!(typeof y=="string"||Array.isArray(y)))throw new TypeError("Expected the input to be `string | string[]`");if(w={pascalCase:!1,preserveConsecutiveUppercase:!1,...w},Array.isArray(y)?y=y.map(O=>O.trim()).filter(O=>O.length).join("-"):y=y.trim(),y.length===0)return"";const b=w.locale===!1?O=>O.toLowerCase():O=>O.toLocaleLowerCase(w.locale),x=w.locale===!1?O=>O.toUpperCase():O=>O.toLocaleUpperCase(w.locale);return y.length===1?w.pascalCase?x(y):b(y):(y!==b(y)&&(y=l(y,b,x)),y=y.replace(o,""),w.preserveConsecutiveUppercase?y=f(y,b):y=b(y),w.pascalCase&&(y=x(y.charAt(0))+y.slice(1)),p(y,x))};return Zy.exports=m,Zy.exports.default=m,Zy.exports}var fD=dD();const hD=Ju(fD);var pD=["accelerator","-wap-accesskey","align-content","-webkit-align-content","align-items","-webkit-align-items","align-self","-webkit-align-self","alignment-baseline","all","-webkit-alt","animation","animation-delay","-moz-animation-delay","-ms-animation-delay","-webkit-animation-delay","animation-direction","-moz-animation-direction","-ms-animation-direction","-webkit-animation-direction","animation-duration","-moz-animation-duration","-ms-animation-duration","-webkit-animation-duration","animation-fill-mode","-moz-animation-fill-mode","-ms-animation-fill-mode","-webkit-animation-fill-mode","animation-iteration-count","-moz-animation-iteration-count","-ms-animation-iteration-count","-webkit-animation-iteration-count","-moz-animation","-ms-animation","animation-name","-moz-animation-name","-ms-animation-name","-webkit-animation-name","animation-play-state","-moz-animation-play-state","-ms-animation-play-state","-webkit-animation-play-state","animation-timing-function","-moz-animation-timing-function","-ms-animation-timing-function","-webkit-animation-timing-function","-webkit-animation-trigger","-webkit-animation","-webkit-app-region","appearance","-moz-appearance","-webkit-appearance","-webkit-aspect-ratio","audio-level","azimuth","backdrop-filter","-webkit-backdrop-filter","backface-visibility","-moz-backface-visibility","-ms-backface-visibility","-webkit-backface-visibility","background","background-attachment","-webkit-background-attachment","background-blend-mode","background-clip","-moz-background-clip","-webkit-background-clip","background-color","-webkit-background-color","-webkit-background-composite","background-image","-webkit-background-image","-moz-background-inline-policy","background-origin","-moz-background-origin","-webkit-background-origin","background-position","-webkit-background-position","background-position-x","-webkit-background-position-x","background-position-y","-webkit-background-position-y","background-repeat","-webkit-background-repeat","background-repeat-x","background-repeat-y","background-size","-moz-background-size","-webkit-background-size","-webkit-background","baseline-shift","baseline-source","behavior","-moz-binding","block-ellipsis","block-overflow","-ms-block-progression","block-size","block-step","block-step-align","block-step-insert","block-step-round","block-step-size","bookmark-label","bookmark-level","bookmark-state","border","-webkit-border-after-color","-webkit-border-after-style","-webkit-border-after","-webkit-border-after-width","-webkit-border-before-color","-webkit-border-before-style","-webkit-border-before","-webkit-border-before-width","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","-moz-border-bottom-colors","border-bottom-left-radius","-webkit-border-bottom-left-radius","border-bottom-right-radius","-webkit-border-bottom-right-radius","border-bottom-style","border-bottom-width","border-boundary","border-collapse","border-color","-moz-border-end-color","-webkit-border-end-color","border-end-end-radius","-moz-border-end","border-end-start-radius","-moz-border-end-style","-webkit-border-end-style","-webkit-border-end","-moz-border-end-width","-webkit-border-end-width","-webkit-border-fit","-webkit-border-horizontal-spacing","border-image","-moz-border-image","-o-border-image","border-image-outset","-webkit-border-image-outset","border-image-repeat","-webkit-border-image-repeat","border-image-slice","-webkit-border-image-slice","border-image-source","-webkit-border-image-source","-webkit-border-image","border-image-width","-webkit-border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","-moz-border-left-colors","border-left-style","border-left-width","border-radius","-moz-border-radius-bottomleft","-moz-border-radius-bottomright","-moz-border-radius","-moz-border-radius-topleft","-moz-border-radius-topright","-webkit-border-radius","border-right","border-right-color","-moz-border-right-colors","border-right-style","border-right-width","border-spacing","-moz-border-start-color","-webkit-border-start-color","border-start-end-radius","-moz-border-start","border-start-start-radius","-moz-border-start-style","-webkit-border-start-style","-webkit-border-start","-moz-border-start-width","-webkit-border-start-width","border-style","border-top","border-top-color","-moz-border-top-colors","border-top-left-radius","-webkit-border-top-left-radius","border-top-right-radius","-webkit-border-top-right-radius","border-top-style","border-top-width","-webkit-border-vertical-spacing","border-width","bottom","-moz-box-align","-webkit-box-align","box-decoration-break","-webkit-box-decoration-break","-moz-box-direction","-webkit-box-direction","-webkit-box-flex-group","-moz-box-flex","-webkit-box-flex","-webkit-box-lines","-moz-box-ordinal-group","-webkit-box-ordinal-group","-moz-box-orient","-webkit-box-orient","-moz-box-pack","-webkit-box-pack","-webkit-box-reflect","box-shadow","-moz-box-shadow","-webkit-box-shadow","box-sizing","-moz-box-sizing","-webkit-box-sizing","box-snap","break-after","break-before","break-inside","buffered-rendering","caption-side","caret","caret-color","caret-shape","chains","clear","clip","clip-path","-webkit-clip-path","clip-rule","color","color-adjust","-webkit-color-correction","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","-webkit-column-axis","-webkit-column-break-after","-webkit-column-break-before","-webkit-column-break-inside","column-count","-moz-column-count","-webkit-column-count","column-fill","-moz-column-fill","-webkit-column-fill","column-gap","-moz-column-gap","-webkit-column-gap","column-progression","-webkit-column-progression","column-rule","column-rule-color","-moz-column-rule-color","-webkit-column-rule-color","-moz-column-rule","column-rule-style","-moz-column-rule-style","-webkit-column-rule-style","-webkit-column-rule","column-rule-width","-moz-column-rule-width","-webkit-column-rule-width","column-span","-moz-column-span","-webkit-column-span","column-width","-moz-column-width","-webkit-column-width","columns","-moz-columns","-webkit-columns","-webkit-composition-fill-color","-webkit-composition-frame-color","contain","content","-ms-content-zoom-chaining","-ms-content-zoom-limit-max","-ms-content-zoom-limit-min","-ms-content-zoom-limit","-ms-content-zoom-snap","-ms-content-zoom-snap-points","-ms-content-zoom-snap-type","-ms-content-zooming","continue","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","-webkit-cursor-visibility","cx","cy","-apple-dashboard-region","-webkit-dashboard-region","direction","display","display-align","dominant-baseline","elevation","empty-cells","enable-background","fill","fill-break","fill-color","fill-image","fill-opacity","fill-origin","fill-position","fill-repeat","fill-rule","fill-size","filter","-ms-filter","-webkit-filter","flex","-ms-flex-align","-webkit-flex-align","flex-basis","-webkit-flex-basis","flex-direction","-ms-flex-direction","-webkit-flex-direction","flex-flow","-ms-flex-flow","-webkit-flex-flow","flex-grow","-webkit-flex-grow","-ms-flex-item-align","-webkit-flex-item-align","-ms-flex-line-pack","-webkit-flex-line-pack","-ms-flex","-ms-flex-negative","-ms-flex-order","-webkit-flex-order","-ms-flex-pack","-webkit-flex-pack","-ms-flex-positive","-ms-flex-preferred-size","flex-shrink","-webkit-flex-shrink","-webkit-flex","flex-wrap","-ms-flex-wrap","-webkit-flex-wrap","float","float-defer","-moz-float-edge","float-offset","float-reference","flood-color","flood-opacity","flow","flow-from","-ms-flow-from","-webkit-flow-from","flow-into","-ms-flow-into","-webkit-flow-into","font","font-display","font-family","font-feature-settings","-moz-font-feature-settings","-ms-font-feature-settings","-webkit-font-feature-settings","font-kerning","-webkit-font-kerning","font-language-override","-moz-font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","-webkit-font-size-delta","-webkit-font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","-webkit-font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","footnote-display","footnote-policy","-moz-force-broken-image-icon","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","-webkit-grid-after","grid-area","grid-auto-columns","-webkit-grid-auto-columns","grid-auto-flow","-webkit-grid-auto-flow","grid-auto-rows","-webkit-grid-auto-rows","-webkit-grid-before","grid-column","-ms-grid-column-align","grid-column-end","grid-column-gap","-ms-grid-column","-ms-grid-column-span","grid-column-start","-webkit-grid-column","-ms-grid-columns","-webkit-grid-columns","-webkit-grid-end","grid-gap","grid-row","-ms-grid-row-align","grid-row-end","grid-row-gap","-ms-grid-row","-ms-grid-row-span","grid-row-start","-webkit-grid-row","-ms-grid-rows","-webkit-grid-rows","-webkit-grid-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","-ms-high-contrast-adjust","-webkit-highlight","hyphenate-character","-webkit-hyphenate-character","-webkit-hyphenate-limit-after","-webkit-hyphenate-limit-before","hyphenate-limit-chars","-ms-hyphenate-limit-chars","hyphenate-limit-last","hyphenate-limit-lines","-ms-hyphenate-limit-lines","-webkit-hyphenate-limit-lines","hyphenate-limit-zone","-ms-hyphenate-limit-zone","hyphens","-moz-hyphens","-ms-hyphens","-webkit-hyphens","image-orientation","-moz-image-region","image-rendering","image-resolution","-ms-ime-align","ime-mode","-webkit-initial-letter","initial-letters","initial-letters-align","initial-letters-wrap","inline-size","inline-sizing","input-format","-wap-input-format","-wap-input-required","inset","inset-after","inset-before","inset-block","inset-block-end","inset-block-start","inset-end","inset-inline","inset-inline-end","inset-inline-start","inset-start","-ms-interpolation-mode","isolation","justify-content","-webkit-justify-content","justify-items","justify-self","-webkit-justify-self","kerning","layout-flow","layout-grid","layout-grid-char","layout-grid-line","layout-grid-mode","layout-grid-type","leading-trim","leading-trim-over","leading-trim-under","left","letter-spacing","lighting-color","-webkit-line-align","-webkit-line-box-contain","line-break","-webkit-line-break","line-clamp","-webkit-line-clamp","line-grid","-webkit-line-grid-snap","-webkit-line-grid","line-height","line-height-step","line-increment","line-padding","line-sizing","line-snap","-webkit-line-snap","-o-link","-o-link-source","list-style","list-style-image","list-style-position","list-style-type","-webkit-locale","-webkit-logical-height","-webkit-logical-width","margin","-webkit-margin-after-collapse","-webkit-margin-after","-webkit-margin-before-collapse","-webkit-margin-before","margin-block","margin-block-end","margin-block-start","margin-bottom","-webkit-margin-bottom-collapse","margin-break","-webkit-margin-collapse","-moz-margin-end","-webkit-margin-end","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","-moz-margin-start","-webkit-margin-start","margin-top","-webkit-margin-top-collapse","margin-trim","marker","marker-end","marker-knockout-left","marker-knockout-right","marker-mid","marker-offset","marker-pattern","marker-segment","marker-side","marker-start","marks","-wap-marquee-dir","-webkit-marquee-direction","-webkit-marquee-increment","-wap-marquee-loop","-webkit-marquee-repetition","-wap-marquee-speed","-webkit-marquee-speed","-wap-marquee-style","-webkit-marquee-style","-webkit-marquee","mask","-webkit-mask-attachment","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","-webkit-mask-box-image-outset","-webkit-mask-box-image-repeat","-webkit-mask-box-image-slice","-webkit-mask-box-image-source","-webkit-mask-box-image","-webkit-mask-box-image-width","mask-clip","-webkit-mask-clip","mask-composite","-webkit-mask-composite","mask-image","-webkit-mask-image","mask-mode","mask-origin","-webkit-mask-origin","mask-position","-webkit-mask-position","mask-position-x","-webkit-mask-position-x","mask-position-y","-webkit-mask-position-y","mask-repeat","-webkit-mask-repeat","-webkit-mask-repeat-x","-webkit-mask-repeat-y","mask-size","-webkit-mask-size","mask-source-type","-webkit-mask-source-type","mask-type","-webkit-mask","-webkit-match-nearest-mail-blockquote-color","max-block-size","max-height","max-inline-size","max-lines","-webkit-max-logical-height","-webkit-max-logical-width","max-width","max-zoom","min-block-size","min-height","min-inline-size","-webkit-min-logical-height","-webkit-min-logical-width","min-width","min-zoom","mix-blend-mode","motion","motion-offset","motion-path","motion-rotation","nav-down","nav-index","nav-left","nav-right","nav-up","-webkit-nbsp-mode","object-fit","-o-object-fit","object-position","-o-object-position","offset","offset-after","offset-anchor","offset-before","offset-block-end","offset-block-start","offset-distance","offset-end","offset-inline-end","offset-inline-start","offset-path","offset-position","offset-rotate","offset-rotation","offset-start","opacity","-moz-opacity","-webkit-opacity","order","-webkit-order","-moz-orient","orientation","orphans","-moz-osx-font-smoothing","outline","outline-color","-moz-outline-color","-moz-outline","outline-offset","-moz-outline-offset","-moz-outline-radius-bottomleft","-moz-outline-radius-bottomright","-moz-outline-radius","-moz-outline-radius-topleft","-moz-outline-radius-topright","outline-style","-moz-outline-style","outline-width","-moz-outline-width","overflow","overflow-anchor","overflow-block","overflow-inline","-webkit-overflow-scrolling","-ms-overflow-style","overflow-wrap","overflow-x","overflow-y","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","-webkit-padding-after","-webkit-padding-before","padding-block","padding-block-end","padding-block-start","padding-bottom","-moz-padding-end","-webkit-padding-end","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","-moz-padding-start","-webkit-padding-start","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","pen-action","perspective","-moz-perspective","-ms-perspective","perspective-origin","-moz-perspective-origin","-ms-perspective-origin","-webkit-perspective-origin","perspective-origin-x","-webkit-perspective-origin-x","perspective-origin-y","-webkit-perspective-origin-y","-webkit-perspective","pitch","pitch-range","place-content","place-items","place-self","play-during","pointer-events","position","-webkit-print-color-adjust","quotes","r","-webkit-region-break-after","-webkit-region-break-before","-webkit-region-break-inside","region-fragment","-webkit-region-fragment","-webkit-region-overflow","resize","richness","right","rotate","row-gap","-webkit-rtl-ordering","ruby-align","ruby-merge","ruby-overhang","ruby-position","-webkit-ruby-position","running","rx","ry","scale","scroll-behavior","-ms-scroll-chaining","-ms-scroll-limit","-ms-scroll-limit-x-max","-ms-scroll-limit-x-min","-ms-scroll-limit-y-max","-ms-scroll-limit-y-min","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","-ms-scroll-rails","scroll-snap-align","scroll-snap-coordinate","-webkit-scroll-snap-coordinate","scroll-snap-destination","-webkit-scroll-snap-destination","scroll-snap-margin","scroll-snap-margin-bottom","scroll-snap-margin-left","scroll-snap-margin-right","scroll-snap-margin-top","scroll-snap-points-x","-ms-scroll-snap-points-x","-webkit-scroll-snap-points-x","scroll-snap-points-y","-ms-scroll-snap-points-y","-webkit-scroll-snap-points-y","scroll-snap-stop","scroll-snap-type","-ms-scroll-snap-type","-webkit-scroll-snap-type","scroll-snap-type-x","scroll-snap-type-y","-ms-scroll-snap-x","-ms-scroll-snap-y","-ms-scroll-translation","scrollbar-arrow-color","scrollbar-base-color","scrollbar-color","scrollbar-dark-shadow-color","scrollbar-darkshadow-color","scrollbar-face-color","scrollbar-gutter","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","scrollbar-width","scrollbar3d-light-color","scrollbar3dlight-color","shape-image-threshold","-webkit-shape-image-threshold","shape-inside","-webkit-shape-inside","shape-margin","-webkit-shape-margin","shape-outside","-webkit-shape-outside","-webkit-shape-padding","shape-rendering","size","snap-height","solid-color","solid-opacity","spatial-navigation-action","spatial-navigation-contain","spatial-navigation-function","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","-moz-stack-sizing","stop-color","stop-opacity","stress","string-set","stroke","stroke-align","stroke-alignment","stroke-break","stroke-color","stroke-dash-corner","stroke-dash-justify","stroke-dashadjust","stroke-dasharray","stroke-dashcorner","stroke-dashoffset","stroke-image","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-origin","stroke-position","stroke-repeat","stroke-size","stroke-width","supported-color-schemes","-webkit-svg-shadow","tab-size","-moz-tab-size","-o-tab-size","-o-table-baseline","table-layout","-webkit-tap-highlight-color","text-align","text-align-all","text-align-last","-moz-text-align-last","text-anchor","text-autospace","-moz-text-blink","-ms-text-combine-horizontal","text-combine-upright","-webkit-text-combine","text-decoration","text-decoration-blink","text-decoration-color","-moz-text-decoration-color","-webkit-text-decoration-color","text-decoration-line","-moz-text-decoration-line","text-decoration-line-through","-webkit-text-decoration-line","text-decoration-none","text-decoration-overline","text-decoration-skip","text-decoration-skip-box","text-decoration-skip-ink","text-decoration-skip-inset","text-decoration-skip-self","text-decoration-skip-spaces","-webkit-text-decoration-skip","text-decoration-style","-moz-text-decoration-style","-webkit-text-decoration-style","text-decoration-thickness","text-decoration-underline","-webkit-text-decoration","text-decoration-width","-webkit-text-decorations-in-effect","text-emphasis","text-emphasis-color","-webkit-text-emphasis-color","text-emphasis-position","-webkit-text-emphasis-position","text-emphasis-skip","text-emphasis-style","-webkit-text-emphasis-style","-webkit-text-emphasis","-webkit-text-fill-color","text-group-align","text-indent","text-justify","text-justify-trim","text-kashida","text-kashida-space","text-line-through","text-line-through-color","text-line-through-mode","text-line-through-style","text-line-through-width","text-orientation","-webkit-text-orientation","text-overflow","text-overline","text-overline-color","text-overline-mode","text-overline-style","text-overline-width","text-rendering","-webkit-text-security","text-shadow","text-size-adjust","-moz-text-size-adjust","-ms-text-size-adjust","-webkit-text-size-adjust","text-space-collapse","text-space-trim","text-spacing","-webkit-text-stroke-color","-webkit-text-stroke","-webkit-text-stroke-width","text-transform","text-underline","text-underline-color","text-underline-mode","text-underline-offset","text-underline-position","-webkit-text-underline-position","text-underline-style","text-underline-width","text-wrap","-webkit-text-zoom","top","touch-action","touch-action-delay","-ms-touch-action","-webkit-touch-callout","-ms-touch-select","transform","transform-box","-moz-transform","-ms-transform","-o-transform","transform-origin","-moz-transform-origin","-ms-transform-origin","-o-transform-origin","-webkit-transform-origin","transform-origin-x","-webkit-transform-origin-x","transform-origin-y","-webkit-transform-origin-y","transform-origin-z","-webkit-transform-origin-z","transform-style","-moz-transform-style","-ms-transform-style","-webkit-transform-style","-webkit-transform","transition","transition-delay","-moz-transition-delay","-ms-transition-delay","-o-transition-delay","-webkit-transition-delay","transition-duration","-moz-transition-duration","-ms-transition-duration","-o-transition-duration","-webkit-transition-duration","-moz-transition","-ms-transition","-o-transition","transition-property","-moz-transition-property","-ms-transition-property","-o-transition-property","-webkit-transition-property","transition-timing-function","-moz-transition-timing-function","-ms-transition-timing-function","-o-transition-timing-function","-webkit-transition-timing-function","-webkit-transition","translate","uc-alt-skin","uc-skin","unicode-bidi","unicode-range","-webkit-user-drag","-moz-user-focus","-moz-user-input","-moz-user-modify","-webkit-user-modify","user-select","-moz-user-select","-ms-user-select","-webkit-user-select","user-zoom","vector-effect","vertical-align","viewport-fill","viewport-fill-opacity","viewport-fit","visibility","voice-family","volume","white-space","-webkit-widget-region","widows","width","will-change","-moz-window-dragging","-moz-window-shadow","word-boundary-detection","word-boundary-expansion","word-break","word-spacing","word-wrap","wrap-after","wrap-before","wrap-flow","-ms-wrap-flow","-webkit-wrap-flow","wrap-inside","-ms-wrap-margin","-webkit-wrap-margin","-webkit-wrap-padding","-webkit-wrap-shape-inside","-webkit-wrap-shape-outside","wrap-through","-ms-wrap-through","-webkit-wrap-through","-webkit-wrap","writing-mode","-webkit-writing-mode","x","y","z-index","zoom"],Mu={w:"width",minW:"minWidth",maxW:"maxWidth",h:"height",minH:"minHeight",maxH:"maxHeight",bgImg:"backgroundImage",bgSize:"backgroundSize",bgPos:"backgroundPosition",bgRepeat:"backgroundRepeat",pos:"position",flexDir:"flexDirection",dir:"flexDirection",direction:"flexDirection",align:"alignItems",justify:"justifyContent",wrap:"flexWrap",shadow:"boxShadow",templateColumns:"gridTemplateColumns",gap:"gridGap",rowGap:"gridRowGap",columnGap:"gridColumnGap",autoFlow:"gridAutoFlow",autoRows:"gridAutoRows",autoColumns:"gridAutoColumns",templateRows:"gridTemplateRows",templateAreas:"gridTemplateAreas",area:"gridArea",column:"gridColumn",row:"gridRow"};Mu.bgAttachment=Mu.backgroundAttachment;Mu.textDecor=Mu.textDecoration;Mu.listStylePos=Mu.listStylePosition;Mu.listStyleImg=Mu.listStyleImage;var mD=["textStyle","buttonStyle","colorStyle"],gD="&:hover",yD="&:active, &[data-active=true]",wD="&:focus",bD="&:visited",SD="&:nth-of-type(even)",vD="&:nth-of-type(odd)",xD="&:disabled, &:disabled:focus, &:disabled:hover, &[aria-disabled=true], &[aria-disabled=true]:focus, &[aria-disabled=true]:hover",_D="&[aria-checked=true]",kD="&[aria-checked=mixed]",RD="&[aria-selected=true]",TD="&[aria-invalid=true]",OD="&[aria-pressed=true]",ND="&[aria-readonly=true], &[readonly]",CD="&:first-of-type",ED="&:last-of-type",AD="&[aria-expanded=true]",FD="&[aria-grabbed=true]",ID="&:not(:first-of-type)",PD="&:not(:last-of-type)",MD="[role=group]:hover &",LD=[].concat(mD,pD.map(function(e){return hD(e)}),Object.keys(Gx),Object.keys(Kx),Object.keys(Mu)),BD=function(t){var n,r=t._after,i=t._focus,o=t._selected,a=t._focusWithin,u=t._hover,l=t._invalid,f=t._active,p=t._disabled,m=t._grabbed,y=t._pressed,w=t._expanded,b=t._visited,x=t._before,k=t._readOnly,O=t._first,N=t._notFirst,E=t._notLast,T=t._last,B=t._placeholder,A=t._checked,U=t._groupHover,v=t._mixed,R=t._odd,C=t._even,M=t.css,J=t.sx,P=oD(t,["_after","_focus","_selected","_focusWithin","_hover","_invalid","_active","_disabled","_grabbed","_pressed","_expanded","_visited","_before","_readOnly","_first","_notFirst","_notLast","_last","_placeholder","_checked","_groupHover","_mixed","_odd","_even","css","sx"]),D={},q=(n={},n[gD]=u,n[wD]=i,n[yD]=f,n[bD]=b,n[xD]=p,n[RD]=o,n[TD]=l,n[AD]=w,n[FD]=m,n[ND]=k,n[CD]=O,n[ID]=N,n[PD]=E,n[ED]=T,n[vD]=R,n[SD]=C,n[kD]=v,n[_D]=A,n[OD]=y,n[MD]=U,n["&:before"]=x,n["&:after"]=r,n["&:focus-within"]=a,n["&::placeholder"]=B,n),K=Cl({},P),Q=$.useCallback(function(I){return LD.find(function(te){return te===I})},[]),H=Object.keys(P);H.forEach(function(I){Q(I)&&(D[I]=P[I],delete K[I])});var X=function(te){var ge=Xy(D)(te)||{},oe=Xy(q)(te)||{},be=Xy(M)(te)||{},ke=Xy(J)(te)||{},Ne=Cl({},ge,oe,be,ke);return Ne};return[X,K]};/* + */var J2;function Dj(){if(J2)return Zt;J2=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,w=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,_=e?Symbol.for("react.fundamental"):60117,O=e?Symbol.for("react.responder"):60118,N=e?Symbol.for("react.scope"):60119;function E(B){if(typeof B=="object"&&B!==null){var A=B.$$typeof;switch(A){case t:switch(B=B.type,B){case l:case f:case r:case o:case i:case m:return B;default:switch(B=B&&B.$$typeof,B){case u:case p:case b:case w:case a:return B;default:return A}}case n:return A}}}function T(B){return E(B)===f}return Zt.AsyncMode=l,Zt.ConcurrentMode=f,Zt.ContextConsumer=u,Zt.ContextProvider=a,Zt.Element=t,Zt.ForwardRef=p,Zt.Fragment=r,Zt.Lazy=b,Zt.Memo=w,Zt.Portal=n,Zt.Profiler=o,Zt.StrictMode=i,Zt.Suspense=m,Zt.isAsyncMode=function(B){return T(B)||E(B)===l},Zt.isConcurrentMode=T,Zt.isContextConsumer=function(B){return E(B)===u},Zt.isContextProvider=function(B){return E(B)===a},Zt.isElement=function(B){return typeof B=="object"&&B!==null&&B.$$typeof===t},Zt.isForwardRef=function(B){return E(B)===p},Zt.isFragment=function(B){return E(B)===r},Zt.isLazy=function(B){return E(B)===b},Zt.isMemo=function(B){return E(B)===w},Zt.isPortal=function(B){return E(B)===n},Zt.isProfiler=function(B){return E(B)===o},Zt.isStrictMode=function(B){return E(B)===i},Zt.isSuspense=function(B){return E(B)===m},Zt.isValidElementType=function(B){return typeof B=="string"||typeof B=="function"||B===r||B===f||B===o||B===i||B===m||B===y||typeof B=="object"&&B!==null&&(B.$$typeof===b||B.$$typeof===w||B.$$typeof===a||B.$$typeof===u||B.$$typeof===p||B.$$typeof===_||B.$$typeof===O||B.$$typeof===N||B.$$typeof===x)},Zt.typeOf=E,Zt}var $2;function Jj(){return $2||($2=1,wv.exports=Dj()),wv.exports}var bv,q2;function $j(){if(q2)return bv;q2=1;var e=Jj(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[e.ForwardRef]=r,o[e.Memo]=i;function a(b){return e.isMemo(b)?i:o[b.$$typeof]||t}var u=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,m=Object.getPrototypeOf,y=Object.prototype;function w(b,x,_){if(typeof x!="string"){if(y){var O=m(x);O&&O!==y&&w(b,O,_)}var N=l(x);f&&(N=N.concat(f(x)));for(var E=a(b),T=a(x),B=0;B=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var zj={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Wj=/[A-Z]|^ms/g,Vj=/_EMO_([^_]+?)_([^]*?)_EMO_/g,o4=function(t){return t.charCodeAt(1)===45},U2=function(t){return t!=null&&typeof t!="boolean"},Sv=Ej(function(e){return o4(e)?e:e.replace(Wj,"-$&").toLowerCase()}),H2=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Vj,function(r,i,o){return Yo={name:i,styles:o,next:Yo},i})}return zj[t]!==1&&!o4(t)&&typeof n=="number"&&n!==0?n+"px":n};function rg(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Yo={name:n.name,styles:n.styles,next:Yo},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Yo={name:r.name,styles:r.styles,next:Yo},r=r.next;var i=n.styles+";";return i}return Gj(e,t,n)}case"function":{if(e!==void 0){var o=Yo,a=n(e);return Yo=o,rg(e,t,a)}break}}return n}function Gj(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i=0)&&(n[i]=e[i]);return n}function Nu(e,t,n,r,i){var o=t&&typeof t=="string"?t.split("."):[t];for(r=0;r=0){if(typeof n=="string"&&n.startsWith("-")){var r=n.substring(1),i=Nu(t,r,r);return"-"+i}return Nu(t,n,n)}var o=Math.abs(n),a=Nu(t,o,o);return typeof a=="string"?"-"+a:Number(a)*-1},uD=["margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginInlineStart","top","bottom","left","right"].reduce(function(e,t){var n;return El({},e,(n={},n[t]=cD,n))},{}),lD=function(t){return function(n){var r={},i=n&&n.breakpoints||sD,o=[null].concat(i.map(function(m){return"@media screen and (min-width: "+m+")"}));for(var a in t){var u=a,l=t[u];if(typeof l=="function"&&(l=l(n||{})),l!=null){if(!Array.isArray(l)){r[u]=l;continue}for(var f=0;f{let x=!1,_=!1,O=!1;for(let N=0;N(n.lastIndex=0,y.replace(n,b=>w(b))),p=(y,w)=>(a.lastIndex=0,u.lastIndex=0,y.replace(a,(b,x)=>w(x)).replace(u,b=>w(b))),m=(y,w)=>{if(!(typeof y=="string"||Array.isArray(y)))throw new TypeError("Expected the input to be `string | string[]`");if(w={pascalCase:!1,preserveConsecutiveUppercase:!1,...w},Array.isArray(y)?y=y.map(O=>O.trim()).filter(O=>O.length).join("-"):y=y.trim(),y.length===0)return"";const b=w.locale===!1?O=>O.toLowerCase():O=>O.toLocaleLowerCase(w.locale),x=w.locale===!1?O=>O.toUpperCase():O=>O.toLocaleUpperCase(w.locale);return y.length===1?w.pascalCase?x(y):b(y):(y!==b(y)&&(y=l(y,b,x)),y=y.replace(o,""),w.preserveConsecutiveUppercase?y=f(y,b):y=b(y),w.pascalCase&&(y=x(y.charAt(0))+y.slice(1)),p(y,x))};return Zy.exports=m,Zy.exports.default=m,Zy.exports}var fD=dD();const hD=Ju(fD);var pD=["accelerator","-wap-accesskey","align-content","-webkit-align-content","align-items","-webkit-align-items","align-self","-webkit-align-self","alignment-baseline","all","-webkit-alt","animation","animation-delay","-moz-animation-delay","-ms-animation-delay","-webkit-animation-delay","animation-direction","-moz-animation-direction","-ms-animation-direction","-webkit-animation-direction","animation-duration","-moz-animation-duration","-ms-animation-duration","-webkit-animation-duration","animation-fill-mode","-moz-animation-fill-mode","-ms-animation-fill-mode","-webkit-animation-fill-mode","animation-iteration-count","-moz-animation-iteration-count","-ms-animation-iteration-count","-webkit-animation-iteration-count","-moz-animation","-ms-animation","animation-name","-moz-animation-name","-ms-animation-name","-webkit-animation-name","animation-play-state","-moz-animation-play-state","-ms-animation-play-state","-webkit-animation-play-state","animation-timing-function","-moz-animation-timing-function","-ms-animation-timing-function","-webkit-animation-timing-function","-webkit-animation-trigger","-webkit-animation","-webkit-app-region","appearance","-moz-appearance","-webkit-appearance","-webkit-aspect-ratio","audio-level","azimuth","backdrop-filter","-webkit-backdrop-filter","backface-visibility","-moz-backface-visibility","-ms-backface-visibility","-webkit-backface-visibility","background","background-attachment","-webkit-background-attachment","background-blend-mode","background-clip","-moz-background-clip","-webkit-background-clip","background-color","-webkit-background-color","-webkit-background-composite","background-image","-webkit-background-image","-moz-background-inline-policy","background-origin","-moz-background-origin","-webkit-background-origin","background-position","-webkit-background-position","background-position-x","-webkit-background-position-x","background-position-y","-webkit-background-position-y","background-repeat","-webkit-background-repeat","background-repeat-x","background-repeat-y","background-size","-moz-background-size","-webkit-background-size","-webkit-background","baseline-shift","baseline-source","behavior","-moz-binding","block-ellipsis","block-overflow","-ms-block-progression","block-size","block-step","block-step-align","block-step-insert","block-step-round","block-step-size","bookmark-label","bookmark-level","bookmark-state","border","-webkit-border-after-color","-webkit-border-after-style","-webkit-border-after","-webkit-border-after-width","-webkit-border-before-color","-webkit-border-before-style","-webkit-border-before","-webkit-border-before-width","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","-moz-border-bottom-colors","border-bottom-left-radius","-webkit-border-bottom-left-radius","border-bottom-right-radius","-webkit-border-bottom-right-radius","border-bottom-style","border-bottom-width","border-boundary","border-collapse","border-color","-moz-border-end-color","-webkit-border-end-color","border-end-end-radius","-moz-border-end","border-end-start-radius","-moz-border-end-style","-webkit-border-end-style","-webkit-border-end","-moz-border-end-width","-webkit-border-end-width","-webkit-border-fit","-webkit-border-horizontal-spacing","border-image","-moz-border-image","-o-border-image","border-image-outset","-webkit-border-image-outset","border-image-repeat","-webkit-border-image-repeat","border-image-slice","-webkit-border-image-slice","border-image-source","-webkit-border-image-source","-webkit-border-image","border-image-width","-webkit-border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","-moz-border-left-colors","border-left-style","border-left-width","border-radius","-moz-border-radius-bottomleft","-moz-border-radius-bottomright","-moz-border-radius","-moz-border-radius-topleft","-moz-border-radius-topright","-webkit-border-radius","border-right","border-right-color","-moz-border-right-colors","border-right-style","border-right-width","border-spacing","-moz-border-start-color","-webkit-border-start-color","border-start-end-radius","-moz-border-start","border-start-start-radius","-moz-border-start-style","-webkit-border-start-style","-webkit-border-start","-moz-border-start-width","-webkit-border-start-width","border-style","border-top","border-top-color","-moz-border-top-colors","border-top-left-radius","-webkit-border-top-left-radius","border-top-right-radius","-webkit-border-top-right-radius","border-top-style","border-top-width","-webkit-border-vertical-spacing","border-width","bottom","-moz-box-align","-webkit-box-align","box-decoration-break","-webkit-box-decoration-break","-moz-box-direction","-webkit-box-direction","-webkit-box-flex-group","-moz-box-flex","-webkit-box-flex","-webkit-box-lines","-moz-box-ordinal-group","-webkit-box-ordinal-group","-moz-box-orient","-webkit-box-orient","-moz-box-pack","-webkit-box-pack","-webkit-box-reflect","box-shadow","-moz-box-shadow","-webkit-box-shadow","box-sizing","-moz-box-sizing","-webkit-box-sizing","box-snap","break-after","break-before","break-inside","buffered-rendering","caption-side","caret","caret-color","caret-shape","chains","clear","clip","clip-path","-webkit-clip-path","clip-rule","color","color-adjust","-webkit-color-correction","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","-webkit-column-axis","-webkit-column-break-after","-webkit-column-break-before","-webkit-column-break-inside","column-count","-moz-column-count","-webkit-column-count","column-fill","-moz-column-fill","-webkit-column-fill","column-gap","-moz-column-gap","-webkit-column-gap","column-progression","-webkit-column-progression","column-rule","column-rule-color","-moz-column-rule-color","-webkit-column-rule-color","-moz-column-rule","column-rule-style","-moz-column-rule-style","-webkit-column-rule-style","-webkit-column-rule","column-rule-width","-moz-column-rule-width","-webkit-column-rule-width","column-span","-moz-column-span","-webkit-column-span","column-width","-moz-column-width","-webkit-column-width","columns","-moz-columns","-webkit-columns","-webkit-composition-fill-color","-webkit-composition-frame-color","contain","content","-ms-content-zoom-chaining","-ms-content-zoom-limit-max","-ms-content-zoom-limit-min","-ms-content-zoom-limit","-ms-content-zoom-snap","-ms-content-zoom-snap-points","-ms-content-zoom-snap-type","-ms-content-zooming","continue","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","-webkit-cursor-visibility","cx","cy","-apple-dashboard-region","-webkit-dashboard-region","direction","display","display-align","dominant-baseline","elevation","empty-cells","enable-background","fill","fill-break","fill-color","fill-image","fill-opacity","fill-origin","fill-position","fill-repeat","fill-rule","fill-size","filter","-ms-filter","-webkit-filter","flex","-ms-flex-align","-webkit-flex-align","flex-basis","-webkit-flex-basis","flex-direction","-ms-flex-direction","-webkit-flex-direction","flex-flow","-ms-flex-flow","-webkit-flex-flow","flex-grow","-webkit-flex-grow","-ms-flex-item-align","-webkit-flex-item-align","-ms-flex-line-pack","-webkit-flex-line-pack","-ms-flex","-ms-flex-negative","-ms-flex-order","-webkit-flex-order","-ms-flex-pack","-webkit-flex-pack","-ms-flex-positive","-ms-flex-preferred-size","flex-shrink","-webkit-flex-shrink","-webkit-flex","flex-wrap","-ms-flex-wrap","-webkit-flex-wrap","float","float-defer","-moz-float-edge","float-offset","float-reference","flood-color","flood-opacity","flow","flow-from","-ms-flow-from","-webkit-flow-from","flow-into","-ms-flow-into","-webkit-flow-into","font","font-display","font-family","font-feature-settings","-moz-font-feature-settings","-ms-font-feature-settings","-webkit-font-feature-settings","font-kerning","-webkit-font-kerning","font-language-override","-moz-font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","-webkit-font-size-delta","-webkit-font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","-webkit-font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","footnote-display","footnote-policy","-moz-force-broken-image-icon","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","-webkit-grid-after","grid-area","grid-auto-columns","-webkit-grid-auto-columns","grid-auto-flow","-webkit-grid-auto-flow","grid-auto-rows","-webkit-grid-auto-rows","-webkit-grid-before","grid-column","-ms-grid-column-align","grid-column-end","grid-column-gap","-ms-grid-column","-ms-grid-column-span","grid-column-start","-webkit-grid-column","-ms-grid-columns","-webkit-grid-columns","-webkit-grid-end","grid-gap","grid-row","-ms-grid-row-align","grid-row-end","grid-row-gap","-ms-grid-row","-ms-grid-row-span","grid-row-start","-webkit-grid-row","-ms-grid-rows","-webkit-grid-rows","-webkit-grid-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","-ms-high-contrast-adjust","-webkit-highlight","hyphenate-character","-webkit-hyphenate-character","-webkit-hyphenate-limit-after","-webkit-hyphenate-limit-before","hyphenate-limit-chars","-ms-hyphenate-limit-chars","hyphenate-limit-last","hyphenate-limit-lines","-ms-hyphenate-limit-lines","-webkit-hyphenate-limit-lines","hyphenate-limit-zone","-ms-hyphenate-limit-zone","hyphens","-moz-hyphens","-ms-hyphens","-webkit-hyphens","image-orientation","-moz-image-region","image-rendering","image-resolution","-ms-ime-align","ime-mode","-webkit-initial-letter","initial-letters","initial-letters-align","initial-letters-wrap","inline-size","inline-sizing","input-format","-wap-input-format","-wap-input-required","inset","inset-after","inset-before","inset-block","inset-block-end","inset-block-start","inset-end","inset-inline","inset-inline-end","inset-inline-start","inset-start","-ms-interpolation-mode","isolation","justify-content","-webkit-justify-content","justify-items","justify-self","-webkit-justify-self","kerning","layout-flow","layout-grid","layout-grid-char","layout-grid-line","layout-grid-mode","layout-grid-type","leading-trim","leading-trim-over","leading-trim-under","left","letter-spacing","lighting-color","-webkit-line-align","-webkit-line-box-contain","line-break","-webkit-line-break","line-clamp","-webkit-line-clamp","line-grid","-webkit-line-grid-snap","-webkit-line-grid","line-height","line-height-step","line-increment","line-padding","line-sizing","line-snap","-webkit-line-snap","-o-link","-o-link-source","list-style","list-style-image","list-style-position","list-style-type","-webkit-locale","-webkit-logical-height","-webkit-logical-width","margin","-webkit-margin-after-collapse","-webkit-margin-after","-webkit-margin-before-collapse","-webkit-margin-before","margin-block","margin-block-end","margin-block-start","margin-bottom","-webkit-margin-bottom-collapse","margin-break","-webkit-margin-collapse","-moz-margin-end","-webkit-margin-end","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","-moz-margin-start","-webkit-margin-start","margin-top","-webkit-margin-top-collapse","margin-trim","marker","marker-end","marker-knockout-left","marker-knockout-right","marker-mid","marker-offset","marker-pattern","marker-segment","marker-side","marker-start","marks","-wap-marquee-dir","-webkit-marquee-direction","-webkit-marquee-increment","-wap-marquee-loop","-webkit-marquee-repetition","-wap-marquee-speed","-webkit-marquee-speed","-wap-marquee-style","-webkit-marquee-style","-webkit-marquee","mask","-webkit-mask-attachment","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","-webkit-mask-box-image-outset","-webkit-mask-box-image-repeat","-webkit-mask-box-image-slice","-webkit-mask-box-image-source","-webkit-mask-box-image","-webkit-mask-box-image-width","mask-clip","-webkit-mask-clip","mask-composite","-webkit-mask-composite","mask-image","-webkit-mask-image","mask-mode","mask-origin","-webkit-mask-origin","mask-position","-webkit-mask-position","mask-position-x","-webkit-mask-position-x","mask-position-y","-webkit-mask-position-y","mask-repeat","-webkit-mask-repeat","-webkit-mask-repeat-x","-webkit-mask-repeat-y","mask-size","-webkit-mask-size","mask-source-type","-webkit-mask-source-type","mask-type","-webkit-mask","-webkit-match-nearest-mail-blockquote-color","max-block-size","max-height","max-inline-size","max-lines","-webkit-max-logical-height","-webkit-max-logical-width","max-width","max-zoom","min-block-size","min-height","min-inline-size","-webkit-min-logical-height","-webkit-min-logical-width","min-width","min-zoom","mix-blend-mode","motion","motion-offset","motion-path","motion-rotation","nav-down","nav-index","nav-left","nav-right","nav-up","-webkit-nbsp-mode","object-fit","-o-object-fit","object-position","-o-object-position","offset","offset-after","offset-anchor","offset-before","offset-block-end","offset-block-start","offset-distance","offset-end","offset-inline-end","offset-inline-start","offset-path","offset-position","offset-rotate","offset-rotation","offset-start","opacity","-moz-opacity","-webkit-opacity","order","-webkit-order","-moz-orient","orientation","orphans","-moz-osx-font-smoothing","outline","outline-color","-moz-outline-color","-moz-outline","outline-offset","-moz-outline-offset","-moz-outline-radius-bottomleft","-moz-outline-radius-bottomright","-moz-outline-radius","-moz-outline-radius-topleft","-moz-outline-radius-topright","outline-style","-moz-outline-style","outline-width","-moz-outline-width","overflow","overflow-anchor","overflow-block","overflow-inline","-webkit-overflow-scrolling","-ms-overflow-style","overflow-wrap","overflow-x","overflow-y","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","-webkit-padding-after","-webkit-padding-before","padding-block","padding-block-end","padding-block-start","padding-bottom","-moz-padding-end","-webkit-padding-end","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","-moz-padding-start","-webkit-padding-start","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","pen-action","perspective","-moz-perspective","-ms-perspective","perspective-origin","-moz-perspective-origin","-ms-perspective-origin","-webkit-perspective-origin","perspective-origin-x","-webkit-perspective-origin-x","perspective-origin-y","-webkit-perspective-origin-y","-webkit-perspective","pitch","pitch-range","place-content","place-items","place-self","play-during","pointer-events","position","-webkit-print-color-adjust","quotes","r","-webkit-region-break-after","-webkit-region-break-before","-webkit-region-break-inside","region-fragment","-webkit-region-fragment","-webkit-region-overflow","resize","richness","right","rotate","row-gap","-webkit-rtl-ordering","ruby-align","ruby-merge","ruby-overhang","ruby-position","-webkit-ruby-position","running","rx","ry","scale","scroll-behavior","-ms-scroll-chaining","-ms-scroll-limit","-ms-scroll-limit-x-max","-ms-scroll-limit-x-min","-ms-scroll-limit-y-max","-ms-scroll-limit-y-min","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","-ms-scroll-rails","scroll-snap-align","scroll-snap-coordinate","-webkit-scroll-snap-coordinate","scroll-snap-destination","-webkit-scroll-snap-destination","scroll-snap-margin","scroll-snap-margin-bottom","scroll-snap-margin-left","scroll-snap-margin-right","scroll-snap-margin-top","scroll-snap-points-x","-ms-scroll-snap-points-x","-webkit-scroll-snap-points-x","scroll-snap-points-y","-ms-scroll-snap-points-y","-webkit-scroll-snap-points-y","scroll-snap-stop","scroll-snap-type","-ms-scroll-snap-type","-webkit-scroll-snap-type","scroll-snap-type-x","scroll-snap-type-y","-ms-scroll-snap-x","-ms-scroll-snap-y","-ms-scroll-translation","scrollbar-arrow-color","scrollbar-base-color","scrollbar-color","scrollbar-dark-shadow-color","scrollbar-darkshadow-color","scrollbar-face-color","scrollbar-gutter","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","scrollbar-width","scrollbar3d-light-color","scrollbar3dlight-color","shape-image-threshold","-webkit-shape-image-threshold","shape-inside","-webkit-shape-inside","shape-margin","-webkit-shape-margin","shape-outside","-webkit-shape-outside","-webkit-shape-padding","shape-rendering","size","snap-height","solid-color","solid-opacity","spatial-navigation-action","spatial-navigation-contain","spatial-navigation-function","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","-moz-stack-sizing","stop-color","stop-opacity","stress","string-set","stroke","stroke-align","stroke-alignment","stroke-break","stroke-color","stroke-dash-corner","stroke-dash-justify","stroke-dashadjust","stroke-dasharray","stroke-dashcorner","stroke-dashoffset","stroke-image","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-origin","stroke-position","stroke-repeat","stroke-size","stroke-width","supported-color-schemes","-webkit-svg-shadow","tab-size","-moz-tab-size","-o-tab-size","-o-table-baseline","table-layout","-webkit-tap-highlight-color","text-align","text-align-all","text-align-last","-moz-text-align-last","text-anchor","text-autospace","-moz-text-blink","-ms-text-combine-horizontal","text-combine-upright","-webkit-text-combine","text-decoration","text-decoration-blink","text-decoration-color","-moz-text-decoration-color","-webkit-text-decoration-color","text-decoration-line","-moz-text-decoration-line","text-decoration-line-through","-webkit-text-decoration-line","text-decoration-none","text-decoration-overline","text-decoration-skip","text-decoration-skip-box","text-decoration-skip-ink","text-decoration-skip-inset","text-decoration-skip-self","text-decoration-skip-spaces","-webkit-text-decoration-skip","text-decoration-style","-moz-text-decoration-style","-webkit-text-decoration-style","text-decoration-thickness","text-decoration-underline","-webkit-text-decoration","text-decoration-width","-webkit-text-decorations-in-effect","text-emphasis","text-emphasis-color","-webkit-text-emphasis-color","text-emphasis-position","-webkit-text-emphasis-position","text-emphasis-skip","text-emphasis-style","-webkit-text-emphasis-style","-webkit-text-emphasis","-webkit-text-fill-color","text-group-align","text-indent","text-justify","text-justify-trim","text-kashida","text-kashida-space","text-line-through","text-line-through-color","text-line-through-mode","text-line-through-style","text-line-through-width","text-orientation","-webkit-text-orientation","text-overflow","text-overline","text-overline-color","text-overline-mode","text-overline-style","text-overline-width","text-rendering","-webkit-text-security","text-shadow","text-size-adjust","-moz-text-size-adjust","-ms-text-size-adjust","-webkit-text-size-adjust","text-space-collapse","text-space-trim","text-spacing","-webkit-text-stroke-color","-webkit-text-stroke","-webkit-text-stroke-width","text-transform","text-underline","text-underline-color","text-underline-mode","text-underline-offset","text-underline-position","-webkit-text-underline-position","text-underline-style","text-underline-width","text-wrap","-webkit-text-zoom","top","touch-action","touch-action-delay","-ms-touch-action","-webkit-touch-callout","-ms-touch-select","transform","transform-box","-moz-transform","-ms-transform","-o-transform","transform-origin","-moz-transform-origin","-ms-transform-origin","-o-transform-origin","-webkit-transform-origin","transform-origin-x","-webkit-transform-origin-x","transform-origin-y","-webkit-transform-origin-y","transform-origin-z","-webkit-transform-origin-z","transform-style","-moz-transform-style","-ms-transform-style","-webkit-transform-style","-webkit-transform","transition","transition-delay","-moz-transition-delay","-ms-transition-delay","-o-transition-delay","-webkit-transition-delay","transition-duration","-moz-transition-duration","-ms-transition-duration","-o-transition-duration","-webkit-transition-duration","-moz-transition","-ms-transition","-o-transition","transition-property","-moz-transition-property","-ms-transition-property","-o-transition-property","-webkit-transition-property","transition-timing-function","-moz-transition-timing-function","-ms-transition-timing-function","-o-transition-timing-function","-webkit-transition-timing-function","-webkit-transition","translate","uc-alt-skin","uc-skin","unicode-bidi","unicode-range","-webkit-user-drag","-moz-user-focus","-moz-user-input","-moz-user-modify","-webkit-user-modify","user-select","-moz-user-select","-ms-user-select","-webkit-user-select","user-zoom","vector-effect","vertical-align","viewport-fill","viewport-fill-opacity","viewport-fit","visibility","voice-family","volume","white-space","-webkit-widget-region","widows","width","will-change","-moz-window-dragging","-moz-window-shadow","word-boundary-detection","word-boundary-expansion","word-break","word-spacing","word-wrap","wrap-after","wrap-before","wrap-flow","-ms-wrap-flow","-webkit-wrap-flow","wrap-inside","-ms-wrap-margin","-webkit-wrap-margin","-webkit-wrap-padding","-webkit-wrap-shape-inside","-webkit-wrap-shape-outside","wrap-through","-ms-wrap-through","-webkit-wrap-through","-webkit-wrap","writing-mode","-webkit-writing-mode","x","y","z-index","zoom"],Mu={w:"width",minW:"minWidth",maxW:"maxWidth",h:"height",minH:"minHeight",maxH:"maxHeight",bgImg:"backgroundImage",bgSize:"backgroundSize",bgPos:"backgroundPosition",bgRepeat:"backgroundRepeat",pos:"position",flexDir:"flexDirection",dir:"flexDirection",direction:"flexDirection",align:"alignItems",justify:"justifyContent",wrap:"flexWrap",shadow:"boxShadow",templateColumns:"gridTemplateColumns",gap:"gridGap",rowGap:"gridRowGap",columnGap:"gridColumnGap",autoFlow:"gridAutoFlow",autoRows:"gridAutoRows",autoColumns:"gridAutoColumns",templateRows:"gridTemplateRows",templateAreas:"gridTemplateAreas",area:"gridArea",column:"gridColumn",row:"gridRow"};Mu.bgAttachment=Mu.backgroundAttachment;Mu.textDecor=Mu.textDecoration;Mu.listStylePos=Mu.listStylePosition;Mu.listStyleImg=Mu.listStyleImage;var mD=["textStyle","buttonStyle","colorStyle"],gD="&:hover",yD="&:active, &[data-active=true]",wD="&:focus",bD="&:visited",SD="&:nth-of-type(even)",vD="&:nth-of-type(odd)",xD="&:disabled, &:disabled:focus, &:disabled:hover, &[aria-disabled=true], &[aria-disabled=true]:focus, &[aria-disabled=true]:hover",_D="&[aria-checked=true]",kD="&[aria-checked=mixed]",RD="&[aria-selected=true]",TD="&[aria-invalid=true]",OD="&[aria-pressed=true]",ND="&[aria-readonly=true], &[readonly]",CD="&:first-of-type",ED="&:last-of-type",AD="&[aria-expanded=true]",FD="&[aria-grabbed=true]",ID="&:not(:first-of-type)",PD="&:not(:last-of-type)",MD="[role=group]:hover &",LD=[].concat(mD,pD.map(function(e){return hD(e)}),Object.keys(Gx),Object.keys(Kx),Object.keys(Mu)),BD=function(t){var n,r=t._after,i=t._focus,o=t._selected,a=t._focusWithin,u=t._hover,l=t._invalid,f=t._active,p=t._disabled,m=t._grabbed,y=t._pressed,w=t._expanded,b=t._visited,x=t._before,_=t._readOnly,O=t._first,N=t._notFirst,E=t._notLast,T=t._last,B=t._placeholder,A=t._checked,U=t._groupHover,v=t._mixed,R=t._odd,C=t._even,M=t.css,J=t.sx,P=oD(t,["_after","_focus","_selected","_focusWithin","_hover","_invalid","_active","_disabled","_grabbed","_pressed","_expanded","_visited","_before","_readOnly","_first","_notFirst","_notLast","_last","_placeholder","_checked","_groupHover","_mixed","_odd","_even","css","sx"]),D={},q=(n={},n[gD]=u,n[wD]=i,n[yD]=f,n[bD]=b,n[xD]=p,n[RD]=o,n[TD]=l,n[AD]=w,n[FD]=m,n[ND]=_,n[CD]=O,n[ID]=N,n[PD]=E,n[ED]=T,n[vD]=R,n[SD]=C,n[kD]=v,n[_D]=A,n[OD]=y,n[MD]=U,n["&:before"]=x,n["&:after"]=r,n["&:focus-within"]=a,n["&::placeholder"]=B,n),K=El({},P),Q=$.useCallback(function(I){return LD.find(function(te){return te===I})},[]),H=Object.keys(P);H.forEach(function(I){Q(I)&&(D[I]=P[I],delete K[I])});var X=function(te){var ge=Xy(D)(te)||{},oe=Xy(q)(te)||{},be=Xy(M)(te)||{},ke=Xy(J)(te)||{},Ne=El({},ge,oe,be,ke);return Ne};return[X,K]};/* object-assign (c) Sindre Sorhus @license MIT -*/var vv,K2;function jD(){if(K2)return vv;K2=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},u=0;u<10;u++)a["_"+String.fromCharCode(u)]=u;var l=Object.getOwnPropertyNames(a).map(function(p){return a[p]});if(l.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(p){f[p]=p}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return vv=i()?Object.assign:function(o,a){for(var u,l=r(o),f,p=1;p0)throw new Error("Invalid string. Length must be a multiple of 4");var x=w.indexOf("=");x===-1&&(x=b);var k=x===b?0:4-x%4;return[x,k]}function u(w){var b=a(w),x=b[0],k=b[1];return(x+k)*3/4-k}function l(w,b,x){return(b+x)*3/4-x}function f(w){var b,x=a(w),k=x[0],O=x[1],N=new n(l(w,k,O)),E=0,T=O>0?k-4:k,B;for(B=0;B>16&255,N[E++]=b>>8&255,N[E++]=b&255;return O===2&&(b=t[w.charCodeAt(B)]<<2|t[w.charCodeAt(B+1)]>>4,N[E++]=b&255),O===1&&(b=t[w.charCodeAt(B)]<<10|t[w.charCodeAt(B+1)]<<4|t[w.charCodeAt(B+2)]>>2,N[E++]=b>>8&255,N[E++]=b&255),N}function p(w){return e[w>>18&63]+e[w>>12&63]+e[w>>6&63]+e[w&63]}function m(w,b,x){for(var k,O=[],N=b;NT?T:E+N));return k===1?(b=w[x-1],O.push(e[b>>2]+e[b<<4&63]+"==")):k===2&&(b=(w[x-2]<<8)+w[x-1],O.push(e[b>>10]+e[b>>4&63]+e[b<<2&63]+"=")),O.join("")}return em}const eJ={},f4=Object.freeze(Object.defineProperty({__proto__:null,default:eJ},Symbol.toStringTag,{value:"Module"})),h4=n_(f4);var p_=Gr(function(e,t){return $.createElement(fe,ln({display:"grid",ref:t},e))}),tJ=Gr(function(e,t){return $.createElement(fe,ln({border:0,height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute",clip:"rect(0px, 0px, 0px, 0px)",ref:t},e))});function p4(){var e=wf([` +*/var vv,K2;function jD(){if(K2)return vv;K2=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},u=0;u<10;u++)a["_"+String.fromCharCode(u)]=u;var l=Object.getOwnPropertyNames(a).map(function(p){return a[p]});if(l.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(p){f[p]=p}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return vv=i()?Object.assign:function(o,a){for(var u,l=r(o),f,p=1;p0)throw new Error("Invalid string. Length must be a multiple of 4");var x=w.indexOf("=");x===-1&&(x=b);var _=x===b?0:4-x%4;return[x,_]}function u(w){var b=a(w),x=b[0],_=b[1];return(x+_)*3/4-_}function l(w,b,x){return(b+x)*3/4-x}function f(w){var b,x=a(w),_=x[0],O=x[1],N=new n(l(w,_,O)),E=0,T=O>0?_-4:_,B;for(B=0;B>16&255,N[E++]=b>>8&255,N[E++]=b&255;return O===2&&(b=t[w.charCodeAt(B)]<<2|t[w.charCodeAt(B+1)]>>4,N[E++]=b&255),O===1&&(b=t[w.charCodeAt(B)]<<10|t[w.charCodeAt(B+1)]<<4|t[w.charCodeAt(B+2)]>>2,N[E++]=b>>8&255,N[E++]=b&255),N}function p(w){return e[w>>18&63]+e[w>>12&63]+e[w>>6&63]+e[w&63]}function m(w,b,x){for(var _,O=[],N=b;NT?T:E+N));return _===1?(b=w[x-1],O.push(e[b>>2]+e[b<<4&63]+"==")):_===2&&(b=(w[x-2]<<8)+w[x-1],O.push(e[b>>10]+e[b>>4&63]+e[b<<2&63]+"=")),O.join("")}return em}const eJ={},f4=Object.freeze(Object.defineProperty({__proto__:null,default:eJ},Symbol.toStringTag,{value:"Module"})),h4=n_(f4);var p_=Gr(function(e,t){return $.createElement(fe,ln({display:"grid",ref:t},e))}),tJ=Gr(function(e,t){return $.createElement(fe,ln({border:0,height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute",clip:"rect(0px, 0px, 0px, 0px)",ref:t},e))});function p4(){var e=bf([` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } -`]);return p4=function(){return e},e}var Y2;(function(e){e.xs="xs",e.sm="sm",e.md="md",e.lg="lg",e.xl="xl"})(Y2||(Y2={}));var nJ=iD(p4()),rJ=function(t){switch(t){case"xs":return"0.75rem";case"sm":return"1rem";case"md":return"1.5rem";case"lg":return"2rem";case"xl":return"3rem";default:return t}},fs=Gr(function(e,t){var n=e.size,r=n===void 0?"md":n,i=e.label,o=i===void 0?"Loading...":i,a=e.thickness,u=a===void 0?"2px":a,l=e.speed,f=l===void 0?"0.85s":l,p=e.color,m=e.emptyColor,y=m===void 0?"transparent":m,w=$u(e,["size","label","thickness","speed","color","emptyColor"]),b=rJ(r);return z0(fe,ln({ref:t,display:"inline-block",borderWidth:u,borderColor:"currentColor",borderBottomColor:y,borderLeftColor:y,borderRadius:"100%",color:p,size:b,animation:nJ+" "+f+" linear infinite"},w),o&&z0(tJ,null,o))});fs.displayName="Spinner";function m4(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t{};let X2=new Map;function oJ(e,t){if(e===t)return e;let n=X2.get(e);if(n)return n(t),t;let r=X2.get(t);return r?(r(e),e):t}function sJ(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}function y4(...e){let t={...e[0]};for(let n=1;n=65&&i.charCodeAt(2)<=90?t[i]=sJ(o,a):(i==="className"||i==="UNSAFE_className")&&typeof o=="string"&&typeof a=="string"?t[i]=iJ(o,a):i==="id"&&o&&a?t.id=oJ(o,a):t[i]=a!==void 0?a:o}}return t}function e0(e){if(aJ())e.focus({preventScroll:!0});else{let t=cJ(e);e.focus(),uJ(t)}}let t0=null;function aJ(){if(t0==null){t0=!1;try{var e=document.createElement("div");e.focus({get preventScroll(){return t0=!0,!0}})}catch{}}return t0}function cJ(e){for(var t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;t instanceof HTMLElement&&t!==r;)(t.offsetHeight"u")return;let e=n=>{let r=ch.get(n.target);r||(r=new Set,ch.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{let r=ch.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),ch.delete(n.target)),ch.size===0)){for(let i of Qx)i();Qx.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Z2():document.addEventListener("DOMContentLoaded",Z2));function lJ(e){requestAnimationFrame(()=>{ch.size===0?e():Qx.add(e)})}function dJ(){let e=$.useRef(new Map),t=$.useCallback((i,o,a,u)=>{let l=u!=null&&u.once?(...f)=>{e.current.delete(a),a(...f)}:a;e.current.set(a,{type:o,eventTarget:i,fn:l,options:u}),i.addEventListener(o,a,u)},[]),n=$.useCallback((i,o,a,u)=>{var l;let f=((l=e.current.get(a))===null||l===void 0?void 0:l.fn)||a;i.removeEventListener(o,f,u),e.current.delete(a)},[]),r=$.useCallback(()=>{e.current.forEach((i,o)=>{n(i.eventTarget,i.type,o,i.options)})},[n]);return $.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function fJ(e,t){g4(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref.current=null}},[e,t])}function hJ(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function m_(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function w4(){return m_(/^Mac/i)}function pJ(){return m_(/^iPhone/i)}function mJ(){return m_(/^iPad/i)||w4()&&navigator.maxTouchPoints>1}function b4(){return pJ()||mJ()}function gJ(){return hJ(/Android/i)}function tm(e){const t=$.useRef(null);return g4(()=>{t.current=e},[e]),$.useCallback((...n)=>{const r=t.current;return r(...n)},[])}function Yx(e){return e.mozInputSource===0&&e.isTrusted?!0:gJ()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function yJ(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}let gh="default",Xx="",P0=new WeakMap;function eO(e){b4()?(gh==="default"&&(Xx=document.documentElement.style.webkitUserSelect,document.documentElement.style.webkitUserSelect="none"),gh="disabled"):(e instanceof HTMLElement||e instanceof SVGElement)&&(P0.set(e,e.style.userSelect),e.style.userSelect="none")}function n0(e){if(b4()){if(gh!=="disabled")return;gh="restoring",setTimeout(()=>{lJ(()=>{gh==="restoring"&&(document.documentElement.style.webkitUserSelect==="none"&&(document.documentElement.style.webkitUserSelect=Xx||""),Xx="",gh="default")})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&P0.has(e)){let t=P0.get(e);e.style.userSelect==="none"&&(e.style.userSelect=t),e.getAttribute("style")===""&&e.removeAttribute("style"),P0.delete(e)}}const S4=lt.createContext(null);S4.displayName="PressResponderContext";function wJ(e){let t=$.useContext(S4);if(t){let{register:n,...r}=t;e=y4(r,e),n()}return fJ(t,e.ref),e}function bJ(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:o,isDisabled:a,isPressed:u,preventFocusOnPress:l,shouldCancelOnPointerExit:f,allowTextSelectionOnPress:p,ref:m,...y}=wJ(e),[w,b]=$.useState(!1),x=$.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:k,removeAllGlobalListeners:O}=dJ(),N=tm((v,R)=>{let C=x.current;a||C.didFirePressStart||(r&&r({type:"pressstart",pointerType:R,target:v.currentTarget,shiftKey:v.shiftKey,metaKey:v.metaKey,ctrlKey:v.ctrlKey,altKey:v.altKey}),n&&n(!0),C.didFirePressStart=!0,b(!0))}),E=tm((v,R,C=!0)=>{let M=x.current;M.didFirePressStart&&(M.ignoreClickAfterPress=!0,M.didFirePressStart=!1,i&&i({type:"pressend",pointerType:R,target:v.currentTarget,shiftKey:v.shiftKey,metaKey:v.metaKey,ctrlKey:v.ctrlKey,altKey:v.altKey}),n&&n(!1),b(!1),t&&C&&!a&&t({type:"press",pointerType:R,target:v.currentTarget,shiftKey:v.shiftKey,metaKey:v.metaKey,ctrlKey:v.ctrlKey,altKey:v.altKey}))}),T=tm((v,R)=>{a||o&&o({type:"pressup",pointerType:R,target:v.currentTarget,shiftKey:v.shiftKey,metaKey:v.metaKey,ctrlKey:v.ctrlKey,altKey:v.altKey})}),B=tm(v=>{let R=x.current;R.isPressed&&(R.isOverTarget&&E(Fs(R.target,v),R.pointerType,!1),R.isPressed=!1,R.isOverTarget=!1,R.activePointerId=null,R.pointerType=null,O(),p||n0(R.target))}),A=tm(v=>{f&&B(v)}),U=$.useMemo(()=>{let v=x.current,R={onKeyDown(M){xv(M.nativeEvent,M.currentTarget)&&M.currentTarget.contains(M.target)?(nO(M.target,M.key)&&M.preventDefault(),M.stopPropagation(),!v.isPressed&&!M.repeat&&(v.target=M.currentTarget,v.isPressed=!0,N(M,"keyboard"),k(document,"keyup",C,!1))):M.key==="Enter"&&Zx(M.currentTarget)&&M.stopPropagation()},onKeyUp(M){xv(M.nativeEvent,M.currentTarget)&&!M.repeat&&M.currentTarget.contains(M.target)&&T(Fs(v.target,M),"keyboard")},onClick(M){M&&!M.currentTarget.contains(M.target)||M&&M.button===0&&(M.stopPropagation(),a&&M.preventDefault(),!v.ignoreClickAfterPress&&!v.ignoreEmulatedMouseEvents&&(v.pointerType==="virtual"||Yx(M.nativeEvent))&&(!a&&!l&&e0(M.currentTarget),N(M,"virtual"),T(M,"virtual"),E(M,"virtual")),v.ignoreEmulatedMouseEvents=!1,v.ignoreClickAfterPress=!1)}},C=M=>{if(v.isPressed&&xv(M,v.target)){nO(M.target,M.key)&&M.preventDefault(),M.stopPropagation(),v.isPressed=!1;let J=M.target;E(Fs(v.target,M),"keyboard",v.target.contains(J)),O(),v.target instanceof HTMLElement&&v.target.contains(J)&&(Zx(v.target)||v.target.getAttribute("role")==="link")&&v.target.click()}};if(typeof PointerEvent<"u"){R.onPointerDown=D=>{if(!(D.button!==0||!D.currentTarget.contains(D.target))){if(yJ(D.nativeEvent)){v.pointerType="virtual";return}_v(D.currentTarget)&&D.preventDefault(),v.pointerType=D.pointerType,D.stopPropagation(),v.isPressed||(v.isPressed=!0,v.isOverTarget=!0,v.activePointerId=D.pointerId,v.target=D.currentTarget,!a&&!l&&e0(D.currentTarget),p||eO(v.target),N(D,v.pointerType),k(document,"pointermove",M,!1),k(document,"pointerup",J,!1),k(document,"pointercancel",P,!1))}},R.onMouseDown=D=>{D.currentTarget.contains(D.target)&&D.button===0&&(_v(D.currentTarget)&&D.preventDefault(),D.stopPropagation())},R.onPointerUp=D=>{!D.currentTarget.contains(D.target)||v.pointerType==="virtual"||D.button===0&&nh(D,D.currentTarget)&&T(D,v.pointerType||D.pointerType)};let M=D=>{D.pointerId===v.activePointerId&&(nh(D,v.target)?v.isOverTarget||(v.isOverTarget=!0,N(Fs(v.target,D),v.pointerType)):v.isOverTarget&&(v.isOverTarget=!1,E(Fs(v.target,D),v.pointerType,!1),A(D)))},J=D=>{D.pointerId===v.activePointerId&&v.isPressed&&D.button===0&&(nh(D,v.target)?E(Fs(v.target,D),v.pointerType):v.isOverTarget&&E(Fs(v.target,D),v.pointerType,!1),v.isPressed=!1,v.isOverTarget=!1,v.activePointerId=null,v.pointerType=null,O(),p||n0(v.target))},P=D=>{B(D)};R.onDragStart=D=>{D.currentTarget.contains(D.target)&&B(D)}}else{R.onMouseDown=P=>{P.button!==0||!P.currentTarget.contains(P.target)||(_v(P.currentTarget)&&P.preventDefault(),P.stopPropagation(),!v.ignoreEmulatedMouseEvents&&(v.isPressed=!0,v.isOverTarget=!0,v.target=P.currentTarget,v.pointerType=Yx(P.nativeEvent)?"virtual":"mouse",!a&&!l&&e0(P.currentTarget),N(P,v.pointerType),k(document,"mouseup",M,!1)))},R.onMouseEnter=P=>{P.currentTarget.contains(P.target)&&(P.stopPropagation(),v.isPressed&&!v.ignoreEmulatedMouseEvents&&(v.isOverTarget=!0,N(P,v.pointerType)))},R.onMouseLeave=P=>{P.currentTarget.contains(P.target)&&(P.stopPropagation(),v.isPressed&&!v.ignoreEmulatedMouseEvents&&(v.isOverTarget=!1,E(P,v.pointerType,!1),A(P)))},R.onMouseUp=P=>{P.currentTarget.contains(P.target)&&!v.ignoreEmulatedMouseEvents&&P.button===0&&T(P,v.pointerType)};let M=P=>{if(P.button===0){if(v.isPressed=!1,O(),v.ignoreEmulatedMouseEvents){v.ignoreEmulatedMouseEvents=!1;return}nh(P,v.target)?E(Fs(v.target,P),v.pointerType):v.isOverTarget&&E(Fs(v.target,P),v.pointerType,!1),v.isOverTarget=!1}};R.onTouchStart=P=>{if(!P.currentTarget.contains(P.target))return;P.stopPropagation();let D=SJ(P.nativeEvent);D&&(v.activePointerId=D.identifier,v.ignoreEmulatedMouseEvents=!0,v.isOverTarget=!0,v.isPressed=!0,v.target=P.currentTarget,v.pointerType="touch",!a&&!l&&e0(P.currentTarget),p||eO(v.target),N(P,v.pointerType),k(window,"scroll",J,!0))},R.onTouchMove=P=>{if(!P.currentTarget.contains(P.target)||(P.stopPropagation(),!v.isPressed))return;let D=tO(P.nativeEvent,v.activePointerId);D&&nh(D,P.currentTarget)?v.isOverTarget||(v.isOverTarget=!0,N(P,v.pointerType)):v.isOverTarget&&(v.isOverTarget=!1,E(P,v.pointerType,!1),A(P))},R.onTouchEnd=P=>{if(!P.currentTarget.contains(P.target)||(P.stopPropagation(),!v.isPressed))return;let D=tO(P.nativeEvent,v.activePointerId);D&&nh(D,P.currentTarget)?(T(P,v.pointerType),E(P,v.pointerType)):v.isOverTarget&&E(P,v.pointerType,!1),v.isPressed=!1,v.activePointerId=null,v.isOverTarget=!1,v.ignoreEmulatedMouseEvents=!0,p||n0(v.target),O()},R.onTouchCancel=P=>{P.currentTarget.contains(P.target)&&(P.stopPropagation(),v.isPressed&&B(P))};let J=P=>{v.isPressed&&P.target.contains(v.target)&&B({currentTarget:v.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};R.onDragStart=P=>{P.currentTarget.contains(P.target)&&B(P)}}return R},[k,a,l,O,p,B,A,E,N,T]);return $.useEffect(()=>()=>{p||n0(x.current.target)},[p]),{isPressed:u||w,pressProps:y4(y,U)}}function Zx(e){return e.tagName==="A"&&e.hasAttribute("href")}function xv(e,t){const{key:n,code:r}=e,i=t,o=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof HTMLInputElement&&!v4(i,n)||i instanceof HTMLTextAreaElement||i.isContentEditable)&&(!Zx(i)||o==="button"&&n!=="Enter")&&!(o==="link"&&n!=="Enter")}function SJ(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function tO(e,t){const n=e.changedTouches;for(let r=0;rt.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function nh(e,t){let n=t.getBoundingClientRect(),r=vJ(e);return xJ(n,r)}function _v(e){return!(e instanceof HTMLElement)||!e.draggable}function nO(e,t){return e instanceof HTMLInputElement?!v4(e,t):e instanceof HTMLButtonElement?e.type!=="submit":!0}const _J=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function v4(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":_J.has(e.type)}let kJ=new Set,rO=!1,lf=!1,e1=!1;function g_(e,t){for(let n of kJ)n(e,t)}function RJ(e){return!(e.metaKey||!w4()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function iO(e){lf=!0,RJ(e)&&g_("keyboard",e)}function rh(e){(e.type==="mousedown"||e.type==="pointerdown")&&(lf=!0,g_("pointer",e))}function TJ(e){Yx(e)&&(lf=!0)}function OJ(e){e.target===window||e.target===document||(!lf&&!e1&&g_("virtual",e),lf=!1,e1=!1)}function NJ(){lf=!1,e1=!0}function oO(){if(typeof window>"u"||rO)return;let e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){lf=!0,e.apply(this,arguments)},document.addEventListener("keydown",iO,!0),document.addEventListener("keyup",iO,!0),document.addEventListener("click",TJ,!0),window.addEventListener("focus",OJ,!0),window.addEventListener("blur",NJ,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",rh,!0),document.addEventListener("pointermove",rh,!0),document.addEventListener("pointerup",rh,!0)):(document.addEventListener("mousedown",rh,!0),document.addEventListener("mousemove",rh,!0),document.addEventListener("mouseup",rh,!0)),rO=!0}typeof document<"u"&&(document.readyState!=="loading"?oO():document.addEventListener("DOMContentLoaded",oO));var CJ=PI(),bd=function(t,n){return t===void 0&&(t=1),n===void 0&&(n=!1),"rgba("+(n?"70,55,255":"85,70,255")+","+t+")"},kv=function(t){return t===void 0&&(t=1),"rgba(170, 179, 255,"+t+")"},EJ=function(t,n){if(n===void 0&&(n="solid"),n==="solid")switch(t){case"secondary":return function(r){var i=r.isPressed,o=r.isDisabled,a=r._hover;return{bg:bd(.2,i),border:"1px solid",borderRadius:"6px",color:ce("invert"),borderColor:bd(0),_hover:ln({bg:bd(.25,!0),cursor:o?"not-allowed":"pointer"},a),_focus:{boxShadow:"0 0 0 3px "+kv(.5)}}};case"tertiary":return function(r){var i=r.isPressed,o=r.isDisabled,a=r._hover;return{border:"1px solid",borderRadius:"6px",color:ce("invert"),bg:ce(i?"bg":"bg-2"),borderColor:ce("border"),boxShadow:"mid",_hover:ln({bg:ce("bg-3"),boxShadow:"high",cursor:o?"not-allowed":"pointer"},a),_focus:{boxShadow:"0 0 0 3px "+kv(.5)}}};default:return function(r){var i=r.isPressed,o=r.isDisabled,a=r._hover;return{border:"1px solid",borderRadius:"6px",bg:bd(1,i),color:"white",borderColor:bd(0),_hover:ln({bg:bd(1,!0),cursor:o?"not-allowed":"pointer"},a),_focus:{boxShadow:"0 0 0 3px "+kv(.75)}}}}else return function(r){var i=r._hover,o=r.isPressed,a=r.isDisabled;return{color:bd(1,o),textDecoration:"none",_hover:ln({textDecoration:"underline",cursor:a?"not-allowed":"pointer"},i)}}},AJ=function(t){switch(t){case"sm":return{px:"tight",py:"extra-tight",fontSize:"12px"};case"md":return{px:"base",py:"base-tight",fontSize:"14px"};case"lg":return{px:"base-loose",py:"base",fontSize:"14px"}}},St=Gr(function(e,t){var n=e.children,r=e.as,i=r===void 0?"button":r,o=e.onClick,a=e.mode,u=a===void 0?"primary":a,l=e.variant,f=l===void 0?"solid":l,p=e.isLoading,m=e.isDisabled,y=e.size,w=y===void 0?"md":y,b=e._hover,x=$u(e,["children","as","onClick","mode","variant","isLoading","isDisabled","size","_hover"]),k=bJ({ref:t,onPress:function(R){o==null||o(R)}}),O=k.pressProps,N=k.isPressed,E=O.onKeyUp,T=O.onKeyDown,B=f==="link"?{}:AJ(w),A=EJ(u,f),U=A({isPressed:N,_hover:b,isDisabled:m});return $.createElement(fe,ln({as:i,outline:"none",fontWeight:"500",transition:Pu,userSelect:"none",ref:t,onKeyUp:E,onKeyDown:T,position:"relative",pointerEvents:p||m?"none":"unset",onClick:function(R){o==null||o(R)},opacity:m?.4:1,alignItems:"center",justifyContent:"center"},U,B,x,{display:x.display||"inline-flex"}),$.createElement(p_,{transition:Pu,opacity:p?1:0,zIndex:2,position:"absolute",top:0,left:0,size:"100%",placeItems:"center"},$.createElement(fs,{size:"sm",color:"currentColor"})),$.createElement(xe,{transition:"opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1)",as:"span",color:"currentColor",opacity:p?0:1,display:x.display||"inline-flex",alignItems:x.alignItems||"center",justifyContent:x.justifyContent||"center"},n))}),Jn,$n,x4={light:(Jn={},Jn[_t.Accent]="#5546FF",Jn[_t.Brand]="#5546FF",Jn[_t.Bg]="white",Jn[_t.Bg2]="white",Jn[_t.Bg3]="white",Jn[_t.Bg4]="#F7F7FA",Jn[_t.BgAlt]="#F7F7FA",Jn[_t.BgLight]="white",Jn[_t.Invert]="#040404",Jn[_t.TextHover]="#5546FF",Jn[_t.TextTitle]="#141416",Jn[_t.TextCaption]="#747478",Jn[_t.TextBody]="#424248",Jn[_t.Icon]="#9C9CA2",Jn[_t.InputPlaceholder]="#747478",Jn[_t.Border]="#F0F0F2",Jn[_t.FeedbackAlert]="#FE9000",Jn[_t.FeedbackError]="#CF0000",Jn[_t.FeedbackSuccess]="#00A200",Jn),dark:($n={},$n[_t.Accent]="#7F80FF",$n[_t.Brand]="#7F80FF",$n[_t.Bg]="#040404",$n[_t.Bg2]="#0A0A0A",$n[_t.Bg3]="#141416",$n[_t.Bg4]="#1E1E20",$n[_t.BgAlt]="#1E1E20",$n[_t.BgLight]="#1E1E20",$n[_t.Invert]="#ffffff",$n[_t.TextHover]="#7F80FF",$n[_t.TextTitle]="#ffffff",$n[_t.TextCaption]="#9C9CA2",$n[_t.TextBody]="#F7F7FA",$n[_t.Icon]="#9C9CA2",$n[_t.InputPlaceholder]="#9C9CA2",$n[_t.Border]="#202020",$n[_t.FeedbackAlert]="#FFB44D",$n[_t.FeedbackError]="#F34D4D",$n[_t.FeedbackSuccess]="#49CE49",$n)},FJ=function(t){return x4[t.colorMode]},IJ=function(t){return Object.keys(x4[t.colorMode])},W0=function(t){return function(n){var r=n.colorMode,i=r===void 0?t:r,o=$u(n,["colorMode"]);return IJ(ln({colorMode:i},o)).map(function(a){return"--colors-"+a+": "+FJ(ln({colorMode:i},o))[a]+";"})}},_4=void 0;try{_4=window}catch{}function PJ(e){var t;return(t=void 0)!=null?t:_4}function MJ(){var e=PJ();return!!(typeof e<"u"&&e.document&&e.document.createElement)}var LJ=MJ();function k4(){var e=wf([` +`]);return p4=function(){return e},e}var Y2;(function(e){e.xs="xs",e.sm="sm",e.md="md",e.lg="lg",e.xl="xl"})(Y2||(Y2={}));var nJ=iD(p4()),rJ=function(t){switch(t){case"xs":return"0.75rem";case"sm":return"1rem";case"md":return"1.5rem";case"lg":return"2rem";case"xl":return"3rem";default:return t}},fs=Gr(function(e,t){var n=e.size,r=n===void 0?"md":n,i=e.label,o=i===void 0?"Loading...":i,a=e.thickness,u=a===void 0?"2px":a,l=e.speed,f=l===void 0?"0.85s":l,p=e.color,m=e.emptyColor,y=m===void 0?"transparent":m,w=qu(e,["size","label","thickness","speed","color","emptyColor"]),b=rJ(r);return z0(fe,ln({ref:t,display:"inline-block",borderWidth:u,borderColor:"currentColor",borderBottomColor:y,borderLeftColor:y,borderRadius:"100%",color:p,size:b,animation:nJ+" "+f+" linear infinite"},w),o&&z0(tJ,null,o))});fs.displayName="Spinner";function m4(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t{};let X2=new Map;function oJ(e,t){if(e===t)return e;let n=X2.get(e);if(n)return n(t),t;let r=X2.get(t);return r?(r(e),e):t}function sJ(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}function y4(...e){let t={...e[0]};for(let n=1;n=65&&i.charCodeAt(2)<=90?t[i]=sJ(o,a):(i==="className"||i==="UNSAFE_className")&&typeof o=="string"&&typeof a=="string"?t[i]=iJ(o,a):i==="id"&&o&&a?t.id=oJ(o,a):t[i]=a!==void 0?a:o}}return t}function e0(e){if(aJ())e.focus({preventScroll:!0});else{let t=cJ(e);e.focus(),uJ(t)}}let t0=null;function aJ(){if(t0==null){t0=!1;try{var e=document.createElement("div");e.focus({get preventScroll(){return t0=!0,!0}})}catch{}}return t0}function cJ(e){for(var t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;t instanceof HTMLElement&&t!==r;)(t.offsetHeight"u")return;let e=n=>{let r=uh.get(n.target);r||(r=new Set,uh.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{let r=uh.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),uh.delete(n.target)),uh.size===0)){for(let i of Qx)i();Qx.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Z2():document.addEventListener("DOMContentLoaded",Z2));function lJ(e){requestAnimationFrame(()=>{uh.size===0?e():Qx.add(e)})}function dJ(){let e=$.useRef(new Map),t=$.useCallback((i,o,a,u)=>{let l=u!=null&&u.once?(...f)=>{e.current.delete(a),a(...f)}:a;e.current.set(a,{type:o,eventTarget:i,fn:l,options:u}),i.addEventListener(o,a,u)},[]),n=$.useCallback((i,o,a,u)=>{var l;let f=((l=e.current.get(a))===null||l===void 0?void 0:l.fn)||a;i.removeEventListener(o,f,u),e.current.delete(a)},[]),r=$.useCallback(()=>{e.current.forEach((i,o)=>{n(i.eventTarget,i.type,o,i.options)})},[n]);return $.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function fJ(e,t){g4(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref.current=null}},[e,t])}function hJ(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function m_(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function w4(){return m_(/^Mac/i)}function pJ(){return m_(/^iPhone/i)}function mJ(){return m_(/^iPad/i)||w4()&&navigator.maxTouchPoints>1}function b4(){return pJ()||mJ()}function gJ(){return hJ(/Android/i)}function tm(e){const t=$.useRef(null);return g4(()=>{t.current=e},[e]),$.useCallback((...n)=>{const r=t.current;return r(...n)},[])}function Yx(e){return e.mozInputSource===0&&e.isTrusted?!0:gJ()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function yJ(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}let yh="default",Xx="",P0=new WeakMap;function eO(e){b4()?(yh==="default"&&(Xx=document.documentElement.style.webkitUserSelect,document.documentElement.style.webkitUserSelect="none"),yh="disabled"):(e instanceof HTMLElement||e instanceof SVGElement)&&(P0.set(e,e.style.userSelect),e.style.userSelect="none")}function n0(e){if(b4()){if(yh!=="disabled")return;yh="restoring",setTimeout(()=>{lJ(()=>{yh==="restoring"&&(document.documentElement.style.webkitUserSelect==="none"&&(document.documentElement.style.webkitUserSelect=Xx||""),Xx="",yh="default")})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&P0.has(e)){let t=P0.get(e);e.style.userSelect==="none"&&(e.style.userSelect=t),e.getAttribute("style")===""&&e.removeAttribute("style"),P0.delete(e)}}const S4=lt.createContext(null);S4.displayName="PressResponderContext";function wJ(e){let t=$.useContext(S4);if(t){let{register:n,...r}=t;e=y4(r,e),n()}return fJ(t,e.ref),e}function bJ(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:o,isDisabled:a,isPressed:u,preventFocusOnPress:l,shouldCancelOnPointerExit:f,allowTextSelectionOnPress:p,ref:m,...y}=wJ(e),[w,b]=$.useState(!1),x=$.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:_,removeAllGlobalListeners:O}=dJ(),N=tm((v,R)=>{let C=x.current;a||C.didFirePressStart||(r&&r({type:"pressstart",pointerType:R,target:v.currentTarget,shiftKey:v.shiftKey,metaKey:v.metaKey,ctrlKey:v.ctrlKey,altKey:v.altKey}),n&&n(!0),C.didFirePressStart=!0,b(!0))}),E=tm((v,R,C=!0)=>{let M=x.current;M.didFirePressStart&&(M.ignoreClickAfterPress=!0,M.didFirePressStart=!1,i&&i({type:"pressend",pointerType:R,target:v.currentTarget,shiftKey:v.shiftKey,metaKey:v.metaKey,ctrlKey:v.ctrlKey,altKey:v.altKey}),n&&n(!1),b(!1),t&&C&&!a&&t({type:"press",pointerType:R,target:v.currentTarget,shiftKey:v.shiftKey,metaKey:v.metaKey,ctrlKey:v.ctrlKey,altKey:v.altKey}))}),T=tm((v,R)=>{a||o&&o({type:"pressup",pointerType:R,target:v.currentTarget,shiftKey:v.shiftKey,metaKey:v.metaKey,ctrlKey:v.ctrlKey,altKey:v.altKey})}),B=tm(v=>{let R=x.current;R.isPressed&&(R.isOverTarget&&E(Fs(R.target,v),R.pointerType,!1),R.isPressed=!1,R.isOverTarget=!1,R.activePointerId=null,R.pointerType=null,O(),p||n0(R.target))}),A=tm(v=>{f&&B(v)}),U=$.useMemo(()=>{let v=x.current,R={onKeyDown(M){xv(M.nativeEvent,M.currentTarget)&&M.currentTarget.contains(M.target)?(nO(M.target,M.key)&&M.preventDefault(),M.stopPropagation(),!v.isPressed&&!M.repeat&&(v.target=M.currentTarget,v.isPressed=!0,N(M,"keyboard"),_(document,"keyup",C,!1))):M.key==="Enter"&&Zx(M.currentTarget)&&M.stopPropagation()},onKeyUp(M){xv(M.nativeEvent,M.currentTarget)&&!M.repeat&&M.currentTarget.contains(M.target)&&T(Fs(v.target,M),"keyboard")},onClick(M){M&&!M.currentTarget.contains(M.target)||M&&M.button===0&&(M.stopPropagation(),a&&M.preventDefault(),!v.ignoreClickAfterPress&&!v.ignoreEmulatedMouseEvents&&(v.pointerType==="virtual"||Yx(M.nativeEvent))&&(!a&&!l&&e0(M.currentTarget),N(M,"virtual"),T(M,"virtual"),E(M,"virtual")),v.ignoreEmulatedMouseEvents=!1,v.ignoreClickAfterPress=!1)}},C=M=>{if(v.isPressed&&xv(M,v.target)){nO(M.target,M.key)&&M.preventDefault(),M.stopPropagation(),v.isPressed=!1;let J=M.target;E(Fs(v.target,M),"keyboard",v.target.contains(J)),O(),v.target instanceof HTMLElement&&v.target.contains(J)&&(Zx(v.target)||v.target.getAttribute("role")==="link")&&v.target.click()}};if(typeof PointerEvent<"u"){R.onPointerDown=D=>{if(!(D.button!==0||!D.currentTarget.contains(D.target))){if(yJ(D.nativeEvent)){v.pointerType="virtual";return}_v(D.currentTarget)&&D.preventDefault(),v.pointerType=D.pointerType,D.stopPropagation(),v.isPressed||(v.isPressed=!0,v.isOverTarget=!0,v.activePointerId=D.pointerId,v.target=D.currentTarget,!a&&!l&&e0(D.currentTarget),p||eO(v.target),N(D,v.pointerType),_(document,"pointermove",M,!1),_(document,"pointerup",J,!1),_(document,"pointercancel",P,!1))}},R.onMouseDown=D=>{D.currentTarget.contains(D.target)&&D.button===0&&(_v(D.currentTarget)&&D.preventDefault(),D.stopPropagation())},R.onPointerUp=D=>{!D.currentTarget.contains(D.target)||v.pointerType==="virtual"||D.button===0&&rh(D,D.currentTarget)&&T(D,v.pointerType||D.pointerType)};let M=D=>{D.pointerId===v.activePointerId&&(rh(D,v.target)?v.isOverTarget||(v.isOverTarget=!0,N(Fs(v.target,D),v.pointerType)):v.isOverTarget&&(v.isOverTarget=!1,E(Fs(v.target,D),v.pointerType,!1),A(D)))},J=D=>{D.pointerId===v.activePointerId&&v.isPressed&&D.button===0&&(rh(D,v.target)?E(Fs(v.target,D),v.pointerType):v.isOverTarget&&E(Fs(v.target,D),v.pointerType,!1),v.isPressed=!1,v.isOverTarget=!1,v.activePointerId=null,v.pointerType=null,O(),p||n0(v.target))},P=D=>{B(D)};R.onDragStart=D=>{D.currentTarget.contains(D.target)&&B(D)}}else{R.onMouseDown=P=>{P.button!==0||!P.currentTarget.contains(P.target)||(_v(P.currentTarget)&&P.preventDefault(),P.stopPropagation(),!v.ignoreEmulatedMouseEvents&&(v.isPressed=!0,v.isOverTarget=!0,v.target=P.currentTarget,v.pointerType=Yx(P.nativeEvent)?"virtual":"mouse",!a&&!l&&e0(P.currentTarget),N(P,v.pointerType),_(document,"mouseup",M,!1)))},R.onMouseEnter=P=>{P.currentTarget.contains(P.target)&&(P.stopPropagation(),v.isPressed&&!v.ignoreEmulatedMouseEvents&&(v.isOverTarget=!0,N(P,v.pointerType)))},R.onMouseLeave=P=>{P.currentTarget.contains(P.target)&&(P.stopPropagation(),v.isPressed&&!v.ignoreEmulatedMouseEvents&&(v.isOverTarget=!1,E(P,v.pointerType,!1),A(P)))},R.onMouseUp=P=>{P.currentTarget.contains(P.target)&&!v.ignoreEmulatedMouseEvents&&P.button===0&&T(P,v.pointerType)};let M=P=>{if(P.button===0){if(v.isPressed=!1,O(),v.ignoreEmulatedMouseEvents){v.ignoreEmulatedMouseEvents=!1;return}rh(P,v.target)?E(Fs(v.target,P),v.pointerType):v.isOverTarget&&E(Fs(v.target,P),v.pointerType,!1),v.isOverTarget=!1}};R.onTouchStart=P=>{if(!P.currentTarget.contains(P.target))return;P.stopPropagation();let D=SJ(P.nativeEvent);D&&(v.activePointerId=D.identifier,v.ignoreEmulatedMouseEvents=!0,v.isOverTarget=!0,v.isPressed=!0,v.target=P.currentTarget,v.pointerType="touch",!a&&!l&&e0(P.currentTarget),p||eO(v.target),N(P,v.pointerType),_(window,"scroll",J,!0))},R.onTouchMove=P=>{if(!P.currentTarget.contains(P.target)||(P.stopPropagation(),!v.isPressed))return;let D=tO(P.nativeEvent,v.activePointerId);D&&rh(D,P.currentTarget)?v.isOverTarget||(v.isOverTarget=!0,N(P,v.pointerType)):v.isOverTarget&&(v.isOverTarget=!1,E(P,v.pointerType,!1),A(P))},R.onTouchEnd=P=>{if(!P.currentTarget.contains(P.target)||(P.stopPropagation(),!v.isPressed))return;let D=tO(P.nativeEvent,v.activePointerId);D&&rh(D,P.currentTarget)?(T(P,v.pointerType),E(P,v.pointerType)):v.isOverTarget&&E(P,v.pointerType,!1),v.isPressed=!1,v.activePointerId=null,v.isOverTarget=!1,v.ignoreEmulatedMouseEvents=!0,p||n0(v.target),O()},R.onTouchCancel=P=>{P.currentTarget.contains(P.target)&&(P.stopPropagation(),v.isPressed&&B(P))};let J=P=>{v.isPressed&&P.target.contains(v.target)&&B({currentTarget:v.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};R.onDragStart=P=>{P.currentTarget.contains(P.target)&&B(P)}}return R},[_,a,l,O,p,B,A,E,N,T]);return $.useEffect(()=>()=>{p||n0(x.current.target)},[p]),{isPressed:u||w,pressProps:y4(y,U)}}function Zx(e){return e.tagName==="A"&&e.hasAttribute("href")}function xv(e,t){const{key:n,code:r}=e,i=t,o=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof HTMLInputElement&&!v4(i,n)||i instanceof HTMLTextAreaElement||i.isContentEditable)&&(!Zx(i)||o==="button"&&n!=="Enter")&&!(o==="link"&&n!=="Enter")}function SJ(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function tO(e,t){const n=e.changedTouches;for(let r=0;rt.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function rh(e,t){let n=t.getBoundingClientRect(),r=vJ(e);return xJ(n,r)}function _v(e){return!(e instanceof HTMLElement)||!e.draggable}function nO(e,t){return e instanceof HTMLInputElement?!v4(e,t):e instanceof HTMLButtonElement?e.type!=="submit":!0}const _J=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function v4(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":_J.has(e.type)}let kJ=new Set,rO=!1,df=!1,e1=!1;function g_(e,t){for(let n of kJ)n(e,t)}function RJ(e){return!(e.metaKey||!w4()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function iO(e){df=!0,RJ(e)&&g_("keyboard",e)}function ih(e){(e.type==="mousedown"||e.type==="pointerdown")&&(df=!0,g_("pointer",e))}function TJ(e){Yx(e)&&(df=!0)}function OJ(e){e.target===window||e.target===document||(!df&&!e1&&g_("virtual",e),df=!1,e1=!1)}function NJ(){df=!1,e1=!0}function oO(){if(typeof window>"u"||rO)return;let e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){df=!0,e.apply(this,arguments)},document.addEventListener("keydown",iO,!0),document.addEventListener("keyup",iO,!0),document.addEventListener("click",TJ,!0),window.addEventListener("focus",OJ,!0),window.addEventListener("blur",NJ,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",ih,!0),document.addEventListener("pointermove",ih,!0),document.addEventListener("pointerup",ih,!0)):(document.addEventListener("mousedown",ih,!0),document.addEventListener("mousemove",ih,!0),document.addEventListener("mouseup",ih,!0)),rO=!0}typeof document<"u"&&(document.readyState!=="loading"?oO():document.addEventListener("DOMContentLoaded",oO));var CJ=PI(),bd=function(t,n){return t===void 0&&(t=1),n===void 0&&(n=!1),"rgba("+(n?"70,55,255":"85,70,255")+","+t+")"},kv=function(t){return t===void 0&&(t=1),"rgba(170, 179, 255,"+t+")"},EJ=function(t,n){if(n===void 0&&(n="solid"),n==="solid")switch(t){case"secondary":return function(r){var i=r.isPressed,o=r.isDisabled,a=r._hover;return{bg:bd(.2,i),border:"1px solid",borderRadius:"6px",color:ce("invert"),borderColor:bd(0),_hover:ln({bg:bd(.25,!0),cursor:o?"not-allowed":"pointer"},a),_focus:{boxShadow:"0 0 0 3px "+kv(.5)}}};case"tertiary":return function(r){var i=r.isPressed,o=r.isDisabled,a=r._hover;return{border:"1px solid",borderRadius:"6px",color:ce("invert"),bg:ce(i?"bg":"bg-2"),borderColor:ce("border"),boxShadow:"mid",_hover:ln({bg:ce("bg-3"),boxShadow:"high",cursor:o?"not-allowed":"pointer"},a),_focus:{boxShadow:"0 0 0 3px "+kv(.5)}}};default:return function(r){var i=r.isPressed,o=r.isDisabled,a=r._hover;return{border:"1px solid",borderRadius:"6px",bg:bd(1,i),color:"white",borderColor:bd(0),_hover:ln({bg:bd(1,!0),cursor:o?"not-allowed":"pointer"},a),_focus:{boxShadow:"0 0 0 3px "+kv(.75)}}}}else return function(r){var i=r._hover,o=r.isPressed,a=r.isDisabled;return{color:bd(1,o),textDecoration:"none",_hover:ln({textDecoration:"underline",cursor:a?"not-allowed":"pointer"},i)}}},AJ=function(t){switch(t){case"sm":return{px:"tight",py:"extra-tight",fontSize:"12px"};case"md":return{px:"base",py:"base-tight",fontSize:"14px"};case"lg":return{px:"base-loose",py:"base",fontSize:"14px"}}},St=Gr(function(e,t){var n=e.children,r=e.as,i=r===void 0?"button":r,o=e.onClick,a=e.mode,u=a===void 0?"primary":a,l=e.variant,f=l===void 0?"solid":l,p=e.isLoading,m=e.isDisabled,y=e.size,w=y===void 0?"md":y,b=e._hover,x=qu(e,["children","as","onClick","mode","variant","isLoading","isDisabled","size","_hover"]),_=bJ({ref:t,onPress:function(R){o==null||o(R)}}),O=_.pressProps,N=_.isPressed,E=O.onKeyUp,T=O.onKeyDown,B=f==="link"?{}:AJ(w),A=EJ(u,f),U=A({isPressed:N,_hover:b,isDisabled:m});return $.createElement(fe,ln({as:i,outline:"none",fontWeight:"500",transition:Pu,userSelect:"none",ref:t,onKeyUp:E,onKeyDown:T,position:"relative",pointerEvents:p||m?"none":"unset",onClick:function(R){o==null||o(R)},opacity:m?.4:1,alignItems:"center",justifyContent:"center"},U,B,x,{display:x.display||"inline-flex"}),$.createElement(p_,{transition:Pu,opacity:p?1:0,zIndex:2,position:"absolute",top:0,left:0,size:"100%",placeItems:"center"},$.createElement(fs,{size:"sm",color:"currentColor"})),$.createElement(xe,{transition:"opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1)",as:"span",color:"currentColor",opacity:p?0:1,display:x.display||"inline-flex",alignItems:x.alignItems||"center",justifyContent:x.justifyContent||"center"},n))}),Jn,$n,x4={light:(Jn={},Jn[_t.Accent]="#5546FF",Jn[_t.Brand]="#5546FF",Jn[_t.Bg]="white",Jn[_t.Bg2]="white",Jn[_t.Bg3]="white",Jn[_t.Bg4]="#F7F7FA",Jn[_t.BgAlt]="#F7F7FA",Jn[_t.BgLight]="white",Jn[_t.Invert]="#040404",Jn[_t.TextHover]="#5546FF",Jn[_t.TextTitle]="#141416",Jn[_t.TextCaption]="#747478",Jn[_t.TextBody]="#424248",Jn[_t.Icon]="#9C9CA2",Jn[_t.InputPlaceholder]="#747478",Jn[_t.Border]="#F0F0F2",Jn[_t.FeedbackAlert]="#FE9000",Jn[_t.FeedbackError]="#CF0000",Jn[_t.FeedbackSuccess]="#00A200",Jn),dark:($n={},$n[_t.Accent]="#7F80FF",$n[_t.Brand]="#7F80FF",$n[_t.Bg]="#040404",$n[_t.Bg2]="#0A0A0A",$n[_t.Bg3]="#141416",$n[_t.Bg4]="#1E1E20",$n[_t.BgAlt]="#1E1E20",$n[_t.BgLight]="#1E1E20",$n[_t.Invert]="#ffffff",$n[_t.TextHover]="#7F80FF",$n[_t.TextTitle]="#ffffff",$n[_t.TextCaption]="#9C9CA2",$n[_t.TextBody]="#F7F7FA",$n[_t.Icon]="#9C9CA2",$n[_t.InputPlaceholder]="#9C9CA2",$n[_t.Border]="#202020",$n[_t.FeedbackAlert]="#FFB44D",$n[_t.FeedbackError]="#F34D4D",$n[_t.FeedbackSuccess]="#49CE49",$n)},FJ=function(t){return x4[t.colorMode]},IJ=function(t){return Object.keys(x4[t.colorMode])},W0=function(t){return function(n){var r=n.colorMode,i=r===void 0?t:r,o=qu(n,["colorMode"]);return IJ(ln({colorMode:i},o)).map(function(a){return"--colors-"+a+": "+FJ(ln({colorMode:i},o))[a]+";"})}},_4=void 0;try{_4=window}catch{}function PJ(e){var t;return(t=void 0)!=null?t:_4}function MJ(){var e=PJ();return!!(typeof e<"u"&&e.document&&e.document.createElement)}var LJ=MJ();function k4(){var e=bf([` * { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -108,17 +108,17 @@ object-assign } } } - `]);return k4=function(){return e},e}function R4(){var e=wf([` + `]);return k4=function(){return e},e}function R4(){var e=bf([` :root { `,`; --colors-highlight-line-bg: rgba(255, 255, 255, 0.05); } - `]);return R4=function(){return e},e}function T4(){var e=wf([` + `]);return R4=function(){return e},e}function T4(){var e=bf([` :root { `,`; --colors-highlight-line-bg: rgba(255, 255, 255, 0.08); } - `]);return T4=function(){return e},e}var sO=lt.createElement(Cw,{styles:ds(T4(),W0("light")({colorMode:"light",theme:os}))}),aO=lt.createElement(Cw,{styles:ds(R4(),W0("dark")({colorMode:"dark",theme:os}))}),BJ=lt.createElement(Cw,{styles:ds(k4(),W0("light")({colorMode:"light",theme:os}),W0("dark")({colorMode:"dark",theme:os}))}),jJ=lt.memo(function(){return lt.createElement(lt.Fragment,null,lt.createElement("style",{"data-emotion-css":"css-global "+aO.props.styles.name,dangerouslySetInnerHTML:{__html:aO.props.styles.styles},media:"(prefers-color-scheme: dark)"}),lt.createElement("style",{"data-emotion-css":"css-global "+sO.props.styles.name,dangerouslySetInnerHTML:{__html:sO.props.styles.styles},media:"(prefers-color-scheme: light)"}),BJ)}),DJ=function(t){var n=t.theme,r=n===void 0?os:n,i=t.children;return lt.createElement(Zj,{theme:r},lt.createElement(jJ,null),i)};function O4(){var e=wf([` + `]);return T4=function(){return e},e}var sO=lt.createElement(Cw,{styles:ds(T4(),W0("light")({colorMode:"light",theme:os}))}),aO=lt.createElement(Cw,{styles:ds(R4(),W0("dark")({colorMode:"dark",theme:os}))}),BJ=lt.createElement(Cw,{styles:ds(k4(),W0("light")({colorMode:"light",theme:os}),W0("dark")({colorMode:"dark",theme:os}))}),jJ=lt.memo(function(){return lt.createElement(lt.Fragment,null,lt.createElement("style",{"data-emotion-css":"css-global "+aO.props.styles.name,dangerouslySetInnerHTML:{__html:aO.props.styles.styles},media:"(prefers-color-scheme: dark)"}),lt.createElement("style",{"data-emotion-css":"css-global "+sO.props.styles.name,dangerouslySetInnerHTML:{__html:sO.props.styles.styles},media:"(prefers-color-scheme: light)"}),BJ)}),DJ=function(t){var n=t.theme,r=n===void 0?os:n,i=t.children;return lt.createElement(Zj,{theme:r},lt.createElement(jJ,null),i)};function O4(){var e=bf([` /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ /* Document @@ -684,7 +684,7 @@ object-assign max-width: 100%; height: auto; } -`]);return O4=function(){return e},e}var JJ=ds(O4()),cO,uO;function N4(){var e=wf([` +`]);return O4=function(){return e},e}var JJ=ds(O4()),cO,uO;function N4(){var e=bf([` *, *::before, *::after { @@ -713,7 +713,7 @@ object-assign text-align: initial; font-family: `,`; } -`]);return N4=function(){return e},e}function C4(){var e=wf([` +`]);return N4=function(){return e},e}function C4(){var e=bf([` `,`; html { @@ -746,7 +746,7 @@ object-assign textarea::placeholder { color: `,`; } -`]);return C4=function(){return e},e}var $J=function(t){return{light:{color:t.colors.ink[900],bg:void 0,borderColor:"#E5E5EC",placeholderColor:t.colors.ink[400]},dark:{color:"white",bg:t.colors.ink[900],borderColor:t.colors.ink[600],placeholderColor:t.colors.ink[500]}}},Ew=$J(os).light,qJ=Ew.color,UJ=Ew.bg,E4=Ew.borderColor,Rh=Ew.placeholderColor,HJ=ds(C4(),JJ,qJ,UJ,os==null||(cO=os.fonts)==null?void 0:cO.body,E4,Rh,Rh,Rh),zJ=z0(Cw,{styles:HJ});os==null||(uO=os.fonts)==null||uO.body;var ie=Gr(function(e,t){return $.createElement(fe,ln({as:"span",display:"inline-block",ref:t},e))}),WJ=function(t){return lt.createElement(fe,ln({as:"span",ml:1,color:"red","aria-hidden":"true",children:"*"},t))},lO=Gr(function(e,t){var n=e.children,r=e.isDisabled,i=e.isRequired,o=$u(e,["children","isDisabled","isRequired","as"]);return lt.createElement(ie,ln({ref:t,mb:"extra-tight",opacity:r?.4:1,textAlign:"left",verticalAlign:"middle",display:"inline-block",textStyle:"body.small.medium"},o),n,i&<.createElement(WJ,null))});function VJ(e){var t=$.useRef(e);return $.useEffect(function(){t.current=e},[e]),t}function GJ(e,t,n,r){n===void 0&&(n=LJ?document:null);var i=VJ(t);return $.useEffect(function(){if(n){var o=function(u){i.current(u)};return n.addEventListener(e,o,r),function(){n.removeEventListener(e,o,r)}}},[e,n,r,i]),function(){var o;(o=n)==null||o.removeEventListener(e,i.current,r)}}var KJ=function(t){return lt.createElement(fe,ln({},t),lt.createElement("svg",{width:"100%",viewBox:"0 0 16 16",fill:"none"},lt.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16ZM7.9983 4C8.46541 4 8.84049 4.38536 8.82787 4.8523L8.72037 8.82986C8.70981 9.22031 8.39026 9.53134 7.99967 9.53134C7.60928 9.53134 7.28981 9.2206 7.279 8.83036L7.16874 4.85287C7.15579 4.38572 7.53096 4 7.9983 4ZM8.9199 11.0743C8.91607 11.5873 8.49058 12 7.99992 12C7.49392 12 7.0761 11.5873 7.07993 11.0743C7.0761 10.569 7.49392 10.1562 7.99992 10.1562C8.49058 10.1562 8.91607 10.569 8.9199 11.0743Z",fill:"currentColor"})))},Rv={exports:{}},Tv,dO;function QJ(){if(dO)return Tv;dO=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Tv=e,Tv}var Ov,fO;function YJ(){if(fO)return Ov;fO=1;var e=QJ();function t(){}function n(){}return n.resetWarningCache=t,Ov=function(){function r(a,u,l,f,p,m){if(m!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Ov}var hO;function XJ(){return hO||(hO=1,Rv.exports=YJ()()),Rv.exports}var ZJ=XJ();const Sd=Ju(ZJ);var e9={height:"48px",border:"1px solid",borderBottomColor:ce("border"),borderLeftColor:ce("border"),borderRightColor:ce("border"),borderTopColor:ce("border"),borderColor:ce("border"),bg:ce("bg"),_hover:{borderBottomColor:ce("border"),borderLeftColor:ce("border"),borderRightColor:ce("border"),borderTopColor:ce("border"),borderColor:ce("border")},_disabled:{bg:ce("bg-4"),cursor:"not-allowed",pointerEvents:"none"},_focus:{borderBottomColor:"rgba(170, 179, 255, 0.4)",borderLeftColor:"rgba(170, 179, 255, 0.4)",borderRightColor:"rgba(170, 179, 255, 0.4)",borderTopColor:"rgba(170, 179, 255, 0.4)",borderColor:"rgba(170, 179, 255, 0.4)",boxShadow:"0 0 0 1px rgba(170, 179, 255, 0.75)"},_invalid:{borderBottomColor:ce("feedback-alert"),borderLeftColor:ce("feedback-alert"),borderRightColor:ce("feedback-alert"),borderTopColor:ce("feedback-alert"),borderColor:ce("feedback-alert")}},t9={display:"flex",alignItems:"center",position:"relative",transition:"all 0.2s",outline:"none",borderRadius:"6px",p:"14px 16px"},n9=function(t){return ln({width:t.isFullWidth?"100%":void 0},t9,e9)},sr=lt.forwardRef(function(e,t){var n=e.as,r=n===void 0?"input":n,i=e["aria-label"],o=e["aria-describedby"],a=e.isReadOnly,u=e.isDisabled,l=e.isInvalid,f=e.isRequired,p=e.style,m=p===void 0?{}:p,y=$u(e,["as","aria-label","aria-describedby","isReadOnly","isDisabled","isInvalid","isRequired","style"]),w=n9(e);return lt.createElement(fe,ln({ref:t,as:r,_readOnly:a,"aria-readonly":a,disabled:u,"aria-label":i,"aria-invalid":l,required:f,"aria-required":f,"aria-disabled":u,"aria-describedby":o,textStyle:"body.small",style:ln({WebkitAppearance:"none"},m)},w,{width:"100%"},y))});sr.displayName="Input";var Nv;function r9(){if(Nv!==void 0)return Nv;var e=!1,t={get passive(){e=!0}},n=function(){};return window.addEventListener("t",n,t),window.removeEventListener("t",n,t),Nv=e,e}var i9=$.useLayoutEffect,o9=function(t){var n=$.useRef(t);return i9(function(){n.current=t}),n},ii="top",io="bottom",oo="right",oi="left",y_="auto",kg=[ii,io,oo,oi],Ih="start",ig="end",s9="clippingParents",A4="viewport",nm="popper",a9="reference",pO=kg.reduce(function(e,t){return e.concat([t+"-"+Ih,t+"-"+ig])},[]),F4=[].concat(kg,[y_]).reduce(function(e,t){return e.concat([t,t+"-"+Ih,t+"-"+ig])},[]),c9="beforeRead",u9="read",l9="afterRead",d9="beforeMain",f9="main",h9="afterMain",p9="beforeWrite",m9="write",g9="afterWrite",y9=[c9,u9,l9,d9,f9,h9,p9,m9,g9];function ss(e){return e?(e.nodeName||"").toLowerCase():null}function Ii(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function df(e){var t=Ii(e).Element;return e instanceof t||e instanceof Element}function ro(e){var t=Ii(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function w_(e){if(typeof ShadowRoot>"u")return!1;var t=Ii(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function w9(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!ro(o)||!ss(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var u=i[a];u===!1?o.removeAttribute(a):o.setAttribute(a,u===!0?"":u)}))})}function b9(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(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=a.reduce(function(l,f){return l[f]="",l},{});!ro(i)||!ss(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const I4={name:"applyStyles",enabled:!0,phase:"write",fn:w9,effect:b9,requires:["computeStyles"]};function is(e){return e.split("-")[0]}var nf=Math.max,V0=Math.min,Ph=Math.round;function t1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function P4(){return!/^((?!chrome|android).)*safari/i.test(t1())}function Mh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&ro(e)&&(i=e.offsetWidth>0&&Ph(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Ph(r.height)/e.offsetHeight||1);var a=df(e)?Ii(e):window,u=a.visualViewport,l=!P4()&&n,f=(r.left+(l&&u?u.offsetLeft:0))/i,p=(r.top+(l&&u?u.offsetTop:0))/o,m=r.width/i,y=r.height/o;return{width:m,height:y,top:p,right:f+m,bottom:p+y,left:f,x:f,y:p}}function b_(e){var t=Mh(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 M4(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w_(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Bu(e){return Ii(e).getComputedStyle(e)}function S9(e){return["table","td","th"].indexOf(ss(e))>=0}function ql(e){return((df(e)?e.ownerDocument:e.document)||window.document).documentElement}function Aw(e){return ss(e)==="html"?e:e.assignedSlot||e.parentNode||(w_(e)?e.host:null)||ql(e)}function mO(e){return!ro(e)||Bu(e).position==="fixed"?null:e.offsetParent}function v9(e){var t=/firefox/i.test(t1()),n=/Trident/i.test(t1());if(n&&ro(e)){var r=Bu(e);if(r.position==="fixed")return null}var i=Aw(e);for(w_(i)&&(i=i.host);ro(i)&&["html","body"].indexOf(ss(i))<0;){var o=Bu(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Rg(e){for(var t=Ii(e),n=mO(e);n&&S9(n)&&Bu(n).position==="static";)n=mO(n);return n&&(ss(n)==="html"||ss(n)==="body"&&Bu(n).position==="static")?t:n||v9(e)||t}function S_(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Hm(e,t,n){return nf(e,V0(t,n))}function x9(e,t,n){var r=Hm(e,t,n);return r>n?n:r}function L4(){return{top:0,right:0,bottom:0,left:0}}function B4(e){return Object.assign({},L4(),e)}function j4(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var _9=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,B4(typeof t!="number"?t:j4(t,kg))};function k9(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=is(n.placement),l=S_(u),f=[oi,oo].indexOf(u)>=0,p=f?"height":"width";if(!(!o||!a)){var m=_9(i.padding,n),y=b_(o),w=l==="y"?ii:oi,b=l==="y"?io:oo,x=n.rects.reference[p]+n.rects.reference[l]-a[l]-n.rects.popper[p],k=a[l]-n.rects.reference[l],O=Rg(o),N=O?l==="y"?O.clientHeight||0:O.clientWidth||0:0,E=x/2-k/2,T=m[w],B=N-y[p]-m[b],A=N/2-y[p]/2+E,U=Hm(T,A,B),v=l;n.modifiersData[r]=(t={},t[v]=U,t.centerOffset=U-A,t)}}function R9(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||M4(t.elements.popper,i)&&(t.elements.arrow=i))}const T9={name:"arrow",enabled:!0,phase:"main",fn:k9,effect:R9,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Lh(e){return e.split("-")[1]}var O9={top:"auto",right:"auto",bottom:"auto",left:"auto"};function N9(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Ph(n*i)/i||0,y:Ph(r*i)/i||0}}function gO(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,u=e.position,l=e.gpuAcceleration,f=e.adaptive,p=e.roundOffsets,m=e.isFixed,y=a.x,w=y===void 0?0:y,b=a.y,x=b===void 0?0:b,k=typeof p=="function"?p({x:w,y:x}):{x:w,y:x};w=k.x,x=k.y;var O=a.hasOwnProperty("x"),N=a.hasOwnProperty("y"),E=oi,T=ii,B=window;if(f){var A=Rg(n),U="clientHeight",v="clientWidth";if(A===Ii(n)&&(A=ql(n),Bu(A).position!=="static"&&u==="absolute"&&(U="scrollHeight",v="scrollWidth")),A=A,i===ii||(i===oi||i===oo)&&o===ig){T=io;var R=m&&A===B&&B.visualViewport?B.visualViewport.height:A[U];x-=R-r.height,x*=l?1:-1}if(i===oi||(i===ii||i===io)&&o===ig){E=oo;var C=m&&A===B&&B.visualViewport?B.visualViewport.width:A[v];w-=C-r.width,w*=l?1:-1}}var M=Object.assign({position:u},f&&O9),J=p===!0?N9({x:w,y:x},Ii(n)):{x:w,y:x};if(w=J.x,x=J.y,l){var P;return Object.assign({},M,(P={},P[T]=N?"0":"",P[E]=O?"0":"",P.transform=(B.devicePixelRatio||1)<=1?"translate("+w+"px, "+x+"px)":"translate3d("+w+"px, "+x+"px, 0)",P))}return Object.assign({},M,(t={},t[T]=N?x+"px":"",t[E]=O?w+"px":"",t.transform="",t))}function C9(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,l=u===void 0?!0:u,f={placement:is(t.placement),variation:Lh(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gO(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gO(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const E9={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:C9,data:{}};var r0={passive:!0};function A9(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,u=a===void 0?!0:a,l=Ii(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&f.forEach(function(p){p.addEventListener("scroll",n.update,r0)}),u&&l.addEventListener("resize",n.update,r0),function(){o&&f.forEach(function(p){p.removeEventListener("scroll",n.update,r0)}),u&&l.removeEventListener("resize",n.update,r0)}}const F9={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:A9,data:{}};var I9={left:"right",right:"left",bottom:"top",top:"bottom"};function M0(e){return e.replace(/left|right|bottom|top/g,function(t){return I9[t]})}var P9={start:"end",end:"start"};function yO(e){return e.replace(/start|end/g,function(t){return P9[t]})}function v_(e){var t=Ii(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function x_(e){return Mh(ql(e)).left+v_(e).scrollLeft}function M9(e,t){var n=Ii(e),r=ql(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,l=0;if(i){o=i.width,a=i.height;var f=P4();(f||!f&&t==="fixed")&&(u=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:u+x_(e),y:l}}function L9(e){var t,n=ql(e),r=v_(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=nf(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=nf(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+x_(e),l=-r.scrollTop;return Bu(i||n).direction==="rtl"&&(u+=nf(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:l}}function __(e){var t=Bu(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function D4(e){return["html","body","#document"].indexOf(ss(e))>=0?e.ownerDocument.body:ro(e)&&__(e)?e:D4(Aw(e))}function zm(e,t){var n;t===void 0&&(t=[]);var r=D4(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Ii(r),a=i?[o].concat(o.visualViewport||[],__(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(zm(Aw(a)))}function n1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function B9(e,t){var n=Mh(e,!1,t==="fixed");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}function wO(e,t,n){return t===A4?n1(M9(e,n)):df(t)?B9(t,n):n1(L9(ql(e)))}function j9(e){var t=zm(Aw(e)),n=["absolute","fixed"].indexOf(Bu(e).position)>=0,r=n&&ro(e)?Rg(e):e;return df(r)?t.filter(function(i){return df(i)&&M4(i,r)&&ss(i)!=="body"}):[]}function D9(e,t,n,r){var i=t==="clippingParents"?j9(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(l,f){var p=wO(e,f,r);return l.top=nf(p.top,l.top),l.right=V0(p.right,l.right),l.bottom=V0(p.bottom,l.bottom),l.left=nf(p.left,l.left),l},wO(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 J4(e){var t=e.reference,n=e.element,r=e.placement,i=r?is(r):null,o=r?Lh(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,l;switch(i){case ii:l={x:a,y:t.y-n.height};break;case io:l={x:a,y:t.y+t.height};break;case oo:l={x:t.x+t.width,y:u};break;case oi:l={x:t.x-n.width,y:u};break;default:l={x:t.x,y:t.y}}var f=i?S_(i):null;if(f!=null){var p=f==="y"?"height":"width";switch(o){case Ih:l[f]=l[f]-(t[p]/2-n[p]/2);break;case ig:l[f]=l[f]+(t[p]/2-n[p]/2);break}}return l}function og(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,u=n.boundary,l=u===void 0?s9:u,f=n.rootBoundary,p=f===void 0?A4:f,m=n.elementContext,y=m===void 0?nm:m,w=n.altBoundary,b=w===void 0?!1:w,x=n.padding,k=x===void 0?0:x,O=B4(typeof k!="number"?k:j4(k,kg)),N=y===nm?a9:nm,E=e.rects.popper,T=e.elements[b?N:y],B=D9(df(T)?T:T.contextElement||ql(e.elements.popper),l,p,a),A=Mh(e.elements.reference),U=J4({reference:A,element:E,strategy:"absolute",placement:i}),v=n1(Object.assign({},E,U)),R=y===nm?v:A,C={top:B.top-R.top+O.top,bottom:R.bottom-B.bottom+O.bottom,left:B.left-R.left+O.left,right:R.right-B.right+O.right},M=e.modifiersData.offset;if(y===nm&&M){var J=M[i];Object.keys(C).forEach(function(P){var D=[oo,io].indexOf(P)>=0?1:-1,q=[ii,io].indexOf(P)>=0?"y":"x";C[P]+=J[q]*D})}return C}function J9(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,u=n.flipVariations,l=n.allowedAutoPlacements,f=l===void 0?F4:l,p=Lh(r),m=p?u?pO:pO.filter(function(b){return Lh(b)===p}):kg,y=m.filter(function(b){return f.indexOf(b)>=0});y.length===0&&(y=m);var w=y.reduce(function(b,x){return b[x]=og(e,{placement:x,boundary:i,rootBoundary:o,padding:a})[is(x)],b},{});return Object.keys(w).sort(function(b,x){return w[b]-w[x]})}function $9(e){if(is(e)===y_)return[];var t=M0(e);return[yO(e),t,yO(t)]}function q9(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!0:a,l=n.fallbackPlacements,f=n.padding,p=n.boundary,m=n.rootBoundary,y=n.altBoundary,w=n.flipVariations,b=w===void 0?!0:w,x=n.allowedAutoPlacements,k=t.options.placement,O=is(k),N=O===k,E=l||(N||!b?[M0(k)]:$9(k)),T=[k].concat(E).reduce(function(be,ke){return be.concat(is(ke)===y_?J9(t,{placement:ke,boundary:p,rootBoundary:m,padding:f,flipVariations:b,allowedAutoPlacements:x}):ke)},[]),B=t.rects.reference,A=t.rects.popper,U=new Map,v=!0,R=T[0],C=0;C=0,q=D?"width":"height",K=og(t,{placement:M,boundary:p,rootBoundary:m,altBoundary:y,padding:f}),Q=D?P?oo:oi:P?io:ii;B[q]>A[q]&&(Q=M0(Q));var H=M0(Q),X=[];if(o&&X.push(K[J]<=0),u&&X.push(K[Q]<=0,K[H]<=0),X.every(function(be){return be})){R=M,v=!1;break}U.set(M,X)}if(v)for(var I=b?3:1,te=function(ke){var Ne=T.find(function(Xe){var Ze=U.get(Xe);if(Ze)return Ze.slice(0,ke).every(function(Nt){return Nt})});if(Ne)return R=Ne,"break"},ge=I;ge>0;ge--){var oe=te(ge);if(oe==="break")break}t.placement!==R&&(t.modifiersData[r]._skip=!0,t.placement=R,t.reset=!0)}}const U9={name:"flip",enabled:!0,phase:"main",fn:q9,requiresIfExists:["offset"],data:{_skip:!1}};function bO(e,t,n){return n===void 0&&(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 SO(e){return[ii,oo,io,oi].some(function(t){return e[t]>=0})}function H9(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=og(t,{elementContext:"reference"}),u=og(t,{altBoundary:!0}),l=bO(a,r),f=bO(u,i,o),p=SO(l),m=SO(f);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:f,isReferenceHidden:p,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":m})}const z9={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:H9};function W9(e,t,n){var r=is(e),i=[oi,ii].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],u=o[1];return a=a||0,u=(u||0)*i,[oi,oo].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function V9(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=F4.reduce(function(p,m){return p[m]=W9(m,t.rects,o),p},{}),u=a[t.placement],l=u.x,f=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=a}const G9={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:V9};function K9(e){var t=e.state,n=e.name;t.modifiersData[n]=J4({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Q9={name:"popperOffsets",enabled:!0,phase:"read",fn:K9,data:{}};function Y9(e){return e==="x"?"y":"x"}function X9(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!1:a,l=n.boundary,f=n.rootBoundary,p=n.altBoundary,m=n.padding,y=n.tether,w=y===void 0?!0:y,b=n.tetherOffset,x=b===void 0?0:b,k=og(t,{boundary:l,rootBoundary:f,padding:m,altBoundary:p}),O=is(t.placement),N=Lh(t.placement),E=!N,T=S_(O),B=Y9(T),A=t.modifiersData.popperOffsets,U=t.rects.reference,v=t.rects.popper,R=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,C=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,J={x:0,y:0};if(A){if(o){var P,D=T==="y"?ii:oi,q=T==="y"?io:oo,K=T==="y"?"height":"width",Q=A[T],H=Q+k[D],X=Q-k[q],I=w?-v[K]/2:0,te=N===Ih?U[K]:v[K],ge=N===Ih?-v[K]:-U[K],oe=t.elements.arrow,be=w&&oe?b_(oe):{width:0,height:0},ke=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:L4(),Ne=ke[D],Xe=ke[q],Ze=Hm(0,U[K],be[K]),Nt=E?U[K]/2-I-Ze-Ne-C.mainAxis:te-Ze-Ne-C.mainAxis,nn=E?-U[K]/2+I+Ze+Xe+C.mainAxis:ge+Ze+Xe+C.mainAxis,kt=t.elements.arrow&&Rg(t.elements.arrow),En=kt?T==="y"?kt.clientTop||0:kt.clientLeft||0:0,Rt=(P=M==null?void 0:M[T])!=null?P:0,Ct=Q+Nt-Rt-En,gt=Q+nn-Rt,hn=Hm(w?V0(H,Ct):H,Q,w?nf(X,gt):X);A[T]=hn,J[T]=hn-Q}if(u){var An,cr=T==="x"?ii:oi,zn=T==="x"?io:oo,qt=A[B],on=B==="y"?"height":"width",ae=qt+k[cr],Ee=qt-k[zn],Pe=[ii,oi].indexOf(O)!==-1,Be=(An=M==null?void 0:M[B])!=null?An:0,it=Pe?ae:qt-U[on]-v[on]-Be+C.altAxis,ht=Pe?qt+U[on]+v[on]-Be-C.altAxis:Ee,Tt=w&&Pe?x9(it,qt,ht):Hm(w?it:ae,qt,w?ht:Ee);A[B]=Tt,J[B]=Tt-qt}t.modifiersData[r]=J}}const Z9={name:"preventOverflow",enabled:!0,phase:"main",fn:X9,requiresIfExists:["offset"]};function e$(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function t$(e){return e===Ii(e)||!ro(e)?v_(e):e$(e)}function n$(e){var t=e.getBoundingClientRect(),n=Ph(t.width)/e.offsetWidth||1,r=Ph(t.height)/e.offsetHeight||1;return n!==1||r!==1}function r$(e,t,n){n===void 0&&(n=!1);var r=ro(t),i=ro(t)&&n$(t),o=ql(t),a=Mh(e,i,n),u={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((ss(t)!=="body"||__(o))&&(u=t$(t)),ro(t)?(l=Mh(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=x_(o))),{x:a.left+u.scrollLeft-l.x,y:a.top+u.scrollTop-l.y,width:a.width,height:a.height}}function i$(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(u){if(!n.has(u)){var l=t.get(u);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function o$(e){var t=i$(e);return y9.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function s$(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function a$(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var vO={placement:"bottom",modifiers:[],strategy:"absolute"};function xO(){for(var e=arguments.length,t=new Array(e),n=0;n0},e.prototype.connect_=function(){!r1||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),w$?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!r1||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=y$.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),q4=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof Bh(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new O$(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Bh(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new N$(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),H4=typeof WeakMap<"u"?new WeakMap:new $4,z4=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=b$.getInstance(),r=new C$(t,n,this);H4.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){z4.prototype[e]=function(){var t;return(t=H4.get(this))[e].apply(t,arguments)}});(function(){return typeof G0.ResizeObserver<"u"?G0.ResizeObserver:z4})();function k_(){const[e,t]=lt.useState(!1),n=lt.useMemo(()=>({onFocus:r=>void t(!0),onBlur:r=>void t(!1)}),[]);return[e,n]}function Iw(){const[e,t]=lt.useState(!1),n=lt.useMemo(()=>({onMouseEnter:r=>void t(!0),onMouseLeave:r=>void t(!1)}),[]);return[e,n]}var E$="tippy-box",W4="tippy-content",A$="tippy-backdrop",V4="tippy-arrow",G4="tippy-svg-arrow",Hd={passive:!0,capture:!0},K4=function(){return document.body};function Cv(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function R_(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Q4(e,t){return typeof e=="function"?e.apply(void 0,t):e}function kO(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function F$(e){return e.split(/\s+/).filter(Boolean)}function uh(e){return[].concat(e)}function RO(e,t){e.indexOf(t)===-1&&e.push(t)}function I$(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function P$(e){return e.split("-")[0]}function Q0(e){return[].slice.call(e)}function TO(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Wm(){return document.createElement("div")}function Pw(e){return["Element","Fragment"].some(function(t){return R_(e,t)})}function M$(e){return R_(e,"NodeList")}function L$(e){return R_(e,"MouseEvent")}function B$(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function j$(e){return Pw(e)?[e]:M$(e)?Q0(e):Array.isArray(e)?e:Q0(document.querySelectorAll(e))}function Ev(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function OO(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function D$(e){var t,n=uh(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function J$(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,u=i.props,l=u.interactiveBorder,f=P$(a.placement),p=a.modifiersData.offset;if(!p)return!0;var m=f==="bottom"?p.top.y:0,y=f==="top"?p.bottom.y:0,w=f==="right"?p.left.x:0,b=f==="left"?p.right.x:0,x=o.top-r+m>l,k=r-o.bottom-y>l,O=o.left-n+w>l,N=n-o.right-b>l;return x||k||O||N})}function Av(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function NO(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Xo={isTouch:!1},CO=0;function $$(){Xo.isTouch||(Xo.isTouch=!0,window.performance&&document.addEventListener("mousemove",Y4))}function Y4(){var e=performance.now();e-CO<20&&(Xo.isTouch=!1,document.removeEventListener("mousemove",Y4)),CO=e}function q$(){var e=document.activeElement;if(B$(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function U$(){document.addEventListener("touchstart",$$,Hd),window.addEventListener("blur",q$)}var H$=typeof window<"u"&&typeof document<"u",z$=H$?!!window.msCrypto:!1,W$={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},V$={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Eo=Object.assign({appendTo:K4,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},W$,V$),G$=Object.keys(Eo),K$=function(t){var n=Object.keys(t);n.forEach(function(r){Eo[r]=t[r]})};function X4(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var u;r[o]=e[o]!==void 0?e[o]:(u=Eo[o])!=null?u:a}return r},{});return Object.assign({},e,n)}function Q$(e,t){var n=t?Object.keys(X4(Object.assign({},Eo,{plugins:t}))):G$,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function EO(e,t){var n=Object.assign({},t,{content:Q4(t.content,[e])},t.ignoreAttributes?{}:Q$(e,t.plugins));return n.aria=Object.assign({},Eo.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var Y$=function(){return"innerHTML"};function i1(e,t){e[Y$()]=t}function AO(e){var t=Wm();return e===!0?t.className=V4:(t.className=G4,Pw(e)?t.appendChild(e):i1(t,e)),t}function FO(e,t){Pw(t.content)?(i1(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?i1(e,t.content):e.textContent=t.content)}function o1(e){var t=e.firstElementChild,n=Q0(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(W4)}),arrow:n.find(function(r){return r.classList.contains(V4)||r.classList.contains(G4)}),backdrop:n.find(function(r){return r.classList.contains(A$)})}}function Z4(e){var t=Wm(),n=Wm();n.className=E$,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Wm();r.className=W4,r.setAttribute("data-state","hidden"),FO(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var u=o1(t),l=u.box,f=u.content,p=u.arrow;a.theme?l.setAttribute("data-theme",a.theme):l.removeAttribute("data-theme"),typeof a.animation=="string"?l.setAttribute("data-animation",a.animation):l.removeAttribute("data-animation"),a.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?l.setAttribute("role",a.role):l.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&FO(f,e.props),a.arrow?p?o.arrow!==a.arrow&&(l.removeChild(p),l.appendChild(AO(a.arrow))):l.appendChild(AO(a.arrow)):p&&l.removeChild(p)}return{popper:t,onUpdate:i}}Z4.$$tippy=!0;var X$=1,i0=[],Fv=[];function Z$(e,t){var n=EO(e,Object.assign({},Eo,X4(TO(t)))),r,i,o,a=!1,u=!1,l=!1,f=!1,p,m,y,w=[],b=kO(Ct,n.interactiveDebounce),x,k=X$++,O=null,N=I$(n.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},T={id:k,reference:e,popper:Wm(),popperInstance:O,props:n,state:E,plugins:N,clearDelayTimeouts:it,setProps:ht,setContent:Tt,show:Bn,hide:Sr,hideWithInteractivity:ur,enable:Pe,disable:Be,unmount:Kr,destroy:le};if(!n.render)return T;var B=n.render(T),A=B.popper,U=B.onUpdate;A.setAttribute("data-tippy-root",""),A.id="tippy-"+T.id,T.popper=A,e._tippy=T,A._tippy=T;var v=N.map(function(z){return z.fn(T)}),R=e.hasAttribute("aria-expanded");return kt(),I(),Q(),H("onCreate",[T]),n.showOnCreate&&ae(),A.addEventListener("mouseenter",function(){T.props.interactive&&T.state.isVisible&&T.clearDelayTimeouts()}),A.addEventListener("mouseleave",function(){T.props.interactive&&T.props.trigger.indexOf("mouseenter")>=0&&D().addEventListener("mousemove",b)}),T;function C(){var z=T.props.touch;return Array.isArray(z)?z:[z,0]}function M(){return C()[0]==="hold"}function J(){var z;return!!((z=T.props.render)!=null&&z.$$tippy)}function P(){return x||e}function D(){var z=P().parentNode;return z?D$(z):document}function q(){return o1(A)}function K(z){return T.state.isMounted&&!T.state.isVisible||Xo.isTouch||p&&p.type==="focus"?0:Cv(T.props.delay,z?0:1,Eo.delay)}function Q(z){z===void 0&&(z=!1),A.style.pointerEvents=T.props.interactive&&!z?"":"none",A.style.zIndex=""+T.props.zIndex}function H(z,ne,pe){if(pe===void 0&&(pe=!0),v.forEach(function(Re){Re[z]&&Re[z].apply(Re,ne)}),pe){var Ce;(Ce=T.props)[z].apply(Ce,ne)}}function X(){var z=T.props.aria;if(z.content){var ne="aria-"+z.content,pe=A.id,Ce=uh(T.props.triggerTarget||e);Ce.forEach(function(Re){var je=Re.getAttribute(ne);if(T.state.isVisible)Re.setAttribute(ne,je?je+" "+pe:pe);else{var Je=je&&je.replace(pe,"").trim();Je?Re.setAttribute(ne,Je):Re.removeAttribute(ne)}})}}function I(){if(!(R||!T.props.aria.expanded)){var z=uh(T.props.triggerTarget||e);z.forEach(function(ne){T.props.interactive?ne.setAttribute("aria-expanded",T.state.isVisible&&ne===P()?"true":"false"):ne.removeAttribute("aria-expanded")})}}function te(){D().removeEventListener("mousemove",b),i0=i0.filter(function(z){return z!==b})}function ge(z){if(!(Xo.isTouch&&(l||z.type==="mousedown"))){var ne=z.composedPath&&z.composedPath()[0]||z.target;if(!(T.props.interactive&&NO(A,ne))){if(uh(T.props.triggerTarget||e).some(function(pe){return NO(pe,ne)})){if(Xo.isTouch||T.state.isVisible&&T.props.trigger.indexOf("click")>=0)return}else H("onClickOutside",[T,z]);T.props.hideOnClick===!0&&(T.clearDelayTimeouts(),T.hide(),u=!0,setTimeout(function(){u=!1}),T.state.isMounted||Ne())}}}function oe(){l=!0}function be(){l=!1}function ke(){var z=D();z.addEventListener("mousedown",ge,!0),z.addEventListener("touchend",ge,Hd),z.addEventListener("touchstart",be,Hd),z.addEventListener("touchmove",oe,Hd)}function Ne(){var z=D();z.removeEventListener("mousedown",ge,!0),z.removeEventListener("touchend",ge,Hd),z.removeEventListener("touchstart",be,Hd),z.removeEventListener("touchmove",oe,Hd)}function Xe(z,ne){Nt(z,function(){!T.state.isVisible&&A.parentNode&&A.parentNode.contains(A)&&ne()})}function Ze(z,ne){Nt(z,ne)}function Nt(z,ne){var pe=q().box;function Ce(Re){Re.target===pe&&(Av(pe,"remove",Ce),ne())}if(z===0)return ne();Av(pe,"remove",m),Av(pe,"add",Ce),m=Ce}function nn(z,ne,pe){pe===void 0&&(pe=!1);var Ce=uh(T.props.triggerTarget||e);Ce.forEach(function(Re){Re.addEventListener(z,ne,pe),w.push({node:Re,eventType:z,handler:ne,options:pe})})}function kt(){M()&&(nn("touchstart",Rt,{passive:!0}),nn("touchend",gt,{passive:!0})),F$(T.props.trigger).forEach(function(z){if(z!=="manual")switch(nn(z,Rt),z){case"mouseenter":nn("mouseleave",gt);break;case"focus":nn(z$?"focusout":"blur",hn);break;case"focusin":nn("focusout",hn);break}})}function En(){w.forEach(function(z){var ne=z.node,pe=z.eventType,Ce=z.handler,Re=z.options;ne.removeEventListener(pe,Ce,Re)}),w=[]}function Rt(z){var ne,pe=!1;if(!(!T.state.isEnabled||An(z)||u)){var Ce=((ne=p)==null?void 0:ne.type)==="focus";p=z,x=z.currentTarget,I(),!T.state.isVisible&&L$(z)&&i0.forEach(function(Re){return Re(z)}),z.type==="click"&&(T.props.trigger.indexOf("mouseenter")<0||a)&&T.props.hideOnClick!==!1&&T.state.isVisible?pe=!0:ae(z),z.type==="click"&&(a=!pe),pe&&!Ce&&Ee(z)}}function Ct(z){var ne=z.target,pe=P().contains(ne)||A.contains(ne);if(!(z.type==="mousemove"&&pe)){var Ce=on().concat(A).map(function(Re){var je,Je=Re._tippy,Le=(je=Je.popperInstance)==null?void 0:je.state;return Le?{popperRect:Re.getBoundingClientRect(),popperState:Le,props:n}:null}).filter(Boolean);J$(Ce,z)&&(te(),Ee(z))}}function gt(z){var ne=An(z)||T.props.trigger.indexOf("click")>=0&&a;if(!ne){if(T.props.interactive){T.hideWithInteractivity(z);return}Ee(z)}}function hn(z){T.props.trigger.indexOf("focusin")<0&&z.target!==P()||T.props.interactive&&z.relatedTarget&&A.contains(z.relatedTarget)||Ee(z)}function An(z){return Xo.isTouch?M()!==z.type.indexOf("touch")>=0:!1}function cr(){zn();var z=T.props,ne=z.popperOptions,pe=z.placement,Ce=z.offset,Re=z.getReferenceClientRect,je=z.moveTransition,Je=J()?o1(A).arrow:null,Le=Re?{getBoundingClientRect:Re,contextElement:Re.contextElement||P()}:e,Qe={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(V){var L=V.state;if(J()){var G=q(),Z=G.box;["placement","reference-hidden","escaped"].forEach(function(de){de==="placement"?Z.setAttribute("data-placement",L.placement):L.attributes.popper["data-popper-"+de]?Z.setAttribute("data-"+de,""):Z.removeAttribute("data-"+de)}),L.attributes.popper={}}}},dt=[{name:"offset",options:{offset:Ce}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!je}},Qe];J()&&Je&&dt.push({name:"arrow",options:{element:Je,padding:3}}),dt.push.apply(dt,(ne==null?void 0:ne.modifiers)||[]),T.popperInstance=l$(Le,A,Object.assign({},ne,{placement:pe,onFirstUpdate:y,modifiers:dt}))}function zn(){T.popperInstance&&(T.popperInstance.destroy(),T.popperInstance=null)}function qt(){var z=T.props.appendTo,ne,pe=P();T.props.interactive&&z===K4||z==="parent"?ne=pe.parentNode:ne=Q4(z,[pe]),ne.contains(A)||ne.appendChild(A),T.state.isMounted=!0,cr()}function on(){return Q0(A.querySelectorAll("[data-tippy-root]"))}function ae(z){T.clearDelayTimeouts(),z&&H("onTrigger",[T,z]),ke();var ne=K(!0),pe=C(),Ce=pe[0],Re=pe[1];Xo.isTouch&&Ce==="hold"&&Re&&(ne=Re),ne?r=setTimeout(function(){T.show()},ne):T.show()}function Ee(z){if(T.clearDelayTimeouts(),H("onUntrigger",[T,z]),!T.state.isVisible){Ne();return}if(!(T.props.trigger.indexOf("mouseenter")>=0&&T.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(z.type)>=0&&a)){var ne=K(!1);ne?i=setTimeout(function(){T.state.isVisible&&T.hide()},ne):o=requestAnimationFrame(function(){T.hide()})}}function Pe(){T.state.isEnabled=!0}function Be(){T.hide(),T.state.isEnabled=!1}function it(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function ht(z){if(!T.state.isDestroyed){H("onBeforeUpdate",[T,z]),En();var ne=T.props,pe=EO(e,Object.assign({},ne,TO(z),{ignoreAttributes:!0}));T.props=pe,kt(),ne.interactiveDebounce!==pe.interactiveDebounce&&(te(),b=kO(Ct,pe.interactiveDebounce)),ne.triggerTarget&&!pe.triggerTarget?uh(ne.triggerTarget).forEach(function(Ce){Ce.removeAttribute("aria-expanded")}):pe.triggerTarget&&e.removeAttribute("aria-expanded"),I(),Q(),U&&U(ne,pe),T.popperInstance&&(cr(),on().forEach(function(Ce){requestAnimationFrame(Ce._tippy.popperInstance.forceUpdate)})),H("onAfterUpdate",[T,z])}}function Tt(z){T.setProps({content:z})}function Bn(){var z=T.state.isVisible,ne=T.state.isDestroyed,pe=!T.state.isEnabled,Ce=Xo.isTouch&&!T.props.touch,Re=Cv(T.props.duration,0,Eo.duration);if(!(z||ne||pe||Ce)&&!P().hasAttribute("disabled")&&(H("onShow",[T],!1),T.props.onShow(T)!==!1)){if(T.state.isVisible=!0,J()&&(A.style.visibility="visible"),Q(),ke(),T.state.isMounted||(A.style.transition="none"),J()){var je=q(),Je=je.box,Le=je.content;Ev([Je,Le],0)}y=function(){var dt;if(!(!T.state.isVisible||f)){if(f=!0,A.offsetHeight,A.style.transition=T.props.moveTransition,J()&&T.props.animation){var Xt=q(),V=Xt.box,L=Xt.content;Ev([V,L],Re),OO([V,L],"visible")}X(),I(),RO(Fv,T),(dt=T.popperInstance)==null||dt.forceUpdate(),H("onMount",[T]),T.props.animation&&J()&&Ze(Re,function(){T.state.isShown=!0,H("onShown",[T])})}},qt()}}function Sr(){var z=!T.state.isVisible,ne=T.state.isDestroyed,pe=!T.state.isEnabled,Ce=Cv(T.props.duration,1,Eo.duration);if(!(z||ne||pe)&&(H("onHide",[T],!1),T.props.onHide(T)!==!1)){if(T.state.isVisible=!1,T.state.isShown=!1,f=!1,a=!1,J()&&(A.style.visibility="hidden"),te(),Ne(),Q(!0),J()){var Re=q(),je=Re.box,Je=Re.content;T.props.animation&&(Ev([je,Je],Ce),OO([je,Je],"hidden"))}X(),I(),T.props.animation?J()&&Xe(Ce,T.unmount):T.unmount()}}function ur(z){D().addEventListener("mousemove",b),RO(i0,b),b(z)}function Kr(){T.state.isVisible&&T.hide(),T.state.isMounted&&(zn(),on().forEach(function(z){z._tippy.unmount()}),A.parentNode&&A.parentNode.removeChild(A),Fv=Fv.filter(function(z){return z!==T}),T.state.isMounted=!1,H("onHidden",[T]))}function le(){T.state.isDestroyed||(T.clearDelayTimeouts(),T.unmount(),En(),delete e._tippy,T.state.isDestroyed=!0,H("onDestroy",[T]))}}function Tg(e,t){t===void 0&&(t={});var n=Eo.plugins.concat(t.plugins||[]);U$();var r=Object.assign({},t,{plugins:n}),i=j$(e),o=i.reduce(function(a,u){var l=u&&Z$(u,r);return l&&a.push(l),a},[]);return Pw(e)?o[0]:o}Tg.defaultProps=Eo;Tg.setDefaultProps=K$;Tg.currentInput=Xo;Object.assign({},I4,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Tg.setDefaultProps({render:Z4});function eP(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var tP=typeof window<"u"&&typeof document<"u";function s1(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function IO(){return tP&&document.createElement("div")}function e7(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function nP(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(t.hasOwnProperty(n)){if(!nP(e[n],t[n]))return!1}else return!1;return!0}else return!1}function t7(e){var t=[];return e.forEach(function(n){t.find(function(r){return nP(n,r)})||t.push(n)}),t}function n7(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:t7([].concat(((n=e.popperOptions)==null?void 0:n.modifiers)||[],((r=t.popperOptions)==null?void 0:r.modifiers)||[]))})})}var Iv=tP?$.useLayoutEffect:$.useEffect;function r7(e){var t=$.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function PO(e,t,n){n.split(/\s+/).forEach(function(r){r&&e.classList[t](r)})}var i7={name:"className",defaultValue:"",fn:function(t){var n=t.popper.firstElementChild,r=function(){var u;return!!((u=t.props.render)!=null&&u.$$tippy)};function i(){t.props.className&&!r()||PO(n,"add",t.props.className)}function o(){r()&&PO(n,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function o7(e){function t(n){var r=n.children,i=n.content,o=n.visible,a=n.singleton,u=n.render,l=n.reference,f=n.disabled,p=f===void 0?!1:f,m=n.ignoreAttributes,y=m===void 0?!0:m;n.__source,n.__self;var w=eP(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),b=o!==void 0,x=a!==void 0,k=$.useState(!1),O=k[0],N=k[1],E=$.useState({}),T=E[0],B=E[1],A=$.useState(),U=A[0],v=A[1],R=r7(function(){return{container:IO(),renders:1}}),C=Object.assign({ignoreAttributes:y},w,{content:R.container});b&&(C.trigger="manual",C.hideOnClick=!1),x&&(p=!0);var M=C,J=C.plugins||[];u&&(M=Object.assign({},C,{plugins:x&&a.data!=null?[].concat(J,[{fn:function(){return{onTrigger:function(K,Q){var H=a.data.children.find(function(X){var I=X.instance;return I.reference===Q.currentTarget});K.state.$$activeSingletonInstance=H.instance,v(H.content)}}}}]):J,render:function(){return{popper:R.container}}}));var P=[l].concat(r?[r.type]:[]);return Iv(function(){var D=l;l&&l.hasOwnProperty("current")&&(D=l.current);var q=e(D||R.ref||IO(),Object.assign({},M,{plugins:[i7].concat(C.plugins||[])}));return R.instance=q,p&&q.disable(),o&&q.show(),x&&a.hook({instance:q,content:i,props:M,setSingletonContent:v}),N(!0),function(){q.destroy(),a==null||a.cleanup(q)}},P),Iv(function(){var D;if(R.renders===1){R.renders++;return}var q=R.instance;q.setProps(n7(q.props,M)),(D=q.popperInstance)==null||D.forceUpdate(),p?q.disable():q.enable(),b&&(o?q.show():q.hide()),x&&a.hook({instance:q,content:i,props:M,setSingletonContent:v})}),Iv(function(){var D;if(u){var q=R.instance;q.setProps({popperOptions:Object.assign({},q.props.popperOptions,{modifiers:[].concat((((D=q.props.popperOptions)==null?void 0:D.modifiers)||[]).filter(function(K){var Q=K.name;return Q!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Q){var H,X=Q.state,I=(H=X.modifiersData)==null?void 0:H.hide;(T.placement!==X.placement||T.referenceHidden!==(I==null?void 0:I.isReferenceHidden)||T.escaped!==(I==null?void 0:I.hasPopperEscaped))&&B({placement:X.placement,referenceHidden:I==null?void 0:I.isReferenceHidden,escaped:I==null?void 0:I.hasPopperEscaped}),X.attributes.popper={}}}])})})}},[T.placement,T.referenceHidden,T.escaped].concat(P)),lt.createElement(lt.Fragment,null,r?$.cloneElement(r,{ref:function(q){R.ref=q,s1(r.ref,q)}}):null,O&&CJ.createPortal(u?u(e7(T),U,R.instance):i,R.container))}return t}var s7=function(e,t){return $.forwardRef(function(r,i){var o=r.children,a=eP(r,["children"]);return lt.createElement(e,Object.assign({},t,a),o?$.cloneElement(o,{ref:function(l){s1(i,l),s1(o.ref,l)}}):null)})},T_=s7(o7(Tg)),a7=function(t){var n=t.label,r=t["aria-label"],i=r===void 0?n:r,o=$u(t,["label","aria-label"]);return $.createElement(T_,ln({content:n,"aria-label":i,trigger:"mouseenter",hideOnClick:void 0},o))},c7=function(t){var n=document.createElement("textarea");n.value=t,n.setAttribute("readonly",""),n.style.position="absolute",n.style.left="-9999px",document.body.appendChild(n);var r=document.getSelection(),i=r&&r.rangeCount>0?r.getRangeAt(0):!1;if(n.select(),document.execCommand("copy"),document.body.removeChild(n),i){var o,a;(o=document.getSelection())==null||o.removeAllRanges(),(a=document.getSelection())==null||a.addRange(i)}};function rP(e){var t=$.useState(!1),n=t[0],r=t[1],i=$.useRef([]),o=function(){c7(e),r(!0),i.current.push(setTimeout(function(){return r(!1)},1250))};return $.useEffect(function(){return function(){return i.current.forEach(function(a){return clearTimeout(a)})}},[]),{value:e,onCopy:o,hasCopied:n}}var u7=u4(Gr(function(e,t){var n=Iw(),r=n[0],i=n[1],o=e.icon,a=e.iconSize,u=a===void 0?"20px":a,l=e.iconProps,f=l===void 0?{}:l,p=e.invert,m=e._hover,y=m===void 0?{}:m,w=e.isHovered,b=$u(e,["icon","iconSize","iconProps","invert","_hover","isHovered"]),x=r||w;return lt.createElement(p_,ln({placeItems:"center",borderRadius:"100%",transition:Pu,size:"36px",position:"relative",userSelect:"none",_hover:ln({cursor:"pointer"},y),color:"currentColor",ref:t},i,b),lt.createElement(o,ln({display:"block",size:u,color:"currentColor"},f)),lt.createElement(fe,{position:"absolute",left:0,top:0,borderRadius:"100%",size:"100%",bg:ce(p?"bg":"invert"),transition:Pu,opacity:x?.12:0}))}));class Og{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){const n={listener:t};return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const sg=typeof window>"u"||"Deno"in window;function eo(){}function l7(e,t){return typeof e=="function"?e(t):e}function a1(e){return typeof e=="number"&&e>=0&&e!==1/0}function iP(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Bm(e,t,n){return Mw(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function _l(e,t,n){return Mw(e)?[{...t,queryKey:e},n]:[e||{},t]}function MO(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:u}=e;if(Mw(a)){if(r){if(t.queryHash!==O_(a,t.options))return!1}else if(!Y0(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function LO(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:o}=e;if(Mw(o)){if(!t.options.mutationKey)return!1;if(n){if(Zd(t.options.mutationKey)!==Zd(o))return!1}else if(!Y0(t.options.mutationKey,o))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function O_(e,t){return((t==null?void 0:t.queryKeyHashFn)||Zd)(e)}function Zd(e){return JSON.stringify(e,(t,n)=>u1(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Y0(e,t){return oP(e,t)}function oP(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!oP(e[n],t[n])):!1}function sP(e,t){if(e===t)return e;const n=BO(e)&&BO(t);if(n||u1(e)&&u1(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,a=n?[]:{};let u=0;for(let l=0;l"u")return!0;const n=t.prototype;return!(!jO(n)||!n.hasOwnProperty("isPrototypeOf"))}function jO(e){return Object.prototype.toString.call(e)==="[object Object]"}function Mw(e){return Array.isArray(e)}function aP(e){return new Promise(t=>{setTimeout(t,e)})}function DO(e){aP(0).then(e)}function d7(){if(typeof AbortController=="function")return new AbortController}function l1(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?sP(e,t):t}class f7 extends Og{constructor(){super(),this.setup=t=>{if(!sg&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const X0=new f7,JO=["online","offline"];class h7 extends Og{constructor(){super(),this.setup=t=>{if(!sg&&window.addEventListener){const n=()=>t();return JO.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{JO.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const Z0=new h7;function p7(e){return Math.min(1e3*2**e,3e4)}function Lw(e){return(e??"online")==="online"?Z0.isOnline():!0}class cP{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function L0(e){return e instanceof cP}function uP(e){let t=!1,n=0,r=!1,i,o,a;const u=new Promise((k,O)=>{o=k,a=O}),l=k=>{r||(w(new cP(k)),e.abort==null||e.abort())},f=()=>{t=!0},p=()=>{t=!1},m=()=>!X0.isFocused()||e.networkMode!=="always"&&!Z0.isOnline(),y=k=>{r||(r=!0,e.onSuccess==null||e.onSuccess(k),i==null||i(),o(k))},w=k=>{r||(r=!0,e.onError==null||e.onError(k),i==null||i(),a(k))},b=()=>new Promise(k=>{i=O=>{const N=r||!m();return N&&k(O),N},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),x=()=>{if(r)return;let k;try{k=e.fn()}catch(O){k=Promise.reject(O)}Promise.resolve(k).then(y).catch(O=>{var N,E;if(r)return;const T=(N=e.retry)!=null?N:3,B=(E=e.retryDelay)!=null?E:p7,A=typeof B=="function"?B(n,O):B,U=T===!0||typeof T=="number"&&n{if(m())return b()}).then(()=>{t?w(O):x()})})};return Lw(e.networkMode)?x():b().then(x),{promise:u,cancel:l,continue:()=>(i==null?void 0:i())?u:Promise.resolve(),cancelRetry:f,continueRetry:p}}const N_=console;function m7(){let e=[],t=0,n=p=>{p()},r=p=>{p()};const i=p=>{let m;t++;try{m=p()}finally{t--,t||u()}return m},o=p=>{t?e.push(p):DO(()=>{n(p)})},a=p=>(...m)=>{o(()=>{p(...m)})},u=()=>{const p=e;e=[],p.length&&DO(()=>{r(()=>{p.forEach(m=>{n(m)})})})};return{batch:i,batchCalls:a,schedule:o,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p}}}const Qn=m7();class lP{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),a1(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(sg?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class g7 extends lP{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||N_,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||y7(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=l1(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(eo).catch(eo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!iP(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(b=>b.options.queryFn);w&&this.setOptions(w.options)}const a=d7(),u={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};l(u);const f=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(u)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),p={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:f};if(l(p),(r=this.options.behavior)==null||r.onFetch(p),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=p.fetchOptions)==null?void 0:i.meta)){var m;this.dispatch({type:"fetch",meta:(m=p.fetchOptions)==null?void 0:m.meta})}const y=w=>{if(L0(w)&&w.silent||this.dispatch({type:"error",error:w}),!L0(w)){var b,x,k,O;(b=(x=this.cache.config).onError)==null||b.call(x,w,this),(k=(O=this.cache.config).onSettled)==null||k.call(O,this.state.data,w,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=uP({fn:p.fetchFn,abort:a==null?void 0:a.abort.bind(a),onSuccess:w=>{var b,x,k,O;if(typeof w>"u"){y(new Error(this.queryHash+" data is undefined"));return}this.setData(w),(b=(x=this.cache.config).onSuccess)==null||b.call(x,w,this),(k=(O=this.cache.config).onSettled)==null||k.call(O,w,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:y,onFail:(w,b)=>{this.dispatch({type:"failed",failureCount:w,error:b})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var i,o;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:Lw(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(o=t.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return L0(a)&&a.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function y7(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class w7 extends Og{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const o=n.queryKey,a=(i=n.queryHash)!=null?i:O_(o,n);let u=this.get(a);return u||(u=new g7({cache:this,logger:t.getLogger(),queryKey:o,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(u)),u}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=_l(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>MO(r,i))}findAll(t,n){const[r]=_l(t,n);return Object.keys(r).length>0?this.queries.filter(i=>MO(r,i)):this.queries}notify(t){Qn.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}onFocus(){Qn.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class b7 extends lP{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||N_,this.observers=[],this.state=t.state||S7(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var U;return this.retryer=uP({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(v,R)=>{this.dispatch({type:"failed",failureCount:v,error:R})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(U=this.options.retry)!=null?U:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,o,a,u,l,f,p;if(!n){var m,y,w,b;this.dispatch({type:"loading",variables:this.options.variables}),await((m=(y=this.mutationCache.config).onMutate)==null?void 0:m.call(y,this.state.variables,this));const v=await((w=(b=this.options).onMutate)==null?void 0:w.call(b,this.state.variables));v!==this.state.context&&this.dispatch({type:"loading",context:v,variables:this.state.variables})}const U=await t();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,U,this.state.variables,this.state.context,this)),await((o=(a=this.options).onSuccess)==null?void 0:o.call(a,U,this.state.variables,this.state.context)),await((u=(l=this.mutationCache.config).onSettled)==null?void 0:u.call(l,U,null,this.state.variables,this.state.context,this)),await((f=(p=this.options).onSettled)==null?void 0:f.call(p,U,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:U}),U}catch(U){try{var x,k,O,N,E,T,B,A;throw await((x=(k=this.mutationCache.config).onError)==null?void 0:x.call(k,U,this.state.variables,this.state.context,this)),await((O=(N=this.options).onError)==null?void 0:O.call(N,U,this.state.variables,this.state.context)),await((E=(T=this.mutationCache.config).onSettled)==null?void 0:E.call(T,void 0,U,this.state.variables,this.state.context,this)),await((B=(A=this.options).onSettled)==null?void 0:B.call(A,void 0,U,this.state.variables,this.state.context)),U}finally{this.dispatch({type:"error",error:U})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Lw(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function S7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class v7 extends Og{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new b7({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){Qn.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>LO(t,n))}findAll(t){return this.mutations.filter(n=>LO(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return Qn.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(eo)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function x7(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,o,a;const u=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,l=(r=e.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,f=l==null?void 0:l.pageParam,p=(l==null?void 0:l.direction)==="forward",m=(l==null?void 0:l.direction)==="backward",y=((o=e.state.data)==null?void 0:o.pages)||[],w=((a=e.state.data)==null?void 0:a.pageParams)||[];let b=w,x=!1;const k=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>{var U;if((U=e.signal)!=null&&U.aborted)x=!0;else{var v;(v=e.signal)==null||v.addEventListener("abort",()=>{x=!0})}return e.signal}})},O=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),N=(A,U,v,R)=>(b=R?[U,...b]:[...b,U],R?[v,...A]:[...A,v]),E=(A,U,v,R)=>{if(x)return Promise.reject("Cancelled");if(typeof v>"u"&&!U&&A.length)return Promise.resolve(A);const C={queryKey:e.queryKey,pageParam:v,meta:e.options.meta};k(C);const M=O(C);return Promise.resolve(M).then(P=>N(A,v,P,R))};let T;if(!y.length)T=E([]);else if(p){const A=typeof f<"u",U=A?f:$O(e.options,y);T=E(y,A,U)}else if(m){const A=typeof f<"u",U=A?f:_7(e.options,y);T=E(y,A,U,!0)}else{b=[];const A=typeof e.options.getNextPageParam>"u";T=(u&&y[0]?u(y[0],0,y):!0)?E([],A,w[0]):Promise.resolve(N([],w[0],y[0]));for(let v=1;v{if(u&&y[v]?u(y[v],v,y):!0){const M=A?w[v]:$O(e.options,R);return E(R,A,M)}return Promise.resolve(N(R,w[v],y[v]))})}return T.then(A=>({pages:A,pageParams:b}))}}}}function $O(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function _7(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class k7{constructor(t={}){this.queryCache=t.queryCache||new w7,this.mutationCache=t.mutationCache||new v7,this.logger=t.logger||N_,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=X0.subscribe(()=>{X0.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Z0.subscribe(()=>{Z0.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=_l(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}ensureQueryData(t,n,r){const i=Bm(t,n,r),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.queryCache.find(t),o=i==null?void 0:i.state.data,a=l7(n,o);if(typeof a>"u")return;const u=Bm(t),l=this.defaultQueryOptions(u);return this.queryCache.build(this,l).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return Qn.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=_l(t,n),i=this.queryCache;Qn.batch(()=>{i.findAll(r).forEach(o=>{i.remove(o)})})}resetQueries(t,n,r){const[i,o]=_l(t,n,r),a=this.queryCache,u={type:"active",...i};return Qn.batch(()=>(a.findAll(i).forEach(l=>{l.reset()}),this.refetchQueries(u,o)))}cancelQueries(t,n,r){const[i,o={}]=_l(t,n,r);typeof o.revert>"u"&&(o.revert=!0);const a=Qn.batch(()=>this.queryCache.findAll(i).map(u=>u.cancel(o)));return Promise.all(a).then(eo).catch(eo)}invalidateQueries(t,n,r){const[i,o]=_l(t,n,r);return Qn.batch(()=>{var a,u;if(this.queryCache.findAll(i).forEach(f=>{f.invalidate()}),i.refetchType==="none")return Promise.resolve();const l={...i,type:(a=(u=i.refetchType)!=null?u:i.type)!=null?a:"active"};return this.refetchQueries(l,o)})}refetchQueries(t,n,r){const[i,o]=_l(t,n,r),a=Qn.batch(()=>this.queryCache.findAll(i).filter(l=>!l.isDisabled()).map(l=>{var f;return l.fetch(void 0,{...o,cancelRefetch:(f=o==null?void 0:o.cancelRefetch)!=null?f:!0,meta:{refetchPage:i.refetchPage}})}));let u=Promise.all(a).then(eo);return o!=null&&o.throwOnError||(u=u.catch(eo)),u}fetchQuery(t,n,r){const i=Bm(t,n,r),o=this.defaultQueryOptions(i);typeof o.retry>"u"&&(o.retry=!1);const a=this.queryCache.build(this,o);return a.isStaleByTime(o.staleTime)?a.fetch(o):Promise.resolve(a.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(eo).catch(eo)}fetchInfiniteQuery(t,n,r){const i=Bm(t,n,r);return i.behavior=x7(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(eo).catch(eo)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(i=>Zd(t)===Zd(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>Y0(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>Zd(t)===Zd(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>Y0(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=O_(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class R7 extends Og{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),qO(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d1(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d1(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),c1(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const o=this.hasListeners();o&&UO(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const a=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||a!==this.currentRefetchInterval)&&this.updateRefetchInterval(a)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t),r=this.createResult(n,t);return O7(this,r,t)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(eo)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),sg||this.currentResult.isStale||!a1(this.options.staleTime))return;const n=iP(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(sg||this.options.enabled===!1||!a1(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||X0.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,i=this.options,o=this.currentResult,a=this.currentResultState,u=this.currentResultOptions,l=t!==r,f=l?t.state:this.currentQueryInitialState,p=l?this.currentResult:this.previousQueryResult,{state:m}=t;let{dataUpdatedAt:y,error:w,errorUpdatedAt:b,fetchStatus:x,status:k}=m,O=!1,N=!1,E;if(n._optimisticResults){const v=this.hasListeners(),R=!v&&qO(t,n),C=v&&UO(t,r,n,i);(R||C)&&(x=Lw(t.options.networkMode)?"fetching":"paused",y||(k="loading")),n._optimisticResults==="isRestoring"&&(x="idle")}if(n.keepPreviousData&&!m.dataUpdatedAt&&p!=null&&p.isSuccess&&k!=="error")E=p.data,y=p.dataUpdatedAt,k=p.status,O=!0;else if(n.select&&typeof m.data<"u")if(o&&m.data===(a==null?void 0:a.data)&&n.select===this.selectFn)E=this.selectResult;else try{this.selectFn=n.select,E=n.select(m.data),E=l1(o==null?void 0:o.data,E,n),this.selectResult=E,this.selectError=null}catch(v){this.selectError=v}else E=m.data;if(typeof n.placeholderData<"u"&&typeof E>"u"&&k==="loading"){let v;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData))v=o.data;else if(v=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof v<"u")try{v=n.select(v),this.selectError=null}catch(R){this.selectError=R}typeof v<"u"&&(k="success",E=l1(o==null?void 0:o.data,v,n),N=!0)}this.selectError&&(w=this.selectError,E=this.selectResult,b=Date.now(),k="error");const T=x==="fetching",B=k==="loading",A=k==="error";return{status:k,fetchStatus:x,isLoading:B,isSuccess:k==="success",isError:A,isInitialLoading:B&&T,data:E,dataUpdatedAt:y,error:w,errorUpdatedAt:b,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:T,isRefetching:T&&!B,isLoadingError:A&&m.dataUpdatedAt===0,isPaused:x==="paused",isPlaceholderData:N,isPreviousData:O,isRefetchError:A&&m.dataUpdatedAt!==0,isStale:C_(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,c1(r,n))return;this.currentResult=r;const i={cache:!0},o=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,u=typeof a=="function"?a():a;if(u==="all"||!u&&!this.trackedProps.size)return!0;const l=new Set(u??this.trackedProps);return this.options.useErrorBoundary&&l.add("error"),Object.keys(this.currentResult).some(f=>{const p=f;return this.currentResult[p]!==n[p]&&l.has(p)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!L0(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){Qn.batch(()=>{if(t.onSuccess){var n,r,i,o;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(o=this.options).onSettled)==null||i.call(o,this.currentResult.data,null)}else if(t.onError){var a,u,l,f;(a=(u=this.options).onError)==null||a.call(u,this.currentResult.error),(l=(f=this.options).onSettled)==null||l.call(f,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:p})=>{p(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function T7(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qO(e,t){return T7(e,t)||e.state.dataUpdatedAt>0&&d1(e,t,t.refetchOnMount)}function d1(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&C_(e,t)}return!1}function UO(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&C_(e,n)}function C_(e,t){return e.isStaleByTime(t.staleTime)}function O7(e,t,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?t.isPlaceholderData:!c1(e.getCurrentResult(),t)}var Pv={exports:{}},Mv={};/** +`]);return C4=function(){return e},e}var $J=function(t){return{light:{color:t.colors.ink[900],bg:void 0,borderColor:"#E5E5EC",placeholderColor:t.colors.ink[400]},dark:{color:"white",bg:t.colors.ink[900],borderColor:t.colors.ink[600],placeholderColor:t.colors.ink[500]}}},Ew=$J(os).light,qJ=Ew.color,UJ=Ew.bg,E4=Ew.borderColor,Th=Ew.placeholderColor,HJ=ds(C4(),JJ,qJ,UJ,os==null||(cO=os.fonts)==null?void 0:cO.body,E4,Th,Th,Th),zJ=z0(Cw,{styles:HJ});os==null||(uO=os.fonts)==null||uO.body;var ie=Gr(function(e,t){return $.createElement(fe,ln({as:"span",display:"inline-block",ref:t},e))}),WJ=function(t){return lt.createElement(fe,ln({as:"span",ml:1,color:"red","aria-hidden":"true",children:"*"},t))},lO=Gr(function(e,t){var n=e.children,r=e.isDisabled,i=e.isRequired,o=qu(e,["children","isDisabled","isRequired","as"]);return lt.createElement(ie,ln({ref:t,mb:"extra-tight",opacity:r?.4:1,textAlign:"left",verticalAlign:"middle",display:"inline-block",textStyle:"body.small.medium"},o),n,i&<.createElement(WJ,null))});function VJ(e){var t=$.useRef(e);return $.useEffect(function(){t.current=e},[e]),t}function GJ(e,t,n,r){n===void 0&&(n=LJ?document:null);var i=VJ(t);return $.useEffect(function(){if(n){var o=function(u){i.current(u)};return n.addEventListener(e,o,r),function(){n.removeEventListener(e,o,r)}}},[e,n,r,i]),function(){var o;(o=n)==null||o.removeEventListener(e,i.current,r)}}var KJ=function(t){return lt.createElement(fe,ln({},t),lt.createElement("svg",{width:"100%",viewBox:"0 0 16 16",fill:"none"},lt.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16ZM7.9983 4C8.46541 4 8.84049 4.38536 8.82787 4.8523L8.72037 8.82986C8.70981 9.22031 8.39026 9.53134 7.99967 9.53134C7.60928 9.53134 7.28981 9.2206 7.279 8.83036L7.16874 4.85287C7.15579 4.38572 7.53096 4 7.9983 4ZM8.9199 11.0743C8.91607 11.5873 8.49058 12 7.99992 12C7.49392 12 7.0761 11.5873 7.07993 11.0743C7.0761 10.569 7.49392 10.1562 7.99992 10.1562C8.49058 10.1562 8.91607 10.569 8.9199 11.0743Z",fill:"currentColor"})))},Rv={exports:{}},Tv,dO;function QJ(){if(dO)return Tv;dO=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Tv=e,Tv}var Ov,fO;function YJ(){if(fO)return Ov;fO=1;var e=QJ();function t(){}function n(){}return n.resetWarningCache=t,Ov=function(){function r(a,u,l,f,p,m){if(m!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Ov}var hO;function XJ(){return hO||(hO=1,Rv.exports=YJ()()),Rv.exports}var ZJ=XJ();const Sd=Ju(ZJ);var e9={height:"48px",border:"1px solid",borderBottomColor:ce("border"),borderLeftColor:ce("border"),borderRightColor:ce("border"),borderTopColor:ce("border"),borderColor:ce("border"),bg:ce("bg"),_hover:{borderBottomColor:ce("border"),borderLeftColor:ce("border"),borderRightColor:ce("border"),borderTopColor:ce("border"),borderColor:ce("border")},_disabled:{bg:ce("bg-4"),cursor:"not-allowed",pointerEvents:"none"},_focus:{borderBottomColor:"rgba(170, 179, 255, 0.4)",borderLeftColor:"rgba(170, 179, 255, 0.4)",borderRightColor:"rgba(170, 179, 255, 0.4)",borderTopColor:"rgba(170, 179, 255, 0.4)",borderColor:"rgba(170, 179, 255, 0.4)",boxShadow:"0 0 0 1px rgba(170, 179, 255, 0.75)"},_invalid:{borderBottomColor:ce("feedback-alert"),borderLeftColor:ce("feedback-alert"),borderRightColor:ce("feedback-alert"),borderTopColor:ce("feedback-alert"),borderColor:ce("feedback-alert")}},t9={display:"flex",alignItems:"center",position:"relative",transition:"all 0.2s",outline:"none",borderRadius:"6px",p:"14px 16px"},n9=function(t){return ln({width:t.isFullWidth?"100%":void 0},t9,e9)},sr=lt.forwardRef(function(e,t){var n=e.as,r=n===void 0?"input":n,i=e["aria-label"],o=e["aria-describedby"],a=e.isReadOnly,u=e.isDisabled,l=e.isInvalid,f=e.isRequired,p=e.style,m=p===void 0?{}:p,y=qu(e,["as","aria-label","aria-describedby","isReadOnly","isDisabled","isInvalid","isRequired","style"]),w=n9(e);return lt.createElement(fe,ln({ref:t,as:r,_readOnly:a,"aria-readonly":a,disabled:u,"aria-label":i,"aria-invalid":l,required:f,"aria-required":f,"aria-disabled":u,"aria-describedby":o,textStyle:"body.small",style:ln({WebkitAppearance:"none"},m)},w,{width:"100%"},y))});sr.displayName="Input";var Nv;function r9(){if(Nv!==void 0)return Nv;var e=!1,t={get passive(){e=!0}},n=function(){};return window.addEventListener("t",n,t),window.removeEventListener("t",n,t),Nv=e,e}var i9=$.useLayoutEffect,o9=function(t){var n=$.useRef(t);return i9(function(){n.current=t}),n},ii="top",io="bottom",oo="right",oi="left",y_="auto",kg=[ii,io,oo,oi],Ih="start",ig="end",s9="clippingParents",A4="viewport",nm="popper",a9="reference",pO=kg.reduce(function(e,t){return e.concat([t+"-"+Ih,t+"-"+ig])},[]),F4=[].concat(kg,[y_]).reduce(function(e,t){return e.concat([t,t+"-"+Ih,t+"-"+ig])},[]),c9="beforeRead",u9="read",l9="afterRead",d9="beforeMain",f9="main",h9="afterMain",p9="beforeWrite",m9="write",g9="afterWrite",y9=[c9,u9,l9,d9,f9,h9,p9,m9,g9];function ss(e){return e?(e.nodeName||"").toLowerCase():null}function Ii(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ff(e){var t=Ii(e).Element;return e instanceof t||e instanceof Element}function ro(e){var t=Ii(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function w_(e){if(typeof ShadowRoot>"u")return!1;var t=Ii(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function w9(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!ro(o)||!ss(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var u=i[a];u===!1?o.removeAttribute(a):o.setAttribute(a,u===!0?"":u)}))})}function b9(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(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=a.reduce(function(l,f){return l[f]="",l},{});!ro(i)||!ss(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const I4={name:"applyStyles",enabled:!0,phase:"write",fn:w9,effect:b9,requires:["computeStyles"]};function is(e){return e.split("-")[0]}var nf=Math.max,V0=Math.min,Ph=Math.round;function t1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function P4(){return!/^((?!chrome|android).)*safari/i.test(t1())}function Mh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&ro(e)&&(i=e.offsetWidth>0&&Ph(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Ph(r.height)/e.offsetHeight||1);var a=ff(e)?Ii(e):window,u=a.visualViewport,l=!P4()&&n,f=(r.left+(l&&u?u.offsetLeft:0))/i,p=(r.top+(l&&u?u.offsetTop:0))/o,m=r.width/i,y=r.height/o;return{width:m,height:y,top:p,right:f+m,bottom:p+y,left:f,x:f,y:p}}function b_(e){var t=Mh(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 M4(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w_(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Bu(e){return Ii(e).getComputedStyle(e)}function S9(e){return["table","td","th"].indexOf(ss(e))>=0}function ql(e){return((ff(e)?e.ownerDocument:e.document)||window.document).documentElement}function Aw(e){return ss(e)==="html"?e:e.assignedSlot||e.parentNode||(w_(e)?e.host:null)||ql(e)}function mO(e){return!ro(e)||Bu(e).position==="fixed"?null:e.offsetParent}function v9(e){var t=/firefox/i.test(t1()),n=/Trident/i.test(t1());if(n&&ro(e)){var r=Bu(e);if(r.position==="fixed")return null}var i=Aw(e);for(w_(i)&&(i=i.host);ro(i)&&["html","body"].indexOf(ss(i))<0;){var o=Bu(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Rg(e){for(var t=Ii(e),n=mO(e);n&&S9(n)&&Bu(n).position==="static";)n=mO(n);return n&&(ss(n)==="html"||ss(n)==="body"&&Bu(n).position==="static")?t:n||v9(e)||t}function S_(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Hm(e,t,n){return nf(e,V0(t,n))}function x9(e,t,n){var r=Hm(e,t,n);return r>n?n:r}function L4(){return{top:0,right:0,bottom:0,left:0}}function B4(e){return Object.assign({},L4(),e)}function j4(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var _9=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,B4(typeof t!="number"?t:j4(t,kg))};function k9(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=is(n.placement),l=S_(u),f=[oi,oo].indexOf(u)>=0,p=f?"height":"width";if(!(!o||!a)){var m=_9(i.padding,n),y=b_(o),w=l==="y"?ii:oi,b=l==="y"?io:oo,x=n.rects.reference[p]+n.rects.reference[l]-a[l]-n.rects.popper[p],_=a[l]-n.rects.reference[l],O=Rg(o),N=O?l==="y"?O.clientHeight||0:O.clientWidth||0:0,E=x/2-_/2,T=m[w],B=N-y[p]-m[b],A=N/2-y[p]/2+E,U=Hm(T,A,B),v=l;n.modifiersData[r]=(t={},t[v]=U,t.centerOffset=U-A,t)}}function R9(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||M4(t.elements.popper,i)&&(t.elements.arrow=i))}const T9={name:"arrow",enabled:!0,phase:"main",fn:k9,effect:R9,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Lh(e){return e.split("-")[1]}var O9={top:"auto",right:"auto",bottom:"auto",left:"auto"};function N9(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Ph(n*i)/i||0,y:Ph(r*i)/i||0}}function gO(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,u=e.position,l=e.gpuAcceleration,f=e.adaptive,p=e.roundOffsets,m=e.isFixed,y=a.x,w=y===void 0?0:y,b=a.y,x=b===void 0?0:b,_=typeof p=="function"?p({x:w,y:x}):{x:w,y:x};w=_.x,x=_.y;var O=a.hasOwnProperty("x"),N=a.hasOwnProperty("y"),E=oi,T=ii,B=window;if(f){var A=Rg(n),U="clientHeight",v="clientWidth";if(A===Ii(n)&&(A=ql(n),Bu(A).position!=="static"&&u==="absolute"&&(U="scrollHeight",v="scrollWidth")),A=A,i===ii||(i===oi||i===oo)&&o===ig){T=io;var R=m&&A===B&&B.visualViewport?B.visualViewport.height:A[U];x-=R-r.height,x*=l?1:-1}if(i===oi||(i===ii||i===io)&&o===ig){E=oo;var C=m&&A===B&&B.visualViewport?B.visualViewport.width:A[v];w-=C-r.width,w*=l?1:-1}}var M=Object.assign({position:u},f&&O9),J=p===!0?N9({x:w,y:x},Ii(n)):{x:w,y:x};if(w=J.x,x=J.y,l){var P;return Object.assign({},M,(P={},P[T]=N?"0":"",P[E]=O?"0":"",P.transform=(B.devicePixelRatio||1)<=1?"translate("+w+"px, "+x+"px)":"translate3d("+w+"px, "+x+"px, 0)",P))}return Object.assign({},M,(t={},t[T]=N?x+"px":"",t[E]=O?w+"px":"",t.transform="",t))}function C9(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,l=u===void 0?!0:u,f={placement:is(t.placement),variation:Lh(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gO(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gO(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const E9={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:C9,data:{}};var r0={passive:!0};function A9(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,u=a===void 0?!0:a,l=Ii(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&f.forEach(function(p){p.addEventListener("scroll",n.update,r0)}),u&&l.addEventListener("resize",n.update,r0),function(){o&&f.forEach(function(p){p.removeEventListener("scroll",n.update,r0)}),u&&l.removeEventListener("resize",n.update,r0)}}const F9={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:A9,data:{}};var I9={left:"right",right:"left",bottom:"top",top:"bottom"};function M0(e){return e.replace(/left|right|bottom|top/g,function(t){return I9[t]})}var P9={start:"end",end:"start"};function yO(e){return e.replace(/start|end/g,function(t){return P9[t]})}function v_(e){var t=Ii(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function x_(e){return Mh(ql(e)).left+v_(e).scrollLeft}function M9(e,t){var n=Ii(e),r=ql(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,l=0;if(i){o=i.width,a=i.height;var f=P4();(f||!f&&t==="fixed")&&(u=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:u+x_(e),y:l}}function L9(e){var t,n=ql(e),r=v_(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=nf(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=nf(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+x_(e),l=-r.scrollTop;return Bu(i||n).direction==="rtl"&&(u+=nf(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:l}}function __(e){var t=Bu(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function D4(e){return["html","body","#document"].indexOf(ss(e))>=0?e.ownerDocument.body:ro(e)&&__(e)?e:D4(Aw(e))}function zm(e,t){var n;t===void 0&&(t=[]);var r=D4(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Ii(r),a=i?[o].concat(o.visualViewport||[],__(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(zm(Aw(a)))}function n1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function B9(e,t){var n=Mh(e,!1,t==="fixed");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}function wO(e,t,n){return t===A4?n1(M9(e,n)):ff(t)?B9(t,n):n1(L9(ql(e)))}function j9(e){var t=zm(Aw(e)),n=["absolute","fixed"].indexOf(Bu(e).position)>=0,r=n&&ro(e)?Rg(e):e;return ff(r)?t.filter(function(i){return ff(i)&&M4(i,r)&&ss(i)!=="body"}):[]}function D9(e,t,n,r){var i=t==="clippingParents"?j9(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(l,f){var p=wO(e,f,r);return l.top=nf(p.top,l.top),l.right=V0(p.right,l.right),l.bottom=V0(p.bottom,l.bottom),l.left=nf(p.left,l.left),l},wO(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 J4(e){var t=e.reference,n=e.element,r=e.placement,i=r?is(r):null,o=r?Lh(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,l;switch(i){case ii:l={x:a,y:t.y-n.height};break;case io:l={x:a,y:t.y+t.height};break;case oo:l={x:t.x+t.width,y:u};break;case oi:l={x:t.x-n.width,y:u};break;default:l={x:t.x,y:t.y}}var f=i?S_(i):null;if(f!=null){var p=f==="y"?"height":"width";switch(o){case Ih:l[f]=l[f]-(t[p]/2-n[p]/2);break;case ig:l[f]=l[f]+(t[p]/2-n[p]/2);break}}return l}function og(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,u=n.boundary,l=u===void 0?s9:u,f=n.rootBoundary,p=f===void 0?A4:f,m=n.elementContext,y=m===void 0?nm:m,w=n.altBoundary,b=w===void 0?!1:w,x=n.padding,_=x===void 0?0:x,O=B4(typeof _!="number"?_:j4(_,kg)),N=y===nm?a9:nm,E=e.rects.popper,T=e.elements[b?N:y],B=D9(ff(T)?T:T.contextElement||ql(e.elements.popper),l,p,a),A=Mh(e.elements.reference),U=J4({reference:A,element:E,strategy:"absolute",placement:i}),v=n1(Object.assign({},E,U)),R=y===nm?v:A,C={top:B.top-R.top+O.top,bottom:R.bottom-B.bottom+O.bottom,left:B.left-R.left+O.left,right:R.right-B.right+O.right},M=e.modifiersData.offset;if(y===nm&&M){var J=M[i];Object.keys(C).forEach(function(P){var D=[oo,io].indexOf(P)>=0?1:-1,q=[ii,io].indexOf(P)>=0?"y":"x";C[P]+=J[q]*D})}return C}function J9(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,u=n.flipVariations,l=n.allowedAutoPlacements,f=l===void 0?F4:l,p=Lh(r),m=p?u?pO:pO.filter(function(b){return Lh(b)===p}):kg,y=m.filter(function(b){return f.indexOf(b)>=0});y.length===0&&(y=m);var w=y.reduce(function(b,x){return b[x]=og(e,{placement:x,boundary:i,rootBoundary:o,padding:a})[is(x)],b},{});return Object.keys(w).sort(function(b,x){return w[b]-w[x]})}function $9(e){if(is(e)===y_)return[];var t=M0(e);return[yO(e),t,yO(t)]}function q9(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!0:a,l=n.fallbackPlacements,f=n.padding,p=n.boundary,m=n.rootBoundary,y=n.altBoundary,w=n.flipVariations,b=w===void 0?!0:w,x=n.allowedAutoPlacements,_=t.options.placement,O=is(_),N=O===_,E=l||(N||!b?[M0(_)]:$9(_)),T=[_].concat(E).reduce(function(be,ke){return be.concat(is(ke)===y_?J9(t,{placement:ke,boundary:p,rootBoundary:m,padding:f,flipVariations:b,allowedAutoPlacements:x}):ke)},[]),B=t.rects.reference,A=t.rects.popper,U=new Map,v=!0,R=T[0],C=0;C=0,q=D?"width":"height",K=og(t,{placement:M,boundary:p,rootBoundary:m,altBoundary:y,padding:f}),Q=D?P?oo:oi:P?io:ii;B[q]>A[q]&&(Q=M0(Q));var H=M0(Q),X=[];if(o&&X.push(K[J]<=0),u&&X.push(K[Q]<=0,K[H]<=0),X.every(function(be){return be})){R=M,v=!1;break}U.set(M,X)}if(v)for(var I=b?3:1,te=function(ke){var Ne=T.find(function(Xe){var Ze=U.get(Xe);if(Ze)return Ze.slice(0,ke).every(function(Nt){return Nt})});if(Ne)return R=Ne,"break"},ge=I;ge>0;ge--){var oe=te(ge);if(oe==="break")break}t.placement!==R&&(t.modifiersData[r]._skip=!0,t.placement=R,t.reset=!0)}}const U9={name:"flip",enabled:!0,phase:"main",fn:q9,requiresIfExists:["offset"],data:{_skip:!1}};function bO(e,t,n){return n===void 0&&(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 SO(e){return[ii,oo,io,oi].some(function(t){return e[t]>=0})}function H9(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=og(t,{elementContext:"reference"}),u=og(t,{altBoundary:!0}),l=bO(a,r),f=bO(u,i,o),p=SO(l),m=SO(f);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:f,isReferenceHidden:p,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":m})}const z9={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:H9};function W9(e,t,n){var r=is(e),i=[oi,ii].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],u=o[1];return a=a||0,u=(u||0)*i,[oi,oo].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function V9(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=F4.reduce(function(p,m){return p[m]=W9(m,t.rects,o),p},{}),u=a[t.placement],l=u.x,f=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=a}const G9={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:V9};function K9(e){var t=e.state,n=e.name;t.modifiersData[n]=J4({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Q9={name:"popperOffsets",enabled:!0,phase:"read",fn:K9,data:{}};function Y9(e){return e==="x"?"y":"x"}function X9(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!1:a,l=n.boundary,f=n.rootBoundary,p=n.altBoundary,m=n.padding,y=n.tether,w=y===void 0?!0:y,b=n.tetherOffset,x=b===void 0?0:b,_=og(t,{boundary:l,rootBoundary:f,padding:m,altBoundary:p}),O=is(t.placement),N=Lh(t.placement),E=!N,T=S_(O),B=Y9(T),A=t.modifiersData.popperOffsets,U=t.rects.reference,v=t.rects.popper,R=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,C=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,J={x:0,y:0};if(A){if(o){var P,D=T==="y"?ii:oi,q=T==="y"?io:oo,K=T==="y"?"height":"width",Q=A[T],H=Q+_[D],X=Q-_[q],I=w?-v[K]/2:0,te=N===Ih?U[K]:v[K],ge=N===Ih?-v[K]:-U[K],oe=t.elements.arrow,be=w&&oe?b_(oe):{width:0,height:0},ke=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:L4(),Ne=ke[D],Xe=ke[q],Ze=Hm(0,U[K],be[K]),Nt=E?U[K]/2-I-Ze-Ne-C.mainAxis:te-Ze-Ne-C.mainAxis,nn=E?-U[K]/2+I+Ze+Xe+C.mainAxis:ge+Ze+Xe+C.mainAxis,kt=t.elements.arrow&&Rg(t.elements.arrow),En=kt?T==="y"?kt.clientTop||0:kt.clientLeft||0:0,Rt=(P=M==null?void 0:M[T])!=null?P:0,Ct=Q+Nt-Rt-En,gt=Q+nn-Rt,hn=Hm(w?V0(H,Ct):H,Q,w?nf(X,gt):X);A[T]=hn,J[T]=hn-Q}if(u){var An,cr=T==="x"?ii:oi,zn=T==="x"?io:oo,qt=A[B],on=B==="y"?"height":"width",ae=qt+_[cr],Ee=qt-_[zn],Pe=[ii,oi].indexOf(O)!==-1,Be=(An=M==null?void 0:M[B])!=null?An:0,it=Pe?ae:qt-U[on]-v[on]-Be+C.altAxis,ht=Pe?qt+U[on]+v[on]-Be-C.altAxis:Ee,Tt=w&&Pe?x9(it,qt,ht):Hm(w?it:ae,qt,w?ht:Ee);A[B]=Tt,J[B]=Tt-qt}t.modifiersData[r]=J}}const Z9={name:"preventOverflow",enabled:!0,phase:"main",fn:X9,requiresIfExists:["offset"]};function e$(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function t$(e){return e===Ii(e)||!ro(e)?v_(e):e$(e)}function n$(e){var t=e.getBoundingClientRect(),n=Ph(t.width)/e.offsetWidth||1,r=Ph(t.height)/e.offsetHeight||1;return n!==1||r!==1}function r$(e,t,n){n===void 0&&(n=!1);var r=ro(t),i=ro(t)&&n$(t),o=ql(t),a=Mh(e,i,n),u={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((ss(t)!=="body"||__(o))&&(u=t$(t)),ro(t)?(l=Mh(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=x_(o))),{x:a.left+u.scrollLeft-l.x,y:a.top+u.scrollTop-l.y,width:a.width,height:a.height}}function i$(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(u){if(!n.has(u)){var l=t.get(u);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function o$(e){var t=i$(e);return y9.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function s$(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function a$(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var vO={placement:"bottom",modifiers:[],strategy:"absolute"};function xO(){for(var e=arguments.length,t=new Array(e),n=0;n0},e.prototype.connect_=function(){!r1||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),w$?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!r1||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=y$.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),q4=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof Bh(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new O$(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Bh(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new N$(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),H4=typeof WeakMap<"u"?new WeakMap:new $4,z4=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=b$.getInstance(),r=new C$(t,n,this);H4.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){z4.prototype[e]=function(){var t;return(t=H4.get(this))[e].apply(t,arguments)}});(function(){return typeof G0.ResizeObserver<"u"?G0.ResizeObserver:z4})();function k_(){const[e,t]=lt.useState(!1),n=lt.useMemo(()=>({onFocus:r=>void t(!0),onBlur:r=>void t(!1)}),[]);return[e,n]}function Iw(){const[e,t]=lt.useState(!1),n=lt.useMemo(()=>({onMouseEnter:r=>void t(!0),onMouseLeave:r=>void t(!1)}),[]);return[e,n]}var E$="tippy-box",W4="tippy-content",A$="tippy-backdrop",V4="tippy-arrow",G4="tippy-svg-arrow",Hd={passive:!0,capture:!0},K4=function(){return document.body};function Cv(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function R_(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Q4(e,t){return typeof e=="function"?e.apply(void 0,t):e}function kO(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function F$(e){return e.split(/\s+/).filter(Boolean)}function lh(e){return[].concat(e)}function RO(e,t){e.indexOf(t)===-1&&e.push(t)}function I$(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function P$(e){return e.split("-")[0]}function Q0(e){return[].slice.call(e)}function TO(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Wm(){return document.createElement("div")}function Pw(e){return["Element","Fragment"].some(function(t){return R_(e,t)})}function M$(e){return R_(e,"NodeList")}function L$(e){return R_(e,"MouseEvent")}function B$(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function j$(e){return Pw(e)?[e]:M$(e)?Q0(e):Array.isArray(e)?e:Q0(document.querySelectorAll(e))}function Ev(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function OO(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function D$(e){var t,n=lh(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function J$(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,u=i.props,l=u.interactiveBorder,f=P$(a.placement),p=a.modifiersData.offset;if(!p)return!0;var m=f==="bottom"?p.top.y:0,y=f==="top"?p.bottom.y:0,w=f==="right"?p.left.x:0,b=f==="left"?p.right.x:0,x=o.top-r+m>l,_=r-o.bottom-y>l,O=o.left-n+w>l,N=n-o.right-b>l;return x||_||O||N})}function Av(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function NO(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Xo={isTouch:!1},CO=0;function $$(){Xo.isTouch||(Xo.isTouch=!0,window.performance&&document.addEventListener("mousemove",Y4))}function Y4(){var e=performance.now();e-CO<20&&(Xo.isTouch=!1,document.removeEventListener("mousemove",Y4)),CO=e}function q$(){var e=document.activeElement;if(B$(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function U$(){document.addEventListener("touchstart",$$,Hd),window.addEventListener("blur",q$)}var H$=typeof window<"u"&&typeof document<"u",z$=H$?!!window.msCrypto:!1,W$={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},V$={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Eo=Object.assign({appendTo:K4,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},W$,V$),G$=Object.keys(Eo),K$=function(t){var n=Object.keys(t);n.forEach(function(r){Eo[r]=t[r]})};function X4(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var u;r[o]=e[o]!==void 0?e[o]:(u=Eo[o])!=null?u:a}return r},{});return Object.assign({},e,n)}function Q$(e,t){var n=t?Object.keys(X4(Object.assign({},Eo,{plugins:t}))):G$,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function EO(e,t){var n=Object.assign({},t,{content:Q4(t.content,[e])},t.ignoreAttributes?{}:Q$(e,t.plugins));return n.aria=Object.assign({},Eo.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var Y$=function(){return"innerHTML"};function i1(e,t){e[Y$()]=t}function AO(e){var t=Wm();return e===!0?t.className=V4:(t.className=G4,Pw(e)?t.appendChild(e):i1(t,e)),t}function FO(e,t){Pw(t.content)?(i1(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?i1(e,t.content):e.textContent=t.content)}function o1(e){var t=e.firstElementChild,n=Q0(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(W4)}),arrow:n.find(function(r){return r.classList.contains(V4)||r.classList.contains(G4)}),backdrop:n.find(function(r){return r.classList.contains(A$)})}}function Z4(e){var t=Wm(),n=Wm();n.className=E$,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Wm();r.className=W4,r.setAttribute("data-state","hidden"),FO(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var u=o1(t),l=u.box,f=u.content,p=u.arrow;a.theme?l.setAttribute("data-theme",a.theme):l.removeAttribute("data-theme"),typeof a.animation=="string"?l.setAttribute("data-animation",a.animation):l.removeAttribute("data-animation"),a.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?l.setAttribute("role",a.role):l.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&FO(f,e.props),a.arrow?p?o.arrow!==a.arrow&&(l.removeChild(p),l.appendChild(AO(a.arrow))):l.appendChild(AO(a.arrow)):p&&l.removeChild(p)}return{popper:t,onUpdate:i}}Z4.$$tippy=!0;var X$=1,i0=[],Fv=[];function Z$(e,t){var n=EO(e,Object.assign({},Eo,X4(TO(t)))),r,i,o,a=!1,u=!1,l=!1,f=!1,p,m,y,w=[],b=kO(Ct,n.interactiveDebounce),x,_=X$++,O=null,N=I$(n.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},T={id:_,reference:e,popper:Wm(),popperInstance:O,props:n,state:E,plugins:N,clearDelayTimeouts:it,setProps:ht,setContent:Tt,show:Bn,hide:Sr,hideWithInteractivity:ur,enable:Pe,disable:Be,unmount:Kr,destroy:le};if(!n.render)return T;var B=n.render(T),A=B.popper,U=B.onUpdate;A.setAttribute("data-tippy-root",""),A.id="tippy-"+T.id,T.popper=A,e._tippy=T,A._tippy=T;var v=N.map(function(z){return z.fn(T)}),R=e.hasAttribute("aria-expanded");return kt(),I(),Q(),H("onCreate",[T]),n.showOnCreate&&ae(),A.addEventListener("mouseenter",function(){T.props.interactive&&T.state.isVisible&&T.clearDelayTimeouts()}),A.addEventListener("mouseleave",function(){T.props.interactive&&T.props.trigger.indexOf("mouseenter")>=0&&D().addEventListener("mousemove",b)}),T;function C(){var z=T.props.touch;return Array.isArray(z)?z:[z,0]}function M(){return C()[0]==="hold"}function J(){var z;return!!((z=T.props.render)!=null&&z.$$tippy)}function P(){return x||e}function D(){var z=P().parentNode;return z?D$(z):document}function q(){return o1(A)}function K(z){return T.state.isMounted&&!T.state.isVisible||Xo.isTouch||p&&p.type==="focus"?0:Cv(T.props.delay,z?0:1,Eo.delay)}function Q(z){z===void 0&&(z=!1),A.style.pointerEvents=T.props.interactive&&!z?"":"none",A.style.zIndex=""+T.props.zIndex}function H(z,ne,pe){if(pe===void 0&&(pe=!0),v.forEach(function(Re){Re[z]&&Re[z].apply(Re,ne)}),pe){var Ce;(Ce=T.props)[z].apply(Ce,ne)}}function X(){var z=T.props.aria;if(z.content){var ne="aria-"+z.content,pe=A.id,Ce=lh(T.props.triggerTarget||e);Ce.forEach(function(Re){var je=Re.getAttribute(ne);if(T.state.isVisible)Re.setAttribute(ne,je?je+" "+pe:pe);else{var Je=je&&je.replace(pe,"").trim();Je?Re.setAttribute(ne,Je):Re.removeAttribute(ne)}})}}function I(){if(!(R||!T.props.aria.expanded)){var z=lh(T.props.triggerTarget||e);z.forEach(function(ne){T.props.interactive?ne.setAttribute("aria-expanded",T.state.isVisible&&ne===P()?"true":"false"):ne.removeAttribute("aria-expanded")})}}function te(){D().removeEventListener("mousemove",b),i0=i0.filter(function(z){return z!==b})}function ge(z){if(!(Xo.isTouch&&(l||z.type==="mousedown"))){var ne=z.composedPath&&z.composedPath()[0]||z.target;if(!(T.props.interactive&&NO(A,ne))){if(lh(T.props.triggerTarget||e).some(function(pe){return NO(pe,ne)})){if(Xo.isTouch||T.state.isVisible&&T.props.trigger.indexOf("click")>=0)return}else H("onClickOutside",[T,z]);T.props.hideOnClick===!0&&(T.clearDelayTimeouts(),T.hide(),u=!0,setTimeout(function(){u=!1}),T.state.isMounted||Ne())}}}function oe(){l=!0}function be(){l=!1}function ke(){var z=D();z.addEventListener("mousedown",ge,!0),z.addEventListener("touchend",ge,Hd),z.addEventListener("touchstart",be,Hd),z.addEventListener("touchmove",oe,Hd)}function Ne(){var z=D();z.removeEventListener("mousedown",ge,!0),z.removeEventListener("touchend",ge,Hd),z.removeEventListener("touchstart",be,Hd),z.removeEventListener("touchmove",oe,Hd)}function Xe(z,ne){Nt(z,function(){!T.state.isVisible&&A.parentNode&&A.parentNode.contains(A)&&ne()})}function Ze(z,ne){Nt(z,ne)}function Nt(z,ne){var pe=q().box;function Ce(Re){Re.target===pe&&(Av(pe,"remove",Ce),ne())}if(z===0)return ne();Av(pe,"remove",m),Av(pe,"add",Ce),m=Ce}function nn(z,ne,pe){pe===void 0&&(pe=!1);var Ce=lh(T.props.triggerTarget||e);Ce.forEach(function(Re){Re.addEventListener(z,ne,pe),w.push({node:Re,eventType:z,handler:ne,options:pe})})}function kt(){M()&&(nn("touchstart",Rt,{passive:!0}),nn("touchend",gt,{passive:!0})),F$(T.props.trigger).forEach(function(z){if(z!=="manual")switch(nn(z,Rt),z){case"mouseenter":nn("mouseleave",gt);break;case"focus":nn(z$?"focusout":"blur",hn);break;case"focusin":nn("focusout",hn);break}})}function En(){w.forEach(function(z){var ne=z.node,pe=z.eventType,Ce=z.handler,Re=z.options;ne.removeEventListener(pe,Ce,Re)}),w=[]}function Rt(z){var ne,pe=!1;if(!(!T.state.isEnabled||An(z)||u)){var Ce=((ne=p)==null?void 0:ne.type)==="focus";p=z,x=z.currentTarget,I(),!T.state.isVisible&&L$(z)&&i0.forEach(function(Re){return Re(z)}),z.type==="click"&&(T.props.trigger.indexOf("mouseenter")<0||a)&&T.props.hideOnClick!==!1&&T.state.isVisible?pe=!0:ae(z),z.type==="click"&&(a=!pe),pe&&!Ce&&Ee(z)}}function Ct(z){var ne=z.target,pe=P().contains(ne)||A.contains(ne);if(!(z.type==="mousemove"&&pe)){var Ce=on().concat(A).map(function(Re){var je,Je=Re._tippy,Le=(je=Je.popperInstance)==null?void 0:je.state;return Le?{popperRect:Re.getBoundingClientRect(),popperState:Le,props:n}:null}).filter(Boolean);J$(Ce,z)&&(te(),Ee(z))}}function gt(z){var ne=An(z)||T.props.trigger.indexOf("click")>=0&&a;if(!ne){if(T.props.interactive){T.hideWithInteractivity(z);return}Ee(z)}}function hn(z){T.props.trigger.indexOf("focusin")<0&&z.target!==P()||T.props.interactive&&z.relatedTarget&&A.contains(z.relatedTarget)||Ee(z)}function An(z){return Xo.isTouch?M()!==z.type.indexOf("touch")>=0:!1}function cr(){zn();var z=T.props,ne=z.popperOptions,pe=z.placement,Ce=z.offset,Re=z.getReferenceClientRect,je=z.moveTransition,Je=J()?o1(A).arrow:null,Le=Re?{getBoundingClientRect:Re,contextElement:Re.contextElement||P()}:e,Qe={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(V){var L=V.state;if(J()){var G=q(),Z=G.box;["placement","reference-hidden","escaped"].forEach(function(de){de==="placement"?Z.setAttribute("data-placement",L.placement):L.attributes.popper["data-popper-"+de]?Z.setAttribute("data-"+de,""):Z.removeAttribute("data-"+de)}),L.attributes.popper={}}}},dt=[{name:"offset",options:{offset:Ce}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!je}},Qe];J()&&Je&&dt.push({name:"arrow",options:{element:Je,padding:3}}),dt.push.apply(dt,(ne==null?void 0:ne.modifiers)||[]),T.popperInstance=l$(Le,A,Object.assign({},ne,{placement:pe,onFirstUpdate:y,modifiers:dt}))}function zn(){T.popperInstance&&(T.popperInstance.destroy(),T.popperInstance=null)}function qt(){var z=T.props.appendTo,ne,pe=P();T.props.interactive&&z===K4||z==="parent"?ne=pe.parentNode:ne=Q4(z,[pe]),ne.contains(A)||ne.appendChild(A),T.state.isMounted=!0,cr()}function on(){return Q0(A.querySelectorAll("[data-tippy-root]"))}function ae(z){T.clearDelayTimeouts(),z&&H("onTrigger",[T,z]),ke();var ne=K(!0),pe=C(),Ce=pe[0],Re=pe[1];Xo.isTouch&&Ce==="hold"&&Re&&(ne=Re),ne?r=setTimeout(function(){T.show()},ne):T.show()}function Ee(z){if(T.clearDelayTimeouts(),H("onUntrigger",[T,z]),!T.state.isVisible){Ne();return}if(!(T.props.trigger.indexOf("mouseenter")>=0&&T.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(z.type)>=0&&a)){var ne=K(!1);ne?i=setTimeout(function(){T.state.isVisible&&T.hide()},ne):o=requestAnimationFrame(function(){T.hide()})}}function Pe(){T.state.isEnabled=!0}function Be(){T.hide(),T.state.isEnabled=!1}function it(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function ht(z){if(!T.state.isDestroyed){H("onBeforeUpdate",[T,z]),En();var ne=T.props,pe=EO(e,Object.assign({},ne,TO(z),{ignoreAttributes:!0}));T.props=pe,kt(),ne.interactiveDebounce!==pe.interactiveDebounce&&(te(),b=kO(Ct,pe.interactiveDebounce)),ne.triggerTarget&&!pe.triggerTarget?lh(ne.triggerTarget).forEach(function(Ce){Ce.removeAttribute("aria-expanded")}):pe.triggerTarget&&e.removeAttribute("aria-expanded"),I(),Q(),U&&U(ne,pe),T.popperInstance&&(cr(),on().forEach(function(Ce){requestAnimationFrame(Ce._tippy.popperInstance.forceUpdate)})),H("onAfterUpdate",[T,z])}}function Tt(z){T.setProps({content:z})}function Bn(){var z=T.state.isVisible,ne=T.state.isDestroyed,pe=!T.state.isEnabled,Ce=Xo.isTouch&&!T.props.touch,Re=Cv(T.props.duration,0,Eo.duration);if(!(z||ne||pe||Ce)&&!P().hasAttribute("disabled")&&(H("onShow",[T],!1),T.props.onShow(T)!==!1)){if(T.state.isVisible=!0,J()&&(A.style.visibility="visible"),Q(),ke(),T.state.isMounted||(A.style.transition="none"),J()){var je=q(),Je=je.box,Le=je.content;Ev([Je,Le],0)}y=function(){var dt;if(!(!T.state.isVisible||f)){if(f=!0,A.offsetHeight,A.style.transition=T.props.moveTransition,J()&&T.props.animation){var Xt=q(),V=Xt.box,L=Xt.content;Ev([V,L],Re),OO([V,L],"visible")}X(),I(),RO(Fv,T),(dt=T.popperInstance)==null||dt.forceUpdate(),H("onMount",[T]),T.props.animation&&J()&&Ze(Re,function(){T.state.isShown=!0,H("onShown",[T])})}},qt()}}function Sr(){var z=!T.state.isVisible,ne=T.state.isDestroyed,pe=!T.state.isEnabled,Ce=Cv(T.props.duration,1,Eo.duration);if(!(z||ne||pe)&&(H("onHide",[T],!1),T.props.onHide(T)!==!1)){if(T.state.isVisible=!1,T.state.isShown=!1,f=!1,a=!1,J()&&(A.style.visibility="hidden"),te(),Ne(),Q(!0),J()){var Re=q(),je=Re.box,Je=Re.content;T.props.animation&&(Ev([je,Je],Ce),OO([je,Je],"hidden"))}X(),I(),T.props.animation?J()&&Xe(Ce,T.unmount):T.unmount()}}function ur(z){D().addEventListener("mousemove",b),RO(i0,b),b(z)}function Kr(){T.state.isVisible&&T.hide(),T.state.isMounted&&(zn(),on().forEach(function(z){z._tippy.unmount()}),A.parentNode&&A.parentNode.removeChild(A),Fv=Fv.filter(function(z){return z!==T}),T.state.isMounted=!1,H("onHidden",[T]))}function le(){T.state.isDestroyed||(T.clearDelayTimeouts(),T.unmount(),En(),delete e._tippy,T.state.isDestroyed=!0,H("onDestroy",[T]))}}function Tg(e,t){t===void 0&&(t={});var n=Eo.plugins.concat(t.plugins||[]);U$();var r=Object.assign({},t,{plugins:n}),i=j$(e),o=i.reduce(function(a,u){var l=u&&Z$(u,r);return l&&a.push(l),a},[]);return Pw(e)?o[0]:o}Tg.defaultProps=Eo;Tg.setDefaultProps=K$;Tg.currentInput=Xo;Object.assign({},I4,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Tg.setDefaultProps({render:Z4});function eP(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var tP=typeof window<"u"&&typeof document<"u";function s1(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function IO(){return tP&&document.createElement("div")}function e7(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function nP(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(t.hasOwnProperty(n)){if(!nP(e[n],t[n]))return!1}else return!1;return!0}else return!1}function t7(e){var t=[];return e.forEach(function(n){t.find(function(r){return nP(n,r)})||t.push(n)}),t}function n7(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:t7([].concat(((n=e.popperOptions)==null?void 0:n.modifiers)||[],((r=t.popperOptions)==null?void 0:r.modifiers)||[]))})})}var Iv=tP?$.useLayoutEffect:$.useEffect;function r7(e){var t=$.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function PO(e,t,n){n.split(/\s+/).forEach(function(r){r&&e.classList[t](r)})}var i7={name:"className",defaultValue:"",fn:function(t){var n=t.popper.firstElementChild,r=function(){var u;return!!((u=t.props.render)!=null&&u.$$tippy)};function i(){t.props.className&&!r()||PO(n,"add",t.props.className)}function o(){r()&&PO(n,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function o7(e){function t(n){var r=n.children,i=n.content,o=n.visible,a=n.singleton,u=n.render,l=n.reference,f=n.disabled,p=f===void 0?!1:f,m=n.ignoreAttributes,y=m===void 0?!0:m;n.__source,n.__self;var w=eP(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),b=o!==void 0,x=a!==void 0,_=$.useState(!1),O=_[0],N=_[1],E=$.useState({}),T=E[0],B=E[1],A=$.useState(),U=A[0],v=A[1],R=r7(function(){return{container:IO(),renders:1}}),C=Object.assign({ignoreAttributes:y},w,{content:R.container});b&&(C.trigger="manual",C.hideOnClick=!1),x&&(p=!0);var M=C,J=C.plugins||[];u&&(M=Object.assign({},C,{plugins:x&&a.data!=null?[].concat(J,[{fn:function(){return{onTrigger:function(K,Q){var H=a.data.children.find(function(X){var I=X.instance;return I.reference===Q.currentTarget});K.state.$$activeSingletonInstance=H.instance,v(H.content)}}}}]):J,render:function(){return{popper:R.container}}}));var P=[l].concat(r?[r.type]:[]);return Iv(function(){var D=l;l&&l.hasOwnProperty("current")&&(D=l.current);var q=e(D||R.ref||IO(),Object.assign({},M,{plugins:[i7].concat(C.plugins||[])}));return R.instance=q,p&&q.disable(),o&&q.show(),x&&a.hook({instance:q,content:i,props:M,setSingletonContent:v}),N(!0),function(){q.destroy(),a==null||a.cleanup(q)}},P),Iv(function(){var D;if(R.renders===1){R.renders++;return}var q=R.instance;q.setProps(n7(q.props,M)),(D=q.popperInstance)==null||D.forceUpdate(),p?q.disable():q.enable(),b&&(o?q.show():q.hide()),x&&a.hook({instance:q,content:i,props:M,setSingletonContent:v})}),Iv(function(){var D;if(u){var q=R.instance;q.setProps({popperOptions:Object.assign({},q.props.popperOptions,{modifiers:[].concat((((D=q.props.popperOptions)==null?void 0:D.modifiers)||[]).filter(function(K){var Q=K.name;return Q!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Q){var H,X=Q.state,I=(H=X.modifiersData)==null?void 0:H.hide;(T.placement!==X.placement||T.referenceHidden!==(I==null?void 0:I.isReferenceHidden)||T.escaped!==(I==null?void 0:I.hasPopperEscaped))&&B({placement:X.placement,referenceHidden:I==null?void 0:I.isReferenceHidden,escaped:I==null?void 0:I.hasPopperEscaped}),X.attributes.popper={}}}])})})}},[T.placement,T.referenceHidden,T.escaped].concat(P)),lt.createElement(lt.Fragment,null,r?$.cloneElement(r,{ref:function(q){R.ref=q,s1(r.ref,q)}}):null,O&&CJ.createPortal(u?u(e7(T),U,R.instance):i,R.container))}return t}var s7=function(e,t){return $.forwardRef(function(r,i){var o=r.children,a=eP(r,["children"]);return lt.createElement(e,Object.assign({},t,a),o?$.cloneElement(o,{ref:function(l){s1(i,l),s1(o.ref,l)}}):null)})},T_=s7(o7(Tg)),a7=function(t){var n=t.label,r=t["aria-label"],i=r===void 0?n:r,o=qu(t,["label","aria-label"]);return $.createElement(T_,ln({content:n,"aria-label":i,trigger:"mouseenter",hideOnClick:void 0},o))},c7=function(t){var n=document.createElement("textarea");n.value=t,n.setAttribute("readonly",""),n.style.position="absolute",n.style.left="-9999px",document.body.appendChild(n);var r=document.getSelection(),i=r&&r.rangeCount>0?r.getRangeAt(0):!1;if(n.select(),document.execCommand("copy"),document.body.removeChild(n),i){var o,a;(o=document.getSelection())==null||o.removeAllRanges(),(a=document.getSelection())==null||a.addRange(i)}};function rP(e){var t=$.useState(!1),n=t[0],r=t[1],i=$.useRef([]),o=function(){c7(e),r(!0),i.current.push(setTimeout(function(){return r(!1)},1250))};return $.useEffect(function(){return function(){return i.current.forEach(function(a){return clearTimeout(a)})}},[]),{value:e,onCopy:o,hasCopied:n}}var u7=u4(Gr(function(e,t){var n=Iw(),r=n[0],i=n[1],o=e.icon,a=e.iconSize,u=a===void 0?"20px":a,l=e.iconProps,f=l===void 0?{}:l,p=e.invert,m=e._hover,y=m===void 0?{}:m,w=e.isHovered,b=qu(e,["icon","iconSize","iconProps","invert","_hover","isHovered"]),x=r||w;return lt.createElement(p_,ln({placeItems:"center",borderRadius:"100%",transition:Pu,size:"36px",position:"relative",userSelect:"none",_hover:ln({cursor:"pointer"},y),color:"currentColor",ref:t},i,b),lt.createElement(o,ln({display:"block",size:u,color:"currentColor"},f)),lt.createElement(fe,{position:"absolute",left:0,top:0,borderRadius:"100%",size:"100%",bg:ce(p?"bg":"invert"),transition:Pu,opacity:x?.12:0}))}));class Og{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){const n={listener:t};return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const sg=typeof window>"u"||"Deno"in window;function eo(){}function l7(e,t){return typeof e=="function"?e(t):e}function a1(e){return typeof e=="number"&&e>=0&&e!==1/0}function iP(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Bm(e,t,n){return Mw(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function kl(e,t,n){return Mw(e)?[{...t,queryKey:e},n]:[e||{},t]}function MO(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:u}=e;if(Mw(a)){if(r){if(t.queryHash!==O_(a,t.options))return!1}else if(!Y0(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function LO(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:o}=e;if(Mw(o)){if(!t.options.mutationKey)return!1;if(n){if(Zd(t.options.mutationKey)!==Zd(o))return!1}else if(!Y0(t.options.mutationKey,o))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function O_(e,t){return((t==null?void 0:t.queryKeyHashFn)||Zd)(e)}function Zd(e){return JSON.stringify(e,(t,n)=>u1(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Y0(e,t){return oP(e,t)}function oP(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!oP(e[n],t[n])):!1}function sP(e,t){if(e===t)return e;const n=BO(e)&&BO(t);if(n||u1(e)&&u1(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,a=n?[]:{};let u=0;for(let l=0;l"u")return!0;const n=t.prototype;return!(!jO(n)||!n.hasOwnProperty("isPrototypeOf"))}function jO(e){return Object.prototype.toString.call(e)==="[object Object]"}function Mw(e){return Array.isArray(e)}function aP(e){return new Promise(t=>{setTimeout(t,e)})}function DO(e){aP(0).then(e)}function d7(){if(typeof AbortController=="function")return new AbortController}function l1(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?sP(e,t):t}class f7 extends Og{constructor(){super(),this.setup=t=>{if(!sg&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const X0=new f7,JO=["online","offline"];class h7 extends Og{constructor(){super(),this.setup=t=>{if(!sg&&window.addEventListener){const n=()=>t();return JO.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{JO.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const Z0=new h7;function p7(e){return Math.min(1e3*2**e,3e4)}function Lw(e){return(e??"online")==="online"?Z0.isOnline():!0}class cP{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function L0(e){return e instanceof cP}function uP(e){let t=!1,n=0,r=!1,i,o,a;const u=new Promise((_,O)=>{o=_,a=O}),l=_=>{r||(w(new cP(_)),e.abort==null||e.abort())},f=()=>{t=!0},p=()=>{t=!1},m=()=>!X0.isFocused()||e.networkMode!=="always"&&!Z0.isOnline(),y=_=>{r||(r=!0,e.onSuccess==null||e.onSuccess(_),i==null||i(),o(_))},w=_=>{r||(r=!0,e.onError==null||e.onError(_),i==null||i(),a(_))},b=()=>new Promise(_=>{i=O=>{const N=r||!m();return N&&_(O),N},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),x=()=>{if(r)return;let _;try{_=e.fn()}catch(O){_=Promise.reject(O)}Promise.resolve(_).then(y).catch(O=>{var N,E;if(r)return;const T=(N=e.retry)!=null?N:3,B=(E=e.retryDelay)!=null?E:p7,A=typeof B=="function"?B(n,O):B,U=T===!0||typeof T=="number"&&n{if(m())return b()}).then(()=>{t?w(O):x()})})};return Lw(e.networkMode)?x():b().then(x),{promise:u,cancel:l,continue:()=>(i==null?void 0:i())?u:Promise.resolve(),cancelRetry:f,continueRetry:p}}const N_=console;function m7(){let e=[],t=0,n=p=>{p()},r=p=>{p()};const i=p=>{let m;t++;try{m=p()}finally{t--,t||u()}return m},o=p=>{t?e.push(p):DO(()=>{n(p)})},a=p=>(...m)=>{o(()=>{p(...m)})},u=()=>{const p=e;e=[],p.length&&DO(()=>{r(()=>{p.forEach(m=>{n(m)})})})};return{batch:i,batchCalls:a,schedule:o,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p}}}const Qn=m7();class lP{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),a1(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(sg?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class g7 extends lP{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||N_,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||y7(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=l1(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(eo).catch(eo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!iP(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(b=>b.options.queryFn);w&&this.setOptions(w.options)}const a=d7(),u={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};l(u);const f=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(u)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),p={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:f};if(l(p),(r=this.options.behavior)==null||r.onFetch(p),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=p.fetchOptions)==null?void 0:i.meta)){var m;this.dispatch({type:"fetch",meta:(m=p.fetchOptions)==null?void 0:m.meta})}const y=w=>{if(L0(w)&&w.silent||this.dispatch({type:"error",error:w}),!L0(w)){var b,x,_,O;(b=(x=this.cache.config).onError)==null||b.call(x,w,this),(_=(O=this.cache.config).onSettled)==null||_.call(O,this.state.data,w,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=uP({fn:p.fetchFn,abort:a==null?void 0:a.abort.bind(a),onSuccess:w=>{var b,x,_,O;if(typeof w>"u"){y(new Error(this.queryHash+" data is undefined"));return}this.setData(w),(b=(x=this.cache.config).onSuccess)==null||b.call(x,w,this),(_=(O=this.cache.config).onSettled)==null||_.call(O,w,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:y,onFail:(w,b)=>{this.dispatch({type:"failed",failureCount:w,error:b})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var i,o;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:Lw(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(o=t.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return L0(a)&&a.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function y7(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class w7 extends Og{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const o=n.queryKey,a=(i=n.queryHash)!=null?i:O_(o,n);let u=this.get(a);return u||(u=new g7({cache:this,logger:t.getLogger(),queryKey:o,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(u)),u}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=kl(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>MO(r,i))}findAll(t,n){const[r]=kl(t,n);return Object.keys(r).length>0?this.queries.filter(i=>MO(r,i)):this.queries}notify(t){Qn.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}onFocus(){Qn.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class b7 extends lP{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||N_,this.observers=[],this.state=t.state||S7(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var U;return this.retryer=uP({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(v,R)=>{this.dispatch({type:"failed",failureCount:v,error:R})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(U=this.options.retry)!=null?U:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,o,a,u,l,f,p;if(!n){var m,y,w,b;this.dispatch({type:"loading",variables:this.options.variables}),await((m=(y=this.mutationCache.config).onMutate)==null?void 0:m.call(y,this.state.variables,this));const v=await((w=(b=this.options).onMutate)==null?void 0:w.call(b,this.state.variables));v!==this.state.context&&this.dispatch({type:"loading",context:v,variables:this.state.variables})}const U=await t();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,U,this.state.variables,this.state.context,this)),await((o=(a=this.options).onSuccess)==null?void 0:o.call(a,U,this.state.variables,this.state.context)),await((u=(l=this.mutationCache.config).onSettled)==null?void 0:u.call(l,U,null,this.state.variables,this.state.context,this)),await((f=(p=this.options).onSettled)==null?void 0:f.call(p,U,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:U}),U}catch(U){try{var x,_,O,N,E,T,B,A;throw await((x=(_=this.mutationCache.config).onError)==null?void 0:x.call(_,U,this.state.variables,this.state.context,this)),await((O=(N=this.options).onError)==null?void 0:O.call(N,U,this.state.variables,this.state.context)),await((E=(T=this.mutationCache.config).onSettled)==null?void 0:E.call(T,void 0,U,this.state.variables,this.state.context,this)),await((B=(A=this.options).onSettled)==null?void 0:B.call(A,void 0,U,this.state.variables,this.state.context)),U}finally{this.dispatch({type:"error",error:U})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Lw(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function S7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class v7 extends Og{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new b7({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){Qn.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>LO(t,n))}findAll(t){return this.mutations.filter(n=>LO(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return Qn.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(eo)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function x7(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,o,a;const u=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,l=(r=e.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,f=l==null?void 0:l.pageParam,p=(l==null?void 0:l.direction)==="forward",m=(l==null?void 0:l.direction)==="backward",y=((o=e.state.data)==null?void 0:o.pages)||[],w=((a=e.state.data)==null?void 0:a.pageParams)||[];let b=w,x=!1;const _=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>{var U;if((U=e.signal)!=null&&U.aborted)x=!0;else{var v;(v=e.signal)==null||v.addEventListener("abort",()=>{x=!0})}return e.signal}})},O=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),N=(A,U,v,R)=>(b=R?[U,...b]:[...b,U],R?[v,...A]:[...A,v]),E=(A,U,v,R)=>{if(x)return Promise.reject("Cancelled");if(typeof v>"u"&&!U&&A.length)return Promise.resolve(A);const C={queryKey:e.queryKey,pageParam:v,meta:e.options.meta};_(C);const M=O(C);return Promise.resolve(M).then(P=>N(A,v,P,R))};let T;if(!y.length)T=E([]);else if(p){const A=typeof f<"u",U=A?f:$O(e.options,y);T=E(y,A,U)}else if(m){const A=typeof f<"u",U=A?f:_7(e.options,y);T=E(y,A,U,!0)}else{b=[];const A=typeof e.options.getNextPageParam>"u";T=(u&&y[0]?u(y[0],0,y):!0)?E([],A,w[0]):Promise.resolve(N([],w[0],y[0]));for(let v=1;v{if(u&&y[v]?u(y[v],v,y):!0){const M=A?w[v]:$O(e.options,R);return E(R,A,M)}return Promise.resolve(N(R,w[v],y[v]))})}return T.then(A=>({pages:A,pageParams:b}))}}}}function $O(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function _7(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class k7{constructor(t={}){this.queryCache=t.queryCache||new w7,this.mutationCache=t.mutationCache||new v7,this.logger=t.logger||N_,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=X0.subscribe(()=>{X0.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Z0.subscribe(()=>{Z0.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=kl(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}ensureQueryData(t,n,r){const i=Bm(t,n,r),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.queryCache.find(t),o=i==null?void 0:i.state.data,a=l7(n,o);if(typeof a>"u")return;const u=Bm(t),l=this.defaultQueryOptions(u);return this.queryCache.build(this,l).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return Qn.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=kl(t,n),i=this.queryCache;Qn.batch(()=>{i.findAll(r).forEach(o=>{i.remove(o)})})}resetQueries(t,n,r){const[i,o]=kl(t,n,r),a=this.queryCache,u={type:"active",...i};return Qn.batch(()=>(a.findAll(i).forEach(l=>{l.reset()}),this.refetchQueries(u,o)))}cancelQueries(t,n,r){const[i,o={}]=kl(t,n,r);typeof o.revert>"u"&&(o.revert=!0);const a=Qn.batch(()=>this.queryCache.findAll(i).map(u=>u.cancel(o)));return Promise.all(a).then(eo).catch(eo)}invalidateQueries(t,n,r){const[i,o]=kl(t,n,r);return Qn.batch(()=>{var a,u;if(this.queryCache.findAll(i).forEach(f=>{f.invalidate()}),i.refetchType==="none")return Promise.resolve();const l={...i,type:(a=(u=i.refetchType)!=null?u:i.type)!=null?a:"active"};return this.refetchQueries(l,o)})}refetchQueries(t,n,r){const[i,o]=kl(t,n,r),a=Qn.batch(()=>this.queryCache.findAll(i).filter(l=>!l.isDisabled()).map(l=>{var f;return l.fetch(void 0,{...o,cancelRefetch:(f=o==null?void 0:o.cancelRefetch)!=null?f:!0,meta:{refetchPage:i.refetchPage}})}));let u=Promise.all(a).then(eo);return o!=null&&o.throwOnError||(u=u.catch(eo)),u}fetchQuery(t,n,r){const i=Bm(t,n,r),o=this.defaultQueryOptions(i);typeof o.retry>"u"&&(o.retry=!1);const a=this.queryCache.build(this,o);return a.isStaleByTime(o.staleTime)?a.fetch(o):Promise.resolve(a.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(eo).catch(eo)}fetchInfiniteQuery(t,n,r){const i=Bm(t,n,r);return i.behavior=x7(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(eo).catch(eo)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(i=>Zd(t)===Zd(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>Y0(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>Zd(t)===Zd(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>Y0(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=O_(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class R7 extends Og{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),qO(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d1(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d1(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),c1(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const o=this.hasListeners();o&&UO(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const a=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||a!==this.currentRefetchInterval)&&this.updateRefetchInterval(a)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t),r=this.createResult(n,t);return O7(this,r,t)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(eo)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),sg||this.currentResult.isStale||!a1(this.options.staleTime))return;const n=iP(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(sg||this.options.enabled===!1||!a1(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||X0.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,i=this.options,o=this.currentResult,a=this.currentResultState,u=this.currentResultOptions,l=t!==r,f=l?t.state:this.currentQueryInitialState,p=l?this.currentResult:this.previousQueryResult,{state:m}=t;let{dataUpdatedAt:y,error:w,errorUpdatedAt:b,fetchStatus:x,status:_}=m,O=!1,N=!1,E;if(n._optimisticResults){const v=this.hasListeners(),R=!v&&qO(t,n),C=v&&UO(t,r,n,i);(R||C)&&(x=Lw(t.options.networkMode)?"fetching":"paused",y||(_="loading")),n._optimisticResults==="isRestoring"&&(x="idle")}if(n.keepPreviousData&&!m.dataUpdatedAt&&p!=null&&p.isSuccess&&_!=="error")E=p.data,y=p.dataUpdatedAt,_=p.status,O=!0;else if(n.select&&typeof m.data<"u")if(o&&m.data===(a==null?void 0:a.data)&&n.select===this.selectFn)E=this.selectResult;else try{this.selectFn=n.select,E=n.select(m.data),E=l1(o==null?void 0:o.data,E,n),this.selectResult=E,this.selectError=null}catch(v){this.selectError=v}else E=m.data;if(typeof n.placeholderData<"u"&&typeof E>"u"&&_==="loading"){let v;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData))v=o.data;else if(v=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof v<"u")try{v=n.select(v),this.selectError=null}catch(R){this.selectError=R}typeof v<"u"&&(_="success",E=l1(o==null?void 0:o.data,v,n),N=!0)}this.selectError&&(w=this.selectError,E=this.selectResult,b=Date.now(),_="error");const T=x==="fetching",B=_==="loading",A=_==="error";return{status:_,fetchStatus:x,isLoading:B,isSuccess:_==="success",isError:A,isInitialLoading:B&&T,data:E,dataUpdatedAt:y,error:w,errorUpdatedAt:b,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:T,isRefetching:T&&!B,isLoadingError:A&&m.dataUpdatedAt===0,isPaused:x==="paused",isPlaceholderData:N,isPreviousData:O,isRefetchError:A&&m.dataUpdatedAt!==0,isStale:C_(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,c1(r,n))return;this.currentResult=r;const i={cache:!0},o=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,u=typeof a=="function"?a():a;if(u==="all"||!u&&!this.trackedProps.size)return!0;const l=new Set(u??this.trackedProps);return this.options.useErrorBoundary&&l.add("error"),Object.keys(this.currentResult).some(f=>{const p=f;return this.currentResult[p]!==n[p]&&l.has(p)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!L0(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){Qn.batch(()=>{if(t.onSuccess){var n,r,i,o;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(o=this.options).onSettled)==null||i.call(o,this.currentResult.data,null)}else if(t.onError){var a,u,l,f;(a=(u=this.options).onError)==null||a.call(u,this.currentResult.error),(l=(f=this.options).onSettled)==null||l.call(f,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:p})=>{p(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function T7(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qO(e,t){return T7(e,t)||e.state.dataUpdatedAt>0&&d1(e,t,t.refetchOnMount)}function d1(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&C_(e,t)}return!1}function UO(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&C_(e,n)}function C_(e,t){return e.isStaleByTime(t.staleTime)}function O7(e,t,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?t.isPlaceholderData:!c1(e.getCurrentResult(),t)}var Pv={exports:{}},Mv={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -754,36 +754,36 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var HO;function N7(){if(HO)return Mv;HO=1;var e=_w();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function u(m,y){var w=y(),b=r({inst:{value:w,getSnapshot:y}}),x=b[0].inst,k=b[1];return o(function(){x.value=w,x.getSnapshot=y,l(x)&&k({inst:x})},[m,w,y]),i(function(){return l(x)&&k({inst:x}),m(function(){l(x)&&k({inst:x})})},[m]),a(w),w}function l(m){var y=m.getSnapshot;m=m.value;try{var w=y();return!n(m,w)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Mv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Mv}var zO;function C7(){return zO||(zO=1,Pv.exports=N7()),Pv.exports}var E7=C7();const A7=E7.useSyncExternalStore,WO=$.createContext(void 0),dP=$.createContext(!1);function fP(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=WO),window.ReactQueryClientContext):WO)}const F7=({context:e}={})=>{const t=$.useContext(fP(e,$.useContext(dP)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},I7=({client:e,children:t,context:n,contextSharing:r=!1})=>{$.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=fP(n,r);return $.createElement(dP.Provider,{value:!n&&r},$.createElement(i.Provider,{value:e},t))},hP=$.createContext(!1),P7=()=>$.useContext(hP);hP.Provider;function M7(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const L7=$.createContext(M7()),B7=()=>$.useContext(L7);function j7(e,t){return typeof e=="function"?e(...t):!!e}const D7=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},J7=e=>{$.useEffect(()=>{e.clearReset()},[e])},$7=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&j7(n,[e.error,r]),q7=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},U7=(e,t)=>e.isLoading&&e.isFetching&&!t,H7=(e,t,n)=>(e==null?void 0:e.suspense)&&U7(t,n),z7=(e,t,n)=>t.fetchOptimistic(e).then(({data:r})=>{e.onSuccess==null||e.onSuccess(r),e.onSettled==null||e.onSettled(r,null)}).catch(r=>{n.clearReset(),e.onError==null||e.onError(r),e.onSettled==null||e.onSettled(void 0,r)});function W7(e,t){const n=F7({context:e.context}),r=P7(),i=B7(),o=n.defaultQueryOptions(e);o._optimisticResults=r?"isRestoring":"optimistic",o.onError&&(o.onError=Qn.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=Qn.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=Qn.batchCalls(o.onSettled)),q7(o),D7(o,i),J7(i);const[a]=$.useState(()=>new t(n,o)),u=a.getOptimisticResult(o);if(A7($.useCallback(l=>{const f=r?()=>{}:a.subscribe(Qn.batchCalls(l));return a.updateResult(),f},[a,r]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),$.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),H7(o,u,r))throw z7(o,a,i);if($7({result:u,errorResetBoundary:i,useErrorBoundary:o.useErrorBoundary,query:a.getCurrentQuery()}))throw u.error;return o.notifyOnChangeProps?u:a.trackResult(u)}function yr(e,t,n){const r=Bm(e,t,n);return W7(r,R7)}var vd={},xd={},Lv={},VO;function Ie(){return VO||(VO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextApiResponse=e.BlobApiResponse=e.VoidApiResponse=e.JSONApiResponse=e.canConsumeForm=e.mapValues=e.querystring=e.exists=e.Configuration=e.COLLECTION_FORMATS=e.RequiredError=e.BaseAPI=e.BASE_PATH=void 0,e.BASE_PATH="https://api.mainnet.hiro.so".replace(/\/+$/,"");const t=w=>typeof Blob<"u"&&w instanceof Blob;class n{constructor(b=new i){this.configuration=b,this.fetchApi=async(x,k)=>{let O={url:x,init:k};for(const E of this.middleware)E.pre&&(O=await E.pre(Object.assign({fetch:this.fetchApi},O))||O);let N=await(this.configuration.fetchApi||fetch)(O.url,O.init);for(const E of this.middleware)E.post&&(N=await E.post({fetch:this.fetchApi,url:O.url,init:O.init,response:N.clone()})||N);return N},this.middleware=b.middleware}withMiddleware(...b){const x=this.clone();return x.middleware=x.middleware.concat(...b),x}withPreMiddleware(...b){const x=b.map(k=>({pre:k}));return this.withMiddleware(...x)}withPostMiddleware(...b){const x=b.map(k=>({post:k}));return this.withMiddleware(...x)}async request(b,x){const{url:k,init:O}=this.createFetchParams(b,x),N=await this.fetchApi(k,O);if(N.status>=200&&N.status<300)return N;throw N}createFetchParams(b,x){let k=this.configuration.basePath+b.path;b.query!==void 0&&Object.keys(b.query).length!==0&&(k+="?"+this.configuration.queryParamsStringify(b.query));const O=typeof FormData<"u"&&b.body instanceof FormData||b.body instanceof URLSearchParams||t(b.body)?b.body:JSON.stringify(b.body),N=Object.assign({},this.configuration.headers,b.headers),E=Object.assign({method:b.method,headers:N,body:O,credentials:this.configuration.credentials},x);return{url:k,init:E}}clone(){const b=this.constructor,x=new b(this.configuration);return x.middleware=this.middleware.slice(),x}}e.BaseAPI=n;class r extends Error{constructor(b,x){super(x),this.field=b,this.name="RequiredError"}}e.RequiredError=r,e.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:" ",pipes:"|"};class i{constructor(b={}){this.configuration=b}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:e.BASE_PATH}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||a}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const b=this.configuration.apiKey;if(b)return typeof b=="function"?b:()=>b}get accessToken(){const b=this.configuration.accessToken;if(b)return typeof b=="function"?b:async()=>b}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}e.Configuration=i;function o(w,b){const x=w[b];return x!=null}e.exists=o;function a(w,b=""){return Object.keys(w).map(x=>{const k=b+(b.length?`[${x}]`:x),O=w[x];if(O instanceof Array){const N=O.map(E=>encodeURIComponent(String(E))).join(`&${encodeURIComponent(k)}=`);return`${encodeURIComponent(k)}=${N}`}return O instanceof Date?`${encodeURIComponent(k)}=${encodeURIComponent(O.toISOString())}`:O instanceof Object?a(O,k):`${encodeURIComponent(k)}=${encodeURIComponent(String(O))}`}).filter(x=>x.length>0).join("&")}e.querystring=a;function u(w,b){return Object.keys(w).reduce((x,k)=>Object.assign(Object.assign({},x),{[k]:b(w[k])}),{})}e.mapValues=u;function l(w){for(const b of w)if(b.contentType==="multipart/form-data")return!0;return!1}e.canConsumeForm=l;class f{constructor(b,x=k=>k){this.raw=b,this.transformer=x}async value(){return this.transformer(await this.raw.json())}}e.JSONApiResponse=f;class p{constructor(b){this.raw=b}async value(){}}e.VoidApiResponse=p;class m{constructor(b){this.raw=b}async value(){return await this.raw.blob()}}e.BlobApiResponse=m;class y{constructor(b){this.raw=b}async value(){return await this.raw.text()}}e.TextApiResponse=y}(Lv)),Lv}var _d={},rm={},kd={},Is={},GO;function V7(){if(GO)return Is;GO=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.AccountDataResponseToJSON=Is.AccountDataResponseFromJSONTyped=Is.AccountDataResponseFromJSON=void 0;function e(r){return t(r)}Is.AccountDataResponseFromJSON=e;function t(r,i){return r==null?r:{balance:r.balance,locked:r.locked,unlock_height:r.unlock_height,nonce:r.nonce,balance_proof:r.balance_proof,nonce_proof:r.nonce_proof}}Is.AccountDataResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{balance:r.balance,locked:r.locked,unlock_height:r.unlock_height,nonce:r.nonce,balance_proof:r.balance_proof,nonce_proof:r.nonce_proof}}return Is.AccountDataResponseToJSON=n,Is}var Ps={},KO;function G7(){if(KO)return Ps;KO=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.AddressAssetsListResponseToJSON=Ps.AddressAssetsListResponseFromJSONTyped=Ps.AddressAssetsListResponseFromJSON=void 0;function e(r){return t(r)}Ps.AddressAssetsListResponseFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}Ps.AddressAssetsListResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return Ps.AddressAssetsListResponseToJSON=n,Ps}var Ms={},QO;function K7(){if(QO)return Ms;QO=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.AddressBalanceResponseToJSON=Ms.AddressBalanceResponseFromJSONTyped=Ms.AddressBalanceResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Ms.AddressBalanceResponseFromJSON=n;function r(o,a){return o==null?o:{stx:(0,t.StxBalanceFromJSON)(o.stx),fungible_tokens:o.fungible_tokens,non_fungible_tokens:o.non_fungible_tokens,token_offering_locked:(0,e.exists)(o,"token_offering_locked")?(0,t.AddressTokenOfferingLockedFromJSON)(o.token_offering_locked):void 0}}Ms.AddressBalanceResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{stx:(0,t.StxBalanceToJSON)(o.stx),fungible_tokens:o.fungible_tokens,non_fungible_tokens:o.non_fungible_tokens,token_offering_locked:(0,t.AddressTokenOfferingLockedToJSON)(o.token_offering_locked)}}return Ms.AddressBalanceResponseToJSON=i,Ms}var Ls={},YO;function Q7(){if(YO)return Ls;YO=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.AddressNftListResponseToJSON=Ls.AddressNftListResponseFromJSONTyped=Ls.AddressNftListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ls.AddressNftListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,nft_events:i.nft_events.map(e.NftEventFromJSON)}}Ls.AddressNftListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,nft_events:i.nft_events.map(e.NftEventToJSON)}}return Ls.AddressNftListResponseToJSON=r,Ls}var Bs={},XO;function Y7(){if(XO)return Bs;XO=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.AddressNftListResponseValueToJSON=Bs.AddressNftListResponseValueFromJSONTyped=Bs.AddressNftListResponseValueFromJSON=void 0;function e(r){return t(r)}Bs.AddressNftListResponseValueFromJSON=e;function t(r,i){return r==null?r:{hex:r.hex,repr:r.repr}}Bs.AddressNftListResponseValueFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{hex:r.hex,repr:r.repr}}return Bs.AddressNftListResponseValueToJSON=n,Bs}var js={},ZO;function X7(){if(ZO)return js;ZO=1,Object.defineProperty(js,"__esModule",{value:!0}),js.AddressNoncesToJSON=js.AddressNoncesFromJSONTyped=js.AddressNoncesFromJSON=void 0;const e=Ie();function t(i){return n(i)}js.AddressNoncesFromJSON=t;function n(i,o){return i==null?i:{last_mempool_tx_nonce:i.last_mempool_tx_nonce,last_executed_tx_nonce:i.last_executed_tx_nonce,possible_next_nonce:i.possible_next_nonce,detected_missing_nonces:i.detected_missing_nonces,detected_mempool_nonces:(0,e.exists)(i,"detected_mempool_nonces")?i.detected_mempool_nonces:void 0}}js.AddressNoncesFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{last_mempool_tx_nonce:i.last_mempool_tx_nonce,last_executed_tx_nonce:i.last_executed_tx_nonce,possible_next_nonce:i.possible_next_nonce,detected_missing_nonces:i.detected_missing_nonces,detected_mempool_nonces:i.detected_mempool_nonces}}return js.AddressNoncesToJSON=r,js}var Ds={},eN;function Z7(){if(eN)return Ds;eN=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.AddressStxInboundListResponseToJSON=Ds.AddressStxInboundListResponseFromJSONTyped=Ds.AddressStxInboundListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ds.AddressStxInboundListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.InboundStxTransferFromJSON)}}Ds.AddressStxInboundListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.InboundStxTransferToJSON)}}return Ds.AddressStxInboundListResponseToJSON=r,Ds}var Js={},tN;function eq(){if(tN)return Js;tN=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.AddressTokenOfferingLockedToJSON=Js.AddressTokenOfferingLockedFromJSONTyped=Js.AddressTokenOfferingLockedFromJSON=void 0;const e=Fe();function t(i){return n(i)}Js.AddressTokenOfferingLockedFromJSON=t;function n(i,o){return i==null?i:{total_locked:i.total_locked,total_unlocked:i.total_unlocked,unlock_schedule:i.unlock_schedule.map(e.AddressUnlockScheduleFromJSON)}}Js.AddressTokenOfferingLockedFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{total_locked:i.total_locked,total_unlocked:i.total_unlocked,unlock_schedule:i.unlock_schedule.map(e.AddressUnlockScheduleToJSON)}}return Js.AddressTokenOfferingLockedToJSON=r,Js}var $s={},nN;function tq(){if(nN)return $s;nN=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.AddressTransactionWithTransfersToJSON=$s.AddressTransactionWithTransfersFromJSONTyped=$s.AddressTransactionWithTransfersFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}$s.AddressTransactionWithTransfersFromJSON=n;function r(o,a){return o==null?o:{tx:o.tx,stx_sent:o.stx_sent,stx_received:o.stx_received,stx_transfers:o.stx_transfers.map(t.AddressTransactionWithTransfersStxTransfersFromJSON),ft_transfers:(0,e.exists)(o,"ft_transfers")?o.ft_transfers.map(t.AddressTransactionWithTransfersFtTransfersFromJSON):void 0,nft_transfers:(0,e.exists)(o,"nft_transfers")?o.nft_transfers.map(t.AddressTransactionWithTransfersNftTransfersFromJSON):void 0}}$s.AddressTransactionWithTransfersFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{tx:o.tx,stx_sent:o.stx_sent,stx_received:o.stx_received,stx_transfers:o.stx_transfers.map(t.AddressTransactionWithTransfersStxTransfersToJSON),ft_transfers:o.ft_transfers===void 0?void 0:o.ft_transfers.map(t.AddressTransactionWithTransfersFtTransfersToJSON),nft_transfers:o.nft_transfers===void 0?void 0:o.nft_transfers.map(t.AddressTransactionWithTransfersNftTransfersToJSON)}}return $s.AddressTransactionWithTransfersToJSON=i,$s}var qs={},rN;function nq(){if(rN)return qs;rN=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.AddressTransactionWithTransfersFtTransfersToJSON=qs.AddressTransactionWithTransfersFtTransfersFromJSONTyped=qs.AddressTransactionWithTransfersFtTransfersFromJSON=void 0;const e=Ie();function t(i){return n(i)}qs.AddressTransactionWithTransfersFtTransfersFromJSON=t;function n(i,o){return i==null?i:{asset_identifier:i.asset_identifier,amount:i.amount,sender:(0,e.exists)(i,"sender")?i.sender:void 0,recipient:(0,e.exists)(i,"recipient")?i.recipient:void 0}}qs.AddressTransactionWithTransfersFtTransfersFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{asset_identifier:i.asset_identifier,amount:i.amount,sender:i.sender,recipient:i.recipient}}return qs.AddressTransactionWithTransfersFtTransfersToJSON=r,qs}var Us={},iN;function rq(){if(iN)return Us;iN=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.AddressTransactionWithTransfersNftTransfersToJSON=Us.AddressTransactionWithTransfersNftTransfersFromJSONTyped=Us.AddressTransactionWithTransfersNftTransfersFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Us.AddressTransactionWithTransfersNftTransfersFromJSON=n;function r(o,a){return o==null?o:{asset_identifier:o.asset_identifier,value:(0,t.AddressTransactionWithTransfersValueFromJSON)(o.value),sender:(0,e.exists)(o,"sender")?o.sender:void 0,recipient:(0,e.exists)(o,"recipient")?o.recipient:void 0}}Us.AddressTransactionWithTransfersNftTransfersFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{asset_identifier:o.asset_identifier,value:(0,t.AddressTransactionWithTransfersValueToJSON)(o.value),sender:o.sender,recipient:o.recipient}}return Us.AddressTransactionWithTransfersNftTransfersToJSON=i,Us}var Hs={},oN;function iq(){if(oN)return Hs;oN=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.AddressTransactionWithTransfersStxTransfersToJSON=Hs.AddressTransactionWithTransfersStxTransfersFromJSONTyped=Hs.AddressTransactionWithTransfersStxTransfersFromJSON=void 0;const e=Ie();function t(i){return n(i)}Hs.AddressTransactionWithTransfersStxTransfersFromJSON=t;function n(i,o){return i==null?i:{amount:i.amount,sender:(0,e.exists)(i,"sender")?i.sender:void 0,recipient:(0,e.exists)(i,"recipient")?i.recipient:void 0}}Hs.AddressTransactionWithTransfersStxTransfersFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{amount:i.amount,sender:i.sender,recipient:i.recipient}}return Hs.AddressTransactionWithTransfersStxTransfersToJSON=r,Hs}var zs={},sN;function oq(){if(sN)return zs;sN=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.AddressTransactionWithTransfersValueToJSON=zs.AddressTransactionWithTransfersValueFromJSONTyped=zs.AddressTransactionWithTransfersValueFromJSON=void 0;function e(r){return t(r)}zs.AddressTransactionWithTransfersValueFromJSON=e;function t(r,i){return r==null?r:{hex:r.hex,repr:r.repr}}zs.AddressTransactionWithTransfersValueFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{hex:r.hex,repr:r.repr}}return zs.AddressTransactionWithTransfersValueToJSON=n,zs}var Ws={},aN;function sq(){if(aN)return Ws;aN=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.AddressTransactionsListResponseToJSON=Ws.AddressTransactionsListResponseFromJSONTyped=Ws.AddressTransactionsListResponseFromJSON=void 0;function e(r){return t(r)}Ws.AddressTransactionsListResponseFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}Ws.AddressTransactionsListResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return Ws.AddressTransactionsListResponseToJSON=n,Ws}var Vs={},cN;function aq(){if(cN)return Vs;cN=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.AddressTransactionsWithTransfersListResponseToJSON=Vs.AddressTransactionsWithTransfersListResponseFromJSONTyped=Vs.AddressTransactionsWithTransfersListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Vs.AddressTransactionsWithTransfersListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.AddressTransactionWithTransfersFromJSON)}}Vs.AddressTransactionsWithTransfersListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.AddressTransactionWithTransfersToJSON)}}return Vs.AddressTransactionsWithTransfersListResponseToJSON=r,Vs}var Gs={},uN;function cq(){if(uN)return Gs;uN=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.AddressUnlockScheduleToJSON=Gs.AddressUnlockScheduleFromJSONTyped=Gs.AddressUnlockScheduleFromJSON=void 0;function e(r){return t(r)}Gs.AddressUnlockScheduleFromJSON=e;function t(r,i){return r==null?r:{amount:r.amount,block_height:r.block_height}}Gs.AddressUnlockScheduleFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{amount:r.amount,block_height:r.block_height}}return Gs.AddressUnlockScheduleToJSON=n,Gs}var Ks={},lN;function uq(){if(lN)return Ks;lN=1,Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.BlockToJSON=Ks.BlockFromJSONTyped=Ks.BlockFromJSON=void 0;function e(r){return t(r)}Ks.BlockFromJSON=e;function t(r,i){return r==null?r:{canonical:r.canonical,height:r.height,hash:r.hash,index_block_hash:r.index_block_hash,parent_block_hash:r.parent_block_hash,burn_block_time:r.burn_block_time,burn_block_time_iso:r.burn_block_time_iso,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,miner_txid:r.miner_txid,parent_microblock_hash:r.parent_microblock_hash,parent_microblock_sequence:r.parent_microblock_sequence,txs:r.txs,microblocks_accepted:r.microblocks_accepted,microblocks_streamed:r.microblocks_streamed,execution_cost_read_count:r.execution_cost_read_count,execution_cost_read_length:r.execution_cost_read_length,execution_cost_runtime:r.execution_cost_runtime,execution_cost_write_count:r.execution_cost_write_count,execution_cost_write_length:r.execution_cost_write_length,microblock_tx_count:r.microblock_tx_count}}Ks.BlockFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{canonical:r.canonical,height:r.height,hash:r.hash,index_block_hash:r.index_block_hash,parent_block_hash:r.parent_block_hash,burn_block_time:r.burn_block_time,burn_block_time_iso:r.burn_block_time_iso,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,miner_txid:r.miner_txid,parent_microblock_hash:r.parent_microblock_hash,parent_microblock_sequence:r.parent_microblock_sequence,txs:r.txs,microblocks_accepted:r.microblocks_accepted,microblocks_streamed:r.microblocks_streamed,execution_cost_read_count:r.execution_cost_read_count,execution_cost_read_length:r.execution_cost_read_length,execution_cost_runtime:r.execution_cost_runtime,execution_cost_write_count:r.execution_cost_write_count,execution_cost_write_length:r.execution_cost_write_length,microblock_tx_count:r.microblock_tx_count}}return Ks.BlockToJSON=n,Ks}var Qs={},dN;function lq(){if(dN)return Qs;dN=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.BlockListResponseToJSON=Qs.BlockListResponseFromJSONTyped=Qs.BlockListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Qs.BlockListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.BlockFromJSON)}}Qs.BlockListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.BlockToJSON)}}return Qs.BlockListResponseToJSON=r,Qs}var Ys={},fN;function dq(){if(fN)return Ys;fN=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.BnsErrorToJSON=Ys.BnsErrorFromJSONTyped=Ys.BnsErrorFromJSON=void 0;const e=Ie();function t(i){return n(i)}Ys.BnsErrorFromJSON=t;function n(i,o){return i==null?i:{error:(0,e.exists)(i,"error")?i.error:void 0}}Ys.BnsErrorFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{error:i.error}}return Ys.BnsErrorToJSON=r,Ys}var Xs={},hN;function fq(){if(hN)return Xs;hN=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.BnsGetAllNamespacesResponseToJSON=Xs.BnsGetAllNamespacesResponseFromJSONTyped=Xs.BnsGetAllNamespacesResponseFromJSON=void 0;function e(r){return t(r)}Xs.BnsGetAllNamespacesResponseFromJSON=e;function t(r,i){return r==null?r:{namespaces:r.namespaces}}Xs.BnsGetAllNamespacesResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{namespaces:r.namespaces}}return Xs.BnsGetAllNamespacesResponseToJSON=n,Xs}var Zs={},pN;function hq(){if(pN)return Zs;pN=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.BnsGetNameInfoResponseToJSON=Zs.BnsGetNameInfoResponseFromJSONTyped=Zs.BnsGetNameInfoResponseFromJSON=void 0;const e=Ie();function t(i){return n(i)}Zs.BnsGetNameInfoResponseFromJSON=t;function n(i,o){return i==null?i:{address:i.address,blockchain:i.blockchain,expire_block:(0,e.exists)(i,"expire_block")?i.expire_block:void 0,grace_period:(0,e.exists)(i,"grace_period")?i.grace_period:void 0,last_txid:i.last_txid,resolver:(0,e.exists)(i,"resolver")?i.resolver:void 0,status:i.status,zonefile:i.zonefile,zonefile_hash:i.zonefile_hash}}Zs.BnsGetNameInfoResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{address:i.address,blockchain:i.blockchain,expire_block:i.expire_block,grace_period:i.grace_period,last_txid:i.last_txid,resolver:i.resolver,status:i.status,zonefile:i.zonefile,zonefile_hash:i.zonefile_hash}}return Zs.BnsGetNameInfoResponseToJSON=r,Zs}var ea={},mN;function pq(){if(mN)return ea;mN=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.BnsGetNamePriceResponseToJSON=ea.BnsGetNamePriceResponseFromJSONTyped=ea.BnsGetNamePriceResponseFromJSON=void 0;function e(r){return t(r)}ea.BnsGetNamePriceResponseFromJSON=e;function t(r,i){return r==null?r:{units:r.units,amount:r.amount}}ea.BnsGetNamePriceResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{units:r.units,amount:r.amount}}return ea.BnsGetNamePriceResponseToJSON=n,ea}var ta={},gN;function mq(){if(gN)return ta;gN=1,Object.defineProperty(ta,"__esModule",{value:!0}),ta.BnsGetNamespacePriceResponseToJSON=ta.BnsGetNamespacePriceResponseFromJSONTyped=ta.BnsGetNamespacePriceResponseFromJSON=void 0;function e(r){return t(r)}ta.BnsGetNamespacePriceResponseFromJSON=e;function t(r,i){return r==null?r:{units:r.units,amount:r.amount}}ta.BnsGetNamespacePriceResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{units:r.units,amount:r.amount}}return ta.BnsGetNamespacePriceResponseToJSON=n,ta}var na={},yN;function gq(){if(yN)return na;yN=1,Object.defineProperty(na,"__esModule",{value:!0}),na.BnsNamesOwnByAddressResponseToJSON=na.BnsNamesOwnByAddressResponseFromJSONTyped=na.BnsNamesOwnByAddressResponseFromJSON=void 0;function e(r){return t(r)}na.BnsNamesOwnByAddressResponseFromJSON=e;function t(r,i){return r==null?r:{names:r.names}}na.BnsNamesOwnByAddressResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{names:r.names}}return na.BnsNamesOwnByAddressResponseToJSON=n,na}var ra={},wN;function yq(){if(wN)return ra;wN=1,Object.defineProperty(ra,"__esModule",{value:!0}),ra.BurnchainRewardToJSON=ra.BurnchainRewardFromJSONTyped=ra.BurnchainRewardFromJSON=void 0;function e(r){return t(r)}ra.BurnchainRewardFromJSON=e;function t(r,i){return r==null?r:{canonical:r.canonical,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,burn_amount:r.burn_amount,reward_recipient:r.reward_recipient,reward_amount:r.reward_amount,reward_index:r.reward_index}}ra.BurnchainRewardFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{canonical:r.canonical,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,burn_amount:r.burn_amount,reward_recipient:r.reward_recipient,reward_amount:r.reward_amount,reward_index:r.reward_index}}return ra.BurnchainRewardToJSON=n,ra}var ia={},bN;function wq(){if(bN)return ia;bN=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.BurnchainRewardListResponseToJSON=ia.BurnchainRewardListResponseFromJSONTyped=ia.BurnchainRewardListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}ia.BurnchainRewardListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,results:i.results.map(e.BurnchainRewardFromJSON)}}ia.BurnchainRewardListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,results:i.results.map(e.BurnchainRewardToJSON)}}return ia.BurnchainRewardListResponseToJSON=r,ia}var oa={},SN;function bq(){if(SN)return oa;SN=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.BurnchainRewardSlotHolderToJSON=oa.BurnchainRewardSlotHolderFromJSONTyped=oa.BurnchainRewardSlotHolderFromJSON=void 0;function e(r){return t(r)}oa.BurnchainRewardSlotHolderFromJSON=e;function t(r,i){return r==null?r:{canonical:r.canonical,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,address:r.address,slot_index:r.slot_index}}oa.BurnchainRewardSlotHolderFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{canonical:r.canonical,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,address:r.address,slot_index:r.slot_index}}return oa.BurnchainRewardSlotHolderToJSON=n,oa}var sa={},vN;function Sq(){if(vN)return sa;vN=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.BurnchainRewardSlotHolderListResponseToJSON=sa.BurnchainRewardSlotHolderListResponseFromJSONTyped=sa.BurnchainRewardSlotHolderListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}sa.BurnchainRewardSlotHolderListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.BurnchainRewardSlotHolderFromJSON)}}sa.BurnchainRewardSlotHolderListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.BurnchainRewardSlotHolderToJSON)}}return sa.BurnchainRewardSlotHolderListResponseToJSON=r,sa}var aa={},xN;function vq(){if(xN)return aa;xN=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.BurnchainRewardsTotalToJSON=aa.BurnchainRewardsTotalFromJSONTyped=aa.BurnchainRewardsTotalFromJSON=void 0;function e(r){return t(r)}aa.BurnchainRewardsTotalFromJSON=e;function t(r,i){return r==null?r:{reward_recipient:r.reward_recipient,reward_amount:r.reward_amount}}aa.BurnchainRewardsTotalFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{reward_recipient:r.reward_recipient,reward_amount:r.reward_amount}}return aa.BurnchainRewardsTotalToJSON=n,aa}var ca={},_N;function xq(){if(_N)return ca;_N=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.ChainTipToJSON=ca.ChainTipFromJSONTyped=ca.ChainTipFromJSON=void 0;const e=Ie();function t(i){return n(i)}ca.ChainTipFromJSON=t;function n(i,o){return i==null?i:{block_height:i.block_height,block_hash:i.block_hash,index_block_hash:i.index_block_hash,microblock_hash:(0,e.exists)(i,"microblock_hash")?i.microblock_hash:void 0,microblock_sequence:(0,e.exists)(i,"microblock_sequence")?i.microblock_sequence:void 0,burn_block_height:i.burn_block_height}}ca.ChainTipFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{block_height:i.block_height,block_hash:i.block_hash,index_block_hash:i.index_block_hash,microblock_hash:i.microblock_hash,microblock_sequence:i.microblock_sequence,burn_block_height:i.burn_block_height}}return ca.ChainTipToJSON=r,ca}var ua={},kN;function _q(){if(kN)return ua;kN=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.ContractInterfaceResponseToJSON=ua.ContractInterfaceResponseFromJSONTyped=ua.ContractInterfaceResponseFromJSON=void 0;function e(r){return t(r)}ua.ContractInterfaceResponseFromJSON=e;function t(r,i){return r==null?r:{functions:r.functions,variables:r.variables,maps:r.maps,fungible_tokens:r.fungible_tokens,non_fungible_tokens:r.non_fungible_tokens}}ua.ContractInterfaceResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{functions:r.functions,variables:r.variables,maps:r.maps,fungible_tokens:r.fungible_tokens,non_fungible_tokens:r.non_fungible_tokens}}return ua.ContractInterfaceResponseToJSON=n,ua}var la={},RN;function kq(){if(RN)return la;RN=1,Object.defineProperty(la,"__esModule",{value:!0}),la.ContractListResponseToJSON=la.ContractListResponseFromJSONTyped=la.ContractListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}la.ContractListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,results:i.results.map(e.SmartContractFromJSON)}}la.ContractListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,results:i.results.map(e.SmartContractToJSON)}}return la.ContractListResponseToJSON=r,la}var da={},TN;function Rq(){if(TN)return da;TN=1,Object.defineProperty(da,"__esModule",{value:!0}),da.ContractSourceResponseToJSON=da.ContractSourceResponseFromJSONTyped=da.ContractSourceResponseFromJSON=void 0;function e(r){return t(r)}da.ContractSourceResponseFromJSON=e;function t(r,i){return r==null?r:{source:r.source,publish_height:r.publish_height,proof:r.proof}}da.ContractSourceResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{source:r.source,publish_height:r.publish_height,proof:r.proof}}return da.ContractSourceResponseToJSON=n,da}var fa={},ON;function Tq(){if(ON)return fa;ON=1,Object.defineProperty(fa,"__esModule",{value:!0}),fa.CoreNodeInfoResponseToJSON=fa.CoreNodeInfoResponseFromJSONTyped=fa.CoreNodeInfoResponseFromJSON=void 0;function e(r){return t(r)}fa.CoreNodeInfoResponseFromJSON=e;function t(r,i){return r==null?r:{peer_version:r.peer_version,pox_consensus:r.pox_consensus,burn_block_height:r.burn_block_height,stable_pox_consensus:r.stable_pox_consensus,stable_burn_block_height:r.stable_burn_block_height,server_version:r.server_version,network_id:r.network_id,parent_network_id:r.parent_network_id,stacks_tip_height:r.stacks_tip_height,stacks_tip:r.stacks_tip,stacks_tip_consensus_hash:r.stacks_tip_consensus_hash,unanchored_tip:r.unanchored_tip,exit_at_block_height:r.exit_at_block_height}}fa.CoreNodeInfoResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{peer_version:r.peer_version,pox_consensus:r.pox_consensus,burn_block_height:r.burn_block_height,stable_pox_consensus:r.stable_pox_consensus,stable_burn_block_height:r.stable_burn_block_height,server_version:r.server_version,network_id:r.network_id,parent_network_id:r.parent_network_id,stacks_tip_height:r.stacks_tip_height,stacks_tip:r.stacks_tip,stacks_tip_consensus_hash:r.stacks_tip_consensus_hash,unanchored_tip:r.unanchored_tip,exit_at_block_height:r.exit_at_block_height}}return fa.CoreNodeInfoResponseToJSON=n,fa}var ha={},NN;function Oq(){if(NN)return ha;NN=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.CoreNodePoxResponseToJSON=ha.CoreNodePoxResponseFromJSONTyped=ha.CoreNodePoxResponseFromJSON=void 0;function e(r){return t(r)}ha.CoreNodePoxResponseFromJSON=e;function t(r,i){return r==null?r:{contract_id:r.contract_id,first_burnchain_block_height:r.first_burnchain_block_height,min_amount_ustx:r.min_amount_ustx,registration_window_length:r.registration_window_length,rejection_fraction:r.rejection_fraction,reward_cycle_id:r.reward_cycle_id,reward_cycle_length:r.reward_cycle_length,rejection_votes_left_required:r.rejection_votes_left_required,total_liquid_supply_ustx:r.total_liquid_supply_ustx}}ha.CoreNodePoxResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{contract_id:r.contract_id,first_burnchain_block_height:r.first_burnchain_block_height,min_amount_ustx:r.min_amount_ustx,registration_window_length:r.registration_window_length,rejection_fraction:r.rejection_fraction,reward_cycle_id:r.reward_cycle_id,reward_cycle_length:r.reward_cycle_length,rejection_votes_left_required:r.rejection_votes_left_required,total_liquid_supply_ustx:r.total_liquid_supply_ustx}}return ha.CoreNodePoxResponseToJSON=n,ha}var pa={},CN;function Nq(){if(CN)return pa;CN=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.FeeRateToJSON=pa.FeeRateFromJSONTyped=pa.FeeRateFromJSON=void 0;function e(r){return t(r)}pa.FeeRateFromJSON=e;function t(r,i){return r==null?r:{fee_rate:r.fee_rate}}pa.FeeRateFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{fee_rate:r.fee_rate}}return pa.FeeRateToJSON=n,pa}var ma={},EN;function Cq(){if(EN)return ma;EN=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.FeeRateRequestToJSON=ma.FeeRateRequestFromJSONTyped=ma.FeeRateRequestFromJSON=void 0;function e(r){return t(r)}ma.FeeRateRequestFromJSON=e;function t(r,i){return r==null?r:{transaction:r.transaction}}ma.FeeRateRequestFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{transaction:r.transaction}}return ma.FeeRateRequestToJSON=n,ma}var ga={},AN;function Eq(){if(AN)return ga;AN=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.FungibleTokenMetadataToJSON=ga.FungibleTokenMetadataFromJSONTyped=ga.FungibleTokenMetadataFromJSON=void 0;function e(r){return t(r)}ga.FungibleTokenMetadataFromJSON=e;function t(r,i){return r==null?r:{token_uri:r.token_uri,name:r.name,description:r.description,image_uri:r.image_uri,image_canonical_uri:r.image_canonical_uri,symbol:r.symbol,decimals:r.decimals,tx_id:r.tx_id,sender_address:r.sender_address}}ga.FungibleTokenMetadataFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{token_uri:r.token_uri,name:r.name,description:r.description,image_uri:r.image_uri,image_canonical_uri:r.image_canonical_uri,symbol:r.symbol,decimals:r.decimals,tx_id:r.tx_id,sender_address:r.sender_address}}return ga.FungibleTokenMetadataToJSON=n,ga}var ya={},FN;function Aq(){if(FN)return ya;FN=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.FungibleTokensMetadataListToJSON=ya.FungibleTokensMetadataListFromJSONTyped=ya.FungibleTokensMetadataListFromJSON=void 0;const e=Fe();function t(i){return n(i)}ya.FungibleTokensMetadataListFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.FungibleTokenMetadataFromJSON)}}ya.FungibleTokensMetadataListFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.FungibleTokenMetadataToJSON)}}return ya.FungibleTokensMetadataListToJSON=r,ya}var wa={},IN;function Fq(){if(IN)return wa;IN=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.GetRawTransactionResultToJSON=wa.GetRawTransactionResultFromJSONTyped=wa.GetRawTransactionResultFromJSON=void 0;function e(r){return t(r)}wa.GetRawTransactionResultFromJSON=e;function t(r,i){return r==null?r:{raw_tx:r.raw_tx}}wa.GetRawTransactionResultFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{raw_tx:r.raw_tx}}return wa.GetRawTransactionResultToJSON=n,wa}var ba={},PN;function Iq(){if(PN)return ba;PN=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.GetStxSupplyLegacyFormatResponseToJSON=ba.GetStxSupplyLegacyFormatResponseFromJSONTyped=ba.GetStxSupplyLegacyFormatResponseFromJSON=void 0;function e(r){return t(r)}ba.GetStxSupplyLegacyFormatResponseFromJSON=e;function t(r,i){return r==null?r:{unlockedPercent:r.unlockedPercent,totalStacks:r.totalStacks,totalStacksFormatted:r.totalStacksFormatted,unlockedSupply:r.unlockedSupply,unlockedSupplyFormatted:r.unlockedSupplyFormatted,blockHeight:r.blockHeight}}ba.GetStxSupplyLegacyFormatResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{unlockedPercent:r.unlockedPercent,totalStacks:r.totalStacks,totalStacksFormatted:r.totalStacksFormatted,unlockedSupply:r.unlockedSupply,unlockedSupplyFormatted:r.unlockedSupplyFormatted,blockHeight:r.blockHeight}}return ba.GetStxSupplyLegacyFormatResponseToJSON=n,ba}var Sa={},MN;function Pq(){if(MN)return Sa;MN=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.GetStxSupplyResponseToJSON=Sa.GetStxSupplyResponseFromJSONTyped=Sa.GetStxSupplyResponseFromJSON=void 0;function e(r){return t(r)}Sa.GetStxSupplyResponseFromJSON=e;function t(r,i){return r==null?r:{unlocked_percent:r.unlocked_percent,total_stx:r.total_stx,unlocked_stx:r.unlocked_stx,block_height:r.block_height}}Sa.GetStxSupplyResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{unlocked_percent:r.unlocked_percent,total_stx:r.total_stx,unlocked_stx:r.unlocked_stx,block_height:r.block_height}}return Sa.GetStxSupplyResponseToJSON=n,Sa}var Bv={},LN;function Mq(){return LN||(LN=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InboundStxTransferToJSON=e.InboundStxTransferFromJSONTyped=e.InboundStxTransferFromJSON=e.InboundStxTransferTransferTypeEnum=void 0,function(i){i.bulk_send="bulk-send",i.stx_transfer="stx-transfer",i.stx_transfer_memo="stx-transfer-memo"}(e.InboundStxTransferTransferTypeEnum||(e.InboundStxTransferTransferTypeEnum={}));function t(i){return n(i)}e.InboundStxTransferFromJSON=t;function n(i,o){return i==null?i:{sender:i.sender,amount:i.amount,memo:i.memo,block_height:i.block_height,tx_id:i.tx_id,transfer_type:i.transfer_type,tx_index:i.tx_index}}e.InboundStxTransferFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{sender:i.sender,amount:i.amount,memo:i.memo,block_height:i.block_height,tx_id:i.tx_id,transfer_type:i.transfer_type,tx_index:i.tx_index}}e.InboundStxTransferToJSON=r}(Bv)),Bv}var va={},BN;function Lq(){if(BN)return va;BN=1,Object.defineProperty(va,"__esModule",{value:!0}),va.InlineObjectToJSON=va.InlineObjectFromJSONTyped=va.InlineObjectFromJSON=void 0;const e=Ie();function t(i){return n(i)}va.InlineObjectFromJSON=t;function n(i,o){return i==null?i:{address:(0,e.exists)(i,"address")?i.address:void 0,stacking:(0,e.exists)(i,"stacking")?i.stacking:void 0}}va.InlineObjectFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{address:i.address,stacking:i.stacking}}return va.InlineObjectToJSON=r,va}var xa={},jN;function Bq(){if(jN)return xa;jN=1,Object.defineProperty(xa,"__esModule",{value:!0}),xa.InlineObject1ToJSON=xa.InlineObject1FromJSONTyped=xa.InlineObject1FromJSON=void 0;const e=Ie();function t(i){return n(i)}xa.InlineObject1FromJSON=t;function n(i,o){return i==null?i:{address:(0,e.exists)(i,"address")?i.address:void 0}}xa.InlineObject1FromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{address:i.address}}return xa.InlineObject1ToJSON=r,xa}var _a={},DN;function jq(){if(DN)return _a;DN=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.InlineResponse403ToJSON=_a.InlineResponse403FromJSONTyped=_a.InlineResponse403FromJSON=void 0;const e=Ie();function t(i){return n(i)}_a.InlineResponse403FromJSON=t;function n(i,o){return i==null?i:{error:(0,e.exists)(i,"error")?i.error:void 0,success:(0,e.exists)(i,"success")?i.success:void 0}}_a.InlineResponse403FromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{error:i.error,success:i.success}}return _a.InlineResponse403ToJSON=r,_a}var ka={},JN;function Dq(){if(JN)return ka;JN=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.MapEntryResponseToJSON=ka.MapEntryResponseFromJSONTyped=ka.MapEntryResponseFromJSON=void 0;const e=Ie();function t(i){return n(i)}ka.MapEntryResponseFromJSON=t;function n(i,o){return i==null?i:{data:i.data,proof:(0,e.exists)(i,"proof")?i.proof:void 0}}ka.MapEntryResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{data:i.data,proof:i.proof}}return ka.MapEntryResponseToJSON=r,ka}var Ra={},$N;function Jq(){if($N)return Ra;$N=1,Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.MempoolTransactionListResponseToJSON=Ra.MempoolTransactionListResponseFromJSONTyped=Ra.MempoolTransactionListResponseFromJSON=void 0;function e(r){return t(r)}Ra.MempoolTransactionListResponseFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}Ra.MempoolTransactionListResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return Ra.MempoolTransactionListResponseToJSON=n,Ra}var Ta={},qN;function $q(){if(qN)return Ta;qN=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.MempoolTransactionStatsResponseToJSON=Ta.MempoolTransactionStatsResponseFromJSONTyped=Ta.MempoolTransactionStatsResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ta.MempoolTransactionStatsResponseFromJSON=t;function n(i,o){return i==null?i:{tx_type_counts:(0,e.MempoolTransactionStatsResponseTxTypeCountsFromJSON)(i.tx_type_counts),tx_simple_fee_averages:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesFromJSON)(i.tx_simple_fee_averages),tx_ages:(0,e.MempoolTransactionStatsResponseTxAgesFromJSON)(i.tx_ages),tx_byte_sizes:(0,e.MempoolTransactionStatsResponseTxByteSizesFromJSON)(i.tx_byte_sizes)}}Ta.MempoolTransactionStatsResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{tx_type_counts:(0,e.MempoolTransactionStatsResponseTxTypeCountsToJSON)(i.tx_type_counts),tx_simple_fee_averages:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesToJSON)(i.tx_simple_fee_averages),tx_ages:(0,e.MempoolTransactionStatsResponseTxAgesToJSON)(i.tx_ages),tx_byte_sizes:(0,e.MempoolTransactionStatsResponseTxByteSizesToJSON)(i.tx_byte_sizes)}}return Ta.MempoolTransactionStatsResponseToJSON=r,Ta}var Oa={},UN;function qq(){if(UN)return Oa;UN=1,Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.MempoolTransactionStatsResponseTxAgesToJSON=Oa.MempoolTransactionStatsResponseTxAgesFromJSONTyped=Oa.MempoolTransactionStatsResponseTxAgesFromJSON=void 0;const e=Fe();function t(i){return n(i)}Oa.MempoolTransactionStatsResponseTxAgesFromJSON=t;function n(i,o){return i==null?i:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.poison_microblock)}}Oa.MempoolTransactionStatsResponseTxAgesFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.poison_microblock)}}return Oa.MempoolTransactionStatsResponseTxAgesToJSON=r,Oa}var Na={},HN;function Uq(){if(HN)return Na;HN=1,Object.defineProperty(Na,"__esModule",{value:!0}),Na.MempoolTransactionStatsResponseTxByteSizesToJSON=Na.MempoolTransactionStatsResponseTxByteSizesFromJSONTyped=Na.MempoolTransactionStatsResponseTxByteSizesFromJSON=void 0;const e=Fe();function t(i){return n(i)}Na.MempoolTransactionStatsResponseTxByteSizesFromJSON=t;function n(i,o){return i==null?i:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.poison_microblock)}}Na.MempoolTransactionStatsResponseTxByteSizesFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.poison_microblock)}}return Na.MempoolTransactionStatsResponseTxByteSizesToJSON=r,Na}var Ca={},zN;function Hq(){if(zN)return Ca;zN=1,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesToJSON=Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesFromJSONTyped=Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesFromJSON=t;function n(i,o){return i==null?i:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.poison_microblock)}}Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.poison_microblock)}}return Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesToJSON=r,Ca}var Ea={},WN;function zq(){if(WN)return Ea;WN=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON=Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSONTyped=Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON=void 0;function e(r){return t(r)}Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON=e;function t(r,i){return r==null?r:{p25:r.p25,p50:r.p50,p75:r.p75,p95:r.p95}}Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{p25:r.p25,p50:r.p50,p75:r.p75,p95:r.p95}}return Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON=n,Ea}var Aa={},VN;function Wq(){if(VN)return Aa;VN=1,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.MempoolTransactionStatsResponseTxTypeCountsToJSON=Aa.MempoolTransactionStatsResponseTxTypeCountsFromJSONTyped=Aa.MempoolTransactionStatsResponseTxTypeCountsFromJSON=void 0;function e(r){return t(r)}Aa.MempoolTransactionStatsResponseTxTypeCountsFromJSON=e;function t(r,i){return r==null?r:{token_transfer:r.token_transfer,smart_contract:r.smart_contract,contract_call:r.contract_call,poison_microblock:r.poison_microblock}}Aa.MempoolTransactionStatsResponseTxTypeCountsFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{token_transfer:r.token_transfer,smart_contract:r.smart_contract,contract_call:r.contract_call,poison_microblock:r.poison_microblock}}return Aa.MempoolTransactionStatsResponseTxTypeCountsToJSON=n,Aa}var Fa={},GN;function Vq(){if(GN)return Fa;GN=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.MicroblockToJSON=Fa.MicroblockFromJSONTyped=Fa.MicroblockFromJSON=void 0;function e(r){return t(r)}Fa.MicroblockFromJSON=e;function t(r,i){return r==null?r:{canonical:r.canonical,microblock_canonical:r.microblock_canonical,microblock_hash:r.microblock_hash,microblock_sequence:r.microblock_sequence,microblock_parent_hash:r.microblock_parent_hash,block_height:r.block_height,parent_block_height:r.parent_block_height,parent_block_hash:r.parent_block_hash,parent_burn_block_hash:r.parent_burn_block_hash,parent_burn_block_time:r.parent_burn_block_time,parent_burn_block_time_iso:r.parent_burn_block_time_iso,parent_burn_block_height:r.parent_burn_block_height,block_hash:r.block_hash,txs:r.txs}}Fa.MicroblockFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{canonical:r.canonical,microblock_canonical:r.microblock_canonical,microblock_hash:r.microblock_hash,microblock_sequence:r.microblock_sequence,microblock_parent_hash:r.microblock_parent_hash,block_height:r.block_height,parent_block_height:r.parent_block_height,parent_block_hash:r.parent_block_hash,parent_burn_block_hash:r.parent_burn_block_hash,parent_burn_block_time:r.parent_burn_block_time,parent_burn_block_time_iso:r.parent_burn_block_time_iso,parent_burn_block_height:r.parent_burn_block_height,block_hash:r.block_hash,txs:r.txs}}return Fa.MicroblockToJSON=n,Fa}var Ia={},KN;function Gq(){if(KN)return Ia;KN=1,Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.MicroblockListResponseToJSON=Ia.MicroblockListResponseFromJSONTyped=Ia.MicroblockListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ia.MicroblockListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.MicroblockFromJSON)}}Ia.MicroblockListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.MicroblockToJSON)}}return Ia.MicroblockListResponseToJSON=r,Ia}var Pa={},QN;function Kq(){if(QN)return Pa;QN=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.NetworkBlockTimeResponseToJSON=Pa.NetworkBlockTimeResponseFromJSONTyped=Pa.NetworkBlockTimeResponseFromJSON=void 0;function e(r){return t(r)}Pa.NetworkBlockTimeResponseFromJSON=e;function t(r,i){return r==null?r:{target_block_time:r.target_block_time}}Pa.NetworkBlockTimeResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{target_block_time:r.target_block_time}}return Pa.NetworkBlockTimeResponseToJSON=n,Pa}var Ma={},YN;function Qq(){if(YN)return Ma;YN=1,Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.NetworkBlockTimesResponseToJSON=Ma.NetworkBlockTimesResponseFromJSONTyped=Ma.NetworkBlockTimesResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ma.NetworkBlockTimesResponseFromJSON=t;function n(i,o){return i==null?i:{mainnet:(0,e.TargetBlockTimeFromJSON)(i.mainnet),testnet:(0,e.TargetBlockTimeFromJSON)(i.testnet)}}Ma.NetworkBlockTimesResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{mainnet:(0,e.TargetBlockTimeToJSON)(i.mainnet),testnet:(0,e.TargetBlockTimeToJSON)(i.testnet)}}return Ma.NetworkBlockTimesResponseToJSON=r,Ma}var La={},XN;function Yq(){if(XN)return La;XN=1,Object.defineProperty(La,"__esModule",{value:!0}),La.NetworkIdentifierToJSON=La.NetworkIdentifierFromJSONTyped=La.NetworkIdentifierFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}La.NetworkIdentifierFromJSON=n;function r(o,a){return o==null?o:{blockchain:o.blockchain,network:o.network,sub_network_identifier:(0,e.exists)(o,"sub_network_identifier")?(0,t.RosettaNetworkListResponseSubNetworkIdentifierFromJSON)(o.sub_network_identifier):void 0}}La.NetworkIdentifierFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{blockchain:o.blockchain,network:o.network,sub_network_identifier:(0,t.RosettaNetworkListResponseSubNetworkIdentifierToJSON)(o.sub_network_identifier)}}return La.NetworkIdentifierToJSON=i,La}var Ba={},ZN;function Xq(){if(ZN)return Ba;ZN=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.NftEventToJSON=Ba.NftEventFromJSONTyped=Ba.NftEventFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Ba.NftEventFromJSON=n;function r(o,a){return o==null?o:{sender:(0,e.exists)(o,"sender")?o.sender:void 0,recipient:(0,e.exists)(o,"recipient")?o.recipient:void 0,asset_identifier:o.asset_identifier,asset_event_type:o.asset_event_type,value:(0,t.AddressNftListResponseValueFromJSON)(o.value),tx_id:o.tx_id,tx_index:o.tx_index,block_height:o.block_height,event_index:o.event_index}}Ba.NftEventFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{sender:o.sender,recipient:o.recipient,asset_identifier:o.asset_identifier,asset_event_type:o.asset_event_type,value:(0,t.AddressNftListResponseValueToJSON)(o.value),tx_id:o.tx_id,tx_index:o.tx_index,block_height:o.block_height,event_index:o.event_index}}return Ba.NftEventToJSON=i,Ba}var ja={},eC;function Zq(){if(eC)return ja;eC=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.NonFungibleTokenHistoryEventListToJSON=ja.NonFungibleTokenHistoryEventListFromJSONTyped=ja.NonFungibleTokenHistoryEventListFromJSON=void 0;function e(r){return t(r)}ja.NonFungibleTokenHistoryEventListFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}ja.NonFungibleTokenHistoryEventListFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return ja.NonFungibleTokenHistoryEventListToJSON=n,ja}var Da={},tC;function eU(){if(tC)return Da;tC=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.NonFungibleTokenHoldingsListToJSON=Da.NonFungibleTokenHoldingsListFromJSONTyped=Da.NonFungibleTokenHoldingsListFromJSON=void 0;function e(r){return t(r)}Da.NonFungibleTokenHoldingsListFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}Da.NonFungibleTokenHoldingsListFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return Da.NonFungibleTokenHoldingsListToJSON=n,Da}var Ja={},nC;function tU(){if(nC)return Ja;nC=1,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.NonFungibleTokenMetadataToJSON=Ja.NonFungibleTokenMetadataFromJSONTyped=Ja.NonFungibleTokenMetadataFromJSON=void 0;function e(r){return t(r)}Ja.NonFungibleTokenMetadataFromJSON=e;function t(r,i){return r==null?r:{token_uri:r.token_uri,name:r.name,description:r.description,image_uri:r.image_uri,image_canonical_uri:r.image_canonical_uri,tx_id:r.tx_id,sender_address:r.sender_address}}Ja.NonFungibleTokenMetadataFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{token_uri:r.token_uri,name:r.name,description:r.description,image_uri:r.image_uri,image_canonical_uri:r.image_canonical_uri,tx_id:r.tx_id,sender_address:r.sender_address}}return Ja.NonFungibleTokenMetadataToJSON=n,Ja}var $a={},rC;function nU(){if(rC)return $a;rC=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.NonFungibleTokenMintListToJSON=$a.NonFungibleTokenMintListFromJSONTyped=$a.NonFungibleTokenMintListFromJSON=void 0;function e(r){return t(r)}$a.NonFungibleTokenMintListFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}$a.NonFungibleTokenMintListFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return $a.NonFungibleTokenMintListToJSON=n,$a}var qa={},iC;function rU(){if(iC)return qa;iC=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.NonFungibleTokensMetadataListToJSON=qa.NonFungibleTokensMetadataListFromJSONTyped=qa.NonFungibleTokensMetadataListFromJSON=void 0;const e=Fe();function t(i){return n(i)}qa.NonFungibleTokensMetadataListFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.NonFungibleTokenMetadataFromJSON)}}qa.NonFungibleTokensMetadataListFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.NonFungibleTokenMetadataToJSON)}}return qa.NonFungibleTokensMetadataListToJSON=r,qa}var Ua={},oC;function iU(){if(oC)return Ua;oC=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.OtherTransactionIdentifierToJSON=Ua.OtherTransactionIdentifierFromJSONTyped=Ua.OtherTransactionIdentifierFromJSON=void 0;function e(r){return t(r)}Ua.OtherTransactionIdentifierFromJSON=e;function t(r,i){return r==null?r:{hash:r.hash}}Ua.OtherTransactionIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{hash:r.hash}}return Ua.OtherTransactionIdentifierToJSON=n,Ua}var Ha={},sC;function oU(){if(sC)return Ha;sC=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.PoolDelegationToJSON=Ha.PoolDelegationFromJSONTyped=Ha.PoolDelegationFromJSON=void 0;const e=Ie();function t(i){return n(i)}Ha.PoolDelegationFromJSON=t;function n(i,o){return i==null?i:{stacker:i.stacker,pox_addr:(0,e.exists)(i,"pox_addr")?i.pox_addr:void 0,amount_ustx:i.amount_ustx,burn_block_unlock_height:(0,e.exists)(i,"burn_block_unlock_height")?i.burn_block_unlock_height:void 0,block_height:i.block_height,tx_id:i.tx_id}}Ha.PoolDelegationFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{stacker:i.stacker,pox_addr:i.pox_addr,amount_ustx:i.amount_ustx,burn_block_unlock_height:i.burn_block_unlock_height,block_height:i.block_height,tx_id:i.tx_id}}return Ha.PoolDelegationToJSON=r,Ha}var za={},aC;function sU(){if(aC)return za;aC=1,Object.defineProperty(za,"__esModule",{value:!0}),za.PoolDelegationsResponseToJSON=za.PoolDelegationsResponseFromJSONTyped=za.PoolDelegationsResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}za.PoolDelegationsResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.PoolDelegationFromJSON)}}za.PoolDelegationsResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.PoolDelegationToJSON)}}return za.PoolDelegationsResponseToJSON=r,za}var Wa={},cC;function aU(){if(cC)return Wa;cC=1,Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.PostCoreNodeTransactionsErrorToJSON=Wa.PostCoreNodeTransactionsErrorFromJSONTyped=Wa.PostCoreNodeTransactionsErrorFromJSON=void 0;function e(r){return t(r)}Wa.PostCoreNodeTransactionsErrorFromJSON=e;function t(r,i){return r==null?r:{error:r.error,reason:r.reason,reason_data:r.reason_data,txid:r.txid}}Wa.PostCoreNodeTransactionsErrorFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{error:r.error,reason:r.reason,reason_data:r.reason_data,txid:r.txid}}return Wa.PostCoreNodeTransactionsErrorToJSON=n,Wa}var Va={},uC;function cU(){if(uC)return Va;uC=1,Object.defineProperty(Va,"__esModule",{value:!0}),Va.ReadOnlyFunctionArgsToJSON=Va.ReadOnlyFunctionArgsFromJSONTyped=Va.ReadOnlyFunctionArgsFromJSON=void 0;function e(r){return t(r)}Va.ReadOnlyFunctionArgsFromJSON=e;function t(r,i){return r==null?r:{sender:r.sender,arguments:r.arguments}}Va.ReadOnlyFunctionArgsFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{sender:r.sender,arguments:r.arguments}}return Va.ReadOnlyFunctionArgsToJSON=n,Va}var Ga={},lC;function uU(){if(lC)return Ga;lC=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.ReadOnlyFunctionSuccessResponseToJSON=Ga.ReadOnlyFunctionSuccessResponseFromJSONTyped=Ga.ReadOnlyFunctionSuccessResponseFromJSON=void 0;const e=Ie();function t(i){return n(i)}Ga.ReadOnlyFunctionSuccessResponseFromJSON=t;function n(i,o){return i==null?i:{okay:i.okay,result:(0,e.exists)(i,"result")?i.result:void 0,cause:(0,e.exists)(i,"cause")?i.cause:void 0}}Ga.ReadOnlyFunctionSuccessResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{okay:i.okay,result:i.result,cause:i.cause}}return Ga.ReadOnlyFunctionSuccessResponseToJSON=r,Ga}var Ka={},dC;function lU(){if(dC)return Ka;dC=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.RosettaAccountToJSON=Ka.RosettaAccountFromJSONTyped=Ka.RosettaAccountFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Ka.RosettaAccountFromJSON=n;function r(o,a){return o==null?o:{address:o.address,sub_account:(0,e.exists)(o,"sub_account")?(0,t.RosettaSubAccountFromJSON)(o.sub_account):void 0,metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Ka.RosettaAccountFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{address:o.address,sub_account:(0,t.RosettaSubAccountToJSON)(o.sub_account),metadata:o.metadata}}return Ka.RosettaAccountToJSON=i,Ka}var Qa={},fC;function dU(){if(fC)return Qa;fC=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.RosettaAccountBalanceRequestToJSON=Qa.RosettaAccountBalanceRequestFromJSONTyped=Qa.RosettaAccountBalanceRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Qa.RosettaAccountBalanceRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),account_identifier:(0,t.RosettaAccountFromJSON)(o.account_identifier),block_identifier:(0,e.exists)(o,"block_identifier")?o.block_identifier:void 0}}Qa.RosettaAccountBalanceRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),account_identifier:(0,t.RosettaAccountToJSON)(o.account_identifier),block_identifier:o.block_identifier}}return Qa.RosettaAccountBalanceRequestToJSON=i,Qa}var Ya={},hC;function fU(){if(hC)return Ya;hC=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.RosettaAccountBalanceResponseToJSON=Ya.RosettaAccountBalanceResponseFromJSONTyped=Ya.RosettaAccountBalanceResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Ya.RosettaAccountBalanceResponseFromJSON=n;function r(o,a){return o==null?o:{block_identifier:o.block_identifier,balances:o.balances.map(t.RosettaAmountFromJSON),coins:(0,e.exists)(o,"coins")?o.coins.map(t.RosettaCoinFromJSON):void 0,metadata:(0,e.exists)(o,"metadata")?(0,t.RosettaAccountBalanceResponseMetadataFromJSON)(o.metadata):void 0}}Ya.RosettaAccountBalanceResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{block_identifier:o.block_identifier,balances:o.balances.map(t.RosettaAmountToJSON),coins:o.coins===void 0?void 0:o.coins.map(t.RosettaCoinToJSON),metadata:(0,t.RosettaAccountBalanceResponseMetadataToJSON)(o.metadata)}}return Ya.RosettaAccountBalanceResponseToJSON=i,Ya}var Xa={},pC;function hU(){if(pC)return Xa;pC=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.RosettaAccountBalanceResponseCoinIdentifierToJSON=Xa.RosettaAccountBalanceResponseCoinIdentifierFromJSONTyped=Xa.RosettaAccountBalanceResponseCoinIdentifierFromJSON=void 0;function e(r){return t(r)}Xa.RosettaAccountBalanceResponseCoinIdentifierFromJSON=e;function t(r,i){return r==null?r:{identifier:r.identifier}}Xa.RosettaAccountBalanceResponseCoinIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{identifier:r.identifier}}return Xa.RosettaAccountBalanceResponseCoinIdentifierToJSON=n,Xa}var Za={},mC;function pU(){if(mC)return Za;mC=1,Object.defineProperty(Za,"__esModule",{value:!0}),Za.RosettaAccountBalanceResponseMetadataToJSON=Za.RosettaAccountBalanceResponseMetadataFromJSONTyped=Za.RosettaAccountBalanceResponseMetadataFromJSON=void 0;function e(r){return t(r)}Za.RosettaAccountBalanceResponseMetadataFromJSON=e;function t(r,i){return r==null?r:{sequence_number:r.sequence_number}}Za.RosettaAccountBalanceResponseMetadataFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{sequence_number:r.sequence_number}}return Za.RosettaAccountBalanceResponseMetadataToJSON=n,Za}var ec={},gC;function mU(){if(gC)return ec;gC=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.RosettaAccountIdentifierToJSON=ec.RosettaAccountIdentifierFromJSONTyped=ec.RosettaAccountIdentifierFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}ec.RosettaAccountIdentifierFromJSON=n;function r(o,a){return o==null?o:{address:o.address,sub_account:(0,e.exists)(o,"sub_account")?(0,t.RosettaSubAccountFromJSON)(o.sub_account):void 0,metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}ec.RosettaAccountIdentifierFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{address:o.address,sub_account:(0,t.RosettaSubAccountToJSON)(o.sub_account),metadata:o.metadata}}return ec.RosettaAccountIdentifierToJSON=i,ec}var tc={},yC;function gU(){if(yC)return tc;yC=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.RosettaAmountToJSON=tc.RosettaAmountFromJSONTyped=tc.RosettaAmountFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}tc.RosettaAmountFromJSON=n;function r(o,a){return o==null?o:{value:o.value,currency:(0,t.RosettaCurrencyFromJSON)(o.currency),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}tc.RosettaAmountFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{value:o.value,currency:(0,t.RosettaCurrencyToJSON)(o.currency),metadata:o.metadata}}return tc.RosettaAmountToJSON=i,tc}var nc={},wC;function yU(){if(wC)return nc;wC=1,Object.defineProperty(nc,"__esModule",{value:!0}),nc.RosettaBlockToJSON=nc.RosettaBlockFromJSONTyped=nc.RosettaBlockFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}nc.RosettaBlockFromJSON=n;function r(o,a){return o==null?o:{block_identifier:o.block_identifier,parent_block_identifier:(0,t.RosettaParentBlockIdentifierFromJSON)(o.parent_block_identifier),timestamp:o.timestamp,transactions:o.transactions.map(t.RosettaTransactionFromJSON),metadata:(0,e.exists)(o,"metadata")?(0,t.RosettaBlockMetadata1FromJSON)(o.metadata):void 0}}nc.RosettaBlockFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{block_identifier:o.block_identifier,parent_block_identifier:(0,t.RosettaParentBlockIdentifierToJSON)(o.parent_block_identifier),timestamp:o.timestamp,transactions:o.transactions.map(t.RosettaTransactionToJSON),metadata:(0,t.RosettaBlockMetadata1ToJSON)(o.metadata)}}return nc.RosettaBlockToJSON=i,nc}var rc={},bC;function wU(){if(bC)return rc;bC=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.RosettaBlockMetadataToJSON=rc.RosettaBlockMetadataFromJSONTyped=rc.RosettaBlockMetadataFromJSON=void 0;const e=Ie();function t(i){return n(i)}rc.RosettaBlockMetadataFromJSON=t;function n(i,o){return i==null?i:{memo:(0,e.exists)(i,"memo")?i.memo:void 0,size:(0,e.exists)(i,"size")?i.size:void 0,lockTime:(0,e.exists)(i,"lockTime")?i.lockTime:void 0}}rc.RosettaBlockMetadataFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{memo:i.memo,size:i.size,lockTime:i.lockTime}}return rc.RosettaBlockMetadataToJSON=r,rc}var ic={},SC;function bU(){if(SC)return ic;SC=1,Object.defineProperty(ic,"__esModule",{value:!0}),ic.RosettaBlockMetadata1ToJSON=ic.RosettaBlockMetadata1FromJSONTyped=ic.RosettaBlockMetadata1FromJSON=void 0;function e(r){return t(r)}ic.RosettaBlockMetadata1FromJSON=e;function t(r,i){return r==null?r:{transactions_root:r.transactions_root,difficulty:r.difficulty}}ic.RosettaBlockMetadata1FromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{transactions_root:r.transactions_root,difficulty:r.difficulty}}return ic.RosettaBlockMetadata1ToJSON=n,ic}var oc={},vC;function SU(){if(vC)return oc;vC=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.RosettaBlockRequestToJSON=oc.RosettaBlockRequestFromJSONTyped=oc.RosettaBlockRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}oc.RosettaBlockRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),block_identifier:i.block_identifier}}oc.RosettaBlockRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),block_identifier:i.block_identifier}}return oc.RosettaBlockRequestToJSON=r,oc}var sc={},xC;function vU(){if(xC)return sc;xC=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.RosettaBlockResponseToJSON=sc.RosettaBlockResponseFromJSONTyped=sc.RosettaBlockResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}sc.RosettaBlockResponseFromJSON=n;function r(o,a){return o==null?o:{block:(0,e.exists)(o,"block")?(0,t.RosettaBlockFromJSON)(o.block):void 0,other_transactions:(0,e.exists)(o,"other_transactions")?o.other_transactions.map(t.OtherTransactionIdentifierFromJSON):void 0}}sc.RosettaBlockResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{block:(0,t.RosettaBlockToJSON)(o.block),other_transactions:o.other_transactions===void 0?void 0:o.other_transactions.map(t.OtherTransactionIdentifierToJSON)}}return sc.RosettaBlockResponseToJSON=i,sc}var ac={},_C;function xU(){if(_C)return ac;_C=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.RosettaBlockTransactionRequestToJSON=ac.RosettaBlockTransactionRequestFromJSONTyped=ac.RosettaBlockTransactionRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}ac.RosettaBlockTransactionRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),block_identifier:i.block_identifier,transaction_identifier:(0,e.TransactionIdentifierFromJSON)(i.transaction_identifier)}}ac.RosettaBlockTransactionRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),block_identifier:i.block_identifier,transaction_identifier:(0,e.TransactionIdentifierToJSON)(i.transaction_identifier)}}return ac.RosettaBlockTransactionRequestToJSON=r,ac}var cc={},kC;function _U(){if(kC)return cc;kC=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.RosettaBlockTransactionResponseToJSON=cc.RosettaBlockTransactionResponseFromJSONTyped=cc.RosettaBlockTransactionResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}cc.RosettaBlockTransactionResponseFromJSON=t;function n(i,o){return i==null?i:{transaction:(0,e.RosettaTransactionFromJSON)(i.transaction)}}cc.RosettaBlockTransactionResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{transaction:(0,e.RosettaTransactionToJSON)(i.transaction)}}return cc.RosettaBlockTransactionResponseToJSON=r,cc}var uc={},RC;function kU(){if(RC)return uc;RC=1,Object.defineProperty(uc,"__esModule",{value:!0}),uc.RosettaCoinToJSON=uc.RosettaCoinFromJSONTyped=uc.RosettaCoinFromJSON=void 0;const e=Fe();function t(i){return n(i)}uc.RosettaCoinFromJSON=t;function n(i,o){return i==null?i:{coin_identifier:(0,e.RosettaAccountBalanceResponseCoinIdentifierFromJSON)(i.coin_identifier),amount:(0,e.RosettaAmountFromJSON)(i.amount)}}uc.RosettaCoinFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{coin_identifier:(0,e.RosettaAccountBalanceResponseCoinIdentifierToJSON)(i.coin_identifier),amount:(0,e.RosettaAmountToJSON)(i.amount)}}return uc.RosettaCoinToJSON=r,uc}var jv={},TC;function RU(){return TC||(TC=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RosettaCoinChangeToJSON=e.RosettaCoinChangeFromJSONTyped=e.RosettaCoinChangeFromJSON=e.RosettaCoinChangeCoinActionEnum=void 0;const t=Fe();(function(o){o.created="coin_created",o.spent="coin_spent"})(e.RosettaCoinChangeCoinActionEnum||(e.RosettaCoinChangeCoinActionEnum={}));function n(o){return r(o)}e.RosettaCoinChangeFromJSON=n;function r(o,a){return o==null?o:{coin_identifier:(0,t.RosettaAccountBalanceResponseCoinIdentifierFromJSON)(o.coin_identifier),coin_action:o.coin_action}}e.RosettaCoinChangeFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{coin_identifier:(0,t.RosettaAccountBalanceResponseCoinIdentifierToJSON)(o.coin_identifier),coin_action:o.coin_action}}e.RosettaCoinChangeToJSON=i}(jv)),jv}var lc={},OC;function TU(){if(OC)return lc;OC=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.RosettaConstructionCombineRequestToJSON=lc.RosettaConstructionCombineRequestFromJSONTyped=lc.RosettaConstructionCombineRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}lc.RosettaConstructionCombineRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),unsigned_transaction:i.unsigned_transaction,signatures:i.signatures.map(e.RosettaSignatureFromJSON)}}lc.RosettaConstructionCombineRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),unsigned_transaction:i.unsigned_transaction,signatures:i.signatures.map(e.RosettaSignatureToJSON)}}return lc.RosettaConstructionCombineRequestToJSON=r,lc}var dc={},NC;function OU(){if(NC)return dc;NC=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.RosettaConstructionCombineResponseToJSON=dc.RosettaConstructionCombineResponseFromJSONTyped=dc.RosettaConstructionCombineResponseFromJSON=void 0;function e(r){return t(r)}dc.RosettaConstructionCombineResponseFromJSON=e;function t(r,i){return r==null?r:{signed_transaction:r.signed_transaction}}dc.RosettaConstructionCombineResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{signed_transaction:r.signed_transaction}}return dc.RosettaConstructionCombineResponseToJSON=n,dc}var fc={},CC;function NU(){if(CC)return fc;CC=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.RosettaConstructionDeriveRequestToJSON=fc.RosettaConstructionDeriveRequestFromJSONTyped=fc.RosettaConstructionDeriveRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}fc.RosettaConstructionDeriveRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),public_key:(0,t.RosettaPublicKeyFromJSON)(o.public_key),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}fc.RosettaConstructionDeriveRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),public_key:(0,t.RosettaPublicKeyToJSON)(o.public_key),metadata:o.metadata}}return fc.RosettaConstructionDeriveRequestToJSON=i,fc}var hc={},EC;function CU(){if(EC)return hc;EC=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.RosettaConstructionDeriveResponseToJSON=hc.RosettaConstructionDeriveResponseFromJSONTyped=hc.RosettaConstructionDeriveResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}hc.RosettaConstructionDeriveResponseFromJSON=n;function r(o,a){return o==null?o:{address:(0,e.exists)(o,"address")?o.address:void 0,account_identifier:(0,e.exists)(o,"account_identifier")?(0,t.RosettaAccountIdentifierFromJSON)(o.account_identifier):void 0,metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}hc.RosettaConstructionDeriveResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{address:o.address,account_identifier:(0,t.RosettaAccountIdentifierToJSON)(o.account_identifier),metadata:o.metadata}}return hc.RosettaConstructionDeriveResponseToJSON=i,hc}var pc={},AC;function EU(){if(AC)return pc;AC=1,Object.defineProperty(pc,"__esModule",{value:!0}),pc.RosettaConstructionHashRequestToJSON=pc.RosettaConstructionHashRequestFromJSONTyped=pc.RosettaConstructionHashRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}pc.RosettaConstructionHashRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),signed_transaction:i.signed_transaction}}pc.RosettaConstructionHashRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),signed_transaction:i.signed_transaction}}return pc.RosettaConstructionHashRequestToJSON=r,pc}var mc={},FC;function AU(){if(FC)return mc;FC=1,Object.defineProperty(mc,"__esModule",{value:!0}),mc.RosettaConstructionHashResponseToJSON=mc.RosettaConstructionHashResponseFromJSONTyped=mc.RosettaConstructionHashResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}mc.RosettaConstructionHashResponseFromJSON=n;function r(o,a){return o==null?o:{transaction_identifier:(0,t.TransactionIdentifierFromJSON)(o.transaction_identifier),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}mc.RosettaConstructionHashResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{transaction_identifier:(0,t.TransactionIdentifierToJSON)(o.transaction_identifier),metadata:o.metadata}}return mc.RosettaConstructionHashResponseToJSON=i,mc}var gc={},IC;function FU(){if(IC)return gc;IC=1,Object.defineProperty(gc,"__esModule",{value:!0}),gc.RosettaConstructionMetadataRequestToJSON=gc.RosettaConstructionMetadataRequestFromJSONTyped=gc.RosettaConstructionMetadataRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}gc.RosettaConstructionMetadataRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),options:(0,t.RosettaOptionsFromJSON)(o.options),public_keys:(0,e.exists)(o,"public_keys")?o.public_keys.map(t.RosettaPublicKeyFromJSON):void 0}}gc.RosettaConstructionMetadataRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),options:(0,t.RosettaOptionsToJSON)(o.options),public_keys:o.public_keys===void 0?void 0:o.public_keys.map(t.RosettaPublicKeyToJSON)}}return gc.RosettaConstructionMetadataRequestToJSON=i,gc}var yc={},PC;function IU(){if(PC)return yc;PC=1,Object.defineProperty(yc,"__esModule",{value:!0}),yc.RosettaConstructionMetadataResponseToJSON=yc.RosettaConstructionMetadataResponseFromJSONTyped=yc.RosettaConstructionMetadataResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}yc.RosettaConstructionMetadataResponseFromJSON=n;function r(o,a){return o==null?o:{metadata:(0,t.RosettaConstructionMetadataResponseMetadataFromJSON)(o.metadata),suggested_fee:(0,e.exists)(o,"suggested_fee")?o.suggested_fee.map(t.RosettaAmountFromJSON):void 0}}yc.RosettaConstructionMetadataResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{metadata:(0,t.RosettaConstructionMetadataResponseMetadataToJSON)(o.metadata),suggested_fee:o.suggested_fee===void 0?void 0:o.suggested_fee.map(t.RosettaAmountToJSON)}}return yc.RosettaConstructionMetadataResponseToJSON=i,yc}var wc={},MC;function PU(){if(MC)return wc;MC=1,Object.defineProperty(wc,"__esModule",{value:!0}),wc.RosettaConstructionMetadataResponseMetadataToJSON=wc.RosettaConstructionMetadataResponseMetadataFromJSONTyped=wc.RosettaConstructionMetadataResponseMetadataFromJSON=void 0;const e=Ie();function t(i){return n(i)}wc.RosettaConstructionMetadataResponseMetadataFromJSON=t;function n(i,o){return i==null?i:{account_sequence:(0,e.exists)(i,"account_sequence")?i.account_sequence:void 0,recent_block_hash:(0,e.exists)(i,"recent_block_hash")?i.recent_block_hash:void 0}}wc.RosettaConstructionMetadataResponseMetadataFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{account_sequence:i.account_sequence,recent_block_hash:i.recent_block_hash}}return wc.RosettaConstructionMetadataResponseMetadataToJSON=r,wc}var bc={},LC;function MU(){if(LC)return bc;LC=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.RosettaConstructionParseRequestToJSON=bc.RosettaConstructionParseRequestFromJSONTyped=bc.RosettaConstructionParseRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}bc.RosettaConstructionParseRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),signed:i.signed,transaction:i.transaction}}bc.RosettaConstructionParseRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),signed:i.signed,transaction:i.transaction}}return bc.RosettaConstructionParseRequestToJSON=r,bc}var Sc={},BC;function LU(){if(BC)return Sc;BC=1,Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.RosettaConstructionParseResponseToJSON=Sc.RosettaConstructionParseResponseFromJSONTyped=Sc.RosettaConstructionParseResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Sc.RosettaConstructionParseResponseFromJSON=n;function r(o,a){return o==null?o:{operations:o.operations.map(t.RosettaOperationFromJSON),signers:(0,e.exists)(o,"signers")?o.signers:void 0,account_identifier_signers:(0,e.exists)(o,"account_identifier_signers")?o.account_identifier_signers.map(t.RosettaAccountIdentifierFromJSON):void 0,metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Sc.RosettaConstructionParseResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{operations:o.operations.map(t.RosettaOperationToJSON),signers:o.signers,account_identifier_signers:o.account_identifier_signers===void 0?void 0:o.account_identifier_signers.map(t.RosettaAccountIdentifierToJSON),metadata:o.metadata}}return Sc.RosettaConstructionParseResponseToJSON=i,Sc}var vc={},jC;function BU(){if(jC)return vc;jC=1,Object.defineProperty(vc,"__esModule",{value:!0}),vc.RosettaConstructionPayloadResponseToJSON=vc.RosettaConstructionPayloadResponseFromJSONTyped=vc.RosettaConstructionPayloadResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}vc.RosettaConstructionPayloadResponseFromJSON=t;function n(i,o){return i==null?i:{unsigned_transaction:i.unsigned_transaction,payloads:i.payloads.map(e.SigningPayloadFromJSON)}}vc.RosettaConstructionPayloadResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{unsigned_transaction:i.unsigned_transaction,payloads:i.payloads.map(e.SigningPayloadToJSON)}}return vc.RosettaConstructionPayloadResponseToJSON=r,vc}var xc={},DC;function jU(){if(DC)return xc;DC=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.RosettaConstructionPayloadsRequestToJSON=xc.RosettaConstructionPayloadsRequestFromJSONTyped=xc.RosettaConstructionPayloadsRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}xc.RosettaConstructionPayloadsRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),operations:o.operations.map(t.RosettaOperationFromJSON),public_keys:(0,e.exists)(o,"public_keys")?o.public_keys.map(t.RosettaPublicKeyFromJSON):void 0,metadata:(0,e.exists)(o,"metadata")?(0,t.RosettaConstructionMetadataResponseMetadataFromJSON)(o.metadata):void 0}}xc.RosettaConstructionPayloadsRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),operations:o.operations.map(t.RosettaOperationToJSON),public_keys:o.public_keys===void 0?void 0:o.public_keys.map(t.RosettaPublicKeyToJSON),metadata:(0,t.RosettaConstructionMetadataResponseMetadataToJSON)(o.metadata)}}return xc.RosettaConstructionPayloadsRequestToJSON=i,xc}var _c={},JC;function DU(){if(JC)return _c;JC=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.RosettaConstructionPreprocessRequestToJSON=_c.RosettaConstructionPreprocessRequestFromJSONTyped=_c.RosettaConstructionPreprocessRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}_c.RosettaConstructionPreprocessRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),operations:o.operations.map(t.RosettaOperationFromJSON),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0,max_fee:(0,e.exists)(o,"max_fee")?o.max_fee.map(t.RosettaMaxFeeAmountFromJSON):void 0,suggested_fee_multiplier:(0,e.exists)(o,"suggested_fee_multiplier")?o.suggested_fee_multiplier:void 0}}_c.RosettaConstructionPreprocessRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),operations:o.operations.map(t.RosettaOperationToJSON),metadata:o.metadata,max_fee:o.max_fee===void 0?void 0:o.max_fee.map(t.RosettaMaxFeeAmountToJSON),suggested_fee_multiplier:o.suggested_fee_multiplier}}return _c.RosettaConstructionPreprocessRequestToJSON=i,_c}var kc={},$C;function JU(){if($C)return kc;$C=1,Object.defineProperty(kc,"__esModule",{value:!0}),kc.RosettaConstructionPreprocessResponseToJSON=kc.RosettaConstructionPreprocessResponseFromJSONTyped=kc.RosettaConstructionPreprocessResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}kc.RosettaConstructionPreprocessResponseFromJSON=n;function r(o,a){return o==null?o:{options:(0,e.exists)(o,"options")?(0,t.RosettaOptionsFromJSON)(o.options):void 0,required_public_keys:(0,e.exists)(o,"required_public_keys")?o.required_public_keys.map(t.RosettaAccountFromJSON):void 0}}kc.RosettaConstructionPreprocessResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{options:(0,t.RosettaOptionsToJSON)(o.options),required_public_keys:o.required_public_keys===void 0?void 0:o.required_public_keys.map(t.RosettaAccountToJSON)}}return kc.RosettaConstructionPreprocessResponseToJSON=i,kc}var Rc={},qC;function $U(){if(qC)return Rc;qC=1,Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.RosettaConstructionSubmitRequestToJSON=Rc.RosettaConstructionSubmitRequestFromJSONTyped=Rc.RosettaConstructionSubmitRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}Rc.RosettaConstructionSubmitRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),signed_transaction:i.signed_transaction}}Rc.RosettaConstructionSubmitRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),signed_transaction:i.signed_transaction}}return Rc.RosettaConstructionSubmitRequestToJSON=r,Rc}var Tc={},UC;function qU(){if(UC)return Tc;UC=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.RosettaConstructionSubmitResponseToJSON=Tc.RosettaConstructionSubmitResponseFromJSONTyped=Tc.RosettaConstructionSubmitResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Tc.RosettaConstructionSubmitResponseFromJSON=n;function r(o,a){return o==null?o:{transaction_identifier:(0,t.TransactionIdentifierFromJSON)(o.transaction_identifier),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Tc.RosettaConstructionSubmitResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{transaction_identifier:(0,t.TransactionIdentifierToJSON)(o.transaction_identifier),metadata:o.metadata}}return Tc.RosettaConstructionSubmitResponseToJSON=i,Tc}var Oc={},HC;function UU(){if(HC)return Oc;HC=1,Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.RosettaCurrencyToJSON=Oc.RosettaCurrencyFromJSONTyped=Oc.RosettaCurrencyFromJSON=void 0;const e=Ie();function t(i){return n(i)}Oc.RosettaCurrencyFromJSON=t;function n(i,o){return i==null?i:{symbol:i.symbol,decimals:i.decimals,metadata:(0,e.exists)(i,"metadata")?i.metadata:void 0}}Oc.RosettaCurrencyFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{symbol:i.symbol,decimals:i.decimals,metadata:i.metadata}}return Oc.RosettaCurrencyToJSON=r,Oc}var Nc={},zC;function HU(){if(zC)return Nc;zC=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.RosettaErrorToJSON=Nc.RosettaErrorFromJSONTyped=Nc.RosettaErrorFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Nc.RosettaErrorFromJSON=n;function r(o,a){return o==null?o:{code:o.code,message:o.message,retriable:o.retriable,details:(0,e.exists)(o,"details")?(0,t.RosettaErrorDetailsFromJSON)(o.details):void 0}}Nc.RosettaErrorFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{code:o.code,message:o.message,retriable:o.retriable,details:(0,t.RosettaErrorDetailsToJSON)(o.details)}}return Nc.RosettaErrorToJSON=i,Nc}var Cc={},WC;function zU(){if(WC)return Cc;WC=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.RosettaErrorDetailsToJSON=Cc.RosettaErrorDetailsFromJSONTyped=Cc.RosettaErrorDetailsFromJSON=void 0;const e=Ie();function t(i){return n(i)}Cc.RosettaErrorDetailsFromJSON=t;function n(i,o){return i==null?i:{address:(0,e.exists)(i,"address")?i.address:void 0,error:(0,e.exists)(i,"error")?i.error:void 0}}Cc.RosettaErrorDetailsFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{address:i.address,error:i.error}}return Cc.RosettaErrorDetailsToJSON=r,Cc}var Ec={},VC;function WU(){if(VC)return Ec;VC=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.RosettaErrorNoDetailsToJSON=Ec.RosettaErrorNoDetailsFromJSONTyped=Ec.RosettaErrorNoDetailsFromJSON=void 0;function e(r){return t(r)}Ec.RosettaErrorNoDetailsFromJSON=e;function t(r,i){return r==null?r:{code:r.code,message:r.message,retriable:r.retriable}}Ec.RosettaErrorNoDetailsFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{code:r.code,message:r.message,retriable:r.retriable}}return Ec.RosettaErrorNoDetailsToJSON=n,Ec}var Ac={},GC;function VU(){if(GC)return Ac;GC=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.RosettaGenesisBlockIdentifierToJSON=Ac.RosettaGenesisBlockIdentifierFromJSONTyped=Ac.RosettaGenesisBlockIdentifierFromJSON=void 0;function e(r){return t(r)}Ac.RosettaGenesisBlockIdentifierFromJSON=e;function t(r,i){return r==null?r:{index:r.index,hash:r.hash}}Ac.RosettaGenesisBlockIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{index:r.index,hash:r.hash}}return Ac.RosettaGenesisBlockIdentifierToJSON=n,Ac}var Fc={},KC;function GU(){if(KC)return Fc;KC=1,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.RosettaMaxFeeAmountToJSON=Fc.RosettaMaxFeeAmountFromJSONTyped=Fc.RosettaMaxFeeAmountFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Fc.RosettaMaxFeeAmountFromJSON=n;function r(o,a){return o==null?o:{value:o.value,currency:(0,t.RosettaCurrencyFromJSON)(o.currency),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Fc.RosettaMaxFeeAmountFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{value:o.value,currency:(0,t.RosettaCurrencyToJSON)(o.currency),metadata:o.metadata}}return Fc.RosettaMaxFeeAmountToJSON=i,Fc}var Ic={},QC;function KU(){if(QC)return Ic;QC=1,Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.RosettaMempoolRequestToJSON=Ic.RosettaMempoolRequestFromJSONTyped=Ic.RosettaMempoolRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Ic.RosettaMempoolRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Ic.RosettaMempoolRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),metadata:o.metadata}}return Ic.RosettaMempoolRequestToJSON=i,Ic}var Pc={},YC;function QU(){if(YC)return Pc;YC=1,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.RosettaMempoolResponseToJSON=Pc.RosettaMempoolResponseFromJSONTyped=Pc.RosettaMempoolResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Pc.RosettaMempoolResponseFromJSON=n;function r(o,a){return o==null?o:{transaction_identifiers:o.transaction_identifiers.map(t.TransactionIdentifierFromJSON),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Pc.RosettaMempoolResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{transaction_identifiers:o.transaction_identifiers.map(t.TransactionIdentifierToJSON),metadata:o.metadata}}return Pc.RosettaMempoolResponseToJSON=i,Pc}var Mc={},XC;function YU(){if(XC)return Mc;XC=1,Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.RosettaMempoolTransactionRequestToJSON=Mc.RosettaMempoolTransactionRequestFromJSONTyped=Mc.RosettaMempoolTransactionRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}Mc.RosettaMempoolTransactionRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),transaction_identifier:(0,e.TransactionIdentifierFromJSON)(i.transaction_identifier)}}Mc.RosettaMempoolTransactionRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),transaction_identifier:(0,e.TransactionIdentifierToJSON)(i.transaction_identifier)}}return Mc.RosettaMempoolTransactionRequestToJSON=r,Mc}var Lc={},ZC;function XU(){if(ZC)return Lc;ZC=1,Object.defineProperty(Lc,"__esModule",{value:!0}),Lc.RosettaMempoolTransactionResponseToJSON=Lc.RosettaMempoolTransactionResponseFromJSONTyped=Lc.RosettaMempoolTransactionResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Lc.RosettaMempoolTransactionResponseFromJSON=n;function r(o,a){return o==null?o:{transaction:(0,t.RosettaTransactionFromJSON)(o.transaction),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Lc.RosettaMempoolTransactionResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{transaction:(0,t.RosettaTransactionToJSON)(o.transaction),metadata:o.metadata}}return Lc.RosettaMempoolTransactionResponseToJSON=i,Lc}var Bc={},eE;function ZU(){if(eE)return Bc;eE=1,Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.RosettaNetworkListResponseToJSON=Bc.RosettaNetworkListResponseFromJSONTyped=Bc.RosettaNetworkListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Bc.RosettaNetworkListResponseFromJSON=t;function n(i,o){return i==null?i:{network_identifiers:i.network_identifiers.map(e.NetworkIdentifierFromJSON)}}Bc.RosettaNetworkListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifiers:i.network_identifiers.map(e.NetworkIdentifierToJSON)}}return Bc.RosettaNetworkListResponseToJSON=r,Bc}var jc={},tE;function eH(){if(tE)return jc;tE=1,Object.defineProperty(jc,"__esModule",{value:!0}),jc.RosettaNetworkListResponseSubNetworkIdentifierToJSON=jc.RosettaNetworkListResponseSubNetworkIdentifierFromJSONTyped=jc.RosettaNetworkListResponseSubNetworkIdentifierFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}jc.RosettaNetworkListResponseSubNetworkIdentifierFromJSON=n;function r(o,a){return o==null?o:{network:o.network,metadata:(0,e.exists)(o,"metadata")?(0,t.RosettaNetworkListResponseSubNetworkIdentifierMetadataFromJSON)(o.metadata):void 0}}jc.RosettaNetworkListResponseSubNetworkIdentifierFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network:o.network,metadata:(0,t.RosettaNetworkListResponseSubNetworkIdentifierMetadataToJSON)(o.metadata)}}return jc.RosettaNetworkListResponseSubNetworkIdentifierToJSON=i,jc}var Dc={},nE;function tH(){if(nE)return Dc;nE=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataToJSON=Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataFromJSONTyped=Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataFromJSON=void 0;function e(r){return t(r)}Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataFromJSON=e;function t(r,i){return r==null?r:{producer:r.producer}}Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{producer:r.producer}}return Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataToJSON=n,Dc}var Jc={},rE;function nH(){if(rE)return Jc;rE=1,Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.RosettaNetworkOptionsResponseToJSON=Jc.RosettaNetworkOptionsResponseFromJSONTyped=Jc.RosettaNetworkOptionsResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Jc.RosettaNetworkOptionsResponseFromJSON=t;function n(i,o){return i==null?i:{version:(0,e.RosettaNetworkOptionsResponseVersionFromJSON)(i.version),allow:(0,e.RosettaNetworkOptionsResponseAllowFromJSON)(i.allow)}}Jc.RosettaNetworkOptionsResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{version:(0,e.RosettaNetworkOptionsResponseVersionToJSON)(i.version),allow:(0,e.RosettaNetworkOptionsResponseAllowToJSON)(i.allow)}}return Jc.RosettaNetworkOptionsResponseToJSON=r,Jc}var $c={},iE;function rH(){if(iE)return $c;iE=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.RosettaNetworkOptionsResponseAllowToJSON=$c.RosettaNetworkOptionsResponseAllowFromJSONTyped=$c.RosettaNetworkOptionsResponseAllowFromJSON=void 0;const e=Fe();function t(i){return n(i)}$c.RosettaNetworkOptionsResponseAllowFromJSON=t;function n(i,o){return i==null?i:{operation_statuses:i.operation_statuses.map(e.RosettaOperationStatusFromJSON),operation_types:i.operation_types,errors:i.errors.map(e.RosettaErrorNoDetailsFromJSON),historical_balance_lookup:i.historical_balance_lookup}}$c.RosettaNetworkOptionsResponseAllowFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{operation_statuses:i.operation_statuses.map(e.RosettaOperationStatusToJSON),operation_types:i.operation_types,errors:i.errors.map(e.RosettaErrorNoDetailsToJSON),historical_balance_lookup:i.historical_balance_lookup}}return $c.RosettaNetworkOptionsResponseAllowToJSON=r,$c}var qc={},oE;function iH(){if(oE)return qc;oE=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.RosettaNetworkOptionsResponseVersionToJSON=qc.RosettaNetworkOptionsResponseVersionFromJSONTyped=qc.RosettaNetworkOptionsResponseVersionFromJSON=void 0;const e=Ie();function t(i){return n(i)}qc.RosettaNetworkOptionsResponseVersionFromJSON=t;function n(i,o){return i==null?i:{rosetta_version:i.rosetta_version,node_version:i.node_version,middleware_version:(0,e.exists)(i,"middleware_version")?i.middleware_version:void 0,metadata:(0,e.exists)(i,"metadata")?i.metadata:void 0}}qc.RosettaNetworkOptionsResponseVersionFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{rosetta_version:i.rosetta_version,node_version:i.node_version,middleware_version:i.middleware_version,metadata:i.metadata}}return qc.RosettaNetworkOptionsResponseVersionToJSON=r,qc}var Uc={},sE;function oH(){if(sE)return Uc;sE=1,Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.RosettaNetworkStatusResponseToJSON=Uc.RosettaNetworkStatusResponseFromJSONTyped=Uc.RosettaNetworkStatusResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Uc.RosettaNetworkStatusResponseFromJSON=n;function r(o,a){return o==null?o:{current_block_identifier:o.current_block_identifier,current_block_timestamp:o.current_block_timestamp,genesis_block_identifier:(0,t.RosettaGenesisBlockIdentifierFromJSON)(o.genesis_block_identifier),oldest_block_identifier:(0,e.exists)(o,"oldest_block_identifier")?(0,t.RosettaOldestBlockIdentifierFromJSON)(o.oldest_block_identifier):void 0,sync_status:(0,e.exists)(o,"sync_status")?(0,t.RosettaSyncStatusFromJSON)(o.sync_status):void 0,peers:o.peers.map(t.RosettaPeersFromJSON)}}Uc.RosettaNetworkStatusResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{current_block_identifier:o.current_block_identifier,current_block_timestamp:o.current_block_timestamp,genesis_block_identifier:(0,t.RosettaGenesisBlockIdentifierToJSON)(o.genesis_block_identifier),oldest_block_identifier:(0,t.RosettaOldestBlockIdentifierToJSON)(o.oldest_block_identifier),sync_status:(0,t.RosettaSyncStatusToJSON)(o.sync_status),peers:o.peers.map(t.RosettaPeersToJSON)}}return Uc.RosettaNetworkStatusResponseToJSON=i,Uc}var Hc={},aE;function sH(){if(aE)return Hc;aE=1,Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.RosettaOldestBlockIdentifierToJSON=Hc.RosettaOldestBlockIdentifierFromJSONTyped=Hc.RosettaOldestBlockIdentifierFromJSON=void 0;function e(r){return t(r)}Hc.RosettaOldestBlockIdentifierFromJSON=e;function t(r,i){return r==null?r:{index:r.index,hash:r.hash}}Hc.RosettaOldestBlockIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{index:r.index,hash:r.hash}}return Hc.RosettaOldestBlockIdentifierToJSON=n,Hc}var zc={},cE;function aH(){if(cE)return zc;cE=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.RosettaOperationToJSON=zc.RosettaOperationFromJSONTyped=zc.RosettaOperationFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}zc.RosettaOperationFromJSON=n;function r(o,a){return o==null?o:{operation_identifier:(0,t.RosettaOperationIdentifierFromJSON)(o.operation_identifier),related_operations:(0,e.exists)(o,"related_operations")?o.related_operations.map(t.RosettaRelatedOperationFromJSON):void 0,type:o.type,status:(0,e.exists)(o,"status")?o.status:void 0,account:(0,e.exists)(o,"account")?(0,t.RosettaAccountFromJSON)(o.account):void 0,amount:(0,e.exists)(o,"amount")?(0,t.RosettaAmountFromJSON)(o.amount):void 0,coin_change:(0,e.exists)(o,"coin_change")?(0,t.RosettaCoinChangeFromJSON)(o.coin_change):void 0,metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}zc.RosettaOperationFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{operation_identifier:(0,t.RosettaOperationIdentifierToJSON)(o.operation_identifier),related_operations:o.related_operations===void 0?void 0:o.related_operations.map(t.RosettaRelatedOperationToJSON),type:o.type,status:o.status,account:(0,t.RosettaAccountToJSON)(o.account),amount:(0,t.RosettaAmountToJSON)(o.amount),coin_change:(0,t.RosettaCoinChangeToJSON)(o.coin_change),metadata:o.metadata}}return zc.RosettaOperationToJSON=i,zc}var Wc={},uE;function cH(){if(uE)return Wc;uE=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.RosettaOperationIdentifierToJSON=Wc.RosettaOperationIdentifierFromJSONTyped=Wc.RosettaOperationIdentifierFromJSON=void 0;const e=Ie();function t(i){return n(i)}Wc.RosettaOperationIdentifierFromJSON=t;function n(i,o){return i==null?i:{index:i.index,network_index:(0,e.exists)(i,"network_index")?i.network_index:void 0}}Wc.RosettaOperationIdentifierFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{index:i.index,network_index:i.network_index}}return Wc.RosettaOperationIdentifierToJSON=r,Wc}var Vc={},lE;function uH(){if(lE)return Vc;lE=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.RosettaOperationStatusToJSON=Vc.RosettaOperationStatusFromJSONTyped=Vc.RosettaOperationStatusFromJSON=void 0;function e(r){return t(r)}Vc.RosettaOperationStatusFromJSON=e;function t(r,i){return r==null?r:{status:r.status,successful:r.successful}}Vc.RosettaOperationStatusFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{status:r.status,successful:r.successful}}return Vc.RosettaOperationStatusToJSON=n,Vc}var Gc={},dE;function lH(){if(dE)return Gc;dE=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.RosettaOptionsToJSON=Gc.RosettaOptionsFromJSONTyped=Gc.RosettaOptionsFromJSON=void 0;const e=Ie();function t(i){return n(i)}Gc.RosettaOptionsFromJSON=t;function n(i,o){return i==null?i:{sender_address:(0,e.exists)(i,"sender_address")?i.sender_address:void 0,type:(0,e.exists)(i,"type")?i.type:void 0,status:(0,e.exists)(i,"status")?i.status:void 0,token_transfer_recipient_address:(0,e.exists)(i,"token_transfer_recipient_address")?i.token_transfer_recipient_address:void 0,amount:(0,e.exists)(i,"amount")?i.amount:void 0,symbol:(0,e.exists)(i,"symbol")?i.symbol:void 0,decimals:(0,e.exists)(i,"decimals")?i.decimals:void 0,gas_limit:(0,e.exists)(i,"gas_limit")?i.gas_limit:void 0,gas_price:(0,e.exists)(i,"gas_price")?i.gas_price:void 0,suggested_fee_multiplier:(0,e.exists)(i,"suggested_fee_multiplier")?i.suggested_fee_multiplier:void 0,max_fee:(0,e.exists)(i,"max_fee")?i.max_fee:void 0,fee:(0,e.exists)(i,"fee")?i.fee:void 0,size:(0,e.exists)(i,"size")?i.size:void 0,memo:(0,e.exists)(i,"memo")?i.memo:void 0,number_of_cycles:(0,e.exists)(i,"number_of_cycles")?i.number_of_cycles:void 0,contract_address:(0,e.exists)(i,"contract_address")?i.contract_address:void 0,contract_name:(0,e.exists)(i,"contract_name")?i.contract_name:void 0,burn_block_height:(0,e.exists)(i,"burn_block_height")?i.burn_block_height:void 0,delegate_to:(0,e.exists)(i,"delegate_to")?i.delegate_to:void 0,pox_addr:(0,e.exists)(i,"pox_addr")?i.pox_addr:void 0}}Gc.RosettaOptionsFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{sender_address:i.sender_address,type:i.type,status:i.status,token_transfer_recipient_address:i.token_transfer_recipient_address,amount:i.amount,symbol:i.symbol,decimals:i.decimals,gas_limit:i.gas_limit,gas_price:i.gas_price,suggested_fee_multiplier:i.suggested_fee_multiplier,max_fee:i.max_fee,fee:i.fee,size:i.size,memo:i.memo,number_of_cycles:i.number_of_cycles,contract_address:i.contract_address,contract_name:i.contract_name,burn_block_height:i.burn_block_height,delegate_to:i.delegate_to,pox_addr:i.pox_addr}}return Gc.RosettaOptionsToJSON=r,Gc}var Kc={},fE;function dH(){if(fE)return Kc;fE=1,Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.RosettaOptionsRequestToJSON=Kc.RosettaOptionsRequestFromJSONTyped=Kc.RosettaOptionsRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Kc.RosettaOptionsRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Kc.RosettaOptionsRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),metadata:o.metadata}}return Kc.RosettaOptionsRequestToJSON=i,Kc}var Qc={},hE;function fH(){if(hE)return Qc;hE=1,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.RosettaParentBlockIdentifierToJSON=Qc.RosettaParentBlockIdentifierFromJSONTyped=Qc.RosettaParentBlockIdentifierFromJSON=void 0;function e(r){return t(r)}Qc.RosettaParentBlockIdentifierFromJSON=e;function t(r,i){return r==null?r:{index:r.index,hash:r.hash}}Qc.RosettaParentBlockIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{index:r.index,hash:r.hash}}return Qc.RosettaParentBlockIdentifierToJSON=n,Qc}var Yc={},pE;function hH(){if(pE)return Yc;pE=1,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.RosettaPeersToJSON=Yc.RosettaPeersFromJSONTyped=Yc.RosettaPeersFromJSON=void 0;const e=Ie();function t(i){return n(i)}Yc.RosettaPeersFromJSON=t;function n(i,o){return i==null?i:{peer_id:i.peer_id,metadata:(0,e.exists)(i,"metadata")?i.metadata:void 0}}Yc.RosettaPeersFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{peer_id:i.peer_id,metadata:i.metadata}}return Yc.RosettaPeersToJSON=r,Yc}var Dv={},mE;function pH(){return mE||(mE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RosettaPublicKeyToJSON=e.RosettaPublicKeyFromJSONTyped=e.RosettaPublicKeyFromJSON=e.RosettaPublicKeyCurveTypeEnum=void 0,function(i){i.secp256k1="secp256k1",i.edwards25519="edwards25519"}(e.RosettaPublicKeyCurveTypeEnum||(e.RosettaPublicKeyCurveTypeEnum={}));function t(i){return n(i)}e.RosettaPublicKeyFromJSON=t;function n(i,o){return i==null?i:{hex_bytes:i.hex_bytes,curve_type:i.curve_type}}e.RosettaPublicKeyFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{hex_bytes:i.hex_bytes,curve_type:i.curve_type}}e.RosettaPublicKeyToJSON=r}(Dv)),Dv}var Xc={},gE;function mH(){if(gE)return Xc;gE=1,Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.RosettaRelatedOperationToJSON=Xc.RosettaRelatedOperationFromJSONTyped=Xc.RosettaRelatedOperationFromJSON=void 0;const e=Ie();function t(i){return n(i)}Xc.RosettaRelatedOperationFromJSON=t;function n(i,o){return i==null?i:{index:i.index,network_index:(0,e.exists)(i,"network_index")?i.network_index:void 0}}Xc.RosettaRelatedOperationFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{index:i.index,network_index:i.network_index}}return Xc.RosettaRelatedOperationToJSON=r,Xc}var Jv={},yE;function gH(){return yE||(yE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RosettaSignatureToJSON=e.RosettaSignatureFromJSONTyped=e.RosettaSignatureFromJSON=e.RosettaSignatureSignatureTypeEnum=void 0;const t=Fe();(function(o){o.ecdsa="ecdsa",o.ecdsa_recovery="ecdsa_recovery",o.ed25519="ed25519",o.schnorr_1="schnorr_1",o.schnorr_poseidon="schnorr_poseidon"})(e.RosettaSignatureSignatureTypeEnum||(e.RosettaSignatureSignatureTypeEnum={}));function n(o){return r(o)}e.RosettaSignatureFromJSON=n;function r(o,a){return o==null?o:{signing_payload:(0,t.SigningPayloadFromJSON)(o.signing_payload),public_key:(0,t.RosettaPublicKeyFromJSON)(o.public_key),signature_type:o.signature_type,hex_bytes:o.hex_bytes}}e.RosettaSignatureFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{signing_payload:(0,t.SigningPayloadToJSON)(o.signing_payload),public_key:(0,t.RosettaPublicKeyToJSON)(o.public_key),signature_type:o.signature_type,hex_bytes:o.hex_bytes}}e.RosettaSignatureToJSON=i}(Jv)),Jv}var Zc={},wE;function yH(){if(wE)return Zc;wE=1,Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.RosettaStatusRequestToJSON=Zc.RosettaStatusRequestFromJSONTyped=Zc.RosettaStatusRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Zc.RosettaStatusRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Zc.RosettaStatusRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),metadata:o.metadata}}return Zc.RosettaStatusRequestToJSON=i,Zc}var eu={},bE;function wH(){if(bE)return eu;bE=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.RosettaSubAccountToJSON=eu.RosettaSubAccountFromJSONTyped=eu.RosettaSubAccountFromJSON=void 0;const e=Ie();function t(i){return n(i)}eu.RosettaSubAccountFromJSON=t;function n(i,o){return i==null?i:{address:i.address,metadata:(0,e.exists)(i,"metadata")?i.metadata:void 0}}eu.RosettaSubAccountFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{address:i.address,metadata:i.metadata}}return eu.RosettaSubAccountToJSON=r,eu}var tu={},SE;function bH(){if(SE)return tu;SE=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.RosettaSyncStatusToJSON=tu.RosettaSyncStatusFromJSONTyped=tu.RosettaSyncStatusFromJSON=void 0;const e=Ie();function t(i){return n(i)}tu.RosettaSyncStatusFromJSON=t;function n(i,o){return i==null?i:{current_index:i.current_index,target_index:(0,e.exists)(i,"target_index")?i.target_index:void 0,stage:(0,e.exists)(i,"stage")?i.stage:void 0,synced:(0,e.exists)(i,"synced")?i.synced:void 0}}tu.RosettaSyncStatusFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{current_index:i.current_index,target_index:i.target_index,stage:i.stage,synced:i.synced}}return tu.RosettaSyncStatusToJSON=r,tu}var nu={},vE;function SH(){if(vE)return nu;vE=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.RosettaTransactionToJSON=nu.RosettaTransactionFromJSONTyped=nu.RosettaTransactionFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}nu.RosettaTransactionFromJSON=n;function r(o,a){return o==null?o:{transaction_identifier:(0,t.TransactionIdentifierFromJSON)(o.transaction_identifier),operations:o.operations.map(t.RosettaOperationFromJSON),metadata:(0,e.exists)(o,"metadata")?(0,t.RosettaBlockMetadataFromJSON)(o.metadata):void 0}}nu.RosettaTransactionFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{transaction_identifier:(0,t.TransactionIdentifierToJSON)(o.transaction_identifier),operations:o.operations.map(t.RosettaOperationToJSON),metadata:(0,t.RosettaBlockMetadataToJSON)(o.metadata)}}return nu.RosettaTransactionToJSON=i,nu}var ru={},xE;function vH(){if(xE)return ru;xE=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.RunFaucetResponseToJSON=ru.RunFaucetResponseFromJSONTyped=ru.RunFaucetResponseFromJSON=void 0;const e=Ie();function t(i){return n(i)}ru.RunFaucetResponseFromJSON=t;function n(i,o){return i==null?i:{success:i.success,txId:(0,e.exists)(i,"txId")?i.txId:void 0,txRaw:(0,e.exists)(i,"txRaw")?i.txRaw:void 0}}ru.RunFaucetResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{success:i.success,txId:i.txId,txRaw:i.txRaw}}return ru.RunFaucetResponseToJSON=r,ru}var iu={},_E;function xH(){if(_E)return iu;_E=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.ServerStatusResponseToJSON=iu.ServerStatusResponseFromJSONTyped=iu.ServerStatusResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}iu.ServerStatusResponseFromJSON=n;function r(o,a){return o==null?o:{server_version:(0,e.exists)(o,"server_version")?o.server_version:void 0,status:o.status,pox_v1_unlock_height:(0,e.exists)(o,"pox_v1_unlock_height")?o.pox_v1_unlock_height:void 0,pox_v2_unlock_height:(0,e.exists)(o,"pox_v2_unlock_height")?o.pox_v2_unlock_height:void 0,chain_tip:(0,e.exists)(o,"chain_tip")?(0,t.ChainTipFromJSON)(o.chain_tip):void 0}}iu.ServerStatusResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{server_version:o.server_version,status:o.status,pox_v1_unlock_height:o.pox_v1_unlock_height,pox_v2_unlock_height:o.pox_v2_unlock_height,chain_tip:(0,t.ChainTipToJSON)(o.chain_tip)}}return iu.ServerStatusResponseToJSON=i,iu}var $v={},kE;function _H(){return kE||(kE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SigningPayloadToJSON=e.SigningPayloadFromJSONTyped=e.SigningPayloadFromJSON=e.SigningPayloadSignatureTypeEnum=void 0;const t=Ie(),n=Fe();(function(a){a.ecdsa="ecdsa",a.ecdsa_recovery="ecdsa_recovery",a.ed25519="ed25519",a.schnorr_1="schnorr_1",a.schnorr_poseidon="schnorr_poseidon"})(e.SigningPayloadSignatureTypeEnum||(e.SigningPayloadSignatureTypeEnum={}));function r(a){return i(a)}e.SigningPayloadFromJSON=r;function i(a,u){return a==null?a:{address:(0,t.exists)(a,"address")?a.address:void 0,account_identifier:(0,t.exists)(a,"account_identifier")?(0,n.RosettaAccountFromJSON)(a.account_identifier):void 0,hex_bytes:a.hex_bytes,signature_type:(0,t.exists)(a,"signature_type")?a.signature_type:void 0}}e.SigningPayloadFromJSONTyped=i;function o(a){if(a!==void 0)return a===null?null:{address:a.address,account_identifier:(0,n.RosettaAccountToJSON)(a.account_identifier),hex_bytes:a.hex_bytes,signature_type:a.signature_type}}e.SigningPayloadToJSON=o}($v)),$v}var ou={},RE;function kH(){if(RE)return ou;RE=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.SmartContractToJSON=ou.SmartContractFromJSONTyped=ou.SmartContractFromJSON=void 0;function e(r){return t(r)}ou.SmartContractFromJSON=e;function t(r,i){return r==null?r:{tx_id:r.tx_id,canonical:r.canonical,contract_id:r.contract_id,block_height:r.block_height,source_code:r.source_code,abi:r.abi}}ou.SmartContractFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{tx_id:r.tx_id,canonical:r.canonical,contract_id:r.contract_id,block_height:r.block_height,source_code:r.source_code,abi:r.abi}}return ou.SmartContractToJSON=n,ou}var su={},TE;function RH(){if(TE)return su;TE=1,Object.defineProperty(su,"__esModule",{value:!0}),su.StxBalanceToJSON=su.StxBalanceFromJSONTyped=su.StxBalanceFromJSON=void 0;function e(r){return t(r)}su.StxBalanceFromJSON=e;function t(r,i){return r==null?r:{balance:r.balance,total_sent:r.total_sent,total_received:r.total_received,total_fees_sent:r.total_fees_sent,total_miner_rewards_received:r.total_miner_rewards_received,lock_tx_id:r.lock_tx_id,locked:r.locked,lock_height:r.lock_height,burnchain_lock_height:r.burnchain_lock_height,burnchain_unlock_height:r.burnchain_unlock_height}}su.StxBalanceFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{balance:r.balance,total_sent:r.total_sent,total_received:r.total_received,total_fees_sent:r.total_fees_sent,total_miner_rewards_received:r.total_miner_rewards_received,lock_tx_id:r.lock_tx_id,locked:r.locked,lock_height:r.lock_height,burnchain_lock_height:r.burnchain_lock_height,burnchain_unlock_height:r.burnchain_unlock_height}}return su.StxBalanceToJSON=n,su}var au={},OE;function TH(){if(OE)return au;OE=1,Object.defineProperty(au,"__esModule",{value:!0}),au.TargetBlockTimeToJSON=au.TargetBlockTimeFromJSONTyped=au.TargetBlockTimeFromJSON=void 0;function e(r){return t(r)}au.TargetBlockTimeFromJSON=e;function t(r,i){return r==null?r:{target_block_time:r.target_block_time}}au.TargetBlockTimeFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{target_block_time:r.target_block_time}}return au.TargetBlockTimeToJSON=n,au}var cu={},NE;function OH(){if(NE)return cu;NE=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.TransactionEventsResponseToJSON=cu.TransactionEventsResponseFromJSONTyped=cu.TransactionEventsResponseFromJSON=void 0;function e(r){return t(r)}cu.TransactionEventsResponseFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,results:r.results}}cu.TransactionEventsResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,results:r.results}}return cu.TransactionEventsResponseToJSON=n,cu}var uu={},CE;function NH(){if(CE)return uu;CE=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.TransactionFeeEstimateRequestToJSON=uu.TransactionFeeEstimateRequestFromJSONTyped=uu.TransactionFeeEstimateRequestFromJSON=void 0;const e=Ie();function t(i){return n(i)}uu.TransactionFeeEstimateRequestFromJSON=t;function n(i,o){return i==null?i:{transaction_payload:i.transaction_payload,estimated_len:(0,e.exists)(i,"estimated_len")?i.estimated_len:void 0}}uu.TransactionFeeEstimateRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{transaction_payload:i.transaction_payload,estimated_len:i.estimated_len}}return uu.TransactionFeeEstimateRequestToJSON=r,uu}var lu={},EE;function CH(){if(EE)return lu;EE=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.TransactionFeeEstimateResponseToJSON=lu.TransactionFeeEstimateResponseFromJSONTyped=lu.TransactionFeeEstimateResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}lu.TransactionFeeEstimateResponseFromJSON=n;function r(o,a){return o==null?o:{estimated_cost_scalar:o.estimated_cost_scalar,cost_scalar_change_by_byte:(0,e.exists)(o,"cost_scalar_change_by_byte")?o.cost_scalar_change_by_byte:void 0,estimated_cost:(0,t.TransactionFeeEstimateResponseEstimatedCostFromJSON)(o.estimated_cost),estimations:(0,e.exists)(o,"estimations")?o.estimations.map(t.TransactionFeeEstimateResponseEstimationsFromJSON):void 0}}lu.TransactionFeeEstimateResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{estimated_cost_scalar:o.estimated_cost_scalar,cost_scalar_change_by_byte:o.cost_scalar_change_by_byte,estimated_cost:(0,t.TransactionFeeEstimateResponseEstimatedCostToJSON)(o.estimated_cost),estimations:o.estimations===void 0?void 0:o.estimations.map(t.TransactionFeeEstimateResponseEstimationsToJSON)}}return lu.TransactionFeeEstimateResponseToJSON=i,lu}var du={},AE;function EH(){if(AE)return du;AE=1,Object.defineProperty(du,"__esModule",{value:!0}),du.TransactionFeeEstimateResponseEstimatedCostToJSON=du.TransactionFeeEstimateResponseEstimatedCostFromJSONTyped=du.TransactionFeeEstimateResponseEstimatedCostFromJSON=void 0;function e(r){return t(r)}du.TransactionFeeEstimateResponseEstimatedCostFromJSON=e;function t(r,i){return r==null?r:{read_count:r.read_count,read_length:r.read_length,runtime:r.runtime,write_count:r.write_count,write_length:r.write_length}}du.TransactionFeeEstimateResponseEstimatedCostFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{read_count:r.read_count,read_length:r.read_length,runtime:r.runtime,write_count:r.write_count,write_length:r.write_length}}return du.TransactionFeeEstimateResponseEstimatedCostToJSON=n,du}var fu={},FE;function AH(){if(FE)return fu;FE=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.TransactionFeeEstimateResponseEstimationsToJSON=fu.TransactionFeeEstimateResponseEstimationsFromJSONTyped=fu.TransactionFeeEstimateResponseEstimationsFromJSON=void 0;const e=Ie();function t(i){return n(i)}fu.TransactionFeeEstimateResponseEstimationsFromJSON=t;function n(i,o){return i==null?i:{fee_rate:(0,e.exists)(i,"fee_rate")?i.fee_rate:void 0,fee:(0,e.exists)(i,"fee")?i.fee:void 0}}fu.TransactionFeeEstimateResponseEstimationsFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{fee_rate:i.fee_rate,fee:i.fee}}return fu.TransactionFeeEstimateResponseEstimationsToJSON=r,fu}var hu={},IE;function FH(){if(IE)return hu;IE=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.TransactionIdentifierToJSON=hu.TransactionIdentifierFromJSONTyped=hu.TransactionIdentifierFromJSON=void 0;function e(r){return t(r)}hu.TransactionIdentifierFromJSON=e;function t(r,i){return r==null?r:{hash:r.hash}}hu.TransactionIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{hash:r.hash}}return hu.TransactionIdentifierToJSON=n,hu}var pu={},PE;function IH(){if(PE)return pu;PE=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.TransactionResultsToJSON=pu.TransactionResultsFromJSONTyped=pu.TransactionResultsFromJSON=void 0;function e(r){return t(r)}pu.TransactionResultsFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}pu.TransactionResultsFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return pu.TransactionResultsToJSON=n,pu}var mu={},ME;function PH(){if(ME)return mu;ME=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.UnanchoredTransactionListResponseToJSON=mu.UnanchoredTransactionListResponseFromJSONTyped=mu.UnanchoredTransactionListResponseFromJSON=void 0;function e(r){return t(r)}mu.UnanchoredTransactionListResponseFromJSON=e;function t(r,i){return r==null?r:{total:r.total,results:r.results}}mu.UnanchoredTransactionListResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{total:r.total,results:r.results}}return mu.UnanchoredTransactionListResponseToJSON=n,mu}var LE;function Fe(){return LE||(LE=1,function(e){var t=kd&&kd.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(i,o);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,a,u)}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=kd&&kd.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(V7(),e),n(G7(),e),n(K7(),e),n(Q7(),e),n(Y7(),e),n(X7(),e),n(Z7(),e),n(eq(),e),n(tq(),e),n(nq(),e),n(rq(),e),n(iq(),e),n(oq(),e),n(sq(),e),n(aq(),e),n(cq(),e),n(uq(),e),n(lq(),e),n(dq(),e),n(fq(),e),n(hq(),e),n(pq(),e),n(mq(),e),n(gq(),e),n(yq(),e),n(wq(),e),n(bq(),e),n(Sq(),e),n(vq(),e),n(xq(),e),n(_q(),e),n(kq(),e),n(Rq(),e),n(Tq(),e),n(Oq(),e),n(Nq(),e),n(Cq(),e),n(Eq(),e),n(Aq(),e),n(Fq(),e),n(Iq(),e),n(Pq(),e),n(Mq(),e),n(Lq(),e),n(Bq(),e),n(jq(),e),n(Dq(),e),n(Jq(),e),n($q(),e),n(qq(),e),n(Uq(),e),n(Hq(),e),n(zq(),e),n(Wq(),e),n(Vq(),e),n(Gq(),e),n(Kq(),e),n(Qq(),e),n(Yq(),e),n(Xq(),e),n(Zq(),e),n(eU(),e),n(tU(),e),n(nU(),e),n(rU(),e),n(iU(),e),n(oU(),e),n(sU(),e),n(aU(),e),n(cU(),e),n(uU(),e),n(lU(),e),n(dU(),e),n(fU(),e),n(hU(),e),n(pU(),e),n(mU(),e),n(gU(),e),n(yU(),e),n(wU(),e),n(bU(),e),n(SU(),e),n(vU(),e),n(xU(),e),n(_U(),e),n(kU(),e),n(RU(),e),n(TU(),e),n(OU(),e),n(NU(),e),n(CU(),e),n(EU(),e),n(AU(),e),n(FU(),e),n(IU(),e),n(PU(),e),n(MU(),e),n(LU(),e),n(BU(),e),n(jU(),e),n(DU(),e),n(JU(),e),n($U(),e),n(qU(),e),n(UU(),e),n(HU(),e),n(zU(),e),n(WU(),e),n(VU(),e),n(GU(),e),n(KU(),e),n(QU(),e),n(YU(),e),n(XU(),e),n(ZU(),e),n(eH(),e),n(tH(),e),n(nH(),e),n(rH(),e),n(iH(),e),n(oH(),e),n(sH(),e),n(aH(),e),n(cH(),e),n(uH(),e),n(lH(),e),n(dH(),e),n(fH(),e),n(hH(),e),n(pH(),e),n(mH(),e),n(gH(),e),n(yH(),e),n(wH(),e),n(bH(),e),n(SH(),e),n(vH(),e),n(xH(),e),n(_H(),e),n(kH(),e),n(RH(),e),n(TH(),e),n(OH(),e),n(NH(),e),n(CH(),e),n(EH(),e),n(AH(),e),n(FH(),e),n(IH(),e),n(PH(),e)}(kd)),kd}var BE;function MH(){if(BE)return rm;BE=1,Object.defineProperty(rm,"__esModule",{value:!0}),rm.AccountsApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getAccountAssetsRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountAssets.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/assets".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressAssetsListResponseFromJSON)(f))}async getAccountAssets(i,o){return await(await this.getAccountAssetsRaw(i,o)).value()}async getAccountBalanceRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountBalance.");const a={};i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/balances".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressBalanceResponseFromJSON)(f))}async getAccountBalance(i,o){return await(await this.getAccountBalanceRaw(i,o)).value()}async getAccountInboundRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountInbound.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.height!==void 0&&(a.height=i.height),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/stx_inbound".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressStxInboundListResponseFromJSON)(f))}async getAccountInbound(i,o){return await(await this.getAccountInboundRaw(i,o)).value()}async getAccountInfoRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountInfo.");const a={};i.proof!==void 0&&(a.proof=i.proof),i.tip!==void 0&&(a.tip=i.tip);const u={},l=await this.request({path:"/v2/accounts/{principal}".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AccountDataResponseFromJSON)(f))}async getAccountInfo(i,o){return await(await this.getAccountInfoRaw(i,o)).value()}async getAccountNftRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountNft.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/nft_events".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressNftListResponseFromJSON)(f))}async getAccountNft(i,o){return await(await this.getAccountNftRaw(i,o)).value()}async getAccountNoncesRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountNonces.");const a={};i.blockHeight!==void 0&&(a.block_height=i.blockHeight),i.blockHash!==void 0&&(a.block_hash=i.blockHash);const u={},l=await this.request({path:"/extended/v1/address/{principal}/nonces".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressNoncesFromJSON)(f))}async getAccountNonces(i,o){return await(await this.getAccountNoncesRaw(i,o)).value()}async getAccountStxBalanceRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountStxBalance.");const a={};i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/stx".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async getAccountStxBalance(i,o){return await(await this.getAccountStxBalanceRaw(i,o)).value()}async getAccountTransactionsRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountTransactions.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.height!==void 0&&(a.height=i.height),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/transactions".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressTransactionsListResponseFromJSON)(f))}async getAccountTransactions(i,o){return await(await this.getAccountTransactionsRaw(i,o)).value()}async getAccountTransactionsWithTransfersRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountTransactionsWithTransfers.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.height!==void 0&&(a.height=i.height),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/transactions_with_transfers".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressTransactionsWithTransfersListResponseFromJSON)(f))}async getAccountTransactionsWithTransfers(i,o){return await(await this.getAccountTransactionsWithTransfersRaw(i,o)).value()}async getSingleTransactionWithTransfersRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getSingleTransactionWithTransfers.");if(i.txId===null||i.txId===void 0)throw new e.RequiredError("txId","Required parameter requestParameters.txId was null or undefined when calling getSingleTransactionWithTransfers.");const a={},u={},l=await this.request({path:"/extended/v1/address/{principal}/{tx_id}/with_transfers".replace("{principal}",encodeURIComponent(String(i.principal))).replace("{tx_id}",encodeURIComponent(String(i.txId))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressTransactionWithTransfersFromJSON)(f))}async getSingleTransactionWithTransfers(i,o){return await(await this.getSingleTransactionWithTransfersRaw(i,o)).value()}};return rm.AccountsApi=n,rm}var im={},jE;function LH(){if(jE)return im;jE=1,Object.defineProperty(im,"__esModule",{value:!0}),im.BlocksApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getBlockByBurnBlockHashRaw(i,o){if(i.burnBlockHash===null||i.burnBlockHash===void 0)throw new e.RequiredError("burnBlockHash","Required parameter requestParameters.burnBlockHash was null or undefined when calling getBlockByBurnBlockHash.");const a={},u={},l=await this.request({path:"/extended/v1/block/by_burn_block_hash/{burn_block_hash}".replace("{burn_block_hash}",encodeURIComponent(String(i.burnBlockHash))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BlockFromJSON)(f))}async getBlockByBurnBlockHash(i,o){return await(await this.getBlockByBurnBlockHashRaw(i,o)).value()}async getBlockByBurnBlockHeightRaw(i,o){if(i.burnBlockHeight===null||i.burnBlockHeight===void 0)throw new e.RequiredError("burnBlockHeight","Required parameter requestParameters.burnBlockHeight was null or undefined when calling getBlockByBurnBlockHeight.");const a={},u={},l=await this.request({path:"/extended/v1/block/by_burn_block_height/{burn_block_height}".replace("{burn_block_height}",encodeURIComponent(String(i.burnBlockHeight))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BlockFromJSON)(f))}async getBlockByBurnBlockHeight(i,o){return await(await this.getBlockByBurnBlockHeightRaw(i,o)).value()}async getBlockByHashRaw(i,o){if(i.hash===null||i.hash===void 0)throw new e.RequiredError("hash","Required parameter requestParameters.hash was null or undefined when calling getBlockByHash.");const a={},u={},l=await this.request({path:"/extended/v1/block/{hash}".replace("{hash}",encodeURIComponent(String(i.hash))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BlockFromJSON)(f))}async getBlockByHash(i,o){return await(await this.getBlockByHashRaw(i,o)).value()}async getBlockByHeightRaw(i,o){if(i.height===null||i.height===void 0)throw new e.RequiredError("height","Required parameter requestParameters.height was null or undefined when calling getBlockByHeight.");const a={},u={},l=await this.request({path:"/extended/v1/block/by_height/{height}".replace("{height}",encodeURIComponent(String(i.height))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BlockFromJSON)(f))}async getBlockByHeight(i,o){return await(await this.getBlockByHeightRaw(i,o)).value()}async getBlockListRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/block",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BlockListResponseFromJSON)(f))}async getBlockList(i,o){return await(await this.getBlockListRaw(i,o)).value()}};return im.BlocksApi=n,im}var om={},DE;function BH(){if(DE)return om;DE=1,Object.defineProperty(om,"__esModule",{value:!0}),om.FaucetsApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async runFaucetBtcRaw(i,o){if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling runFaucetBtc.");const a={};i.address!==void 0&&(a.address=i.address);const u={};u["Content-Type"]="application/json";const l=await this.request({path:"/extended/v1/faucets/btc",method:"POST",headers:u,query:a,body:(0,t.InlineObject1ToJSON)(i.inlineObject1)},o);return new e.JSONApiResponse(l,f=>(0,t.RunFaucetResponseFromJSON)(f))}async runFaucetBtc(i,o){return await(await this.runFaucetBtcRaw(i,o)).value()}async runFaucetStxRaw(i,o){if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling runFaucetStx.");const a={};i.address!==void 0&&(a.address=i.address),i.stacking!==void 0&&(a.stacking=i.stacking);const u={};u["Content-Type"]="application/json";const l=await this.request({path:"/extended/v1/faucets/stx",method:"POST",headers:u,query:a,body:(0,t.InlineObjectToJSON)(i.inlineObject)},o);return new e.JSONApiResponse(l,f=>(0,t.RunFaucetResponseFromJSON)(f))}async runFaucetStx(i,o){return await(await this.runFaucetStxRaw(i,o)).value()}};return om.FaucetsApi=n,om}var sm={},JE;function jH(){if(JE)return sm;JE=1,Object.defineProperty(sm,"__esModule",{value:!0}),sm.FeesApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async fetchFeeRateRaw(i,o){if(i.feeRateRequest===null||i.feeRateRequest===void 0)throw new e.RequiredError("feeRateRequest","Required parameter requestParameters.feeRateRequest was null or undefined when calling fetchFeeRate.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/extended/v1/fee_rate",method:"POST",headers:u,query:a,body:(0,t.FeeRateRequestToJSON)(i.feeRateRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.FeeRateFromJSON)(f))}async fetchFeeRate(i,o){return await(await this.fetchFeeRateRaw(i,o)).value()}async getFeeTransferRaw(i){const o={},a={},u=await this.request({path:"/v2/fees/transfer",method:"GET",headers:a,query:o},i);return new e.JSONApiResponse(u)}async getFeeTransfer(i){return await(await this.getFeeTransferRaw(i)).value()}async postFeeTransactionRaw(i,o){const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/v2/fees/transaction",method:"POST",headers:u,query:a,body:(0,t.TransactionFeeEstimateRequestToJSON)(i.transactionFeeEstimateRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.TransactionFeeEstimateResponseFromJSON)(f))}async postFeeTransaction(i,o){return await(await this.postFeeTransactionRaw(i,o)).value()}};return sm.FeesApi=n,sm}var am={},$E;function DH(){if($E)return am;$E=1,Object.defineProperty(am,"__esModule",{value:!0}),am.FungibleTokensApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getContractFtMetadataRaw(i,o){if(i.contractId===null||i.contractId===void 0)throw new e.RequiredError("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractFtMetadata.");const a={},u={},l=await this.request({path:"/extended/v1/tokens/{contractId}/ft/metadata".replace("{contractId}",encodeURIComponent(String(i.contractId))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.FungibleTokenMetadataFromJSON)(f))}async getContractFtMetadata(i,o){return await(await this.getContractFtMetadataRaw(i,o)).value()}async getFtMetadataListRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/tokens/ft/metadata",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.FungibleTokensMetadataListFromJSON)(f))}async getFtMetadataList(i,o){return await(await this.getFtMetadataListRaw(i,o)).value()}};return am.FungibleTokensApi=n,am}var qv={},qE;function JH(){return qE||(qE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GetNetworkBlockTimeByNetworkNetworkEnum=e.InfoApi=void 0;const t=Ie(),n=Fe();class r extends t.BaseAPI{async getCoreApiInfoRaw(o){const a={},u={},l=await this.request({path:"/v2/info",method:"GET",headers:u,query:a},o);return new t.JSONApiResponse(l,f=>(0,n.CoreNodeInfoResponseFromJSON)(f))}async getCoreApiInfo(o){return await(await this.getCoreApiInfoRaw(o)).value()}async getNetworkBlockTimeByNetworkRaw(o,a){if(o.network===null||o.network===void 0)throw new t.RequiredError("network","Required parameter requestParameters.network was null or undefined when calling getNetworkBlockTimeByNetwork.");const u={},l={},f=await this.request({path:"/extended/v1/info/network_block_time/{network}".replace("{network}",encodeURIComponent(String(o.network))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.NetworkBlockTimeResponseFromJSON)(p))}async getNetworkBlockTimeByNetwork(o,a){return await(await this.getNetworkBlockTimeByNetworkRaw(o,a)).value()}async getNetworkBlockTimesRaw(o){const a={},u={},l=await this.request({path:"/extended/v1/info/network_block_times",method:"GET",headers:u,query:a},o);return new t.JSONApiResponse(l,f=>(0,n.NetworkBlockTimesResponseFromJSON)(f))}async getNetworkBlockTimes(o){return await(await this.getNetworkBlockTimesRaw(o)).value()}async getPoxInfoRaw(o){const a={},u={},l=await this.request({path:"/v2/pox",method:"GET",headers:u,query:a},o);return new t.JSONApiResponse(l,f=>(0,n.CoreNodePoxResponseFromJSON)(f))}async getPoxInfo(o){return await(await this.getPoxInfoRaw(o)).value()}async getStatusRaw(o){const a={},u={},l=await this.request({path:"/extended/v1/status",method:"GET",headers:u,query:a},o);return new t.JSONApiResponse(l,f=>(0,n.ServerStatusResponseFromJSON)(f))}async getStatus(o){return await(await this.getStatusRaw(o)).value()}async getStxSupplyRaw(o,a){const u={};o.height!==void 0&&(u.height=o.height);const l={},f=await this.request({path:"/extended/v1/stx_supply",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.GetStxSupplyResponseFromJSON)(p))}async getStxSupply(o,a){return await(await this.getStxSupplyRaw(o,a)).value()}async getStxSupplyCirculatingPlainRaw(o){const a={},u={},l=await this.request({path:"/extended/v1/stx_supply/circulating/plain",method:"GET",headers:u,query:a},o);return new t.TextApiResponse(l)}async getStxSupplyCirculatingPlain(o){return await(await this.getStxSupplyCirculatingPlainRaw(o)).value()}async getStxSupplyTotalSupplyPlainRaw(o){const a={},u={},l=await this.request({path:"/extended/v1/stx_supply/total/plain",method:"GET",headers:u,query:a},o);return new t.TextApiResponse(l)}async getStxSupplyTotalSupplyPlain(o){return await(await this.getStxSupplyTotalSupplyPlainRaw(o)).value()}async getTotalStxSupplyLegacyFormatRaw(o,a){const u={};o.height!==void 0&&(u.height=o.height);const l={},f=await this.request({path:"/extended/v1/stx_supply/legacy_format",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.GetStxSupplyLegacyFormatResponseFromJSON)(p))}async getTotalStxSupplyLegacyFormat(o,a){return await(await this.getTotalStxSupplyLegacyFormatRaw(o,a)).value()}}e.InfoApi=r,function(i){i.testnet="testnet",i.mainnet="mainnet"}(e.GetNetworkBlockTimeByNetworkNetworkEnum||(e.GetNetworkBlockTimeByNetworkNetworkEnum={}))}(qv)),qv}var cm={},UE;function $H(){if(UE)return cm;UE=1,Object.defineProperty(cm,"__esModule",{value:!0}),cm.MicroblocksApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getMicroblockByHashRaw(i,o){if(i.hash===null||i.hash===void 0)throw new e.RequiredError("hash","Required parameter requestParameters.hash was null or undefined when calling getMicroblockByHash.");const a={},u={},l=await this.request({path:"/extended/v1/microblock/{hash}".replace("{hash}",encodeURIComponent(String(i.hash))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.MicroblockFromJSON)(f))}async getMicroblockByHash(i,o){return await(await this.getMicroblockByHashRaw(i,o)).value()}async getMicroblockListRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/microblock",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.MicroblockListResponseFromJSON)(f))}async getMicroblockList(i,o){return await(await this.getMicroblockListRaw(i,o)).value()}async getUnanchoredTxsRaw(i){const o={},a={},u=await this.request({path:"/extended/v1/microblock/unanchored/txs",method:"GET",headers:a,query:o},i);return new e.JSONApiResponse(u,l=>(0,t.UnanchoredTransactionListResponseFromJSON)(l))}async getUnanchoredTxs(i){return await(await this.getUnanchoredTxsRaw(i)).value()}};return cm.MicroblocksApi=n,cm}var um={},HE;function qH(){if(HE)return um;HE=1,Object.defineProperty(um,"__esModule",{value:!0}),um.NamesApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async fetchSubdomainsListForNameRaw(i,o){if(i.name===null||i.name===void 0)throw new e.RequiredError("name","Required parameter requestParameters.name was null or undefined when calling fetchSubdomainsListForName.");const a={},u={},l=await this.request({path:"/v1/names/{name}/subdomains".replace("{name}",encodeURIComponent(String(i.name))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async fetchSubdomainsListForName(i,o){return await(await this.fetchSubdomainsListForNameRaw(i,o)).value()}async fetchZoneFileRaw(i,o){if(i.name===null||i.name===void 0)throw new e.RequiredError("name","Required parameter requestParameters.name was null or undefined when calling fetchZoneFile.");const a={},u={},l=await this.request({path:"/v1/names/{name}/zonefile".replace("{name}",encodeURIComponent(String(i.name))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async fetchZoneFile(i,o){return await(await this.fetchZoneFileRaw(i,o)).value()}async getAllNamesRaw(i,o){const a={};i.page!==void 0&&(a.page=i.page);const u={},l=await this.request({path:"/v1/names",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async getAllNames(i,o){return await(await this.getAllNamesRaw(i,o)).value()}async getAllNamespacesRaw(i){const o={},a={},u=await this.request({path:"/v1/namespaces",method:"GET",headers:a,query:o},i);return new e.JSONApiResponse(u,l=>(0,t.BnsGetAllNamespacesResponseFromJSON)(l))}async getAllNamespaces(i){return await(await this.getAllNamespacesRaw(i)).value()}async getHistoricalZoneFileRaw(i,o){if(i.name===null||i.name===void 0)throw new e.RequiredError("name","Required parameter requestParameters.name was null or undefined when calling getHistoricalZoneFile.");if(i.zoneFileHash===null||i.zoneFileHash===void 0)throw new e.RequiredError("zoneFileHash","Required parameter requestParameters.zoneFileHash was null or undefined when calling getHistoricalZoneFile.");const a={},u={},l=await this.request({path:"/v1/names/{name}/zonefile/{zoneFileHash}".replace("{name}",encodeURIComponent(String(i.name))).replace("{zoneFileHash}",encodeURIComponent(String(i.zoneFileHash))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async getHistoricalZoneFile(i,o){return await(await this.getHistoricalZoneFileRaw(i,o)).value()}async getNameInfoRaw(i,o){if(i.name===null||i.name===void 0)throw new e.RequiredError("name","Required parameter requestParameters.name was null or undefined when calling getNameInfo.");const a={},u={},l=await this.request({path:"/v1/names/{name}".replace("{name}",encodeURIComponent(String(i.name))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BnsGetNameInfoResponseFromJSON)(f))}async getNameInfo(i,o){return await(await this.getNameInfoRaw(i,o)).value()}async getNamePriceRaw(i,o){if(i.name===null||i.name===void 0)throw new e.RequiredError("name","Required parameter requestParameters.name was null or undefined when calling getNamePrice.");const a={},u={},l=await this.request({path:"/v2/prices/names/{name}".replace("{name}",encodeURIComponent(String(i.name))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BnsGetNamePriceResponseFromJSON)(f))}async getNamePrice(i,o){return await(await this.getNamePriceRaw(i,o)).value()}async getNamesOwnedByAddressRaw(i,o){if(i.blockchain===null||i.blockchain===void 0)throw new e.RequiredError("blockchain","Required parameter requestParameters.blockchain was null or undefined when calling getNamesOwnedByAddress.");if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling getNamesOwnedByAddress.");const a={},u={},l=await this.request({path:"/v1/addresses/{blockchain}/{address}".replace("{blockchain}",encodeURIComponent(String(i.blockchain))).replace("{address}",encodeURIComponent(String(i.address))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BnsNamesOwnByAddressResponseFromJSON)(f))}async getNamesOwnedByAddress(i,o){return await(await this.getNamesOwnedByAddressRaw(i,o)).value()}async getNamespaceNamesRaw(i,o){if(i.tld===null||i.tld===void 0)throw new e.RequiredError("tld","Required parameter requestParameters.tld was null or undefined when calling getNamespaceNames.");const a={};i.page!==void 0&&(a.page=i.page);const u={},l=await this.request({path:"/v1/namespaces/{tld}/names".replace("{tld}",encodeURIComponent(String(i.tld))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async getNamespaceNames(i,o){return await(await this.getNamespaceNamesRaw(i,o)).value()}async getNamespacePriceRaw(i,o){if(i.tld===null||i.tld===void 0)throw new e.RequiredError("tld","Required parameter requestParameters.tld was null or undefined when calling getNamespacePrice.");const a={},u={},l=await this.request({path:"/v2/prices/namespaces/{tld}".replace("{tld}",encodeURIComponent(String(i.tld))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BnsGetNamespacePriceResponseFromJSON)(f))}async getNamespacePrice(i,o){return await(await this.getNamespacePriceRaw(i,o)).value()}};return um.NamesApi=n,um}var lm={},zE;function UH(){if(zE)return lm;zE=1,Object.defineProperty(lm,"__esModule",{value:!0}),lm.NonFungibleTokensApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getContractNftMetadataRaw(i,o){if(i.contractId===null||i.contractId===void 0)throw new e.RequiredError("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractNftMetadata.");const a={},u={},l=await this.request({path:"/extended/v1/tokens/{contractId}/nft/metadata".replace("{contractId}",encodeURIComponent(String(i.contractId))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.NonFungibleTokenMetadataFromJSON)(f))}async getContractNftMetadata(i,o){return await(await this.getContractNftMetadataRaw(i,o)).value()}async getNftHistoryRaw(i,o){if(i.assetIdentifier===null||i.assetIdentifier===void 0)throw new e.RequiredError("assetIdentifier","Required parameter requestParameters.assetIdentifier was null or undefined when calling getNftHistory.");if(i.value===null||i.value===void 0)throw new e.RequiredError("value","Required parameter requestParameters.value was null or undefined when calling getNftHistory.");const a={};i.assetIdentifier!==void 0&&(a.asset_identifier=i.assetIdentifier),i.value!==void 0&&(a.value=i.value),i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.txMetadata!==void 0&&(a.tx_metadata=i.txMetadata);const u={},l=await this.request({path:"/extended/v1/tokens/nft/history",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.NonFungibleTokenHistoryEventListFromJSON)(f))}async getNftHistory(i,o){return await(await this.getNftHistoryRaw(i,o)).value()}async getNftHoldingsRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getNftHoldings.");const a={};i.principal!==void 0&&(a.principal=i.principal),i.assetIdentifiers&&(a.asset_identifiers=i.assetIdentifiers),i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.txMetadata!==void 0&&(a.tx_metadata=i.txMetadata);const u={},l=await this.request({path:"/extended/v1/tokens/nft/holdings",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.NonFungibleTokenHoldingsListFromJSON)(f))}async getNftHoldings(i,o){return await(await this.getNftHoldingsRaw(i,o)).value()}async getNftMetadataListRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/tokens/nft/metadata",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.NonFungibleTokensMetadataListFromJSON)(f))}async getNftMetadataList(i,o){return await(await this.getNftMetadataListRaw(i,o)).value()}async getNftMintsRaw(i,o){if(i.assetIdentifier===null||i.assetIdentifier===void 0)throw new e.RequiredError("assetIdentifier","Required parameter requestParameters.assetIdentifier was null or undefined when calling getNftMints.");const a={};i.assetIdentifier!==void 0&&(a.asset_identifier=i.assetIdentifier),i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.txMetadata!==void 0&&(a.tx_metadata=i.txMetadata);const u={},l=await this.request({path:"/extended/v1/tokens/nft/mints",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.NonFungibleTokenMintListFromJSON)(f))}async getNftMints(i,o){return await(await this.getNftMintsRaw(i,o)).value()}};return lm.NonFungibleTokensApi=n,lm}var dm={},WE;function HH(){if(WE)return dm;WE=1,Object.defineProperty(dm,"__esModule",{value:!0}),dm.RosettaApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async rosettaAccountBalanceRaw(i,o){if(i.rosettaAccountBalanceRequest===null||i.rosettaAccountBalanceRequest===void 0)throw new e.RequiredError("rosettaAccountBalanceRequest","Required parameter requestParameters.rosettaAccountBalanceRequest was null or undefined when calling rosettaAccountBalance.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/account/balance",method:"POST",headers:u,query:a,body:(0,t.RosettaAccountBalanceRequestToJSON)(i.rosettaAccountBalanceRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaAccountBalanceResponseFromJSON)(f))}async rosettaAccountBalance(i,o){return await(await this.rosettaAccountBalanceRaw(i,o)).value()}async rosettaBlockRaw(i,o){if(i.rosettaBlockRequest===null||i.rosettaBlockRequest===void 0)throw new e.RequiredError("rosettaBlockRequest","Required parameter requestParameters.rosettaBlockRequest was null or undefined when calling rosettaBlock.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/block",method:"POST",headers:u,query:a,body:(0,t.RosettaBlockRequestToJSON)(i.rosettaBlockRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaBlockResponseFromJSON)(f))}async rosettaBlock(i,o){return await(await this.rosettaBlockRaw(i,o)).value()}async rosettaBlockTransactionRaw(i,o){if(i.rosettaBlockTransactionRequest===null||i.rosettaBlockTransactionRequest===void 0)throw new e.RequiredError("rosettaBlockTransactionRequest","Required parameter requestParameters.rosettaBlockTransactionRequest was null or undefined when calling rosettaBlockTransaction.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/block/transaction",method:"POST",headers:u,query:a,body:(0,t.RosettaBlockTransactionRequestToJSON)(i.rosettaBlockTransactionRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaBlockTransactionResponseFromJSON)(f))}async rosettaBlockTransaction(i,o){return await(await this.rosettaBlockTransactionRaw(i,o)).value()}async rosettaConstructionCombineRaw(i,o){if(i.rosettaConstructionCombineRequest===null||i.rosettaConstructionCombineRequest===void 0)throw new e.RequiredError("rosettaConstructionCombineRequest","Required parameter requestParameters.rosettaConstructionCombineRequest was null or undefined when calling rosettaConstructionCombine.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/combine",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionCombineRequestToJSON)(i.rosettaConstructionCombineRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionCombineResponseFromJSON)(f))}async rosettaConstructionCombine(i,o){return await(await this.rosettaConstructionCombineRaw(i,o)).value()}async rosettaConstructionDeriveRaw(i,o){if(i.rosettaConstructionDeriveRequest===null||i.rosettaConstructionDeriveRequest===void 0)throw new e.RequiredError("rosettaConstructionDeriveRequest","Required parameter requestParameters.rosettaConstructionDeriveRequest was null or undefined when calling rosettaConstructionDerive.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/derive",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionDeriveRequestToJSON)(i.rosettaConstructionDeriveRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionDeriveResponseFromJSON)(f))}async rosettaConstructionDerive(i,o){return await(await this.rosettaConstructionDeriveRaw(i,o)).value()}async rosettaConstructionHashRaw(i,o){if(i.rosettaConstructionHashRequest===null||i.rosettaConstructionHashRequest===void 0)throw new e.RequiredError("rosettaConstructionHashRequest","Required parameter requestParameters.rosettaConstructionHashRequest was null or undefined when calling rosettaConstructionHash.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/hash",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionHashRequestToJSON)(i.rosettaConstructionHashRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionHashResponseFromJSON)(f))}async rosettaConstructionHash(i,o){return await(await this.rosettaConstructionHashRaw(i,o)).value()}async rosettaConstructionMetadataRaw(i,o){if(i.rosettaConstructionMetadataRequest===null||i.rosettaConstructionMetadataRequest===void 0)throw new e.RequiredError("rosettaConstructionMetadataRequest","Required parameter requestParameters.rosettaConstructionMetadataRequest was null or undefined when calling rosettaConstructionMetadata.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/metadata",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionMetadataRequestToJSON)(i.rosettaConstructionMetadataRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionMetadataResponseFromJSON)(f))}async rosettaConstructionMetadata(i,o){return await(await this.rosettaConstructionMetadataRaw(i,o)).value()}async rosettaConstructionParseRaw(i,o){if(i.rosettaConstructionParseRequest===null||i.rosettaConstructionParseRequest===void 0)throw new e.RequiredError("rosettaConstructionParseRequest","Required parameter requestParameters.rosettaConstructionParseRequest was null or undefined when calling rosettaConstructionParse.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/parse",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionParseRequestToJSON)(i.rosettaConstructionParseRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionParseResponseFromJSON)(f))}async rosettaConstructionParse(i,o){return await(await this.rosettaConstructionParseRaw(i,o)).value()}async rosettaConstructionPayloadsRaw(i,o){if(i.rosettaConstructionPayloadsRequest===null||i.rosettaConstructionPayloadsRequest===void 0)throw new e.RequiredError("rosettaConstructionPayloadsRequest","Required parameter requestParameters.rosettaConstructionPayloadsRequest was null or undefined when calling rosettaConstructionPayloads.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/payloads",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionPayloadsRequestToJSON)(i.rosettaConstructionPayloadsRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionPayloadResponseFromJSON)(f))}async rosettaConstructionPayloads(i,o){return await(await this.rosettaConstructionPayloadsRaw(i,o)).value()}async rosettaConstructionPreprocessRaw(i,o){if(i.rosettaConstructionPreprocessRequest===null||i.rosettaConstructionPreprocessRequest===void 0)throw new e.RequiredError("rosettaConstructionPreprocessRequest","Required parameter requestParameters.rosettaConstructionPreprocessRequest was null or undefined when calling rosettaConstructionPreprocess.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/preprocess",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionPreprocessRequestToJSON)(i.rosettaConstructionPreprocessRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionPreprocessResponseFromJSON)(f))}async rosettaConstructionPreprocess(i,o){return await(await this.rosettaConstructionPreprocessRaw(i,o)).value()}async rosettaConstructionSubmitRaw(i,o){if(i.rosettaConstructionSubmitRequest===null||i.rosettaConstructionSubmitRequest===void 0)throw new e.RequiredError("rosettaConstructionSubmitRequest","Required parameter requestParameters.rosettaConstructionSubmitRequest was null or undefined when calling rosettaConstructionSubmit.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/submit",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionSubmitRequestToJSON)(i.rosettaConstructionSubmitRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionSubmitResponseFromJSON)(f))}async rosettaConstructionSubmit(i,o){return await(await this.rosettaConstructionSubmitRaw(i,o)).value()}async rosettaMempoolRaw(i,o){if(i.rosettaMempoolRequest===null||i.rosettaMempoolRequest===void 0)throw new e.RequiredError("rosettaMempoolRequest","Required parameter requestParameters.rosettaMempoolRequest was null or undefined when calling rosettaMempool.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/mempool",method:"POST",headers:u,query:a,body:(0,t.RosettaMempoolRequestToJSON)(i.rosettaMempoolRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaMempoolResponseFromJSON)(f))}async rosettaMempool(i,o){return await(await this.rosettaMempoolRaw(i,o)).value()}async rosettaMempoolTransactionRaw(i,o){if(i.rosettaMempoolTransactionRequest===null||i.rosettaMempoolTransactionRequest===void 0)throw new e.RequiredError("rosettaMempoolTransactionRequest","Required parameter requestParameters.rosettaMempoolTransactionRequest was null or undefined when calling rosettaMempoolTransaction.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/mempool/transaction",method:"POST",headers:u,query:a,body:(0,t.RosettaMempoolTransactionRequestToJSON)(i.rosettaMempoolTransactionRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaMempoolTransactionResponseFromJSON)(f))}async rosettaMempoolTransaction(i,o){return await(await this.rosettaMempoolTransactionRaw(i,o)).value()}async rosettaNetworkListRaw(i){const o={},a={},u=await this.request({path:"/rosetta/v1/network/list",method:"POST",headers:a,query:o},i);return new e.JSONApiResponse(u,l=>(0,t.RosettaNetworkListResponseFromJSON)(l))}async rosettaNetworkList(i){return await(await this.rosettaNetworkListRaw(i)).value()}async rosettaNetworkOptionsRaw(i,o){if(i.rosettaOptionsRequest===null||i.rosettaOptionsRequest===void 0)throw new e.RequiredError("rosettaOptionsRequest","Required parameter requestParameters.rosettaOptionsRequest was null or undefined when calling rosettaNetworkOptions.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/network/options",method:"POST",headers:u,query:a,body:(0,t.RosettaOptionsRequestToJSON)(i.rosettaOptionsRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaNetworkOptionsResponseFromJSON)(f))}async rosettaNetworkOptions(i,o){return await(await this.rosettaNetworkOptionsRaw(i,o)).value()}async rosettaNetworkStatusRaw(i,o){if(i.rosettaStatusRequest===null||i.rosettaStatusRequest===void 0)throw new e.RequiredError("rosettaStatusRequest","Required parameter requestParameters.rosettaStatusRequest was null or undefined when calling rosettaNetworkStatus.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/network/status",method:"POST",headers:u,query:a,body:(0,t.RosettaStatusRequestToJSON)(i.rosettaStatusRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaNetworkStatusResponseFromJSON)(f))}async rosettaNetworkStatus(i,o){return await(await this.rosettaNetworkStatusRaw(i,o)).value()}};return dm.RosettaApi=n,dm}var fm={},VE;function zH(){if(VE)return fm;VE=1,Object.defineProperty(fm,"__esModule",{value:!0}),fm.SearchApi=void 0;const e=Ie();let t=class extends e.BaseAPI{async searchByIdRaw(r,i){if(r.id===null||r.id===void 0)throw new e.RequiredError("id","Required parameter requestParameters.id was null or undefined when calling searchById.");const o={};r.includeMetadata!==void 0&&(o.include_metadata=r.includeMetadata);const a={},u=await this.request({path:"/extended/v1/search/{id}".replace("{id}",encodeURIComponent(String(r.id))),method:"GET",headers:a,query:o},i);return new e.JSONApiResponse(u)}async searchById(r,i){return await(await this.searchByIdRaw(r,i)).value()}};return fm.SearchApi=t,fm}var hm={},GE;function WH(){if(GE)return hm;GE=1,Object.defineProperty(hm,"__esModule",{value:!0}),hm.SmartContractsApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async callReadOnlyFunctionRaw(i,o){if(i.contractAddress===null||i.contractAddress===void 0)throw new e.RequiredError("contractAddress","Required parameter requestParameters.contractAddress was null or undefined when calling callReadOnlyFunction.");if(i.contractName===null||i.contractName===void 0)throw new e.RequiredError("contractName","Required parameter requestParameters.contractName was null or undefined when calling callReadOnlyFunction.");if(i.functionName===null||i.functionName===void 0)throw new e.RequiredError("functionName","Required parameter requestParameters.functionName was null or undefined when calling callReadOnlyFunction.");if(i.readOnlyFunctionArgs===null||i.readOnlyFunctionArgs===void 0)throw new e.RequiredError("readOnlyFunctionArgs","Required parameter requestParameters.readOnlyFunctionArgs was null or undefined when calling callReadOnlyFunction.");const a={};i.tip!==void 0&&(a.tip=i.tip);const u={};u["Content-Type"]="application/json";const l=await this.request({path:"/v2/contracts/call-read/{contract_address}/{contract_name}/{function_name}".replace("{contract_address}",encodeURIComponent(String(i.contractAddress))).replace("{contract_name}",encodeURIComponent(String(i.contractName))).replace("{function_name}",encodeURIComponent(String(i.functionName))),method:"POST",headers:u,query:a,body:(0,t.ReadOnlyFunctionArgsToJSON)(i.readOnlyFunctionArgs)},o);return new e.JSONApiResponse(l,f=>(0,t.ReadOnlyFunctionSuccessResponseFromJSON)(f))}async callReadOnlyFunction(i,o){return await(await this.callReadOnlyFunctionRaw(i,o)).value()}async getContractByIdRaw(i,o){if(i.contractId===null||i.contractId===void 0)throw new e.RequiredError("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractById.");const a={};i.unanchored!==void 0&&(a.unanchored=i.unanchored);const u={},l=await this.request({path:"/extended/v1/contract/{contract_id}".replace("{contract_id}",encodeURIComponent(String(i.contractId))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.SmartContractFromJSON)(f))}async getContractById(i,o){return await(await this.getContractByIdRaw(i,o)).value()}async getContractDataMapEntryRaw(i,o){if(i.contractAddress===null||i.contractAddress===void 0)throw new e.RequiredError("contractAddress","Required parameter requestParameters.contractAddress was null or undefined when calling getContractDataMapEntry.");if(i.contractName===null||i.contractName===void 0)throw new e.RequiredError("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractDataMapEntry.");if(i.mapName===null||i.mapName===void 0)throw new e.RequiredError("mapName","Required parameter requestParameters.mapName was null or undefined when calling getContractDataMapEntry.");if(i.key===null||i.key===void 0)throw new e.RequiredError("key","Required parameter requestParameters.key was null or undefined when calling getContractDataMapEntry.");const a={};i.proof!==void 0&&(a.proof=i.proof),i.tip!==void 0&&(a.tip=i.tip);const u={};u["Content-Type"]="application/json";const l=await this.request({path:"/v2/map_entry/{contract_address}/{contract_name}/{map_name}".replace("{contract_address}",encodeURIComponent(String(i.contractAddress))).replace("{contract_name}",encodeURIComponent(String(i.contractName))).replace("{map_name}",encodeURIComponent(String(i.mapName))),method:"POST",headers:u,query:a,body:i.key},o);return new e.JSONApiResponse(l,f=>(0,t.MapEntryResponseFromJSON)(f))}async getContractDataMapEntry(i,o){return await(await this.getContractDataMapEntryRaw(i,o)).value()}async getContractEventsByIdRaw(i,o){if(i.contractId===null||i.contractId===void 0)throw new e.RequiredError("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractEventsById.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored);const u={},l=await this.request({path:"/extended/v1/contract/{contract_id}/events".replace("{contract_id}",encodeURIComponent(String(i.contractId))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async getContractEventsById(i,o){return await(await this.getContractEventsByIdRaw(i,o)).value()}async getContractInterfaceRaw(i,o){if(i.contractAddress===null||i.contractAddress===void 0)throw new e.RequiredError("contractAddress","Required parameter requestParameters.contractAddress was null or undefined when calling getContractInterface.");if(i.contractName===null||i.contractName===void 0)throw new e.RequiredError("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractInterface.");const a={};i.tip!==void 0&&(a.tip=i.tip);const u={},l=await this.request({path:"/v2/contracts/interface/{contract_address}/{contract_name}".replace("{contract_address}",encodeURIComponent(String(i.contractAddress))).replace("{contract_name}",encodeURIComponent(String(i.contractName))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.ContractInterfaceResponseFromJSON)(f))}async getContractInterface(i,o){return await(await this.getContractInterfaceRaw(i,o)).value()}async getContractSourceRaw(i,o){if(i.contractAddress===null||i.contractAddress===void 0)throw new e.RequiredError("contractAddress","Required parameter requestParameters.contractAddress was null or undefined when calling getContractSource.");if(i.contractName===null||i.contractName===void 0)throw new e.RequiredError("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractSource.");const a={};i.proof!==void 0&&(a.proof=i.proof),i.tip!==void 0&&(a.tip=i.tip);const u={},l=await this.request({path:"/v2/contracts/source/{contract_address}/{contract_name}".replace("{contract_address}",encodeURIComponent(String(i.contractAddress))).replace("{contract_name}",encodeURIComponent(String(i.contractName))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.ContractSourceResponseFromJSON)(f))}async getContractSource(i,o){return await(await this.getContractSourceRaw(i,o)).value()}async getContractsByTraitRaw(i,o){if(i.traitAbi===null||i.traitAbi===void 0)throw new e.RequiredError("traitAbi","Required parameter requestParameters.traitAbi was null or undefined when calling getContractsByTrait.");const a={};i.traitAbi!==void 0&&(a.trait_abi=i.traitAbi),i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/contract/by_trait",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.ContractListResponseFromJSON)(f))}async getContractsByTrait(i,o){return await(await this.getContractsByTraitRaw(i,o)).value()}};return hm.SmartContractsApi=n,hm}var pm={},KE;function VH(){if(KE)return pm;KE=1,Object.defineProperty(pm,"__esModule",{value:!0}),pm.StackingApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getPoolDelegationsRaw(i,o){if(i.poolPrincipal===null||i.poolPrincipal===void 0)throw new e.RequiredError("poolPrincipal","Required parameter requestParameters.poolPrincipal was null or undefined when calling getPoolDelegations.");const a={};i.afterBlock!==void 0&&(a.after_block=i.afterBlock),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/beta/stacking/{pool_principal}/delegations".replace("{pool_principal}",encodeURIComponent(String(i.poolPrincipal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.PoolDelegationsResponseFromJSON)(f))}async getPoolDelegations(i,o){return await(await this.getPoolDelegationsRaw(i,o)).value()}};return pm.StackingApi=n,pm}var mm={},QE;function GH(){if(QE)return mm;QE=1,Object.defineProperty(mm,"__esModule",{value:!0}),mm.StackingRewardsApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getBurnchainRewardListRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/burnchain/rewards",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BurnchainRewardListResponseFromJSON)(f))}async getBurnchainRewardList(i,o){return await(await this.getBurnchainRewardListRaw(i,o)).value()}async getBurnchainRewardListByAddressRaw(i,o){if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling getBurnchainRewardListByAddress.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/burnchain/rewards/{address}".replace("{address}",encodeURIComponent(String(i.address))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BurnchainRewardListResponseFromJSON)(f))}async getBurnchainRewardListByAddress(i,o){return await(await this.getBurnchainRewardListByAddressRaw(i,o)).value()}async getBurnchainRewardSlotHoldersRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/burnchain/reward_slot_holders",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BurnchainRewardSlotHolderListResponseFromJSON)(f))}async getBurnchainRewardSlotHolders(i,o){return await(await this.getBurnchainRewardSlotHoldersRaw(i,o)).value()}async getBurnchainRewardSlotHoldersByAddressRaw(i,o){if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling getBurnchainRewardSlotHoldersByAddress.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/burnchain/reward_slot_holders/{address}".replace("{address}",encodeURIComponent(String(i.address))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BurnchainRewardSlotHolderListResponseFromJSON)(f))}async getBurnchainRewardSlotHoldersByAddress(i,o){return await(await this.getBurnchainRewardSlotHoldersByAddressRaw(i,o)).value()}async getBurnchainRewardsTotalByAddressRaw(i,o){if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling getBurnchainRewardsTotalByAddress.");const a={},u={},l=await this.request({path:"/extended/v1/burnchain/rewards/{address}/total".replace("{address}",encodeURIComponent(String(i.address))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BurnchainRewardsTotalFromJSON)(f))}async getBurnchainRewardsTotalByAddress(i,o){return await(await this.getBurnchainRewardsTotalByAddressRaw(i,o)).value()}};return mm.StackingRewardsApi=n,mm}var Uv={},YE;function KH(){return YE||(YE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GetTransactionListTypeEnum=e.GetFilteredEventsTypeEnum=e.TransactionsApi=void 0;const t=Ie(),n=Fe();class r extends t.BaseAPI{async getAddressMempoolTransactionsRaw(o,a){if(o.address===null||o.address===void 0)throw new t.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling getAddressMempoolTransactions.");const u={};o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/address/{address}/mempool".replace("{address}",encodeURIComponent(String(o.address))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.MempoolTransactionListResponseFromJSON)(p))}async getAddressMempoolTransactions(o,a){return await(await this.getAddressMempoolTransactionsRaw(o,a)).value()}async getDroppedMempoolTransactionListRaw(o,a){const u={};o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset);const l={},f=await this.request({path:"/extended/v1/tx/mempool/dropped",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.MempoolTransactionListResponseFromJSON)(p))}async getDroppedMempoolTransactionList(o,a){return await(await this.getDroppedMempoolTransactionListRaw(o,a)).value()}async getFilteredEventsRaw(o,a){const u={};o.txId!==void 0&&(u.tx_id=o.txId),o.address!==void 0&&(u.address=o.address),o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset),o.type&&(u.type=o.type);const l={},f=await this.request({path:"/extended/v1/tx/events",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.TransactionEventsResponseFromJSON)(p))}async getFilteredEvents(o,a){return await(await this.getFilteredEventsRaw(o,a)).value()}async getMempoolTransactionListRaw(o,a){const u={};o.senderAddress!==void 0&&(u.sender_address=o.senderAddress),o.recipientAddress!==void 0&&(u.recipient_address=o.recipientAddress),o.address!==void 0&&(u.address=o.address),o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/tx/mempool",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.MempoolTransactionListResponseFromJSON)(p))}async getMempoolTransactionList(o,a){return await(await this.getMempoolTransactionListRaw(o,a)).value()}async getMempoolTransactionStatsRaw(o){const a={},u={},l=await this.request({path:"/extended/v1/tx/mempool/stats",method:"GET",headers:u,query:a},o);return new t.JSONApiResponse(l,f=>(0,n.MempoolTransactionStatsResponseFromJSON)(f))}async getMempoolTransactionStats(o){return await(await this.getMempoolTransactionStatsRaw(o)).value()}async getRawTransactionByIdRaw(o,a){if(o.txId===null||o.txId===void 0)throw new t.RequiredError("txId","Required parameter requestParameters.txId was null or undefined when calling getRawTransactionById.");const u={},l={},f=await this.request({path:"/extended/v1/tx/{tx_id}/raw".replace("{tx_id}",encodeURIComponent(String(o.txId))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.GetRawTransactionResultFromJSON)(p))}async getRawTransactionById(o,a){return await(await this.getRawTransactionByIdRaw(o,a)).value()}async getTransactionByIdRaw(o,a){if(o.txId===null||o.txId===void 0)throw new t.RequiredError("txId","Required parameter requestParameters.txId was null or undefined when calling getTransactionById.");const u={};o.eventOffset!==void 0&&(u.event_offset=o.eventOffset),o.eventLimit!==void 0&&(u.event_limit=o.eventLimit),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/tx/{tx_id}".replace("{tx_id}",encodeURIComponent(String(o.txId))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f)}async getTransactionById(o,a){return await(await this.getTransactionByIdRaw(o,a)).value()}async getTransactionListRaw(o,a){const u={};o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset),o.type&&(u.type=o.type),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/tx",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.TransactionResultsFromJSON)(p))}async getTransactionList(o,a){return await(await this.getTransactionListRaw(o,a)).value()}async getTransactionsByBlockHashRaw(o,a){if(o.blockHash===null||o.blockHash===void 0)throw new t.RequiredError("blockHash","Required parameter requestParameters.blockHash was null or undefined when calling getTransactionsByBlockHash.");const u={};o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset);const l={},f=await this.request({path:"/extended/v1/tx/block/{block_hash}".replace("{block_hash}",encodeURIComponent(String(o.blockHash))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.TransactionResultsFromJSON)(p))}async getTransactionsByBlockHash(o,a){return await(await this.getTransactionsByBlockHashRaw(o,a)).value()}async getTransactionsByBlockHeightRaw(o,a){if(o.height===null||o.height===void 0)throw new t.RequiredError("height","Required parameter requestParameters.height was null or undefined when calling getTransactionsByBlockHeight.");const u={};o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/tx/block_height/{height}".replace("{height}",encodeURIComponent(String(o.height))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.TransactionResultsFromJSON)(p))}async getTransactionsByBlockHeight(o,a){return await(await this.getTransactionsByBlockHeightRaw(o,a)).value()}async getTxListDetailsRaw(o,a){if(o.txId===null||o.txId===void 0)throw new t.RequiredError("txId","Required parameter requestParameters.txId was null or undefined when calling getTxListDetails.");const u={};o.txId&&(u.tx_id=o.txId),o.eventOffset!==void 0&&(u.event_offset=o.eventOffset),o.eventLimit!==void 0&&(u.event_limit=o.eventLimit),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/tx/multiple",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f)}async getTxListDetails(o,a){return await(await this.getTxListDetailsRaw(o,a)).value()}async postCoreNodeTransactionsRaw(o,a){const u={},l={};l["Content-Type"]="application/octet-stream";const f=await this.request({path:"/v2/transactions",method:"POST",headers:l,query:u,body:o.body},a);return new t.TextApiResponse(f)}async postCoreNodeTransactions(o,a){return await(await this.postCoreNodeTransactionsRaw(o,a)).value()}}e.TransactionsApi=r,function(i){i.smart_contract_log="smart_contract_log",i.stx_lock="stx_lock",i.stx_asset="stx_asset",i.fungible_token_asset="fungible_token_asset",i.non_fungible_token_asset="non_fungible_token_asset"}(e.GetFilteredEventsTypeEnum||(e.GetFilteredEventsTypeEnum={})),function(i){i.coinbase="coinbase",i.token_transfer="token_transfer",i.smart_contract="smart_contract",i.contract_call="contract_call",i.poison_microblock="poison_microblock"}(e.GetTransactionListTypeEnum||(e.GetTransactionListTypeEnum={}))}(Uv)),Uv}var XE;function QH(){return XE||(XE=1,function(e){var t=_d&&_d.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(i,o);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,a,u)}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=_d&&_d.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(MH(),e),n(LH(),e),n(BH(),e),n(jH(),e),n(DH(),e),n(JH(),e),n($H(),e),n(qH(),e),n(UH(),e),n(HH(),e),n(zH(),e),n(WH(),e),n(VH(),e),n(GH(),e),n(KH(),e)}(_d)),_d}var ZE;function YH(){return ZE||(ZE=1,function(e){var t=xd&&xd.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(i,o);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,a,u)}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=xd&&xd.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(Ie(),e),n(QH(),e),n(Fe(),e)}(xd)),xd}var Rd={};const o0=Object.prototype.hasOwnProperty,E_=typeof Number.isSafeInteger=="function"?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&e===Math.floor(e)&&Math.abs(e)<=9007199254740991};class Ul{constructor(){this.jsonrpc="2.0"}serialize(){return JSON.stringify(this)}}Ul.VERSION="2.0";class Bw extends Ul{constructor(t,n,r){super(),this.id=t,this.method=n,r!==void 0&&(this.params=r)}}class jw extends Ul{constructor(t,n){super(),this.method=t,n!==void 0&&(this.params=n)}}class Dw extends Ul{constructor(t,n){super(),this.id=t,this.result=n}}class Jw extends Ul{constructor(t,n){super(),this.id=t,this.error=n,this.id=t,this.error=n}}class jh{constructor(t,n){this.payload=t,this.type=n,this.payload=t,this.type=n}}class tn{constructor(t,n,r){this.message=t,this.code=E_(n)?n:0,r!=null&&(this.data=r)}}tn.invalidRequest=function(e){return new tn("Invalid request",-32600,e)};tn.methodNotFound=function(e){return new tn("Method not found",-32601,e)};tn.invalidParams=function(e){return new tn("Invalid params",-32602,e)};tn.internalError=function(e){return new tn("Internal error",-32603,e)};tn.parseError=function(e){return new tn("Parse error",-32700,e)};function pP(e,t,n){const r=new Bw(e,t,n);return Tl(r,!0),r}function mP(e,t){const n=new jw(e,t);return Tl(n,!0),n}function gP(e,t){const n=new Dw(e,t);return Tl(n,!0),n}function yP(e,t){const n=new Jw(e,t);return Tl(n,!0),n}function A_(e){if(!$w(e))return new jh(tn.invalidRequest(e),"invalid");let t;try{t=JSON.parse(e)}catch{return new jh(tn.parseError(e),"invalid")}return F_(t)}function F_(e){if(!Array.isArray(e))return ew(e);if(e.length===0)return new jh(tn.invalidRequest(e),"invalid");const t=[];for(let n=0,r=e.length;n{const f=e.parse(l.data);(Array.isArray(f)?f:[f]).forEach(m=>{if(m.type==="notification")this.handleNotification(m.payload);else if(m.type==="success"){const y=this.pendingRequests.get(m.payload.id);y&&(this.pendingRequests.delete(m.payload.id),y.resolve(m.payload.result))}else if(m.type==="error"){const y=this.pendingRequests.get(m.payload.id);y&&(this.pendingRequests.delete(m.payload.id),y.reject(m.payload.error))}})})}static async connect(u=n.BASE_PATH){let l;try{l=new URL(u)}catch{l=new URL(`ws://${u}`)}l.protocol==="https:"?l.protocol="wss:":l.protocol==="http:"&&(l.protocol="ws:"),l.pathname==="/"&&(l.pathname="/extended/v1/ws");const f=await new Promise((p,m)=>{const y=new(o())(l.toString());y.onopen=()=>p(y),y.onerror=w=>m(w)});return new r(f)}handleNotification(u){switch(u.method){case"tx_update":this.eventEmitter.emit("txUpdate",u.params);break;case"address_tx_update":this.eventEmitter.emit("addressTxUpdate",u.params);break;case"address_balance_update":this.eventEmitter.emit("addressBalanceUpdate",u.params);break;case"block":this.eventEmitter.emit("block",u.params);break;case"microblock":this.eventEmitter.emit("microblock",u.params);break;case"mempool":this.eventEmitter.emit("mempool",u.params);break;case"nft_event":this.eventEmitter.emit("nftEventUpdate",u.params);break;case"nft_asset_event":this.eventEmitter.emit("nftAssetEventUpdate",u.params);break;case"nft_collection_event":this.eventEmitter.emit("nftCollectionEventUpdate",u.params);break}}rpcCall(u,l){const f=e.request(++this.idCursor,u,l);return new Promise((p,m)=>{this.pendingRequests.set(f.id,{resolve:p,reject:m}),this.webSocket.send(f.serialize())})}async subscribeBlocks(u){const l={event:"block"};await this.rpcCall("subscribe",l);const f=p=>{u(p)};return this.eventEmitter.addListener("block",f),{unsubscribe:()=>(this.eventEmitter.removeListener("block",f),this.rpcCall("unsubscribe",l))}}async subscribeMicroblocks(u){const l={event:"microblock"};await this.rpcCall("subscribe",l);const f=p=>{u(p)};return this.eventEmitter.addListener("microblock",f),{unsubscribe:()=>(this.eventEmitter.removeListener("microblock",f),this.rpcCall("unsubscribe",l))}}async subscribeMempool(u){const l={event:"mempool"};await this.rpcCall("subscribe",l);const f=p=>{u(p)};return this.eventEmitter.addListener("mempool",f),{unsubscribe:()=>(this.eventEmitter.removeListener("mempool",f),this.rpcCall("unsubscribe",l))}}async subscribeTxUpdates(u,l){const f={event:"tx_update",tx_id:u},p=await this.rpcCall("subscribe",f),m=y=>{y.tx_id===p.tx_id&&l(y)};return this.eventEmitter.addListener("txUpdate",m),{unsubscribe:()=>(this.eventEmitter.removeListener("txUpdate",m),this.rpcCall("unsubscribe",f))}}async subscribeAddressTransactions(u,l){const f={event:"address_tx_update",address:u},p=await this.rpcCall("subscribe",f),m=y=>{y.address===p.address&&l(y)};return this.eventEmitter.addListener("addressTxUpdate",m),{unsubscribe:()=>(this.eventEmitter.removeListener("addressTxUpdate",m),this.rpcCall("unsubscribe",f))}}async subscribeAddressBalanceUpdates(u,l){const f={event:"address_balance_update",address:u},p=await this.rpcCall("subscribe",f),m=y=>{y.address===p.address&&l(y)};return this.eventEmitter.addListener("addressBalanceUpdate",m),{unsubscribe:()=>(this.eventEmitter.removeListener("addressBalanceUpdate",m),this.rpcCall("unsubscribe",f))}}async subscribeNftEventUpdates(u){const l={event:"nft_event"};await this.rpcCall("subscribe",l);const f=p=>{u(p)};return this.eventEmitter.addListener("nftEventUpdate",f),{unsubscribe:()=>(this.eventEmitter.removeListener("nftEventUpdate",f),this.rpcCall("unsubscribe",l))}}async subscribeNftAssetEventUpdates(u,l,f){const p={event:"nft_asset_event",asset_identifier:u,value:l},m=await this.rpcCall("subscribe",p),y=w=>{w.asset_identifier===m.asset_identifier&&w.value.hex===m.value&&f(w)};return this.eventEmitter.addListener("nftAssetEventUpdate",y),{unsubscribe:()=>(this.eventEmitter.removeListener("nftAssetEventUpdate",y),this.rpcCall("unsubscribe",p))}}async subscribeNftCollectionEventUpdates(u,l){const f={event:"nft_collection_event",asset_identifier:u},p=await this.rpcCall("subscribe",f),m=y=>{y.asset_identifier===p.asset_identifier&&l(y)};return this.eventEmitter.addListener("nftCollectionEventUpdate",m),{unsubscribe:()=>(this.eventEmitter.removeListener("nftCollectionEventUpdate",m),this.rpcCall("unsubscribe",f))}}}Rd.StacksApiWebSocketClient=r;async function i(a=n.BASE_PATH){return r.connect(a)}Rd.connectWebSocketClient=i;function o(){return typeof WebSocket<"u"?WebSocket:typeof Yd<"u"&&Yd.WebSocket?Yd.WebSocket:typeof window<"u"&&window.WebSocket?window.WebSocket:typeof self<"u"&&self.WebSocket?self.WebSocket:iz()}return Rd}var gm={},jm={exports:{}},Td={},Vv={},Od={},ym={},gu={},Nd={},wi={},s0={},yu={},sA;function bP(){if(sA)return yu;sA=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.ERROR_PACKET=yu.PACKET_TYPES_REVERSE=yu.PACKET_TYPES=void 0;const e=Object.create(null);yu.PACKET_TYPES=e,e.open="0",e.close="1",e.ping="2",e.pong="3",e.message="4",e.upgrade="5",e.noop="6";const t=Object.create(null);yu.PACKET_TYPES_REVERSE=t,Object.keys(e).forEach(r=>{t[e[r]]=r});const n={type:"error",data:"parser error"};return yu.ERROR_PACKET=n,yu}var aA;function sz(){if(aA)return s0;aA=1,Object.defineProperty(s0,"__esModule",{value:!0});const e=bP(),t=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",n=typeof ArrayBuffer=="function",r=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a&&a.buffer instanceof ArrayBuffer,i=({type:a,data:u},l,f)=>t&&u instanceof Blob?l?f(u):o(u,f):n&&(u instanceof ArrayBuffer||r(u))?l?f(u):o(new Blob([u]),f):f(e.PACKET_TYPES[a]+(u||"")),o=(a,u)=>{const l=new FileReader;return l.onload=function(){const f=l.result.split(",")[1];u("b"+(f||""))},l.readAsDataURL(a)};return s0.default=i,s0}var a0={},Cd={},cA;function az(){if(cA)return Cd;cA=1,Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.decode=Cd.encode=void 0;const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let i=0;i{let o=new Uint8Array(i),a,u=o.length,l="";for(a=0;a>2],l+=e[(o[a]&3)<<4|o[a+1]>>4],l+=e[(o[a+1]&15)<<2|o[a+2]>>6],l+=e[o[a+2]&63];return u%3===2?l=l.substring(0,l.length-1)+"=":u%3===1&&(l=l.substring(0,l.length-2)+"=="),l};Cd.encode=n;const r=i=>{let o=i.length*.75,a=i.length,u,l=0,f,p,m,y;i[i.length-1]==="="&&(o--,i[i.length-2]==="="&&o--);const w=new ArrayBuffer(o),b=new Uint8Array(w);for(u=0;u>4,b[l++]=(p&15)<<4|m>>2,b[l++]=(m&3)<<6|y&63;return w};return Cd.decode=r,Cd}var uA;function cz(){if(uA)return a0;uA=1,Object.defineProperty(a0,"__esModule",{value:!0});const e=bP(),t=az(),n=typeof ArrayBuffer=="function",r=(a,u)=>{if(typeof a!="string")return{type:"message",data:o(a,u)};const l=a.charAt(0);return l==="b"?{type:"message",data:i(a.substring(1),u)}:e.PACKET_TYPES_REVERSE[l]?a.length>1?{type:e.PACKET_TYPES_REVERSE[l],data:a.substring(1)}:{type:e.PACKET_TYPES_REVERSE[l]}:e.ERROR_PACKET},i=(a,u)=>{if(n){const l=(0,t.decode)(a);return o(l,u)}else return{base64:!0,data:a}},o=(a,u)=>{switch(u){case"blob":return a instanceof ArrayBuffer?new Blob([a]):a;case"arraybuffer":default:return a}};return a0.default=r,a0}var lA;function qw(){if(lA)return wi;lA=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.decodePayload=wi.decodePacket=wi.encodePayload=wi.encodePacket=wi.protocol=void 0;const e=sz();wi.encodePacket=e.default;const t=cz();wi.decodePacket=t.default;const n="",r=(o,a)=>{const u=o.length,l=new Array(u);let f=0;o.forEach((p,m)=>{(0,e.default)(p,!1,y=>{l[m]=y,++f===u&&a(l.join(n))})})};wi.encodePayload=r;const i=(o,a)=>{const u=o.split(n),l=[];for(let f=0;f(l.hasOwnProperty(m)&&(p[m]=l[m]),p),{})}wu.pick=t;const n=e.globalThisShim.setTimeout,r=e.globalThisShim.clearTimeout;function i(l,f){f.useNativeTimers?(l.setTimeoutFn=n.bind(e.globalThisShim),l.clearTimeoutFn=r.bind(e.globalThisShim)):(l.setTimeoutFn=e.globalThisShim.setTimeout.bind(e.globalThisShim),l.clearTimeoutFn=e.globalThisShim.clearTimeout.bind(e.globalThisShim))}wu.installTimerFunctions=i;const o=1.33;function a(l){return typeof l=="string"?u(l):Math.ceil((l.byteLength||l.size)*o)}wu.byteLength=a;function u(l){let f=0,p=0;for(let m=0,y=l.length;m=57344?p+=3:(m++,p+=4);return p}return wu}var c0={exports:{}},Gv,hA;function dz(){if(hA)return Gv;hA=1;var e=1e3,t=e*60,n=t*60,r=n*24,i=r*7,o=r*365.25;Gv=function(p,m){m=m||{};var y=typeof p;if(y==="string"&&p.length>0)return a(p);if(y==="number"&&isFinite(p))return m.long?l(p):u(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function a(p){if(p=String(p),!(p.length>100)){var m=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(m){var y=parseFloat(m[1]),w=(m[2]||"ms").toLowerCase();switch(w){case"years":case"year":case"yrs":case"yr":case"y":return y*o;case"weeks":case"week":case"w":return y*i;case"days":case"day":case"d":return y*r;case"hours":case"hour":case"hrs":case"hr":case"h":return y*n;case"minutes":case"minute":case"mins":case"min":case"m":return y*t;case"seconds":case"second":case"secs":case"sec":case"s":return y*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function u(p){var m=Math.abs(p);return m>=r?Math.round(p/r)+"d":m>=n?Math.round(p/n)+"h":m>=t?Math.round(p/t)+"m":m>=e?Math.round(p/e)+"s":p+"ms"}function l(p){var m=Math.abs(p);return m>=r?f(p,m,r,"day"):m>=n?f(p,m,n,"hour"):m>=t?f(p,m,t,"minute"):m>=e?f(p,m,e,"second"):p+" ms"}function f(p,m,y,w){var b=m>=y*1.5;return Math.round(p/y)+" "+w+(b?"s":"")}return Gv}var Kv,pA;function fz(){if(pA)return Kv;pA=1;function e(t){r.debug=r,r.default=r,r.coerce=f,r.disable=a,r.enable=o,r.enabled=u,r.humanize=dz(),r.destroy=p,Object.keys(t).forEach(m=>{r[m]=t[m]}),r.names=[],r.skips=[],r.formatters={};function n(m){let y=0;for(let w=0;w{if(U==="%%")return"%";B++;const R=r.formatters[v];if(typeof R=="function"){const C=O[B];U=R.call(N,C),O.splice(B,1),B--}return U}),r.formatArgs.call(N,O),(N.log||r.log).apply(N,O)}return k.namespace=m,k.useColors=r.useColors(),k.color=r.selectColor(m),k.extend=i,k.destroy=r.destroy,Object.defineProperty(k,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(b!==r.namespaces&&(b=r.namespaces,x=r.enabled(m)),x),set:O=>{w=O}}),typeof r.init=="function"&&r.init(k),k}function i(m,y){const w=r(this.namespace+(typeof y>"u"?":":y)+m);return w.log=this.log,w}function o(m){r.save(m),r.namespaces=m,r.names=[],r.skips=[];let y;const w=(typeof m=="string"?m:"").split(/[\s,]+/),b=w.length;for(y=0;y"-"+y)].join(",");return r.enable(""),m}function u(m){if(m[m.length-1]==="*")return!0;let y,w;for(y=0,w=r.skips.length;y{let f=!1;return()=>{f||(f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;f.splice(1,0,p,"color: inherit");let m=0,y=0;f[0].replace(/%[a-zA-Z%]/g,w=>{w!=="%%"&&(m++,w==="%c"&&(y=m))}),f.splice(y,0,p)}t.log=console.debug||console.log||(()=>{});function o(f){try{f?t.storage.setItem("debug",f):t.storage.removeItem("debug")}catch{}}function a(){let f;try{f=t.storage.getItem("debug")}catch{}return!f&&typeof process<"u"&&"env"in process&&(f=n.DEBUG),f}function u(){try{return localStorage}catch{}}e.exports=fz()(t);const{formatters:l}=e.exports;l.j=function(f){try{return JSON.stringify(f)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}}(c0,c0.exports)),c0.exports}var gA;function I_(){if(gA)return Nd;gA=1;var e=Nd&&Nd.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.Transport=void 0;const t=qw(),n=rp,r=Ng(),o=(0,e(qu()).default)("engine.io-client:transport");class a extends Error{constructor(f,p,m){super(f),this.description=p,this.context=m,this.type="TransportError"}}class u extends n.Emitter{constructor(f){super(),this.writable=!1,(0,r.installTimerFunctions)(this,f),this.opts=f,this.query=f.query,this.socket=f.socket}onError(f,p,m){return super.emitReserved("error",new a(f,p,m)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(f){this.readyState==="open"?this.write(f):o("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(f){const p=(0,t.decodePacket)(f,this.socket.binaryType);this.onPacket(p)}onPacket(f){super.emitReserved("packet",f)}onClose(f){this.readyState="closed",super.emitReserved("close",f)}pause(f){}}return Nd.Transport=u,Nd}var bu={},yA;function SP(){if(yA)return bu;yA=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.yeast=bu.decode=bu.encode=void 0;const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),t=64,n={};let r=0,i=0,o;function a(f){let p="";do p=e[f%t]+p,f=Math.floor(f/t);while(f>0);return p}bu.encode=a;function u(f){let p=0;for(i=0;i{p("paused"),this.readyState="paused",O()};if(this.polling||!this.writable){let E=0;this.polling&&(p("we are currently polling - waiting to pause"),E++,this.once("pollComplete",function(){p("pre-pause polling complete"),--E||N()})),this.writable||(p("we are currently writing - waiting to pause"),E++,this.once("drain",function(){p("pre-pause writing complete"),--E||N()}))}else N()}poll(){p("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(O){p("polling got data %s",O);const N=E=>{if(this.readyState==="opening"&&E.type==="open"&&this.onOpen(),E.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(E)};(0,o.decodePayload)(O,this.socket.binaryType).forEach(N),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():p('ignoring poll - transport state "%s"',this.readyState))}doClose(){const O=()=>{p("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(p("transport open - closing"),O()):(p("transport not open - deferring close"),this.once("open",O))}write(O){this.writable=!1,(0,o.encodePayload)(O,N=>{this.doWrite(N,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let O=this.query||{};const N=this.opts.secure?"https":"http";let E="";this.opts.timestampRequests!==!1&&(O[this.opts.timestampParam]=(0,r.yeast)()),!this.supportsBinary&&!O.sid&&(O.b64=1),this.opts.port&&(N==="https"&&Number(this.opts.port)!==443||N==="http"&&Number(this.opts.port)!==80)&&(E=":"+this.opts.port);const T=(0,i.encode)(O),B=this.opts.hostname.indexOf(":")!==-1;return N+"://"+(B?"["+this.opts.hostname+"]":this.opts.hostname)+E+this.opts.path+(T.length?"?"+T:"")}request(O={}){return Object.assign(O,{xd:this.xd,xs:this.xs},this.opts),new b(this.uri(),O)}doWrite(O,N){const E=this.request({method:"POST",data:O});E.on("success",N),E.on("error",(T,B)=>{this.onError("xhr post error",T,B)})}doPoll(){p("xhr poll");const O=this.request();O.on("data",this.onData.bind(this)),O.on("error",(N,E)=>{this.onError("xhr poll error",N,E)}),this.pollXhr=O}}gu.Polling=w;class b extends u.Emitter{constructor(O,N){super(),(0,l.installTimerFunctions)(this,N),this.opts=N,this.method=N.method||"GET",this.uri=O,this.async=N.async!==!1,this.data=N.data!==void 0?N.data:null,this.create()}create(){const O=(0,l.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");O.xdomain=!!this.opts.xd,O.xscheme=!!this.opts.xs;const N=this.xhr=new a.XHR(O);try{p("xhr open %s: %s",this.method,this.uri),N.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){N.setDisableHeaderCheck&&N.setDisableHeaderCheck(!0);for(let E in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(E)&&N.setRequestHeader(E,this.opts.extraHeaders[E])}}catch{}if(this.method==="POST")try{N.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{N.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in N&&(N.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(N.timeout=this.opts.requestTimeout),N.onreadystatechange=()=>{N.readyState===4&&(N.status===200||N.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof N.status=="number"?N.status:0)},0))},p("xhr data %s",this.data),N.send(this.data)}catch(E){this.setTimeoutFn(()=>{this.onError(E)},0);return}typeof document<"u"&&(this.index=b.requestsCount++,b.requests[this.index]=this)}onError(O){this.emitReserved("error",O,this.xhr),this.cleanup(!0)}cleanup(O){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=m,O)try{this.xhr.abort()}catch{}typeof document<"u"&&delete b.requests[this.index],this.xhr=null}}onLoad(){const O=this.xhr.responseText;O!==null&&(this.emitReserved("data",O),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(gu.Request=b,b.requestsCount=0,b.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",x);else if(typeof addEventListener=="function"){const k="onpagehide"in f.globalThisShim?"pagehide":"unload";addEventListener(k,x,!1)}}function x(){for(let k in b.requests)b.requests.hasOwnProperty(k)&&b.requests[k].abort()}return gu}var Ad={},wo={},xA;function vP(){if(xA)return wo;xA=1,Object.defineProperty(wo,"__esModule",{value:!0}),wo.defaultBinaryType=wo.usingBrowserWebSocket=wo.WebSocket=wo.nextTick=void 0;const e=Uw();return wo.nextTick=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,r)=>r(n,0),wo.WebSocket=e.globalThisShim.WebSocket||e.globalThisShim.MozWebSocket,wo.usingBrowserWebSocket=!0,wo.defaultBinaryType="arraybuffer",wo}var _A;function gz(){if(_A)return Ad;_A=1;var e=Ad&&Ad.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.WS=void 0;const t=I_(),n=P_(),r=SP(),i=Ng(),o=vP(),a=e(qu()),u=qw(),l=(0,a.default)("engine.io-client:websocket"),f=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class p extends t.Transport{constructor(y){super(y),this.supportsBinary=!y.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const y=this.uri(),w=this.opts.protocols,b=f?{}:(0,i.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(b.headers=this.opts.extraHeaders);try{this.ws=o.usingBrowserWebSocket&&!f?w?new o.WebSocket(y,w):new o.WebSocket(y):new o.WebSocket(y,w,b)}catch(x){return this.emitReserved("error",x)}this.ws.binaryType=this.socket.binaryType||o.defaultBinaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=y=>this.onClose({description:"websocket connection closed",context:y}),this.ws.onmessage=y=>this.onData(y.data),this.ws.onerror=y=>this.onError("websocket error",y)}write(y){this.writable=!1;for(let w=0;w{const O={};o.usingBrowserWebSocket||(b.options&&(O.compress=b.options.compress),this.opts.perMessageDeflate&&(typeof k=="string"?Buffer.byteLength(k):k.length){this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let y=this.query||{};const w=this.opts.secure?"wss":"ws";let b="";this.opts.port&&(w==="wss"&&Number(this.opts.port)!==443||w==="ws"&&Number(this.opts.port)!==80)&&(b=":"+this.opts.port),this.opts.timestampRequests&&(y[this.opts.timestampParam]=(0,r.yeast)()),this.supportsBinary||(y.b64=1);const x=(0,n.encode)(y),k=this.opts.hostname.indexOf(":")!==-1;return w+"://"+(k?"["+this.opts.hostname+"]":this.opts.hostname)+b+this.opts.path+(x.length?"?"+x:"")}check(){return!!o.WebSocket}}return Ad.WS=p,Ad}var kA;function xP(){if(kA)return ym;kA=1,Object.defineProperty(ym,"__esModule",{value:!0}),ym.transports=void 0;const e=mz(),t=gz();return ym.transports={websocket:t.WS,polling:e.Polling},ym}var vm={},RA;function _P(){if(RA)return vm;RA=1,Object.defineProperty(vm,"__esModule",{value:!0}),vm.parse=void 0;const e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,t=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function n(o){const a=o,u=o.indexOf("["),l=o.indexOf("]");u!=-1&&l!=-1&&(o=o.substring(0,u)+o.substring(u,l).replace(/:/g,";")+o.substring(l,o.length));let f=e.exec(o||""),p={},m=14;for(;m--;)p[t[m]]=f[m]||"";return u!=-1&&l!=-1&&(p.source=a,p.host=p.host.substring(1,p.host.length-1).replace(/;/g,":"),p.authority=p.authority.replace("[","").replace("]","").replace(/;/g,":"),p.ipv6uri=!0),p.pathNames=r(p,p.path),p.queryKey=i(p,p.query),p}vm.parse=n;function r(o,a){const u=/\/{2,9}/g,l=a.replace(u,"/").split("/");return(a.slice(0,1)=="/"||a.length===0)&&l.splice(0,1),a.slice(-1)=="/"&&l.splice(l.length-1,1),l}function i(o,a){const u={};return a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(l,f,p){f&&(u[f]=p)}),u}return vm}var TA;function yz(){if(TA)return Od;TA=1;var e=Od&&Od.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Od,"__esModule",{value:!0}),Od.Socket=void 0;const t=xP(),n=Ng(),r=P_(),i=_P(),o=e(qu()),a=rp,u=qw(),l=(0,o.default)("engine.io-client:socket");class f extends a.Emitter{constructor(m,y={}){super(),this.writeBuffer=[],m&&typeof m=="object"&&(y=m,m=null),m?(m=(0,i.parse)(m),y.hostname=m.host,y.secure=m.protocol==="https"||m.protocol==="wss",y.port=m.port,m.query&&(y.query=m.query)):y.host&&(y.hostname=(0,i.parse)(y.host).host),(0,n.installTimerFunctions)(this,y),this.secure=y.secure!=null?y.secure:typeof location<"u"&&location.protocol==="https:",y.hostname&&!y.port&&(y.port=this.secure?"443":"80"),this.hostname=y.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=y.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=y.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},y),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,r.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(m){l('creating transport "%s"',m);const y=Object.assign({},this.opts.query);y.EIO=u.protocol,y.transport=m,this.id&&(y.sid=this.id);const w=Object.assign({},this.opts.transportOptions[m],this.opts,{query:y,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return l("options: %j",w),new t.transports[m](w)}open(){let m;if(this.opts.rememberUpgrade&&f.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)m="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else m=this.transports[0];this.readyState="opening";try{m=this.createTransport(m)}catch(y){l("error while creating transport: %s",y),this.transports.shift(),this.open();return}m.open(),this.setTransport(m)}setTransport(m){l("setting transport %s",m.name),this.transport&&(l("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=m,m.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",y=>this.onClose("transport close",y))}probe(m){l('probing transport "%s"',m);let y=this.createTransport(m),w=!1;f.priorWebsocketSuccess=!1;const b=()=>{w||(l('probe transport "%s" opened',m),y.send([{type:"ping",data:"probe"}]),y.once("packet",B=>{if(!w)if(B.type==="pong"&&B.data==="probe"){if(l('probe transport "%s" pong',m),this.upgrading=!0,this.emitReserved("upgrading",y),!y)return;f.priorWebsocketSuccess=y.name==="websocket",l('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{w||this.readyState!=="closed"&&(l("changing transport and sending upgrade packet"),T(),this.setTransport(y),y.send([{type:"upgrade"}]),this.emitReserved("upgrade",y),y=null,this.upgrading=!1,this.flush())})}else{l('probe transport "%s" failed',m);const A=new Error("probe error");A.transport=y.name,this.emitReserved("upgradeError",A)}}))};function x(){w||(w=!0,T(),y.close(),y=null)}const k=B=>{const A=new Error("probe error: "+B);A.transport=y.name,x(),l('probe transport "%s" failed because of error: %s',m,B),this.emitReserved("upgradeError",A)};function O(){k("transport closed")}function N(){k("socket closed")}function E(B){y&&B.name!==y.name&&(l('"%s" works - aborting "%s"',B.name,y.name),x())}const T=()=>{y.removeListener("open",b),y.removeListener("error",k),y.removeListener("close",O),this.off("close",N),this.off("upgrading",E)};y.once("open",b),y.once("error",k),y.once("close",O),this.once("close",N),this.once("upgrading",E),y.open()}onOpen(){if(l("socket open"),this.readyState="open",f.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){l("starting upgrade probes");let m=0;const y=this.upgrades.length;for(;m{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const m=this.getWritablePackets();l("flushing %d packets in socket",m.length),this.transport.send(m),this.prevBufferLen=m.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let y=1;for(let w=0;w0&&y>this.maxPayload)return l("only send %d out of %d packets",w,this.writeBuffer.length),this.writeBuffer.slice(0,w);y+=2}return l("payload size is %d (max: %d)",y,this.maxPayload),this.writeBuffer}write(m,y,w){return this.sendPacket("message",m,y,w),this}send(m,y,w){return this.sendPacket("message",m,y,w),this}sendPacket(m,y,w,b){if(typeof y=="function"&&(b=y,y=void 0),typeof w=="function"&&(b=w,w=null),this.readyState==="closing"||this.readyState==="closed")return;w=w||{},w.compress=w.compress!==!1;const x={type:m,data:y,options:w};this.emitReserved("packetCreate",x),this.writeBuffer.push(x),b&&this.once("flush",b),this.flush()}close(){const m=()=>{this.onClose("forced close"),l("socket closing - telling transport to close"),this.transport.close()},y=()=>{this.off("upgrade",y),this.off("upgradeError",y),m()},w=()=>{this.once("upgrade",y),this.once("upgradeError",y)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?w():m()}):this.upgrading?w():m()),this}onError(m){l("socket error %j",m),f.priorWebsocketSuccess=!1,this.emitReserved("error",m),this.onClose("transport error",m)}onClose(m,y){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(l('socket close with reason: "%s"',m),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",m,y),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(m){const y=[];let w=0;const b=m.length;for(;wtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(u):u.buffer instanceof ArrayBuffer,n=Object.prototype.toString,r=typeof Blob=="function"||typeof Blob<"u"&&n.call(Blob)==="[object BlobConstructor]",i=typeof File=="function"||typeof File<"u"&&n.call(File)==="[object FileConstructor]";function o(u){return e&&(u instanceof ArrayBuffer||t(u))||r&&u instanceof Blob||i&&u instanceof File}Pd.isBinary=o;function a(u,l){if(!u||typeof u!="object")return!1;if(Array.isArray(u)){for(let f=0,p=u.length;f=0&&o.num{delete this.acks[f];for(let b=0;b{this.io.clearTimeoutFn(w),p.apply(this,[null,...b])}}emitWithAck(f,...p){const m=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((y,w)=>{p.push((b,x)=>m?b?w(b):y(x):y(b)),this.emit(f,...p)})}_addToQueue(f){let p;typeof f[f.length-1]=="function"&&(p=f.pop());const m={id:this._queueSeq++,tryCount:0,pending:!1,args:f,flags:Object.assign({fromQueue:!0},this.flags)};f.push((y,...w)=>m!==this._queue[0]?void 0:(y!==null?m.tryCount>this._opts.retries&&(o("packet [%d] is discarded after %d tries",m.id,m.tryCount),this._queue.shift(),p&&p(y)):(o("packet [%d] was successfully sent",m.id),this._queue.shift(),p&&p(null,...w)),m.pending=!1,this._drainQueue())),this._queue.push(m),this._drainQueue()}_drainQueue(f=!1){if(o("draining queue"),!this.connected||this._queue.length===0)return;const p=this._queue[0];if(p.pending&&!f){o("packet [%d] has already been sent and is waiting for an ack",p.id);return}p.pending=!0,p.tryCount++,o("sending packet [%d] (try n°%d)",p.id,p.tryCount),this.flags=p.flags,this.emit.apply(this,p.args)}packet(f){f.nsp=this.nsp,this.io._packet(f)}onopen(){o("transport is open - connecting"),typeof this.auth=="function"?this.auth(f=>{this._sendConnectPacket(f)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(f){this.packet({type:t.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},f):f})}onerror(f){this.connected||this.emitReserved("connect_error",f)}onclose(f,p){o("close (%s)",f),this.connected=!1,delete this.id,this.emitReserved("disconnect",f,p)}onpacket(f){if(f.nsp===this.nsp)switch(f.type){case t.PacketType.CONNECT:f.data&&f.data.sid?this.onconnect(f.data.sid,f.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case t.PacketType.EVENT:case t.PacketType.BINARY_EVENT:this.onevent(f);break;case t.PacketType.ACK:case t.PacketType.BINARY_ACK:this.onack(f);break;case t.PacketType.DISCONNECT:this.ondisconnect();break;case t.PacketType.CONNECT_ERROR:this.destroy();const m=new Error(f.data.message);m.data=f.data.data,this.emitReserved("connect_error",m);break}}onevent(f){const p=f.data||[];o("emitting event %j",p),f.id!=null&&(o("attaching ack callback to event"),p.push(this.ack(f.id))),this.connected?this.emitEvent(p):this.receiveBuffer.push(Object.freeze(p))}emitEvent(f){if(this._anyListeners&&this._anyListeners.length){const p=this._anyListeners.slice();for(const m of p)m.apply(this,f)}super.emit.apply(this,f),this._pid&&f.length&&typeof f[f.length-1]=="string"&&(this._lastOffset=f[f.length-1])}ack(f){const p=this;let m=!1;return function(...y){m||(m=!0,o("sending ack %j",y),p.packet({type:t.PacketType.ACK,id:f,data:y}))}}onack(f){const p=this.acks[f.id];typeof p=="function"?(o("calling ack %s with %j",f.id,f.data),p.apply(this,f.data),delete this.acks[f.id]):o("bad ack %s",f.id)}onconnect(f,p){o("socket connected with id %s",f),this.id=f,this.recovered=p&&this._pid===p,this._pid=p,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(f=>this.emitEvent(f)),this.receiveBuffer=[],this.sendBuffer.forEach(f=>{this.notifyOutgoingListeners(f),this.packet(f)}),this.sendBuffer=[]}ondisconnect(){o("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(f=>f()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(o("performing disconnect (%s)",this.nsp),this.packet({type:t.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(f){return this.flags.compress=f,this}get volatile(){return this.flags.volatile=!0,this}timeout(f){return this.flags.timeout=f,this}onAny(f){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(f),this}prependAny(f){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(f),this}offAny(f){if(!this._anyListeners)return this;if(f){const p=this._anyListeners;for(let m=0;m0&&t.jitter<=1?t.jitter:0,this.attempts=0}return _m.Backoff=e,e.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),r=Math.floor(n*this.jitter*t);t=Math.floor(n*10)&1?t+r:t-r}return Math.min(t,this.max)|0},e.prototype.reset=function(){this.attempts=0},e.prototype.setMin=function(t){this.ms=t},e.prototype.setMax=function(t){this.max=t},e.prototype.setJitter=function(t){this.jitter=t},_m}var MA;function vz(){if(MA)return bi;MA=1;var e=bi&&bi.__createBinding||(Object.create?function(w,b,x,k){k===void 0&&(k=x),Object.defineProperty(w,k,{enumerable:!0,get:function(){return b[x]}})}:function(w,b,x,k){k===void 0&&(k=x),w[k]=b[x]}),t=bi&&bi.__setModuleDefault||(Object.create?function(w,b){Object.defineProperty(w,"default",{enumerable:!0,value:b})}:function(w,b){w.default=b}),n=bi&&bi.__importStar||function(w){if(w&&w.__esModule)return w;var b={};if(w!=null)for(var x in w)x!=="default"&&Object.prototype.hasOwnProperty.call(w,x)&&e(b,w,x);return t(b,w),b},r=bi&&bi.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(bi,"__esModule",{value:!0}),bi.Manager=void 0;const i=kP(),o=OP(),a=n(M_()),u=TP(),l=Sz(),f=rp,m=r(qu()).default("socket.io-client:manager");class y extends f.Emitter{constructor(b,x){var k;super(),this.nsps={},this.subs=[],b&&typeof b=="object"&&(x=b,b=void 0),x=x||{},x.path=x.path||"/socket.io",this.opts=x,i.installTimerFunctions(this,x),this.reconnection(x.reconnection!==!1),this.reconnectionAttempts(x.reconnectionAttempts||1/0),this.reconnectionDelay(x.reconnectionDelay||1e3),this.reconnectionDelayMax(x.reconnectionDelayMax||5e3),this.randomizationFactor((k=x.randomizationFactor)!==null&&k!==void 0?k:.5),this.backoff=new l.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(x.timeout==null?2e4:x.timeout),this._readyState="closed",this.uri=b;const O=x.parser||a;this.encoder=new O.Encoder,this.decoder=new O.Decoder,this._autoConnect=x.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(b){return arguments.length?(this._reconnection=!!b,this):this._reconnection}reconnectionAttempts(b){return b===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=b,this)}reconnectionDelay(b){var x;return b===void 0?this._reconnectionDelay:(this._reconnectionDelay=b,(x=this.backoff)===null||x===void 0||x.setMin(b),this)}randomizationFactor(b){var x;return b===void 0?this._randomizationFactor:(this._randomizationFactor=b,(x=this.backoff)===null||x===void 0||x.setJitter(b),this)}reconnectionDelayMax(b){var x;return b===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=b,(x=this.backoff)===null||x===void 0||x.setMax(b),this)}timeout(b){return arguments.length?(this._timeout=b,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(b){if(m("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;m("opening %s",this.uri),this.engine=new i.Socket(this.uri,this.opts);const x=this.engine,k=this;this._readyState="opening",this.skipReconnect=!1;const O=u.on(x,"open",function(){k.onopen(),b&&b()}),N=u.on(x,"error",E=>{m("error"),k.cleanup(),k._readyState="closed",this.emitReserved("error",E),b?b(E):k.maybeReconnectOnOpen()});if(this._timeout!==!1){const E=this._timeout;m("connect attempt will timeout after %d",E),E===0&&O();const T=this.setTimeoutFn(()=>{m("connect attempt timed out after %d",E),O(),x.close(),x.emit("error",new Error("timeout"))},E);this.opts.autoUnref&&T.unref(),this.subs.push(function(){clearTimeout(T)})}return this.subs.push(O),this.subs.push(N),this}connect(b){return this.open(b)}onopen(){m("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const b=this.engine;this.subs.push(u.on(b,"ping",this.onping.bind(this)),u.on(b,"data",this.ondata.bind(this)),u.on(b,"error",this.onerror.bind(this)),u.on(b,"close",this.onclose.bind(this)),u.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(b){try{this.decoder.add(b)}catch(x){this.onclose("parse error",x)}}ondecoded(b){i.nextTick(()=>{this.emitReserved("packet",b)},this.setTimeoutFn)}onerror(b){m("error",b),this.emitReserved("error",b)}socket(b,x){let k=this.nsps[b];return k?this._autoConnect&&!k.active&&k.connect():(k=new o.Socket(this,b,x),this.nsps[b]=k),k}_destroy(b){const x=Object.keys(this.nsps);for(const k of x)if(this.nsps[k].active){m("socket %s is still active, skipping close",k);return}this._close()}_packet(b){m("writing packet %j",b);const x=this.encoder.encode(b);for(let k=0;kb()),this.subs.length=0,this.decoder.destroy()}_close(){m("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(b,x){m("closed due to %s",b),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",b,x),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const b=this;if(this.backoff.attempts>=this._reconnectionAttempts)m("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const x=this.backoff.duration();m("will wait %dms before reconnect attempt",x),this._reconnecting=!0;const k=this.setTimeoutFn(()=>{b.skipReconnect||(m("attempting reconnect"),this.emitReserved("reconnect_attempt",b.backoff.attempts),!b.skipReconnect&&b.open(O=>{O?(m("reconnect attempt error"),b._reconnecting=!1,b.reconnect(),this.emitReserved("reconnect_error",O)):(m("reconnect success"),b.onreconnect())}))},x);this.opts.autoUnref&&k.unref(),this.subs.push(function(){clearTimeout(k)})}}onreconnect(){const b=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",b)}}return bi.Manager=y,bi}var LA=jm.exports,BA;function xz(){return BA||(BA=1,function(e,t){var n=LA&&LA.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const r=wz(),i=vz();Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return i.Manager}});const o=OP();Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return o.Socket}});const u=n(qu()).default("socket.io-client"),l={};function f(m,y){typeof m=="object"&&(y=m,m=void 0),y=y||{};const w=r.url(m,y.path||"/socket.io"),b=w.source,x=w.id,k=w.path,O=l[x]&&k in l[x].nsps,N=y.forceNew||y["force new connection"]||y.multiplex===!1||O;let E;return N?(u("ignoring socket cache for %s",b),E=new i.Manager(b,y)):(l[x]||(u("new io instance for %s",b),l[x]=new i.Manager(b,y)),E=l[x]),w.query&&!y.query&&(y.query=w.queryKey),E.socket(w.path,y)}t.io=f,t.connect=f,t.default=f,Object.assign(f,{Manager:i.Manager,Socket:o.Socket,io:f,connect:f});var p=M_();Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return p.protocol}}),e.exports=f}(jm,jm.exports)),jm.exports}var jA;function _z(){if(jA)return gm;jA=1,Object.defineProperty(gm,"__esModule",{value:!0}),gm.StacksApiSocketClient=void 0;const e=xz(),t=Ie();function n(i){let o;try{if(o=new URL(i),!o.protocol||!o.host)throw new TypeError(`[ERR_INVALID_URL]: Invalid URL: ${i}`)}catch(a){throw console.error('Pass an absolute URL with a protocol/schema, e.g. "wss://example.com"'),a}return o}class r{constructor(o){this.socket=o}static connect({url:o=t.BASE_PATH,subscriptions:a=[]}={}){const u=(0,e.io)(n(o).href,{query:{subscriptions:Array.from(new Set(a)).join(",")}});return new r(u)}handleSubscription(o,a=!1){var u,l;const f=new Set((l=(u=this.socket.io.opts.query)===null||u===void 0?void 0:u.subscriptions.split(","))!==null&&l!==void 0?l:[]);return a?(this.socket.emit("subscribe",o,p=>{p&&console.error(`Error subscribing: ${p}`)}),f.add(o)):(this.socket.emit("unsubscribe",o),f.delete(o)),this.socket.io.opts.query===void 0&&(this.socket.io.opts.query={}),this.socket.io.opts.query.subscriptions=Array.from(f).join(","),{unsubscribe:()=>{this.handleSubscription(o,!1)}}}subscribeBlocks(){return this.handleSubscription("block",!0)}unsubscribeBlocks(){this.handleSubscription("block",!1)}subscribeMicroblocks(){return this.handleSubscription("microblock",!0)}unsubscribeMicroblocks(){this.handleSubscription("microblock",!1)}subscribeMempool(){return this.handleSubscription("mempool",!0)}unsubscribeMempool(){this.handleSubscription("mempool",!1)}subscribeAddressTransactions(o){return this.handleSubscription(`address-transaction:${o}`,!0)}unsubscribeAddressTransactions(o){this.handleSubscription(`address-transaction:${o}`,!1)}subscribeAddressStxBalance(o){return this.handleSubscription(`address-stx-balance:${o}`,!0)}unsubscribeAddressStxBalance(o){this.handleSubscription(`address-stx-balance:${o}`,!1)}subscribeTransaction(o){return this.handleSubscription(`transaction:${o}`,!0)}unsubscribeTransaction(o){this.handleSubscription(`transaction:${o}`,!1)}subscribeNftEvent(){return this.handleSubscription("nft-event",!0)}unsubscribeNftEvent(){this.handleSubscription("nft-event",!1)}subscribeNftAssetEvent(o,a){return this.handleSubscription(`nft-asset-event:${o}+${a}`,!0)}unsubscribeNftAssetEvent(o,a){this.handleSubscription(`nft-asset-event:${o}+${a}`,!1)}subscribeNftCollectionEvent(o){return this.handleSubscription(`nft-collection-event:${o}`,!0)}unsubscribeNftCollectionEvent(o){this.handleSubscription(`nft-collection-event:${o}`,!1)}logEvents(){this.socket.on("connect",()=>console.log("socket connected")),this.socket.on("disconnect",o=>console.warn("disconnected",o)),this.socket.on("connect_error",o=>console.error("connect_error",o)),this.socket.on("block",o=>console.log("block",o)),this.socket.on("microblock",o=>console.log("microblock",o)),this.socket.on("mempool",o=>console.log("mempool",o)),this.socket.on("address-transaction",(o,a)=>console.log("address-transaction",o,a)),this.socket.on("address-stx-balance",(o,a)=>console.log("address-stx-balance",o,a)),this.socket.on("nft-event",o=>console.log("nft-event",o)),this.socket.on("nft-asset-event",(o,a,u)=>console.log("nft-asset-event",o,a,u)),this.socket.on("nft-collection-event",(o,a)=>console.log("nft-collection-event",o,a))}}return gm.StacksApiSocketClient=r,gm}var DA;function kz(){return DA||(DA=1,function(e){var t=vd&&vd.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(i,o);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,a,u)}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=vd&&vd.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(YH(),e),n(oz(),e),n(_z(),e)}(vd)),vd}var rr=kz(),dn;(function(e){e[e.Mainnet=1]="Mainnet",e[e.Testnet=2147483648]="Testnet"})(dn||(dn={}));var tw;(function(e){e[e.Mainnet=385875968]="Mainnet",e[e.Testnet=4278190080]="Testnet"})(tw||(tw={}));dn.Mainnet;var Ni;(function(e){e[e.Mainnet=0]="Mainnet",e[e.Testnet=128]="Testnet"})(Ni||(Ni={}));var Ao;(function(e){e[e.MainnetSingleSig=22]="MainnetSingleSig",e[e.MainnetMultiSig=20]="MainnetMultiSig",e[e.TestnetSingleSig=26]="TestnetSingleSig",e[e.TestnetMultiSig=21]="TestnetMultiSig"})(Ao||(Ao={}));Ni.Mainnet;function Rz(e){return t=>t[e]}const Tz={network:{layer1:"placeholder"},logLevel:"debug"},bf={MISSING_PARAMETER:"missing_parameter",REMOTE_SERVICE_ERROR:"remote_service_error",INVALID_STATE:"invalid_state",NO_SESSION_DATA:"no_session_data",DOES_NOT_EXIST:"does_not_exist",FAILED_DECRYPTION_ERROR:"failed_decryption_error",INVALID_DID_ERROR:"invalid_did_error",NOT_ENOUGH_FUNDS_ERROR:"not_enough_error",INVALID_AMOUNT_ERROR:"invalid_amount_error",LOGIN_FAILED_ERROR:"login_failed",SIGNATURE_VERIFICATION_ERROR:"signature_verification_failure",CONFLICT_ERROR:"conflict_error",NOT_ENOUGH_PROOF_ERROR:"not_enough_proof_error",BAD_PATH_ERROR:"bad_path_error",VALIDATION_ERROR:"validation_error",PAYLOAD_TOO_LARGE_ERROR:"payload_too_large_error",PRECONDITION_FAILED_ERROR:"precondition_failed_error",UNKNOWN:"unknown"};Object.freeze(bf);class ip extends Error{constructor(t){super();let n=t.message,r=`Error Code: ${t.code}`,i=this.stack;if(i)r+=`Stack Trace: + */var HO;function N7(){if(HO)return Mv;HO=1;var e=_w();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function u(m,y){var w=y(),b=r({inst:{value:w,getSnapshot:y}}),x=b[0].inst,_=b[1];return o(function(){x.value=w,x.getSnapshot=y,l(x)&&_({inst:x})},[m,w,y]),i(function(){return l(x)&&_({inst:x}),m(function(){l(x)&&_({inst:x})})},[m]),a(w),w}function l(m){var y=m.getSnapshot;m=m.value;try{var w=y();return!n(m,w)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Mv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Mv}var zO;function C7(){return zO||(zO=1,Pv.exports=N7()),Pv.exports}var E7=C7();const A7=E7.useSyncExternalStore,WO=$.createContext(void 0),dP=$.createContext(!1);function fP(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=WO),window.ReactQueryClientContext):WO)}const F7=({context:e}={})=>{const t=$.useContext(fP(e,$.useContext(dP)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},I7=({client:e,children:t,context:n,contextSharing:r=!1})=>{$.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=fP(n,r);return $.createElement(dP.Provider,{value:!n&&r},$.createElement(i.Provider,{value:e},t))},hP=$.createContext(!1),P7=()=>$.useContext(hP);hP.Provider;function M7(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const L7=$.createContext(M7()),B7=()=>$.useContext(L7);function j7(e,t){return typeof e=="function"?e(...t):!!e}const D7=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},J7=e=>{$.useEffect(()=>{e.clearReset()},[e])},$7=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&j7(n,[e.error,r]),q7=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},U7=(e,t)=>e.isLoading&&e.isFetching&&!t,H7=(e,t,n)=>(e==null?void 0:e.suspense)&&U7(t,n),z7=(e,t,n)=>t.fetchOptimistic(e).then(({data:r})=>{e.onSuccess==null||e.onSuccess(r),e.onSettled==null||e.onSettled(r,null)}).catch(r=>{n.clearReset(),e.onError==null||e.onError(r),e.onSettled==null||e.onSettled(void 0,r)});function W7(e,t){const n=F7({context:e.context}),r=P7(),i=B7(),o=n.defaultQueryOptions(e);o._optimisticResults=r?"isRestoring":"optimistic",o.onError&&(o.onError=Qn.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=Qn.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=Qn.batchCalls(o.onSettled)),q7(o),D7(o,i),J7(i);const[a]=$.useState(()=>new t(n,o)),u=a.getOptimisticResult(o);if(A7($.useCallback(l=>{const f=r?()=>{}:a.subscribe(Qn.batchCalls(l));return a.updateResult(),f},[a,r]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),$.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),H7(o,u,r))throw z7(o,a,i);if($7({result:u,errorResetBoundary:i,useErrorBoundary:o.useErrorBoundary,query:a.getCurrentQuery()}))throw u.error;return o.notifyOnChangeProps?u:a.trackResult(u)}function yr(e,t,n){const r=Bm(e,t,n);return W7(r,R7)}var vd={},xd={},Lv={},VO;function Ie(){return VO||(VO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextApiResponse=e.BlobApiResponse=e.VoidApiResponse=e.JSONApiResponse=e.canConsumeForm=e.mapValues=e.querystring=e.exists=e.Configuration=e.COLLECTION_FORMATS=e.RequiredError=e.BaseAPI=e.BASE_PATH=void 0,e.BASE_PATH="https://api.mainnet.hiro.so".replace(/\/+$/,"");const t=w=>typeof Blob<"u"&&w instanceof Blob;class n{constructor(b=new i){this.configuration=b,this.fetchApi=async(x,_)=>{let O={url:x,init:_};for(const E of this.middleware)E.pre&&(O=await E.pre(Object.assign({fetch:this.fetchApi},O))||O);let N=await(this.configuration.fetchApi||fetch)(O.url,O.init);for(const E of this.middleware)E.post&&(N=await E.post({fetch:this.fetchApi,url:O.url,init:O.init,response:N.clone()})||N);return N},this.middleware=b.middleware}withMiddleware(...b){const x=this.clone();return x.middleware=x.middleware.concat(...b),x}withPreMiddleware(...b){const x=b.map(_=>({pre:_}));return this.withMiddleware(...x)}withPostMiddleware(...b){const x=b.map(_=>({post:_}));return this.withMiddleware(...x)}async request(b,x){const{url:_,init:O}=this.createFetchParams(b,x),N=await this.fetchApi(_,O);if(N.status>=200&&N.status<300)return N;throw N}createFetchParams(b,x){let _=this.configuration.basePath+b.path;b.query!==void 0&&Object.keys(b.query).length!==0&&(_+="?"+this.configuration.queryParamsStringify(b.query));const O=typeof FormData<"u"&&b.body instanceof FormData||b.body instanceof URLSearchParams||t(b.body)?b.body:JSON.stringify(b.body),N=Object.assign({},this.configuration.headers,b.headers),E=Object.assign({method:b.method,headers:N,body:O,credentials:this.configuration.credentials},x);return{url:_,init:E}}clone(){const b=this.constructor,x=new b(this.configuration);return x.middleware=this.middleware.slice(),x}}e.BaseAPI=n;class r extends Error{constructor(b,x){super(x),this.field=b,this.name="RequiredError"}}e.RequiredError=r,e.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:" ",pipes:"|"};class i{constructor(b={}){this.configuration=b}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:e.BASE_PATH}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||a}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const b=this.configuration.apiKey;if(b)return typeof b=="function"?b:()=>b}get accessToken(){const b=this.configuration.accessToken;if(b)return typeof b=="function"?b:async()=>b}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}e.Configuration=i;function o(w,b){const x=w[b];return x!=null}e.exists=o;function a(w,b=""){return Object.keys(w).map(x=>{const _=b+(b.length?`[${x}]`:x),O=w[x];if(O instanceof Array){const N=O.map(E=>encodeURIComponent(String(E))).join(`&${encodeURIComponent(_)}=`);return`${encodeURIComponent(_)}=${N}`}return O instanceof Date?`${encodeURIComponent(_)}=${encodeURIComponent(O.toISOString())}`:O instanceof Object?a(O,_):`${encodeURIComponent(_)}=${encodeURIComponent(String(O))}`}).filter(x=>x.length>0).join("&")}e.querystring=a;function u(w,b){return Object.keys(w).reduce((x,_)=>Object.assign(Object.assign({},x),{[_]:b(w[_])}),{})}e.mapValues=u;function l(w){for(const b of w)if(b.contentType==="multipart/form-data")return!0;return!1}e.canConsumeForm=l;class f{constructor(b,x=_=>_){this.raw=b,this.transformer=x}async value(){return this.transformer(await this.raw.json())}}e.JSONApiResponse=f;class p{constructor(b){this.raw=b}async value(){}}e.VoidApiResponse=p;class m{constructor(b){this.raw=b}async value(){return await this.raw.blob()}}e.BlobApiResponse=m;class y{constructor(b){this.raw=b}async value(){return await this.raw.text()}}e.TextApiResponse=y}(Lv)),Lv}var _d={},rm={},kd={},Is={},GO;function V7(){if(GO)return Is;GO=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.AccountDataResponseToJSON=Is.AccountDataResponseFromJSONTyped=Is.AccountDataResponseFromJSON=void 0;function e(r){return t(r)}Is.AccountDataResponseFromJSON=e;function t(r,i){return r==null?r:{balance:r.balance,locked:r.locked,unlock_height:r.unlock_height,nonce:r.nonce,balance_proof:r.balance_proof,nonce_proof:r.nonce_proof}}Is.AccountDataResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{balance:r.balance,locked:r.locked,unlock_height:r.unlock_height,nonce:r.nonce,balance_proof:r.balance_proof,nonce_proof:r.nonce_proof}}return Is.AccountDataResponseToJSON=n,Is}var Ps={},KO;function G7(){if(KO)return Ps;KO=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.AddressAssetsListResponseToJSON=Ps.AddressAssetsListResponseFromJSONTyped=Ps.AddressAssetsListResponseFromJSON=void 0;function e(r){return t(r)}Ps.AddressAssetsListResponseFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}Ps.AddressAssetsListResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return Ps.AddressAssetsListResponseToJSON=n,Ps}var Ms={},QO;function K7(){if(QO)return Ms;QO=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.AddressBalanceResponseToJSON=Ms.AddressBalanceResponseFromJSONTyped=Ms.AddressBalanceResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Ms.AddressBalanceResponseFromJSON=n;function r(o,a){return o==null?o:{stx:(0,t.StxBalanceFromJSON)(o.stx),fungible_tokens:o.fungible_tokens,non_fungible_tokens:o.non_fungible_tokens,token_offering_locked:(0,e.exists)(o,"token_offering_locked")?(0,t.AddressTokenOfferingLockedFromJSON)(o.token_offering_locked):void 0}}Ms.AddressBalanceResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{stx:(0,t.StxBalanceToJSON)(o.stx),fungible_tokens:o.fungible_tokens,non_fungible_tokens:o.non_fungible_tokens,token_offering_locked:(0,t.AddressTokenOfferingLockedToJSON)(o.token_offering_locked)}}return Ms.AddressBalanceResponseToJSON=i,Ms}var Ls={},YO;function Q7(){if(YO)return Ls;YO=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.AddressNftListResponseToJSON=Ls.AddressNftListResponseFromJSONTyped=Ls.AddressNftListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ls.AddressNftListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,nft_events:i.nft_events.map(e.NftEventFromJSON)}}Ls.AddressNftListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,nft_events:i.nft_events.map(e.NftEventToJSON)}}return Ls.AddressNftListResponseToJSON=r,Ls}var Bs={},XO;function Y7(){if(XO)return Bs;XO=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.AddressNftListResponseValueToJSON=Bs.AddressNftListResponseValueFromJSONTyped=Bs.AddressNftListResponseValueFromJSON=void 0;function e(r){return t(r)}Bs.AddressNftListResponseValueFromJSON=e;function t(r,i){return r==null?r:{hex:r.hex,repr:r.repr}}Bs.AddressNftListResponseValueFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{hex:r.hex,repr:r.repr}}return Bs.AddressNftListResponseValueToJSON=n,Bs}var js={},ZO;function X7(){if(ZO)return js;ZO=1,Object.defineProperty(js,"__esModule",{value:!0}),js.AddressNoncesToJSON=js.AddressNoncesFromJSONTyped=js.AddressNoncesFromJSON=void 0;const e=Ie();function t(i){return n(i)}js.AddressNoncesFromJSON=t;function n(i,o){return i==null?i:{last_mempool_tx_nonce:i.last_mempool_tx_nonce,last_executed_tx_nonce:i.last_executed_tx_nonce,possible_next_nonce:i.possible_next_nonce,detected_missing_nonces:i.detected_missing_nonces,detected_mempool_nonces:(0,e.exists)(i,"detected_mempool_nonces")?i.detected_mempool_nonces:void 0}}js.AddressNoncesFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{last_mempool_tx_nonce:i.last_mempool_tx_nonce,last_executed_tx_nonce:i.last_executed_tx_nonce,possible_next_nonce:i.possible_next_nonce,detected_missing_nonces:i.detected_missing_nonces,detected_mempool_nonces:i.detected_mempool_nonces}}return js.AddressNoncesToJSON=r,js}var Ds={},eN;function Z7(){if(eN)return Ds;eN=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.AddressStxInboundListResponseToJSON=Ds.AddressStxInboundListResponseFromJSONTyped=Ds.AddressStxInboundListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ds.AddressStxInboundListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.InboundStxTransferFromJSON)}}Ds.AddressStxInboundListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.InboundStxTransferToJSON)}}return Ds.AddressStxInboundListResponseToJSON=r,Ds}var Js={},tN;function eq(){if(tN)return Js;tN=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.AddressTokenOfferingLockedToJSON=Js.AddressTokenOfferingLockedFromJSONTyped=Js.AddressTokenOfferingLockedFromJSON=void 0;const e=Fe();function t(i){return n(i)}Js.AddressTokenOfferingLockedFromJSON=t;function n(i,o){return i==null?i:{total_locked:i.total_locked,total_unlocked:i.total_unlocked,unlock_schedule:i.unlock_schedule.map(e.AddressUnlockScheduleFromJSON)}}Js.AddressTokenOfferingLockedFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{total_locked:i.total_locked,total_unlocked:i.total_unlocked,unlock_schedule:i.unlock_schedule.map(e.AddressUnlockScheduleToJSON)}}return Js.AddressTokenOfferingLockedToJSON=r,Js}var $s={},nN;function tq(){if(nN)return $s;nN=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.AddressTransactionWithTransfersToJSON=$s.AddressTransactionWithTransfersFromJSONTyped=$s.AddressTransactionWithTransfersFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}$s.AddressTransactionWithTransfersFromJSON=n;function r(o,a){return o==null?o:{tx:o.tx,stx_sent:o.stx_sent,stx_received:o.stx_received,stx_transfers:o.stx_transfers.map(t.AddressTransactionWithTransfersStxTransfersFromJSON),ft_transfers:(0,e.exists)(o,"ft_transfers")?o.ft_transfers.map(t.AddressTransactionWithTransfersFtTransfersFromJSON):void 0,nft_transfers:(0,e.exists)(o,"nft_transfers")?o.nft_transfers.map(t.AddressTransactionWithTransfersNftTransfersFromJSON):void 0}}$s.AddressTransactionWithTransfersFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{tx:o.tx,stx_sent:o.stx_sent,stx_received:o.stx_received,stx_transfers:o.stx_transfers.map(t.AddressTransactionWithTransfersStxTransfersToJSON),ft_transfers:o.ft_transfers===void 0?void 0:o.ft_transfers.map(t.AddressTransactionWithTransfersFtTransfersToJSON),nft_transfers:o.nft_transfers===void 0?void 0:o.nft_transfers.map(t.AddressTransactionWithTransfersNftTransfersToJSON)}}return $s.AddressTransactionWithTransfersToJSON=i,$s}var qs={},rN;function nq(){if(rN)return qs;rN=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.AddressTransactionWithTransfersFtTransfersToJSON=qs.AddressTransactionWithTransfersFtTransfersFromJSONTyped=qs.AddressTransactionWithTransfersFtTransfersFromJSON=void 0;const e=Ie();function t(i){return n(i)}qs.AddressTransactionWithTransfersFtTransfersFromJSON=t;function n(i,o){return i==null?i:{asset_identifier:i.asset_identifier,amount:i.amount,sender:(0,e.exists)(i,"sender")?i.sender:void 0,recipient:(0,e.exists)(i,"recipient")?i.recipient:void 0}}qs.AddressTransactionWithTransfersFtTransfersFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{asset_identifier:i.asset_identifier,amount:i.amount,sender:i.sender,recipient:i.recipient}}return qs.AddressTransactionWithTransfersFtTransfersToJSON=r,qs}var Us={},iN;function rq(){if(iN)return Us;iN=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.AddressTransactionWithTransfersNftTransfersToJSON=Us.AddressTransactionWithTransfersNftTransfersFromJSONTyped=Us.AddressTransactionWithTransfersNftTransfersFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Us.AddressTransactionWithTransfersNftTransfersFromJSON=n;function r(o,a){return o==null?o:{asset_identifier:o.asset_identifier,value:(0,t.AddressTransactionWithTransfersValueFromJSON)(o.value),sender:(0,e.exists)(o,"sender")?o.sender:void 0,recipient:(0,e.exists)(o,"recipient")?o.recipient:void 0}}Us.AddressTransactionWithTransfersNftTransfersFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{asset_identifier:o.asset_identifier,value:(0,t.AddressTransactionWithTransfersValueToJSON)(o.value),sender:o.sender,recipient:o.recipient}}return Us.AddressTransactionWithTransfersNftTransfersToJSON=i,Us}var Hs={},oN;function iq(){if(oN)return Hs;oN=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.AddressTransactionWithTransfersStxTransfersToJSON=Hs.AddressTransactionWithTransfersStxTransfersFromJSONTyped=Hs.AddressTransactionWithTransfersStxTransfersFromJSON=void 0;const e=Ie();function t(i){return n(i)}Hs.AddressTransactionWithTransfersStxTransfersFromJSON=t;function n(i,o){return i==null?i:{amount:i.amount,sender:(0,e.exists)(i,"sender")?i.sender:void 0,recipient:(0,e.exists)(i,"recipient")?i.recipient:void 0}}Hs.AddressTransactionWithTransfersStxTransfersFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{amount:i.amount,sender:i.sender,recipient:i.recipient}}return Hs.AddressTransactionWithTransfersStxTransfersToJSON=r,Hs}var zs={},sN;function oq(){if(sN)return zs;sN=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.AddressTransactionWithTransfersValueToJSON=zs.AddressTransactionWithTransfersValueFromJSONTyped=zs.AddressTransactionWithTransfersValueFromJSON=void 0;function e(r){return t(r)}zs.AddressTransactionWithTransfersValueFromJSON=e;function t(r,i){return r==null?r:{hex:r.hex,repr:r.repr}}zs.AddressTransactionWithTransfersValueFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{hex:r.hex,repr:r.repr}}return zs.AddressTransactionWithTransfersValueToJSON=n,zs}var Ws={},aN;function sq(){if(aN)return Ws;aN=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.AddressTransactionsListResponseToJSON=Ws.AddressTransactionsListResponseFromJSONTyped=Ws.AddressTransactionsListResponseFromJSON=void 0;function e(r){return t(r)}Ws.AddressTransactionsListResponseFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}Ws.AddressTransactionsListResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return Ws.AddressTransactionsListResponseToJSON=n,Ws}var Vs={},cN;function aq(){if(cN)return Vs;cN=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.AddressTransactionsWithTransfersListResponseToJSON=Vs.AddressTransactionsWithTransfersListResponseFromJSONTyped=Vs.AddressTransactionsWithTransfersListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Vs.AddressTransactionsWithTransfersListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.AddressTransactionWithTransfersFromJSON)}}Vs.AddressTransactionsWithTransfersListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.AddressTransactionWithTransfersToJSON)}}return Vs.AddressTransactionsWithTransfersListResponseToJSON=r,Vs}var Gs={},uN;function cq(){if(uN)return Gs;uN=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.AddressUnlockScheduleToJSON=Gs.AddressUnlockScheduleFromJSONTyped=Gs.AddressUnlockScheduleFromJSON=void 0;function e(r){return t(r)}Gs.AddressUnlockScheduleFromJSON=e;function t(r,i){return r==null?r:{amount:r.amount,block_height:r.block_height}}Gs.AddressUnlockScheduleFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{amount:r.amount,block_height:r.block_height}}return Gs.AddressUnlockScheduleToJSON=n,Gs}var Ks={},lN;function uq(){if(lN)return Ks;lN=1,Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.BlockToJSON=Ks.BlockFromJSONTyped=Ks.BlockFromJSON=void 0;function e(r){return t(r)}Ks.BlockFromJSON=e;function t(r,i){return r==null?r:{canonical:r.canonical,height:r.height,hash:r.hash,index_block_hash:r.index_block_hash,parent_block_hash:r.parent_block_hash,burn_block_time:r.burn_block_time,burn_block_time_iso:r.burn_block_time_iso,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,miner_txid:r.miner_txid,parent_microblock_hash:r.parent_microblock_hash,parent_microblock_sequence:r.parent_microblock_sequence,txs:r.txs,microblocks_accepted:r.microblocks_accepted,microblocks_streamed:r.microblocks_streamed,execution_cost_read_count:r.execution_cost_read_count,execution_cost_read_length:r.execution_cost_read_length,execution_cost_runtime:r.execution_cost_runtime,execution_cost_write_count:r.execution_cost_write_count,execution_cost_write_length:r.execution_cost_write_length,microblock_tx_count:r.microblock_tx_count}}Ks.BlockFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{canonical:r.canonical,height:r.height,hash:r.hash,index_block_hash:r.index_block_hash,parent_block_hash:r.parent_block_hash,burn_block_time:r.burn_block_time,burn_block_time_iso:r.burn_block_time_iso,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,miner_txid:r.miner_txid,parent_microblock_hash:r.parent_microblock_hash,parent_microblock_sequence:r.parent_microblock_sequence,txs:r.txs,microblocks_accepted:r.microblocks_accepted,microblocks_streamed:r.microblocks_streamed,execution_cost_read_count:r.execution_cost_read_count,execution_cost_read_length:r.execution_cost_read_length,execution_cost_runtime:r.execution_cost_runtime,execution_cost_write_count:r.execution_cost_write_count,execution_cost_write_length:r.execution_cost_write_length,microblock_tx_count:r.microblock_tx_count}}return Ks.BlockToJSON=n,Ks}var Qs={},dN;function lq(){if(dN)return Qs;dN=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.BlockListResponseToJSON=Qs.BlockListResponseFromJSONTyped=Qs.BlockListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Qs.BlockListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.BlockFromJSON)}}Qs.BlockListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.BlockToJSON)}}return Qs.BlockListResponseToJSON=r,Qs}var Ys={},fN;function dq(){if(fN)return Ys;fN=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.BnsErrorToJSON=Ys.BnsErrorFromJSONTyped=Ys.BnsErrorFromJSON=void 0;const e=Ie();function t(i){return n(i)}Ys.BnsErrorFromJSON=t;function n(i,o){return i==null?i:{error:(0,e.exists)(i,"error")?i.error:void 0}}Ys.BnsErrorFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{error:i.error}}return Ys.BnsErrorToJSON=r,Ys}var Xs={},hN;function fq(){if(hN)return Xs;hN=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.BnsGetAllNamespacesResponseToJSON=Xs.BnsGetAllNamespacesResponseFromJSONTyped=Xs.BnsGetAllNamespacesResponseFromJSON=void 0;function e(r){return t(r)}Xs.BnsGetAllNamespacesResponseFromJSON=e;function t(r,i){return r==null?r:{namespaces:r.namespaces}}Xs.BnsGetAllNamespacesResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{namespaces:r.namespaces}}return Xs.BnsGetAllNamespacesResponseToJSON=n,Xs}var Zs={},pN;function hq(){if(pN)return Zs;pN=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.BnsGetNameInfoResponseToJSON=Zs.BnsGetNameInfoResponseFromJSONTyped=Zs.BnsGetNameInfoResponseFromJSON=void 0;const e=Ie();function t(i){return n(i)}Zs.BnsGetNameInfoResponseFromJSON=t;function n(i,o){return i==null?i:{address:i.address,blockchain:i.blockchain,expire_block:(0,e.exists)(i,"expire_block")?i.expire_block:void 0,grace_period:(0,e.exists)(i,"grace_period")?i.grace_period:void 0,last_txid:i.last_txid,resolver:(0,e.exists)(i,"resolver")?i.resolver:void 0,status:i.status,zonefile:i.zonefile,zonefile_hash:i.zonefile_hash}}Zs.BnsGetNameInfoResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{address:i.address,blockchain:i.blockchain,expire_block:i.expire_block,grace_period:i.grace_period,last_txid:i.last_txid,resolver:i.resolver,status:i.status,zonefile:i.zonefile,zonefile_hash:i.zonefile_hash}}return Zs.BnsGetNameInfoResponseToJSON=r,Zs}var ea={},mN;function pq(){if(mN)return ea;mN=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.BnsGetNamePriceResponseToJSON=ea.BnsGetNamePriceResponseFromJSONTyped=ea.BnsGetNamePriceResponseFromJSON=void 0;function e(r){return t(r)}ea.BnsGetNamePriceResponseFromJSON=e;function t(r,i){return r==null?r:{units:r.units,amount:r.amount}}ea.BnsGetNamePriceResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{units:r.units,amount:r.amount}}return ea.BnsGetNamePriceResponseToJSON=n,ea}var ta={},gN;function mq(){if(gN)return ta;gN=1,Object.defineProperty(ta,"__esModule",{value:!0}),ta.BnsGetNamespacePriceResponseToJSON=ta.BnsGetNamespacePriceResponseFromJSONTyped=ta.BnsGetNamespacePriceResponseFromJSON=void 0;function e(r){return t(r)}ta.BnsGetNamespacePriceResponseFromJSON=e;function t(r,i){return r==null?r:{units:r.units,amount:r.amount}}ta.BnsGetNamespacePriceResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{units:r.units,amount:r.amount}}return ta.BnsGetNamespacePriceResponseToJSON=n,ta}var na={},yN;function gq(){if(yN)return na;yN=1,Object.defineProperty(na,"__esModule",{value:!0}),na.BnsNamesOwnByAddressResponseToJSON=na.BnsNamesOwnByAddressResponseFromJSONTyped=na.BnsNamesOwnByAddressResponseFromJSON=void 0;function e(r){return t(r)}na.BnsNamesOwnByAddressResponseFromJSON=e;function t(r,i){return r==null?r:{names:r.names}}na.BnsNamesOwnByAddressResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{names:r.names}}return na.BnsNamesOwnByAddressResponseToJSON=n,na}var ra={},wN;function yq(){if(wN)return ra;wN=1,Object.defineProperty(ra,"__esModule",{value:!0}),ra.BurnchainRewardToJSON=ra.BurnchainRewardFromJSONTyped=ra.BurnchainRewardFromJSON=void 0;function e(r){return t(r)}ra.BurnchainRewardFromJSON=e;function t(r,i){return r==null?r:{canonical:r.canonical,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,burn_amount:r.burn_amount,reward_recipient:r.reward_recipient,reward_amount:r.reward_amount,reward_index:r.reward_index}}ra.BurnchainRewardFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{canonical:r.canonical,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,burn_amount:r.burn_amount,reward_recipient:r.reward_recipient,reward_amount:r.reward_amount,reward_index:r.reward_index}}return ra.BurnchainRewardToJSON=n,ra}var ia={},bN;function wq(){if(bN)return ia;bN=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.BurnchainRewardListResponseToJSON=ia.BurnchainRewardListResponseFromJSONTyped=ia.BurnchainRewardListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}ia.BurnchainRewardListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,results:i.results.map(e.BurnchainRewardFromJSON)}}ia.BurnchainRewardListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,results:i.results.map(e.BurnchainRewardToJSON)}}return ia.BurnchainRewardListResponseToJSON=r,ia}var oa={},SN;function bq(){if(SN)return oa;SN=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.BurnchainRewardSlotHolderToJSON=oa.BurnchainRewardSlotHolderFromJSONTyped=oa.BurnchainRewardSlotHolderFromJSON=void 0;function e(r){return t(r)}oa.BurnchainRewardSlotHolderFromJSON=e;function t(r,i){return r==null?r:{canonical:r.canonical,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,address:r.address,slot_index:r.slot_index}}oa.BurnchainRewardSlotHolderFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{canonical:r.canonical,burn_block_hash:r.burn_block_hash,burn_block_height:r.burn_block_height,address:r.address,slot_index:r.slot_index}}return oa.BurnchainRewardSlotHolderToJSON=n,oa}var sa={},vN;function Sq(){if(vN)return sa;vN=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.BurnchainRewardSlotHolderListResponseToJSON=sa.BurnchainRewardSlotHolderListResponseFromJSONTyped=sa.BurnchainRewardSlotHolderListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}sa.BurnchainRewardSlotHolderListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.BurnchainRewardSlotHolderFromJSON)}}sa.BurnchainRewardSlotHolderListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.BurnchainRewardSlotHolderToJSON)}}return sa.BurnchainRewardSlotHolderListResponseToJSON=r,sa}var aa={},xN;function vq(){if(xN)return aa;xN=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.BurnchainRewardsTotalToJSON=aa.BurnchainRewardsTotalFromJSONTyped=aa.BurnchainRewardsTotalFromJSON=void 0;function e(r){return t(r)}aa.BurnchainRewardsTotalFromJSON=e;function t(r,i){return r==null?r:{reward_recipient:r.reward_recipient,reward_amount:r.reward_amount}}aa.BurnchainRewardsTotalFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{reward_recipient:r.reward_recipient,reward_amount:r.reward_amount}}return aa.BurnchainRewardsTotalToJSON=n,aa}var ca={},_N;function xq(){if(_N)return ca;_N=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.ChainTipToJSON=ca.ChainTipFromJSONTyped=ca.ChainTipFromJSON=void 0;const e=Ie();function t(i){return n(i)}ca.ChainTipFromJSON=t;function n(i,o){return i==null?i:{block_height:i.block_height,block_hash:i.block_hash,index_block_hash:i.index_block_hash,microblock_hash:(0,e.exists)(i,"microblock_hash")?i.microblock_hash:void 0,microblock_sequence:(0,e.exists)(i,"microblock_sequence")?i.microblock_sequence:void 0,burn_block_height:i.burn_block_height}}ca.ChainTipFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{block_height:i.block_height,block_hash:i.block_hash,index_block_hash:i.index_block_hash,microblock_hash:i.microblock_hash,microblock_sequence:i.microblock_sequence,burn_block_height:i.burn_block_height}}return ca.ChainTipToJSON=r,ca}var ua={},kN;function _q(){if(kN)return ua;kN=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.ContractInterfaceResponseToJSON=ua.ContractInterfaceResponseFromJSONTyped=ua.ContractInterfaceResponseFromJSON=void 0;function e(r){return t(r)}ua.ContractInterfaceResponseFromJSON=e;function t(r,i){return r==null?r:{functions:r.functions,variables:r.variables,maps:r.maps,fungible_tokens:r.fungible_tokens,non_fungible_tokens:r.non_fungible_tokens}}ua.ContractInterfaceResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{functions:r.functions,variables:r.variables,maps:r.maps,fungible_tokens:r.fungible_tokens,non_fungible_tokens:r.non_fungible_tokens}}return ua.ContractInterfaceResponseToJSON=n,ua}var la={},RN;function kq(){if(RN)return la;RN=1,Object.defineProperty(la,"__esModule",{value:!0}),la.ContractListResponseToJSON=la.ContractListResponseFromJSONTyped=la.ContractListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}la.ContractListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,results:i.results.map(e.SmartContractFromJSON)}}la.ContractListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,results:i.results.map(e.SmartContractToJSON)}}return la.ContractListResponseToJSON=r,la}var da={},TN;function Rq(){if(TN)return da;TN=1,Object.defineProperty(da,"__esModule",{value:!0}),da.ContractSourceResponseToJSON=da.ContractSourceResponseFromJSONTyped=da.ContractSourceResponseFromJSON=void 0;function e(r){return t(r)}da.ContractSourceResponseFromJSON=e;function t(r,i){return r==null?r:{source:r.source,publish_height:r.publish_height,proof:r.proof}}da.ContractSourceResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{source:r.source,publish_height:r.publish_height,proof:r.proof}}return da.ContractSourceResponseToJSON=n,da}var fa={},ON;function Tq(){if(ON)return fa;ON=1,Object.defineProperty(fa,"__esModule",{value:!0}),fa.CoreNodeInfoResponseToJSON=fa.CoreNodeInfoResponseFromJSONTyped=fa.CoreNodeInfoResponseFromJSON=void 0;function e(r){return t(r)}fa.CoreNodeInfoResponseFromJSON=e;function t(r,i){return r==null?r:{peer_version:r.peer_version,pox_consensus:r.pox_consensus,burn_block_height:r.burn_block_height,stable_pox_consensus:r.stable_pox_consensus,stable_burn_block_height:r.stable_burn_block_height,server_version:r.server_version,network_id:r.network_id,parent_network_id:r.parent_network_id,stacks_tip_height:r.stacks_tip_height,stacks_tip:r.stacks_tip,stacks_tip_consensus_hash:r.stacks_tip_consensus_hash,unanchored_tip:r.unanchored_tip,exit_at_block_height:r.exit_at_block_height}}fa.CoreNodeInfoResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{peer_version:r.peer_version,pox_consensus:r.pox_consensus,burn_block_height:r.burn_block_height,stable_pox_consensus:r.stable_pox_consensus,stable_burn_block_height:r.stable_burn_block_height,server_version:r.server_version,network_id:r.network_id,parent_network_id:r.parent_network_id,stacks_tip_height:r.stacks_tip_height,stacks_tip:r.stacks_tip,stacks_tip_consensus_hash:r.stacks_tip_consensus_hash,unanchored_tip:r.unanchored_tip,exit_at_block_height:r.exit_at_block_height}}return fa.CoreNodeInfoResponseToJSON=n,fa}var ha={},NN;function Oq(){if(NN)return ha;NN=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.CoreNodePoxResponseToJSON=ha.CoreNodePoxResponseFromJSONTyped=ha.CoreNodePoxResponseFromJSON=void 0;function e(r){return t(r)}ha.CoreNodePoxResponseFromJSON=e;function t(r,i){return r==null?r:{contract_id:r.contract_id,first_burnchain_block_height:r.first_burnchain_block_height,min_amount_ustx:r.min_amount_ustx,registration_window_length:r.registration_window_length,rejection_fraction:r.rejection_fraction,reward_cycle_id:r.reward_cycle_id,reward_cycle_length:r.reward_cycle_length,rejection_votes_left_required:r.rejection_votes_left_required,total_liquid_supply_ustx:r.total_liquid_supply_ustx}}ha.CoreNodePoxResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{contract_id:r.contract_id,first_burnchain_block_height:r.first_burnchain_block_height,min_amount_ustx:r.min_amount_ustx,registration_window_length:r.registration_window_length,rejection_fraction:r.rejection_fraction,reward_cycle_id:r.reward_cycle_id,reward_cycle_length:r.reward_cycle_length,rejection_votes_left_required:r.rejection_votes_left_required,total_liquid_supply_ustx:r.total_liquid_supply_ustx}}return ha.CoreNodePoxResponseToJSON=n,ha}var pa={},CN;function Nq(){if(CN)return pa;CN=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.FeeRateToJSON=pa.FeeRateFromJSONTyped=pa.FeeRateFromJSON=void 0;function e(r){return t(r)}pa.FeeRateFromJSON=e;function t(r,i){return r==null?r:{fee_rate:r.fee_rate}}pa.FeeRateFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{fee_rate:r.fee_rate}}return pa.FeeRateToJSON=n,pa}var ma={},EN;function Cq(){if(EN)return ma;EN=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.FeeRateRequestToJSON=ma.FeeRateRequestFromJSONTyped=ma.FeeRateRequestFromJSON=void 0;function e(r){return t(r)}ma.FeeRateRequestFromJSON=e;function t(r,i){return r==null?r:{transaction:r.transaction}}ma.FeeRateRequestFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{transaction:r.transaction}}return ma.FeeRateRequestToJSON=n,ma}var ga={},AN;function Eq(){if(AN)return ga;AN=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.FungibleTokenMetadataToJSON=ga.FungibleTokenMetadataFromJSONTyped=ga.FungibleTokenMetadataFromJSON=void 0;function e(r){return t(r)}ga.FungibleTokenMetadataFromJSON=e;function t(r,i){return r==null?r:{token_uri:r.token_uri,name:r.name,description:r.description,image_uri:r.image_uri,image_canonical_uri:r.image_canonical_uri,symbol:r.symbol,decimals:r.decimals,tx_id:r.tx_id,sender_address:r.sender_address}}ga.FungibleTokenMetadataFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{token_uri:r.token_uri,name:r.name,description:r.description,image_uri:r.image_uri,image_canonical_uri:r.image_canonical_uri,symbol:r.symbol,decimals:r.decimals,tx_id:r.tx_id,sender_address:r.sender_address}}return ga.FungibleTokenMetadataToJSON=n,ga}var ya={},FN;function Aq(){if(FN)return ya;FN=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.FungibleTokensMetadataListToJSON=ya.FungibleTokensMetadataListFromJSONTyped=ya.FungibleTokensMetadataListFromJSON=void 0;const e=Fe();function t(i){return n(i)}ya.FungibleTokensMetadataListFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.FungibleTokenMetadataFromJSON)}}ya.FungibleTokensMetadataListFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.FungibleTokenMetadataToJSON)}}return ya.FungibleTokensMetadataListToJSON=r,ya}var wa={},IN;function Fq(){if(IN)return wa;IN=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.GetRawTransactionResultToJSON=wa.GetRawTransactionResultFromJSONTyped=wa.GetRawTransactionResultFromJSON=void 0;function e(r){return t(r)}wa.GetRawTransactionResultFromJSON=e;function t(r,i){return r==null?r:{raw_tx:r.raw_tx}}wa.GetRawTransactionResultFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{raw_tx:r.raw_tx}}return wa.GetRawTransactionResultToJSON=n,wa}var ba={},PN;function Iq(){if(PN)return ba;PN=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.GetStxSupplyLegacyFormatResponseToJSON=ba.GetStxSupplyLegacyFormatResponseFromJSONTyped=ba.GetStxSupplyLegacyFormatResponseFromJSON=void 0;function e(r){return t(r)}ba.GetStxSupplyLegacyFormatResponseFromJSON=e;function t(r,i){return r==null?r:{unlockedPercent:r.unlockedPercent,totalStacks:r.totalStacks,totalStacksFormatted:r.totalStacksFormatted,unlockedSupply:r.unlockedSupply,unlockedSupplyFormatted:r.unlockedSupplyFormatted,blockHeight:r.blockHeight}}ba.GetStxSupplyLegacyFormatResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{unlockedPercent:r.unlockedPercent,totalStacks:r.totalStacks,totalStacksFormatted:r.totalStacksFormatted,unlockedSupply:r.unlockedSupply,unlockedSupplyFormatted:r.unlockedSupplyFormatted,blockHeight:r.blockHeight}}return ba.GetStxSupplyLegacyFormatResponseToJSON=n,ba}var Sa={},MN;function Pq(){if(MN)return Sa;MN=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.GetStxSupplyResponseToJSON=Sa.GetStxSupplyResponseFromJSONTyped=Sa.GetStxSupplyResponseFromJSON=void 0;function e(r){return t(r)}Sa.GetStxSupplyResponseFromJSON=e;function t(r,i){return r==null?r:{unlocked_percent:r.unlocked_percent,total_stx:r.total_stx,unlocked_stx:r.unlocked_stx,block_height:r.block_height}}Sa.GetStxSupplyResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{unlocked_percent:r.unlocked_percent,total_stx:r.total_stx,unlocked_stx:r.unlocked_stx,block_height:r.block_height}}return Sa.GetStxSupplyResponseToJSON=n,Sa}var Bv={},LN;function Mq(){return LN||(LN=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InboundStxTransferToJSON=e.InboundStxTransferFromJSONTyped=e.InboundStxTransferFromJSON=e.InboundStxTransferTransferTypeEnum=void 0,function(i){i.bulk_send="bulk-send",i.stx_transfer="stx-transfer",i.stx_transfer_memo="stx-transfer-memo"}(e.InboundStxTransferTransferTypeEnum||(e.InboundStxTransferTransferTypeEnum={}));function t(i){return n(i)}e.InboundStxTransferFromJSON=t;function n(i,o){return i==null?i:{sender:i.sender,amount:i.amount,memo:i.memo,block_height:i.block_height,tx_id:i.tx_id,transfer_type:i.transfer_type,tx_index:i.tx_index}}e.InboundStxTransferFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{sender:i.sender,amount:i.amount,memo:i.memo,block_height:i.block_height,tx_id:i.tx_id,transfer_type:i.transfer_type,tx_index:i.tx_index}}e.InboundStxTransferToJSON=r}(Bv)),Bv}var va={},BN;function Lq(){if(BN)return va;BN=1,Object.defineProperty(va,"__esModule",{value:!0}),va.InlineObjectToJSON=va.InlineObjectFromJSONTyped=va.InlineObjectFromJSON=void 0;const e=Ie();function t(i){return n(i)}va.InlineObjectFromJSON=t;function n(i,o){return i==null?i:{address:(0,e.exists)(i,"address")?i.address:void 0,stacking:(0,e.exists)(i,"stacking")?i.stacking:void 0}}va.InlineObjectFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{address:i.address,stacking:i.stacking}}return va.InlineObjectToJSON=r,va}var xa={},jN;function Bq(){if(jN)return xa;jN=1,Object.defineProperty(xa,"__esModule",{value:!0}),xa.InlineObject1ToJSON=xa.InlineObject1FromJSONTyped=xa.InlineObject1FromJSON=void 0;const e=Ie();function t(i){return n(i)}xa.InlineObject1FromJSON=t;function n(i,o){return i==null?i:{address:(0,e.exists)(i,"address")?i.address:void 0}}xa.InlineObject1FromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{address:i.address}}return xa.InlineObject1ToJSON=r,xa}var _a={},DN;function jq(){if(DN)return _a;DN=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.InlineResponse403ToJSON=_a.InlineResponse403FromJSONTyped=_a.InlineResponse403FromJSON=void 0;const e=Ie();function t(i){return n(i)}_a.InlineResponse403FromJSON=t;function n(i,o){return i==null?i:{error:(0,e.exists)(i,"error")?i.error:void 0,success:(0,e.exists)(i,"success")?i.success:void 0}}_a.InlineResponse403FromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{error:i.error,success:i.success}}return _a.InlineResponse403ToJSON=r,_a}var ka={},JN;function Dq(){if(JN)return ka;JN=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.MapEntryResponseToJSON=ka.MapEntryResponseFromJSONTyped=ka.MapEntryResponseFromJSON=void 0;const e=Ie();function t(i){return n(i)}ka.MapEntryResponseFromJSON=t;function n(i,o){return i==null?i:{data:i.data,proof:(0,e.exists)(i,"proof")?i.proof:void 0}}ka.MapEntryResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{data:i.data,proof:i.proof}}return ka.MapEntryResponseToJSON=r,ka}var Ra={},$N;function Jq(){if($N)return Ra;$N=1,Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.MempoolTransactionListResponseToJSON=Ra.MempoolTransactionListResponseFromJSONTyped=Ra.MempoolTransactionListResponseFromJSON=void 0;function e(r){return t(r)}Ra.MempoolTransactionListResponseFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}Ra.MempoolTransactionListResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return Ra.MempoolTransactionListResponseToJSON=n,Ra}var Ta={},qN;function $q(){if(qN)return Ta;qN=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.MempoolTransactionStatsResponseToJSON=Ta.MempoolTransactionStatsResponseFromJSONTyped=Ta.MempoolTransactionStatsResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ta.MempoolTransactionStatsResponseFromJSON=t;function n(i,o){return i==null?i:{tx_type_counts:(0,e.MempoolTransactionStatsResponseTxTypeCountsFromJSON)(i.tx_type_counts),tx_simple_fee_averages:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesFromJSON)(i.tx_simple_fee_averages),tx_ages:(0,e.MempoolTransactionStatsResponseTxAgesFromJSON)(i.tx_ages),tx_byte_sizes:(0,e.MempoolTransactionStatsResponseTxByteSizesFromJSON)(i.tx_byte_sizes)}}Ta.MempoolTransactionStatsResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{tx_type_counts:(0,e.MempoolTransactionStatsResponseTxTypeCountsToJSON)(i.tx_type_counts),tx_simple_fee_averages:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesToJSON)(i.tx_simple_fee_averages),tx_ages:(0,e.MempoolTransactionStatsResponseTxAgesToJSON)(i.tx_ages),tx_byte_sizes:(0,e.MempoolTransactionStatsResponseTxByteSizesToJSON)(i.tx_byte_sizes)}}return Ta.MempoolTransactionStatsResponseToJSON=r,Ta}var Oa={},UN;function qq(){if(UN)return Oa;UN=1,Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.MempoolTransactionStatsResponseTxAgesToJSON=Oa.MempoolTransactionStatsResponseTxAgesFromJSONTyped=Oa.MempoolTransactionStatsResponseTxAgesFromJSON=void 0;const e=Fe();function t(i){return n(i)}Oa.MempoolTransactionStatsResponseTxAgesFromJSON=t;function n(i,o){return i==null?i:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.poison_microblock)}}Oa.MempoolTransactionStatsResponseTxAgesFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.poison_microblock)}}return Oa.MempoolTransactionStatsResponseTxAgesToJSON=r,Oa}var Na={},HN;function Uq(){if(HN)return Na;HN=1,Object.defineProperty(Na,"__esModule",{value:!0}),Na.MempoolTransactionStatsResponseTxByteSizesToJSON=Na.MempoolTransactionStatsResponseTxByteSizesFromJSONTyped=Na.MempoolTransactionStatsResponseTxByteSizesFromJSON=void 0;const e=Fe();function t(i){return n(i)}Na.MempoolTransactionStatsResponseTxByteSizesFromJSON=t;function n(i,o){return i==null?i:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.poison_microblock)}}Na.MempoolTransactionStatsResponseTxByteSizesFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.poison_microblock)}}return Na.MempoolTransactionStatsResponseTxByteSizesToJSON=r,Na}var Ca={},zN;function Hq(){if(zN)return Ca;zN=1,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesToJSON=Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesFromJSONTyped=Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesFromJSON=t;function n(i,o){return i==null?i:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON)(i.poison_microblock)}}Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{token_transfer:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.token_transfer),smart_contract:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.smart_contract),contract_call:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.contract_call),poison_microblock:(0,e.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON)(i.poison_microblock)}}return Ca.MempoolTransactionStatsResponseTxSimpleFeeAveragesToJSON=r,Ca}var Ea={},WN;function zq(){if(WN)return Ea;WN=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON=Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSONTyped=Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON=void 0;function e(r){return t(r)}Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSON=e;function t(r,i){return r==null?r:{p25:r.p25,p50:r.p50,p75:r.p75,p95:r.p95}}Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{p25:r.p25,p50:r.p50,p75:r.p75,p95:r.p95}}return Ea.MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransferToJSON=n,Ea}var Aa={},VN;function Wq(){if(VN)return Aa;VN=1,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.MempoolTransactionStatsResponseTxTypeCountsToJSON=Aa.MempoolTransactionStatsResponseTxTypeCountsFromJSONTyped=Aa.MempoolTransactionStatsResponseTxTypeCountsFromJSON=void 0;function e(r){return t(r)}Aa.MempoolTransactionStatsResponseTxTypeCountsFromJSON=e;function t(r,i){return r==null?r:{token_transfer:r.token_transfer,smart_contract:r.smart_contract,contract_call:r.contract_call,poison_microblock:r.poison_microblock}}Aa.MempoolTransactionStatsResponseTxTypeCountsFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{token_transfer:r.token_transfer,smart_contract:r.smart_contract,contract_call:r.contract_call,poison_microblock:r.poison_microblock}}return Aa.MempoolTransactionStatsResponseTxTypeCountsToJSON=n,Aa}var Fa={},GN;function Vq(){if(GN)return Fa;GN=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.MicroblockToJSON=Fa.MicroblockFromJSONTyped=Fa.MicroblockFromJSON=void 0;function e(r){return t(r)}Fa.MicroblockFromJSON=e;function t(r,i){return r==null?r:{canonical:r.canonical,microblock_canonical:r.microblock_canonical,microblock_hash:r.microblock_hash,microblock_sequence:r.microblock_sequence,microblock_parent_hash:r.microblock_parent_hash,block_height:r.block_height,parent_block_height:r.parent_block_height,parent_block_hash:r.parent_block_hash,parent_burn_block_hash:r.parent_burn_block_hash,parent_burn_block_time:r.parent_burn_block_time,parent_burn_block_time_iso:r.parent_burn_block_time_iso,parent_burn_block_height:r.parent_burn_block_height,block_hash:r.block_hash,txs:r.txs}}Fa.MicroblockFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{canonical:r.canonical,microblock_canonical:r.microblock_canonical,microblock_hash:r.microblock_hash,microblock_sequence:r.microblock_sequence,microblock_parent_hash:r.microblock_parent_hash,block_height:r.block_height,parent_block_height:r.parent_block_height,parent_block_hash:r.parent_block_hash,parent_burn_block_hash:r.parent_burn_block_hash,parent_burn_block_time:r.parent_burn_block_time,parent_burn_block_time_iso:r.parent_burn_block_time_iso,parent_burn_block_height:r.parent_burn_block_height,block_hash:r.block_hash,txs:r.txs}}return Fa.MicroblockToJSON=n,Fa}var Ia={},KN;function Gq(){if(KN)return Ia;KN=1,Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.MicroblockListResponseToJSON=Ia.MicroblockListResponseFromJSONTyped=Ia.MicroblockListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ia.MicroblockListResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.MicroblockFromJSON)}}Ia.MicroblockListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.MicroblockToJSON)}}return Ia.MicroblockListResponseToJSON=r,Ia}var Pa={},QN;function Kq(){if(QN)return Pa;QN=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.NetworkBlockTimeResponseToJSON=Pa.NetworkBlockTimeResponseFromJSONTyped=Pa.NetworkBlockTimeResponseFromJSON=void 0;function e(r){return t(r)}Pa.NetworkBlockTimeResponseFromJSON=e;function t(r,i){return r==null?r:{target_block_time:r.target_block_time}}Pa.NetworkBlockTimeResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{target_block_time:r.target_block_time}}return Pa.NetworkBlockTimeResponseToJSON=n,Pa}var Ma={},YN;function Qq(){if(YN)return Ma;YN=1,Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.NetworkBlockTimesResponseToJSON=Ma.NetworkBlockTimesResponseFromJSONTyped=Ma.NetworkBlockTimesResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Ma.NetworkBlockTimesResponseFromJSON=t;function n(i,o){return i==null?i:{mainnet:(0,e.TargetBlockTimeFromJSON)(i.mainnet),testnet:(0,e.TargetBlockTimeFromJSON)(i.testnet)}}Ma.NetworkBlockTimesResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{mainnet:(0,e.TargetBlockTimeToJSON)(i.mainnet),testnet:(0,e.TargetBlockTimeToJSON)(i.testnet)}}return Ma.NetworkBlockTimesResponseToJSON=r,Ma}var La={},XN;function Yq(){if(XN)return La;XN=1,Object.defineProperty(La,"__esModule",{value:!0}),La.NetworkIdentifierToJSON=La.NetworkIdentifierFromJSONTyped=La.NetworkIdentifierFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}La.NetworkIdentifierFromJSON=n;function r(o,a){return o==null?o:{blockchain:o.blockchain,network:o.network,sub_network_identifier:(0,e.exists)(o,"sub_network_identifier")?(0,t.RosettaNetworkListResponseSubNetworkIdentifierFromJSON)(o.sub_network_identifier):void 0}}La.NetworkIdentifierFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{blockchain:o.blockchain,network:o.network,sub_network_identifier:(0,t.RosettaNetworkListResponseSubNetworkIdentifierToJSON)(o.sub_network_identifier)}}return La.NetworkIdentifierToJSON=i,La}var Ba={},ZN;function Xq(){if(ZN)return Ba;ZN=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.NftEventToJSON=Ba.NftEventFromJSONTyped=Ba.NftEventFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Ba.NftEventFromJSON=n;function r(o,a){return o==null?o:{sender:(0,e.exists)(o,"sender")?o.sender:void 0,recipient:(0,e.exists)(o,"recipient")?o.recipient:void 0,asset_identifier:o.asset_identifier,asset_event_type:o.asset_event_type,value:(0,t.AddressNftListResponseValueFromJSON)(o.value),tx_id:o.tx_id,tx_index:o.tx_index,block_height:o.block_height,event_index:o.event_index}}Ba.NftEventFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{sender:o.sender,recipient:o.recipient,asset_identifier:o.asset_identifier,asset_event_type:o.asset_event_type,value:(0,t.AddressNftListResponseValueToJSON)(o.value),tx_id:o.tx_id,tx_index:o.tx_index,block_height:o.block_height,event_index:o.event_index}}return Ba.NftEventToJSON=i,Ba}var ja={},eC;function Zq(){if(eC)return ja;eC=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.NonFungibleTokenHistoryEventListToJSON=ja.NonFungibleTokenHistoryEventListFromJSONTyped=ja.NonFungibleTokenHistoryEventListFromJSON=void 0;function e(r){return t(r)}ja.NonFungibleTokenHistoryEventListFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}ja.NonFungibleTokenHistoryEventListFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return ja.NonFungibleTokenHistoryEventListToJSON=n,ja}var Da={},tC;function eU(){if(tC)return Da;tC=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.NonFungibleTokenHoldingsListToJSON=Da.NonFungibleTokenHoldingsListFromJSONTyped=Da.NonFungibleTokenHoldingsListFromJSON=void 0;function e(r){return t(r)}Da.NonFungibleTokenHoldingsListFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}Da.NonFungibleTokenHoldingsListFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return Da.NonFungibleTokenHoldingsListToJSON=n,Da}var Ja={},nC;function tU(){if(nC)return Ja;nC=1,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.NonFungibleTokenMetadataToJSON=Ja.NonFungibleTokenMetadataFromJSONTyped=Ja.NonFungibleTokenMetadataFromJSON=void 0;function e(r){return t(r)}Ja.NonFungibleTokenMetadataFromJSON=e;function t(r,i){return r==null?r:{token_uri:r.token_uri,name:r.name,description:r.description,image_uri:r.image_uri,image_canonical_uri:r.image_canonical_uri,tx_id:r.tx_id,sender_address:r.sender_address}}Ja.NonFungibleTokenMetadataFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{token_uri:r.token_uri,name:r.name,description:r.description,image_uri:r.image_uri,image_canonical_uri:r.image_canonical_uri,tx_id:r.tx_id,sender_address:r.sender_address}}return Ja.NonFungibleTokenMetadataToJSON=n,Ja}var $a={},rC;function nU(){if(rC)return $a;rC=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.NonFungibleTokenMintListToJSON=$a.NonFungibleTokenMintListFromJSONTyped=$a.NonFungibleTokenMintListFromJSON=void 0;function e(r){return t(r)}$a.NonFungibleTokenMintListFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}$a.NonFungibleTokenMintListFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return $a.NonFungibleTokenMintListToJSON=n,$a}var qa={},iC;function rU(){if(iC)return qa;iC=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.NonFungibleTokensMetadataListToJSON=qa.NonFungibleTokensMetadataListFromJSONTyped=qa.NonFungibleTokensMetadataListFromJSON=void 0;const e=Fe();function t(i){return n(i)}qa.NonFungibleTokensMetadataListFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.NonFungibleTokenMetadataFromJSON)}}qa.NonFungibleTokensMetadataListFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.NonFungibleTokenMetadataToJSON)}}return qa.NonFungibleTokensMetadataListToJSON=r,qa}var Ua={},oC;function iU(){if(oC)return Ua;oC=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.OtherTransactionIdentifierToJSON=Ua.OtherTransactionIdentifierFromJSONTyped=Ua.OtherTransactionIdentifierFromJSON=void 0;function e(r){return t(r)}Ua.OtherTransactionIdentifierFromJSON=e;function t(r,i){return r==null?r:{hash:r.hash}}Ua.OtherTransactionIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{hash:r.hash}}return Ua.OtherTransactionIdentifierToJSON=n,Ua}var Ha={},sC;function oU(){if(sC)return Ha;sC=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.PoolDelegationToJSON=Ha.PoolDelegationFromJSONTyped=Ha.PoolDelegationFromJSON=void 0;const e=Ie();function t(i){return n(i)}Ha.PoolDelegationFromJSON=t;function n(i,o){return i==null?i:{stacker:i.stacker,pox_addr:(0,e.exists)(i,"pox_addr")?i.pox_addr:void 0,amount_ustx:i.amount_ustx,burn_block_unlock_height:(0,e.exists)(i,"burn_block_unlock_height")?i.burn_block_unlock_height:void 0,block_height:i.block_height,tx_id:i.tx_id}}Ha.PoolDelegationFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{stacker:i.stacker,pox_addr:i.pox_addr,amount_ustx:i.amount_ustx,burn_block_unlock_height:i.burn_block_unlock_height,block_height:i.block_height,tx_id:i.tx_id}}return Ha.PoolDelegationToJSON=r,Ha}var za={},aC;function sU(){if(aC)return za;aC=1,Object.defineProperty(za,"__esModule",{value:!0}),za.PoolDelegationsResponseToJSON=za.PoolDelegationsResponseFromJSONTyped=za.PoolDelegationsResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}za.PoolDelegationsResponseFromJSON=t;function n(i,o){return i==null?i:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.PoolDelegationFromJSON)}}za.PoolDelegationsResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{limit:i.limit,offset:i.offset,total:i.total,results:i.results.map(e.PoolDelegationToJSON)}}return za.PoolDelegationsResponseToJSON=r,za}var Wa={},cC;function aU(){if(cC)return Wa;cC=1,Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.PostCoreNodeTransactionsErrorToJSON=Wa.PostCoreNodeTransactionsErrorFromJSONTyped=Wa.PostCoreNodeTransactionsErrorFromJSON=void 0;function e(r){return t(r)}Wa.PostCoreNodeTransactionsErrorFromJSON=e;function t(r,i){return r==null?r:{error:r.error,reason:r.reason,reason_data:r.reason_data,txid:r.txid}}Wa.PostCoreNodeTransactionsErrorFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{error:r.error,reason:r.reason,reason_data:r.reason_data,txid:r.txid}}return Wa.PostCoreNodeTransactionsErrorToJSON=n,Wa}var Va={},uC;function cU(){if(uC)return Va;uC=1,Object.defineProperty(Va,"__esModule",{value:!0}),Va.ReadOnlyFunctionArgsToJSON=Va.ReadOnlyFunctionArgsFromJSONTyped=Va.ReadOnlyFunctionArgsFromJSON=void 0;function e(r){return t(r)}Va.ReadOnlyFunctionArgsFromJSON=e;function t(r,i){return r==null?r:{sender:r.sender,arguments:r.arguments}}Va.ReadOnlyFunctionArgsFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{sender:r.sender,arguments:r.arguments}}return Va.ReadOnlyFunctionArgsToJSON=n,Va}var Ga={},lC;function uU(){if(lC)return Ga;lC=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.ReadOnlyFunctionSuccessResponseToJSON=Ga.ReadOnlyFunctionSuccessResponseFromJSONTyped=Ga.ReadOnlyFunctionSuccessResponseFromJSON=void 0;const e=Ie();function t(i){return n(i)}Ga.ReadOnlyFunctionSuccessResponseFromJSON=t;function n(i,o){return i==null?i:{okay:i.okay,result:(0,e.exists)(i,"result")?i.result:void 0,cause:(0,e.exists)(i,"cause")?i.cause:void 0}}Ga.ReadOnlyFunctionSuccessResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{okay:i.okay,result:i.result,cause:i.cause}}return Ga.ReadOnlyFunctionSuccessResponseToJSON=r,Ga}var Ka={},dC;function lU(){if(dC)return Ka;dC=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.RosettaAccountToJSON=Ka.RosettaAccountFromJSONTyped=Ka.RosettaAccountFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Ka.RosettaAccountFromJSON=n;function r(o,a){return o==null?o:{address:o.address,sub_account:(0,e.exists)(o,"sub_account")?(0,t.RosettaSubAccountFromJSON)(o.sub_account):void 0,metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Ka.RosettaAccountFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{address:o.address,sub_account:(0,t.RosettaSubAccountToJSON)(o.sub_account),metadata:o.metadata}}return Ka.RosettaAccountToJSON=i,Ka}var Qa={},fC;function dU(){if(fC)return Qa;fC=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.RosettaAccountBalanceRequestToJSON=Qa.RosettaAccountBalanceRequestFromJSONTyped=Qa.RosettaAccountBalanceRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Qa.RosettaAccountBalanceRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),account_identifier:(0,t.RosettaAccountFromJSON)(o.account_identifier),block_identifier:(0,e.exists)(o,"block_identifier")?o.block_identifier:void 0}}Qa.RosettaAccountBalanceRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),account_identifier:(0,t.RosettaAccountToJSON)(o.account_identifier),block_identifier:o.block_identifier}}return Qa.RosettaAccountBalanceRequestToJSON=i,Qa}var Ya={},hC;function fU(){if(hC)return Ya;hC=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.RosettaAccountBalanceResponseToJSON=Ya.RosettaAccountBalanceResponseFromJSONTyped=Ya.RosettaAccountBalanceResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Ya.RosettaAccountBalanceResponseFromJSON=n;function r(o,a){return o==null?o:{block_identifier:o.block_identifier,balances:o.balances.map(t.RosettaAmountFromJSON),coins:(0,e.exists)(o,"coins")?o.coins.map(t.RosettaCoinFromJSON):void 0,metadata:(0,e.exists)(o,"metadata")?(0,t.RosettaAccountBalanceResponseMetadataFromJSON)(o.metadata):void 0}}Ya.RosettaAccountBalanceResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{block_identifier:o.block_identifier,balances:o.balances.map(t.RosettaAmountToJSON),coins:o.coins===void 0?void 0:o.coins.map(t.RosettaCoinToJSON),metadata:(0,t.RosettaAccountBalanceResponseMetadataToJSON)(o.metadata)}}return Ya.RosettaAccountBalanceResponseToJSON=i,Ya}var Xa={},pC;function hU(){if(pC)return Xa;pC=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.RosettaAccountBalanceResponseCoinIdentifierToJSON=Xa.RosettaAccountBalanceResponseCoinIdentifierFromJSONTyped=Xa.RosettaAccountBalanceResponseCoinIdentifierFromJSON=void 0;function e(r){return t(r)}Xa.RosettaAccountBalanceResponseCoinIdentifierFromJSON=e;function t(r,i){return r==null?r:{identifier:r.identifier}}Xa.RosettaAccountBalanceResponseCoinIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{identifier:r.identifier}}return Xa.RosettaAccountBalanceResponseCoinIdentifierToJSON=n,Xa}var Za={},mC;function pU(){if(mC)return Za;mC=1,Object.defineProperty(Za,"__esModule",{value:!0}),Za.RosettaAccountBalanceResponseMetadataToJSON=Za.RosettaAccountBalanceResponseMetadataFromJSONTyped=Za.RosettaAccountBalanceResponseMetadataFromJSON=void 0;function e(r){return t(r)}Za.RosettaAccountBalanceResponseMetadataFromJSON=e;function t(r,i){return r==null?r:{sequence_number:r.sequence_number}}Za.RosettaAccountBalanceResponseMetadataFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{sequence_number:r.sequence_number}}return Za.RosettaAccountBalanceResponseMetadataToJSON=n,Za}var ec={},gC;function mU(){if(gC)return ec;gC=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.RosettaAccountIdentifierToJSON=ec.RosettaAccountIdentifierFromJSONTyped=ec.RosettaAccountIdentifierFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}ec.RosettaAccountIdentifierFromJSON=n;function r(o,a){return o==null?o:{address:o.address,sub_account:(0,e.exists)(o,"sub_account")?(0,t.RosettaSubAccountFromJSON)(o.sub_account):void 0,metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}ec.RosettaAccountIdentifierFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{address:o.address,sub_account:(0,t.RosettaSubAccountToJSON)(o.sub_account),metadata:o.metadata}}return ec.RosettaAccountIdentifierToJSON=i,ec}var tc={},yC;function gU(){if(yC)return tc;yC=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.RosettaAmountToJSON=tc.RosettaAmountFromJSONTyped=tc.RosettaAmountFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}tc.RosettaAmountFromJSON=n;function r(o,a){return o==null?o:{value:o.value,currency:(0,t.RosettaCurrencyFromJSON)(o.currency),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}tc.RosettaAmountFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{value:o.value,currency:(0,t.RosettaCurrencyToJSON)(o.currency),metadata:o.metadata}}return tc.RosettaAmountToJSON=i,tc}var nc={},wC;function yU(){if(wC)return nc;wC=1,Object.defineProperty(nc,"__esModule",{value:!0}),nc.RosettaBlockToJSON=nc.RosettaBlockFromJSONTyped=nc.RosettaBlockFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}nc.RosettaBlockFromJSON=n;function r(o,a){return o==null?o:{block_identifier:o.block_identifier,parent_block_identifier:(0,t.RosettaParentBlockIdentifierFromJSON)(o.parent_block_identifier),timestamp:o.timestamp,transactions:o.transactions.map(t.RosettaTransactionFromJSON),metadata:(0,e.exists)(o,"metadata")?(0,t.RosettaBlockMetadata1FromJSON)(o.metadata):void 0}}nc.RosettaBlockFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{block_identifier:o.block_identifier,parent_block_identifier:(0,t.RosettaParentBlockIdentifierToJSON)(o.parent_block_identifier),timestamp:o.timestamp,transactions:o.transactions.map(t.RosettaTransactionToJSON),metadata:(0,t.RosettaBlockMetadata1ToJSON)(o.metadata)}}return nc.RosettaBlockToJSON=i,nc}var rc={},bC;function wU(){if(bC)return rc;bC=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.RosettaBlockMetadataToJSON=rc.RosettaBlockMetadataFromJSONTyped=rc.RosettaBlockMetadataFromJSON=void 0;const e=Ie();function t(i){return n(i)}rc.RosettaBlockMetadataFromJSON=t;function n(i,o){return i==null?i:{memo:(0,e.exists)(i,"memo")?i.memo:void 0,size:(0,e.exists)(i,"size")?i.size:void 0,lockTime:(0,e.exists)(i,"lockTime")?i.lockTime:void 0}}rc.RosettaBlockMetadataFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{memo:i.memo,size:i.size,lockTime:i.lockTime}}return rc.RosettaBlockMetadataToJSON=r,rc}var ic={},SC;function bU(){if(SC)return ic;SC=1,Object.defineProperty(ic,"__esModule",{value:!0}),ic.RosettaBlockMetadata1ToJSON=ic.RosettaBlockMetadata1FromJSONTyped=ic.RosettaBlockMetadata1FromJSON=void 0;function e(r){return t(r)}ic.RosettaBlockMetadata1FromJSON=e;function t(r,i){return r==null?r:{transactions_root:r.transactions_root,difficulty:r.difficulty}}ic.RosettaBlockMetadata1FromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{transactions_root:r.transactions_root,difficulty:r.difficulty}}return ic.RosettaBlockMetadata1ToJSON=n,ic}var oc={},vC;function SU(){if(vC)return oc;vC=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.RosettaBlockRequestToJSON=oc.RosettaBlockRequestFromJSONTyped=oc.RosettaBlockRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}oc.RosettaBlockRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),block_identifier:i.block_identifier}}oc.RosettaBlockRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),block_identifier:i.block_identifier}}return oc.RosettaBlockRequestToJSON=r,oc}var sc={},xC;function vU(){if(xC)return sc;xC=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.RosettaBlockResponseToJSON=sc.RosettaBlockResponseFromJSONTyped=sc.RosettaBlockResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}sc.RosettaBlockResponseFromJSON=n;function r(o,a){return o==null?o:{block:(0,e.exists)(o,"block")?(0,t.RosettaBlockFromJSON)(o.block):void 0,other_transactions:(0,e.exists)(o,"other_transactions")?o.other_transactions.map(t.OtherTransactionIdentifierFromJSON):void 0}}sc.RosettaBlockResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{block:(0,t.RosettaBlockToJSON)(o.block),other_transactions:o.other_transactions===void 0?void 0:o.other_transactions.map(t.OtherTransactionIdentifierToJSON)}}return sc.RosettaBlockResponseToJSON=i,sc}var ac={},_C;function xU(){if(_C)return ac;_C=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.RosettaBlockTransactionRequestToJSON=ac.RosettaBlockTransactionRequestFromJSONTyped=ac.RosettaBlockTransactionRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}ac.RosettaBlockTransactionRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),block_identifier:i.block_identifier,transaction_identifier:(0,e.TransactionIdentifierFromJSON)(i.transaction_identifier)}}ac.RosettaBlockTransactionRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),block_identifier:i.block_identifier,transaction_identifier:(0,e.TransactionIdentifierToJSON)(i.transaction_identifier)}}return ac.RosettaBlockTransactionRequestToJSON=r,ac}var cc={},kC;function _U(){if(kC)return cc;kC=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.RosettaBlockTransactionResponseToJSON=cc.RosettaBlockTransactionResponseFromJSONTyped=cc.RosettaBlockTransactionResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}cc.RosettaBlockTransactionResponseFromJSON=t;function n(i,o){return i==null?i:{transaction:(0,e.RosettaTransactionFromJSON)(i.transaction)}}cc.RosettaBlockTransactionResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{transaction:(0,e.RosettaTransactionToJSON)(i.transaction)}}return cc.RosettaBlockTransactionResponseToJSON=r,cc}var uc={},RC;function kU(){if(RC)return uc;RC=1,Object.defineProperty(uc,"__esModule",{value:!0}),uc.RosettaCoinToJSON=uc.RosettaCoinFromJSONTyped=uc.RosettaCoinFromJSON=void 0;const e=Fe();function t(i){return n(i)}uc.RosettaCoinFromJSON=t;function n(i,o){return i==null?i:{coin_identifier:(0,e.RosettaAccountBalanceResponseCoinIdentifierFromJSON)(i.coin_identifier),amount:(0,e.RosettaAmountFromJSON)(i.amount)}}uc.RosettaCoinFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{coin_identifier:(0,e.RosettaAccountBalanceResponseCoinIdentifierToJSON)(i.coin_identifier),amount:(0,e.RosettaAmountToJSON)(i.amount)}}return uc.RosettaCoinToJSON=r,uc}var jv={},TC;function RU(){return TC||(TC=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RosettaCoinChangeToJSON=e.RosettaCoinChangeFromJSONTyped=e.RosettaCoinChangeFromJSON=e.RosettaCoinChangeCoinActionEnum=void 0;const t=Fe();(function(o){o.created="coin_created",o.spent="coin_spent"})(e.RosettaCoinChangeCoinActionEnum||(e.RosettaCoinChangeCoinActionEnum={}));function n(o){return r(o)}e.RosettaCoinChangeFromJSON=n;function r(o,a){return o==null?o:{coin_identifier:(0,t.RosettaAccountBalanceResponseCoinIdentifierFromJSON)(o.coin_identifier),coin_action:o.coin_action}}e.RosettaCoinChangeFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{coin_identifier:(0,t.RosettaAccountBalanceResponseCoinIdentifierToJSON)(o.coin_identifier),coin_action:o.coin_action}}e.RosettaCoinChangeToJSON=i}(jv)),jv}var lc={},OC;function TU(){if(OC)return lc;OC=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.RosettaConstructionCombineRequestToJSON=lc.RosettaConstructionCombineRequestFromJSONTyped=lc.RosettaConstructionCombineRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}lc.RosettaConstructionCombineRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),unsigned_transaction:i.unsigned_transaction,signatures:i.signatures.map(e.RosettaSignatureFromJSON)}}lc.RosettaConstructionCombineRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),unsigned_transaction:i.unsigned_transaction,signatures:i.signatures.map(e.RosettaSignatureToJSON)}}return lc.RosettaConstructionCombineRequestToJSON=r,lc}var dc={},NC;function OU(){if(NC)return dc;NC=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.RosettaConstructionCombineResponseToJSON=dc.RosettaConstructionCombineResponseFromJSONTyped=dc.RosettaConstructionCombineResponseFromJSON=void 0;function e(r){return t(r)}dc.RosettaConstructionCombineResponseFromJSON=e;function t(r,i){return r==null?r:{signed_transaction:r.signed_transaction}}dc.RosettaConstructionCombineResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{signed_transaction:r.signed_transaction}}return dc.RosettaConstructionCombineResponseToJSON=n,dc}var fc={},CC;function NU(){if(CC)return fc;CC=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.RosettaConstructionDeriveRequestToJSON=fc.RosettaConstructionDeriveRequestFromJSONTyped=fc.RosettaConstructionDeriveRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}fc.RosettaConstructionDeriveRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),public_key:(0,t.RosettaPublicKeyFromJSON)(o.public_key),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}fc.RosettaConstructionDeriveRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),public_key:(0,t.RosettaPublicKeyToJSON)(o.public_key),metadata:o.metadata}}return fc.RosettaConstructionDeriveRequestToJSON=i,fc}var hc={},EC;function CU(){if(EC)return hc;EC=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.RosettaConstructionDeriveResponseToJSON=hc.RosettaConstructionDeriveResponseFromJSONTyped=hc.RosettaConstructionDeriveResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}hc.RosettaConstructionDeriveResponseFromJSON=n;function r(o,a){return o==null?o:{address:(0,e.exists)(o,"address")?o.address:void 0,account_identifier:(0,e.exists)(o,"account_identifier")?(0,t.RosettaAccountIdentifierFromJSON)(o.account_identifier):void 0,metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}hc.RosettaConstructionDeriveResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{address:o.address,account_identifier:(0,t.RosettaAccountIdentifierToJSON)(o.account_identifier),metadata:o.metadata}}return hc.RosettaConstructionDeriveResponseToJSON=i,hc}var pc={},AC;function EU(){if(AC)return pc;AC=1,Object.defineProperty(pc,"__esModule",{value:!0}),pc.RosettaConstructionHashRequestToJSON=pc.RosettaConstructionHashRequestFromJSONTyped=pc.RosettaConstructionHashRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}pc.RosettaConstructionHashRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),signed_transaction:i.signed_transaction}}pc.RosettaConstructionHashRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),signed_transaction:i.signed_transaction}}return pc.RosettaConstructionHashRequestToJSON=r,pc}var mc={},FC;function AU(){if(FC)return mc;FC=1,Object.defineProperty(mc,"__esModule",{value:!0}),mc.RosettaConstructionHashResponseToJSON=mc.RosettaConstructionHashResponseFromJSONTyped=mc.RosettaConstructionHashResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}mc.RosettaConstructionHashResponseFromJSON=n;function r(o,a){return o==null?o:{transaction_identifier:(0,t.TransactionIdentifierFromJSON)(o.transaction_identifier),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}mc.RosettaConstructionHashResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{transaction_identifier:(0,t.TransactionIdentifierToJSON)(o.transaction_identifier),metadata:o.metadata}}return mc.RosettaConstructionHashResponseToJSON=i,mc}var gc={},IC;function FU(){if(IC)return gc;IC=1,Object.defineProperty(gc,"__esModule",{value:!0}),gc.RosettaConstructionMetadataRequestToJSON=gc.RosettaConstructionMetadataRequestFromJSONTyped=gc.RosettaConstructionMetadataRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}gc.RosettaConstructionMetadataRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),options:(0,t.RosettaOptionsFromJSON)(o.options),public_keys:(0,e.exists)(o,"public_keys")?o.public_keys.map(t.RosettaPublicKeyFromJSON):void 0}}gc.RosettaConstructionMetadataRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),options:(0,t.RosettaOptionsToJSON)(o.options),public_keys:o.public_keys===void 0?void 0:o.public_keys.map(t.RosettaPublicKeyToJSON)}}return gc.RosettaConstructionMetadataRequestToJSON=i,gc}var yc={},PC;function IU(){if(PC)return yc;PC=1,Object.defineProperty(yc,"__esModule",{value:!0}),yc.RosettaConstructionMetadataResponseToJSON=yc.RosettaConstructionMetadataResponseFromJSONTyped=yc.RosettaConstructionMetadataResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}yc.RosettaConstructionMetadataResponseFromJSON=n;function r(o,a){return o==null?o:{metadata:(0,t.RosettaConstructionMetadataResponseMetadataFromJSON)(o.metadata),suggested_fee:(0,e.exists)(o,"suggested_fee")?o.suggested_fee.map(t.RosettaAmountFromJSON):void 0}}yc.RosettaConstructionMetadataResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{metadata:(0,t.RosettaConstructionMetadataResponseMetadataToJSON)(o.metadata),suggested_fee:o.suggested_fee===void 0?void 0:o.suggested_fee.map(t.RosettaAmountToJSON)}}return yc.RosettaConstructionMetadataResponseToJSON=i,yc}var wc={},MC;function PU(){if(MC)return wc;MC=1,Object.defineProperty(wc,"__esModule",{value:!0}),wc.RosettaConstructionMetadataResponseMetadataToJSON=wc.RosettaConstructionMetadataResponseMetadataFromJSONTyped=wc.RosettaConstructionMetadataResponseMetadataFromJSON=void 0;const e=Ie();function t(i){return n(i)}wc.RosettaConstructionMetadataResponseMetadataFromJSON=t;function n(i,o){return i==null?i:{account_sequence:(0,e.exists)(i,"account_sequence")?i.account_sequence:void 0,recent_block_hash:(0,e.exists)(i,"recent_block_hash")?i.recent_block_hash:void 0}}wc.RosettaConstructionMetadataResponseMetadataFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{account_sequence:i.account_sequence,recent_block_hash:i.recent_block_hash}}return wc.RosettaConstructionMetadataResponseMetadataToJSON=r,wc}var bc={},LC;function MU(){if(LC)return bc;LC=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.RosettaConstructionParseRequestToJSON=bc.RosettaConstructionParseRequestFromJSONTyped=bc.RosettaConstructionParseRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}bc.RosettaConstructionParseRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),signed:i.signed,transaction:i.transaction}}bc.RosettaConstructionParseRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),signed:i.signed,transaction:i.transaction}}return bc.RosettaConstructionParseRequestToJSON=r,bc}var Sc={},BC;function LU(){if(BC)return Sc;BC=1,Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.RosettaConstructionParseResponseToJSON=Sc.RosettaConstructionParseResponseFromJSONTyped=Sc.RosettaConstructionParseResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Sc.RosettaConstructionParseResponseFromJSON=n;function r(o,a){return o==null?o:{operations:o.operations.map(t.RosettaOperationFromJSON),signers:(0,e.exists)(o,"signers")?o.signers:void 0,account_identifier_signers:(0,e.exists)(o,"account_identifier_signers")?o.account_identifier_signers.map(t.RosettaAccountIdentifierFromJSON):void 0,metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Sc.RosettaConstructionParseResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{operations:o.operations.map(t.RosettaOperationToJSON),signers:o.signers,account_identifier_signers:o.account_identifier_signers===void 0?void 0:o.account_identifier_signers.map(t.RosettaAccountIdentifierToJSON),metadata:o.metadata}}return Sc.RosettaConstructionParseResponseToJSON=i,Sc}var vc={},jC;function BU(){if(jC)return vc;jC=1,Object.defineProperty(vc,"__esModule",{value:!0}),vc.RosettaConstructionPayloadResponseToJSON=vc.RosettaConstructionPayloadResponseFromJSONTyped=vc.RosettaConstructionPayloadResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}vc.RosettaConstructionPayloadResponseFromJSON=t;function n(i,o){return i==null?i:{unsigned_transaction:i.unsigned_transaction,payloads:i.payloads.map(e.SigningPayloadFromJSON)}}vc.RosettaConstructionPayloadResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{unsigned_transaction:i.unsigned_transaction,payloads:i.payloads.map(e.SigningPayloadToJSON)}}return vc.RosettaConstructionPayloadResponseToJSON=r,vc}var xc={},DC;function jU(){if(DC)return xc;DC=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.RosettaConstructionPayloadsRequestToJSON=xc.RosettaConstructionPayloadsRequestFromJSONTyped=xc.RosettaConstructionPayloadsRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}xc.RosettaConstructionPayloadsRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),operations:o.operations.map(t.RosettaOperationFromJSON),public_keys:(0,e.exists)(o,"public_keys")?o.public_keys.map(t.RosettaPublicKeyFromJSON):void 0,metadata:(0,e.exists)(o,"metadata")?(0,t.RosettaConstructionMetadataResponseMetadataFromJSON)(o.metadata):void 0}}xc.RosettaConstructionPayloadsRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),operations:o.operations.map(t.RosettaOperationToJSON),public_keys:o.public_keys===void 0?void 0:o.public_keys.map(t.RosettaPublicKeyToJSON),metadata:(0,t.RosettaConstructionMetadataResponseMetadataToJSON)(o.metadata)}}return xc.RosettaConstructionPayloadsRequestToJSON=i,xc}var _c={},JC;function DU(){if(JC)return _c;JC=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.RosettaConstructionPreprocessRequestToJSON=_c.RosettaConstructionPreprocessRequestFromJSONTyped=_c.RosettaConstructionPreprocessRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}_c.RosettaConstructionPreprocessRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),operations:o.operations.map(t.RosettaOperationFromJSON),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0,max_fee:(0,e.exists)(o,"max_fee")?o.max_fee.map(t.RosettaMaxFeeAmountFromJSON):void 0,suggested_fee_multiplier:(0,e.exists)(o,"suggested_fee_multiplier")?o.suggested_fee_multiplier:void 0}}_c.RosettaConstructionPreprocessRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),operations:o.operations.map(t.RosettaOperationToJSON),metadata:o.metadata,max_fee:o.max_fee===void 0?void 0:o.max_fee.map(t.RosettaMaxFeeAmountToJSON),suggested_fee_multiplier:o.suggested_fee_multiplier}}return _c.RosettaConstructionPreprocessRequestToJSON=i,_c}var kc={},$C;function JU(){if($C)return kc;$C=1,Object.defineProperty(kc,"__esModule",{value:!0}),kc.RosettaConstructionPreprocessResponseToJSON=kc.RosettaConstructionPreprocessResponseFromJSONTyped=kc.RosettaConstructionPreprocessResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}kc.RosettaConstructionPreprocessResponseFromJSON=n;function r(o,a){return o==null?o:{options:(0,e.exists)(o,"options")?(0,t.RosettaOptionsFromJSON)(o.options):void 0,required_public_keys:(0,e.exists)(o,"required_public_keys")?o.required_public_keys.map(t.RosettaAccountFromJSON):void 0}}kc.RosettaConstructionPreprocessResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{options:(0,t.RosettaOptionsToJSON)(o.options),required_public_keys:o.required_public_keys===void 0?void 0:o.required_public_keys.map(t.RosettaAccountToJSON)}}return kc.RosettaConstructionPreprocessResponseToJSON=i,kc}var Rc={},qC;function $U(){if(qC)return Rc;qC=1,Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.RosettaConstructionSubmitRequestToJSON=Rc.RosettaConstructionSubmitRequestFromJSONTyped=Rc.RosettaConstructionSubmitRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}Rc.RosettaConstructionSubmitRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),signed_transaction:i.signed_transaction}}Rc.RosettaConstructionSubmitRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),signed_transaction:i.signed_transaction}}return Rc.RosettaConstructionSubmitRequestToJSON=r,Rc}var Tc={},UC;function qU(){if(UC)return Tc;UC=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.RosettaConstructionSubmitResponseToJSON=Tc.RosettaConstructionSubmitResponseFromJSONTyped=Tc.RosettaConstructionSubmitResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Tc.RosettaConstructionSubmitResponseFromJSON=n;function r(o,a){return o==null?o:{transaction_identifier:(0,t.TransactionIdentifierFromJSON)(o.transaction_identifier),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Tc.RosettaConstructionSubmitResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{transaction_identifier:(0,t.TransactionIdentifierToJSON)(o.transaction_identifier),metadata:o.metadata}}return Tc.RosettaConstructionSubmitResponseToJSON=i,Tc}var Oc={},HC;function UU(){if(HC)return Oc;HC=1,Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.RosettaCurrencyToJSON=Oc.RosettaCurrencyFromJSONTyped=Oc.RosettaCurrencyFromJSON=void 0;const e=Ie();function t(i){return n(i)}Oc.RosettaCurrencyFromJSON=t;function n(i,o){return i==null?i:{symbol:i.symbol,decimals:i.decimals,metadata:(0,e.exists)(i,"metadata")?i.metadata:void 0}}Oc.RosettaCurrencyFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{symbol:i.symbol,decimals:i.decimals,metadata:i.metadata}}return Oc.RosettaCurrencyToJSON=r,Oc}var Nc={},zC;function HU(){if(zC)return Nc;zC=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.RosettaErrorToJSON=Nc.RosettaErrorFromJSONTyped=Nc.RosettaErrorFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Nc.RosettaErrorFromJSON=n;function r(o,a){return o==null?o:{code:o.code,message:o.message,retriable:o.retriable,details:(0,e.exists)(o,"details")?(0,t.RosettaErrorDetailsFromJSON)(o.details):void 0}}Nc.RosettaErrorFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{code:o.code,message:o.message,retriable:o.retriable,details:(0,t.RosettaErrorDetailsToJSON)(o.details)}}return Nc.RosettaErrorToJSON=i,Nc}var Cc={},WC;function zU(){if(WC)return Cc;WC=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.RosettaErrorDetailsToJSON=Cc.RosettaErrorDetailsFromJSONTyped=Cc.RosettaErrorDetailsFromJSON=void 0;const e=Ie();function t(i){return n(i)}Cc.RosettaErrorDetailsFromJSON=t;function n(i,o){return i==null?i:{address:(0,e.exists)(i,"address")?i.address:void 0,error:(0,e.exists)(i,"error")?i.error:void 0}}Cc.RosettaErrorDetailsFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{address:i.address,error:i.error}}return Cc.RosettaErrorDetailsToJSON=r,Cc}var Ec={},VC;function WU(){if(VC)return Ec;VC=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.RosettaErrorNoDetailsToJSON=Ec.RosettaErrorNoDetailsFromJSONTyped=Ec.RosettaErrorNoDetailsFromJSON=void 0;function e(r){return t(r)}Ec.RosettaErrorNoDetailsFromJSON=e;function t(r,i){return r==null?r:{code:r.code,message:r.message,retriable:r.retriable}}Ec.RosettaErrorNoDetailsFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{code:r.code,message:r.message,retriable:r.retriable}}return Ec.RosettaErrorNoDetailsToJSON=n,Ec}var Ac={},GC;function VU(){if(GC)return Ac;GC=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.RosettaGenesisBlockIdentifierToJSON=Ac.RosettaGenesisBlockIdentifierFromJSONTyped=Ac.RosettaGenesisBlockIdentifierFromJSON=void 0;function e(r){return t(r)}Ac.RosettaGenesisBlockIdentifierFromJSON=e;function t(r,i){return r==null?r:{index:r.index,hash:r.hash}}Ac.RosettaGenesisBlockIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{index:r.index,hash:r.hash}}return Ac.RosettaGenesisBlockIdentifierToJSON=n,Ac}var Fc={},KC;function GU(){if(KC)return Fc;KC=1,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.RosettaMaxFeeAmountToJSON=Fc.RosettaMaxFeeAmountFromJSONTyped=Fc.RosettaMaxFeeAmountFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Fc.RosettaMaxFeeAmountFromJSON=n;function r(o,a){return o==null?o:{value:o.value,currency:(0,t.RosettaCurrencyFromJSON)(o.currency),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Fc.RosettaMaxFeeAmountFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{value:o.value,currency:(0,t.RosettaCurrencyToJSON)(o.currency),metadata:o.metadata}}return Fc.RosettaMaxFeeAmountToJSON=i,Fc}var Ic={},QC;function KU(){if(QC)return Ic;QC=1,Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.RosettaMempoolRequestToJSON=Ic.RosettaMempoolRequestFromJSONTyped=Ic.RosettaMempoolRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Ic.RosettaMempoolRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Ic.RosettaMempoolRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),metadata:o.metadata}}return Ic.RosettaMempoolRequestToJSON=i,Ic}var Pc={},YC;function QU(){if(YC)return Pc;YC=1,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.RosettaMempoolResponseToJSON=Pc.RosettaMempoolResponseFromJSONTyped=Pc.RosettaMempoolResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Pc.RosettaMempoolResponseFromJSON=n;function r(o,a){return o==null?o:{transaction_identifiers:o.transaction_identifiers.map(t.TransactionIdentifierFromJSON),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Pc.RosettaMempoolResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{transaction_identifiers:o.transaction_identifiers.map(t.TransactionIdentifierToJSON),metadata:o.metadata}}return Pc.RosettaMempoolResponseToJSON=i,Pc}var Mc={},XC;function YU(){if(XC)return Mc;XC=1,Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.RosettaMempoolTransactionRequestToJSON=Mc.RosettaMempoolTransactionRequestFromJSONTyped=Mc.RosettaMempoolTransactionRequestFromJSON=void 0;const e=Fe();function t(i){return n(i)}Mc.RosettaMempoolTransactionRequestFromJSON=t;function n(i,o){return i==null?i:{network_identifier:(0,e.NetworkIdentifierFromJSON)(i.network_identifier),transaction_identifier:(0,e.TransactionIdentifierFromJSON)(i.transaction_identifier)}}Mc.RosettaMempoolTransactionRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifier:(0,e.NetworkIdentifierToJSON)(i.network_identifier),transaction_identifier:(0,e.TransactionIdentifierToJSON)(i.transaction_identifier)}}return Mc.RosettaMempoolTransactionRequestToJSON=r,Mc}var Lc={},ZC;function XU(){if(ZC)return Lc;ZC=1,Object.defineProperty(Lc,"__esModule",{value:!0}),Lc.RosettaMempoolTransactionResponseToJSON=Lc.RosettaMempoolTransactionResponseFromJSONTyped=Lc.RosettaMempoolTransactionResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Lc.RosettaMempoolTransactionResponseFromJSON=n;function r(o,a){return o==null?o:{transaction:(0,t.RosettaTransactionFromJSON)(o.transaction),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Lc.RosettaMempoolTransactionResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{transaction:(0,t.RosettaTransactionToJSON)(o.transaction),metadata:o.metadata}}return Lc.RosettaMempoolTransactionResponseToJSON=i,Lc}var Bc={},eE;function ZU(){if(eE)return Bc;eE=1,Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.RosettaNetworkListResponseToJSON=Bc.RosettaNetworkListResponseFromJSONTyped=Bc.RosettaNetworkListResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Bc.RosettaNetworkListResponseFromJSON=t;function n(i,o){return i==null?i:{network_identifiers:i.network_identifiers.map(e.NetworkIdentifierFromJSON)}}Bc.RosettaNetworkListResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{network_identifiers:i.network_identifiers.map(e.NetworkIdentifierToJSON)}}return Bc.RosettaNetworkListResponseToJSON=r,Bc}var jc={},tE;function eH(){if(tE)return jc;tE=1,Object.defineProperty(jc,"__esModule",{value:!0}),jc.RosettaNetworkListResponseSubNetworkIdentifierToJSON=jc.RosettaNetworkListResponseSubNetworkIdentifierFromJSONTyped=jc.RosettaNetworkListResponseSubNetworkIdentifierFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}jc.RosettaNetworkListResponseSubNetworkIdentifierFromJSON=n;function r(o,a){return o==null?o:{network:o.network,metadata:(0,e.exists)(o,"metadata")?(0,t.RosettaNetworkListResponseSubNetworkIdentifierMetadataFromJSON)(o.metadata):void 0}}jc.RosettaNetworkListResponseSubNetworkIdentifierFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network:o.network,metadata:(0,t.RosettaNetworkListResponseSubNetworkIdentifierMetadataToJSON)(o.metadata)}}return jc.RosettaNetworkListResponseSubNetworkIdentifierToJSON=i,jc}var Dc={},nE;function tH(){if(nE)return Dc;nE=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataToJSON=Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataFromJSONTyped=Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataFromJSON=void 0;function e(r){return t(r)}Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataFromJSON=e;function t(r,i){return r==null?r:{producer:r.producer}}Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{producer:r.producer}}return Dc.RosettaNetworkListResponseSubNetworkIdentifierMetadataToJSON=n,Dc}var Jc={},rE;function nH(){if(rE)return Jc;rE=1,Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.RosettaNetworkOptionsResponseToJSON=Jc.RosettaNetworkOptionsResponseFromJSONTyped=Jc.RosettaNetworkOptionsResponseFromJSON=void 0;const e=Fe();function t(i){return n(i)}Jc.RosettaNetworkOptionsResponseFromJSON=t;function n(i,o){return i==null?i:{version:(0,e.RosettaNetworkOptionsResponseVersionFromJSON)(i.version),allow:(0,e.RosettaNetworkOptionsResponseAllowFromJSON)(i.allow)}}Jc.RosettaNetworkOptionsResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{version:(0,e.RosettaNetworkOptionsResponseVersionToJSON)(i.version),allow:(0,e.RosettaNetworkOptionsResponseAllowToJSON)(i.allow)}}return Jc.RosettaNetworkOptionsResponseToJSON=r,Jc}var $c={},iE;function rH(){if(iE)return $c;iE=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.RosettaNetworkOptionsResponseAllowToJSON=$c.RosettaNetworkOptionsResponseAllowFromJSONTyped=$c.RosettaNetworkOptionsResponseAllowFromJSON=void 0;const e=Fe();function t(i){return n(i)}$c.RosettaNetworkOptionsResponseAllowFromJSON=t;function n(i,o){return i==null?i:{operation_statuses:i.operation_statuses.map(e.RosettaOperationStatusFromJSON),operation_types:i.operation_types,errors:i.errors.map(e.RosettaErrorNoDetailsFromJSON),historical_balance_lookup:i.historical_balance_lookup}}$c.RosettaNetworkOptionsResponseAllowFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{operation_statuses:i.operation_statuses.map(e.RosettaOperationStatusToJSON),operation_types:i.operation_types,errors:i.errors.map(e.RosettaErrorNoDetailsToJSON),historical_balance_lookup:i.historical_balance_lookup}}return $c.RosettaNetworkOptionsResponseAllowToJSON=r,$c}var qc={},oE;function iH(){if(oE)return qc;oE=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.RosettaNetworkOptionsResponseVersionToJSON=qc.RosettaNetworkOptionsResponseVersionFromJSONTyped=qc.RosettaNetworkOptionsResponseVersionFromJSON=void 0;const e=Ie();function t(i){return n(i)}qc.RosettaNetworkOptionsResponseVersionFromJSON=t;function n(i,o){return i==null?i:{rosetta_version:i.rosetta_version,node_version:i.node_version,middleware_version:(0,e.exists)(i,"middleware_version")?i.middleware_version:void 0,metadata:(0,e.exists)(i,"metadata")?i.metadata:void 0}}qc.RosettaNetworkOptionsResponseVersionFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{rosetta_version:i.rosetta_version,node_version:i.node_version,middleware_version:i.middleware_version,metadata:i.metadata}}return qc.RosettaNetworkOptionsResponseVersionToJSON=r,qc}var Uc={},sE;function oH(){if(sE)return Uc;sE=1,Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.RosettaNetworkStatusResponseToJSON=Uc.RosettaNetworkStatusResponseFromJSONTyped=Uc.RosettaNetworkStatusResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Uc.RosettaNetworkStatusResponseFromJSON=n;function r(o,a){return o==null?o:{current_block_identifier:o.current_block_identifier,current_block_timestamp:o.current_block_timestamp,genesis_block_identifier:(0,t.RosettaGenesisBlockIdentifierFromJSON)(o.genesis_block_identifier),oldest_block_identifier:(0,e.exists)(o,"oldest_block_identifier")?(0,t.RosettaOldestBlockIdentifierFromJSON)(o.oldest_block_identifier):void 0,sync_status:(0,e.exists)(o,"sync_status")?(0,t.RosettaSyncStatusFromJSON)(o.sync_status):void 0,peers:o.peers.map(t.RosettaPeersFromJSON)}}Uc.RosettaNetworkStatusResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{current_block_identifier:o.current_block_identifier,current_block_timestamp:o.current_block_timestamp,genesis_block_identifier:(0,t.RosettaGenesisBlockIdentifierToJSON)(o.genesis_block_identifier),oldest_block_identifier:(0,t.RosettaOldestBlockIdentifierToJSON)(o.oldest_block_identifier),sync_status:(0,t.RosettaSyncStatusToJSON)(o.sync_status),peers:o.peers.map(t.RosettaPeersToJSON)}}return Uc.RosettaNetworkStatusResponseToJSON=i,Uc}var Hc={},aE;function sH(){if(aE)return Hc;aE=1,Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.RosettaOldestBlockIdentifierToJSON=Hc.RosettaOldestBlockIdentifierFromJSONTyped=Hc.RosettaOldestBlockIdentifierFromJSON=void 0;function e(r){return t(r)}Hc.RosettaOldestBlockIdentifierFromJSON=e;function t(r,i){return r==null?r:{index:r.index,hash:r.hash}}Hc.RosettaOldestBlockIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{index:r.index,hash:r.hash}}return Hc.RosettaOldestBlockIdentifierToJSON=n,Hc}var zc={},cE;function aH(){if(cE)return zc;cE=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.RosettaOperationToJSON=zc.RosettaOperationFromJSONTyped=zc.RosettaOperationFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}zc.RosettaOperationFromJSON=n;function r(o,a){return o==null?o:{operation_identifier:(0,t.RosettaOperationIdentifierFromJSON)(o.operation_identifier),related_operations:(0,e.exists)(o,"related_operations")?o.related_operations.map(t.RosettaRelatedOperationFromJSON):void 0,type:o.type,status:(0,e.exists)(o,"status")?o.status:void 0,account:(0,e.exists)(o,"account")?(0,t.RosettaAccountFromJSON)(o.account):void 0,amount:(0,e.exists)(o,"amount")?(0,t.RosettaAmountFromJSON)(o.amount):void 0,coin_change:(0,e.exists)(o,"coin_change")?(0,t.RosettaCoinChangeFromJSON)(o.coin_change):void 0,metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}zc.RosettaOperationFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{operation_identifier:(0,t.RosettaOperationIdentifierToJSON)(o.operation_identifier),related_operations:o.related_operations===void 0?void 0:o.related_operations.map(t.RosettaRelatedOperationToJSON),type:o.type,status:o.status,account:(0,t.RosettaAccountToJSON)(o.account),amount:(0,t.RosettaAmountToJSON)(o.amount),coin_change:(0,t.RosettaCoinChangeToJSON)(o.coin_change),metadata:o.metadata}}return zc.RosettaOperationToJSON=i,zc}var Wc={},uE;function cH(){if(uE)return Wc;uE=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.RosettaOperationIdentifierToJSON=Wc.RosettaOperationIdentifierFromJSONTyped=Wc.RosettaOperationIdentifierFromJSON=void 0;const e=Ie();function t(i){return n(i)}Wc.RosettaOperationIdentifierFromJSON=t;function n(i,o){return i==null?i:{index:i.index,network_index:(0,e.exists)(i,"network_index")?i.network_index:void 0}}Wc.RosettaOperationIdentifierFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{index:i.index,network_index:i.network_index}}return Wc.RosettaOperationIdentifierToJSON=r,Wc}var Vc={},lE;function uH(){if(lE)return Vc;lE=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.RosettaOperationStatusToJSON=Vc.RosettaOperationStatusFromJSONTyped=Vc.RosettaOperationStatusFromJSON=void 0;function e(r){return t(r)}Vc.RosettaOperationStatusFromJSON=e;function t(r,i){return r==null?r:{status:r.status,successful:r.successful}}Vc.RosettaOperationStatusFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{status:r.status,successful:r.successful}}return Vc.RosettaOperationStatusToJSON=n,Vc}var Gc={},dE;function lH(){if(dE)return Gc;dE=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.RosettaOptionsToJSON=Gc.RosettaOptionsFromJSONTyped=Gc.RosettaOptionsFromJSON=void 0;const e=Ie();function t(i){return n(i)}Gc.RosettaOptionsFromJSON=t;function n(i,o){return i==null?i:{sender_address:(0,e.exists)(i,"sender_address")?i.sender_address:void 0,type:(0,e.exists)(i,"type")?i.type:void 0,status:(0,e.exists)(i,"status")?i.status:void 0,token_transfer_recipient_address:(0,e.exists)(i,"token_transfer_recipient_address")?i.token_transfer_recipient_address:void 0,amount:(0,e.exists)(i,"amount")?i.amount:void 0,symbol:(0,e.exists)(i,"symbol")?i.symbol:void 0,decimals:(0,e.exists)(i,"decimals")?i.decimals:void 0,gas_limit:(0,e.exists)(i,"gas_limit")?i.gas_limit:void 0,gas_price:(0,e.exists)(i,"gas_price")?i.gas_price:void 0,suggested_fee_multiplier:(0,e.exists)(i,"suggested_fee_multiplier")?i.suggested_fee_multiplier:void 0,max_fee:(0,e.exists)(i,"max_fee")?i.max_fee:void 0,fee:(0,e.exists)(i,"fee")?i.fee:void 0,size:(0,e.exists)(i,"size")?i.size:void 0,memo:(0,e.exists)(i,"memo")?i.memo:void 0,number_of_cycles:(0,e.exists)(i,"number_of_cycles")?i.number_of_cycles:void 0,contract_address:(0,e.exists)(i,"contract_address")?i.contract_address:void 0,contract_name:(0,e.exists)(i,"contract_name")?i.contract_name:void 0,burn_block_height:(0,e.exists)(i,"burn_block_height")?i.burn_block_height:void 0,delegate_to:(0,e.exists)(i,"delegate_to")?i.delegate_to:void 0,pox_addr:(0,e.exists)(i,"pox_addr")?i.pox_addr:void 0}}Gc.RosettaOptionsFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{sender_address:i.sender_address,type:i.type,status:i.status,token_transfer_recipient_address:i.token_transfer_recipient_address,amount:i.amount,symbol:i.symbol,decimals:i.decimals,gas_limit:i.gas_limit,gas_price:i.gas_price,suggested_fee_multiplier:i.suggested_fee_multiplier,max_fee:i.max_fee,fee:i.fee,size:i.size,memo:i.memo,number_of_cycles:i.number_of_cycles,contract_address:i.contract_address,contract_name:i.contract_name,burn_block_height:i.burn_block_height,delegate_to:i.delegate_to,pox_addr:i.pox_addr}}return Gc.RosettaOptionsToJSON=r,Gc}var Kc={},fE;function dH(){if(fE)return Kc;fE=1,Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.RosettaOptionsRequestToJSON=Kc.RosettaOptionsRequestFromJSONTyped=Kc.RosettaOptionsRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Kc.RosettaOptionsRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Kc.RosettaOptionsRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),metadata:o.metadata}}return Kc.RosettaOptionsRequestToJSON=i,Kc}var Qc={},hE;function fH(){if(hE)return Qc;hE=1,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.RosettaParentBlockIdentifierToJSON=Qc.RosettaParentBlockIdentifierFromJSONTyped=Qc.RosettaParentBlockIdentifierFromJSON=void 0;function e(r){return t(r)}Qc.RosettaParentBlockIdentifierFromJSON=e;function t(r,i){return r==null?r:{index:r.index,hash:r.hash}}Qc.RosettaParentBlockIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{index:r.index,hash:r.hash}}return Qc.RosettaParentBlockIdentifierToJSON=n,Qc}var Yc={},pE;function hH(){if(pE)return Yc;pE=1,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.RosettaPeersToJSON=Yc.RosettaPeersFromJSONTyped=Yc.RosettaPeersFromJSON=void 0;const e=Ie();function t(i){return n(i)}Yc.RosettaPeersFromJSON=t;function n(i,o){return i==null?i:{peer_id:i.peer_id,metadata:(0,e.exists)(i,"metadata")?i.metadata:void 0}}Yc.RosettaPeersFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{peer_id:i.peer_id,metadata:i.metadata}}return Yc.RosettaPeersToJSON=r,Yc}var Dv={},mE;function pH(){return mE||(mE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RosettaPublicKeyToJSON=e.RosettaPublicKeyFromJSONTyped=e.RosettaPublicKeyFromJSON=e.RosettaPublicKeyCurveTypeEnum=void 0,function(i){i.secp256k1="secp256k1",i.edwards25519="edwards25519"}(e.RosettaPublicKeyCurveTypeEnum||(e.RosettaPublicKeyCurveTypeEnum={}));function t(i){return n(i)}e.RosettaPublicKeyFromJSON=t;function n(i,o){return i==null?i:{hex_bytes:i.hex_bytes,curve_type:i.curve_type}}e.RosettaPublicKeyFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{hex_bytes:i.hex_bytes,curve_type:i.curve_type}}e.RosettaPublicKeyToJSON=r}(Dv)),Dv}var Xc={},gE;function mH(){if(gE)return Xc;gE=1,Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.RosettaRelatedOperationToJSON=Xc.RosettaRelatedOperationFromJSONTyped=Xc.RosettaRelatedOperationFromJSON=void 0;const e=Ie();function t(i){return n(i)}Xc.RosettaRelatedOperationFromJSON=t;function n(i,o){return i==null?i:{index:i.index,network_index:(0,e.exists)(i,"network_index")?i.network_index:void 0}}Xc.RosettaRelatedOperationFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{index:i.index,network_index:i.network_index}}return Xc.RosettaRelatedOperationToJSON=r,Xc}var Jv={},yE;function gH(){return yE||(yE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RosettaSignatureToJSON=e.RosettaSignatureFromJSONTyped=e.RosettaSignatureFromJSON=e.RosettaSignatureSignatureTypeEnum=void 0;const t=Fe();(function(o){o.ecdsa="ecdsa",o.ecdsa_recovery="ecdsa_recovery",o.ed25519="ed25519",o.schnorr_1="schnorr_1",o.schnorr_poseidon="schnorr_poseidon"})(e.RosettaSignatureSignatureTypeEnum||(e.RosettaSignatureSignatureTypeEnum={}));function n(o){return r(o)}e.RosettaSignatureFromJSON=n;function r(o,a){return o==null?o:{signing_payload:(0,t.SigningPayloadFromJSON)(o.signing_payload),public_key:(0,t.RosettaPublicKeyFromJSON)(o.public_key),signature_type:o.signature_type,hex_bytes:o.hex_bytes}}e.RosettaSignatureFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{signing_payload:(0,t.SigningPayloadToJSON)(o.signing_payload),public_key:(0,t.RosettaPublicKeyToJSON)(o.public_key),signature_type:o.signature_type,hex_bytes:o.hex_bytes}}e.RosettaSignatureToJSON=i}(Jv)),Jv}var Zc={},wE;function yH(){if(wE)return Zc;wE=1,Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.RosettaStatusRequestToJSON=Zc.RosettaStatusRequestFromJSONTyped=Zc.RosettaStatusRequestFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}Zc.RosettaStatusRequestFromJSON=n;function r(o,a){return o==null?o:{network_identifier:(0,t.NetworkIdentifierFromJSON)(o.network_identifier),metadata:(0,e.exists)(o,"metadata")?o.metadata:void 0}}Zc.RosettaStatusRequestFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{network_identifier:(0,t.NetworkIdentifierToJSON)(o.network_identifier),metadata:o.metadata}}return Zc.RosettaStatusRequestToJSON=i,Zc}var eu={},bE;function wH(){if(bE)return eu;bE=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.RosettaSubAccountToJSON=eu.RosettaSubAccountFromJSONTyped=eu.RosettaSubAccountFromJSON=void 0;const e=Ie();function t(i){return n(i)}eu.RosettaSubAccountFromJSON=t;function n(i,o){return i==null?i:{address:i.address,metadata:(0,e.exists)(i,"metadata")?i.metadata:void 0}}eu.RosettaSubAccountFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{address:i.address,metadata:i.metadata}}return eu.RosettaSubAccountToJSON=r,eu}var tu={},SE;function bH(){if(SE)return tu;SE=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.RosettaSyncStatusToJSON=tu.RosettaSyncStatusFromJSONTyped=tu.RosettaSyncStatusFromJSON=void 0;const e=Ie();function t(i){return n(i)}tu.RosettaSyncStatusFromJSON=t;function n(i,o){return i==null?i:{current_index:i.current_index,target_index:(0,e.exists)(i,"target_index")?i.target_index:void 0,stage:(0,e.exists)(i,"stage")?i.stage:void 0,synced:(0,e.exists)(i,"synced")?i.synced:void 0}}tu.RosettaSyncStatusFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{current_index:i.current_index,target_index:i.target_index,stage:i.stage,synced:i.synced}}return tu.RosettaSyncStatusToJSON=r,tu}var nu={},vE;function SH(){if(vE)return nu;vE=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.RosettaTransactionToJSON=nu.RosettaTransactionFromJSONTyped=nu.RosettaTransactionFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}nu.RosettaTransactionFromJSON=n;function r(o,a){return o==null?o:{transaction_identifier:(0,t.TransactionIdentifierFromJSON)(o.transaction_identifier),operations:o.operations.map(t.RosettaOperationFromJSON),metadata:(0,e.exists)(o,"metadata")?(0,t.RosettaBlockMetadataFromJSON)(o.metadata):void 0}}nu.RosettaTransactionFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{transaction_identifier:(0,t.TransactionIdentifierToJSON)(o.transaction_identifier),operations:o.operations.map(t.RosettaOperationToJSON),metadata:(0,t.RosettaBlockMetadataToJSON)(o.metadata)}}return nu.RosettaTransactionToJSON=i,nu}var ru={},xE;function vH(){if(xE)return ru;xE=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.RunFaucetResponseToJSON=ru.RunFaucetResponseFromJSONTyped=ru.RunFaucetResponseFromJSON=void 0;const e=Ie();function t(i){return n(i)}ru.RunFaucetResponseFromJSON=t;function n(i,o){return i==null?i:{success:i.success,txId:(0,e.exists)(i,"txId")?i.txId:void 0,txRaw:(0,e.exists)(i,"txRaw")?i.txRaw:void 0}}ru.RunFaucetResponseFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{success:i.success,txId:i.txId,txRaw:i.txRaw}}return ru.RunFaucetResponseToJSON=r,ru}var iu={},_E;function xH(){if(_E)return iu;_E=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.ServerStatusResponseToJSON=iu.ServerStatusResponseFromJSONTyped=iu.ServerStatusResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}iu.ServerStatusResponseFromJSON=n;function r(o,a){return o==null?o:{server_version:(0,e.exists)(o,"server_version")?o.server_version:void 0,status:o.status,pox_v1_unlock_height:(0,e.exists)(o,"pox_v1_unlock_height")?o.pox_v1_unlock_height:void 0,pox_v2_unlock_height:(0,e.exists)(o,"pox_v2_unlock_height")?o.pox_v2_unlock_height:void 0,chain_tip:(0,e.exists)(o,"chain_tip")?(0,t.ChainTipFromJSON)(o.chain_tip):void 0}}iu.ServerStatusResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{server_version:o.server_version,status:o.status,pox_v1_unlock_height:o.pox_v1_unlock_height,pox_v2_unlock_height:o.pox_v2_unlock_height,chain_tip:(0,t.ChainTipToJSON)(o.chain_tip)}}return iu.ServerStatusResponseToJSON=i,iu}var $v={},kE;function _H(){return kE||(kE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SigningPayloadToJSON=e.SigningPayloadFromJSONTyped=e.SigningPayloadFromJSON=e.SigningPayloadSignatureTypeEnum=void 0;const t=Ie(),n=Fe();(function(a){a.ecdsa="ecdsa",a.ecdsa_recovery="ecdsa_recovery",a.ed25519="ed25519",a.schnorr_1="schnorr_1",a.schnorr_poseidon="schnorr_poseidon"})(e.SigningPayloadSignatureTypeEnum||(e.SigningPayloadSignatureTypeEnum={}));function r(a){return i(a)}e.SigningPayloadFromJSON=r;function i(a,u){return a==null?a:{address:(0,t.exists)(a,"address")?a.address:void 0,account_identifier:(0,t.exists)(a,"account_identifier")?(0,n.RosettaAccountFromJSON)(a.account_identifier):void 0,hex_bytes:a.hex_bytes,signature_type:(0,t.exists)(a,"signature_type")?a.signature_type:void 0}}e.SigningPayloadFromJSONTyped=i;function o(a){if(a!==void 0)return a===null?null:{address:a.address,account_identifier:(0,n.RosettaAccountToJSON)(a.account_identifier),hex_bytes:a.hex_bytes,signature_type:a.signature_type}}e.SigningPayloadToJSON=o}($v)),$v}var ou={},RE;function kH(){if(RE)return ou;RE=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.SmartContractToJSON=ou.SmartContractFromJSONTyped=ou.SmartContractFromJSON=void 0;function e(r){return t(r)}ou.SmartContractFromJSON=e;function t(r,i){return r==null?r:{tx_id:r.tx_id,canonical:r.canonical,contract_id:r.contract_id,block_height:r.block_height,source_code:r.source_code,abi:r.abi}}ou.SmartContractFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{tx_id:r.tx_id,canonical:r.canonical,contract_id:r.contract_id,block_height:r.block_height,source_code:r.source_code,abi:r.abi}}return ou.SmartContractToJSON=n,ou}var su={},TE;function RH(){if(TE)return su;TE=1,Object.defineProperty(su,"__esModule",{value:!0}),su.StxBalanceToJSON=su.StxBalanceFromJSONTyped=su.StxBalanceFromJSON=void 0;function e(r){return t(r)}su.StxBalanceFromJSON=e;function t(r,i){return r==null?r:{balance:r.balance,total_sent:r.total_sent,total_received:r.total_received,total_fees_sent:r.total_fees_sent,total_miner_rewards_received:r.total_miner_rewards_received,lock_tx_id:r.lock_tx_id,locked:r.locked,lock_height:r.lock_height,burnchain_lock_height:r.burnchain_lock_height,burnchain_unlock_height:r.burnchain_unlock_height}}su.StxBalanceFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{balance:r.balance,total_sent:r.total_sent,total_received:r.total_received,total_fees_sent:r.total_fees_sent,total_miner_rewards_received:r.total_miner_rewards_received,lock_tx_id:r.lock_tx_id,locked:r.locked,lock_height:r.lock_height,burnchain_lock_height:r.burnchain_lock_height,burnchain_unlock_height:r.burnchain_unlock_height}}return su.StxBalanceToJSON=n,su}var au={},OE;function TH(){if(OE)return au;OE=1,Object.defineProperty(au,"__esModule",{value:!0}),au.TargetBlockTimeToJSON=au.TargetBlockTimeFromJSONTyped=au.TargetBlockTimeFromJSON=void 0;function e(r){return t(r)}au.TargetBlockTimeFromJSON=e;function t(r,i){return r==null?r:{target_block_time:r.target_block_time}}au.TargetBlockTimeFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{target_block_time:r.target_block_time}}return au.TargetBlockTimeToJSON=n,au}var cu={},NE;function OH(){if(NE)return cu;NE=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.TransactionEventsResponseToJSON=cu.TransactionEventsResponseFromJSONTyped=cu.TransactionEventsResponseFromJSON=void 0;function e(r){return t(r)}cu.TransactionEventsResponseFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,results:r.results}}cu.TransactionEventsResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,results:r.results}}return cu.TransactionEventsResponseToJSON=n,cu}var uu={},CE;function NH(){if(CE)return uu;CE=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.TransactionFeeEstimateRequestToJSON=uu.TransactionFeeEstimateRequestFromJSONTyped=uu.TransactionFeeEstimateRequestFromJSON=void 0;const e=Ie();function t(i){return n(i)}uu.TransactionFeeEstimateRequestFromJSON=t;function n(i,o){return i==null?i:{transaction_payload:i.transaction_payload,estimated_len:(0,e.exists)(i,"estimated_len")?i.estimated_len:void 0}}uu.TransactionFeeEstimateRequestFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{transaction_payload:i.transaction_payload,estimated_len:i.estimated_len}}return uu.TransactionFeeEstimateRequestToJSON=r,uu}var lu={},EE;function CH(){if(EE)return lu;EE=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.TransactionFeeEstimateResponseToJSON=lu.TransactionFeeEstimateResponseFromJSONTyped=lu.TransactionFeeEstimateResponseFromJSON=void 0;const e=Ie(),t=Fe();function n(o){return r(o)}lu.TransactionFeeEstimateResponseFromJSON=n;function r(o,a){return o==null?o:{estimated_cost_scalar:o.estimated_cost_scalar,cost_scalar_change_by_byte:(0,e.exists)(o,"cost_scalar_change_by_byte")?o.cost_scalar_change_by_byte:void 0,estimated_cost:(0,t.TransactionFeeEstimateResponseEstimatedCostFromJSON)(o.estimated_cost),estimations:(0,e.exists)(o,"estimations")?o.estimations.map(t.TransactionFeeEstimateResponseEstimationsFromJSON):void 0}}lu.TransactionFeeEstimateResponseFromJSONTyped=r;function i(o){if(o!==void 0)return o===null?null:{estimated_cost_scalar:o.estimated_cost_scalar,cost_scalar_change_by_byte:o.cost_scalar_change_by_byte,estimated_cost:(0,t.TransactionFeeEstimateResponseEstimatedCostToJSON)(o.estimated_cost),estimations:o.estimations===void 0?void 0:o.estimations.map(t.TransactionFeeEstimateResponseEstimationsToJSON)}}return lu.TransactionFeeEstimateResponseToJSON=i,lu}var du={},AE;function EH(){if(AE)return du;AE=1,Object.defineProperty(du,"__esModule",{value:!0}),du.TransactionFeeEstimateResponseEstimatedCostToJSON=du.TransactionFeeEstimateResponseEstimatedCostFromJSONTyped=du.TransactionFeeEstimateResponseEstimatedCostFromJSON=void 0;function e(r){return t(r)}du.TransactionFeeEstimateResponseEstimatedCostFromJSON=e;function t(r,i){return r==null?r:{read_count:r.read_count,read_length:r.read_length,runtime:r.runtime,write_count:r.write_count,write_length:r.write_length}}du.TransactionFeeEstimateResponseEstimatedCostFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{read_count:r.read_count,read_length:r.read_length,runtime:r.runtime,write_count:r.write_count,write_length:r.write_length}}return du.TransactionFeeEstimateResponseEstimatedCostToJSON=n,du}var fu={},FE;function AH(){if(FE)return fu;FE=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.TransactionFeeEstimateResponseEstimationsToJSON=fu.TransactionFeeEstimateResponseEstimationsFromJSONTyped=fu.TransactionFeeEstimateResponseEstimationsFromJSON=void 0;const e=Ie();function t(i){return n(i)}fu.TransactionFeeEstimateResponseEstimationsFromJSON=t;function n(i,o){return i==null?i:{fee_rate:(0,e.exists)(i,"fee_rate")?i.fee_rate:void 0,fee:(0,e.exists)(i,"fee")?i.fee:void 0}}fu.TransactionFeeEstimateResponseEstimationsFromJSONTyped=n;function r(i){if(i!==void 0)return i===null?null:{fee_rate:i.fee_rate,fee:i.fee}}return fu.TransactionFeeEstimateResponseEstimationsToJSON=r,fu}var hu={},IE;function FH(){if(IE)return hu;IE=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.TransactionIdentifierToJSON=hu.TransactionIdentifierFromJSONTyped=hu.TransactionIdentifierFromJSON=void 0;function e(r){return t(r)}hu.TransactionIdentifierFromJSON=e;function t(r,i){return r==null?r:{hash:r.hash}}hu.TransactionIdentifierFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{hash:r.hash}}return hu.TransactionIdentifierToJSON=n,hu}var pu={},PE;function IH(){if(PE)return pu;PE=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.TransactionResultsToJSON=pu.TransactionResultsFromJSONTyped=pu.TransactionResultsFromJSON=void 0;function e(r){return t(r)}pu.TransactionResultsFromJSON=e;function t(r,i){return r==null?r:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}pu.TransactionResultsFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{limit:r.limit,offset:r.offset,total:r.total,results:r.results}}return pu.TransactionResultsToJSON=n,pu}var mu={},ME;function PH(){if(ME)return mu;ME=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.UnanchoredTransactionListResponseToJSON=mu.UnanchoredTransactionListResponseFromJSONTyped=mu.UnanchoredTransactionListResponseFromJSON=void 0;function e(r){return t(r)}mu.UnanchoredTransactionListResponseFromJSON=e;function t(r,i){return r==null?r:{total:r.total,results:r.results}}mu.UnanchoredTransactionListResponseFromJSONTyped=t;function n(r){if(r!==void 0)return r===null?null:{total:r.total,results:r.results}}return mu.UnanchoredTransactionListResponseToJSON=n,mu}var LE;function Fe(){return LE||(LE=1,function(e){var t=kd&&kd.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(i,o);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,a,u)}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=kd&&kd.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(V7(),e),n(G7(),e),n(K7(),e),n(Q7(),e),n(Y7(),e),n(X7(),e),n(Z7(),e),n(eq(),e),n(tq(),e),n(nq(),e),n(rq(),e),n(iq(),e),n(oq(),e),n(sq(),e),n(aq(),e),n(cq(),e),n(uq(),e),n(lq(),e),n(dq(),e),n(fq(),e),n(hq(),e),n(pq(),e),n(mq(),e),n(gq(),e),n(yq(),e),n(wq(),e),n(bq(),e),n(Sq(),e),n(vq(),e),n(xq(),e),n(_q(),e),n(kq(),e),n(Rq(),e),n(Tq(),e),n(Oq(),e),n(Nq(),e),n(Cq(),e),n(Eq(),e),n(Aq(),e),n(Fq(),e),n(Iq(),e),n(Pq(),e),n(Mq(),e),n(Lq(),e),n(Bq(),e),n(jq(),e),n(Dq(),e),n(Jq(),e),n($q(),e),n(qq(),e),n(Uq(),e),n(Hq(),e),n(zq(),e),n(Wq(),e),n(Vq(),e),n(Gq(),e),n(Kq(),e),n(Qq(),e),n(Yq(),e),n(Xq(),e),n(Zq(),e),n(eU(),e),n(tU(),e),n(nU(),e),n(rU(),e),n(iU(),e),n(oU(),e),n(sU(),e),n(aU(),e),n(cU(),e),n(uU(),e),n(lU(),e),n(dU(),e),n(fU(),e),n(hU(),e),n(pU(),e),n(mU(),e),n(gU(),e),n(yU(),e),n(wU(),e),n(bU(),e),n(SU(),e),n(vU(),e),n(xU(),e),n(_U(),e),n(kU(),e),n(RU(),e),n(TU(),e),n(OU(),e),n(NU(),e),n(CU(),e),n(EU(),e),n(AU(),e),n(FU(),e),n(IU(),e),n(PU(),e),n(MU(),e),n(LU(),e),n(BU(),e),n(jU(),e),n(DU(),e),n(JU(),e),n($U(),e),n(qU(),e),n(UU(),e),n(HU(),e),n(zU(),e),n(WU(),e),n(VU(),e),n(GU(),e),n(KU(),e),n(QU(),e),n(YU(),e),n(XU(),e),n(ZU(),e),n(eH(),e),n(tH(),e),n(nH(),e),n(rH(),e),n(iH(),e),n(oH(),e),n(sH(),e),n(aH(),e),n(cH(),e),n(uH(),e),n(lH(),e),n(dH(),e),n(fH(),e),n(hH(),e),n(pH(),e),n(mH(),e),n(gH(),e),n(yH(),e),n(wH(),e),n(bH(),e),n(SH(),e),n(vH(),e),n(xH(),e),n(_H(),e),n(kH(),e),n(RH(),e),n(TH(),e),n(OH(),e),n(NH(),e),n(CH(),e),n(EH(),e),n(AH(),e),n(FH(),e),n(IH(),e),n(PH(),e)}(kd)),kd}var BE;function MH(){if(BE)return rm;BE=1,Object.defineProperty(rm,"__esModule",{value:!0}),rm.AccountsApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getAccountAssetsRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountAssets.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/assets".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressAssetsListResponseFromJSON)(f))}async getAccountAssets(i,o){return await(await this.getAccountAssetsRaw(i,o)).value()}async getAccountBalanceRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountBalance.");const a={};i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/balances".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressBalanceResponseFromJSON)(f))}async getAccountBalance(i,o){return await(await this.getAccountBalanceRaw(i,o)).value()}async getAccountInboundRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountInbound.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.height!==void 0&&(a.height=i.height),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/stx_inbound".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressStxInboundListResponseFromJSON)(f))}async getAccountInbound(i,o){return await(await this.getAccountInboundRaw(i,o)).value()}async getAccountInfoRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountInfo.");const a={};i.proof!==void 0&&(a.proof=i.proof),i.tip!==void 0&&(a.tip=i.tip);const u={},l=await this.request({path:"/v2/accounts/{principal}".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AccountDataResponseFromJSON)(f))}async getAccountInfo(i,o){return await(await this.getAccountInfoRaw(i,o)).value()}async getAccountNftRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountNft.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/nft_events".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressNftListResponseFromJSON)(f))}async getAccountNft(i,o){return await(await this.getAccountNftRaw(i,o)).value()}async getAccountNoncesRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountNonces.");const a={};i.blockHeight!==void 0&&(a.block_height=i.blockHeight),i.blockHash!==void 0&&(a.block_hash=i.blockHash);const u={},l=await this.request({path:"/extended/v1/address/{principal}/nonces".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressNoncesFromJSON)(f))}async getAccountNonces(i,o){return await(await this.getAccountNoncesRaw(i,o)).value()}async getAccountStxBalanceRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountStxBalance.");const a={};i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/stx".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async getAccountStxBalance(i,o){return await(await this.getAccountStxBalanceRaw(i,o)).value()}async getAccountTransactionsRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountTransactions.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.height!==void 0&&(a.height=i.height),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/transactions".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressTransactionsListResponseFromJSON)(f))}async getAccountTransactions(i,o){return await(await this.getAccountTransactionsRaw(i,o)).value()}async getAccountTransactionsWithTransfersRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountTransactionsWithTransfers.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.height!==void 0&&(a.height=i.height),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.untilBlock!==void 0&&(a.until_block=i.untilBlock);const u={},l=await this.request({path:"/extended/v1/address/{principal}/transactions_with_transfers".replace("{principal}",encodeURIComponent(String(i.principal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressTransactionsWithTransfersListResponseFromJSON)(f))}async getAccountTransactionsWithTransfers(i,o){return await(await this.getAccountTransactionsWithTransfersRaw(i,o)).value()}async getSingleTransactionWithTransfersRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getSingleTransactionWithTransfers.");if(i.txId===null||i.txId===void 0)throw new e.RequiredError("txId","Required parameter requestParameters.txId was null or undefined when calling getSingleTransactionWithTransfers.");const a={},u={},l=await this.request({path:"/extended/v1/address/{principal}/{tx_id}/with_transfers".replace("{principal}",encodeURIComponent(String(i.principal))).replace("{tx_id}",encodeURIComponent(String(i.txId))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.AddressTransactionWithTransfersFromJSON)(f))}async getSingleTransactionWithTransfers(i,o){return await(await this.getSingleTransactionWithTransfersRaw(i,o)).value()}};return rm.AccountsApi=n,rm}var im={},jE;function LH(){if(jE)return im;jE=1,Object.defineProperty(im,"__esModule",{value:!0}),im.BlocksApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getBlockByBurnBlockHashRaw(i,o){if(i.burnBlockHash===null||i.burnBlockHash===void 0)throw new e.RequiredError("burnBlockHash","Required parameter requestParameters.burnBlockHash was null or undefined when calling getBlockByBurnBlockHash.");const a={},u={},l=await this.request({path:"/extended/v1/block/by_burn_block_hash/{burn_block_hash}".replace("{burn_block_hash}",encodeURIComponent(String(i.burnBlockHash))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BlockFromJSON)(f))}async getBlockByBurnBlockHash(i,o){return await(await this.getBlockByBurnBlockHashRaw(i,o)).value()}async getBlockByBurnBlockHeightRaw(i,o){if(i.burnBlockHeight===null||i.burnBlockHeight===void 0)throw new e.RequiredError("burnBlockHeight","Required parameter requestParameters.burnBlockHeight was null or undefined when calling getBlockByBurnBlockHeight.");const a={},u={},l=await this.request({path:"/extended/v1/block/by_burn_block_height/{burn_block_height}".replace("{burn_block_height}",encodeURIComponent(String(i.burnBlockHeight))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BlockFromJSON)(f))}async getBlockByBurnBlockHeight(i,o){return await(await this.getBlockByBurnBlockHeightRaw(i,o)).value()}async getBlockByHashRaw(i,o){if(i.hash===null||i.hash===void 0)throw new e.RequiredError("hash","Required parameter requestParameters.hash was null or undefined when calling getBlockByHash.");const a={},u={},l=await this.request({path:"/extended/v1/block/{hash}".replace("{hash}",encodeURIComponent(String(i.hash))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BlockFromJSON)(f))}async getBlockByHash(i,o){return await(await this.getBlockByHashRaw(i,o)).value()}async getBlockByHeightRaw(i,o){if(i.height===null||i.height===void 0)throw new e.RequiredError("height","Required parameter requestParameters.height was null or undefined when calling getBlockByHeight.");const a={},u={},l=await this.request({path:"/extended/v1/block/by_height/{height}".replace("{height}",encodeURIComponent(String(i.height))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BlockFromJSON)(f))}async getBlockByHeight(i,o){return await(await this.getBlockByHeightRaw(i,o)).value()}async getBlockListRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/block",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BlockListResponseFromJSON)(f))}async getBlockList(i,o){return await(await this.getBlockListRaw(i,o)).value()}};return im.BlocksApi=n,im}var om={},DE;function BH(){if(DE)return om;DE=1,Object.defineProperty(om,"__esModule",{value:!0}),om.FaucetsApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async runFaucetBtcRaw(i,o){if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling runFaucetBtc.");const a={};i.address!==void 0&&(a.address=i.address);const u={};u["Content-Type"]="application/json";const l=await this.request({path:"/extended/v1/faucets/btc",method:"POST",headers:u,query:a,body:(0,t.InlineObject1ToJSON)(i.inlineObject1)},o);return new e.JSONApiResponse(l,f=>(0,t.RunFaucetResponseFromJSON)(f))}async runFaucetBtc(i,o){return await(await this.runFaucetBtcRaw(i,o)).value()}async runFaucetStxRaw(i,o){if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling runFaucetStx.");const a={};i.address!==void 0&&(a.address=i.address),i.stacking!==void 0&&(a.stacking=i.stacking);const u={};u["Content-Type"]="application/json";const l=await this.request({path:"/extended/v1/faucets/stx",method:"POST",headers:u,query:a,body:(0,t.InlineObjectToJSON)(i.inlineObject)},o);return new e.JSONApiResponse(l,f=>(0,t.RunFaucetResponseFromJSON)(f))}async runFaucetStx(i,o){return await(await this.runFaucetStxRaw(i,o)).value()}};return om.FaucetsApi=n,om}var sm={},JE;function jH(){if(JE)return sm;JE=1,Object.defineProperty(sm,"__esModule",{value:!0}),sm.FeesApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async fetchFeeRateRaw(i,o){if(i.feeRateRequest===null||i.feeRateRequest===void 0)throw new e.RequiredError("feeRateRequest","Required parameter requestParameters.feeRateRequest was null or undefined when calling fetchFeeRate.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/extended/v1/fee_rate",method:"POST",headers:u,query:a,body:(0,t.FeeRateRequestToJSON)(i.feeRateRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.FeeRateFromJSON)(f))}async fetchFeeRate(i,o){return await(await this.fetchFeeRateRaw(i,o)).value()}async getFeeTransferRaw(i){const o={},a={},u=await this.request({path:"/v2/fees/transfer",method:"GET",headers:a,query:o},i);return new e.JSONApiResponse(u)}async getFeeTransfer(i){return await(await this.getFeeTransferRaw(i)).value()}async postFeeTransactionRaw(i,o){const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/v2/fees/transaction",method:"POST",headers:u,query:a,body:(0,t.TransactionFeeEstimateRequestToJSON)(i.transactionFeeEstimateRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.TransactionFeeEstimateResponseFromJSON)(f))}async postFeeTransaction(i,o){return await(await this.postFeeTransactionRaw(i,o)).value()}};return sm.FeesApi=n,sm}var am={},$E;function DH(){if($E)return am;$E=1,Object.defineProperty(am,"__esModule",{value:!0}),am.FungibleTokensApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getContractFtMetadataRaw(i,o){if(i.contractId===null||i.contractId===void 0)throw new e.RequiredError("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractFtMetadata.");const a={},u={},l=await this.request({path:"/extended/v1/tokens/{contractId}/ft/metadata".replace("{contractId}",encodeURIComponent(String(i.contractId))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.FungibleTokenMetadataFromJSON)(f))}async getContractFtMetadata(i,o){return await(await this.getContractFtMetadataRaw(i,o)).value()}async getFtMetadataListRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/tokens/ft/metadata",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.FungibleTokensMetadataListFromJSON)(f))}async getFtMetadataList(i,o){return await(await this.getFtMetadataListRaw(i,o)).value()}};return am.FungibleTokensApi=n,am}var qv={},qE;function JH(){return qE||(qE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GetNetworkBlockTimeByNetworkNetworkEnum=e.InfoApi=void 0;const t=Ie(),n=Fe();class r extends t.BaseAPI{async getCoreApiInfoRaw(o){const a={},u={},l=await this.request({path:"/v2/info",method:"GET",headers:u,query:a},o);return new t.JSONApiResponse(l,f=>(0,n.CoreNodeInfoResponseFromJSON)(f))}async getCoreApiInfo(o){return await(await this.getCoreApiInfoRaw(o)).value()}async getNetworkBlockTimeByNetworkRaw(o,a){if(o.network===null||o.network===void 0)throw new t.RequiredError("network","Required parameter requestParameters.network was null or undefined when calling getNetworkBlockTimeByNetwork.");const u={},l={},f=await this.request({path:"/extended/v1/info/network_block_time/{network}".replace("{network}",encodeURIComponent(String(o.network))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.NetworkBlockTimeResponseFromJSON)(p))}async getNetworkBlockTimeByNetwork(o,a){return await(await this.getNetworkBlockTimeByNetworkRaw(o,a)).value()}async getNetworkBlockTimesRaw(o){const a={},u={},l=await this.request({path:"/extended/v1/info/network_block_times",method:"GET",headers:u,query:a},o);return new t.JSONApiResponse(l,f=>(0,n.NetworkBlockTimesResponseFromJSON)(f))}async getNetworkBlockTimes(o){return await(await this.getNetworkBlockTimesRaw(o)).value()}async getPoxInfoRaw(o){const a={},u={},l=await this.request({path:"/v2/pox",method:"GET",headers:u,query:a},o);return new t.JSONApiResponse(l,f=>(0,n.CoreNodePoxResponseFromJSON)(f))}async getPoxInfo(o){return await(await this.getPoxInfoRaw(o)).value()}async getStatusRaw(o){const a={},u={},l=await this.request({path:"/extended/v1/status",method:"GET",headers:u,query:a},o);return new t.JSONApiResponse(l,f=>(0,n.ServerStatusResponseFromJSON)(f))}async getStatus(o){return await(await this.getStatusRaw(o)).value()}async getStxSupplyRaw(o,a){const u={};o.height!==void 0&&(u.height=o.height);const l={},f=await this.request({path:"/extended/v1/stx_supply",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.GetStxSupplyResponseFromJSON)(p))}async getStxSupply(o,a){return await(await this.getStxSupplyRaw(o,a)).value()}async getStxSupplyCirculatingPlainRaw(o){const a={},u={},l=await this.request({path:"/extended/v1/stx_supply/circulating/plain",method:"GET",headers:u,query:a},o);return new t.TextApiResponse(l)}async getStxSupplyCirculatingPlain(o){return await(await this.getStxSupplyCirculatingPlainRaw(o)).value()}async getStxSupplyTotalSupplyPlainRaw(o){const a={},u={},l=await this.request({path:"/extended/v1/stx_supply/total/plain",method:"GET",headers:u,query:a},o);return new t.TextApiResponse(l)}async getStxSupplyTotalSupplyPlain(o){return await(await this.getStxSupplyTotalSupplyPlainRaw(o)).value()}async getTotalStxSupplyLegacyFormatRaw(o,a){const u={};o.height!==void 0&&(u.height=o.height);const l={},f=await this.request({path:"/extended/v1/stx_supply/legacy_format",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.GetStxSupplyLegacyFormatResponseFromJSON)(p))}async getTotalStxSupplyLegacyFormat(o,a){return await(await this.getTotalStxSupplyLegacyFormatRaw(o,a)).value()}}e.InfoApi=r,function(i){i.testnet="testnet",i.mainnet="mainnet"}(e.GetNetworkBlockTimeByNetworkNetworkEnum||(e.GetNetworkBlockTimeByNetworkNetworkEnum={}))}(qv)),qv}var cm={},UE;function $H(){if(UE)return cm;UE=1,Object.defineProperty(cm,"__esModule",{value:!0}),cm.MicroblocksApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getMicroblockByHashRaw(i,o){if(i.hash===null||i.hash===void 0)throw new e.RequiredError("hash","Required parameter requestParameters.hash was null or undefined when calling getMicroblockByHash.");const a={},u={},l=await this.request({path:"/extended/v1/microblock/{hash}".replace("{hash}",encodeURIComponent(String(i.hash))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.MicroblockFromJSON)(f))}async getMicroblockByHash(i,o){return await(await this.getMicroblockByHashRaw(i,o)).value()}async getMicroblockListRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/microblock",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.MicroblockListResponseFromJSON)(f))}async getMicroblockList(i,o){return await(await this.getMicroblockListRaw(i,o)).value()}async getUnanchoredTxsRaw(i){const o={},a={},u=await this.request({path:"/extended/v1/microblock/unanchored/txs",method:"GET",headers:a,query:o},i);return new e.JSONApiResponse(u,l=>(0,t.UnanchoredTransactionListResponseFromJSON)(l))}async getUnanchoredTxs(i){return await(await this.getUnanchoredTxsRaw(i)).value()}};return cm.MicroblocksApi=n,cm}var um={},HE;function qH(){if(HE)return um;HE=1,Object.defineProperty(um,"__esModule",{value:!0}),um.NamesApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async fetchSubdomainsListForNameRaw(i,o){if(i.name===null||i.name===void 0)throw new e.RequiredError("name","Required parameter requestParameters.name was null or undefined when calling fetchSubdomainsListForName.");const a={},u={},l=await this.request({path:"/v1/names/{name}/subdomains".replace("{name}",encodeURIComponent(String(i.name))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async fetchSubdomainsListForName(i,o){return await(await this.fetchSubdomainsListForNameRaw(i,o)).value()}async fetchZoneFileRaw(i,o){if(i.name===null||i.name===void 0)throw new e.RequiredError("name","Required parameter requestParameters.name was null or undefined when calling fetchZoneFile.");const a={},u={},l=await this.request({path:"/v1/names/{name}/zonefile".replace("{name}",encodeURIComponent(String(i.name))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async fetchZoneFile(i,o){return await(await this.fetchZoneFileRaw(i,o)).value()}async getAllNamesRaw(i,o){const a={};i.page!==void 0&&(a.page=i.page);const u={},l=await this.request({path:"/v1/names",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async getAllNames(i,o){return await(await this.getAllNamesRaw(i,o)).value()}async getAllNamespacesRaw(i){const o={},a={},u=await this.request({path:"/v1/namespaces",method:"GET",headers:a,query:o},i);return new e.JSONApiResponse(u,l=>(0,t.BnsGetAllNamespacesResponseFromJSON)(l))}async getAllNamespaces(i){return await(await this.getAllNamespacesRaw(i)).value()}async getHistoricalZoneFileRaw(i,o){if(i.name===null||i.name===void 0)throw new e.RequiredError("name","Required parameter requestParameters.name was null or undefined when calling getHistoricalZoneFile.");if(i.zoneFileHash===null||i.zoneFileHash===void 0)throw new e.RequiredError("zoneFileHash","Required parameter requestParameters.zoneFileHash was null or undefined when calling getHistoricalZoneFile.");const a={},u={},l=await this.request({path:"/v1/names/{name}/zonefile/{zoneFileHash}".replace("{name}",encodeURIComponent(String(i.name))).replace("{zoneFileHash}",encodeURIComponent(String(i.zoneFileHash))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async getHistoricalZoneFile(i,o){return await(await this.getHistoricalZoneFileRaw(i,o)).value()}async getNameInfoRaw(i,o){if(i.name===null||i.name===void 0)throw new e.RequiredError("name","Required parameter requestParameters.name was null or undefined when calling getNameInfo.");const a={},u={},l=await this.request({path:"/v1/names/{name}".replace("{name}",encodeURIComponent(String(i.name))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BnsGetNameInfoResponseFromJSON)(f))}async getNameInfo(i,o){return await(await this.getNameInfoRaw(i,o)).value()}async getNamePriceRaw(i,o){if(i.name===null||i.name===void 0)throw new e.RequiredError("name","Required parameter requestParameters.name was null or undefined when calling getNamePrice.");const a={},u={},l=await this.request({path:"/v2/prices/names/{name}".replace("{name}",encodeURIComponent(String(i.name))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BnsGetNamePriceResponseFromJSON)(f))}async getNamePrice(i,o){return await(await this.getNamePriceRaw(i,o)).value()}async getNamesOwnedByAddressRaw(i,o){if(i.blockchain===null||i.blockchain===void 0)throw new e.RequiredError("blockchain","Required parameter requestParameters.blockchain was null or undefined when calling getNamesOwnedByAddress.");if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling getNamesOwnedByAddress.");const a={},u={},l=await this.request({path:"/v1/addresses/{blockchain}/{address}".replace("{blockchain}",encodeURIComponent(String(i.blockchain))).replace("{address}",encodeURIComponent(String(i.address))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BnsNamesOwnByAddressResponseFromJSON)(f))}async getNamesOwnedByAddress(i,o){return await(await this.getNamesOwnedByAddressRaw(i,o)).value()}async getNamespaceNamesRaw(i,o){if(i.tld===null||i.tld===void 0)throw new e.RequiredError("tld","Required parameter requestParameters.tld was null or undefined when calling getNamespaceNames.");const a={};i.page!==void 0&&(a.page=i.page);const u={},l=await this.request({path:"/v1/namespaces/{tld}/names".replace("{tld}",encodeURIComponent(String(i.tld))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async getNamespaceNames(i,o){return await(await this.getNamespaceNamesRaw(i,o)).value()}async getNamespacePriceRaw(i,o){if(i.tld===null||i.tld===void 0)throw new e.RequiredError("tld","Required parameter requestParameters.tld was null or undefined when calling getNamespacePrice.");const a={},u={},l=await this.request({path:"/v2/prices/namespaces/{tld}".replace("{tld}",encodeURIComponent(String(i.tld))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BnsGetNamespacePriceResponseFromJSON)(f))}async getNamespacePrice(i,o){return await(await this.getNamespacePriceRaw(i,o)).value()}};return um.NamesApi=n,um}var lm={},zE;function UH(){if(zE)return lm;zE=1,Object.defineProperty(lm,"__esModule",{value:!0}),lm.NonFungibleTokensApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getContractNftMetadataRaw(i,o){if(i.contractId===null||i.contractId===void 0)throw new e.RequiredError("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractNftMetadata.");const a={},u={},l=await this.request({path:"/extended/v1/tokens/{contractId}/nft/metadata".replace("{contractId}",encodeURIComponent(String(i.contractId))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.NonFungibleTokenMetadataFromJSON)(f))}async getContractNftMetadata(i,o){return await(await this.getContractNftMetadataRaw(i,o)).value()}async getNftHistoryRaw(i,o){if(i.assetIdentifier===null||i.assetIdentifier===void 0)throw new e.RequiredError("assetIdentifier","Required parameter requestParameters.assetIdentifier was null or undefined when calling getNftHistory.");if(i.value===null||i.value===void 0)throw new e.RequiredError("value","Required parameter requestParameters.value was null or undefined when calling getNftHistory.");const a={};i.assetIdentifier!==void 0&&(a.asset_identifier=i.assetIdentifier),i.value!==void 0&&(a.value=i.value),i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.txMetadata!==void 0&&(a.tx_metadata=i.txMetadata);const u={},l=await this.request({path:"/extended/v1/tokens/nft/history",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.NonFungibleTokenHistoryEventListFromJSON)(f))}async getNftHistory(i,o){return await(await this.getNftHistoryRaw(i,o)).value()}async getNftHoldingsRaw(i,o){if(i.principal===null||i.principal===void 0)throw new e.RequiredError("principal","Required parameter requestParameters.principal was null or undefined when calling getNftHoldings.");const a={};i.principal!==void 0&&(a.principal=i.principal),i.assetIdentifiers&&(a.asset_identifiers=i.assetIdentifiers),i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.txMetadata!==void 0&&(a.tx_metadata=i.txMetadata);const u={},l=await this.request({path:"/extended/v1/tokens/nft/holdings",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.NonFungibleTokenHoldingsListFromJSON)(f))}async getNftHoldings(i,o){return await(await this.getNftHoldingsRaw(i,o)).value()}async getNftMetadataListRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/tokens/nft/metadata",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.NonFungibleTokensMetadataListFromJSON)(f))}async getNftMetadataList(i,o){return await(await this.getNftMetadataListRaw(i,o)).value()}async getNftMintsRaw(i,o){if(i.assetIdentifier===null||i.assetIdentifier===void 0)throw new e.RequiredError("assetIdentifier","Required parameter requestParameters.assetIdentifier was null or undefined when calling getNftMints.");const a={};i.assetIdentifier!==void 0&&(a.asset_identifier=i.assetIdentifier),i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.txMetadata!==void 0&&(a.tx_metadata=i.txMetadata);const u={},l=await this.request({path:"/extended/v1/tokens/nft/mints",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.NonFungibleTokenMintListFromJSON)(f))}async getNftMints(i,o){return await(await this.getNftMintsRaw(i,o)).value()}};return lm.NonFungibleTokensApi=n,lm}var dm={},WE;function HH(){if(WE)return dm;WE=1,Object.defineProperty(dm,"__esModule",{value:!0}),dm.RosettaApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async rosettaAccountBalanceRaw(i,o){if(i.rosettaAccountBalanceRequest===null||i.rosettaAccountBalanceRequest===void 0)throw new e.RequiredError("rosettaAccountBalanceRequest","Required parameter requestParameters.rosettaAccountBalanceRequest was null or undefined when calling rosettaAccountBalance.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/account/balance",method:"POST",headers:u,query:a,body:(0,t.RosettaAccountBalanceRequestToJSON)(i.rosettaAccountBalanceRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaAccountBalanceResponseFromJSON)(f))}async rosettaAccountBalance(i,o){return await(await this.rosettaAccountBalanceRaw(i,o)).value()}async rosettaBlockRaw(i,o){if(i.rosettaBlockRequest===null||i.rosettaBlockRequest===void 0)throw new e.RequiredError("rosettaBlockRequest","Required parameter requestParameters.rosettaBlockRequest was null or undefined when calling rosettaBlock.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/block",method:"POST",headers:u,query:a,body:(0,t.RosettaBlockRequestToJSON)(i.rosettaBlockRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaBlockResponseFromJSON)(f))}async rosettaBlock(i,o){return await(await this.rosettaBlockRaw(i,o)).value()}async rosettaBlockTransactionRaw(i,o){if(i.rosettaBlockTransactionRequest===null||i.rosettaBlockTransactionRequest===void 0)throw new e.RequiredError("rosettaBlockTransactionRequest","Required parameter requestParameters.rosettaBlockTransactionRequest was null or undefined when calling rosettaBlockTransaction.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/block/transaction",method:"POST",headers:u,query:a,body:(0,t.RosettaBlockTransactionRequestToJSON)(i.rosettaBlockTransactionRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaBlockTransactionResponseFromJSON)(f))}async rosettaBlockTransaction(i,o){return await(await this.rosettaBlockTransactionRaw(i,o)).value()}async rosettaConstructionCombineRaw(i,o){if(i.rosettaConstructionCombineRequest===null||i.rosettaConstructionCombineRequest===void 0)throw new e.RequiredError("rosettaConstructionCombineRequest","Required parameter requestParameters.rosettaConstructionCombineRequest was null or undefined when calling rosettaConstructionCombine.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/combine",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionCombineRequestToJSON)(i.rosettaConstructionCombineRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionCombineResponseFromJSON)(f))}async rosettaConstructionCombine(i,o){return await(await this.rosettaConstructionCombineRaw(i,o)).value()}async rosettaConstructionDeriveRaw(i,o){if(i.rosettaConstructionDeriveRequest===null||i.rosettaConstructionDeriveRequest===void 0)throw new e.RequiredError("rosettaConstructionDeriveRequest","Required parameter requestParameters.rosettaConstructionDeriveRequest was null or undefined when calling rosettaConstructionDerive.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/derive",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionDeriveRequestToJSON)(i.rosettaConstructionDeriveRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionDeriveResponseFromJSON)(f))}async rosettaConstructionDerive(i,o){return await(await this.rosettaConstructionDeriveRaw(i,o)).value()}async rosettaConstructionHashRaw(i,o){if(i.rosettaConstructionHashRequest===null||i.rosettaConstructionHashRequest===void 0)throw new e.RequiredError("rosettaConstructionHashRequest","Required parameter requestParameters.rosettaConstructionHashRequest was null or undefined when calling rosettaConstructionHash.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/hash",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionHashRequestToJSON)(i.rosettaConstructionHashRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionHashResponseFromJSON)(f))}async rosettaConstructionHash(i,o){return await(await this.rosettaConstructionHashRaw(i,o)).value()}async rosettaConstructionMetadataRaw(i,o){if(i.rosettaConstructionMetadataRequest===null||i.rosettaConstructionMetadataRequest===void 0)throw new e.RequiredError("rosettaConstructionMetadataRequest","Required parameter requestParameters.rosettaConstructionMetadataRequest was null or undefined when calling rosettaConstructionMetadata.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/metadata",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionMetadataRequestToJSON)(i.rosettaConstructionMetadataRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionMetadataResponseFromJSON)(f))}async rosettaConstructionMetadata(i,o){return await(await this.rosettaConstructionMetadataRaw(i,o)).value()}async rosettaConstructionParseRaw(i,o){if(i.rosettaConstructionParseRequest===null||i.rosettaConstructionParseRequest===void 0)throw new e.RequiredError("rosettaConstructionParseRequest","Required parameter requestParameters.rosettaConstructionParseRequest was null or undefined when calling rosettaConstructionParse.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/parse",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionParseRequestToJSON)(i.rosettaConstructionParseRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionParseResponseFromJSON)(f))}async rosettaConstructionParse(i,o){return await(await this.rosettaConstructionParseRaw(i,o)).value()}async rosettaConstructionPayloadsRaw(i,o){if(i.rosettaConstructionPayloadsRequest===null||i.rosettaConstructionPayloadsRequest===void 0)throw new e.RequiredError("rosettaConstructionPayloadsRequest","Required parameter requestParameters.rosettaConstructionPayloadsRequest was null or undefined when calling rosettaConstructionPayloads.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/payloads",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionPayloadsRequestToJSON)(i.rosettaConstructionPayloadsRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionPayloadResponseFromJSON)(f))}async rosettaConstructionPayloads(i,o){return await(await this.rosettaConstructionPayloadsRaw(i,o)).value()}async rosettaConstructionPreprocessRaw(i,o){if(i.rosettaConstructionPreprocessRequest===null||i.rosettaConstructionPreprocessRequest===void 0)throw new e.RequiredError("rosettaConstructionPreprocessRequest","Required parameter requestParameters.rosettaConstructionPreprocessRequest was null or undefined when calling rosettaConstructionPreprocess.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/preprocess",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionPreprocessRequestToJSON)(i.rosettaConstructionPreprocessRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionPreprocessResponseFromJSON)(f))}async rosettaConstructionPreprocess(i,o){return await(await this.rosettaConstructionPreprocessRaw(i,o)).value()}async rosettaConstructionSubmitRaw(i,o){if(i.rosettaConstructionSubmitRequest===null||i.rosettaConstructionSubmitRequest===void 0)throw new e.RequiredError("rosettaConstructionSubmitRequest","Required parameter requestParameters.rosettaConstructionSubmitRequest was null or undefined when calling rosettaConstructionSubmit.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/construction/submit",method:"POST",headers:u,query:a,body:(0,t.RosettaConstructionSubmitRequestToJSON)(i.rosettaConstructionSubmitRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaConstructionSubmitResponseFromJSON)(f))}async rosettaConstructionSubmit(i,o){return await(await this.rosettaConstructionSubmitRaw(i,o)).value()}async rosettaMempoolRaw(i,o){if(i.rosettaMempoolRequest===null||i.rosettaMempoolRequest===void 0)throw new e.RequiredError("rosettaMempoolRequest","Required parameter requestParameters.rosettaMempoolRequest was null or undefined when calling rosettaMempool.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/mempool",method:"POST",headers:u,query:a,body:(0,t.RosettaMempoolRequestToJSON)(i.rosettaMempoolRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaMempoolResponseFromJSON)(f))}async rosettaMempool(i,o){return await(await this.rosettaMempoolRaw(i,o)).value()}async rosettaMempoolTransactionRaw(i,o){if(i.rosettaMempoolTransactionRequest===null||i.rosettaMempoolTransactionRequest===void 0)throw new e.RequiredError("rosettaMempoolTransactionRequest","Required parameter requestParameters.rosettaMempoolTransactionRequest was null or undefined when calling rosettaMempoolTransaction.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/mempool/transaction",method:"POST",headers:u,query:a,body:(0,t.RosettaMempoolTransactionRequestToJSON)(i.rosettaMempoolTransactionRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaMempoolTransactionResponseFromJSON)(f))}async rosettaMempoolTransaction(i,o){return await(await this.rosettaMempoolTransactionRaw(i,o)).value()}async rosettaNetworkListRaw(i){const o={},a={},u=await this.request({path:"/rosetta/v1/network/list",method:"POST",headers:a,query:o},i);return new e.JSONApiResponse(u,l=>(0,t.RosettaNetworkListResponseFromJSON)(l))}async rosettaNetworkList(i){return await(await this.rosettaNetworkListRaw(i)).value()}async rosettaNetworkOptionsRaw(i,o){if(i.rosettaOptionsRequest===null||i.rosettaOptionsRequest===void 0)throw new e.RequiredError("rosettaOptionsRequest","Required parameter requestParameters.rosettaOptionsRequest was null or undefined when calling rosettaNetworkOptions.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/network/options",method:"POST",headers:u,query:a,body:(0,t.RosettaOptionsRequestToJSON)(i.rosettaOptionsRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaNetworkOptionsResponseFromJSON)(f))}async rosettaNetworkOptions(i,o){return await(await this.rosettaNetworkOptionsRaw(i,o)).value()}async rosettaNetworkStatusRaw(i,o){if(i.rosettaStatusRequest===null||i.rosettaStatusRequest===void 0)throw new e.RequiredError("rosettaStatusRequest","Required parameter requestParameters.rosettaStatusRequest was null or undefined when calling rosettaNetworkStatus.");const a={},u={};u["Content-Type"]="application/json";const l=await this.request({path:"/rosetta/v1/network/status",method:"POST",headers:u,query:a,body:(0,t.RosettaStatusRequestToJSON)(i.rosettaStatusRequest)},o);return new e.JSONApiResponse(l,f=>(0,t.RosettaNetworkStatusResponseFromJSON)(f))}async rosettaNetworkStatus(i,o){return await(await this.rosettaNetworkStatusRaw(i,o)).value()}};return dm.RosettaApi=n,dm}var fm={},VE;function zH(){if(VE)return fm;VE=1,Object.defineProperty(fm,"__esModule",{value:!0}),fm.SearchApi=void 0;const e=Ie();let t=class extends e.BaseAPI{async searchByIdRaw(r,i){if(r.id===null||r.id===void 0)throw new e.RequiredError("id","Required parameter requestParameters.id was null or undefined when calling searchById.");const o={};r.includeMetadata!==void 0&&(o.include_metadata=r.includeMetadata);const a={},u=await this.request({path:"/extended/v1/search/{id}".replace("{id}",encodeURIComponent(String(r.id))),method:"GET",headers:a,query:o},i);return new e.JSONApiResponse(u)}async searchById(r,i){return await(await this.searchByIdRaw(r,i)).value()}};return fm.SearchApi=t,fm}var hm={},GE;function WH(){if(GE)return hm;GE=1,Object.defineProperty(hm,"__esModule",{value:!0}),hm.SmartContractsApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async callReadOnlyFunctionRaw(i,o){if(i.contractAddress===null||i.contractAddress===void 0)throw new e.RequiredError("contractAddress","Required parameter requestParameters.contractAddress was null or undefined when calling callReadOnlyFunction.");if(i.contractName===null||i.contractName===void 0)throw new e.RequiredError("contractName","Required parameter requestParameters.contractName was null or undefined when calling callReadOnlyFunction.");if(i.functionName===null||i.functionName===void 0)throw new e.RequiredError("functionName","Required parameter requestParameters.functionName was null or undefined when calling callReadOnlyFunction.");if(i.readOnlyFunctionArgs===null||i.readOnlyFunctionArgs===void 0)throw new e.RequiredError("readOnlyFunctionArgs","Required parameter requestParameters.readOnlyFunctionArgs was null or undefined when calling callReadOnlyFunction.");const a={};i.tip!==void 0&&(a.tip=i.tip);const u={};u["Content-Type"]="application/json";const l=await this.request({path:"/v2/contracts/call-read/{contract_address}/{contract_name}/{function_name}".replace("{contract_address}",encodeURIComponent(String(i.contractAddress))).replace("{contract_name}",encodeURIComponent(String(i.contractName))).replace("{function_name}",encodeURIComponent(String(i.functionName))),method:"POST",headers:u,query:a,body:(0,t.ReadOnlyFunctionArgsToJSON)(i.readOnlyFunctionArgs)},o);return new e.JSONApiResponse(l,f=>(0,t.ReadOnlyFunctionSuccessResponseFromJSON)(f))}async callReadOnlyFunction(i,o){return await(await this.callReadOnlyFunctionRaw(i,o)).value()}async getContractByIdRaw(i,o){if(i.contractId===null||i.contractId===void 0)throw new e.RequiredError("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractById.");const a={};i.unanchored!==void 0&&(a.unanchored=i.unanchored);const u={},l=await this.request({path:"/extended/v1/contract/{contract_id}".replace("{contract_id}",encodeURIComponent(String(i.contractId))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.SmartContractFromJSON)(f))}async getContractById(i,o){return await(await this.getContractByIdRaw(i,o)).value()}async getContractDataMapEntryRaw(i,o){if(i.contractAddress===null||i.contractAddress===void 0)throw new e.RequiredError("contractAddress","Required parameter requestParameters.contractAddress was null or undefined when calling getContractDataMapEntry.");if(i.contractName===null||i.contractName===void 0)throw new e.RequiredError("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractDataMapEntry.");if(i.mapName===null||i.mapName===void 0)throw new e.RequiredError("mapName","Required parameter requestParameters.mapName was null or undefined when calling getContractDataMapEntry.");if(i.key===null||i.key===void 0)throw new e.RequiredError("key","Required parameter requestParameters.key was null or undefined when calling getContractDataMapEntry.");const a={};i.proof!==void 0&&(a.proof=i.proof),i.tip!==void 0&&(a.tip=i.tip);const u={};u["Content-Type"]="application/json";const l=await this.request({path:"/v2/map_entry/{contract_address}/{contract_name}/{map_name}".replace("{contract_address}",encodeURIComponent(String(i.contractAddress))).replace("{contract_name}",encodeURIComponent(String(i.contractName))).replace("{map_name}",encodeURIComponent(String(i.mapName))),method:"POST",headers:u,query:a,body:i.key},o);return new e.JSONApiResponse(l,f=>(0,t.MapEntryResponseFromJSON)(f))}async getContractDataMapEntry(i,o){return await(await this.getContractDataMapEntryRaw(i,o)).value()}async getContractEventsByIdRaw(i,o){if(i.contractId===null||i.contractId===void 0)throw new e.RequiredError("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractEventsById.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset),i.unanchored!==void 0&&(a.unanchored=i.unanchored);const u={},l=await this.request({path:"/extended/v1/contract/{contract_id}/events".replace("{contract_id}",encodeURIComponent(String(i.contractId))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l)}async getContractEventsById(i,o){return await(await this.getContractEventsByIdRaw(i,o)).value()}async getContractInterfaceRaw(i,o){if(i.contractAddress===null||i.contractAddress===void 0)throw new e.RequiredError("contractAddress","Required parameter requestParameters.contractAddress was null or undefined when calling getContractInterface.");if(i.contractName===null||i.contractName===void 0)throw new e.RequiredError("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractInterface.");const a={};i.tip!==void 0&&(a.tip=i.tip);const u={},l=await this.request({path:"/v2/contracts/interface/{contract_address}/{contract_name}".replace("{contract_address}",encodeURIComponent(String(i.contractAddress))).replace("{contract_name}",encodeURIComponent(String(i.contractName))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.ContractInterfaceResponseFromJSON)(f))}async getContractInterface(i,o){return await(await this.getContractInterfaceRaw(i,o)).value()}async getContractSourceRaw(i,o){if(i.contractAddress===null||i.contractAddress===void 0)throw new e.RequiredError("contractAddress","Required parameter requestParameters.contractAddress was null or undefined when calling getContractSource.");if(i.contractName===null||i.contractName===void 0)throw new e.RequiredError("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractSource.");const a={};i.proof!==void 0&&(a.proof=i.proof),i.tip!==void 0&&(a.tip=i.tip);const u={},l=await this.request({path:"/v2/contracts/source/{contract_address}/{contract_name}".replace("{contract_address}",encodeURIComponent(String(i.contractAddress))).replace("{contract_name}",encodeURIComponent(String(i.contractName))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.ContractSourceResponseFromJSON)(f))}async getContractSource(i,o){return await(await this.getContractSourceRaw(i,o)).value()}async getContractsByTraitRaw(i,o){if(i.traitAbi===null||i.traitAbi===void 0)throw new e.RequiredError("traitAbi","Required parameter requestParameters.traitAbi was null or undefined when calling getContractsByTrait.");const a={};i.traitAbi!==void 0&&(a.trait_abi=i.traitAbi),i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/contract/by_trait",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.ContractListResponseFromJSON)(f))}async getContractsByTrait(i,o){return await(await this.getContractsByTraitRaw(i,o)).value()}};return hm.SmartContractsApi=n,hm}var pm={},KE;function VH(){if(KE)return pm;KE=1,Object.defineProperty(pm,"__esModule",{value:!0}),pm.StackingApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getPoolDelegationsRaw(i,o){if(i.poolPrincipal===null||i.poolPrincipal===void 0)throw new e.RequiredError("poolPrincipal","Required parameter requestParameters.poolPrincipal was null or undefined when calling getPoolDelegations.");const a={};i.afterBlock!==void 0&&(a.after_block=i.afterBlock),i.unanchored!==void 0&&(a.unanchored=i.unanchored),i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/beta/stacking/{pool_principal}/delegations".replace("{pool_principal}",encodeURIComponent(String(i.poolPrincipal))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.PoolDelegationsResponseFromJSON)(f))}async getPoolDelegations(i,o){return await(await this.getPoolDelegationsRaw(i,o)).value()}};return pm.StackingApi=n,pm}var mm={},QE;function GH(){if(QE)return mm;QE=1,Object.defineProperty(mm,"__esModule",{value:!0}),mm.StackingRewardsApi=void 0;const e=Ie(),t=Fe();let n=class extends e.BaseAPI{async getBurnchainRewardListRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/burnchain/rewards",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BurnchainRewardListResponseFromJSON)(f))}async getBurnchainRewardList(i,o){return await(await this.getBurnchainRewardListRaw(i,o)).value()}async getBurnchainRewardListByAddressRaw(i,o){if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling getBurnchainRewardListByAddress.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/burnchain/rewards/{address}".replace("{address}",encodeURIComponent(String(i.address))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BurnchainRewardListResponseFromJSON)(f))}async getBurnchainRewardListByAddress(i,o){return await(await this.getBurnchainRewardListByAddressRaw(i,o)).value()}async getBurnchainRewardSlotHoldersRaw(i,o){const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/burnchain/reward_slot_holders",method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BurnchainRewardSlotHolderListResponseFromJSON)(f))}async getBurnchainRewardSlotHolders(i,o){return await(await this.getBurnchainRewardSlotHoldersRaw(i,o)).value()}async getBurnchainRewardSlotHoldersByAddressRaw(i,o){if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling getBurnchainRewardSlotHoldersByAddress.");const a={};i.limit!==void 0&&(a.limit=i.limit),i.offset!==void 0&&(a.offset=i.offset);const u={},l=await this.request({path:"/extended/v1/burnchain/reward_slot_holders/{address}".replace("{address}",encodeURIComponent(String(i.address))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BurnchainRewardSlotHolderListResponseFromJSON)(f))}async getBurnchainRewardSlotHoldersByAddress(i,o){return await(await this.getBurnchainRewardSlotHoldersByAddressRaw(i,o)).value()}async getBurnchainRewardsTotalByAddressRaw(i,o){if(i.address===null||i.address===void 0)throw new e.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling getBurnchainRewardsTotalByAddress.");const a={},u={},l=await this.request({path:"/extended/v1/burnchain/rewards/{address}/total".replace("{address}",encodeURIComponent(String(i.address))),method:"GET",headers:u,query:a},o);return new e.JSONApiResponse(l,f=>(0,t.BurnchainRewardsTotalFromJSON)(f))}async getBurnchainRewardsTotalByAddress(i,o){return await(await this.getBurnchainRewardsTotalByAddressRaw(i,o)).value()}};return mm.StackingRewardsApi=n,mm}var Uv={},YE;function KH(){return YE||(YE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GetTransactionListTypeEnum=e.GetFilteredEventsTypeEnum=e.TransactionsApi=void 0;const t=Ie(),n=Fe();class r extends t.BaseAPI{async getAddressMempoolTransactionsRaw(o,a){if(o.address===null||o.address===void 0)throw new t.RequiredError("address","Required parameter requestParameters.address was null or undefined when calling getAddressMempoolTransactions.");const u={};o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/address/{address}/mempool".replace("{address}",encodeURIComponent(String(o.address))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.MempoolTransactionListResponseFromJSON)(p))}async getAddressMempoolTransactions(o,a){return await(await this.getAddressMempoolTransactionsRaw(o,a)).value()}async getDroppedMempoolTransactionListRaw(o,a){const u={};o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset);const l={},f=await this.request({path:"/extended/v1/tx/mempool/dropped",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.MempoolTransactionListResponseFromJSON)(p))}async getDroppedMempoolTransactionList(o,a){return await(await this.getDroppedMempoolTransactionListRaw(o,a)).value()}async getFilteredEventsRaw(o,a){const u={};o.txId!==void 0&&(u.tx_id=o.txId),o.address!==void 0&&(u.address=o.address),o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset),o.type&&(u.type=o.type);const l={},f=await this.request({path:"/extended/v1/tx/events",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.TransactionEventsResponseFromJSON)(p))}async getFilteredEvents(o,a){return await(await this.getFilteredEventsRaw(o,a)).value()}async getMempoolTransactionListRaw(o,a){const u={};o.senderAddress!==void 0&&(u.sender_address=o.senderAddress),o.recipientAddress!==void 0&&(u.recipient_address=o.recipientAddress),o.address!==void 0&&(u.address=o.address),o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/tx/mempool",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.MempoolTransactionListResponseFromJSON)(p))}async getMempoolTransactionList(o,a){return await(await this.getMempoolTransactionListRaw(o,a)).value()}async getMempoolTransactionStatsRaw(o){const a={},u={},l=await this.request({path:"/extended/v1/tx/mempool/stats",method:"GET",headers:u,query:a},o);return new t.JSONApiResponse(l,f=>(0,n.MempoolTransactionStatsResponseFromJSON)(f))}async getMempoolTransactionStats(o){return await(await this.getMempoolTransactionStatsRaw(o)).value()}async getRawTransactionByIdRaw(o,a){if(o.txId===null||o.txId===void 0)throw new t.RequiredError("txId","Required parameter requestParameters.txId was null or undefined when calling getRawTransactionById.");const u={},l={},f=await this.request({path:"/extended/v1/tx/{tx_id}/raw".replace("{tx_id}",encodeURIComponent(String(o.txId))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.GetRawTransactionResultFromJSON)(p))}async getRawTransactionById(o,a){return await(await this.getRawTransactionByIdRaw(o,a)).value()}async getTransactionByIdRaw(o,a){if(o.txId===null||o.txId===void 0)throw new t.RequiredError("txId","Required parameter requestParameters.txId was null or undefined when calling getTransactionById.");const u={};o.eventOffset!==void 0&&(u.event_offset=o.eventOffset),o.eventLimit!==void 0&&(u.event_limit=o.eventLimit),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/tx/{tx_id}".replace("{tx_id}",encodeURIComponent(String(o.txId))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f)}async getTransactionById(o,a){return await(await this.getTransactionByIdRaw(o,a)).value()}async getTransactionListRaw(o,a){const u={};o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset),o.type&&(u.type=o.type),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/tx",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.TransactionResultsFromJSON)(p))}async getTransactionList(o,a){return await(await this.getTransactionListRaw(o,a)).value()}async getTransactionsByBlockHashRaw(o,a){if(o.blockHash===null||o.blockHash===void 0)throw new t.RequiredError("blockHash","Required parameter requestParameters.blockHash was null or undefined when calling getTransactionsByBlockHash.");const u={};o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset);const l={},f=await this.request({path:"/extended/v1/tx/block/{block_hash}".replace("{block_hash}",encodeURIComponent(String(o.blockHash))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.TransactionResultsFromJSON)(p))}async getTransactionsByBlockHash(o,a){return await(await this.getTransactionsByBlockHashRaw(o,a)).value()}async getTransactionsByBlockHeightRaw(o,a){if(o.height===null||o.height===void 0)throw new t.RequiredError("height","Required parameter requestParameters.height was null or undefined when calling getTransactionsByBlockHeight.");const u={};o.limit!==void 0&&(u.limit=o.limit),o.offset!==void 0&&(u.offset=o.offset),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/tx/block_height/{height}".replace("{height}",encodeURIComponent(String(o.height))),method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f,p=>(0,n.TransactionResultsFromJSON)(p))}async getTransactionsByBlockHeight(o,a){return await(await this.getTransactionsByBlockHeightRaw(o,a)).value()}async getTxListDetailsRaw(o,a){if(o.txId===null||o.txId===void 0)throw new t.RequiredError("txId","Required parameter requestParameters.txId was null or undefined when calling getTxListDetails.");const u={};o.txId&&(u.tx_id=o.txId),o.eventOffset!==void 0&&(u.event_offset=o.eventOffset),o.eventLimit!==void 0&&(u.event_limit=o.eventLimit),o.unanchored!==void 0&&(u.unanchored=o.unanchored);const l={},f=await this.request({path:"/extended/v1/tx/multiple",method:"GET",headers:l,query:u},a);return new t.JSONApiResponse(f)}async getTxListDetails(o,a){return await(await this.getTxListDetailsRaw(o,a)).value()}async postCoreNodeTransactionsRaw(o,a){const u={},l={};l["Content-Type"]="application/octet-stream";const f=await this.request({path:"/v2/transactions",method:"POST",headers:l,query:u,body:o.body},a);return new t.TextApiResponse(f)}async postCoreNodeTransactions(o,a){return await(await this.postCoreNodeTransactionsRaw(o,a)).value()}}e.TransactionsApi=r,function(i){i.smart_contract_log="smart_contract_log",i.stx_lock="stx_lock",i.stx_asset="stx_asset",i.fungible_token_asset="fungible_token_asset",i.non_fungible_token_asset="non_fungible_token_asset"}(e.GetFilteredEventsTypeEnum||(e.GetFilteredEventsTypeEnum={})),function(i){i.coinbase="coinbase",i.token_transfer="token_transfer",i.smart_contract="smart_contract",i.contract_call="contract_call",i.poison_microblock="poison_microblock"}(e.GetTransactionListTypeEnum||(e.GetTransactionListTypeEnum={}))}(Uv)),Uv}var XE;function QH(){return XE||(XE=1,function(e){var t=_d&&_d.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(i,o);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,a,u)}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=_d&&_d.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(MH(),e),n(LH(),e),n(BH(),e),n(jH(),e),n(DH(),e),n(JH(),e),n($H(),e),n(qH(),e),n(UH(),e),n(HH(),e),n(zH(),e),n(WH(),e),n(VH(),e),n(GH(),e),n(KH(),e)}(_d)),_d}var ZE;function YH(){return ZE||(ZE=1,function(e){var t=xd&&xd.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(i,o);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,a,u)}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=xd&&xd.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(Ie(),e),n(QH(),e),n(Fe(),e)}(xd)),xd}var Rd={};const o0=Object.prototype.hasOwnProperty,E_=typeof Number.isSafeInteger=="function"?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&e===Math.floor(e)&&Math.abs(e)<=9007199254740991};class Ul{constructor(){this.jsonrpc="2.0"}serialize(){return JSON.stringify(this)}}Ul.VERSION="2.0";class Bw extends Ul{constructor(t,n,r){super(),this.id=t,this.method=n,r!==void 0&&(this.params=r)}}class jw extends Ul{constructor(t,n){super(),this.method=t,n!==void 0&&(this.params=n)}}class Dw extends Ul{constructor(t,n){super(),this.id=t,this.result=n}}class Jw extends Ul{constructor(t,n){super(),this.id=t,this.error=n,this.id=t,this.error=n}}class jh{constructor(t,n){this.payload=t,this.type=n,this.payload=t,this.type=n}}class tn{constructor(t,n,r){this.message=t,this.code=E_(n)?n:0,r!=null&&(this.data=r)}}tn.invalidRequest=function(e){return new tn("Invalid request",-32600,e)};tn.methodNotFound=function(e){return new tn("Method not found",-32601,e)};tn.invalidParams=function(e){return new tn("Invalid params",-32602,e)};tn.internalError=function(e){return new tn("Internal error",-32603,e)};tn.parseError=function(e){return new tn("Parse error",-32700,e)};function pP(e,t,n){const r=new Bw(e,t,n);return Ol(r,!0),r}function mP(e,t){const n=new jw(e,t);return Ol(n,!0),n}function gP(e,t){const n=new Dw(e,t);return Ol(n,!0),n}function yP(e,t){const n=new Jw(e,t);return Ol(n,!0),n}function A_(e){if(!$w(e))return new jh(tn.invalidRequest(e),"invalid");let t;try{t=JSON.parse(e)}catch{return new jh(tn.parseError(e),"invalid")}return F_(t)}function F_(e){if(!Array.isArray(e))return ew(e);if(e.length===0)return new jh(tn.invalidRequest(e),"invalid");const t=[];for(let n=0,r=e.length;n{const f=e.parse(l.data);(Array.isArray(f)?f:[f]).forEach(m=>{if(m.type==="notification")this.handleNotification(m.payload);else if(m.type==="success"){const y=this.pendingRequests.get(m.payload.id);y&&(this.pendingRequests.delete(m.payload.id),y.resolve(m.payload.result))}else if(m.type==="error"){const y=this.pendingRequests.get(m.payload.id);y&&(this.pendingRequests.delete(m.payload.id),y.reject(m.payload.error))}})})}static async connect(u=n.BASE_PATH){let l;try{l=new URL(u)}catch{l=new URL(`ws://${u}`)}l.protocol==="https:"?l.protocol="wss:":l.protocol==="http:"&&(l.protocol="ws:"),l.pathname==="/"&&(l.pathname="/extended/v1/ws");const f=await new Promise((p,m)=>{const y=new(o())(l.toString());y.onopen=()=>p(y),y.onerror=w=>m(w)});return new r(f)}handleNotification(u){switch(u.method){case"tx_update":this.eventEmitter.emit("txUpdate",u.params);break;case"address_tx_update":this.eventEmitter.emit("addressTxUpdate",u.params);break;case"address_balance_update":this.eventEmitter.emit("addressBalanceUpdate",u.params);break;case"block":this.eventEmitter.emit("block",u.params);break;case"microblock":this.eventEmitter.emit("microblock",u.params);break;case"mempool":this.eventEmitter.emit("mempool",u.params);break;case"nft_event":this.eventEmitter.emit("nftEventUpdate",u.params);break;case"nft_asset_event":this.eventEmitter.emit("nftAssetEventUpdate",u.params);break;case"nft_collection_event":this.eventEmitter.emit("nftCollectionEventUpdate",u.params);break}}rpcCall(u,l){const f=e.request(++this.idCursor,u,l);return new Promise((p,m)=>{this.pendingRequests.set(f.id,{resolve:p,reject:m}),this.webSocket.send(f.serialize())})}async subscribeBlocks(u){const l={event:"block"};await this.rpcCall("subscribe",l);const f=p=>{u(p)};return this.eventEmitter.addListener("block",f),{unsubscribe:()=>(this.eventEmitter.removeListener("block",f),this.rpcCall("unsubscribe",l))}}async subscribeMicroblocks(u){const l={event:"microblock"};await this.rpcCall("subscribe",l);const f=p=>{u(p)};return this.eventEmitter.addListener("microblock",f),{unsubscribe:()=>(this.eventEmitter.removeListener("microblock",f),this.rpcCall("unsubscribe",l))}}async subscribeMempool(u){const l={event:"mempool"};await this.rpcCall("subscribe",l);const f=p=>{u(p)};return this.eventEmitter.addListener("mempool",f),{unsubscribe:()=>(this.eventEmitter.removeListener("mempool",f),this.rpcCall("unsubscribe",l))}}async subscribeTxUpdates(u,l){const f={event:"tx_update",tx_id:u},p=await this.rpcCall("subscribe",f),m=y=>{y.tx_id===p.tx_id&&l(y)};return this.eventEmitter.addListener("txUpdate",m),{unsubscribe:()=>(this.eventEmitter.removeListener("txUpdate",m),this.rpcCall("unsubscribe",f))}}async subscribeAddressTransactions(u,l){const f={event:"address_tx_update",address:u},p=await this.rpcCall("subscribe",f),m=y=>{y.address===p.address&&l(y)};return this.eventEmitter.addListener("addressTxUpdate",m),{unsubscribe:()=>(this.eventEmitter.removeListener("addressTxUpdate",m),this.rpcCall("unsubscribe",f))}}async subscribeAddressBalanceUpdates(u,l){const f={event:"address_balance_update",address:u},p=await this.rpcCall("subscribe",f),m=y=>{y.address===p.address&&l(y)};return this.eventEmitter.addListener("addressBalanceUpdate",m),{unsubscribe:()=>(this.eventEmitter.removeListener("addressBalanceUpdate",m),this.rpcCall("unsubscribe",f))}}async subscribeNftEventUpdates(u){const l={event:"nft_event"};await this.rpcCall("subscribe",l);const f=p=>{u(p)};return this.eventEmitter.addListener("nftEventUpdate",f),{unsubscribe:()=>(this.eventEmitter.removeListener("nftEventUpdate",f),this.rpcCall("unsubscribe",l))}}async subscribeNftAssetEventUpdates(u,l,f){const p={event:"nft_asset_event",asset_identifier:u,value:l},m=await this.rpcCall("subscribe",p),y=w=>{w.asset_identifier===m.asset_identifier&&w.value.hex===m.value&&f(w)};return this.eventEmitter.addListener("nftAssetEventUpdate",y),{unsubscribe:()=>(this.eventEmitter.removeListener("nftAssetEventUpdate",y),this.rpcCall("unsubscribe",p))}}async subscribeNftCollectionEventUpdates(u,l){const f={event:"nft_collection_event",asset_identifier:u},p=await this.rpcCall("subscribe",f),m=y=>{y.asset_identifier===p.asset_identifier&&l(y)};return this.eventEmitter.addListener("nftCollectionEventUpdate",m),{unsubscribe:()=>(this.eventEmitter.removeListener("nftCollectionEventUpdate",m),this.rpcCall("unsubscribe",f))}}}Rd.StacksApiWebSocketClient=r;async function i(a=n.BASE_PATH){return r.connect(a)}Rd.connectWebSocketClient=i;function o(){return typeof WebSocket<"u"?WebSocket:typeof Yd<"u"&&Yd.WebSocket?Yd.WebSocket:typeof window<"u"&&window.WebSocket?window.WebSocket:typeof self<"u"&&self.WebSocket?self.WebSocket:iz()}return Rd}var gm={},jm={exports:{}},Td={},Vv={},Od={},ym={},gu={},Nd={},wi={},s0={},yu={},sA;function bP(){if(sA)return yu;sA=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.ERROR_PACKET=yu.PACKET_TYPES_REVERSE=yu.PACKET_TYPES=void 0;const e=Object.create(null);yu.PACKET_TYPES=e,e.open="0",e.close="1",e.ping="2",e.pong="3",e.message="4",e.upgrade="5",e.noop="6";const t=Object.create(null);yu.PACKET_TYPES_REVERSE=t,Object.keys(e).forEach(r=>{t[e[r]]=r});const n={type:"error",data:"parser error"};return yu.ERROR_PACKET=n,yu}var aA;function sz(){if(aA)return s0;aA=1,Object.defineProperty(s0,"__esModule",{value:!0});const e=bP(),t=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",n=typeof ArrayBuffer=="function",r=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a&&a.buffer instanceof ArrayBuffer,i=({type:a,data:u},l,f)=>t&&u instanceof Blob?l?f(u):o(u,f):n&&(u instanceof ArrayBuffer||r(u))?l?f(u):o(new Blob([u]),f):f(e.PACKET_TYPES[a]+(u||"")),o=(a,u)=>{const l=new FileReader;return l.onload=function(){const f=l.result.split(",")[1];u("b"+(f||""))},l.readAsDataURL(a)};return s0.default=i,s0}var a0={},Cd={},cA;function az(){if(cA)return Cd;cA=1,Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.decode=Cd.encode=void 0;const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let i=0;i{let o=new Uint8Array(i),a,u=o.length,l="";for(a=0;a>2],l+=e[(o[a]&3)<<4|o[a+1]>>4],l+=e[(o[a+1]&15)<<2|o[a+2]>>6],l+=e[o[a+2]&63];return u%3===2?l=l.substring(0,l.length-1)+"=":u%3===1&&(l=l.substring(0,l.length-2)+"=="),l};Cd.encode=n;const r=i=>{let o=i.length*.75,a=i.length,u,l=0,f,p,m,y;i[i.length-1]==="="&&(o--,i[i.length-2]==="="&&o--);const w=new ArrayBuffer(o),b=new Uint8Array(w);for(u=0;u>4,b[l++]=(p&15)<<4|m>>2,b[l++]=(m&3)<<6|y&63;return w};return Cd.decode=r,Cd}var uA;function cz(){if(uA)return a0;uA=1,Object.defineProperty(a0,"__esModule",{value:!0});const e=bP(),t=az(),n=typeof ArrayBuffer=="function",r=(a,u)=>{if(typeof a!="string")return{type:"message",data:o(a,u)};const l=a.charAt(0);return l==="b"?{type:"message",data:i(a.substring(1),u)}:e.PACKET_TYPES_REVERSE[l]?a.length>1?{type:e.PACKET_TYPES_REVERSE[l],data:a.substring(1)}:{type:e.PACKET_TYPES_REVERSE[l]}:e.ERROR_PACKET},i=(a,u)=>{if(n){const l=(0,t.decode)(a);return o(l,u)}else return{base64:!0,data:a}},o=(a,u)=>{switch(u){case"blob":return a instanceof ArrayBuffer?new Blob([a]):a;case"arraybuffer":default:return a}};return a0.default=r,a0}var lA;function qw(){if(lA)return wi;lA=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.decodePayload=wi.decodePacket=wi.encodePayload=wi.encodePacket=wi.protocol=void 0;const e=sz();wi.encodePacket=e.default;const t=cz();wi.decodePacket=t.default;const n="",r=(o,a)=>{const u=o.length,l=new Array(u);let f=0;o.forEach((p,m)=>{(0,e.default)(p,!1,y=>{l[m]=y,++f===u&&a(l.join(n))})})};wi.encodePayload=r;const i=(o,a)=>{const u=o.split(n),l=[];for(let f=0;f(l.hasOwnProperty(m)&&(p[m]=l[m]),p),{})}wu.pick=t;const n=e.globalThisShim.setTimeout,r=e.globalThisShim.clearTimeout;function i(l,f){f.useNativeTimers?(l.setTimeoutFn=n.bind(e.globalThisShim),l.clearTimeoutFn=r.bind(e.globalThisShim)):(l.setTimeoutFn=e.globalThisShim.setTimeout.bind(e.globalThisShim),l.clearTimeoutFn=e.globalThisShim.clearTimeout.bind(e.globalThisShim))}wu.installTimerFunctions=i;const o=1.33;function a(l){return typeof l=="string"?u(l):Math.ceil((l.byteLength||l.size)*o)}wu.byteLength=a;function u(l){let f=0,p=0;for(let m=0,y=l.length;m=57344?p+=3:(m++,p+=4);return p}return wu}var c0={exports:{}},Gv,hA;function dz(){if(hA)return Gv;hA=1;var e=1e3,t=e*60,n=t*60,r=n*24,i=r*7,o=r*365.25;Gv=function(p,m){m=m||{};var y=typeof p;if(y==="string"&&p.length>0)return a(p);if(y==="number"&&isFinite(p))return m.long?l(p):u(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function a(p){if(p=String(p),!(p.length>100)){var m=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(m){var y=parseFloat(m[1]),w=(m[2]||"ms").toLowerCase();switch(w){case"years":case"year":case"yrs":case"yr":case"y":return y*o;case"weeks":case"week":case"w":return y*i;case"days":case"day":case"d":return y*r;case"hours":case"hour":case"hrs":case"hr":case"h":return y*n;case"minutes":case"minute":case"mins":case"min":case"m":return y*t;case"seconds":case"second":case"secs":case"sec":case"s":return y*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function u(p){var m=Math.abs(p);return m>=r?Math.round(p/r)+"d":m>=n?Math.round(p/n)+"h":m>=t?Math.round(p/t)+"m":m>=e?Math.round(p/e)+"s":p+"ms"}function l(p){var m=Math.abs(p);return m>=r?f(p,m,r,"day"):m>=n?f(p,m,n,"hour"):m>=t?f(p,m,t,"minute"):m>=e?f(p,m,e,"second"):p+" ms"}function f(p,m,y,w){var b=m>=y*1.5;return Math.round(p/y)+" "+w+(b?"s":"")}return Gv}var Kv,pA;function fz(){if(pA)return Kv;pA=1;function e(t){r.debug=r,r.default=r,r.coerce=f,r.disable=a,r.enable=o,r.enabled=u,r.humanize=dz(),r.destroy=p,Object.keys(t).forEach(m=>{r[m]=t[m]}),r.names=[],r.skips=[],r.formatters={};function n(m){let y=0;for(let w=0;w{if(U==="%%")return"%";B++;const R=r.formatters[v];if(typeof R=="function"){const C=O[B];U=R.call(N,C),O.splice(B,1),B--}return U}),r.formatArgs.call(N,O),(N.log||r.log).apply(N,O)}return _.namespace=m,_.useColors=r.useColors(),_.color=r.selectColor(m),_.extend=i,_.destroy=r.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(b!==r.namespaces&&(b=r.namespaces,x=r.enabled(m)),x),set:O=>{w=O}}),typeof r.init=="function"&&r.init(_),_}function i(m,y){const w=r(this.namespace+(typeof y>"u"?":":y)+m);return w.log=this.log,w}function o(m){r.save(m),r.namespaces=m,r.names=[],r.skips=[];let y;const w=(typeof m=="string"?m:"").split(/[\s,]+/),b=w.length;for(y=0;y"-"+y)].join(",");return r.enable(""),m}function u(m){if(m[m.length-1]==="*")return!0;let y,w;for(y=0,w=r.skips.length;y{let f=!1;return()=>{f||(f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;f.splice(1,0,p,"color: inherit");let m=0,y=0;f[0].replace(/%[a-zA-Z%]/g,w=>{w!=="%%"&&(m++,w==="%c"&&(y=m))}),f.splice(y,0,p)}t.log=console.debug||console.log||(()=>{});function o(f){try{f?t.storage.setItem("debug",f):t.storage.removeItem("debug")}catch{}}function a(){let f;try{f=t.storage.getItem("debug")}catch{}return!f&&typeof process<"u"&&"env"in process&&(f=n.DEBUG),f}function u(){try{return localStorage}catch{}}e.exports=fz()(t);const{formatters:l}=e.exports;l.j=function(f){try{return JSON.stringify(f)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}}(c0,c0.exports)),c0.exports}var gA;function I_(){if(gA)return Nd;gA=1;var e=Nd&&Nd.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.Transport=void 0;const t=qw(),n=rp,r=Ng(),o=(0,e(Uu()).default)("engine.io-client:transport");class a extends Error{constructor(f,p,m){super(f),this.description=p,this.context=m,this.type="TransportError"}}class u extends n.Emitter{constructor(f){super(),this.writable=!1,(0,r.installTimerFunctions)(this,f),this.opts=f,this.query=f.query,this.socket=f.socket}onError(f,p,m){return super.emitReserved("error",new a(f,p,m)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(f){this.readyState==="open"?this.write(f):o("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(f){const p=(0,t.decodePacket)(f,this.socket.binaryType);this.onPacket(p)}onPacket(f){super.emitReserved("packet",f)}onClose(f){this.readyState="closed",super.emitReserved("close",f)}pause(f){}}return Nd.Transport=u,Nd}var bu={},yA;function SP(){if(yA)return bu;yA=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.yeast=bu.decode=bu.encode=void 0;const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),t=64,n={};let r=0,i=0,o;function a(f){let p="";do p=e[f%t]+p,f=Math.floor(f/t);while(f>0);return p}bu.encode=a;function u(f){let p=0;for(i=0;i{p("paused"),this.readyState="paused",O()};if(this.polling||!this.writable){let E=0;this.polling&&(p("we are currently polling - waiting to pause"),E++,this.once("pollComplete",function(){p("pre-pause polling complete"),--E||N()})),this.writable||(p("we are currently writing - waiting to pause"),E++,this.once("drain",function(){p("pre-pause writing complete"),--E||N()}))}else N()}poll(){p("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(O){p("polling got data %s",O);const N=E=>{if(this.readyState==="opening"&&E.type==="open"&&this.onOpen(),E.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(E)};(0,o.decodePayload)(O,this.socket.binaryType).forEach(N),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():p('ignoring poll - transport state "%s"',this.readyState))}doClose(){const O=()=>{p("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(p("transport open - closing"),O()):(p("transport not open - deferring close"),this.once("open",O))}write(O){this.writable=!1,(0,o.encodePayload)(O,N=>{this.doWrite(N,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let O=this.query||{};const N=this.opts.secure?"https":"http";let E="";this.opts.timestampRequests!==!1&&(O[this.opts.timestampParam]=(0,r.yeast)()),!this.supportsBinary&&!O.sid&&(O.b64=1),this.opts.port&&(N==="https"&&Number(this.opts.port)!==443||N==="http"&&Number(this.opts.port)!==80)&&(E=":"+this.opts.port);const T=(0,i.encode)(O),B=this.opts.hostname.indexOf(":")!==-1;return N+"://"+(B?"["+this.opts.hostname+"]":this.opts.hostname)+E+this.opts.path+(T.length?"?"+T:"")}request(O={}){return Object.assign(O,{xd:this.xd,xs:this.xs},this.opts),new b(this.uri(),O)}doWrite(O,N){const E=this.request({method:"POST",data:O});E.on("success",N),E.on("error",(T,B)=>{this.onError("xhr post error",T,B)})}doPoll(){p("xhr poll");const O=this.request();O.on("data",this.onData.bind(this)),O.on("error",(N,E)=>{this.onError("xhr poll error",N,E)}),this.pollXhr=O}}gu.Polling=w;class b extends u.Emitter{constructor(O,N){super(),(0,l.installTimerFunctions)(this,N),this.opts=N,this.method=N.method||"GET",this.uri=O,this.async=N.async!==!1,this.data=N.data!==void 0?N.data:null,this.create()}create(){const O=(0,l.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");O.xdomain=!!this.opts.xd,O.xscheme=!!this.opts.xs;const N=this.xhr=new a.XHR(O);try{p("xhr open %s: %s",this.method,this.uri),N.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){N.setDisableHeaderCheck&&N.setDisableHeaderCheck(!0);for(let E in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(E)&&N.setRequestHeader(E,this.opts.extraHeaders[E])}}catch{}if(this.method==="POST")try{N.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{N.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in N&&(N.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(N.timeout=this.opts.requestTimeout),N.onreadystatechange=()=>{N.readyState===4&&(N.status===200||N.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof N.status=="number"?N.status:0)},0))},p("xhr data %s",this.data),N.send(this.data)}catch(E){this.setTimeoutFn(()=>{this.onError(E)},0);return}typeof document<"u"&&(this.index=b.requestsCount++,b.requests[this.index]=this)}onError(O){this.emitReserved("error",O,this.xhr),this.cleanup(!0)}cleanup(O){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=m,O)try{this.xhr.abort()}catch{}typeof document<"u"&&delete b.requests[this.index],this.xhr=null}}onLoad(){const O=this.xhr.responseText;O!==null&&(this.emitReserved("data",O),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(gu.Request=b,b.requestsCount=0,b.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",x);else if(typeof addEventListener=="function"){const _="onpagehide"in f.globalThisShim?"pagehide":"unload";addEventListener(_,x,!1)}}function x(){for(let _ in b.requests)b.requests.hasOwnProperty(_)&&b.requests[_].abort()}return gu}var Ad={},wo={},xA;function vP(){if(xA)return wo;xA=1,Object.defineProperty(wo,"__esModule",{value:!0}),wo.defaultBinaryType=wo.usingBrowserWebSocket=wo.WebSocket=wo.nextTick=void 0;const e=Uw();return wo.nextTick=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,r)=>r(n,0),wo.WebSocket=e.globalThisShim.WebSocket||e.globalThisShim.MozWebSocket,wo.usingBrowserWebSocket=!0,wo.defaultBinaryType="arraybuffer",wo}var _A;function gz(){if(_A)return Ad;_A=1;var e=Ad&&Ad.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.WS=void 0;const t=I_(),n=P_(),r=SP(),i=Ng(),o=vP(),a=e(Uu()),u=qw(),l=(0,a.default)("engine.io-client:websocket"),f=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class p extends t.Transport{constructor(y){super(y),this.supportsBinary=!y.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const y=this.uri(),w=this.opts.protocols,b=f?{}:(0,i.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(b.headers=this.opts.extraHeaders);try{this.ws=o.usingBrowserWebSocket&&!f?w?new o.WebSocket(y,w):new o.WebSocket(y):new o.WebSocket(y,w,b)}catch(x){return this.emitReserved("error",x)}this.ws.binaryType=this.socket.binaryType||o.defaultBinaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=y=>this.onClose({description:"websocket connection closed",context:y}),this.ws.onmessage=y=>this.onData(y.data),this.ws.onerror=y=>this.onError("websocket error",y)}write(y){this.writable=!1;for(let w=0;w{const O={};o.usingBrowserWebSocket||(b.options&&(O.compress=b.options.compress),this.opts.perMessageDeflate&&(typeof _=="string"?Buffer.byteLength(_):_.length){this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let y=this.query||{};const w=this.opts.secure?"wss":"ws";let b="";this.opts.port&&(w==="wss"&&Number(this.opts.port)!==443||w==="ws"&&Number(this.opts.port)!==80)&&(b=":"+this.opts.port),this.opts.timestampRequests&&(y[this.opts.timestampParam]=(0,r.yeast)()),this.supportsBinary||(y.b64=1);const x=(0,n.encode)(y),_=this.opts.hostname.indexOf(":")!==-1;return w+"://"+(_?"["+this.opts.hostname+"]":this.opts.hostname)+b+this.opts.path+(x.length?"?"+x:"")}check(){return!!o.WebSocket}}return Ad.WS=p,Ad}var kA;function xP(){if(kA)return ym;kA=1,Object.defineProperty(ym,"__esModule",{value:!0}),ym.transports=void 0;const e=mz(),t=gz();return ym.transports={websocket:t.WS,polling:e.Polling},ym}var vm={},RA;function _P(){if(RA)return vm;RA=1,Object.defineProperty(vm,"__esModule",{value:!0}),vm.parse=void 0;const e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,t=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function n(o){const a=o,u=o.indexOf("["),l=o.indexOf("]");u!=-1&&l!=-1&&(o=o.substring(0,u)+o.substring(u,l).replace(/:/g,";")+o.substring(l,o.length));let f=e.exec(o||""),p={},m=14;for(;m--;)p[t[m]]=f[m]||"";return u!=-1&&l!=-1&&(p.source=a,p.host=p.host.substring(1,p.host.length-1).replace(/;/g,":"),p.authority=p.authority.replace("[","").replace("]","").replace(/;/g,":"),p.ipv6uri=!0),p.pathNames=r(p,p.path),p.queryKey=i(p,p.query),p}vm.parse=n;function r(o,a){const u=/\/{2,9}/g,l=a.replace(u,"/").split("/");return(a.slice(0,1)=="/"||a.length===0)&&l.splice(0,1),a.slice(-1)=="/"&&l.splice(l.length-1,1),l}function i(o,a){const u={};return a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(l,f,p){f&&(u[f]=p)}),u}return vm}var TA;function yz(){if(TA)return Od;TA=1;var e=Od&&Od.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Od,"__esModule",{value:!0}),Od.Socket=void 0;const t=xP(),n=Ng(),r=P_(),i=_P(),o=e(Uu()),a=rp,u=qw(),l=(0,o.default)("engine.io-client:socket");class f extends a.Emitter{constructor(m,y={}){super(),this.writeBuffer=[],m&&typeof m=="object"&&(y=m,m=null),m?(m=(0,i.parse)(m),y.hostname=m.host,y.secure=m.protocol==="https"||m.protocol==="wss",y.port=m.port,m.query&&(y.query=m.query)):y.host&&(y.hostname=(0,i.parse)(y.host).host),(0,n.installTimerFunctions)(this,y),this.secure=y.secure!=null?y.secure:typeof location<"u"&&location.protocol==="https:",y.hostname&&!y.port&&(y.port=this.secure?"443":"80"),this.hostname=y.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=y.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=y.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},y),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,r.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(m){l('creating transport "%s"',m);const y=Object.assign({},this.opts.query);y.EIO=u.protocol,y.transport=m,this.id&&(y.sid=this.id);const w=Object.assign({},this.opts.transportOptions[m],this.opts,{query:y,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return l("options: %j",w),new t.transports[m](w)}open(){let m;if(this.opts.rememberUpgrade&&f.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)m="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else m=this.transports[0];this.readyState="opening";try{m=this.createTransport(m)}catch(y){l("error while creating transport: %s",y),this.transports.shift(),this.open();return}m.open(),this.setTransport(m)}setTransport(m){l("setting transport %s",m.name),this.transport&&(l("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=m,m.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",y=>this.onClose("transport close",y))}probe(m){l('probing transport "%s"',m);let y=this.createTransport(m),w=!1;f.priorWebsocketSuccess=!1;const b=()=>{w||(l('probe transport "%s" opened',m),y.send([{type:"ping",data:"probe"}]),y.once("packet",B=>{if(!w)if(B.type==="pong"&&B.data==="probe"){if(l('probe transport "%s" pong',m),this.upgrading=!0,this.emitReserved("upgrading",y),!y)return;f.priorWebsocketSuccess=y.name==="websocket",l('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{w||this.readyState!=="closed"&&(l("changing transport and sending upgrade packet"),T(),this.setTransport(y),y.send([{type:"upgrade"}]),this.emitReserved("upgrade",y),y=null,this.upgrading=!1,this.flush())})}else{l('probe transport "%s" failed',m);const A=new Error("probe error");A.transport=y.name,this.emitReserved("upgradeError",A)}}))};function x(){w||(w=!0,T(),y.close(),y=null)}const _=B=>{const A=new Error("probe error: "+B);A.transport=y.name,x(),l('probe transport "%s" failed because of error: %s',m,B),this.emitReserved("upgradeError",A)};function O(){_("transport closed")}function N(){_("socket closed")}function E(B){y&&B.name!==y.name&&(l('"%s" works - aborting "%s"',B.name,y.name),x())}const T=()=>{y.removeListener("open",b),y.removeListener("error",_),y.removeListener("close",O),this.off("close",N),this.off("upgrading",E)};y.once("open",b),y.once("error",_),y.once("close",O),this.once("close",N),this.once("upgrading",E),y.open()}onOpen(){if(l("socket open"),this.readyState="open",f.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){l("starting upgrade probes");let m=0;const y=this.upgrades.length;for(;m{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const m=this.getWritablePackets();l("flushing %d packets in socket",m.length),this.transport.send(m),this.prevBufferLen=m.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let y=1;for(let w=0;w0&&y>this.maxPayload)return l("only send %d out of %d packets",w,this.writeBuffer.length),this.writeBuffer.slice(0,w);y+=2}return l("payload size is %d (max: %d)",y,this.maxPayload),this.writeBuffer}write(m,y,w){return this.sendPacket("message",m,y,w),this}send(m,y,w){return this.sendPacket("message",m,y,w),this}sendPacket(m,y,w,b){if(typeof y=="function"&&(b=y,y=void 0),typeof w=="function"&&(b=w,w=null),this.readyState==="closing"||this.readyState==="closed")return;w=w||{},w.compress=w.compress!==!1;const x={type:m,data:y,options:w};this.emitReserved("packetCreate",x),this.writeBuffer.push(x),b&&this.once("flush",b),this.flush()}close(){const m=()=>{this.onClose("forced close"),l("socket closing - telling transport to close"),this.transport.close()},y=()=>{this.off("upgrade",y),this.off("upgradeError",y),m()},w=()=>{this.once("upgrade",y),this.once("upgradeError",y)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?w():m()}):this.upgrading?w():m()),this}onError(m){l("socket error %j",m),f.priorWebsocketSuccess=!1,this.emitReserved("error",m),this.onClose("transport error",m)}onClose(m,y){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(l('socket close with reason: "%s"',m),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",m,y),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(m){const y=[];let w=0;const b=m.length;for(;wtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(u):u.buffer instanceof ArrayBuffer,n=Object.prototype.toString,r=typeof Blob=="function"||typeof Blob<"u"&&n.call(Blob)==="[object BlobConstructor]",i=typeof File=="function"||typeof File<"u"&&n.call(File)==="[object FileConstructor]";function o(u){return e&&(u instanceof ArrayBuffer||t(u))||r&&u instanceof Blob||i&&u instanceof File}Pd.isBinary=o;function a(u,l){if(!u||typeof u!="object")return!1;if(Array.isArray(u)){for(let f=0,p=u.length;f=0&&o.num{delete this.acks[f];for(let b=0;b{this.io.clearTimeoutFn(w),p.apply(this,[null,...b])}}emitWithAck(f,...p){const m=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((y,w)=>{p.push((b,x)=>m?b?w(b):y(x):y(b)),this.emit(f,...p)})}_addToQueue(f){let p;typeof f[f.length-1]=="function"&&(p=f.pop());const m={id:this._queueSeq++,tryCount:0,pending:!1,args:f,flags:Object.assign({fromQueue:!0},this.flags)};f.push((y,...w)=>m!==this._queue[0]?void 0:(y!==null?m.tryCount>this._opts.retries&&(o("packet [%d] is discarded after %d tries",m.id,m.tryCount),this._queue.shift(),p&&p(y)):(o("packet [%d] was successfully sent",m.id),this._queue.shift(),p&&p(null,...w)),m.pending=!1,this._drainQueue())),this._queue.push(m),this._drainQueue()}_drainQueue(f=!1){if(o("draining queue"),!this.connected||this._queue.length===0)return;const p=this._queue[0];if(p.pending&&!f){o("packet [%d] has already been sent and is waiting for an ack",p.id);return}p.pending=!0,p.tryCount++,o("sending packet [%d] (try n°%d)",p.id,p.tryCount),this.flags=p.flags,this.emit.apply(this,p.args)}packet(f){f.nsp=this.nsp,this.io._packet(f)}onopen(){o("transport is open - connecting"),typeof this.auth=="function"?this.auth(f=>{this._sendConnectPacket(f)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(f){this.packet({type:t.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},f):f})}onerror(f){this.connected||this.emitReserved("connect_error",f)}onclose(f,p){o("close (%s)",f),this.connected=!1,delete this.id,this.emitReserved("disconnect",f,p)}onpacket(f){if(f.nsp===this.nsp)switch(f.type){case t.PacketType.CONNECT:f.data&&f.data.sid?this.onconnect(f.data.sid,f.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case t.PacketType.EVENT:case t.PacketType.BINARY_EVENT:this.onevent(f);break;case t.PacketType.ACK:case t.PacketType.BINARY_ACK:this.onack(f);break;case t.PacketType.DISCONNECT:this.ondisconnect();break;case t.PacketType.CONNECT_ERROR:this.destroy();const m=new Error(f.data.message);m.data=f.data.data,this.emitReserved("connect_error",m);break}}onevent(f){const p=f.data||[];o("emitting event %j",p),f.id!=null&&(o("attaching ack callback to event"),p.push(this.ack(f.id))),this.connected?this.emitEvent(p):this.receiveBuffer.push(Object.freeze(p))}emitEvent(f){if(this._anyListeners&&this._anyListeners.length){const p=this._anyListeners.slice();for(const m of p)m.apply(this,f)}super.emit.apply(this,f),this._pid&&f.length&&typeof f[f.length-1]=="string"&&(this._lastOffset=f[f.length-1])}ack(f){const p=this;let m=!1;return function(...y){m||(m=!0,o("sending ack %j",y),p.packet({type:t.PacketType.ACK,id:f,data:y}))}}onack(f){const p=this.acks[f.id];typeof p=="function"?(o("calling ack %s with %j",f.id,f.data),p.apply(this,f.data),delete this.acks[f.id]):o("bad ack %s",f.id)}onconnect(f,p){o("socket connected with id %s",f),this.id=f,this.recovered=p&&this._pid===p,this._pid=p,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(f=>this.emitEvent(f)),this.receiveBuffer=[],this.sendBuffer.forEach(f=>{this.notifyOutgoingListeners(f),this.packet(f)}),this.sendBuffer=[]}ondisconnect(){o("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(f=>f()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(o("performing disconnect (%s)",this.nsp),this.packet({type:t.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(f){return this.flags.compress=f,this}get volatile(){return this.flags.volatile=!0,this}timeout(f){return this.flags.timeout=f,this}onAny(f){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(f),this}prependAny(f){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(f),this}offAny(f){if(!this._anyListeners)return this;if(f){const p=this._anyListeners;for(let m=0;m0&&t.jitter<=1?t.jitter:0,this.attempts=0}return _m.Backoff=e,e.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),r=Math.floor(n*this.jitter*t);t=Math.floor(n*10)&1?t+r:t-r}return Math.min(t,this.max)|0},e.prototype.reset=function(){this.attempts=0},e.prototype.setMin=function(t){this.ms=t},e.prototype.setMax=function(t){this.max=t},e.prototype.setJitter=function(t){this.jitter=t},_m}var MA;function vz(){if(MA)return bi;MA=1;var e=bi&&bi.__createBinding||(Object.create?function(w,b,x,_){_===void 0&&(_=x),Object.defineProperty(w,_,{enumerable:!0,get:function(){return b[x]}})}:function(w,b,x,_){_===void 0&&(_=x),w[_]=b[x]}),t=bi&&bi.__setModuleDefault||(Object.create?function(w,b){Object.defineProperty(w,"default",{enumerable:!0,value:b})}:function(w,b){w.default=b}),n=bi&&bi.__importStar||function(w){if(w&&w.__esModule)return w;var b={};if(w!=null)for(var x in w)x!=="default"&&Object.prototype.hasOwnProperty.call(w,x)&&e(b,w,x);return t(b,w),b},r=bi&&bi.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(bi,"__esModule",{value:!0}),bi.Manager=void 0;const i=kP(),o=OP(),a=n(M_()),u=TP(),l=Sz(),f=rp,m=r(Uu()).default("socket.io-client:manager");class y extends f.Emitter{constructor(b,x){var _;super(),this.nsps={},this.subs=[],b&&typeof b=="object"&&(x=b,b=void 0),x=x||{},x.path=x.path||"/socket.io",this.opts=x,i.installTimerFunctions(this,x),this.reconnection(x.reconnection!==!1),this.reconnectionAttempts(x.reconnectionAttempts||1/0),this.reconnectionDelay(x.reconnectionDelay||1e3),this.reconnectionDelayMax(x.reconnectionDelayMax||5e3),this.randomizationFactor((_=x.randomizationFactor)!==null&&_!==void 0?_:.5),this.backoff=new l.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(x.timeout==null?2e4:x.timeout),this._readyState="closed",this.uri=b;const O=x.parser||a;this.encoder=new O.Encoder,this.decoder=new O.Decoder,this._autoConnect=x.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(b){return arguments.length?(this._reconnection=!!b,this):this._reconnection}reconnectionAttempts(b){return b===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=b,this)}reconnectionDelay(b){var x;return b===void 0?this._reconnectionDelay:(this._reconnectionDelay=b,(x=this.backoff)===null||x===void 0||x.setMin(b),this)}randomizationFactor(b){var x;return b===void 0?this._randomizationFactor:(this._randomizationFactor=b,(x=this.backoff)===null||x===void 0||x.setJitter(b),this)}reconnectionDelayMax(b){var x;return b===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=b,(x=this.backoff)===null||x===void 0||x.setMax(b),this)}timeout(b){return arguments.length?(this._timeout=b,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(b){if(m("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;m("opening %s",this.uri),this.engine=new i.Socket(this.uri,this.opts);const x=this.engine,_=this;this._readyState="opening",this.skipReconnect=!1;const O=u.on(x,"open",function(){_.onopen(),b&&b()}),N=u.on(x,"error",E=>{m("error"),_.cleanup(),_._readyState="closed",this.emitReserved("error",E),b?b(E):_.maybeReconnectOnOpen()});if(this._timeout!==!1){const E=this._timeout;m("connect attempt will timeout after %d",E),E===0&&O();const T=this.setTimeoutFn(()=>{m("connect attempt timed out after %d",E),O(),x.close(),x.emit("error",new Error("timeout"))},E);this.opts.autoUnref&&T.unref(),this.subs.push(function(){clearTimeout(T)})}return this.subs.push(O),this.subs.push(N),this}connect(b){return this.open(b)}onopen(){m("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const b=this.engine;this.subs.push(u.on(b,"ping",this.onping.bind(this)),u.on(b,"data",this.ondata.bind(this)),u.on(b,"error",this.onerror.bind(this)),u.on(b,"close",this.onclose.bind(this)),u.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(b){try{this.decoder.add(b)}catch(x){this.onclose("parse error",x)}}ondecoded(b){i.nextTick(()=>{this.emitReserved("packet",b)},this.setTimeoutFn)}onerror(b){m("error",b),this.emitReserved("error",b)}socket(b,x){let _=this.nsps[b];return _?this._autoConnect&&!_.active&&_.connect():(_=new o.Socket(this,b,x),this.nsps[b]=_),_}_destroy(b){const x=Object.keys(this.nsps);for(const _ of x)if(this.nsps[_].active){m("socket %s is still active, skipping close",_);return}this._close()}_packet(b){m("writing packet %j",b);const x=this.encoder.encode(b);for(let _=0;_b()),this.subs.length=0,this.decoder.destroy()}_close(){m("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(b,x){m("closed due to %s",b),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",b,x),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const b=this;if(this.backoff.attempts>=this._reconnectionAttempts)m("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const x=this.backoff.duration();m("will wait %dms before reconnect attempt",x),this._reconnecting=!0;const _=this.setTimeoutFn(()=>{b.skipReconnect||(m("attempting reconnect"),this.emitReserved("reconnect_attempt",b.backoff.attempts),!b.skipReconnect&&b.open(O=>{O?(m("reconnect attempt error"),b._reconnecting=!1,b.reconnect(),this.emitReserved("reconnect_error",O)):(m("reconnect success"),b.onreconnect())}))},x);this.opts.autoUnref&&_.unref(),this.subs.push(function(){clearTimeout(_)})}}onreconnect(){const b=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",b)}}return bi.Manager=y,bi}var LA=jm.exports,BA;function xz(){return BA||(BA=1,function(e,t){var n=LA&&LA.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const r=wz(),i=vz();Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return i.Manager}});const o=OP();Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return o.Socket}});const u=n(Uu()).default("socket.io-client"),l={};function f(m,y){typeof m=="object"&&(y=m,m=void 0),y=y||{};const w=r.url(m,y.path||"/socket.io"),b=w.source,x=w.id,_=w.path,O=l[x]&&_ in l[x].nsps,N=y.forceNew||y["force new connection"]||y.multiplex===!1||O;let E;return N?(u("ignoring socket cache for %s",b),E=new i.Manager(b,y)):(l[x]||(u("new io instance for %s",b),l[x]=new i.Manager(b,y)),E=l[x]),w.query&&!y.query&&(y.query=w.queryKey),E.socket(w.path,y)}t.io=f,t.connect=f,t.default=f,Object.assign(f,{Manager:i.Manager,Socket:o.Socket,io:f,connect:f});var p=M_();Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return p.protocol}}),e.exports=f}(jm,jm.exports)),jm.exports}var jA;function _z(){if(jA)return gm;jA=1,Object.defineProperty(gm,"__esModule",{value:!0}),gm.StacksApiSocketClient=void 0;const e=xz(),t=Ie();function n(i){let o;try{if(o=new URL(i),!o.protocol||!o.host)throw new TypeError(`[ERR_INVALID_URL]: Invalid URL: ${i}`)}catch(a){throw console.error('Pass an absolute URL with a protocol/schema, e.g. "wss://example.com"'),a}return o}class r{constructor(o){this.socket=o}static connect({url:o=t.BASE_PATH,subscriptions:a=[]}={}){const u=(0,e.io)(n(o).href,{query:{subscriptions:Array.from(new Set(a)).join(",")}});return new r(u)}handleSubscription(o,a=!1){var u,l;const f=new Set((l=(u=this.socket.io.opts.query)===null||u===void 0?void 0:u.subscriptions.split(","))!==null&&l!==void 0?l:[]);return a?(this.socket.emit("subscribe",o,p=>{p&&console.error(`Error subscribing: ${p}`)}),f.add(o)):(this.socket.emit("unsubscribe",o),f.delete(o)),this.socket.io.opts.query===void 0&&(this.socket.io.opts.query={}),this.socket.io.opts.query.subscriptions=Array.from(f).join(","),{unsubscribe:()=>{this.handleSubscription(o,!1)}}}subscribeBlocks(){return this.handleSubscription("block",!0)}unsubscribeBlocks(){this.handleSubscription("block",!1)}subscribeMicroblocks(){return this.handleSubscription("microblock",!0)}unsubscribeMicroblocks(){this.handleSubscription("microblock",!1)}subscribeMempool(){return this.handleSubscription("mempool",!0)}unsubscribeMempool(){this.handleSubscription("mempool",!1)}subscribeAddressTransactions(o){return this.handleSubscription(`address-transaction:${o}`,!0)}unsubscribeAddressTransactions(o){this.handleSubscription(`address-transaction:${o}`,!1)}subscribeAddressStxBalance(o){return this.handleSubscription(`address-stx-balance:${o}`,!0)}unsubscribeAddressStxBalance(o){this.handleSubscription(`address-stx-balance:${o}`,!1)}subscribeTransaction(o){return this.handleSubscription(`transaction:${o}`,!0)}unsubscribeTransaction(o){this.handleSubscription(`transaction:${o}`,!1)}subscribeNftEvent(){return this.handleSubscription("nft-event",!0)}unsubscribeNftEvent(){this.handleSubscription("nft-event",!1)}subscribeNftAssetEvent(o,a){return this.handleSubscription(`nft-asset-event:${o}+${a}`,!0)}unsubscribeNftAssetEvent(o,a){this.handleSubscription(`nft-asset-event:${o}+${a}`,!1)}subscribeNftCollectionEvent(o){return this.handleSubscription(`nft-collection-event:${o}`,!0)}unsubscribeNftCollectionEvent(o){this.handleSubscription(`nft-collection-event:${o}`,!1)}logEvents(){this.socket.on("connect",()=>console.log("socket connected")),this.socket.on("disconnect",o=>console.warn("disconnected",o)),this.socket.on("connect_error",o=>console.error("connect_error",o)),this.socket.on("block",o=>console.log("block",o)),this.socket.on("microblock",o=>console.log("microblock",o)),this.socket.on("mempool",o=>console.log("mempool",o)),this.socket.on("address-transaction",(o,a)=>console.log("address-transaction",o,a)),this.socket.on("address-stx-balance",(o,a)=>console.log("address-stx-balance",o,a)),this.socket.on("nft-event",o=>console.log("nft-event",o)),this.socket.on("nft-asset-event",(o,a,u)=>console.log("nft-asset-event",o,a,u)),this.socket.on("nft-collection-event",(o,a)=>console.log("nft-collection-event",o,a))}}return gm.StacksApiSocketClient=r,gm}var DA;function kz(){return DA||(DA=1,function(e){var t=vd&&vd.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(i,o);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,a,u)}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=vd&&vd.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(YH(),e),n(oz(),e),n(_z(),e)}(vd)),vd}var rr=kz(),dn;(function(e){e[e.Mainnet=1]="Mainnet",e[e.Testnet=2147483648]="Testnet"})(dn||(dn={}));var tw;(function(e){e[e.Mainnet=385875968]="Mainnet",e[e.Testnet=4278190080]="Testnet"})(tw||(tw={}));dn.Mainnet;var Ni;(function(e){e[e.Mainnet=0]="Mainnet",e[e.Testnet=128]="Testnet"})(Ni||(Ni={}));var Ao;(function(e){e[e.MainnetSingleSig=22]="MainnetSingleSig",e[e.MainnetMultiSig=20]="MainnetMultiSig",e[e.TestnetSingleSig=26]="TestnetSingleSig",e[e.TestnetMultiSig=21]="TestnetMultiSig"})(Ao||(Ao={}));Ni.Mainnet;function Rz(e){return t=>t[e]}const Tz={network:{layer1:"placeholder"},logLevel:"debug"},Sf={MISSING_PARAMETER:"missing_parameter",REMOTE_SERVICE_ERROR:"remote_service_error",INVALID_STATE:"invalid_state",NO_SESSION_DATA:"no_session_data",DOES_NOT_EXIST:"does_not_exist",FAILED_DECRYPTION_ERROR:"failed_decryption_error",INVALID_DID_ERROR:"invalid_did_error",NOT_ENOUGH_FUNDS_ERROR:"not_enough_error",INVALID_AMOUNT_ERROR:"invalid_amount_error",LOGIN_FAILED_ERROR:"login_failed",SIGNATURE_VERIFICATION_ERROR:"signature_verification_failure",CONFLICT_ERROR:"conflict_error",NOT_ENOUGH_PROOF_ERROR:"not_enough_proof_error",BAD_PATH_ERROR:"bad_path_error",VALIDATION_ERROR:"validation_error",PAYLOAD_TOO_LARGE_ERROR:"payload_too_large_error",PRECONDITION_FAILED_ERROR:"precondition_failed_error",UNKNOWN:"unknown"};Object.freeze(Sf);class ip extends Error{constructor(t){super();let n=t.message,r=`Error Code: ${t.code}`,i=this.stack;if(i)r+=`Stack Trace: ${i}`;else try{throw new Error}catch(o){i=o.stack}n+=` If you believe this exception is caused by a bug in stacks.js, please file a bug report: https://github.com/blockstack/stacks.js/issues ${r}`,this.message=n,this.code=t.code,this.parameter=t.parameter?t.parameter:void 0}toString(){return`${super.toString()} - code: ${this.code} param: ${this.parameter?this.parameter:"n/a"}`}}class Oz extends ip{constructor(t,n=""){super({code:bf.MISSING_PARAMETER,message:n,parameter:t}),this.name="MissingParametersError"}}class JA extends ip{constructor(t=""){super({code:bf.INVALID_DID_ERROR,message:t}),this.name="InvalidDIDError"}}class u0 extends ip{constructor(t){const n=`Failed to login: ${t}`;super({code:bf.LOGIN_FAILED_ERROR,message:n}),this.message=n,this.name="LoginFailedError"}}class $A extends ip{constructor(t="Unable to decrypt cipher object."){super({code:bf.FAILED_DECRYPTION_ERROR,message:t}),this.message=t,this.name="FailedDecryptionError"}}class f1 extends ip{constructor(t){super({code:bf.INVALID_STATE,message:t}),this.message=t,this.name="InvalidStateError"}}class NP extends ip{constructor(t){super({code:bf.INVALID_STATE,message:t}),this.message=t,this.name="NoSessionDataError"}}const qA=["debug","info","warn","error","none"],h1={};for(let e=0;eparseInt(i,10)),r=t.split(".").map(i=>parseInt(i,10));for(let i=0;i=e.length&&r.push(0),n[i]{const n=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t==="x"?n:n&3|8).toString(16)})}function Az(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unexpected runtime environment - no supported global scope (`window`, `self`, `global`) available")}function Fz(e,t,n){return n?`Use of '${n}' requires \`${t}\` which is unavailable on the '${e}' object within the currently executing environment.`:`\`${t}\` is unavailable on the '${e}' object within the currently executing environment.`}function L_(e,{throwIfUnavailable:t,usageDesc:n,returnEmptyObject:r}={}){let i;try{if(i=Az(),i){const o=i[e];if(o)return o}}catch(o){yh.error(`Error getting object '${e}' from global scope '${i}': ${o}`)}if(t){const o=Fz(i,e.toString(),n);throw yh.error(o),new Error(o)}if(r)return{}}function Ml(e,t){return zw(Yt(e),t)}function Yt(e){if(typeof e=="bigint")return e;if(typeof e=="string")return BigInt(e);if(typeof e=="number"){if(!Number.isInteger(e))throw new RangeError("Invalid value. Values of type 'number' must be an integer.");if(e>Number.MAX_SAFE_INTEGER)throw new RangeError(`Invalid value. Values of type 'number' must be less than or equal to ${Number.MAX_SAFE_INTEGER}. For larger values, try using a BigInt instead.`);return BigInt(e)}if(ai(e,Uint8Array))return BigInt(`0x${at(e)}`);throw new TypeError("intToBigInt: Invalid value type. Must be a number, bigint, BigInt-compatible string, or Uint8Array.")}function CP(e){return/^0x/i.test(e)?e.slice(2):e}function nw(e){if(typeof e!="string")throw new TypeError(`hexToBigInt: expected string, got ${typeof e}`);return BigInt(`0x${e}`)}function Cg(e,t=8){return(typeof e=="bigint"?e:Yt(e)).toString(16).padStart(t*2,"0")}function Hw(e){return parseInt(e,16)}function zw(e,t=16){const n=Cg(e,t);return rt(n)}function Iz(e,t){if(e<-(BigInt(1)<=BigInt(0)?BigInt(e):e+(BigInt(1)<t.toString(16).padStart(2,"0"));function at(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(const n of e)t+=Lz[n];return t}function rt(e){if(typeof e!="string")throw new TypeError(`hexToBytes: expected string, got ${typeof e}`);e=CP(e),e=e.length%2?`0${e}`:e;const t=new Uint8Array(e.length/2);for(let n=0;n255}function UA(e){if(e.some(Bz))throw new Error("Some values are invalid bytes.");return new Uint8Array(e)}function so(...e){if(!e.every(r=>r instanceof Uint8Array))throw new Error("Uint8Array list expected");if(e.length===1)return e[0];const t=e.reduce((r,i)=>r+i.length,0),n=new Uint8Array(t);for(let r=0,i=0;rtypeof t=="number"?UA([t]):t instanceof Array?UA(t):t))}function ai(e,t){var n,r;return e instanceof t||((r=(n=e==null?void 0:e.constructor)==null?void 0:n.name)==null?void 0:r.toLowerCase())===t.name}function jz(e){return e=CP(e),e.length!==64?!1:/^[0-9a-fA-F]+$/.test(e)}const Dz="https://api.mainnet.hiro.so",Jz="https://api.testnet.hiro.so",$z="http://localhost:3999",qz="https://hub.blockstack.org",Uz=33,Xv=32;function FP(e){if(e.length>>0}function Vz(e,t,n=0){return e[n+0]=t>>>8,e[n+1]=t>>>0,e}function IP(e,t){return e[t]}function Dm(e,t,n=0){return e[n]=t,e}function Gz(e,t,n=0){return e[n+0]=t&255,t>>>=8,e[n+1]=t&255,e}function Kz(e,t){return e[t]*2**24+e[t+1]*2**16+e[t+2]*2**8+e[t+3]}function ff(e,t,n=0){return e[n+3]=t,t>>>=8,e[n+2]=t,t>>>=8,e[n+1]=t,t>>>=8,e[n]=t,e}function Zv(e,t,n=0){return e[n+0]=t&255,t>>>=8,e[n+1]=t&255,t>>>=8,e[n+2]=t&255,t>>>=8,e[n+3]=t&255,e}const Qz={referrerPolicy:"origin",headers:{"x-hiro-product":"stacksjs"}};async function Yz(e,t){const n={};return Object.assign(n,Qz,t),await fetch(e,n)}function Xz(e){let t=Yz,n=[];return e.length>0&&typeof e[0]=="function"&&(t=e.shift()),e.length>0&&(n=e),{fetchLib:t,middlewares:n}}function PP(...e){const{fetchLib:t,middlewares:n}=Xz(e);return async(i,o)=>{let a={url:i,init:o??{}};for(const l of n)typeof l.pre=="function"&&(a=await Promise.resolve(l.pre({fetch:t,...a}))??a);let u=await t(a.url,a.init);for(const l of n)typeof l.post=="function"&&(u=await Promise.resolve(l.post({fetch:t,url:a.url,init:a.init,response:(u==null?void 0:u.clone())??u}))??u);return u}}const Ag={chainId:dn.Mainnet,transactionVersion:Ni.Mainnet,peerNetworkId:tw.Mainnet,magicBytes:"X2",bootAddress:"SP000000000000000000002Q6VF78",addressVersion:{singleSig:Ao.MainnetSingleSig,multiSig:Ao.MainnetMultiSig},client:{baseUrl:Dz}},ag={chainId:dn.Testnet,transactionVersion:Ni.Testnet,peerNetworkId:tw.Testnet,magicBytes:"T2",bootAddress:"ST000000000000000000002AMW42H",addressVersion:{singleSig:Ao.TestnetSingleSig,multiSig:Ao.TestnetMultiSig},client:{baseUrl:Jz}},Vm={...ag,addressVersion:{...ag.addressVersion},magicBytes:"id",client:{baseUrl:$z}},MP={...Vm,addressVersion:{...Vm.addressVersion},client:{...Vm.client}},Zz=["mainnet","testnet","devnet","mocknet"];function eW(e){switch(e){case"mainnet":return Ag;case"testnet":return ag;case"devnet":return Vm;case"mocknet":return MP;default:throw new Error(`Unknown network name: ${e}`)}}function mr(e){return typeof e=="string"?eW(e):e}function hs(e){return e.client.fetch?e.client:{...e.client,fetch:PP()}}const LP=typeof document<"u",tW=typeof window<"u"?{name:"Stacking",icon:`${window.location.origin}/logo.svg`}:{name:"Stacking - Testing",icon:"/logo.svg"},nW="https://api.hiro.so",rW="https://api.testnet.hiro.so",Dh="http://localhost:3999",HA="https://api.nakamoto.testnet.hiro.so";var iW={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},oW=Object.defineProperty,sW=Object.defineProperties,aW=Object.getOwnPropertyDescriptors,rw=Object.getOwnPropertySymbols,BP=Object.prototype.hasOwnProperty,jP=Object.prototype.propertyIsEnumerable,zA=(e,t,n)=>t in e?oW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WA=(e,t)=>{for(var n in t||(t={}))BP.call(t,n)&&zA(e,n,t[n]);if(rw)for(var n of rw(t))jP.call(t,n)&&zA(e,n,t[n]);return e},cW=(e,t)=>sW(e,aW(t)),uW=(e,t)=>{var n={};for(var r in e)BP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rw)for(var r of rw(e))t.indexOf(r)<0&&jP.call(e,r)&&(n[r]=e[r]);return n},Hl=(e,t,n)=>{const r=$.forwardRef((i,o)=>{var a=i,{color:u="currentColor",size:l=24,stroke:f=2,children:p}=a,m=uW(a,["color","size","stroke","children"]);return $.createElement("svg",WA(cW(WA({ref:o},iW),{width:l,height:l,stroke:u,strokeWidth:f,className:`tabler-icon tabler-icon-${e}`}),m),[...n.map(([y,w])=>$.createElement(y,w)),...p||[]])});return r.propTypes={color:Sd.string,size:Sd.oneOfType([Sd.string,Sd.number]),stroke:Sd.oneOfType([Sd.string,Sd.number])},r.displayName=`${t}`,r},DP=Hl("alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]),lW=Hl("check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),cg=Hl("clock-hour-4","IconClockHour4",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 12l3 2",key:"svg-1"}],["path",{d:"M12 7v5",key:"svg-2"}]]),JP=Hl("copy","IconCopy",[["path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2",key:"svg-1"}]]),dW=Hl("edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]),Th=Hl("info-circle","IconInfoCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 9h.01",key:"svg-1"}],["path",{d:"M11 12h1v4h1",key:"svg-2"}]]),ps=Hl("lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]),iw=Hl("stairs","IconStairs",[["path",{d:"M22 5h-5v5h-5v5h-5v5h-5",key:"svg-0"}]]),fW=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ex=Math.ceil,Qi=Math.floor,ni="[BigNumber Error] ",VA=ni+"Number primitive has more than 15 significant digits: ",bo=1e14,yt=14,tx=9007199254740991,nx=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],gl=1e7,hr=1e9;function $P(e){var t,n,r,i=N.prototype={constructor:N,toString:null,valueOf:null},o=new N(1),a=20,u=4,l=-7,f=21,p=-1e7,m=1e7,y=!1,w=1,b=0,x={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},k="0123456789abcdefghijklmnopqrstuvwxyz",O=!0;function N(v,R){var C,M,J,P,D,q,K,Q,H=this;if(!(H instanceof N))return new N(v,R);if(R==null){if(v&&v._isBigNumber===!0){H.s=v.s,!v.c||v.e>m?H.c=H.e=null:v.e=10;D/=10,P++);P>m?H.c=H.e=null:(H.e=P,H.c=[v]);return}Q=String(v)}else{if(!fW.test(Q=String(v)))return r(H,Q,q);H.s=Q.charCodeAt(0)==45?(Q=Q.slice(1),-1):1}(P=Q.indexOf("."))>-1&&(Q=Q.replace(".","")),(D=Q.search(/e/i))>0?(P<0&&(P=D),P+=+Q.slice(D+1),Q=Q.substring(0,D)):P<0&&(P=Q.length)}else{if(Nn(R,2,k.length,"Base"),R==10&&O)return H=new N(v),A(H,a+H.e+1,u);if(Q=String(v),q=typeof v=="number"){if(v*0!=0)return r(H,Q,q,R);if(H.s=1/v<0?(Q=Q.slice(1),-1):1,N.DEBUG&&Q.replace(/^0\.0*|\./,"").length>15)throw Error(VA+v)}else H.s=Q.charCodeAt(0)===45?(Q=Q.slice(1),-1):1;for(C=k.slice(0,R),P=D=0,K=Q.length;DP){P=K;continue}}else if(!J&&(Q==Q.toUpperCase()&&(Q=Q.toLowerCase())||Q==Q.toLowerCase()&&(Q=Q.toUpperCase()))){J=!0,D=-1,P=0;continue}return r(H,String(v),q,R)}q=!1,Q=n(Q,R,10,H.s),(P=Q.indexOf("."))>-1?Q=Q.replace(".",""):P=Q.length}for(D=0;Q.charCodeAt(D)===48;D++);for(K=Q.length;Q.charCodeAt(--K)===48;);if(Q=Q.slice(D,++K)){if(K-=D,q&&N.DEBUG&&K>15&&(v>tx||v!==Qi(v)))throw Error(VA+H.s*v);if((P=P-D-1)>m)H.c=H.e=null;else if(P=-hr&&J<=hr&&J===Qi(J)){if(M[0]===0){if(J===0&&M.length===1)return!0;break e}if(R=(J+1)%yt,R<1&&(R+=yt),String(M[0]).length==R){for(R=0;R=bo||C!==Qi(C))break e;if(C!==0)return!0}}}else if(M===null&&J===null&&(P===null||P===1||P===-1))return!0;throw Error(ni+"Invalid BigNumber: "+v)},N.maximum=N.max=function(){return T(arguments,-1)},N.minimum=N.min=function(){return T(arguments,1)},N.random=function(){var v=9007199254740992,R=Math.random()*v&2097151?function(){return Qi(Math.random()*v)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(C){var M,J,P,D,q,K=0,Q=[],H=new N(o);if(C==null?C=a:Nn(C,0,hr),D=ex(C/yt),y)if(crypto.getRandomValues){for(M=crypto.getRandomValues(new Uint32Array(D*=2));K>>11),q>=9e15?(J=crypto.getRandomValues(new Uint32Array(2)),M[K]=J[0],M[K+1]=J[1]):(Q.push(q%1e14),K+=2);K=D/2}else if(crypto.randomBytes){for(M=crypto.randomBytes(D*=7);K=9e15?crypto.randomBytes(7).copy(M,K):(Q.push(q%1e14),K+=7);K=D/7}else throw y=!1,Error(ni+"crypto unavailable");if(!y)for(;K=10;q/=10,K++);KJ-1&&(q[D+1]==null&&(q[D+1]=0),q[D+1]+=q[D]/J|0,q[D]%=J)}return q.reverse()}return function(C,M,J,P,D){var q,K,Q,H,X,I,te,ge,oe=C.indexOf("."),be=a,ke=u;for(oe>=0&&(H=b,b=0,C=C.replace(".",""),ge=new N(M),I=ge.pow(C.length-oe),b=H,ge.c=R(Su(Vi(I.c),I.e,"0"),10,J,v),ge.e=ge.c.length),te=R(C,M,J,D?(q=k,v):(q=v,k)),Q=H=te.length;te[--H]==0;te.pop());if(!te[0])return q.charAt(0);if(oe<0?--Q:(I.c=te,I.e=Q,I.s=P,I=t(I,ge,be,ke,J),te=I.c,X=I.r,Q=I.e),K=Q+be+1,oe=te[K],H=J/2,X=X||K<0||te[K+1]!=null,X=ke<4?(oe!=null||X)&&(ke==0||ke==(I.s<0?3:2)):oe>H||oe==H&&(ke==4||X||ke==6&&te[K-1]&1||ke==(I.s<0?8:7)),K<1||!te[0])C=X?Su(q.charAt(1),-be,q.charAt(0)):q.charAt(0);else{if(te.length=K,X)for(--J;++te[--K]>J;)te[K]=0,K||(++Q,te=[1].concat(te));for(H=te.length;!te[--H];);for(oe=0,C="";oe<=H;C+=q.charAt(te[oe++]));C=Su(C,Q,q.charAt(0))}return C}}(),t=function(){function v(M,J,P){var D,q,K,Q,H=0,X=M.length,I=J%gl,te=J/gl|0;for(M=M.slice();X--;)K=M[X]%gl,Q=M[X]/gl|0,D=te*K+Q*I,q=I*K+D%gl*gl+H,H=(q/P|0)+(D/gl|0)+te*Q,M[X]=q%P;return H&&(M=[H].concat(M)),M}function R(M,J,P,D){var q,K;if(P!=D)K=P>D?1:-1;else for(q=K=0;qJ[q]?1:-1;break}return K}function C(M,J,P,D){for(var q=0;P--;)M[P]-=q,q=M[P]1;M.splice(0,1));}return function(M,J,P,D,q){var K,Q,H,X,I,te,ge,oe,be,ke,Ne,Xe,Ze,Nt,nn,kt,En,Rt=M.s==J.s?1:-1,Ct=M.c,gt=J.c;if(!Ct||!Ct[0]||!gt||!gt[0])return new N(!M.s||!J.s||(Ct?gt&&Ct[0]==gt[0]:!gt)?NaN:Ct&&Ct[0]==0||!gt?Rt*0:Rt/0);for(oe=new N(Rt),be=oe.c=[],Q=M.e-J.e,Rt=P+Q+1,q||(q=bo,Q=Yi(M.e/yt)-Yi(J.e/yt),Rt=Rt/yt|0),H=0;gt[H]==(Ct[H]||0);H++);if(gt[H]>(Ct[H]||0)&&Q--,Rt<0)be.push(1),X=!0;else{for(Nt=Ct.length,kt=gt.length,H=0,Rt+=2,I=Qi(q/(gt[0]+1)),I>1&&(gt=v(gt,I,q),Ct=v(Ct,I,q),kt=gt.length,Nt=Ct.length),Ze=kt,ke=Ct.slice(0,kt),Ne=ke.length;Ne=q/2&&nn++;do{if(I=0,K=R(gt,ke,kt,Ne),K<0){if(Xe=ke[0],kt!=Ne&&(Xe=Xe*q+(ke[1]||0)),I=Qi(Xe/nn),I>1)for(I>=q&&(I=q-1),te=v(gt,I,q),ge=te.length,Ne=ke.length;R(te,ke,ge,Ne)==1;)I--,C(te,kt=10;Rt/=10,H++);A(oe,P+(oe.e=H+Q*yt-1)+1,D,X)}else oe.e=Q,oe.r=+X;return oe}}();function E(v,R,C,M){var J,P,D,q,K;if(C==null?C=u:Nn(C,0,8),!v.c)return v.toString();if(J=v.c[0],D=v.e,R==null)K=Vi(v.c),K=M==1||M==2&&(D<=l||D>=f)?d0(K,D):Su(K,D,"0");else if(v=A(new N(v),R,C),P=v.e,K=Vi(v.c),q=K.length,M==1||M==2&&(R<=P||P<=l)){for(;qq){if(--R>0)for(K+=".";R--;K+="0");}else if(R+=P-q,R>0)for(P+1==q&&(K+=".");R--;K+="0");return v.s<0&&J?"-"+K:K}function T(v,R){for(var C,M,J=1,P=new N(v[0]);J=10;J/=10,M++);return(C=M+C*yt-1)>m?v.c=v.e=null:C=10;q/=10,J++);if(P=R-J,P<0)P+=yt,D=R,K=X[Q=0],H=Qi(K/I[J-D-1]%10);else if(Q=ex((P+1)/yt),Q>=X.length)if(M){for(;X.length<=Q;X.push(0));K=H=0,J=1,P%=yt,D=P-yt+1}else break e;else{for(K=q=X[Q],J=1;q>=10;q/=10,J++);P%=yt,D=P-yt+J,H=D<0?0:Qi(K/I[J-D-1]%10)}if(M=M||R<0||X[Q+1]!=null||(D<0?K:K%I[J-D-1]),M=C<4?(H||M)&&(C==0||C==(v.s<0?3:2)):H>5||H==5&&(C==4||M||C==6&&(P>0?D>0?K/I[J-D]:0:X[Q-1])%10&1||C==(v.s<0?8:7)),R<1||!X[0])return X.length=0,M?(R-=v.e+1,X[0]=I[(yt-R%yt)%yt],v.e=-R||0):X[0]=v.e=0,v;if(P==0?(X.length=Q,q=1,Q--):(X.length=Q+1,q=I[yt-P],X[Q]=D>0?Qi(K/I[J-D]%I[D])*q:0),M)for(;;)if(Q==0){for(P=1,D=X[0];D>=10;D/=10,P++);for(D=X[0]+=q,q=1;D>=10;D/=10,q++);P!=q&&(v.e++,X[0]==bo&&(X[0]=1));break}else{if(X[Q]+=q,X[Q]!=bo)break;X[Q--]=0,q=1}for(P=X.length;X[--P]===0;X.pop());}v.e>m?v.c=v.e=null:v.e=f?d0(R,C):Su(R,C,"0"),v.s<0?"-"+R:R)}return i.absoluteValue=i.abs=function(){var v=new N(this);return v.s<0&&(v.s=1),v},i.comparedTo=function(v,R){return Md(this,new N(v,R))},i.decimalPlaces=i.dp=function(v,R){var C,M,J,P=this;if(v!=null)return Nn(v,0,hr),R==null?R=u:Nn(R,0,8),A(new N(P),v+P.e+1,R);if(!(C=P.c))return null;if(M=((J=C.length-1)-Yi(this.e/yt))*yt,J=C[J])for(;J%10==0;J/=10,M--);return M<0&&(M=0),M},i.dividedBy=i.div=function(v,R){return t(this,new N(v,R),a,u)},i.dividedToIntegerBy=i.idiv=function(v,R){return t(this,new N(v,R),0,1)},i.exponentiatedBy=i.pow=function(v,R){var C,M,J,P,D,q,K,Q,H,X=this;if(v=new N(v),v.c&&!v.isInteger())throw Error(ni+"Exponent not an integer: "+U(v));if(R!=null&&(R=new N(R)),q=v.e>14,!X.c||!X.c[0]||X.c[0]==1&&!X.e&&X.c.length==1||!v.c||!v.c[0])return H=new N(Math.pow(+U(X),q?v.s*(2-l0(v)):+U(v))),R?H.mod(R):H;if(K=v.s<0,R){if(R.c?!R.c[0]:!R.s)return new N(NaN);M=!K&&X.isInteger()&&R.isInteger(),M&&(X=X.mod(R))}else{if(v.e>9&&(X.e>0||X.e<-1||(X.e==0?X.c[0]>1||q&&X.c[1]>=24e7:X.c[0]<8e13||q&&X.c[0]<=9999975e7)))return P=X.s<0&&l0(v)?-0:0,X.e>-1&&(P=1/P),new N(K?1/P:P);b&&(P=ex(b/yt+2))}for(q?(C=new N(.5),K&&(v.s=1),Q=l0(v)):(J=Math.abs(+U(v)),Q=J%2),H=new N(o);;){if(Q){if(H=H.times(X),!H.c)break;P?H.c.length>P&&(H.c.length=P):M&&(H=H.mod(R))}if(J){if(J=Qi(J/2),J===0)break;Q=J%2}else if(v=v.times(C),A(v,v.e+1,1),v.e>14)Q=l0(v);else{if(J=+U(v),J===0)break;Q=J%2}X=X.times(X),P?X.c&&X.c.length>P&&(X.c.length=P):M&&(X=X.mod(R))}return M?H:(K&&(H=o.div(H)),R?H.mod(R):P?A(H,b,u,D):H)},i.integerValue=function(v){var R=new N(this);return v==null?v=u:Nn(v,0,8),A(R,R.e+1,v)},i.isEqualTo=i.eq=function(v,R){return Md(this,new N(v,R))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(v,R){return Md(this,new N(v,R))>0},i.isGreaterThanOrEqualTo=i.gte=function(v,R){return(R=Md(this,new N(v,R)))===1||R===0},i.isInteger=function(){return!!this.c&&Yi(this.e/yt)>this.c.length-2},i.isLessThan=i.lt=function(v,R){return Md(this,new N(v,R))<0},i.isLessThanOrEqualTo=i.lte=function(v,R){return(R=Md(this,new N(v,R)))===-1||R===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(v,R){var C,M,J,P,D=this,q=D.s;if(v=new N(v,R),R=v.s,!q||!R)return new N(NaN);if(q!=R)return v.s=-R,D.plus(v);var K=D.e/yt,Q=v.e/yt,H=D.c,X=v.c;if(!K||!Q){if(!H||!X)return H?(v.s=-R,v):new N(X?D:NaN);if(!H[0]||!X[0])return X[0]?(v.s=-R,v):new N(H[0]?D:u==3?-0:0)}if(K=Yi(K),Q=Yi(Q),H=H.slice(),q=K-Q){for((P=q<0)?(q=-q,J=H):(Q=K,J=X),J.reverse(),R=q;R--;J.push(0));J.reverse()}else for(M=(P=(q=H.length)<(R=X.length))?q:R,q=R=0;R0)for(;R--;H[C++]=0);for(R=bo-1;M>q;){if(H[--M]=0;){for(C=0,I=Xe[J]%be,te=Xe[J]/be|0,D=K,P=J+D;P>J;)Q=Ne[--D]%be,H=Ne[D]/be|0,q=te*Q+H*I,Q=I*Q+q%be*be+ge[P]+C,C=(Q/oe|0)+(q/be|0)+te*H,ge[P--]=Q%oe;ge[P]=C}return C?++M:ge.splice(0,1),B(v,ge,M)},i.negated=function(){var v=new N(this);return v.s=-v.s||null,v},i.plus=function(v,R){var C,M=this,J=M.s;if(v=new N(v,R),R=v.s,!J||!R)return new N(NaN);if(J!=R)return v.s=-R,M.minus(v);var P=M.e/yt,D=v.e/yt,q=M.c,K=v.c;if(!P||!D){if(!q||!K)return new N(J/0);if(!q[0]||!K[0])return K[0]?v:new N(q[0]?M:J*0)}if(P=Yi(P),D=Yi(D),q=q.slice(),J=P-D){for(J>0?(D=P,C=K):(J=-J,C=q),C.reverse();J--;C.push(0));C.reverse()}for(J=q.length,R=K.length,J-R<0&&(C=K,K=q,q=C,R=J),J=0;R;)J=(q[--R]=q[R]+K[R]+J)/bo|0,q[R]=bo===q[R]?0:q[R]%bo;return J&&(q=[J].concat(q),++D),B(v,q,D)},i.precision=i.sd=function(v,R){var C,M,J,P=this;if(v!=null&&v!==!!v)return Nn(v,1,hr),R==null?R=u:Nn(R,0,8),A(new N(P),v,R);if(!(C=P.c))return null;if(J=C.length-1,M=J*yt+1,J=C[J]){for(;J%10==0;J/=10,M--);for(J=C[0];J>=10;J/=10,M++);}return v&&P.e+1>M&&(M=P.e+1),M},i.shiftedBy=function(v){return Nn(v,-tx,tx),this.times("1e"+v)},i.squareRoot=i.sqrt=function(){var v,R,C,M,J,P=this,D=P.c,q=P.s,K=P.e,Q=a+4,H=new N("0.5");if(q!==1||!D||!D[0])return new N(!q||q<0&&(!D||D[0])?NaN:D?P:1/0);if(q=Math.sqrt(+U(P)),q==0||q==1/0?(R=Vi(D),(R.length+K)%2==0&&(R+="0"),q=Math.sqrt(+R),K=Yi((K+1)/2)-(K<0||K%2),q==1/0?R="5e"+K:(R=q.toExponential(),R=R.slice(0,R.indexOf("e")+1)+K),C=new N(R)):C=new N(q+""),C.c[0]){for(K=C.e,q=K+Q,q<3&&(q=0);;)if(J=C,C=H.times(J.plus(t(P,J,Q,1))),Vi(J.c).slice(0,q)===(R=Vi(C.c)).slice(0,q))if(C.e0&&ge>0){for(P=ge%q||q,H=te.substr(0,P);P0&&(H+=Q+te.slice(P)),I&&(H="-"+H)}M=X?H+(C.decimalSeparator||"")+((K=+C.fractionGroupSize)?X.replace(new RegExp("\\d{"+K+"}\\B","g"),"$&"+(C.fractionGroupSeparator||"")):X):H}return(C.prefix||"")+M+(C.suffix||"")},i.toFraction=function(v){var R,C,M,J,P,D,q,K,Q,H,X,I,te=this,ge=te.c;if(v!=null&&(q=new N(v),!q.isInteger()&&(q.c||q.s!==1)||q.lt(o)))throw Error(ni+"Argument "+(q.isInteger()?"out of range: ":"not an integer: ")+U(q));if(!ge)return new N(te);for(R=new N(o),Q=C=new N(o),M=K=new N(o),I=Vi(ge),P=R.e=I.length-te.e-1,R.c[0]=nx[(D=P%yt)<0?yt+D:D],v=!v||q.comparedTo(R)>0?P>0?R:Q:q,D=m,m=1/0,q=new N(I),K.c[0]=0;H=t(q,R,0,1),J=C.plus(H.times(M)),J.comparedTo(v)!=1;)C=M,M=J,Q=K.plus(H.times(J=Q)),K=J,R=q.minus(H.times(J=R)),q=J;return J=t(v.minus(C),M,0,1),K=K.plus(J.times(Q)),C=C.plus(J.times(M)),K.s=Q.s=te.s,P=P*2,X=t(Q,M,P,u).minus(te).abs().comparedTo(t(K,C,P,u).minus(te).abs())<1?[Q,M]:[K,C],m=D,X},i.toNumber=function(){return+U(this)},i.toPrecision=function(v,R){return v!=null&&Nn(v,1,hr),E(this,v,R,2)},i.toString=function(v){var R,C=this,M=C.s,J=C.e;return J===null?M?(R="Infinity",M<0&&(R="-"+R)):R="NaN":(v==null?R=J<=l||J>=f?d0(Vi(C.c),J):Su(Vi(C.c),J,"0"):v===10&&O?(C=A(new N(C),a+J+1,u),R=Su(Vi(C.c),C.e,"0")):(Nn(v,2,k.length,"Base"),R=n(Su(Vi(C.c),J,"0"),10,v,M,!0)),M<0&&C.c[0]&&(R="-"+R)),R},i.valueOf=i.toJSON=function(){return U(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&N.set(e),N}function Yi(e){var t=e|0;return e>0||e===t?t:t-1}function Vi(e){for(var t,n,r=1,i=e.length,o=e[0]+"";rf^n?1:-1;for(u=(l=i.length)<(f=o.length)?l:f,a=0;ao[a]^n?1:-1;return l==f?0:l>f^n?1:-1}function Nn(e,t,n,r){if(en||e!==Qi(e))throw Error(ni+(r||"Argument")+(typeof e=="number"?en?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function l0(e){var t=e.c.length-1;return Yi(e.e/yt)==t&&e.c[t]%2!=0}function d0(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Su(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t(e.mainnet="mainnet",e.testnet="testnet",e.devnet="devnet",e))(mt||{}),es=(e=>(e.FastPool="FAST Pool",e.Xverse="Xverse",e.PlanBetter="PlanBetter",e.Restake="Restake",e.CustomPool="Custom Pool",e))(es||{}),wt=(e=>(e[e.WrapperOneCycle=0]="WrapperOneCycle",e[e.WrapperFastPool=1]="WrapperFastPool",e[e.WrapperRestake=2]="WrapperRestake",e[e.Pox4=3]="Pox4",e))(wt||{});const Hr={devnet:{3:"ST000000000000000000002AMW42H.pox-4",0:"ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.pox4-pools",1:"ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.pox4-self-service",2:"ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.pox4-self-service"},testnet:{3:"ST000000000000000000002AMW42H.pox-4",0:"ST2PABAF9FTAJYNFZH93XENAJ8FVY99RRM4DF2YCW.pox4-pools",1:"ST2PABAF9FTAJYNFZH93XENAJ8FVY99RRM4DF2YCW.pox4-self-service",2:"ST2PABAF9FTAJYNFZH93XENAJ8FVY99RRM4DF2YCW.pox4-self-service"},mainnet:{3:"SP000000000000000000002Q6VF78.pox-4",0:"SP001SFSMC2ZY76PD4M68P3WGX154XCH7NE3TYMX.pox4-pools",1:"SP21YTSM60CAY6D011EZVEVNKXVW8FVZE198XEFFP.pox4-fast-pool-v3",2:"SPZV5RJN5XTJHA76E0VHEFB0WPEH7E11NZZ4CGBK.restake-self-service-pool-v1"}};var Vd=(e=>(e.BTC="BTC",e.STX="STX",e.OTHER="OTHER",e))(Vd||{});const f0=({src:e})=>d.jsx("img",{src:e,width:"32px",alt:"name"}),Mo={"FAST Pool":{name:es.FastPool,description:"Enjoy automatic pool operations. You can increase the locking amount for the next cycle. Locked STX will unlock 1 day after the end of the cycle.",duration:1,website:"https://fastpool.org",payoutMethod:Vd.STX,poolAddress:{[mt.mainnet]:Hr[mt.mainnet][wt.WrapperFastPool],[mt.testnet]:Hr[mt.testnet][wt.WrapperFastPool],[mt.devnet]:Hr[mt.devnet][wt.WrapperFastPool]},poxContract:wt.WrapperFastPool,minimumDelegationAmount:4e7,icon:d.jsx(f0,{src:"/32x32_FastPool.png"}),allowCustomRewardAddress:!1,disabled:!1},PlanBetter:{name:es.PlanBetter,description:"Earn non-custodial Bitcoin yield. No wrapped tokens. Native BTC.",duration:1,website:"https://planbetter.org",payoutMethod:Vd.BTC,poolAddress:{[mt.mainnet]:"SP3TDKYYRTYFE32N19484838WEJ25GX40Z24GECPZ",[mt.testnet]:"SP3TDKYYRTYFE32N19484838WEJ25GX40Z24GECPZ",[mt.devnet]:"SP3TDKYYRTYFE32N19484838WEJ25GX40Z24GECPZ"},poxContract:wt.WrapperOneCycle,minimumDelegationAmount:2e8,icon:d.jsx(f0,{src:"/32x32_PlanBetter.png"}),allowCustomRewardAddress:!1,disabled:!1},Xverse:{name:es.Xverse,description:"Xverse pool is a non-custodial stacking pool service from the makers of Xverse wallet.",duration:1,website:"https://pool.xverse.app/",payoutMethod:Vd.BTC,poolAddress:{[mt.mainnet]:"SPXVRSEH2BKSXAEJ00F1BY562P45D5ERPSKR4Q33",[mt.testnet]:"SPXVRSEH2BKSXAEJ00F1BY562P45D5ERPSKR4Q33",[mt.devnet]:"SPXVRSEH2BKSXAEJ00F1BY562P45D5ERPSKR4Q33"},poxContract:wt.WrapperOneCycle,minimumDelegationAmount:1e8,icon:d.jsx(f0,{src:"/32x32_Xverse.png"}),allowCustomRewardAddress:!0,disabled:!1},Restake:{name:es.Restake,description:"Earn STX rewards by pooling your tokens with Restake, a non-custodial infrastructure operator trusted by institutions.",duration:1,website:"https://restake.net/stacks-pool",payoutMethod:Vd.STX,poolAddress:{[mt.mainnet]:Hr[mt.mainnet][wt.WrapperRestake],[mt.testnet]:Hr[mt.testnet][wt.WrapperRestake],[mt.devnet]:Hr[mt.devnet][wt.WrapperRestake]},poxContract:wt.WrapperRestake,minimumDelegationAmount:1e8,icon:d.jsx(f0,{src:"/32x32_Restake.png"}),allowCustomRewardAddress:!1,disabled:!1},"Custom Pool":{name:es.CustomPool,description:"Enter the STX address of the pool with which you’d like to Stack without your STX leaving your wallet.",duration:-1,website:"https://www.stacks.co/learn/stacking",payoutMethod:Vd.OTHER,poolAddress:void 0,poxContract:wt.Pox4,minimumDelegationAmount:yW,icon:d.jsx(dW,{}),allowCustomRewardAddress:!1,disabled:!1}};function Gw(e){return e.chainId===dn.Mainnet?mt.mainnet:e.client.baseUrl===Dh?mt.devnet:mt.testnet}function ju(e){const t=Gw(e);return Hr[t]}function qP(e){return e.poxContract!==wt.Pox4}function vW(e){if(e===es.CustomPool)return!1;const t=Mo[e];return qP(t)}function xW(e,t){return ju(t)[Mo[e].poxContract]}function _W(e,t){return Hr[e][t]}function UP(e){return[Hr[mt.mainnet][wt.WrapperFastPool],Hr[mt.testnet][wt.WrapperFastPool],Hr[mt.devnet][wt.WrapperFastPool],Hr[mt.mainnet][wt.WrapperRestake],Hr[mt.testnet][wt.WrapperRestake],Hr[mt.devnet][wt.WrapperRestake]].includes(e)}function kW(e,t){return Hr[e][t].split(".")}function HP(e){return t=>t[e]}function RW(e){return t=>t[e]}async function TW(e,t){const r=(e instanceof URL,e.toString()).includes("hiro.so")?{...t,headers:{...t==null?void 0:t.headers,"x-hiro-product":"Leather"}}:t;return await fetch(e,r)}var h0={};/*! + code: ${this.code} param: ${this.parameter?this.parameter:"n/a"}`}}class Oz extends ip{constructor(t,n=""){super({code:Sf.MISSING_PARAMETER,message:n,parameter:t}),this.name="MissingParametersError"}}class JA extends ip{constructor(t=""){super({code:Sf.INVALID_DID_ERROR,message:t}),this.name="InvalidDIDError"}}class u0 extends ip{constructor(t){const n=`Failed to login: ${t}`;super({code:Sf.LOGIN_FAILED_ERROR,message:n}),this.message=n,this.name="LoginFailedError"}}class $A extends ip{constructor(t="Unable to decrypt cipher object."){super({code:Sf.FAILED_DECRYPTION_ERROR,message:t}),this.message=t,this.name="FailedDecryptionError"}}class f1 extends ip{constructor(t){super({code:Sf.INVALID_STATE,message:t}),this.message=t,this.name="InvalidStateError"}}class NP extends ip{constructor(t){super({code:Sf.INVALID_STATE,message:t}),this.message=t,this.name="NoSessionDataError"}}const qA=["debug","info","warn","error","none"],h1={};for(let e=0;eparseInt(i,10)),r=t.split(".").map(i=>parseInt(i,10));for(let i=0;i=e.length&&r.push(0),n[i]{const n=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t==="x"?n:n&3|8).toString(16)})}function Az(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unexpected runtime environment - no supported global scope (`window`, `self`, `global`) available")}function Fz(e,t,n){return n?`Use of '${n}' requires \`${t}\` which is unavailable on the '${e}' object within the currently executing environment.`:`\`${t}\` is unavailable on the '${e}' object within the currently executing environment.`}function L_(e,{throwIfUnavailable:t,usageDesc:n,returnEmptyObject:r}={}){let i;try{if(i=Az(),i){const o=i[e];if(o)return o}}catch(o){wh.error(`Error getting object '${e}' from global scope '${i}': ${o}`)}if(t){const o=Fz(i,e.toString(),n);throw wh.error(o),new Error(o)}if(r)return{}}function Ll(e,t){return zw(Yt(e),t)}function Yt(e){if(typeof e=="bigint")return e;if(typeof e=="string")return BigInt(e);if(typeof e=="number"){if(!Number.isInteger(e))throw new RangeError("Invalid value. Values of type 'number' must be an integer.");if(e>Number.MAX_SAFE_INTEGER)throw new RangeError(`Invalid value. Values of type 'number' must be less than or equal to ${Number.MAX_SAFE_INTEGER}. For larger values, try using a BigInt instead.`);return BigInt(e)}if(ai(e,Uint8Array))return BigInt(`0x${at(e)}`);throw new TypeError("intToBigInt: Invalid value type. Must be a number, bigint, BigInt-compatible string, or Uint8Array.")}function CP(e){return/^0x/i.test(e)?e.slice(2):e}function nw(e){if(typeof e!="string")throw new TypeError(`hexToBigInt: expected string, got ${typeof e}`);return BigInt(`0x${e}`)}function Cg(e,t=8){return(typeof e=="bigint"?e:Yt(e)).toString(16).padStart(t*2,"0")}function Hw(e){return parseInt(e,16)}function zw(e,t=16){const n=Cg(e,t);return rt(n)}function Iz(e,t){if(e<-(BigInt(1)<=BigInt(0)?BigInt(e):e+(BigInt(1)<t.toString(16).padStart(2,"0"));function at(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(const n of e)t+=Lz[n];return t}function rt(e){if(typeof e!="string")throw new TypeError(`hexToBytes: expected string, got ${typeof e}`);e=CP(e),e=e.length%2?`0${e}`:e;const t=new Uint8Array(e.length/2);for(let n=0;n255}function UA(e){if(e.some(Bz))throw new Error("Some values are invalid bytes.");return new Uint8Array(e)}function so(...e){if(!e.every(r=>r instanceof Uint8Array))throw new Error("Uint8Array list expected");if(e.length===1)return e[0];const t=e.reduce((r,i)=>r+i.length,0),n=new Uint8Array(t);for(let r=0,i=0;rtypeof t=="number"?UA([t]):t instanceof Array?UA(t):t))}function ai(e,t){var n,r;return e instanceof t||((r=(n=e==null?void 0:e.constructor)==null?void 0:n.name)==null?void 0:r.toLowerCase())===t.name}function jz(e){return e=CP(e),e.length!==64?!1:/^[0-9a-fA-F]+$/.test(e)}const Dz="https://api.mainnet.hiro.so",Jz="https://api.testnet.hiro.so",$z="http://localhost:3999",qz="https://hub.blockstack.org",Uz=33,Xv=32;function FP(e){if(e.length>>0}function Vz(e,t,n=0){return e[n+0]=t>>>8,e[n+1]=t>>>0,e}function IP(e,t){return e[t]}function Dm(e,t,n=0){return e[n]=t,e}function Gz(e,t,n=0){return e[n+0]=t&255,t>>>=8,e[n+1]=t&255,e}function Kz(e,t){return e[t]*2**24+e[t+1]*2**16+e[t+2]*2**8+e[t+3]}function hf(e,t,n=0){return e[n+3]=t,t>>>=8,e[n+2]=t,t>>>=8,e[n+1]=t,t>>>=8,e[n]=t,e}function Zv(e,t,n=0){return e[n+0]=t&255,t>>>=8,e[n+1]=t&255,t>>>=8,e[n+2]=t&255,t>>>=8,e[n+3]=t&255,e}const Qz={referrerPolicy:"origin",headers:{"x-hiro-product":"stacksjs"}};async function Yz(e,t){const n={};return Object.assign(n,Qz,t),await fetch(e,n)}function Xz(e){let t=Yz,n=[];return e.length>0&&typeof e[0]=="function"&&(t=e.shift()),e.length>0&&(n=e),{fetchLib:t,middlewares:n}}function PP(...e){const{fetchLib:t,middlewares:n}=Xz(e);return async(i,o)=>{let a={url:i,init:o??{}};for(const l of n)typeof l.pre=="function"&&(a=await Promise.resolve(l.pre({fetch:t,...a}))??a);let u=await t(a.url,a.init);for(const l of n)typeof l.post=="function"&&(u=await Promise.resolve(l.post({fetch:t,url:a.url,init:a.init,response:(u==null?void 0:u.clone())??u}))??u);return u}}const Ag={chainId:dn.Mainnet,transactionVersion:Ni.Mainnet,peerNetworkId:tw.Mainnet,magicBytes:"X2",bootAddress:"SP000000000000000000002Q6VF78",addressVersion:{singleSig:Ao.MainnetSingleSig,multiSig:Ao.MainnetMultiSig},client:{baseUrl:Dz}},ag={chainId:dn.Testnet,transactionVersion:Ni.Testnet,peerNetworkId:tw.Testnet,magicBytes:"T2",bootAddress:"ST000000000000000000002AMW42H",addressVersion:{singleSig:Ao.TestnetSingleSig,multiSig:Ao.TestnetMultiSig},client:{baseUrl:Jz}},Vm={...ag,addressVersion:{...ag.addressVersion},magicBytes:"id",client:{baseUrl:$z}},MP={...Vm,addressVersion:{...Vm.addressVersion},client:{...Vm.client}},Zz=["mainnet","testnet","devnet","mocknet"];function eW(e){switch(e){case"mainnet":return Ag;case"testnet":return ag;case"devnet":return Vm;case"mocknet":return MP;default:throw new Error(`Unknown network name: ${e}`)}}function mr(e){return typeof e=="string"?eW(e):e}function hs(e){return e.client.fetch?e.client:{...e.client,fetch:PP()}}const LP=typeof document<"u",tW=typeof window<"u"?{name:"Stacking",icon:`${window.location.origin}/logo.svg`}:{name:"Stacking - Testing",icon:"/logo.svg"},nW="https://api.hiro.so",rW="https://api.testnet.hiro.so",Dh="http://localhost:3999",HA="https://api.nakamoto.testnet.hiro.so";var iW={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},oW=Object.defineProperty,sW=Object.defineProperties,aW=Object.getOwnPropertyDescriptors,rw=Object.getOwnPropertySymbols,BP=Object.prototype.hasOwnProperty,jP=Object.prototype.propertyIsEnumerable,zA=(e,t,n)=>t in e?oW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WA=(e,t)=>{for(var n in t||(t={}))BP.call(t,n)&&zA(e,n,t[n]);if(rw)for(var n of rw(t))jP.call(t,n)&&zA(e,n,t[n]);return e},cW=(e,t)=>sW(e,aW(t)),uW=(e,t)=>{var n={};for(var r in e)BP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rw)for(var r of rw(e))t.indexOf(r)<0&&jP.call(e,r)&&(n[r]=e[r]);return n},Hl=(e,t,n)=>{const r=$.forwardRef((i,o)=>{var a=i,{color:u="currentColor",size:l=24,stroke:f=2,children:p}=a,m=uW(a,["color","size","stroke","children"]);return $.createElement("svg",WA(cW(WA({ref:o},iW),{width:l,height:l,stroke:u,strokeWidth:f,className:`tabler-icon tabler-icon-${e}`}),m),[...n.map(([y,w])=>$.createElement(y,w)),...p||[]])});return r.propTypes={color:Sd.string,size:Sd.oneOfType([Sd.string,Sd.number]),stroke:Sd.oneOfType([Sd.string,Sd.number])},r.displayName=`${t}`,r},DP=Hl("alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]),lW=Hl("check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),cg=Hl("clock-hour-4","IconClockHour4",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 12l3 2",key:"svg-1"}],["path",{d:"M12 7v5",key:"svg-2"}]]),JP=Hl("copy","IconCopy",[["path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2",key:"svg-1"}]]),dW=Hl("edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]),Oh=Hl("info-circle","IconInfoCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 9h.01",key:"svg-1"}],["path",{d:"M11 12h1v4h1",key:"svg-2"}]]),ps=Hl("lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]),iw=Hl("stairs","IconStairs",[["path",{d:"M22 5h-5v5h-5v5h-5v5h-5",key:"svg-0"}]]),fW=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ex=Math.ceil,Qi=Math.floor,ni="[BigNumber Error] ",VA=ni+"Number primitive has more than 15 significant digits: ",bo=1e14,yt=14,tx=9007199254740991,nx=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],yl=1e7,hr=1e9;function $P(e){var t,n,r,i=N.prototype={constructor:N,toString:null,valueOf:null},o=new N(1),a=20,u=4,l=-7,f=21,p=-1e7,m=1e7,y=!1,w=1,b=0,x={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},_="0123456789abcdefghijklmnopqrstuvwxyz",O=!0;function N(v,R){var C,M,J,P,D,q,K,Q,H=this;if(!(H instanceof N))return new N(v,R);if(R==null){if(v&&v._isBigNumber===!0){H.s=v.s,!v.c||v.e>m?H.c=H.e=null:v.e=10;D/=10,P++);P>m?H.c=H.e=null:(H.e=P,H.c=[v]);return}Q=String(v)}else{if(!fW.test(Q=String(v)))return r(H,Q,q);H.s=Q.charCodeAt(0)==45?(Q=Q.slice(1),-1):1}(P=Q.indexOf("."))>-1&&(Q=Q.replace(".","")),(D=Q.search(/e/i))>0?(P<0&&(P=D),P+=+Q.slice(D+1),Q=Q.substring(0,D)):P<0&&(P=Q.length)}else{if(Nn(R,2,_.length,"Base"),R==10&&O)return H=new N(v),A(H,a+H.e+1,u);if(Q=String(v),q=typeof v=="number"){if(v*0!=0)return r(H,Q,q,R);if(H.s=1/v<0?(Q=Q.slice(1),-1):1,N.DEBUG&&Q.replace(/^0\.0*|\./,"").length>15)throw Error(VA+v)}else H.s=Q.charCodeAt(0)===45?(Q=Q.slice(1),-1):1;for(C=_.slice(0,R),P=D=0,K=Q.length;DP){P=K;continue}}else if(!J&&(Q==Q.toUpperCase()&&(Q=Q.toLowerCase())||Q==Q.toLowerCase()&&(Q=Q.toUpperCase()))){J=!0,D=-1,P=0;continue}return r(H,String(v),q,R)}q=!1,Q=n(Q,R,10,H.s),(P=Q.indexOf("."))>-1?Q=Q.replace(".",""):P=Q.length}for(D=0;Q.charCodeAt(D)===48;D++);for(K=Q.length;Q.charCodeAt(--K)===48;);if(Q=Q.slice(D,++K)){if(K-=D,q&&N.DEBUG&&K>15&&(v>tx||v!==Qi(v)))throw Error(VA+H.s*v);if((P=P-D-1)>m)H.c=H.e=null;else if(P=-hr&&J<=hr&&J===Qi(J)){if(M[0]===0){if(J===0&&M.length===1)return!0;break e}if(R=(J+1)%yt,R<1&&(R+=yt),String(M[0]).length==R){for(R=0;R=bo||C!==Qi(C))break e;if(C!==0)return!0}}}else if(M===null&&J===null&&(P===null||P===1||P===-1))return!0;throw Error(ni+"Invalid BigNumber: "+v)},N.maximum=N.max=function(){return T(arguments,-1)},N.minimum=N.min=function(){return T(arguments,1)},N.random=function(){var v=9007199254740992,R=Math.random()*v&2097151?function(){return Qi(Math.random()*v)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(C){var M,J,P,D,q,K=0,Q=[],H=new N(o);if(C==null?C=a:Nn(C,0,hr),D=ex(C/yt),y)if(crypto.getRandomValues){for(M=crypto.getRandomValues(new Uint32Array(D*=2));K>>11),q>=9e15?(J=crypto.getRandomValues(new Uint32Array(2)),M[K]=J[0],M[K+1]=J[1]):(Q.push(q%1e14),K+=2);K=D/2}else if(crypto.randomBytes){for(M=crypto.randomBytes(D*=7);K=9e15?crypto.randomBytes(7).copy(M,K):(Q.push(q%1e14),K+=7);K=D/7}else throw y=!1,Error(ni+"crypto unavailable");if(!y)for(;K=10;q/=10,K++);KJ-1&&(q[D+1]==null&&(q[D+1]=0),q[D+1]+=q[D]/J|0,q[D]%=J)}return q.reverse()}return function(C,M,J,P,D){var q,K,Q,H,X,I,te,ge,oe=C.indexOf("."),be=a,ke=u;for(oe>=0&&(H=b,b=0,C=C.replace(".",""),ge=new N(M),I=ge.pow(C.length-oe),b=H,ge.c=R(Su(Vi(I.c),I.e,"0"),10,J,v),ge.e=ge.c.length),te=R(C,M,J,D?(q=_,v):(q=v,_)),Q=H=te.length;te[--H]==0;te.pop());if(!te[0])return q.charAt(0);if(oe<0?--Q:(I.c=te,I.e=Q,I.s=P,I=t(I,ge,be,ke,J),te=I.c,X=I.r,Q=I.e),K=Q+be+1,oe=te[K],H=J/2,X=X||K<0||te[K+1]!=null,X=ke<4?(oe!=null||X)&&(ke==0||ke==(I.s<0?3:2)):oe>H||oe==H&&(ke==4||X||ke==6&&te[K-1]&1||ke==(I.s<0?8:7)),K<1||!te[0])C=X?Su(q.charAt(1),-be,q.charAt(0)):q.charAt(0);else{if(te.length=K,X)for(--J;++te[--K]>J;)te[K]=0,K||(++Q,te=[1].concat(te));for(H=te.length;!te[--H];);for(oe=0,C="";oe<=H;C+=q.charAt(te[oe++]));C=Su(C,Q,q.charAt(0))}return C}}(),t=function(){function v(M,J,P){var D,q,K,Q,H=0,X=M.length,I=J%yl,te=J/yl|0;for(M=M.slice();X--;)K=M[X]%yl,Q=M[X]/yl|0,D=te*K+Q*I,q=I*K+D%yl*yl+H,H=(q/P|0)+(D/yl|0)+te*Q,M[X]=q%P;return H&&(M=[H].concat(M)),M}function R(M,J,P,D){var q,K;if(P!=D)K=P>D?1:-1;else for(q=K=0;qJ[q]?1:-1;break}return K}function C(M,J,P,D){for(var q=0;P--;)M[P]-=q,q=M[P]1;M.splice(0,1));}return function(M,J,P,D,q){var K,Q,H,X,I,te,ge,oe,be,ke,Ne,Xe,Ze,Nt,nn,kt,En,Rt=M.s==J.s?1:-1,Ct=M.c,gt=J.c;if(!Ct||!Ct[0]||!gt||!gt[0])return new N(!M.s||!J.s||(Ct?gt&&Ct[0]==gt[0]:!gt)?NaN:Ct&&Ct[0]==0||!gt?Rt*0:Rt/0);for(oe=new N(Rt),be=oe.c=[],Q=M.e-J.e,Rt=P+Q+1,q||(q=bo,Q=Yi(M.e/yt)-Yi(J.e/yt),Rt=Rt/yt|0),H=0;gt[H]==(Ct[H]||0);H++);if(gt[H]>(Ct[H]||0)&&Q--,Rt<0)be.push(1),X=!0;else{for(Nt=Ct.length,kt=gt.length,H=0,Rt+=2,I=Qi(q/(gt[0]+1)),I>1&&(gt=v(gt,I,q),Ct=v(Ct,I,q),kt=gt.length,Nt=Ct.length),Ze=kt,ke=Ct.slice(0,kt),Ne=ke.length;Ne=q/2&&nn++;do{if(I=0,K=R(gt,ke,kt,Ne),K<0){if(Xe=ke[0],kt!=Ne&&(Xe=Xe*q+(ke[1]||0)),I=Qi(Xe/nn),I>1)for(I>=q&&(I=q-1),te=v(gt,I,q),ge=te.length,Ne=ke.length;R(te,ke,ge,Ne)==1;)I--,C(te,kt=10;Rt/=10,H++);A(oe,P+(oe.e=H+Q*yt-1)+1,D,X)}else oe.e=Q,oe.r=+X;return oe}}();function E(v,R,C,M){var J,P,D,q,K;if(C==null?C=u:Nn(C,0,8),!v.c)return v.toString();if(J=v.c[0],D=v.e,R==null)K=Vi(v.c),K=M==1||M==2&&(D<=l||D>=f)?d0(K,D):Su(K,D,"0");else if(v=A(new N(v),R,C),P=v.e,K=Vi(v.c),q=K.length,M==1||M==2&&(R<=P||P<=l)){for(;qq){if(--R>0)for(K+=".";R--;K+="0");}else if(R+=P-q,R>0)for(P+1==q&&(K+=".");R--;K+="0");return v.s<0&&J?"-"+K:K}function T(v,R){for(var C,M,J=1,P=new N(v[0]);J=10;J/=10,M++);return(C=M+C*yt-1)>m?v.c=v.e=null:C=10;q/=10,J++);if(P=R-J,P<0)P+=yt,D=R,K=X[Q=0],H=Qi(K/I[J-D-1]%10);else if(Q=ex((P+1)/yt),Q>=X.length)if(M){for(;X.length<=Q;X.push(0));K=H=0,J=1,P%=yt,D=P-yt+1}else break e;else{for(K=q=X[Q],J=1;q>=10;q/=10,J++);P%=yt,D=P-yt+J,H=D<0?0:Qi(K/I[J-D-1]%10)}if(M=M||R<0||X[Q+1]!=null||(D<0?K:K%I[J-D-1]),M=C<4?(H||M)&&(C==0||C==(v.s<0?3:2)):H>5||H==5&&(C==4||M||C==6&&(P>0?D>0?K/I[J-D]:0:X[Q-1])%10&1||C==(v.s<0?8:7)),R<1||!X[0])return X.length=0,M?(R-=v.e+1,X[0]=I[(yt-R%yt)%yt],v.e=-R||0):X[0]=v.e=0,v;if(P==0?(X.length=Q,q=1,Q--):(X.length=Q+1,q=I[yt-P],X[Q]=D>0?Qi(K/I[J-D]%I[D])*q:0),M)for(;;)if(Q==0){for(P=1,D=X[0];D>=10;D/=10,P++);for(D=X[0]+=q,q=1;D>=10;D/=10,q++);P!=q&&(v.e++,X[0]==bo&&(X[0]=1));break}else{if(X[Q]+=q,X[Q]!=bo)break;X[Q--]=0,q=1}for(P=X.length;X[--P]===0;X.pop());}v.e>m?v.c=v.e=null:v.e=f?d0(R,C):Su(R,C,"0"),v.s<0?"-"+R:R)}return i.absoluteValue=i.abs=function(){var v=new N(this);return v.s<0&&(v.s=1),v},i.comparedTo=function(v,R){return Md(this,new N(v,R))},i.decimalPlaces=i.dp=function(v,R){var C,M,J,P=this;if(v!=null)return Nn(v,0,hr),R==null?R=u:Nn(R,0,8),A(new N(P),v+P.e+1,R);if(!(C=P.c))return null;if(M=((J=C.length-1)-Yi(this.e/yt))*yt,J=C[J])for(;J%10==0;J/=10,M--);return M<0&&(M=0),M},i.dividedBy=i.div=function(v,R){return t(this,new N(v,R),a,u)},i.dividedToIntegerBy=i.idiv=function(v,R){return t(this,new N(v,R),0,1)},i.exponentiatedBy=i.pow=function(v,R){var C,M,J,P,D,q,K,Q,H,X=this;if(v=new N(v),v.c&&!v.isInteger())throw Error(ni+"Exponent not an integer: "+U(v));if(R!=null&&(R=new N(R)),q=v.e>14,!X.c||!X.c[0]||X.c[0]==1&&!X.e&&X.c.length==1||!v.c||!v.c[0])return H=new N(Math.pow(+U(X),q?v.s*(2-l0(v)):+U(v))),R?H.mod(R):H;if(K=v.s<0,R){if(R.c?!R.c[0]:!R.s)return new N(NaN);M=!K&&X.isInteger()&&R.isInteger(),M&&(X=X.mod(R))}else{if(v.e>9&&(X.e>0||X.e<-1||(X.e==0?X.c[0]>1||q&&X.c[1]>=24e7:X.c[0]<8e13||q&&X.c[0]<=9999975e7)))return P=X.s<0&&l0(v)?-0:0,X.e>-1&&(P=1/P),new N(K?1/P:P);b&&(P=ex(b/yt+2))}for(q?(C=new N(.5),K&&(v.s=1),Q=l0(v)):(J=Math.abs(+U(v)),Q=J%2),H=new N(o);;){if(Q){if(H=H.times(X),!H.c)break;P?H.c.length>P&&(H.c.length=P):M&&(H=H.mod(R))}if(J){if(J=Qi(J/2),J===0)break;Q=J%2}else if(v=v.times(C),A(v,v.e+1,1),v.e>14)Q=l0(v);else{if(J=+U(v),J===0)break;Q=J%2}X=X.times(X),P?X.c&&X.c.length>P&&(X.c.length=P):M&&(X=X.mod(R))}return M?H:(K&&(H=o.div(H)),R?H.mod(R):P?A(H,b,u,D):H)},i.integerValue=function(v){var R=new N(this);return v==null?v=u:Nn(v,0,8),A(R,R.e+1,v)},i.isEqualTo=i.eq=function(v,R){return Md(this,new N(v,R))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(v,R){return Md(this,new N(v,R))>0},i.isGreaterThanOrEqualTo=i.gte=function(v,R){return(R=Md(this,new N(v,R)))===1||R===0},i.isInteger=function(){return!!this.c&&Yi(this.e/yt)>this.c.length-2},i.isLessThan=i.lt=function(v,R){return Md(this,new N(v,R))<0},i.isLessThanOrEqualTo=i.lte=function(v,R){return(R=Md(this,new N(v,R)))===-1||R===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(v,R){var C,M,J,P,D=this,q=D.s;if(v=new N(v,R),R=v.s,!q||!R)return new N(NaN);if(q!=R)return v.s=-R,D.plus(v);var K=D.e/yt,Q=v.e/yt,H=D.c,X=v.c;if(!K||!Q){if(!H||!X)return H?(v.s=-R,v):new N(X?D:NaN);if(!H[0]||!X[0])return X[0]?(v.s=-R,v):new N(H[0]?D:u==3?-0:0)}if(K=Yi(K),Q=Yi(Q),H=H.slice(),q=K-Q){for((P=q<0)?(q=-q,J=H):(Q=K,J=X),J.reverse(),R=q;R--;J.push(0));J.reverse()}else for(M=(P=(q=H.length)<(R=X.length))?q:R,q=R=0;R0)for(;R--;H[C++]=0);for(R=bo-1;M>q;){if(H[--M]=0;){for(C=0,I=Xe[J]%be,te=Xe[J]/be|0,D=K,P=J+D;P>J;)Q=Ne[--D]%be,H=Ne[D]/be|0,q=te*Q+H*I,Q=I*Q+q%be*be+ge[P]+C,C=(Q/oe|0)+(q/be|0)+te*H,ge[P--]=Q%oe;ge[P]=C}return C?++M:ge.splice(0,1),B(v,ge,M)},i.negated=function(){var v=new N(this);return v.s=-v.s||null,v},i.plus=function(v,R){var C,M=this,J=M.s;if(v=new N(v,R),R=v.s,!J||!R)return new N(NaN);if(J!=R)return v.s=-R,M.minus(v);var P=M.e/yt,D=v.e/yt,q=M.c,K=v.c;if(!P||!D){if(!q||!K)return new N(J/0);if(!q[0]||!K[0])return K[0]?v:new N(q[0]?M:J*0)}if(P=Yi(P),D=Yi(D),q=q.slice(),J=P-D){for(J>0?(D=P,C=K):(J=-J,C=q),C.reverse();J--;C.push(0));C.reverse()}for(J=q.length,R=K.length,J-R<0&&(C=K,K=q,q=C,R=J),J=0;R;)J=(q[--R]=q[R]+K[R]+J)/bo|0,q[R]=bo===q[R]?0:q[R]%bo;return J&&(q=[J].concat(q),++D),B(v,q,D)},i.precision=i.sd=function(v,R){var C,M,J,P=this;if(v!=null&&v!==!!v)return Nn(v,1,hr),R==null?R=u:Nn(R,0,8),A(new N(P),v,R);if(!(C=P.c))return null;if(J=C.length-1,M=J*yt+1,J=C[J]){for(;J%10==0;J/=10,M--);for(J=C[0];J>=10;J/=10,M++);}return v&&P.e+1>M&&(M=P.e+1),M},i.shiftedBy=function(v){return Nn(v,-tx,tx),this.times("1e"+v)},i.squareRoot=i.sqrt=function(){var v,R,C,M,J,P=this,D=P.c,q=P.s,K=P.e,Q=a+4,H=new N("0.5");if(q!==1||!D||!D[0])return new N(!q||q<0&&(!D||D[0])?NaN:D?P:1/0);if(q=Math.sqrt(+U(P)),q==0||q==1/0?(R=Vi(D),(R.length+K)%2==0&&(R+="0"),q=Math.sqrt(+R),K=Yi((K+1)/2)-(K<0||K%2),q==1/0?R="5e"+K:(R=q.toExponential(),R=R.slice(0,R.indexOf("e")+1)+K),C=new N(R)):C=new N(q+""),C.c[0]){for(K=C.e,q=K+Q,q<3&&(q=0);;)if(J=C,C=H.times(J.plus(t(P,J,Q,1))),Vi(J.c).slice(0,q)===(R=Vi(C.c)).slice(0,q))if(C.e0&&ge>0){for(P=ge%q||q,H=te.substr(0,P);P0&&(H+=Q+te.slice(P)),I&&(H="-"+H)}M=X?H+(C.decimalSeparator||"")+((K=+C.fractionGroupSize)?X.replace(new RegExp("\\d{"+K+"}\\B","g"),"$&"+(C.fractionGroupSeparator||"")):X):H}return(C.prefix||"")+M+(C.suffix||"")},i.toFraction=function(v){var R,C,M,J,P,D,q,K,Q,H,X,I,te=this,ge=te.c;if(v!=null&&(q=new N(v),!q.isInteger()&&(q.c||q.s!==1)||q.lt(o)))throw Error(ni+"Argument "+(q.isInteger()?"out of range: ":"not an integer: ")+U(q));if(!ge)return new N(te);for(R=new N(o),Q=C=new N(o),M=K=new N(o),I=Vi(ge),P=R.e=I.length-te.e-1,R.c[0]=nx[(D=P%yt)<0?yt+D:D],v=!v||q.comparedTo(R)>0?P>0?R:Q:q,D=m,m=1/0,q=new N(I),K.c[0]=0;H=t(q,R,0,1),J=C.plus(H.times(M)),J.comparedTo(v)!=1;)C=M,M=J,Q=K.plus(H.times(J=Q)),K=J,R=q.minus(H.times(J=R)),q=J;return J=t(v.minus(C),M,0,1),K=K.plus(J.times(Q)),C=C.plus(J.times(M)),K.s=Q.s=te.s,P=P*2,X=t(Q,M,P,u).minus(te).abs().comparedTo(t(K,C,P,u).minus(te).abs())<1?[Q,M]:[K,C],m=D,X},i.toNumber=function(){return+U(this)},i.toPrecision=function(v,R){return v!=null&&Nn(v,1,hr),E(this,v,R,2)},i.toString=function(v){var R,C=this,M=C.s,J=C.e;return J===null?M?(R="Infinity",M<0&&(R="-"+R)):R="NaN":(v==null?R=J<=l||J>=f?d0(Vi(C.c),J):Su(Vi(C.c),J,"0"):v===10&&O?(C=A(new N(C),a+J+1,u),R=Su(Vi(C.c),C.e,"0")):(Nn(v,2,_.length,"Base"),R=n(Su(Vi(C.c),J,"0"),10,v,M,!0)),M<0&&C.c[0]&&(R="-"+R)),R},i.valueOf=i.toJSON=function(){return U(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&N.set(e),N}function Yi(e){var t=e|0;return e>0||e===t?t:t-1}function Vi(e){for(var t,n,r=1,i=e.length,o=e[0]+"";rf^n?1:-1;for(u=(l=i.length)<(f=o.length)?l:f,a=0;ao[a]^n?1:-1;return l==f?0:l>f^n?1:-1}function Nn(e,t,n,r){if(en||e!==Qi(e))throw Error(ni+(r||"Argument")+(typeof e=="number"?en?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function l0(e){var t=e.c.length-1;return Yi(e.e/yt)==t&&e.c[t]%2!=0}function d0(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Su(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t(e.mainnet="mainnet",e.testnet="testnet",e.devnet="devnet",e))(mt||{}),es=(e=>(e.FastPool="FAST Pool",e.Xverse="Xverse",e.PlanBetter="PlanBetter",e.Restake="Restake",e.CustomPool="Custom Pool",e))(es||{}),wt=(e=>(e[e.WrapperOneCycle=0]="WrapperOneCycle",e[e.WrapperFastPool=1]="WrapperFastPool",e[e.WrapperRestake=2]="WrapperRestake",e[e.Pox4=3]="Pox4",e))(wt||{});const Hr={devnet:{3:"ST000000000000000000002AMW42H.pox-4",0:"ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.pox4-pools",1:"ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.pox4-self-service",2:"ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.pox4-self-service"},testnet:{3:"ST000000000000000000002AMW42H.pox-4",0:"ST2PABAF9FTAJYNFZH93XENAJ8FVY99RRM4DF2YCW.pox4-pools",1:"ST2PABAF9FTAJYNFZH93XENAJ8FVY99RRM4DF2YCW.pox4-self-service",2:"ST2PABAF9FTAJYNFZH93XENAJ8FVY99RRM4DF2YCW.pox4-self-service"},mainnet:{3:"SP000000000000000000002Q6VF78.pox-4",0:"SP001SFSMC2ZY76PD4M68P3WGX154XCH7NE3TYMX.pox4-pools",1:"SP21YTSM60CAY6D011EZVEVNKXVW8FVZE198XEFFP.pox4-fast-pool-v3",2:"SPZV5RJN5XTJHA76E0VHEFB0WPEH7E11NZZ4CGBK.restake-self-service-pool-v1"}};var Vd=(e=>(e.BTC="BTC",e.STX="STX",e.OTHER="OTHER",e))(Vd||{});const f0=({src:e})=>d.jsx("img",{src:e,width:"32px",alt:"name"}),Mo={"FAST Pool":{name:es.FastPool,description:"Enjoy automatic pool operations. You can increase the locking amount for the next cycle. Locked STX will unlock 1 day after the end of the cycle.",duration:1,website:"https://fastpool.org",payoutMethod:Vd.STX,poolAddress:{[mt.mainnet]:Hr[mt.mainnet][wt.WrapperFastPool],[mt.testnet]:Hr[mt.testnet][wt.WrapperFastPool],[mt.devnet]:Hr[mt.devnet][wt.WrapperFastPool]},poxContract:wt.WrapperFastPool,minimumDelegationAmount:4e7,icon:d.jsx(f0,{src:"/32x32_FastPool.png"}),allowCustomRewardAddress:!1,disabled:!1},PlanBetter:{name:es.PlanBetter,description:"Earn non-custodial Bitcoin yield. No wrapped tokens. Native BTC.",duration:1,website:"https://planbetter.org",payoutMethod:Vd.BTC,poolAddress:{[mt.mainnet]:"SP3TDKYYRTYFE32N19484838WEJ25GX40Z24GECPZ",[mt.testnet]:"SP3TDKYYRTYFE32N19484838WEJ25GX40Z24GECPZ",[mt.devnet]:"SP3TDKYYRTYFE32N19484838WEJ25GX40Z24GECPZ"},poxContract:wt.WrapperOneCycle,minimumDelegationAmount:2e8,icon:d.jsx(f0,{src:"/32x32_PlanBetter.png"}),allowCustomRewardAddress:!1,disabled:!1},Xverse:{name:es.Xverse,description:"Xverse pool is a non-custodial stacking pool service from the makers of Xverse wallet.",duration:1,website:"https://pool.xverse.app/",payoutMethod:Vd.BTC,poolAddress:{[mt.mainnet]:"SPXVRSEH2BKSXAEJ00F1BY562P45D5ERPSKR4Q33",[mt.testnet]:"SPXVRSEH2BKSXAEJ00F1BY562P45D5ERPSKR4Q33",[mt.devnet]:"SPXVRSEH2BKSXAEJ00F1BY562P45D5ERPSKR4Q33"},poxContract:wt.WrapperOneCycle,minimumDelegationAmount:1e8,icon:d.jsx(f0,{src:"/32x32_Xverse.png"}),allowCustomRewardAddress:!0,disabled:!1},Restake:{name:es.Restake,description:"Earn STX rewards by pooling your tokens with Restake, a non-custodial infrastructure operator trusted by institutions.",duration:1,website:"https://restake.net/stacks-pool",payoutMethod:Vd.STX,poolAddress:{[mt.mainnet]:Hr[mt.mainnet][wt.WrapperRestake],[mt.testnet]:Hr[mt.testnet][wt.WrapperRestake],[mt.devnet]:Hr[mt.devnet][wt.WrapperRestake]},poxContract:wt.WrapperRestake,minimumDelegationAmount:1e8,icon:d.jsx(f0,{src:"/32x32_Restake.png"}),allowCustomRewardAddress:!1,disabled:!1},"Custom Pool":{name:es.CustomPool,description:"Enter the STX address of the pool with which you’d like to Stack without your STX leaving your wallet.",duration:-1,website:"https://www.stacks.co/learn/stacking",payoutMethod:Vd.OTHER,poolAddress:void 0,poxContract:wt.Pox4,minimumDelegationAmount:yW,icon:d.jsx(dW,{}),allowCustomRewardAddress:!1,disabled:!1}};function Gw(e){return e.chainId===dn.Mainnet?mt.mainnet:e.client.baseUrl===Dh?mt.devnet:mt.testnet}function ju(e){const t=Gw(e);return Hr[t]}function qP(e){return e.poxContract!==wt.Pox4}function vW(e){if(e===es.CustomPool)return!1;const t=Mo[e];return qP(t)}function xW(e,t){return ju(t)[Mo[e].poxContract]}function _W(e,t){return Hr[e][t]}function UP(e){return[Hr[mt.mainnet][wt.WrapperFastPool],Hr[mt.testnet][wt.WrapperFastPool],Hr[mt.devnet][wt.WrapperFastPool],Hr[mt.mainnet][wt.WrapperRestake],Hr[mt.testnet][wt.WrapperRestake],Hr[mt.devnet][wt.WrapperRestake]].includes(e)}function kW(e,t){return Hr[e][t].split(".")}function HP(e){return t=>t[e]}function RW(e){return t=>t[e]}async function TW(e,t){const r=(e instanceof URL,e.toString()).includes("hiro.so")?{...t,headers:{...t==null?void 0:t.headers,"x-hiro-product":"Leather"}}:t;return await fetch(e,r)}var h0={};/*! * cookie * Copyright(c) 2012-2014 Roman Shtylman * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed - */var GA;function OW(){if(GA)return h0;GA=1,h0.parse=r,h0.serialize=i;var e=decodeURIComponent,t=encodeURIComponent,n=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function r(a,u){if(typeof a!="string")throw new TypeError("argument str must be a string");for(var l={},f=u||{},p=a.split(";"),m=f.decode||e,y=0;y"u"&&(t=!e||e[0]!=="{"&&e[0]!=="["&&e[0]!=='"'),!t}function KA(e,t){t===void 0&&(t={});var n=AW(e);if(EW(n,t.doNotParse))try{return JSON.parse(n)}catch{}return e}function AW(e){return e&&e[0]==="j"&&e[1]===":"?e.substr(2):e}var Gd=function(){return Gd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0&&this.changeListeners.splice(n,1)},e}(),J_=$.createContext(new FW);J_.Provider;J_.Consumer;function IW(){return typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"}function PW(e){var t=$.useContext(J_);if(!t)throw new Error("Missing ");var n=t.getAll(),r=$.useState(n),i=r[0],o=r[1],a=$.useRef(i);IW()&&$.useLayoutEffect(function(){function f(){var p=t.getAll();MW(e||null,p,a.current)&&o(p),a.current=p}return t.addChangeListener(f),function(){t.removeChangeListener(f)}},[t]);var u=$.useMemo(function(){return t.set.bind(t)},[t]),l=$.useMemo(function(){return t.remove.bind(t)},[t]);return[i,u,l]}function MW(e,t,n){if(!e)return!0;for(var r=0,i=e;r"u"&&(t=!e||e[0]!=="{"&&e[0]!=="["&&e[0]!=='"'),!t}function KA(e,t){t===void 0&&(t={});var n=AW(e);if(EW(n,t.doNotParse))try{return JSON.parse(n)}catch{}return e}function AW(e){return e&&e[0]==="j"&&e[1]===":"?e.substr(2):e}var Gd=function(){return Gd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0&&this.changeListeners.splice(n,1)},e}(),J_=$.createContext(new FW);J_.Provider;J_.Consumer;function IW(){return typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"}function PW(e){var t=$.useContext(J_);if(!t)throw new Error("Missing ");var n=t.getAll(),r=$.useState(n),i=r[0],o=r[1],a=$.useRef(i);IW()&&$.useLayoutEffect(function(){function f(){var p=t.getAll();MW(e||null,p,a.current)&&o(p),a.current=p}return t.addChangeListener(f),function(){t.removeChangeListener(f)}},[t]);var u=$.useMemo(function(){return t.set.bind(t)},[t]),l=$.useMemo(function(){return t.remove.bind(t)},[t]);return[i,u,l]}function MW(e,t,n){if(!e)return!0;for(var r=0,i=e;rPromise.resolve(!1),removeCustomNetwork:()=>!0,networks:{}}),JW=({cookies:e,queryNetworkMode:t,queryApiUrl:n,apiUrls:r,children:i})=>{var x,k;if(LP&&((k=(x=window==null?void 0:window.location)==null?void 0:x.search)!=null&&k.includes("err=1")))throw new Error("test error");const o=JSON.parse(jW.parse(e||"").customNetworks||"{}"),[a,u]=PW(["customNetworks"]),[l,f]=$.useState(o),p=$.useMemo(()=>({[r.mainnet]:{label:"hiro.so",url:r.mainnet,networkId:dn.Mainnet,mode:"mainnet"},[r.testnet]:{label:"hiro.so",url:r.testnet,networkId:dn.Testnet,mode:"testnet"},[Dh]:{label:"devnet",url:Dh,networkId:dn.Testnet,mode:"testnet",isCustomNetwork:!0},[HA]:{label:"Nakamoto Testnet",url:HA,networkId:dn.Testnet,mode:"testnet",isCustomNetwork:!0},...l}),[r,l]),m=n||r[t],w=!p[m]?r.mainnet:m,b=p[w];return b.mode!==t?d.jsx(Kw,{to:".",replace:!0}):d.jsx(WP.Provider,{value:{activeNetwork:b,activeNetworkKey:w,cookies:e,apiUrls:r,addCustomNetwork:O=>new Promise(N=>{u("customNetworks",JSON.stringify({...l,[O.url]:O}),{path:"/",maxAge:3600,sameSite:!0}),setTimeout(()=>{f({...l,[O.url]:{...O,isCustomNetwork:!0}}),N(!0)},100)}),removeCustomNetwork:O=>{const{[O.url]:N,...E}=l;u("customNetworks",JSON.stringify(E),{path:"/",maxAge:3600,sameSite:!0}),f(E)},networks:p},children:i})},ms=()=>$.useContext(WP);function m0(e){return e.client.fetch=TW,e}const Pt=()=>{const e=ms().activeNetwork,t=e.mode,n=RW(t)({mainnet:mr(m0(Ag)),testnet:mr(m0(ag)),devnet:mr(m0(Vm)),mocknet:mr(m0(MP))}),r=Gw(n);return{network:n,networkName:t,networkInstance:r,networkLabel:e.label}},VP=$.createContext(null);function $W({children:e}){const{network:t}=Pt(),n=new rr.Configuration({basePath:t.client.baseUrl});return d.jsx(VP.Provider,{value:{accountsApi:new rr.AccountsApi(n),blocksApi:new rr.BlocksApi(n),faucetsApi:new rr.FaucetsApi(n),feesApi:new rr.FeesApi(n),fungibleTokensApi:new rr.FungibleTokensApi(n),infoApi:new rr.InfoApi(n),microblocksApi:new rr.MicroblocksApi(n),namesApi:new rr.NamesApi(n),nonFungibleTokensApi:new rr.NonFungibleTokensApi(n),rosettaApi:new rr.RosettaApi(n),searchApi:new rr.SearchApi(n),smartContractsApi:new rr.SmartContractsApi(n),stackingRewardsApi:new rr.StackingRewardsApi(n),transactionsApi:new rr.TransactionsApi(n)},children:e})}function Qw(){return $.useContext(VP)}function qW(e){const t=Object.values(e).filter(r=>typeof r=="number"),n=new Set(t);return r=>n.has(r)}const YA=new Map;function GP(e,t){const n=YA.get(e);if(n!==void 0)return n(t);const r=qW(e);return YA.set(e,r),GP(e,t)}class fn{constructor(t){this.consumed=0,this.source=typeof t=="string"?rt(t):t}readBytes(t){const n=this.source.subarray(this.consumed,this.consumed+t);return this.consumed+=t,n}readUInt32BE(){return Kz(this.readBytes(4),0)}readUInt8(){return IP(this.readBytes(1),0)}readUInt16BE(){return Wz(this.readBytes(2),0)}readBigUIntLE(t){const n=this.readBytes(t).slice().reverse(),r=at(n);return BigInt(`0x${r}`)}readBigUIntBE(t){const n=this.readBytes(t),r=at(n);return BigInt(`0x${r}`)}get readOffset(){return this.consumed}set readOffset(t){this.consumed=t}get internalBytes(){return this.source}readUInt8Enum(t,n){const r=this.readUInt8();if(GP(t,r))return r;throw n(r)}}const UW=128,HW=128,KP=16,rf=32,m1=80,Fg=65,zW=32,WW=64,ow=34;var en;(function(e){e[e.TokenTransfer=0]="TokenTransfer",e[e.SmartContract=1]="SmartContract",e[e.VersionedSmartContract=6]="VersionedSmartContract",e[e.ContractCall=2]="ContractCall",e[e.PoisonMicroblock=3]="PoisonMicroblock",e[e.Coinbase=4]="Coinbase",e[e.CoinbaseToAltRecipient=5]="CoinbaseToAltRecipient",e[e.TenureChange=7]="TenureChange",e[e.NakamotoCoinbase=8]="NakamotoCoinbase"})(en||(en={}));var g1;(function(e){e[e.Clarity1=1]="Clarity1",e[e.Clarity2=2]="Clarity2",e[e.Clarity3=3]="Clarity3"})(g1||(g1={}));var Ri;(function(e){e[e.OnChainOnly=1]="OnChainOnly",e[e.OffChainOnly=2]="OffChainOnly",e[e.Any=3]="Any"})(Ri||(Ri={}));const rx=["onChainOnly","offChainOnly","any"];rx[0]+"",Ri.OnChainOnly,rx[1]+"",Ri.OffChainOnly,rx[2]+"",Ri.Any,Ri.OnChainOnly+"",Ri.OnChainOnly,Ri.OffChainOnly+"",Ri.OffChainOnly,Ri.Any+"",Ri.Any;var hf;(function(e){e[e.Allow=1]="Allow",e[e.Deny=2]="Deny"})(hf||(hf={}));var Or;(function(e){e[e.STX=0]="STX",e[e.Fungible=1]="Fungible",e[e.NonFungible=2]="NonFungible"})(Or||(Or={}));var un;(function(e){e[e.Standard=4]="Standard",e[e.Sponsored=5]="Sponsored"})(un||(un={}));var vt;(function(e){e[e.P2PKH=0]="P2PKH",e[e.P2SH=1]="P2SH",e[e.P2WPKH=2]="P2WPKH",e[e.P2WSH=3]="P2WSH",e[e.P2SHNonSequential=5]="P2SHNonSequential",e[e.P2WSHNonSequential=7]="P2WSHNonSequential"})(vt||(vt={}));var _n;(function(e){e[e.Compressed=0]="Compressed",e[e.Uncompressed=1]="Uncompressed"})(_n||(_n={}));var Cu;(function(e){e[e.Equal=1]="Equal",e[e.Greater=2]="Greater",e[e.GreaterEqual=3]="GreaterEqual",e[e.Less=4]="Less",e[e.LessEqual=5]="LessEqual"})(Cu||(Cu={}));var ug;(function(e){e[e.Sends=16]="Sends",e[e.DoesNotSend=17]="DoesNotSend"})(ug||(ug={}));var Ai;(function(e){e[e.Origin=1]="Origin",e[e.Standard=2]="Standard",e[e.Contract=3]="Contract"})(Ai||(Ai={}));var XA;(function(e){e[e.STX=0]="STX",e[e.Fungible=1]="Fungible",e[e.NonFungible=2]="NonFungible"})(XA||(XA={}));var y1;(function(e){e[e.BlockFound=0]="BlockFound",e[e.Extended=1]="Extended"})(y1||(y1={}));var No;(function(e){e[e.PublicKeyCompressed=0]="PublicKeyCompressed",e[e.PublicKeyUncompressed=1]="PublicKeyUncompressed",e[e.SignatureCompressed=2]="SignatureCompressed",e[e.SignatureUncompressed=3]="SignatureUncompressed"})(No||(No={}));var ZA;(function(e){e.Serialization="Serialization",e.Deserialization="Deserialization",e.SignatureValidation="SignatureValidation",e.FeeTooLow="FeeTooLow",e.BadNonce="BadNonce",e.NotEnoughFunds="NotEnoughFunds",e.NoSuchContract="NoSuchContract",e.NoSuchPublicFunction="NoSuchPublicFunction",e.BadFunctionArgument="BadFunctionArgument",e.ContractAlreadyExists="ContractAlreadyExists",e.PoisonMicroblocksDoNotConflict="PoisonMicroblocksDoNotConflict",e.PoisonMicroblockHasUnknownPubKeyHash="PoisonMicroblockHasUnknownPubKeyHash",e.PoisonMicroblockIsInvalid="PoisonMicroblockIsInvalid",e.BadAddressVersionByte="BadAddressVersionByte",e.NoCoinbaseViaMempool="NoCoinbaseViaMempool",e.ServerFailureNoSuchChainTip="ServerFailureNoSuchChainTip",e.ServerFailureDatabase="ServerFailureDatabase",e.ServerFailureOther="ServerFailureOther"})(ZA||(ZA={}));let Ig=class extends Error{constructor(t){super(t),this.message=t,this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},wh=class extends Ig{constructor(t){super(t)}};class Ci extends Ig{constructor(t){super(t)}}class QP extends Ig{constructor(t){super(t)}}class Zo extends Ig{constructor(t){super(t)}}class ef extends Ig{constructor(t){super(t)}}function w1(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function VW(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function YP(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function GW(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");w1(e.outputLen),w1(e.blockLen)}function KW(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function QW(e,t){YP(e);const n=t.outputLen;if(e.lengthnew DataView(e.buffer,e.byteOffset,e.byteLength),Ko=(e,t)=>e<<32-t|e>>>t,YW=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!YW)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function XW(e){if(typeof e!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof e}`);return new TextEncoder().encode(e)}function $_(e){if(typeof e=="string"&&(e=XW(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}let XP=class{clone(){return this._cloneInto()}};function Sf(e){const t=r=>e().update($_(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}class ZP extends XP{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,tf.hash(t);const r=$_(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?t.create().update(r).digest():r);for(let a=0;anew ZP(e,t).update(n).digest();Pg.create=(e,t)=>new ZP(e,t);function ZW(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const i=BigInt(32),o=BigInt(4294967295),a=Number(n>>i&o),u=Number(n&o),l=r?4:0,f=r?0:4;e.setUint32(t+l,a,r),e.setUint32(t+f,u,r)}class q_ extends XP{constructor(t,n,r,i){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=ix(this.buffer)}update(t){tf.exists(this);const{view:n,buffer:r,blockLen:i}=this;t=$_(t);const o=t.length;for(let a=0;ai-a&&(this.process(r,0),a=0);for(let m=a;mp.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;me&t^~e&n,tV=(e,t,n)=>e&t^e&n^t&n,nV=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),yl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),wl=new Uint32Array(64);class eM extends q_{constructor(){super(64,32,8,!1),this.A=yl[0]|0,this.B=yl[1]|0,this.C=yl[2]|0,this.D=yl[3]|0,this.E=yl[4]|0,this.F=yl[5]|0,this.G=yl[6]|0,this.H=yl[7]|0}get(){const{A:t,B:n,C:r,D:i,E:o,F:a,G:u,H:l}=this;return[t,n,r,i,o,a,u,l]}set(t,n,r,i,o,a,u,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=a|0,this.G=u|0,this.H=l|0}process(t,n){for(let m=0;m<16;m++,n+=4)wl[m]=t.getUint32(n,!1);for(let m=16;m<64;m++){const y=wl[m-15],w=wl[m-2],b=Ko(y,7)^Ko(y,18)^y>>>3,x=Ko(w,17)^Ko(w,19)^w>>>10;wl[m]=x+wl[m-7]+b+wl[m-16]|0}let{A:r,B:i,C:o,D:a,E:u,F:l,G:f,H:p}=this;for(let m=0;m<64;m++){const y=Ko(u,6)^Ko(u,11)^Ko(u,25),w=p+y+eV(u,l,f)+nV[m]+wl[m]|0,x=(Ko(r,2)^Ko(r,13)^Ko(r,22))+tV(r,i,o)|0;p=f,f=l,l=u,u=a+w|0,a=o,o=i,i=r,r=w+x|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,f=f+this.G|0,p=p+this.H|0,this.set(r,i,o,a,u,l,f,p)}roundClean(){wl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class rV extends eM{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const Jr=Sf(()=>new eM);Sf(()=>new rV);/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const jt=BigInt(0),xn=BigInt(1),Ol=BigInt(2),Gm=BigInt(3),eF=BigInt(8),In=Object.freeze({a:jt,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:xn,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")}),tF=(e,t)=>(e+t/Ol)/t,g0={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(e){const{n:t}=In,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-xn*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,a=BigInt("0x100000000000000000000000000000000"),u=tF(o*e,t),l=tF(-r*e,t);let f=$e(e-u*n-l*i,t),p=$e(-u*r-l*o,t);const m=f>a,y=p>a;if(m&&(f=t-f),y&&(p=t-p),f>a||p>a)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:m,k1:f,k2neg:y,k2:p}}},Fo=32,qh=32,iV=32,sw=Fo+1,aw=2*Fo+1;function nF(e){const{a:t,b:n}=In,r=$e(e*e),i=$e(r*e);return $e(i+t*e+n)}const y0=In.a===jt;class tM extends Error{constructor(t){super(t)}}function rF(e){if(!(e instanceof Vt))throw new TypeError("JacobianPoint expected")}class Vt{constructor(t,n,r){this.x=t,this.y=n,this.z=r}static fromAffine(t){if(!(t instanceof Kt))throw new TypeError("JacobianPoint#fromAffine: expected Point");return t.equals(Kt.ZERO)?Vt.ZERO:new Vt(t.x,t.y,xn)}static toAffineBatch(t){const n=uV(t.map(r=>r.z));return t.map((r,i)=>r.toAffine(n[i]))}static normalizeZ(t){return Vt.toAffineBatch(t).map(Vt.fromAffine)}equals(t){rF(t);const{x:n,y:r,z:i}=this,{x:o,y:a,z:u}=t,l=$e(i*i),f=$e(u*u),p=$e(n*f),m=$e(o*l),y=$e($e(r*u)*f),w=$e($e(a*i)*l);return p===m&&y===w}negate(){return new Vt(this.x,$e(-this.y),this.z)}double(){const{x:t,y:n,z:r}=this,i=$e(t*t),o=$e(n*n),a=$e(o*o),u=t+o,l=$e(Ol*($e(u*u)-i-a)),f=$e(Gm*i),p=$e(f*f),m=$e(p-Ol*l),y=$e(f*(l-m)-eF*a),w=$e(Ol*n*r);return new Vt(m,y,w)}add(t){rF(t);const{x:n,y:r,z:i}=this,{x:o,y:a,z:u}=t;if(o===jt||a===jt)return this;if(n===jt||r===jt)return t;const l=$e(i*i),f=$e(u*u),p=$e(n*f),m=$e(o*l),y=$e($e(r*u)*f),w=$e($e(a*i)*l),b=$e(m-p),x=$e(w-y);if(b===jt)return x===jt?this.double():Vt.ZERO;const k=$e(b*b),O=$e(b*k),N=$e(p*k),E=$e(x*x-O-Ol*N),T=$e(x*(N-E)-y*O),B=$e(i*u*b);return new Vt(E,T,B)}subtract(t){return this.add(t.negate())}multiplyUnsafe(t){const n=Vt.ZERO;if(typeof t=="bigint"&&t===jt)return n;let r=sF(t);if(r===xn)return this;if(!y0){let m=n,y=this;for(;r>jt;)r&xn&&(m=m.add(y)),y=y.double(),r>>=xn;return m}let{k1neg:i,k1:o,k2neg:a,k2:u}=g0.splitScalar(r),l=n,f=n,p=this;for(;o>jt||u>jt;)o&xn&&(l=l.add(p)),u&xn&&(f=f.add(p)),p=p.double(),o>>=xn,u>>=xn;return i&&(l=l.negate()),a&&(f=f.negate()),f=new Vt($e(f.x*g0.beta),f.y,f.z),l.add(f)}precomputeWindow(t){const n=y0?128/t+1:256/t+1,r=[];let i=this,o=i;for(let a=0;a>=m,b>l&&(b-=p,t+=xn);const x=w,k=w+Math.abs(b)-1,O=y%2!==0,N=b<0;b===0?a=a.add(w0(O,i[x])):o=o.add(w0(N,i[k]))}return{p:o,f:a}}multiply(t,n){let r=sF(t),i,o;if(y0){const{k1neg:a,k1:u,k2neg:l,k2:f}=g0.splitScalar(r);let{p,f:m}=this.wNAF(u,n),{p:y,f:w}=this.wNAF(f,n);p=w0(a,p),y=w0(l,y),y=new Vt($e(y.x*g0.beta),y.y,y.z),i=p.add(y),o=m.add(w)}else{const{p:a,f:u}=this.wNAF(r,n);i=a,o=u}return Vt.normalizeZ([i,o])[0]}toAffine(t){const{x:n,y:r,z:i}=this,o=this.equals(Vt.ZERO);t==null&&(t=o?eF:op(i));const a=t,u=$e(a*a),l=$e(u*a),f=$e(n*u),p=$e(r*l),m=$e(i*a);if(o)return Kt.ZERO;if(m!==xn)throw new Error("invZ was invalid");return new Kt(f,p)}}Vt.BASE=new Vt(In.Gx,In.Gy,xn);Vt.ZERO=new Vt(jt,xn,jt);function w0(e,t){const n=t.negate();return e?n:t}const b1=new WeakMap;class Kt{constructor(t,n){this.x=t,this.y=n}_setWindowSize(t){this._WINDOW_SIZE=t,b1.delete(this)}hasEvenY(){return this.y%Ol===jt}static fromCompressedHex(t){const n=t.length===32,r=El(n?t:t.subarray(1));if(!ox(r))throw new Error("Point is not on curve");const i=nF(r);let o=cV(i);const a=(o&xn)===xn;n?a&&(o=$e(-o)):(t[0]&1)===1!==a&&(o=$e(-o));const u=new Kt(r,o);return u.assertValidity(),u}static fromUncompressedHex(t){const n=El(t.subarray(1,Fo+1)),r=El(t.subarray(Fo+1,Fo*2+1)),i=new Kt(n,r);return i.assertValidity(),i}static fromHex(t){const n=Hh(t),r=n.length,i=n[0];if(r===Fo)return this.fromCompressedHex(n);if(r===sw&&(i===2||i===3))return this.fromCompressedHex(n);if(r===aw&&i===4)return this.fromUncompressedHex(n);throw new Error(`Point.fromHex: received invalid point. Expected 32-${sw} compressed bytes or ${aw} uncompressed bytes, not ${r}`)}static fromPrivateKey(t){return Kt.BASE.multiply(dg(t))}static fromSignature(t,n,r){const{r:i,s:o}=rM(n);if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");const a=U_(Hh(t)),{n:u}=In,l=r===2||r===3?i+u:i,f=op(l,u),p=$e(-a*f,u),m=$e(o*f,u),y=r&1?"03":"02",w=Kt.fromHex(y+Oh(l)),b=Kt.BASE.multiplyAndAddUnsafe(w,p,m);if(!b)throw new Error("Cannot recover signature: point at infinify");return b.assertValidity(),b}toRawBytes(t=!1){return of(this.toHex(t))}toHex(t=!1){const n=Oh(this.x);return t?`${this.hasEvenY()?"02":"03"}${n}`:`04${n}${Oh(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const t="Point is not on elliptic curve",{x:n,y:r}=this;if(!ox(n)||!ox(r))throw new Error(t);const i=$e(r*r),o=nF(n);if($e(i-o)!==jt)throw new Error(t)}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new Kt(this.x,$e(-this.y))}double(){return Vt.fromAffine(this).double().toAffine()}add(t){return Vt.fromAffine(this).add(Vt.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return Vt.fromAffine(this).multiply(t,this).toAffine()}multiplyAndAddUnsafe(t,n,r){const i=Vt.fromAffine(this),o=n===jt||n===xn||this!==Kt.BASE?i.multiplyUnsafe(n):i.multiply(n),a=Vt.fromAffine(t).multiplyUnsafe(r),u=o.add(a);return u.equals(Vt.ZERO)?void 0:u.toAffine()}}Kt.BASE=new Kt(In.Gx,In.Gy);Kt.ZERO=new Kt(jt,jt);function iF(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function oF(e){if(e.length<2||e[0]!==2)throw new Error(`Invalid signature integer tag: ${Uh(e)}`);const t=e[1],n=e.subarray(2,t+2);if(!t||n.length!==t)throw new Error("Invalid signature integer: wrong length");if(n[0]===0&&n[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:El(n),left:e.subarray(t+2)}}function oV(e){if(e.length<2||e[0]!=48)throw new Error(`Invalid signature tag: ${Uh(e)}`);if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:n}=oF(e.subarray(2)),{data:r,left:i}=oF(n);if(i.length)throw new Error(`Invalid signature: left bytes after parsing: ${Uh(i)}`);return{r:t,s:r}}class Lo{constructor(t,n){this.r=t,this.s=n,this.assertValidity()}static fromCompact(t){const n=t instanceof Uint8Array,r="Signature.fromCompact";if(typeof t!="string"&&!n)throw new TypeError(`${r}: Expected string or Uint8Array`);const i=n?Uh(t):t;if(i.length!==128)throw new Error(`${r}: Expected 64-byte hex`);return new Lo(cw(i.slice(0,64)),cw(i.slice(64,128)))}static fromDER(t){const n=t instanceof Uint8Array;if(typeof t!="string"&&!n)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:i}=oV(n?t:of(t));return new Lo(r,i)}static fromHex(t){return this.fromDER(t)}assertValidity(){const{r:t,s:n}=this;if(!lg(t))throw new Error("Invalid Signature: r must be 0 < r < n");if(!lg(n))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const t=In.n>>xn;return this.s>t}normalizeS(){return this.hasHighS()?new Lo(this.r,$e(-this.s,In.n)):this}toDERRawBytes(){return of(this.toDERHex())}toDERHex(){const t=iF(km(this.s)),n=iF(km(this.r)),r=t.length/2,i=n.length/2,o=km(r),a=km(i);return`30${km(i+r+4)}02${a}${n}02${o}${t}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return of(this.toCompactHex())}toCompactHex(){return Oh(this.r)+Oh(this.s)}}function kl(...e){if(!e.every(r=>r instanceof Uint8Array))throw new Error("Uint8Array list expected");if(e.length===1)return e[0];const t=e.reduce((r,i)=>r+i.length,0),n=new Uint8Array(t);for(let r=0,i=0;rt.toString(16).padStart(2,"0"));function Uh(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");let t="";for(let n=0;n0)return BigInt(e);if(typeof e=="bigint"&&lg(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function $e(e,t=In.P){const n=e%t;return n>=jt?n:t+n}function Gi(e,t){const{P:n}=In;let r=e;for(;t-- >jt;)r*=r,r%=n;return r}function cV(e){const{P:t}=In,n=BigInt(6),r=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),u=BigInt(88),l=e*e*e%t,f=l*l*e%t,p=Gi(f,Gm)*f%t,m=Gi(p,Gm)*f%t,y=Gi(m,Ol)*l%t,w=Gi(y,r)*y%t,b=Gi(w,i)*w%t,x=Gi(b,a)*b%t,k=Gi(x,u)*x%t,O=Gi(k,a)*b%t,N=Gi(O,Gm)*f%t,E=Gi(N,o)*w%t,T=Gi(E,n)*l%t,B=Gi(T,Ol);if(B*B%t!==e)throw new Error("Cannot find square root");return B}function op(e,t=In.P){if(e===jt||t<=jt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=$e(e,t),r=t,i=jt,o=xn;for(;n!==jt;){const u=r/n,l=r%n,f=i-o*u;r=n,n=l,i=o,o=f}if(r!==xn)throw new Error("invert: does not exist");return $e(i,t)}function uV(e,t=In.P){const n=new Array(e.length),r=e.reduce((o,a,u)=>a===jt?o:(n[u]=o,$e(o*a,t)),xn),i=op(r,t);return e.reduceRight((o,a,u)=>a===jt?o:(n[u]=$e(o*n[u],t),$e(o*a,t)),i),n}function lV(e){const t=e.length*8-qh*8,n=El(e);return t>0?n>>BigInt(t):n}function U_(e,t=!1){const n=lV(e);if(t)return n;const{n:r}=In;return n>=r?n-r:n}let Nh,Km;class dV{constructor(t,n){if(this.hashLen=t,this.qByteLen=n,typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(t).fill(1),this.k=new Uint8Array(t).fill(0),this.counter=0}hmac(...t){return ri.hmacSha256(this.k,...t)}hmacSync(...t){return Km(this.k,...t)}checkSync(){if(typeof Km!="function")throw new tM("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(t=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),t),this.v=await this.hmac(this.v),t.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),t),this.v=await this.hmac(this.v))}reseedSync(t=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),t),this.v=this.hmacSync(this.v),t.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),t),this.v=this.hmacSync(this.v))}async generate(){this.incr();let t=0;const n=[];for(;t0)t=BigInt(e);else if(typeof e=="string"){if(e.length!==2*qh)throw new Error("Expected 32 bytes of private key");t=cw(e)}else if(e instanceof Uint8Array){if(e.length!==qh)throw new Error("Expected 32 bytes of private key");t=El(e)}else throw new TypeError("Expected valid private key");if(!lg(t))throw new Error("Expected private key: 0 < key < n");return t}function nM(e){return e instanceof Kt?(e.assertValidity(),e):Kt.fromHex(e)}function rM(e){if(e instanceof Lo)return e.assertValidity(),e;try{return Lo.fromDER(e)}catch{return Lo.fromCompact(e)}}function H_(e,t=!1){return Kt.fromPrivateKey(e).toRawBytes(t)}function aF(e){const t=e instanceof Uint8Array,n=typeof e=="string",r=(t||n)&&e.length;return t?r===sw||r===aw:n?r===sw*2||r===aw*2:e instanceof Kt}function iM(e,t,n=!1){if(aF(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!aF(t))throw new TypeError("getSharedSecret: second arg must be public key");const r=nM(t);return r.assertValidity(),r.multiply(dg(e)).toRawBytes(n)}function oM(e){const t=e.length>Fo?e.slice(0,Fo):e;return El(t)}function hV(e){const t=oM(e),n=$e(t,In.n);return sM(n{e=Hh(e);const t=qh+8;if(e.length1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const n=$e(El(e),In.n-xn)+xn;return S1(n)},randomBytes:(e=32)=>{if(Si.web)return Si.web.getRandomValues(new Uint8Array(e));if(Si.node){const{randomBytes:t}=Si.node;return Uint8Array.from(t(e))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>ri.hashToPrivateKey(ri.randomBytes(qh+8)),precompute(e=8,t=Kt.BASE){const n=t===Kt.BASE?t:new Kt(t.x,t.y);return n._setWindowSize(e),n.multiply(Gm),n},sha256:async(...e)=>{if(Si.web){const t=await Si.web.subtle.digest("SHA-256",kl(...e));return new Uint8Array(t)}else if(Si.node){const{createHash:t}=Si.node,n=t("sha256");return e.forEach(r=>n.update(r)),Uint8Array.from(n.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(Si.web){const n=await Si.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),r=kl(...t),i=await Si.web.subtle.sign("HMAC",n,r);return new Uint8Array(i)}else if(Si.node){const{createHmac:n}=Si.node,r=n("sha256",e);return t.forEach(i=>r.update(i)),Uint8Array.from(r.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(e,...t)=>{let n=b0[e];if(n===void 0){const r=await ri.sha256(Uint8Array.from(e,i=>i.charCodeAt(0)));n=kl(r,r),b0[e]=n}return ri.sha256(n,...t)},taggedHashSync:(e,...t)=>{if(typeof Nh!="function")throw new tM("sha256Sync is undefined, you need to set it");let n=b0[e];if(n===void 0){const r=Nh(Uint8Array.from(e,i=>i.charCodeAt(0)));n=kl(r,r),b0[e]=n}return Nh(n,...t)},_JacobianPoint:Vt};Object.defineProperties(ri,{sha256Sync:{configurable:!1,get(){return Nh},set(e){Nh||(Nh=e)}},hmacSha256Sync:{configurable:!1,get(){return Km},set(e){Km||(Km=e)}}});var sx={},ax={},cx={},Rm={},uF;function yV(){return uF||(uF=1,Object.defineProperty(Rm,"__esModule",{value:!0}),Rm.crypto=void 0,Rm.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),Rm}var lF;function zl(){return lF||(lF=1,function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;const t=yV(),n=A=>A instanceof Uint8Array,r=A=>new Uint8Array(A.buffer,A.byteOffset,A.byteLength);e.u8=r;const i=A=>new Uint32Array(A.buffer,A.byteOffset,Math.floor(A.byteLength/4));e.u32=i;const o=A=>new DataView(A.buffer,A.byteOffset,A.byteLength);e.createView=o;const a=(A,U)=>A<<32-U|A>>>U;if(e.rotr=a,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");const u=Array.from({length:256},(A,U)=>U.toString(16).padStart(2,"0"));function l(A){if(!n(A))throw new Error("Uint8Array expected");let U="";for(let v=0;v{};e.nextTick=p;async function m(A,U,v){let R=Date.now();for(let C=0;C=0&&MR+C.length,0));let v=0;return A.forEach(R=>{if(!n(R))throw new Error("Uint8Array expected");U.set(R,v),v+=R.length}),U}e.concatBytes=b;class x{clone(){return this._cloneInto()}}e.Hash=x;const k={}.toString;function O(A,U){if(U!==void 0&&k.call(U)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(A,U)}e.checkOpts=O;function N(A){const U=R=>A().update(w(R)).digest(),v=A();return U.outputLen=v.outputLen,U.blockLen=v.blockLen,U.create=()=>A(),U}e.wrapConstructor=N;function E(A){const U=(R,C)=>A(C).update(w(R)).digest(),v=A({});return U.outputLen=v.outputLen,U.blockLen=v.blockLen,U.create=R=>A(R),U}e.wrapConstructorWithOpts=E;function T(A){const U=(R,C)=>A(C).update(w(R)).digest(),v=A({});return U.outputLen=v.outputLen,U.blockLen=v.blockLen,U.create=R=>A(R),U}e.wrapXOFConstructorWithOpts=T;function B(A=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(A));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=B}(cx)),cx}var dF;function cM(){return dF||(dF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.c32decode=e.c32normalize=e.c32encode=e.c32=void 0;const t=zl();e.c32="0123456789ABCDEFGHJKMNPQRSTVWXYZ";const n="0123456789abcdef";function r(a,u){if(!a.match(/^[0-9a-fA-F]*$/))throw new Error("Not a hex-encoded string");a.length%2!==0&&(a=`0${a}`),a=a.toLowerCase();let l=[],f=0;for(let w=a.length-1;w>=0;w--)if(f<4){const b=n.indexOf(a[w])>>f;let x=0;w!==0&&(x=n.indexOf(a[w-1]));const k=1+f,O=x%(1<=0;x--){y===4&&(p.unshift(n[m]),y=0,m=0);const O=(e.c32.indexOf(a[x])<>4,m>1<0&&!l.includes(u.length))throw new Error(`Expected Uint8Array of length ${l}, not of length=${u.length}`)}Br.bytes=n;function r(u){if(typeof u!="function"||typeof u.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");e(u.outputLen),e(u.blockLen)}Br.hash=r;function i(u,l=!0){if(u.destroyed)throw new Error("Hash instance has been destroyed");if(l&&u.finished)throw new Error("Hash#digest() has already been called")}Br.exists=i;function o(u,l){n(u);const f=l.outputLen;if(u.length>l&f),m=Number(a&f),y=u?4:0,w=u?0:4;i.setUint32(o+y,p,u),i.setUint32(o+w,m,u)}class r extends t.Hash{constructor(o,a,u,l){super(),this.blockLen=o,this.outputLen=a,this.padOffset=u,this.isLE=l,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(o),this.view=(0,t.createView)(this.buffer)}update(o){(0,e.exists)(this);const{view:a,buffer:u,blockLen:l}=this;o=(0,t.toBytes)(o);const f=o.length;for(let p=0;pl-p&&(this.process(u,0),p=0);for(let x=p;xb.length)throw new Error("_sha2: outputLen bigger than state");for(let x=0;xf&p^~f&m,r=(f,p,m)=>f&p^f&m^p&m,i=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);class u extends e.SHA2{constructor(){super(64,32,8,!1),this.A=o[0]|0,this.B=o[1]|0,this.C=o[2]|0,this.D=o[3]|0,this.E=o[4]|0,this.F=o[5]|0,this.G=o[6]|0,this.H=o[7]|0}get(){const{A:p,B:m,C:y,D:w,E:b,F:x,G:k,H:O}=this;return[p,m,y,w,b,x,k,O]}set(p,m,y,w,b,x,k,O){this.A=p|0,this.B=m|0,this.C=y|0,this.D=w|0,this.E=b|0,this.F=x|0,this.G=k|0,this.H=O|0}process(p,m){for(let T=0;T<16;T++,m+=4)a[T]=p.getUint32(m,!1);for(let T=16;T<64;T++){const B=a[T-15],A=a[T-2],U=(0,t.rotr)(B,7)^(0,t.rotr)(B,18)^B>>>3,v=(0,t.rotr)(A,17)^(0,t.rotr)(A,19)^A>>>10;a[T]=v+a[T-7]+U+a[T-16]|0}let{A:y,B:w,C:b,D:x,E:k,F:O,G:N,H:E}=this;for(let T=0;T<64;T++){const B=(0,t.rotr)(k,6)^(0,t.rotr)(k,11)^(0,t.rotr)(k,25),A=E+B+n(k,O,N)+i[T]+a[T]|0,v=((0,t.rotr)(y,2)^(0,t.rotr)(y,13)^(0,t.rotr)(y,22))+r(y,w,b)|0;E=N,N=O,O=k,k=x+A|0,x=b,b=w,w=y,y=A+v|0}y=y+this.A|0,w=w+this.B|0,b=b+this.C|0,x=x+this.D|0,k=k+this.E|0,O=O+this.F|0,N=N+this.G|0,E=E+this.H|0,this.set(y,w,b,x,k,O,N,E)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class l extends u{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}return Bd.sha256=(0,t.wrapConstructor)(()=>new u),Bd.sha224=(0,t.wrapConstructor)(()=>new l),Bd}var mF;function lM(){if(mF)return Ld;mF=1,Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.c32checkDecode=Ld.c32checkEncode=void 0;const e=Yw(),t=zl(),n=cM();function r(a){const u=(0,e.sha256)((0,e.sha256)((0,t.hexToBytes)(a)));return(0,t.bytesToHex)(u.slice(0,4))}function i(a,u){if(a<0||a>=32)throw new Error("Invalid version (must be between 0 and 31)");if(!u.match(/^[0-9a-fA-F]*$/))throw new Error("Invalid data (not a hex string)");u=u.toLowerCase(),u.length%2!==0&&(u=`0${u}`);let l=a.toString(16);l.length===1&&(l=`0${l}`);const f=r(`${l}${u}`),p=(0,n.c32encode)(`${u}${f}`);return`${n.c32[a]}${p}`}Ld.c32checkEncode=i;function o(a){a=(0,n.c32normalize)(a);const u=(0,n.c32decode)(a.slice(1)),l=a[0],f=n.c32.indexOf(l),p=u.slice(-8);let m=f.toString(16);if(m.length===1&&(m=`0${m}`),r(`${m}${u.substring(0,u.length-8)}`)!==p)throw new Error("Invalid c32check string: checksum mismatch");return[f,u.substring(0,u.length-8)]}return Ld.c32checkDecode=o,Ld}var ux={},jd={},lx,gF;function dM(){if(gF)return lx;gF=1;function e(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r>>0,T=new Uint8Array(E);O!==N;){for(var B=b[O],A=0,U=E-1;(B!==0||A>>0,T[U]=B%u>>>0,B=B/u>>>0;if(B!==0)throw new Error("Non-zero carry");k=A,O++}for(var v=E-k;v!==E&&T[v]===0;)v++;for(var R=l.repeat(x);v>>0,E=new Uint8Array(N);b[x];){var T=n[b.charCodeAt(x)];if(T===255)return;for(var B=0,A=N-1;(T!==0||B>>0,E[A]=T%256>>>0,T=T/256>>>0;if(T!==0)throw new Error("Non-zero carry");O=B,x++}for(var U=N-O;U!==N&&E[U]===0;)U++;for(var v=new Uint8Array(k+(N-U)),R=k;U!==N;)v[R++]=E[U++];return v}function w(b){var x=y(b);if(x)return x;throw new Error("Non-base"+u+" character")}return{encode:m,decodeUnsafe:y,decode:w}}return lx=e,lx}var yF;function bV(){if(yF)return jd;yF=1,Object.defineProperty(jd,"__esModule",{value:!0}),jd.decode=jd.encode=void 0;const e=Yw(),t=zl(),n=dM(),r="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function i(a,u="00"){const l=typeof a=="string"?(0,t.hexToBytes)(a):a,f=typeof u=="string"?(0,t.hexToBytes)(u):a;if(!(l instanceof Uint8Array)||!(f instanceof Uint8Array))throw new TypeError("Argument must be of type Uint8Array or string");const p=(0,e.sha256)((0,e.sha256)(new Uint8Array([...f,...l])));return n(r).encode([...f,...l,...p.slice(0,4)])}jd.encode=i;function o(a){const u=n(r).decode(a),l=u.slice(0,1),f=u.slice(1,-4),p=(0,e.sha256)((0,e.sha256)(new Uint8Array([...l,...f])));return u.slice(-4).forEach((m,y)=>{if(m!==p[y])throw new Error("Invalid checksum")}),{prefix:l,data:f}}return jd.decode=o,jd}var wF;function SV(){return wF||(wF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.c32ToB58=e.b58ToC32=e.c32addressDecode=e.c32address=e.versions=void 0;const t=lM(),n=bV(),r=zl();e.versions={mainnet:{p2pkh:22,p2sh:20},testnet:{p2pkh:26,p2sh:21}};const i={};i[0]=e.versions.mainnet.p2pkh,i[5]=e.versions.mainnet.p2sh,i[111]=e.versions.testnet.p2pkh,i[196]=e.versions.testnet.p2sh;const o={};o[e.versions.mainnet.p2pkh]=0,o[e.versions.mainnet.p2sh]=5,o[e.versions.testnet.p2pkh]=111,o[e.versions.testnet.p2sh]=196;function a(p,m){if(!m.match(/^[0-9a-fA-F]{40}$/))throw new Error("Invalid argument: not a hash160 hex string");return`S${(0,t.c32checkEncode)(p,m)}`}e.c32address=a;function u(p){if(p.length<=5)throw new Error("Invalid c32 address: invalid length");if(p[0]!="S")throw new Error('Invalid c32 address: must start with "S"');return(0,t.c32checkDecode)(p.slice(1))}e.c32addressDecode=u;function l(p,m=-1){const y=n.decode(p),w=(0,r.bytesToHex)(y.data),b=parseInt((0,r.bytesToHex)(y.prefix),16);let x;return m<0?(x=b,i[b]!==void 0&&(x=i[b])):x=m,a(x,w)}e.b58ToC32=l;function f(p,m=-1){const y=u(p),w=y[0],b=y[1];let x;m<0?(x=w,o[w]!==void 0&&(x=o[w])):x=m;let k=x.toString(16);return k.length===1&&(k=`0${k}`),n.encode(b,k)}e.c32ToB58=f}(ux)),ux}var bF;function vV(){return bF||(bF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.b58ToC32=e.c32ToB58=e.versions=e.c32normalize=e.c32addressDecode=e.c32address=e.c32checkDecode=e.c32checkEncode=e.c32decode=e.c32encode=void 0;const t=cM();Object.defineProperty(e,"c32encode",{enumerable:!0,get:function(){return t.c32encode}}),Object.defineProperty(e,"c32decode",{enumerable:!0,get:function(){return t.c32decode}}),Object.defineProperty(e,"c32normalize",{enumerable:!0,get:function(){return t.c32normalize}});const n=lM();Object.defineProperty(e,"c32checkEncode",{enumerable:!0,get:function(){return n.c32checkEncode}}),Object.defineProperty(e,"c32checkDecode",{enumerable:!0,get:function(){return n.c32checkDecode}});const r=SV();Object.defineProperty(e,"c32address",{enumerable:!0,get:function(){return r.c32address}}),Object.defineProperty(e,"c32addressDecode",{enumerable:!0,get:function(){return r.c32addressDecode}}),Object.defineProperty(e,"c32ToB58",{enumerable:!0,get:function(){return r.c32ToB58}}),Object.defineProperty(e,"b58ToC32",{enumerable:!0,get:function(){return r.b58ToC32}}),Object.defineProperty(e,"versions",{enumerable:!0,get:function(){return r.versions}})}(sx)),sx}var Xw=vV();function xV(e,t){switch(t=mr(t??Ag),e){case vt.P2PKH:switch(t.transactionVersion){case Ni.Mainnet:return Ao.MainnetSingleSig;case Ni.Testnet:return Ao.TestnetSingleSig;default:throw new Error(`Unexpected transactionVersion ${t.transactionVersion} for hashMode ${e}`)}case vt.P2SH:case vt.P2SHNonSequential:case vt.P2WPKH:case vt.P2WSH:case vt.P2WSHNonSequential:switch(t.transactionVersion){case Ni.Mainnet:return Ao.MainnetMultiSig;case Ni.Testnet:return Ao.TestnetMultiSig;default:throw new Error(`Unexpected transactionVersion ${t.transactionVersion} for hashMode ${e}`)}default:throw new Error(`Unexpected hashMode ${e}`)}}const _V=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),fM=Uint8Array.from({length:16},(e,t)=>t),kV=fM.map(e=>(9*e+5)%16);let z_=[fM],W_=[kV];for(let e=0;e<4;e++)for(let t of[z_,W_])t.push(t[e].map(n=>_V[n]));const hM=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),RV=z_.map((e,t)=>e.map(n=>hM[t][n])),TV=W_.map((e,t)=>e.map(n=>hM[t][n])),OV=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),NV=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),S0=(e,t)=>e<>>32-t;function SF(e,t,n,r){return e===0?t^n^r:e===1?t&n|~t&r:e===2?(t|~n)^r:e===3?t&r|n&~r:t^(n|~r)}const v0=new Uint32Array(16);class CV extends q_{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:n,h2:r,h3:i,h4:o}=this;return[t,n,r,i,o]}set(t,n,r,i,o){this.h0=t|0,this.h1=n|0,this.h2=r|0,this.h3=i|0,this.h4=o|0}process(t,n){for(let w=0;w<16;w++,n+=4)v0[w]=t.getUint32(n,!0);let r=this.h0|0,i=r,o=this.h1|0,a=o,u=this.h2|0,l=u,f=this.h3|0,p=f,m=this.h4|0,y=m;for(let w=0;w<5;w++){const b=4-w,x=OV[w],k=NV[w],O=z_[w],N=W_[w],E=RV[w],T=TV[w];for(let B=0;B<16;B++){const A=S0(r+SF(w,o,u,f)+v0[O[B]]+x,E[B])+m|0;r=m,m=f,f=S0(u,10)|0,u=o,o=A}for(let B=0;B<16;B++){const A=S0(i+SF(b,a,l,p)+v0[N[B]]+k,T[B])+y|0;i=y,y=p,p=S0(l,10)|0,l=a,a=A}}this.set(this.h1+u+p|0,this.h2+f+y|0,this.h3+m+i|0,this.h4+r+a|0,this.h0+o+l|0)}roundClean(){v0.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const pM=Sf(()=>new CV),x0=BigInt(2**32-1),v1=BigInt(32);function mM(e,t=!1){return t?{h:Number(e&x0),l:Number(e>>v1&x0)}:{h:Number(e>>v1&x0)|0,l:Number(e&x0)|0}}function EV(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0),FV=(e,t,n)=>e>>>n,IV=(e,t,n)=>e<<32-n|t>>>n,PV=(e,t,n)=>e>>>n|t<<32-n,MV=(e,t,n)=>e<<32-n|t>>>n,LV=(e,t,n)=>e<<64-n|t>>>n-32,BV=(e,t,n)=>e>>>n-32|t<<64-n,jV=(e,t)=>t,DV=(e,t)=>e,JV=(e,t,n)=>e<>>32-n,$V=(e,t,n)=>t<>>32-n,qV=(e,t,n)=>t<>>64-n,UV=(e,t,n)=>e<>>64-n;function HV(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}const zV=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),WV=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,VV=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),GV=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,KV=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),QV=(e,t,n,r,i,o)=>t+n+r+i+o+(e/2**32|0)|0,xt={fromBig:mM,split:EV,toBig:AV,shrSH:FV,shrSL:IV,rotrSH:PV,rotrSL:MV,rotrBH:LV,rotrBL:BV,rotr32H:jV,rotr32L:DV,rotlSH:JV,rotlSL:$V,rotlBH:qV,rotlBL:UV,add:HV,add3L:zV,add3H:WV,add4L:VV,add4H:GV,add5H:QV,add5L:KV},[YV,XV]=xt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),bl=new Uint32Array(80),Sl=new Uint32Array(80);class Zw extends q_{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:n,Bh:r,Bl:i,Ch:o,Cl:a,Dh:u,Dl:l,Eh:f,El:p,Fh:m,Fl:y,Gh:w,Gl:b,Hh:x,Hl:k}=this;return[t,n,r,i,o,a,u,l,f,p,m,y,w,b,x,k]}set(t,n,r,i,o,a,u,l,f,p,m,y,w,b,x,k){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=o|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=f|0,this.El=p|0,this.Fh=m|0,this.Fl=y|0,this.Gh=w|0,this.Gl=b|0,this.Hh=x|0,this.Hl=k|0}process(t,n){for(let E=0;E<16;E++,n+=4)bl[E]=t.getUint32(n),Sl[E]=t.getUint32(n+=4);for(let E=16;E<80;E++){const T=bl[E-15]|0,B=Sl[E-15]|0,A=xt.rotrSH(T,B,1)^xt.rotrSH(T,B,8)^xt.shrSH(T,B,7),U=xt.rotrSL(T,B,1)^xt.rotrSL(T,B,8)^xt.shrSL(T,B,7),v=bl[E-2]|0,R=Sl[E-2]|0,C=xt.rotrSH(v,R,19)^xt.rotrBH(v,R,61)^xt.shrSH(v,R,6),M=xt.rotrSL(v,R,19)^xt.rotrBL(v,R,61)^xt.shrSL(v,R,6),J=xt.add4L(U,M,Sl[E-7],Sl[E-16]),P=xt.add4H(J,A,C,bl[E-7],bl[E-16]);bl[E]=P|0,Sl[E]=J|0}let{Ah:r,Al:i,Bh:o,Bl:a,Ch:u,Cl:l,Dh:f,Dl:p,Eh:m,El:y,Fh:w,Fl:b,Gh:x,Gl:k,Hh:O,Hl:N}=this;for(let E=0;E<80;E++){const T=xt.rotrSH(m,y,14)^xt.rotrSH(m,y,18)^xt.rotrBH(m,y,41),B=xt.rotrSL(m,y,14)^xt.rotrSL(m,y,18)^xt.rotrBL(m,y,41),A=m&w^~m&x,U=y&b^~y&k,v=xt.add5L(N,B,U,XV[E],Sl[E]),R=xt.add5H(v,O,T,A,YV[E],bl[E]),C=v|0,M=xt.rotrSH(r,i,28)^xt.rotrBH(r,i,34)^xt.rotrBH(r,i,39),J=xt.rotrSL(r,i,28)^xt.rotrBL(r,i,34)^xt.rotrBL(r,i,39),P=r&o^r&u^o&u,D=i&a^i&l^a&l;O=x|0,N=k|0,x=w|0,k=b|0,w=m|0,b=y|0,{h:m,l:y}=xt.add(f|0,p|0,R|0,C|0),f=u|0,p=l|0,u=o|0,l=a|0,o=r|0,a=i|0;const q=xt.add3L(C,J,D);r=xt.add3H(q,R,M,P),i=q|0}({h:r,l:i}=xt.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:o,l:a}=xt.add(this.Bh|0,this.Bl|0,o|0,a|0),{h:u,l}=xt.add(this.Ch|0,this.Cl|0,u|0,l|0),{h:f,l:p}=xt.add(this.Dh|0,this.Dl|0,f|0,p|0),{h:m,l:y}=xt.add(this.Eh|0,this.El|0,m|0,y|0),{h:w,l:b}=xt.add(this.Fh|0,this.Fl|0,w|0,b|0),{h:x,l:k}=xt.add(this.Gh|0,this.Gl|0,x|0,k|0),{h:O,l:N}=xt.add(this.Hh|0,this.Hl|0,O|0,N|0),this.set(r,i,o,a,u,l,f,p,m,y,w,b,x,k,O,N)}roundClean(){bl.fill(0),Sl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class ZV extends Zw{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class eG extends Zw{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class tG extends Zw{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const nG=Sf(()=>new Zw);Sf(()=>new ZV);const rG=Sf(()=>new eG);Sf(()=>new tG);var Jm={exports:{}};Jm.exports;var vF;function iG(){return vF||(vF=1,function(e,t){var n=200,r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Array]",u="[object Boolean]",l="[object Date]",f="[object Error]",p="[object Function]",m="[object GeneratorFunction]",y="[object Map]",w="[object Number]",b="[object Object]",x="[object Promise]",k="[object RegExp]",O="[object Set]",N="[object String]",E="[object Symbol]",T="[object WeakMap]",B="[object ArrayBuffer]",A="[object DataView]",U="[object Float32Array]",v="[object Float64Array]",R="[object Int8Array]",C="[object Int16Array]",M="[object Int32Array]",J="[object Uint8Array]",P="[object Uint8ClampedArray]",D="[object Uint16Array]",q="[object Uint32Array]",K=/[\\^$.*+?()[\]{}|]/g,Q=/\w*$/,H=/^\[object .+?Constructor\]$/,X=/^(?:0|[1-9]\d*)$/,I={};I[o]=I[a]=I[B]=I[A]=I[u]=I[l]=I[U]=I[v]=I[R]=I[C]=I[M]=I[y]=I[w]=I[b]=I[k]=I[O]=I[N]=I[E]=I[J]=I[P]=I[D]=I[q]=!0,I[f]=I[p]=I[T]=!1;var te=typeof Yd=="object"&&Yd&&Yd.Object===Object&&Yd,ge=typeof self=="object"&&self&&self.Object===Object&&self,oe=te||ge||Function("return this")(),be=t&&!t.nodeType&&t,ke=be&&!0&&e&&!e.nodeType&&e,Ne=ke&&ke.exports===be;function Xe(j,ue){return j.set(ue[0],ue[1]),j}function Ze(j,ue){return j.add(ue),j}function Nt(j,ue){for(var ye=-1,et=j?j.length:0;++ye-1}function Wn(j,ue){var ye=this.__data__,et=Ef(ye,j);return et<0?ye.push([j,ue]):ye[et][1]=ue,this}ot.prototype.clear=Ke,ot.prototype.delete=Et,ot.prototype.get=Ut,ot.prototype.has=Lt,ot.prototype.set=Wn;function Xn(j){var ue=-1,ye=j?j.length:0;for(this.clear();++ue-1&&j%1==0&&j-1&&j%1==0&&j<=i}function _s(j){var ue=typeof j;return!!j&&(ue=="object"||ue=="function")}function ny(j){return!!j&&typeof j=="object"}function xp(j){return Xg(j)?Wg(j):Mb(j)}function nd(){return[]}function rd(){return!1}e.exports=Uo}(Jm,Jm.exports)),Jm.exports}var oG=iG();const sG=Ju(oG);var we;(function(e){e.Int="int",e.UInt="uint",e.Buffer="buffer",e.BoolTrue="true",e.BoolFalse="false",e.PrincipalStandard="address",e.PrincipalContract="contract",e.ResponseOk="ok",e.ResponseErr="err",e.OptionalNone="none",e.OptionalSome="some",e.List="list",e.Tuple="tuple",e.StringASCII="ascii",e.StringUTF8="utf8"})(we||(we={}));var nr;(function(e){e[e.int=0]="int",e[e.uint=1]="uint",e[e.buffer=2]="buffer",e[e.true=3]="true",e[e.false=4]="false",e[e.address=5]="address",e[e.contract=6]="contract",e[e.ok=7]="ok",e[e.err=8]="err",e[e.none=9]="none",e[e.some=10]="some",e[e.list=11]="list",e[e.tuple=12]="tuple",e[e.ascii=13]="ascii",e[e.utf8=14]="utf8"})(nr||(nr={}));function V_(e){return nr[e]}function Kd(e,t="hex"){switch(e.type){case we.BoolTrue:return"true";case we.BoolFalse:return"false";case we.Int:return e.value.toString();case we.UInt:return`u${e.value.toString()}`;case we.Buffer:if(t==="tryAscii"){const n=AP(rt(e.value));if(/[ -~]/.test(n))return JSON.stringify(n)}return`0x${e.value}`;case we.OptionalNone:return"none";case we.OptionalSome:return`(some ${Kd(e.value,t)})`;case we.ResponseErr:return`(err ${Kd(e.value,t)})`;case we.ResponseOk:return`(ok ${Kd(e.value,t)})`;case we.PrincipalStandard:case we.PrincipalContract:return e.value;case we.List:return`(list ${e.value.map(n=>Kd(n,t)).join(" ")})`;case we.Tuple:return`(tuple ${Object.keys(e.value).map(n=>`(${n} ${Kd(e.value[n],t)})`).join(" ")})`;case we.StringASCII:return`"${e.value}"`;case we.StringUTF8:return`u"${e.value}"`}}function lh(e){switch(e.type){case we.BoolTrue:case we.BoolFalse:return"bool";case we.Int:return"int";case we.UInt:return"uint";case we.Buffer:return`(buff ${Math.ceil(e.value.length/2)})`;case we.OptionalNone:return"(optional none)";case we.OptionalSome:return`(optional ${lh(e.value)})`;case we.ResponseErr:return`(response UnknownType ${lh(e.value)})`;case we.ResponseOk:return`(response ${lh(e.value)} UnknownType)`;case we.PrincipalStandard:case we.PrincipalContract:return"principal";case we.List:return`(list ${e.value.length} ${e.value.length?lh(e.value[0]):"UnknownType"})`;case we.Tuple:return`(tuple ${Object.keys(e.value).map(t=>`(${t} ${lh(e.value[t])})`).join(" ")})`;case we.StringASCII:return`(string-ascii ${EP(e.value).length})`;case we.StringUTF8:return`(string-utf8 ${as(e.value).length})`}}const aG=()=>({type:we.BoolTrue}),cG=()=>({type:we.BoolFalse}),kr=e=>{if(e.byteLength>1048576)throw new Error("Cannot construct clarity buffer that is greater than 1MB");return{type:we.Buffer,value:at(e)}},xF=BigInt("0xffffffffffffffffffffffffffffffff"),uG=BigInt(0),_F=BigInt("0x7fffffffffffffffffffffffffffffff"),kF=BigInt("-170141183460469231731687303715884105728"),lG=e=>{typeof e=="string"&&e.toLowerCase().startsWith("0x")&&(e=p1(rt(e))),ai(e,Uint8Array)&&(e=p1(e));const t=Yt(e);if(t>_F)throw new RangeError(`Cannot construct clarity integer from value greater than ${_F}`);if(t{const t=Yt(e);if(txF)throw new RangeError(`Cannot construct unsigned clarity integer greater than ${xF}`);return{type:we.UInt,value:t}};function dG(e){return{type:we.List,value:e}}function Rr(){return{type:we.OptionalNone}}function Xi(e){return{type:we.OptionalSome,value:e}}var qe;(function(e){e[e.Address=0]="Address",e[e.Principal=1]="Principal",e[e.LengthPrefixedString=2]="LengthPrefixedString",e[e.MemoString=3]="MemoString",e[e.Asset=4]="Asset",e[e.PostCondition=5]="PostCondition",e[e.PublicKey=6]="PublicKey",e[e.LengthPrefixedList=7]="LengthPrefixedList",e[e.Payload=8]="Payload",e[e.MessageSignature=9]="MessageSignature",e[e.StructuredDataSignature=10]="StructuredDataSignature",e[e.TransactionAuthField=11]="TransactionAuthField"})(qe||(qe={}));function fG(){return{type:qe.Address,version:Ao.MainnetSingleSig,hash160:"0".repeat(40)}}function RF(e){if(e&&RM(e,ow))throw new Error(`Memo exceeds maximum length of ${ow} bytes`);return{type:qe.MemoString,content:e}}function eb(e,t){return{type:qe.LengthPrefixedList,lengthPrefixBytes:4,values:e}}function x1(e){if(rt(e).byteLength!=Fg)throw Error("Invalid signature");return{type:qe.MessageSignature,data:e}}function hG(e,t,n){return typeof e=="string"&&(e=no(e)),typeof n=="string"&&(n=RF(n)),{type:qe.Payload,payloadType:en.TokenTransfer,recipient:e,amount:Yt(t),memo:n??RF("")}}function gM(e,t,n,r){return typeof t=="string"&&(t=Bo(t)),typeof n=="string"&&(n=Bo(n)),{type:qe.Payload,payloadType:en.ContractCall,contractAddress:typeof e=="string"?gs(e):e,contractName:t,functionName:n,functionArgs:r}}function pG(e){return Bo(e,4,1e5)}function TF(e,t,n){return typeof e=="string"&&(e=Bo(e)),typeof t=="string"&&(t=pG(t)),typeof n=="number"?{type:qe.Payload,payloadType:en.VersionedSmartContract,clarityVersion:n,contractName:e,codeBody:t}:{type:qe.Payload,payloadType:en.SmartContract,contractName:e,codeBody:t}}function mG(){return{type:qe.Payload,payloadType:en.PoisonMicroblock}}function OF(e,t){if(e.byteLength!=rf)throw Error(`Coinbase buffer size must be ${rf} bytes`);return t!=null?{type:qe.Payload,payloadType:en.CoinbaseToAltRecipient,coinbaseBytes:e,recipient:t}:{type:qe.Payload,payloadType:en.Coinbase,coinbaseBytes:e}}function gG(e,t,n){if(e.byteLength!=rf)throw Error(`Coinbase buffer size must be ${rf} bytes`);if(n.byteLength!=m1)throw Error(`VRF proof buffer size must be ${m1} bytes`);return{type:qe.Payload,payloadType:en.NakamotoCoinbase,coinbaseBytes:e,recipient:t.type===we.OptionalSome?t.value:void 0,vrfProof:n}}function yG(e,t,n,r,i,o,a){return{type:qe.Payload,payloadType:en.TenureChange,tenureHash:e,previousTenureHash:t,burnViewHash:n,previousTenureEnd:r,previousTenureBlocks:i,cause:o,publicKeyHash:a}}function Bo(e,t,n){const r=t||1,i=n||UW;if(RM(e,i))throw new Error(`String length exceeds maximum bytes ${i}`);return{type:qe.LengthPrefixedString,content:e,lengthPrefixBytes:r,maxLengthBytes:i}}function wG(e,t,n){return{type:qe.Asset,address:gs(e),contractName:Bo(t),assetName:Bo(n)}}function gs(e){const t=Xw.c32addressDecode(e);return{type:qe.Address,version:t[0],hash160:t[1]}}function bG(e,t){const n=gs(e),r=Bo(t);return{type:qe.Principal,prefix:Ai.Contract,address:n,contractName:r}}function SG(e){const t=gs(e);return{type:qe.Principal,prefix:Ai.Standard,address:t}}function bh(e,t){return{pubKeyEncoding:e,type:qe.TransactionAuthField,contents:t}}function ku(e){switch(e.type){case qe.Address:return Mg(e);case qe.Principal:return yM(e);case qe.LengthPrefixedString:return Wh(e);case qe.MemoString:return xG(e);case qe.Asset:return bM(e);case qe.PostCondition:return vM(e);case qe.PublicKey:return R1(e);case qe.LengthPrefixedList:return G_(e);case qe.Payload:return K_(e);case qe.TransactionAuthField:return OG(e);case qe.MessageSignature:return Q_(e)}}function Mg(e){const t=[];return t.push(rt(Cg(e.version,1))),t.push(rt(e.hash160)),Hn(t)}function zh(e){const t=ai(e,fn)?e:new fn(e),n=Hw(at(t.readBytes(1))),r=at(t.readBytes(20));return{type:qe.Address,version:n,hash160:r}}function yM(e){const t=[];return t.push(e.prefix),(e.prefix===Ai.Standard||e.prefix===Ai.Contract)&&t.push(Mg(e.address)),e.prefix===Ai.Contract&&t.push(Wh(e.contractName)),Hn(t)}function vG(e){const t=ai(e,fn)?e:new fn(e),n=t.readUInt8Enum(Ai,o=>{throw new Ci(`Unexpected Principal payload type: ${o}`)});if(n===Ai.Origin)return{type:qe.Principal,prefix:n};const r=zh(t);if(n===Ai.Standard)return{type:qe.Principal,prefix:n,address:r};const i=to(t);return{type:qe.Principal,prefix:n,address:r,contractName:i}}function Wh(e){const t=[],n=as(e.content),r=n.byteLength;return t.push(rt(Cg(r,e.lengthPrefixBytes))),t.push(n),Hn(t)}function to(e,t,n){t=t||1;const r=ai(e,fn)?e:new fn(e),i=Hw(at(r.readBytes(t))),o=Eg(r.readBytes(i));return Bo(o,t,n??128)}function xG(e){const t=[],n=as(e.content),r=WG(at(n),ow*2);return t.push(rt(r)),Hn(t)}function wM(e){const t=ai(e,fn)?e:new fn(e);let n=Eg(t.readBytes(ow));return n=n.replace(/\u0000*$/,""),{type:qe.MemoString,content:n}}function bM(e){const t=[];return t.push(Mg(e.address)),t.push(Wh(e.contractName)),t.push(Wh(e.assetName)),Hn(t)}function _1(e){const t=ai(e,fn)?e:new fn(e);return{type:qe.Asset,address:zh(t),contractName:to(t),assetName:to(t)}}function G_(e){const t=e.values,n=[];n.push(rt(Cg(t.length,e.lengthPrefixBytes)));for(const r of t)n.push(ku(r));return Hn(n)}function SM(e,t,n){const r=ai(e,fn)?e:new fn(e),i=Hw(at(r.readBytes(4))),o=[];for(let a=0;aBigInt("0xffffffffffffffff"))throw new wh("The post-condition amount may not be larger than 8 bytes");t.push(Ml(e.amount,8))}return Hn(t)}function kG(e){const t=ai(e,fn)?e:new fn(e),n=t.readUInt8Enum(Or,u=>{throw new Ci(`Could not read ${u} as PostConditionType`)}),r=vG(t);let i,o,a;switch(n){case Or.STX:return i=t.readUInt8Enum(Cu,l=>{throw new Ci(`Could not read ${l} as FungibleConditionCode`)}),a=BigInt(`0x${at(t.readBytes(8))}`),{type:qe.PostCondition,conditionType:Or.STX,principal:r,conditionCode:i,amount:a};case Or.Fungible:return o=_1(t),i=t.readUInt8Enum(Cu,l=>{throw new Ci(`Could not read ${l} as FungibleConditionCode`)}),a=BigInt(`0x${at(t.readBytes(8))}`),{type:qe.PostCondition,conditionType:Or.Fungible,principal:r,conditionCode:i,amount:a,asset:o};case Or.NonFungible:o=_1(t);const u=Co(t);return i=t.readUInt8Enum(ug,l=>{throw new Ci(`Could not read ${l} as FungibleConditionCode`)}),{type:qe.PostCondition,conditionType:Or.NonFungible,principal:r,conditionCode:i,asset:o,assetName:u}}}function K_(e){const t=[];switch(t.push(e.payloadType),e.payloadType){case en.TokenTransfer:t.push(Io(e.recipient)),t.push(Ml(e.amount,8)),t.push(ku(e.memo));break;case en.ContractCall:t.push(ku(e.contractAddress)),t.push(ku(e.contractName)),t.push(ku(e.functionName));const n=new Uint8Array(4);ff(n,e.functionArgs.length,0),t.push(n),e.functionArgs.forEach(r=>{t.push(Io(r))});break;case en.SmartContract:t.push(ku(e.contractName)),t.push(ku(e.codeBody));break;case en.VersionedSmartContract:t.push(e.clarityVersion),t.push(ku(e.contractName)),t.push(ku(e.codeBody));break;case en.PoisonMicroblock:break;case en.Coinbase:t.push(e.coinbaseBytes);break;case en.CoinbaseToAltRecipient:t.push(e.coinbaseBytes),t.push(Io(e.recipient));break;case en.NakamotoCoinbase:t.push(e.coinbaseBytes),t.push(Io(e.recipient?Xi(e.recipient):Rr())),t.push(e.vrfProof);break;case en.TenureChange:t.push(rt(e.tenureHash)),t.push(rt(e.previousTenureHash)),t.push(rt(e.burnViewHash)),t.push(rt(e.previousTenureEnd)),t.push(ff(new Uint8Array(4),e.previousTenureBlocks)),t.push(Dm(new Uint8Array(1),e.cause)),t.push(rt(e.publicKeyHash));break}return Hn(t)}function RG(e){const t=ai(e,fn)?e:new fn(e);switch(t.readUInt8Enum(en,r=>{throw new Error(`Cannot recognize PayloadType: ${r}`)})){case en.TokenTransfer:const r=Co(t),i=Yt(t.readBytes(8)),o=wM(t);return hG(r,i,o);case en.ContractCall:const a=zh(t),u=to(t),l=to(t),f=[],p=t.readUInt32BE();for(let T=0;T{throw new Error(`Cannot recognize ClarityVersion: ${U}`)}),B=to(t),A=to(t,4,1e5);return TF(B,A,T)}case en.PoisonMicroblock:return mG();case en.Coinbase:{const T=t.readBytes(rf);return OF(T)}case en.CoinbaseToAltRecipient:{const T=t.readBytes(rf),B=Co(t);return OF(T,B)}case en.NakamotoCoinbase:{const T=t.readBytes(rf),B=Co(t),A=t.readBytes(m1);return gG(T,B,A)}case en.TenureChange:const w=at(t.readBytes(20)),b=at(t.readBytes(20)),x=at(t.readBytes(20)),k=at(t.readBytes(32)),O=t.readUInt32BE(),N=t.readUInt8Enum(y1,T=>{throw new Error(`Cannot recognize TenureChangeCause: ${T}`)}),E=at(t.readBytes(20));return yG(w,b,x,k,O,N,E)}}function k1(e){const t=ai(e,fn)?e:new fn(e);return x1(at(t.readBytes(Fg)))}function TG(e){const t=ai(e,fn)?e:new fn(e),n=t.readUInt8Enum(No,r=>{throw new Ci(`Could not read ${r} as AuthFieldType`)});switch(n){case No.PublicKeyCompressed:return bh(_n.Compressed,T1(t));case No.PublicKeyUncompressed:return bh(_n.Uncompressed,us(rK(T1(t).data)));case No.SignatureCompressed:return bh(_n.Compressed,k1(t));case No.SignatureUncompressed:return bh(_n.Uncompressed,k1(t));default:throw new Error(`Unknown auth field type: ${JSON.stringify(n)}`)}}function Q_(e){return rt(e.data)}function OG(e){const t=[];switch(e.contents.type){case qe.PublicKey:t.push(e.pubKeyEncoding===_n.Compressed?No.PublicKeyCompressed:No.PublicKeyUncompressed),t.push(rt(nK(e.contents.data)));break;case qe.MessageSignature:t.push(e.pubKeyEncoding===_n.Compressed?No.SignatureCompressed:No.SignatureUncompressed),t.push(Q_(e.contents));break}return Hn(t)}function R1(e){return e.data.slice()}function T1(e){const t=ai(e,fn)?e:new fn(e),n=t.readUInt8(),r=n===4?WW:zW;return us(Hn([n,t.readBytes(r)]))}function Vh(e,t,n,r){if(r.length===0)throw Error("Invalid number of public keys");if((t===vt.P2PKH||t===vt.P2WPKH)&&(r.length!==1||n!==1))throw Error("Invalid number of public keys or signatures");if((t===vt.P2WPKH||t===vt.P2WSH||t===vt.P2WSHNonSequential)&&!r.map(i=>i.data).every(ap))throw Error("Public keys must be compressed for segwit");switch(t){case vt.P2PKH:return $m(e,TM(r[0].data));case vt.P2WPKH:return $m(e,VG(r[0].data));case vt.P2SH:case vt.P2SHNonSequential:return $m(e,GG(n,r.map(R1)));case vt.P2WSH:case vt.P2WSHNonSequential:return $m(e,KG(n,r.map(R1)))}}function $m(e,t){return{type:qe.Address,version:e,hash160:t}}function tb(e){return Xw.c32address(e.version,e.hash160)}function NF(e){const[t,n,r]=e.split(/\.|::/);return wG(t,n,r)}function dx(e){if(e.includes(".")){const[t,n]=e.split(".");return bG(t,n)}else return SG(e)}function no(e){if(e.includes(".")){const[t,n]=e.split(".");return xM(t,n)}else return NG(e)}function NG(e){const t=gs(e);return{type:we.PrincipalStandard,value:tb(t)}}function CG(e){return{type:we.PrincipalStandard,value:tb(e)}}function xM(e,t){const n=gs(e),r=Bo(t);return _M(n,r)}function _M(e,t){if(as(t.content).byteLength>=128)throw new Error("Contract name must be less than 128 bytes");return{type:we.PrincipalContract,value:`${tb(e)}.${t.content}`}}function EG(e){return{type:we.ResponseErr,value:e}}function AG(e){return{type:we.ResponseOk,value:e}}const Qm=e=>({type:we.StringASCII,value:e}),FG=e=>({type:we.StringUTF8,value:e});function uw(e){for(const t in e)if(!QG(t))throw new Error(`"${t}" is not a valid Clarity name`);return{type:we.Tuple,value:e}}function Co(e){let t;if(typeof e=="string"){const r=e.slice(0,2).toLowerCase()==="0x";t=new fn(rt(r?e.slice(2):e))}else e instanceof Uint8Array?t=new fn(e):t=e;switch(t.readUInt8Enum(nr,r=>{throw new Ci(`Cannot recognize Clarity Type: ${r}`)})){case nr.int:return lG(p1(t.readBytes(16)));case nr.uint:return ft(t.readBytes(16));case nr.buffer:const r=t.readUInt32BE();return kr(t.readBytes(r));case nr.true:return aG();case nr.false:return cG();case nr.address:const i=zh(t);return CG(i);case nr.contract:const o=zh(t),a=to(t);return _M(o,a);case nr.ok:return AG(Co(t));case nr.err:return EG(Co(t));case nr.none:return Rr();case nr.some:return Xi(Co(t));case nr.list:const u=t.readUInt32BE(),l=[];for(let x=0;xi.localeCompare(o));for(const i of r){const o=Bo(i);t.push(Wh(o));const a=Io(e.value[i]);t.push(a)}return ys(e.type,Hn(t))}function kM(e,t){const n=[],r=t=="ascii"?EP(e.value):as(e.value),i=new Uint8Array(4);return ff(i,r.length,0),n.push(i),n.push(r),ys(e.type,Hn(n))}function UG(e){return kM(e,"ascii")}function HG(e){return kM(e,"utf8")}function lw(e){return at(Io(e))}function Io(e){switch(e.type){case we.BoolTrue:case we.BoolFalse:return IG(e);case we.OptionalNone:case we.OptionalSome:return PG(e);case we.Buffer:return MG(e);case we.UInt:return BG(e);case we.Int:return LG(e);case we.PrincipalStandard:return jG(e);case we.PrincipalContract:return DG(e);case we.ResponseOk:case we.ResponseErr:return JG(e);case we.List:return $G(e);case we.Tuple:return qG(e);case we.StringASCII:return UG(e);case we.StringUTF8:return HG(e);default:throw new wh("Unable to serialize. Invalid Clarity Value.")}}const zG=e=>e.length%2?`0${e}`:e,WG=(e,t)=>e.padEnd(t,"0"),RM=(e,t)=>e?as(e).length>t:!1;function Al(e){return sG(e)}function CF(e,t){const n=Al(e);return delete n[t],n}const fg=e=>pM(Jr(e)),Y_=e=>at(rG(e)),TM=e=>at(fg(e)),VG=e=>{const t=fg(e),n=so(new Uint8Array([0]),new Uint8Array([t.length]),t),r=fg(n);return at(r)},GG=(e,t)=>{if(e>15||t.length>15)throw Error("P2SH multisig address can only contain up to 15 public keys");const n=[];n.push(80+e),t.forEach(o=>{n.push(o.length),n.push(o)}),n.push(80+t.length),n.push(174);const r=Hn(n),i=fg(r);return at(i)},KG=(e,t)=>{if(e>15||t.length>15)throw Error("P2WSH multisig address can only contain up to 15 public keys");const n=[];n.push(80+e),t.forEach(l=>{n.push(l.length),n.push(l)}),n.push(80+t.length),n.push(174);const r=Hn(n),i=Jr(r),o=[];o.push(0),o.push(i.length),o.push(i);const a=Hn(o),u=fg(a);return at(u)};function QG(e){return/^[a-zA-Z]([a-zA-Z0-9]|[-_!?+<>=/*])*$|^[-+=/*]$|^[<>]=?$/.test(e)&&e.length<128}function YG(e){return`0x${lw(e)}`}function sp(e){return Co(e)}const XG=e=>{if(e.okay)return sp(e.result);throw new Error(e.cause)},vf=e=>{try{return Xw.c32addressDecode(e),!0}catch{return!1}};function ZG(e){const[t,n]=e.split(".");if(!t||!n)throw new Error(`Invalid contract identifier: ${e}`);return[t,n]}ri.hmacSha256Sync=(e,...t)=>{const n=Pg.create(Jr,e);return t.forEach(r=>n.update(r)),n.digest()};function eK(e,t="mainnet"){t=mr(t),e=typeof e=="string"?rt(e):e;const n=xV(vt.P2PKH,t),r=$m(n,TM(e));return tb(r)}function us(e){return e=typeof e=="string"?rt(e):e,{type:qe.PublicKey,data:e}}function tK(e,t,n=_n.Compressed){const r=FP(t),i=new Lo(nw(r.r),nw(r.s)),o=Kt.fromSignature(e,i,r.recoveryId),a=n===_n.Compressed;return o.toHex(a)}function OM(e){return typeof e=="string"?e:at(e)}const Gh=OM;function NM(e){return(typeof e=="string"?e.length/2:e.byteLength)===Uz}function ap(e){return!Gh(e).startsWith("04")}function X_(e){e=B_(e);const t=NM(e);return at(H_(e.slice(0,32),t))}function nK(e){return Kt.fromHex(Gh(e)).toHex(!0)}function rK(e){return Kt.fromHex(Gh(e)).toHex(!1)}function CM(e,t){e=B_(e);const[n,r]=aM(t,e.slice(0,32),{canonical:!0,recovered:!0});if(r==null)throw new Error("No signature recoveryId received");return Cg(r,1)+Lo.fromHex(n).toCompactHex()}function iK({messageHash:e,privateKey:t}){return Hz(CM(t,e))}function Z_(){return{type:qe.MessageSignature,data:at(new Uint8Array(Fg))}}function ek(e,t,n,r){const i=Vh(0,e,1,[us(t)]).hash160,o=ap(t)?_n.Compressed:_n.Uncompressed;return{hashMode:e,signer:i,nonce:Yt(n),fee:Yt(r),keyEncoding:o,signature:Z_()}}function oK(e,t,n,r,i){const o=n.map(us),a=Vh(0,e,t,o).hash160;return{hashMode:e,signer:a,nonce:Yt(r),fee:Yt(i),fields:[],signaturesRequired:t}}function Ll(e){return"signature"in e}function O1(e){return e===vt.P2SH||e===vt.P2WSH}function EM(e){return e===vt.P2SHNonSequential||e===vt.P2WSHNonSequential}function EF(e){const t=Al(e);return t.nonce=0,t.fee=0,Ll(t)?t.signature=Z_():t.fields=[],{...t,nonce:BigInt(0),fee:BigInt(0)}}function sK(e){const t=[e.hashMode,rt(e.signer),Ml(e.nonce,8),Ml(e.fee,8),e.keyEncoding,Q_(e.signature)];return Hn(t)}function aK(e){const t=[e.hashMode,rt(e.signer),Ml(e.nonce,8),Ml(e.fee,8)],n=eb(e.fields);t.push(G_(n));const r=new Uint8Array(2);return Vz(r,e.signaturesRequired,0),t.push(r),Hn(t)}function cK(e,t){const n=at(t.readBytes(20)),r=BigInt(`0x${at(t.readBytes(8))}`),i=BigInt(`0x${at(t.readBytes(8))}`),o=t.readUInt8Enum(_n,u=>{throw new Ci(`Could not parse ${u} as PubKeyEncoding`)});if(e===vt.P2WPKH&&o!=_n.Compressed)throw new Ci("Failed to parse singlesig spending condition: incomaptible hash mode and key encoding");const a=k1(t);return{hashMode:e,signer:n,nonce:r,fee:i,keyEncoding:o,signature:a}}function uK(e,t){const n=at(t.readBytes(20)),r=BigInt("0x"+at(t.readBytes(8))),i=BigInt("0x"+at(t.readBytes(8))),o=SM(t,qe.TransactionAuthField).values;let a=!1,u=0;for(const f of o)switch(f.contents.type){case qe.PublicKey:ap(f.contents.data)||(a=!0);break;case qe.MessageSignature:if(f.pubKeyEncoding===_n.Uncompressed&&(a=!0),u+=1,u===65536)throw new ef("Failed to parse multisig spending condition: too many signatures");break}const l=t.readUInt16BE();if(a&&(e===vt.P2WSH||e===vt.P2WSHNonSequential))throw new ef("Uncompressed keys are not allowed in this hash mode");return{hashMode:e,signer:n,nonce:r,fee:i,fields:o,signaturesRequired:l}}function fx(e){return Ll(e)?sK(e):aK(e)}function hx(e){const t=e.readUInt8Enum(vt,n=>{throw new Ci(`Could not parse ${n} as AddressHashMode`)});return t===vt.P2PKH||t===vt.P2WPKH?cK(t,e):uK(t,e)}function AM(e,t,n,r){const o=e+at(new Uint8Array([t]))+at(Ml(n,8))+at(Ml(r,8));if(rt(o).byteLength!==49)throw Error("Invalid signature hash length");return Y_(rt(o))}function FM(e,t,n){const r=33+Fg,i=ap(t.data)?_n.Compressed:_n.Uncompressed,o=e+zG(i.toString(16))+n,a=rt(o);if(a.byteLength>r)throw Error("Invalid signature hash length");return Y_(a)}function lK(e,t,n,r,i){const o=AM(e,t,n,r),a=CM(i,o),u=us(X_(i)),l=FM(o,u,a);return{nextSig:a,nextSigHash:l}}function tk(e,t,n,r,i,o){const a=AM(e,t,n,r),u=us(tK(a,o,i)),l=FM(a,u,o);return{pubKey:u,nextSigHash:l}}function dK(){const e=ek(vt.P2PKH,"",0,0);return e.signer=fG().hash160,e.keyEncoding=_n.Compressed,e.signature=Z_(),e}function AF(e,t,n){return Ll(e)?fK(e,t,n):hK(e,t,n)}function fK(e,t,n){const{pubKey:r,nextSigHash:i}=tk(t,n,e.fee,e.nonce,e.keyEncoding,e.signature.data),o=Vh(0,e.hashMode,1,[r]).hash160;if(o!==e.signer)throw new ef(`Signer hash does not equal hash of public key(s): ${o} != ${e.signer}`);return i}function hK(e,t,n){const r=[];let i=t,o=!1,a=0;for(const l of e.fields)switch(l.contents.type){case qe.PublicKey:ap(l.contents.data)||(o=!0),r.push(l.contents);break;case qe.MessageSignature:l.pubKeyEncoding===_n.Uncompressed&&(o=!0);const{pubKey:f,nextSigHash:p}=tk(i,n,e.fee,e.nonce,l.pubKeyEncoding,l.contents.data);if(O1(e.hashMode)&&(i=p),r.push(f),a+=1,a===65536)throw new ef("Too many signatures");break}if(O1(e.hashMode)&&a!==e.signaturesRequired||EM(e.hashMode)&&a{throw new Ci(`Could not parse ${r} as AuthType`)});let n;switch(t){case un.Standard:return n=hx(e),nk(n);case un.Sponsored:n=hx(e);const r=hx(e);return rk(n,r)}}var Gt;(function(e){e[e.ClarityAbiTypeUInt128=1]="ClarityAbiTypeUInt128",e[e.ClarityAbiTypeInt128=2]="ClarityAbiTypeInt128",e[e.ClarityAbiTypeBool=3]="ClarityAbiTypeBool",e[e.ClarityAbiTypePrincipal=4]="ClarityAbiTypePrincipal",e[e.ClarityAbiTypeNone=5]="ClarityAbiTypeNone",e[e.ClarityAbiTypeBuffer=6]="ClarityAbiTypeBuffer",e[e.ClarityAbiTypeResponse=7]="ClarityAbiTypeResponse",e[e.ClarityAbiTypeOptional=8]="ClarityAbiTypeOptional",e[e.ClarityAbiTypeTuple=9]="ClarityAbiTypeTuple",e[e.ClarityAbiTypeList=10]="ClarityAbiTypeList",e[e.ClarityAbiTypeStringAscii=11]="ClarityAbiTypeStringAscii",e[e.ClarityAbiTypeStringUtf8=12]="ClarityAbiTypeStringUtf8",e[e.ClarityAbiTypeTraitReference=13]="ClarityAbiTypeTraitReference"})(Gt||(Gt={}));const IM=e=>typeof e=="string",PM=e=>e.buffer!==void 0,MM=e=>e["string-ascii"]!==void 0,LM=e=>e["string-utf8"]!==void 0,BM=e=>e.response!==void 0,jM=e=>e.optional!==void 0,DM=e=>e.tuple!==void 0,JM=e=>e.list!==void 0;function xK(e){if(IM(e)){if(e==="uint128")return{id:Gt.ClarityAbiTypeUInt128,type:e};if(e==="int128")return{id:Gt.ClarityAbiTypeInt128,type:e};if(e==="bool")return{id:Gt.ClarityAbiTypeBool,type:e};if(e==="principal")return{id:Gt.ClarityAbiTypePrincipal,type:e};if(e==="trait_reference")return{id:Gt.ClarityAbiTypeTraitReference,type:e};if(e==="none")return{id:Gt.ClarityAbiTypeNone,type:e};throw new Error(`Unexpected Clarity ABI type primitive: ${JSON.stringify(e)}`)}else{if(PM(e))return{id:Gt.ClarityAbiTypeBuffer,type:e};if(BM(e))return{id:Gt.ClarityAbiTypeResponse,type:e};if(jM(e))return{id:Gt.ClarityAbiTypeOptional,type:e};if(DM(e))return{id:Gt.ClarityAbiTypeTuple,type:e};if(JM(e))return{id:Gt.ClarityAbiTypeList,type:e};if(MM(e))return{id:Gt.ClarityAbiTypeStringAscii,type:e};if(LM(e))return{id:Gt.ClarityAbiTypeStringUtf8,type:e};throw new Error(`Unexpected Clarity ABI type: ${JSON.stringify(e)}`)}}function dh(e){if(IM(e))return e==="int128"?"int":e==="uint128"?"uint":e;if(PM(e))return`(buff ${e.buffer.length})`;if(MM(e))return`(string-ascii ${e["string-ascii"].length})`;if(LM(e))return`(string-utf8 ${e["string-utf8"].length})`;if(BM(e))return`(response ${dh(e.response.ok)} ${dh(e.response.error)})`;if(jM(e))return`(optional ${dh(e.optional)})`;if(DM(e))return`(tuple ${e.tuple.map(t=>`(${t.name} ${dh(t.type)})`).join(" ")})`;if(JM(e))return`(list ${e.list.length} ${dh(e.list.type)})`;throw new Error(`Type string unsupported for Clarity type: ${JSON.stringify(e)}`)}function fh(e,t){const n=xK(t);switch(e.type){case we.BoolTrue:case we.BoolFalse:return n.id===Gt.ClarityAbiTypeBool;case we.Int:return n.id===Gt.ClarityAbiTypeInt128;case we.UInt:return n.id===Gt.ClarityAbiTypeUInt128;case we.Buffer:return n.id===Gt.ClarityAbiTypeBuffer&&n.type.buffer.length>=Math.ceil(e.value.length/2);case we.StringASCII:return n.id===Gt.ClarityAbiTypeStringAscii&&n.type["string-ascii"].length>=e.value.length;case we.StringUTF8:return n.id===Gt.ClarityAbiTypeStringUtf8&&n.type["string-utf8"].length>=e.value.length;case we.OptionalNone:return n.id===Gt.ClarityAbiTypeNone||n.id===Gt.ClarityAbiTypeOptional;case we.OptionalSome:return n.id===Gt.ClarityAbiTypeOptional&&fh(e.value,n.type.optional);case we.ResponseErr:return n.id===Gt.ClarityAbiTypeResponse&&fh(e.value,n.type.response.error);case we.ResponseOk:return n.id===Gt.ClarityAbiTypeResponse&&fh(e.value,n.type.response.ok);case we.PrincipalContract:return n.id===Gt.ClarityAbiTypePrincipal||n.id===Gt.ClarityAbiTypeTraitReference;case we.PrincipalStandard:return n.id===Gt.ClarityAbiTypePrincipal;case we.List:return n.id==Gt.ClarityAbiTypeList&&n.type.list.length>=e.value.length&&e.value.every(r=>fh(r,n.type.list.type));case we.Tuple:if(n.id==Gt.ClarityAbiTypeTuple){const r=Al(e.value);for(let i=0;ir.name===e.functionName.content);if(n.length===1){const i=n[0].args;if(e.functionArgs.length!==i.length)throw new Error(`Clarity function expects ${i.length} argument(s) but received ${e.functionArgs.length}`);for(let o=0;o{throw new Error(`Could not parse ${p} as TransactionVersion`)}),r=t.readUInt32BE(),i=vK(t),o=t.readUInt8Enum(Ri,p=>{throw new Error(`Could not parse ${p} as AnchorMode`)}),a=t.readUInt8Enum(hf,p=>{throw new Error(`Could not parse ${p} as PostConditionMode`)}),u=SM(t,qe.PostCondition),l=RG(t),f=new $M({transactionVersion:n,chainId:r,auth:i,payload:l,postConditions:u,postConditionMode:a});return f.anchorMode=o,f}function ik(e){return Rz(e.transactionVersion)({[Ni.Mainnet]:Ag,[Ni.Testnet]:ag})}function RK(e){const t=e.auth.spendingCondition.hashMode;if([vt.P2SH,vt.P2WSH].includes(t)){const r=e.auth.spendingCondition,i=r.fields.filter(a=>a.contents.type===qe.MessageSignature).length,o=(r.signaturesRequired-i)*(Fg+1);return e.serializeBytes().byteLength+o}else return e.serializeBytes().byteLength}const TK="/v2/transactions",OK="/v2/fees/transfer",NK="/v2/fees/transaction",CK="/v2/accounts",EK="/v2/contracts/interface",AK="/v2/contracts/call-read";async function So({transaction:e,attachment:t,network:n,client:r}){const i=e.serialize(),o=t?typeof t=="string"?t:at(t):void 0,u={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t?{tx:i,attachment:o}:{tx:i})},l=n??ik(e),f=Object.assign({},hs(mr(l)),r),p=`${f.baseUrl}${TK}`,m=await f.fetch(p,u);if(!m.ok)try{return await m.json()}catch(b){throw Error("Failed to broadcast transaction (unable to parse node response).",{cause:b})}const y=await m.text(),w=y.replace(/["]+/g,"");if(!jz(w))throw new Error(y);return{txid:w}}async function FK({address:e,network:t="mainnet",client:n}){const r=Object.assign({},hs(mr(t)),n),i=`${r.baseUrl}/extended/v1/address/${e}/nonces`,a=await(await r.fetch(i)).json();return BigInt(a.possible_next_nonce)}async function IK(e){try{return await FK(e)}catch{}const t=mr(e.network??"mainnet"),n=Object.assign({},hs(t),e.client),r=`${n.baseUrl}${CK}/${e.address}?proof=0`,i=await n.fetch(r);if(!i.ok){const a=await i.text().catch(()=>"");throw new Error(`Error fetching nonce. Response ${i.status}: ${i.statusText}. Attempted to fetch ${r} and failed with the message: "${a}"`)}const o=await i.json();return BigInt(o.nonce)}async function PK({transaction:e,network:t,client:n}){const r=t??ik(e),i=Object.assign({},hs(mr(r)),n),o=`${i.baseUrl}${OK}`,a=await i.fetch(o,{headers:{Accept:"application/text"}});if(!a.ok){const p=await a.text().catch(()=>"");throw new Error(`Error estimating transfer fee. Response ${a.status}: ${a.statusText}. Attempted to fetch ${o} and failed with the message: "${p}"`)}const u=await a.text(),l=BigInt(Math.ceil(e.serializeBytes().byteLength));return BigInt(u)*l}async function MK({payload:e,estimatedLength:t,network:n="mainnet",client:r}){var p;const o={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({transaction_payload:e,estimated_len:t})},a=Object.assign({},hs(mr(n)),r),u=`${a.baseUrl}${NK}`,l=await a.fetch(u,o);if(!l.ok){const m=await l.json().catch(()=>({}));throw(m==null?void 0:m.reason)==="NoEstimateAvailable"?new QP(((p=m==null?void 0:m.reason_data)==null?void 0:p.message)??""):new Error(`Error estimating transaction fee. Response ${l.status}: ${l.statusText}. Attempted to fetch ${u} and failed with the message: "${m}"`)}return(await l.json()).estimations}async function LK({transaction:e,network:t,client:n}){const r=t??ik(e),i=Object.assign({},hs(mr(r)),n);try{const o=RK(e);return(await MK({payload:at(K_(e.payload)),estimatedLength:o,network:r,client:i}))[1].fee}catch(o){if(!(o instanceof QP))throw o;return await PK({transaction:e,network:r})}}async function BK({contractAddress:e,contractName:t,network:n="mainnet",client:r}){const i=Object.assign({},hs(mr(n)),r),o=`${i.baseUrl}${EK}/${e}/${t}`,a=await i.fetch(o);if(!a.ok){const u=await a.text().catch(()=>"");throw new Error(`Error fetching contract ABI for contract "${t}" at address ${e}. Response ${a.status}: ${a.statusText}. Attempted to fetch ${o} and failed with the message: "${u}"`)}return JSON.parse(await a.text())}async function hh({contractName:e,contractAddress:t,functionName:n,functionArgs:r,senderAddress:i,network:o="mainnet",client:a}){const u={sender:i,arguments:r.map(w=>YG(w))},l={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)},f=encodeURIComponent(n),p=Object.assign({},hs(mr(o)),a),m=`${p.baseUrl}${AK}/${t}/${e}/${f}`,y=await p.fetch(m,l);if(!y.ok){const w=await y.text().catch(()=>"");throw new Error(`Error calling read-only function. Response ${y.status}: ${y.statusText}. Attempted to fetch ${m} and failed with the message: "${w}"`)}return await y.json().then(XG)}const IF={eq:Cu.Equal,gt:Cu.Greater,lt:Cu.Less,gte:Cu.GreaterEqual,lte:Cu.LessEqual},jK={sent:ug.Sends,"not-sent":ug.DoesNotSend};function qM(e){switch(e.type){case"stx-postcondition":return{type:qe.PostCondition,conditionType:Or.STX,principal:e.address==="origin"?{type:qe.Principal,prefix:Ai.Origin}:dx(e.address),conditionCode:IF[e.condition],amount:BigInt(e.amount)};case"ft-postcondition":return{type:qe.PostCondition,conditionType:Or.Fungible,principal:e.address==="origin"?{type:qe.Principal,prefix:Ai.Origin}:dx(e.address),conditionCode:IF[e.condition],amount:BigInt(e.amount),asset:NF(e.asset)};case"nft-postcondition":return{type:qe.PostCondition,conditionType:Or.NonFungible,principal:e.address==="origin"?{type:qe.Principal,prefix:Ai.Origin}:dx(e.address),conditionCode:jK[e.condition],asset:NF(e.asset),assetName:e.assetId};default:throw new Error("Invalid post condition type")}}function UM(e){const t=qM(e);return _G(t)}function DK(e){if(typeof e=="number")return e;if(e==="allow")return hf.Allow;if(e==="deny")return hf.Deny;throw new Error(`Invalid post condition mode: ${e}`)}class HM{constructor(t){this.transaction=t,this.sigHash=t.signBegin(),this.originDone=!1,this.checkOversign=!0,this.checkOverlap=!0;const n=t.auth.spendingCondition;if(n&&!Ll(n)){if(n.fields.filter(r=>r.contents.type===qe.MessageSignature).length>=n.signaturesRequired)throw new Error("SpendingCondition has more signatures than are expected");n.fields.forEach(r=>{if(r.contents.type!==qe.MessageSignature)return;const i=r.contents,o=tk(this.sigHash,t.auth.authType,n.fee,n.nonce,_n.Compressed,i.data);EM(n.hashMode)||(this.sigHash=o.nextSigHash)})}}static createSponsorSigner(t,n){if(t.auth.authType!=un.Sponsored)throw new Zo("Cannot add sponsor to non-sponsored transaction");const r=Al(t);r.setSponsor(n);const i=r.verifyOrigin(),o=new this(r);return o.originDone=!0,o.sigHash=i,o.checkOversign=!0,o.checkOverlap=!0,o}signOrigin(t){if(this.checkOverlap&&this.originDone)throw new Zo("Cannot sign origin after sponsor key");if(this.transaction.auth===void 0)throw new Zo('"transaction.auth" is undefined');if(this.transaction.auth.spendingCondition===void 0)throw new Zo('"transaction.auth.spendingCondition" is undefined');const n=this.transaction.auth.spendingCondition;if((n.hashMode===vt.P2SH||n.hashMode===vt.P2WSH)&&this.checkOversign&&n.fields.filter(i=>i.contents.type===qe.MessageSignature).length>=n.signaturesRequired)throw new Error("Origin would have too many signatures");const r=this.transaction.signNextOrigin(this.sigHash,t);(Ll(this.transaction.auth.spendingCondition)||O1(this.transaction.auth.spendingCondition.hashMode))&&(this.sigHash=r)}appendOrigin(t){const n=typeof t=="object"&&"type"in t?t:us(t);if(this.checkOverlap&&this.originDone)throw Error("Cannot append public key to origin after sponsor key");if(this.transaction.auth===void 0)throw new Error('"transaction.auth" is undefined');if(this.transaction.auth.spendingCondition===void 0)throw new Error('"transaction.auth.spendingCondition" is undefined');this.transaction.appendPubkey(n)}signSponsor(t){if(this.transaction.auth===void 0)throw new Zo('"transaction.auth" is undefined');if(this.transaction.auth.authType!==un.Sponsored)throw new Zo('"transaction.auth.authType" is not AuthType.Sponsored');const n=this.transaction.signNextSponsor(this.sigHash,t);this.sigHash=n,this.originDone=!0}getTxInComplete(){return Al(this.transaction)}resume(t){this.transaction=Al(t),this.sigHash=t.signBegin()}}async function PF(e){const t={fee:BigInt(0),nonce:BigInt(0),network:Ag,postConditionMode:hf.Deny,sponsored:!1},n=Object.assign(t,e);n.network=mr(n.network),n.client=Object.assign({},hs(n.network),n.client),n.postConditionMode=DK(n.postConditionMode);const r=gM(n.contractAddress,n.contractName,n.functionName,n.functionArgs);if(n!=null&&n.validateWithAbi){let f;if(typeof n.validateWithAbi=="boolean")if(n!=null&&n.network)f=await BK({...n});else throw new Error("Network option must be provided in order to validate with ABI");else f=n.validateWithAbi;_K(r,f)}let i=null;if("publicKey"in n)i=ek(vt.P2PKH,n.publicKey,n.nonce,n.fee);else{const f=n.useNonSequentialMultiSig?vt.P2SHNonSequential:vt.P2SH,p=n.address?zM(n.publicKeys.map(Gh),n.numSignatures,f,gs(n.address).hash160):n.publicKeys.map(Gh);i=oK(f,n.numSignatures,p,n.nonce,n.fee)}const o=n.sponsored?rk(i):nk(i),a=(n.postConditions??[]).map(f=>typeof f.type=="string"?qM(f):f),u=eb(a),l=new $M({transactionVersion:n.network.transactionVersion,chainId:n.network.chainId,auth:o,payload:r,postConditions:u,postConditionMode:n.postConditionMode});if(e.fee===void 0||e.fee===null){const f=await LK({transaction:l,...n});l.setFee(f)}if(e.nonce===void 0||e.nonce===null){const f=n.network.addressVersion.singleSig,p=Xw.c32address(f,l.auth.spendingCondition.signer),m=await IK({address:p,...n});l.setNonce(m)}return l}async function vo(e){if("senderKey"in e){const t=X_(e.senderKey),n=CF(e,"senderKey"),r=await PF({publicKey:t,...n}),i=e.senderKey;return new HM(r).signOrigin(i),r}else{const t=CF(e,"signerKeys"),n=await PF(t);return JK(n,e.publicKeys.map(Gh).slice(),e.signerKeys.map(OM),e.address),n}}function JK(e,t,n,r){if(Ll(e.auth.spendingCondition))throw new Error("Transaction is not a multi-sig transaction");const i=new HM(e),o=r?zM(t,e.auth.spendingCondition.signaturesRequired,e.auth.spendingCondition.hashMode,gs(r).hash160):t;for(const a of o){const u=n.find(l=>X_(l)===a);u?i.signOrigin(u):i.appendOrigin(a)}}function zM(e,t,n,r){if(Vh(0,n,t,e.map(us)).hash160===r)return e;const o=e.slice().sort();if(Vh(0,n,t,o.map(us)).hash160===r)return o;throw new Error("Failed to find matching multi-sig address given public-keys.")}const $K=new Uint8Array([83,73,80,48,49,56]);function MF(e){return Jr(Io(e))}function qK(e){return!(e.type!==we.Tuple||!["name","version","chain-id"].every(t=>t in e.value)||!["name","version"].every(t=>e.value[t].type===we.StringASCII)||e.value["chain-id"].type!==we.UInt)}function WM({message:e,domain:t}){const n=MF(e);if(!qK(t))throw new Error("domain parameter must be a valid domain of type TupleCV with keys 'name', 'version', 'chain-id' with respective types StringASCII, StringASCII, UInt");const r=MF(t);return so($K,r,n)}function UK({message:e,domain:t,privateKey:n}){const r=at(Jr(WM({message:e,domain:t})));return iK({messageHash:r,privateKey:n})}var Gn;(function(e){e[e.P2PKH=0]="P2PKH",e[e.P2SH=1]="P2SH",e[e.P2SHP2WPKH=2]="P2SHP2WPKH",e[e.P2SHP2WSH=3]="P2SHP2WSH",e[e.P2WPKH=4]="P2WPKH",e[e.P2WSH=5]="P2WSH",e[e.P2TR=6]="P2TR"})(Gn||(Gn={}));const Sh={mainnet:{P2PKH:0,P2SH:5},testnet:{P2PKH:111,P2SH:196},devnet:{P2PKH:111,P2SH:196},mocknet:{P2PKH:111,P2SH:196}},VM=/^(1|3|m|n|2)/,LF=/^(bc1q|tb1q|bcrt1q)/i,BF=/^(bc1p|tb1p|bcrt1p)/i,jF={mainnet:"bc",testnet:"tb",devnet:"bcrt",mocknet:"bcrt"},HK=/^(bc|tb)/i,N1=0,GM=1;var Rl;(function(e){e.Period1="Period1",e.Period2a="Period2a",e.Period2b="Period2b",e.Period3="Period3"})(Rl||(Rl={}));var C1;(function(e){e[e.ERR_STACKING_UNREACHABLE=255]="ERR_STACKING_UNREACHABLE",e[e.ERR_STACKING_CORRUPTED_STATE=254]="ERR_STACKING_CORRUPTED_STATE",e[e.ERR_STACKING_INSUFFICIENT_FUNDS=1]="ERR_STACKING_INSUFFICIENT_FUNDS",e[e.ERR_STACKING_INVALID_LOCK_PERIOD=2]="ERR_STACKING_INVALID_LOCK_PERIOD",e[e.ERR_STACKING_ALREADY_STACKED=3]="ERR_STACKING_ALREADY_STACKED",e[e.ERR_STACKING_NO_SUCH_PRINCIPAL=4]="ERR_STACKING_NO_SUCH_PRINCIPAL",e[e.ERR_STACKING_EXPIRED=5]="ERR_STACKING_EXPIRED",e[e.ERR_STACKING_STX_LOCKED=6]="ERR_STACKING_STX_LOCKED",e[e.ERR_STACKING_PERMISSION_DENIED=9]="ERR_STACKING_PERMISSION_DENIED",e[e.ERR_STACKING_THRESHOLD_NOT_MET=11]="ERR_STACKING_THRESHOLD_NOT_MET",e[e.ERR_STACKING_POX_ADDRESS_IN_USE=12]="ERR_STACKING_POX_ADDRESS_IN_USE",e[e.ERR_STACKING_INVALID_POX_ADDRESS=13]="ERR_STACKING_INVALID_POX_ADDRESS",e[e.ERR_STACKING_ALREADY_REJECTED=17]="ERR_STACKING_ALREADY_REJECTED",e[e.ERR_STACKING_INVALID_AMOUNT=18]="ERR_STACKING_INVALID_AMOUNT",e[e.ERR_NOT_ALLOWED=19]="ERR_NOT_ALLOWED",e[e.ERR_STACKING_ALREADY_DELEGATED=20]="ERR_STACKING_ALREADY_DELEGATED",e[e.ERR_DELEGATION_EXPIRES_DURING_LOCK=21]="ERR_DELEGATION_EXPIRES_DURING_LOCK",e[e.ERR_DELEGATION_TOO_MUCH_LOCKED=22]="ERR_DELEGATION_TOO_MUCH_LOCKED",e[e.ERR_DELEGATION_POX_ADDR_REQUIRED=23]="ERR_DELEGATION_POX_ADDR_REQUIRED",e[e.ERR_INVALID_START_BURN_HEIGHT=24]="ERR_INVALID_START_BURN_HEIGHT",e[e.ERR_NOT_CURRENT_STACKER=25]="ERR_NOT_CURRENT_STACKER",e[e.ERR_STACK_EXTEND_NOT_LOCKED=26]="ERR_STACK_EXTEND_NOT_LOCKED",e[e.ERR_STACK_INCREASE_NOT_LOCKED=27]="ERR_STACK_INCREASE_NOT_LOCKED",e[e.ERR_DELEGATION_NO_REWARD_SLOT=28]="ERR_DELEGATION_NO_REWARD_SLOT",e[e.ERR_DELEGATION_WRONG_REWARD_SLOT=29]="ERR_DELEGATION_WRONG_REWARD_SLOT",e[e.ERR_STACKING_IS_DELEGATED=30]="ERR_STACKING_IS_DELEGATED",e[e.ERR_STACKING_NOT_DELEGATED=31]="ERR_STACKING_NOT_DELEGATED"})(C1||(C1={}));/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function cp(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function Uu(...e){const t=(i,o)=>a=>i(o(a)),n=Array.from(e).reverse().reduce((i,o)=>i?t(i,o.encode):o.encode,void 0),r=e.reduce((i,o)=>i?t(i,o.decode):o.decode,void 0);return{encode:n,decode:r}}function Hu(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(cp(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function zu(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function nb(e,t="="){if(cp(e),typeof t!="string")throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let r of n)if(typeof r!="string")throw new Error(`padding.encode: non-string input=${r}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let i of n)if(typeof i!="string")throw new Error(`padding.decode: non-string input=${i}`);let r=n.length;if(r*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function KM(e){if(typeof e!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function DF(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const i=[],o=Array.from(e);for(o.forEach(a=>{if(cp(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,u=!0;for(let l=r;lt?QM(t,e%t):e,dw=(e,t)=>e+(t-QM(e,t));function E1(e,t,n,r){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(dw(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${dw(t,n)}`);let i=0,o=0;const a=2**n-1,u=[];for(const l of e){if(cp(l),l>=2**t)throw new Error(`convertRadix2: invalid data word=${l} from=${t}`);if(i=i<32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=n;o-=n)u.push((i>>o-n&a)>>>0);i&=2**o-1}if(i=i<=t)throw new Error("Excess padding");if(!r&&i)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&u.push(i>>>0),u}function zK(e){return cp(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return DF(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(DF(t,e,2**8))}}}function Wl(e,t=!1){if(cp(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(dw(8,e)>32||dw(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return E1(Array.from(n),8,e,!t)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(E1(n,e,8,t))}}}function JF(e){if(typeof e!="function")throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}const WK=Uu(Wl(4),Hu("0123456789ABCDEF"),zu("")),VK=Uu(Wl(5),Hu("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),nb(5),zu(""));Uu(Wl(5),Hu("0123456789ABCDEFGHIJKLMNOPQRSTUV"),nb(5),zu(""));Uu(Wl(5),Hu("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),zu(""),KM(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const GK=Uu(Wl(6),Hu("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),nb(6),zu("")),KK=Uu(Wl(6),Hu("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),nb(6),zu("")),ok=e=>Uu(zK(58),Hu(e),zu("")),A1=ok("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");ok("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");ok("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const $F=[0,2,3,5,6,7,9,10,11],QK={encode(e){let t="";for(let n=0;n>25;let n=(e&33554431)<<5;for(let r=0;r>r&1)===1&&(n^=qF[r]);return n}function UF(e,t,n=1){const r=e.length;let i=1;for(let o=0;o126)throw new Error(`Invalid prefix (${e})`);i=Om(i)^a>>5}i=Om(i);for(let o=0;oy)throw new TypeError(`Length ${w} exceeds limit ${y}`);return p=p.toLowerCase(),`${p}1${F1.encode(m)}${UF(p,m,t)}`}function u(p,m=90){if(typeof p!="string")throw new Error(`bech32.decode input should be string, not ${typeof p}`);if(p.length<8||m!==!1&&p.length>m)throw new TypeError(`Wrong string length: ${p.length} (${p}). Expected (8..${m})`);const y=p.toLowerCase();if(p!==y&&p!==p.toUpperCase())throw new Error("String must be lowercase or uppercase");p=y;const w=p.lastIndexOf("1");if(w===0||w===-1)throw new Error('Letter "1" must be present between prefix and data only');const b=p.slice(0,w),x=p.slice(w+1);if(x.length<6)throw new Error("Data must be at least 6 characters long");const k=F1.decode(x).slice(0,-6),O=UF(b,k,t);if(!x.endsWith(O))throw new Error(`Invalid checksum in ${p}: expected "${O}"`);return{prefix:b,words:k}}const l=JF(u);function f(p){const{prefix:m,words:y}=u(p,!1);return{prefix:m,words:y,bytes:r(y)}}return{encode:a,decode:u,decodeToBytes:f,decodeUnsafe:l,fromWords:r,fromWordsUnsafe:o,toWords:i}}const fw=YM("bech32"),hw=YM("bech32m"),YK={encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)},XK=Uu(Wl(4),Hu("0123456789abcdef"),zu(""),KM(e=>{if(typeof e!="string"||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})),ZK={utf8:YK,hex:XK,base16:WK,base32:VK,base64:GK,base64url:KK,base58:A1,base58xmr:QK};`${Object.keys(ZK).join(", ")}`;var XM=h_();function eQ(){return typeof crypto<"u"&&typeof crypto.subtle<"u"}const tQ='Crypto lib not found. Either the WebCrypto "crypto.subtle" or Node.js "crypto" module must be available.';async function nQ(){if(eQ())return{lib:crypto.subtle,name:"subtleCrypto"};try{return{lib:require("crypto"),name:"nodeCrypto"}}catch{throw new Error(tQ)}}class rQ{constructor(t,n){this.createCipher=t,this.createDecipher=n}async encrypt(t,n,r,i){if(t!=="aes-128-cbc"&&t!=="aes-256-cbc")throw new Error(`Unsupported cipher algorithm "${t}"`);const o=this.createCipher(t,n,r),a=new Uint8Array(so(o.update(i),o.final()));return Promise.resolve(a)}async decrypt(t,n,r,i){if(t!=="aes-128-cbc"&&t!=="aes-256-cbc")throw new Error(`Unsupported cipher algorithm "${t}"`);const o=this.createDecipher(t,n,r),a=new Uint8Array(so(o.update(i),o.final()));return Promise.resolve(a)}}class iQ{constructor(t){this.subtleCrypto=t}async encrypt(t,n,r,i){let o,a;if(t==="aes-128-cbc")o="AES-CBC",a=128;else if(t==="aes-256-cbc")o="AES-CBC",a=256;else throw new Error(`Unsupported cipher algorithm "${t}"`);const u=await this.subtleCrypto.importKey("raw",n,{name:o,length:a},!1,["encrypt"]),l=await this.subtleCrypto.encrypt({name:o,iv:r},u,i);return new Uint8Array(l)}async decrypt(t,n,r,i){let o,a;if(t==="aes-128-cbc")o="AES-CBC",a=128;else if(t==="aes-256-cbc")o="AES-CBC",a=256;else throw new Error(`Unsupported cipher algorithm "${t}"`);const u=await this.subtleCrypto.importKey("raw",n,{name:o,length:a},!1,["decrypt"]),l=await this.subtleCrypto.decrypt({name:o,iv:r},u,i);return new Uint8Array(l)}}async function ZM(){const e=await nQ();return e.name==="subtleCrypto"?new iQ(e.lib):new rQ(e.lib.createCipheriv,e.lib.createDecipheriv)}var px,HF;function oQ(){return HF||(HF=1,px=dM()("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),px}var sQ=oQ();const e8=Ju(sQ);function aQ(e){return pM(e)}function t8(e){return Jr(e)}function cQ(e){return nG(e)}const uQ=0;ri.hmacSha256Sync=(e,...t)=>{const n=Pg.create(Jr,e);return t.forEach(r=>n.update(r)),n.digest()};function lQ(){return at(ri.randomPrivateKey())}function dQ(e){const t=e8.decode(e),n=t.slice(0,-4),r=t.slice(-4),i=Jr(Jr(n));if(r[0]^i[0]|r[1]^i[1]|r[2]^i[2]|r[3]^i[3])throw new Error("Invalid checksum");if(n.length!==21)throw new TypeError("Invalid address length");const o=IP(n,0),a=n.slice(1);return{version:o,hash:a}}function fQ(e){const t=Jr(Jr(e));return e8.encode(so(e,t).slice(0,e.length+4))}function n8(e,t){return fQ(so(new Uint8Array([e]),t.slice(0,20)))}function r8(e,t=uQ){const n=typeof e=="string"?rt(e):e,r=aQ(t8(n));return n8(t,r)}function i8(e){const t=B_(e);return at(H_(t.slice(0,32),!0))}const hQ=9007199254740991;function o8(e){if(e<0||e>hQ||e%1!==0)throw new RangeError("value out of range")}function pQ(e,t,n=0){return o8(e),t||(t=new Uint8Array(mQ(e))),e<253?Dm(t,e,n):e<=65535?(Dm(t,253,n),Gz(t,e,n+1)):e<=4294967295?(Dm(t,254,n),Zv(t,e,n+1)):(Dm(t,255,n),Zv(t,e>>>0,n+1),Zv(t,e/4294967296|0,n+5)),t}function mQ(e){return o8(e),e<253?1:e<=65535?3:e<=4294967295?5:9}const s8=`Stacks Signed Message: + */var QA;function LW(){if(QA)return p0;QA=1,p0.parse=n,p0.serialize=r;var e=Object.prototype.toString,t=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function n(l,f){if(typeof l!="string")throw new TypeError("argument str must be a string");for(var p={},m=f||{},y=m.decode||i,w=0;wPromise.resolve(!1),removeCustomNetwork:()=>!0,networks:{}}),JW=({cookies:e,queryNetworkMode:t,queryApiUrl:n,apiUrls:r,children:i})=>{var x,_;if(LP&&((_=(x=window==null?void 0:window.location)==null?void 0:x.search)!=null&&_.includes("err=1")))throw new Error("test error");const o=JSON.parse(jW.parse(e||"").customNetworks||"{}"),[a,u]=PW(["customNetworks"]),[l,f]=$.useState(o),p=$.useMemo(()=>({[r.mainnet]:{label:"hiro.so",url:r.mainnet,networkId:dn.Mainnet,mode:"mainnet"},[r.testnet]:{label:"hiro.so",url:r.testnet,networkId:dn.Testnet,mode:"testnet"},[Dh]:{label:"devnet",url:Dh,networkId:dn.Testnet,mode:"testnet",isCustomNetwork:!0},[HA]:{label:"Nakamoto Testnet",url:HA,networkId:dn.Testnet,mode:"testnet",isCustomNetwork:!0},...l}),[r,l]),m=n||r[t],w=!p[m]?r.mainnet:m,b=p[w];return b.mode!==t?d.jsx(Kw,{to:".",replace:!0}):d.jsx(WP.Provider,{value:{activeNetwork:b,activeNetworkKey:w,cookies:e,apiUrls:r,addCustomNetwork:O=>new Promise(N=>{u("customNetworks",JSON.stringify({...l,[O.url]:O}),{path:"/",maxAge:3600,sameSite:!0}),setTimeout(()=>{f({...l,[O.url]:{...O,isCustomNetwork:!0}}),N(!0)},100)}),removeCustomNetwork:O=>{const{[O.url]:N,...E}=l;u("customNetworks",JSON.stringify(E),{path:"/",maxAge:3600,sameSite:!0}),f(E)},networks:p},children:i})},ms=()=>$.useContext(WP);function m0(e){return e.client.fetch=TW,e}const Pt=()=>{const e=ms().activeNetwork,t=e.mode,n=RW(t)({mainnet:mr(m0(Ag)),testnet:mr(m0(ag)),devnet:mr(m0(Vm)),mocknet:mr(m0(MP))}),r=Gw(n);return{network:n,networkName:t,networkInstance:r,networkLabel:e.label}},VP=$.createContext(null);function $W({children:e}){const{network:t}=Pt(),n=new rr.Configuration({basePath:t.client.baseUrl});return d.jsx(VP.Provider,{value:{accountsApi:new rr.AccountsApi(n),blocksApi:new rr.BlocksApi(n),faucetsApi:new rr.FaucetsApi(n),feesApi:new rr.FeesApi(n),fungibleTokensApi:new rr.FungibleTokensApi(n),infoApi:new rr.InfoApi(n),microblocksApi:new rr.MicroblocksApi(n),namesApi:new rr.NamesApi(n),nonFungibleTokensApi:new rr.NonFungibleTokensApi(n),rosettaApi:new rr.RosettaApi(n),searchApi:new rr.SearchApi(n),smartContractsApi:new rr.SmartContractsApi(n),stackingRewardsApi:new rr.StackingRewardsApi(n),transactionsApi:new rr.TransactionsApi(n)},children:e})}function Qw(){return $.useContext(VP)}function qW(e){const t=Object.values(e).filter(r=>typeof r=="number"),n=new Set(t);return r=>n.has(r)}const YA=new Map;function GP(e,t){const n=YA.get(e);if(n!==void 0)return n(t);const r=qW(e);return YA.set(e,r),GP(e,t)}class fn{constructor(t){this.consumed=0,this.source=typeof t=="string"?rt(t):t}readBytes(t){const n=this.source.subarray(this.consumed,this.consumed+t);return this.consumed+=t,n}readUInt32BE(){return Kz(this.readBytes(4),0)}readUInt8(){return IP(this.readBytes(1),0)}readUInt16BE(){return Wz(this.readBytes(2),0)}readBigUIntLE(t){const n=this.readBytes(t).slice().reverse(),r=at(n);return BigInt(`0x${r}`)}readBigUIntBE(t){const n=this.readBytes(t),r=at(n);return BigInt(`0x${r}`)}get readOffset(){return this.consumed}set readOffset(t){this.consumed=t}get internalBytes(){return this.source}readUInt8Enum(t,n){const r=this.readUInt8();if(GP(t,r))return r;throw n(r)}}const UW=128,HW=128,KP=16,rf=32,m1=80,Fg=65,zW=32,WW=64,ow=34;var en;(function(e){e[e.TokenTransfer=0]="TokenTransfer",e[e.SmartContract=1]="SmartContract",e[e.VersionedSmartContract=6]="VersionedSmartContract",e[e.ContractCall=2]="ContractCall",e[e.PoisonMicroblock=3]="PoisonMicroblock",e[e.Coinbase=4]="Coinbase",e[e.CoinbaseToAltRecipient=5]="CoinbaseToAltRecipient",e[e.TenureChange=7]="TenureChange",e[e.NakamotoCoinbase=8]="NakamotoCoinbase"})(en||(en={}));var g1;(function(e){e[e.Clarity1=1]="Clarity1",e[e.Clarity2=2]="Clarity2",e[e.Clarity3=3]="Clarity3"})(g1||(g1={}));var Ri;(function(e){e[e.OnChainOnly=1]="OnChainOnly",e[e.OffChainOnly=2]="OffChainOnly",e[e.Any=3]="Any"})(Ri||(Ri={}));const rx=["onChainOnly","offChainOnly","any"];rx[0]+"",Ri.OnChainOnly,rx[1]+"",Ri.OffChainOnly,rx[2]+"",Ri.Any,Ri.OnChainOnly+"",Ri.OnChainOnly,Ri.OffChainOnly+"",Ri.OffChainOnly,Ri.Any+"",Ri.Any;var pf;(function(e){e[e.Allow=1]="Allow",e[e.Deny=2]="Deny"})(pf||(pf={}));var Or;(function(e){e[e.STX=0]="STX",e[e.Fungible=1]="Fungible",e[e.NonFungible=2]="NonFungible"})(Or||(Or={}));var un;(function(e){e[e.Standard=4]="Standard",e[e.Sponsored=5]="Sponsored"})(un||(un={}));var vt;(function(e){e[e.P2PKH=0]="P2PKH",e[e.P2SH=1]="P2SH",e[e.P2WPKH=2]="P2WPKH",e[e.P2WSH=3]="P2WSH",e[e.P2SHNonSequential=5]="P2SHNonSequential",e[e.P2WSHNonSequential=7]="P2WSHNonSequential"})(vt||(vt={}));var _n;(function(e){e[e.Compressed=0]="Compressed",e[e.Uncompressed=1]="Uncompressed"})(_n||(_n={}));var Cu;(function(e){e[e.Equal=1]="Equal",e[e.Greater=2]="Greater",e[e.GreaterEqual=3]="GreaterEqual",e[e.Less=4]="Less",e[e.LessEqual=5]="LessEqual"})(Cu||(Cu={}));var ug;(function(e){e[e.Sends=16]="Sends",e[e.DoesNotSend=17]="DoesNotSend"})(ug||(ug={}));var Ai;(function(e){e[e.Origin=1]="Origin",e[e.Standard=2]="Standard",e[e.Contract=3]="Contract"})(Ai||(Ai={}));var XA;(function(e){e[e.STX=0]="STX",e[e.Fungible=1]="Fungible",e[e.NonFungible=2]="NonFungible"})(XA||(XA={}));var y1;(function(e){e[e.BlockFound=0]="BlockFound",e[e.Extended=1]="Extended"})(y1||(y1={}));var No;(function(e){e[e.PublicKeyCompressed=0]="PublicKeyCompressed",e[e.PublicKeyUncompressed=1]="PublicKeyUncompressed",e[e.SignatureCompressed=2]="SignatureCompressed",e[e.SignatureUncompressed=3]="SignatureUncompressed"})(No||(No={}));var ZA;(function(e){e.Serialization="Serialization",e.Deserialization="Deserialization",e.SignatureValidation="SignatureValidation",e.FeeTooLow="FeeTooLow",e.BadNonce="BadNonce",e.NotEnoughFunds="NotEnoughFunds",e.NoSuchContract="NoSuchContract",e.NoSuchPublicFunction="NoSuchPublicFunction",e.BadFunctionArgument="BadFunctionArgument",e.ContractAlreadyExists="ContractAlreadyExists",e.PoisonMicroblocksDoNotConflict="PoisonMicroblocksDoNotConflict",e.PoisonMicroblockHasUnknownPubKeyHash="PoisonMicroblockHasUnknownPubKeyHash",e.PoisonMicroblockIsInvalid="PoisonMicroblockIsInvalid",e.BadAddressVersionByte="BadAddressVersionByte",e.NoCoinbaseViaMempool="NoCoinbaseViaMempool",e.ServerFailureNoSuchChainTip="ServerFailureNoSuchChainTip",e.ServerFailureDatabase="ServerFailureDatabase",e.ServerFailureOther="ServerFailureOther"})(ZA||(ZA={}));let Ig=class extends Error{constructor(t){super(t),this.message=t,this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},bh=class extends Ig{constructor(t){super(t)}};class Ci extends Ig{constructor(t){super(t)}}class QP extends Ig{constructor(t){super(t)}}class Zo extends Ig{constructor(t){super(t)}}class ef extends Ig{constructor(t){super(t)}}function w1(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function VW(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function YP(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function GW(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");w1(e.outputLen),w1(e.blockLen)}function KW(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function QW(e,t){YP(e);const n=t.outputLen;if(e.lengthnew DataView(e.buffer,e.byteOffset,e.byteLength),Ko=(e,t)=>e<<32-t|e>>>t,YW=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!YW)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function XW(e){if(typeof e!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof e}`);return new TextEncoder().encode(e)}function $_(e){if(typeof e=="string"&&(e=XW(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}let XP=class{clone(){return this._cloneInto()}};function vf(e){const t=r=>e().update($_(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}class ZP extends XP{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,tf.hash(t);const r=$_(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?t.create().update(r).digest():r);for(let a=0;anew ZP(e,t).update(n).digest();Pg.create=(e,t)=>new ZP(e,t);function ZW(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const i=BigInt(32),o=BigInt(4294967295),a=Number(n>>i&o),u=Number(n&o),l=r?4:0,f=r?0:4;e.setUint32(t+l,a,r),e.setUint32(t+f,u,r)}class q_ extends XP{constructor(t,n,r,i){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=ix(this.buffer)}update(t){tf.exists(this);const{view:n,buffer:r,blockLen:i}=this;t=$_(t);const o=t.length;for(let a=0;ai-a&&(this.process(r,0),a=0);for(let m=a;mp.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;me&t^~e&n,tV=(e,t,n)=>e&t^e&n^t&n,nV=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),wl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),bl=new Uint32Array(64);class eM extends q_{constructor(){super(64,32,8,!1),this.A=wl[0]|0,this.B=wl[1]|0,this.C=wl[2]|0,this.D=wl[3]|0,this.E=wl[4]|0,this.F=wl[5]|0,this.G=wl[6]|0,this.H=wl[7]|0}get(){const{A:t,B:n,C:r,D:i,E:o,F:a,G:u,H:l}=this;return[t,n,r,i,o,a,u,l]}set(t,n,r,i,o,a,u,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=a|0,this.G=u|0,this.H=l|0}process(t,n){for(let m=0;m<16;m++,n+=4)bl[m]=t.getUint32(n,!1);for(let m=16;m<64;m++){const y=bl[m-15],w=bl[m-2],b=Ko(y,7)^Ko(y,18)^y>>>3,x=Ko(w,17)^Ko(w,19)^w>>>10;bl[m]=x+bl[m-7]+b+bl[m-16]|0}let{A:r,B:i,C:o,D:a,E:u,F:l,G:f,H:p}=this;for(let m=0;m<64;m++){const y=Ko(u,6)^Ko(u,11)^Ko(u,25),w=p+y+eV(u,l,f)+nV[m]+bl[m]|0,x=(Ko(r,2)^Ko(r,13)^Ko(r,22))+tV(r,i,o)|0;p=f,f=l,l=u,u=a+w|0,a=o,o=i,i=r,r=w+x|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,f=f+this.G|0,p=p+this.H|0,this.set(r,i,o,a,u,l,f,p)}roundClean(){bl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class rV extends eM{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const Jr=vf(()=>new eM);vf(()=>new rV);/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const jt=BigInt(0),xn=BigInt(1),Nl=BigInt(2),Gm=BigInt(3),eF=BigInt(8),In=Object.freeze({a:jt,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:xn,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")}),tF=(e,t)=>(e+t/Nl)/t,g0={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(e){const{n:t}=In,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-xn*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,a=BigInt("0x100000000000000000000000000000000"),u=tF(o*e,t),l=tF(-r*e,t);let f=$e(e-u*n-l*i,t),p=$e(-u*r-l*o,t);const m=f>a,y=p>a;if(m&&(f=t-f),y&&(p=t-p),f>a||p>a)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:m,k1:f,k2neg:y,k2:p}}},Fo=32,qh=32,iV=32,sw=Fo+1,aw=2*Fo+1;function nF(e){const{a:t,b:n}=In,r=$e(e*e),i=$e(r*e);return $e(i+t*e+n)}const y0=In.a===jt;class tM extends Error{constructor(t){super(t)}}function rF(e){if(!(e instanceof Vt))throw new TypeError("JacobianPoint expected")}class Vt{constructor(t,n,r){this.x=t,this.y=n,this.z=r}static fromAffine(t){if(!(t instanceof Kt))throw new TypeError("JacobianPoint#fromAffine: expected Point");return t.equals(Kt.ZERO)?Vt.ZERO:new Vt(t.x,t.y,xn)}static toAffineBatch(t){const n=uV(t.map(r=>r.z));return t.map((r,i)=>r.toAffine(n[i]))}static normalizeZ(t){return Vt.toAffineBatch(t).map(Vt.fromAffine)}equals(t){rF(t);const{x:n,y:r,z:i}=this,{x:o,y:a,z:u}=t,l=$e(i*i),f=$e(u*u),p=$e(n*f),m=$e(o*l),y=$e($e(r*u)*f),w=$e($e(a*i)*l);return p===m&&y===w}negate(){return new Vt(this.x,$e(-this.y),this.z)}double(){const{x:t,y:n,z:r}=this,i=$e(t*t),o=$e(n*n),a=$e(o*o),u=t+o,l=$e(Nl*($e(u*u)-i-a)),f=$e(Gm*i),p=$e(f*f),m=$e(p-Nl*l),y=$e(f*(l-m)-eF*a),w=$e(Nl*n*r);return new Vt(m,y,w)}add(t){rF(t);const{x:n,y:r,z:i}=this,{x:o,y:a,z:u}=t;if(o===jt||a===jt)return this;if(n===jt||r===jt)return t;const l=$e(i*i),f=$e(u*u),p=$e(n*f),m=$e(o*l),y=$e($e(r*u)*f),w=$e($e(a*i)*l),b=$e(m-p),x=$e(w-y);if(b===jt)return x===jt?this.double():Vt.ZERO;const _=$e(b*b),O=$e(b*_),N=$e(p*_),E=$e(x*x-O-Nl*N),T=$e(x*(N-E)-y*O),B=$e(i*u*b);return new Vt(E,T,B)}subtract(t){return this.add(t.negate())}multiplyUnsafe(t){const n=Vt.ZERO;if(typeof t=="bigint"&&t===jt)return n;let r=sF(t);if(r===xn)return this;if(!y0){let m=n,y=this;for(;r>jt;)r&xn&&(m=m.add(y)),y=y.double(),r>>=xn;return m}let{k1neg:i,k1:o,k2neg:a,k2:u}=g0.splitScalar(r),l=n,f=n,p=this;for(;o>jt||u>jt;)o&xn&&(l=l.add(p)),u&xn&&(f=f.add(p)),p=p.double(),o>>=xn,u>>=xn;return i&&(l=l.negate()),a&&(f=f.negate()),f=new Vt($e(f.x*g0.beta),f.y,f.z),l.add(f)}precomputeWindow(t){const n=y0?128/t+1:256/t+1,r=[];let i=this,o=i;for(let a=0;a>=m,b>l&&(b-=p,t+=xn);const x=w,_=w+Math.abs(b)-1,O=y%2!==0,N=b<0;b===0?a=a.add(w0(O,i[x])):o=o.add(w0(N,i[_]))}return{p:o,f:a}}multiply(t,n){let r=sF(t),i,o;if(y0){const{k1neg:a,k1:u,k2neg:l,k2:f}=g0.splitScalar(r);let{p,f:m}=this.wNAF(u,n),{p:y,f:w}=this.wNAF(f,n);p=w0(a,p),y=w0(l,y),y=new Vt($e(y.x*g0.beta),y.y,y.z),i=p.add(y),o=m.add(w)}else{const{p:a,f:u}=this.wNAF(r,n);i=a,o=u}return Vt.normalizeZ([i,o])[0]}toAffine(t){const{x:n,y:r,z:i}=this,o=this.equals(Vt.ZERO);t==null&&(t=o?eF:op(i));const a=t,u=$e(a*a),l=$e(u*a),f=$e(n*u),p=$e(r*l),m=$e(i*a);if(o)return Kt.ZERO;if(m!==xn)throw new Error("invZ was invalid");return new Kt(f,p)}}Vt.BASE=new Vt(In.Gx,In.Gy,xn);Vt.ZERO=new Vt(jt,xn,jt);function w0(e,t){const n=t.negate();return e?n:t}const b1=new WeakMap;class Kt{constructor(t,n){this.x=t,this.y=n}_setWindowSize(t){this._WINDOW_SIZE=t,b1.delete(this)}hasEvenY(){return this.y%Nl===jt}static fromCompressedHex(t){const n=t.length===32,r=Al(n?t:t.subarray(1));if(!ox(r))throw new Error("Point is not on curve");const i=nF(r);let o=cV(i);const a=(o&xn)===xn;n?a&&(o=$e(-o)):(t[0]&1)===1!==a&&(o=$e(-o));const u=new Kt(r,o);return u.assertValidity(),u}static fromUncompressedHex(t){const n=Al(t.subarray(1,Fo+1)),r=Al(t.subarray(Fo+1,Fo*2+1)),i=new Kt(n,r);return i.assertValidity(),i}static fromHex(t){const n=Hh(t),r=n.length,i=n[0];if(r===Fo)return this.fromCompressedHex(n);if(r===sw&&(i===2||i===3))return this.fromCompressedHex(n);if(r===aw&&i===4)return this.fromUncompressedHex(n);throw new Error(`Point.fromHex: received invalid point. Expected 32-${sw} compressed bytes or ${aw} uncompressed bytes, not ${r}`)}static fromPrivateKey(t){return Kt.BASE.multiply(dg(t))}static fromSignature(t,n,r){const{r:i,s:o}=rM(n);if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");const a=U_(Hh(t)),{n:u}=In,l=r===2||r===3?i+u:i,f=op(l,u),p=$e(-a*f,u),m=$e(o*f,u),y=r&1?"03":"02",w=Kt.fromHex(y+Nh(l)),b=Kt.BASE.multiplyAndAddUnsafe(w,p,m);if(!b)throw new Error("Cannot recover signature: point at infinify");return b.assertValidity(),b}toRawBytes(t=!1){return of(this.toHex(t))}toHex(t=!1){const n=Nh(this.x);return t?`${this.hasEvenY()?"02":"03"}${n}`:`04${n}${Nh(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const t="Point is not on elliptic curve",{x:n,y:r}=this;if(!ox(n)||!ox(r))throw new Error(t);const i=$e(r*r),o=nF(n);if($e(i-o)!==jt)throw new Error(t)}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new Kt(this.x,$e(-this.y))}double(){return Vt.fromAffine(this).double().toAffine()}add(t){return Vt.fromAffine(this).add(Vt.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return Vt.fromAffine(this).multiply(t,this).toAffine()}multiplyAndAddUnsafe(t,n,r){const i=Vt.fromAffine(this),o=n===jt||n===xn||this!==Kt.BASE?i.multiplyUnsafe(n):i.multiply(n),a=Vt.fromAffine(t).multiplyUnsafe(r),u=o.add(a);return u.equals(Vt.ZERO)?void 0:u.toAffine()}}Kt.BASE=new Kt(In.Gx,In.Gy);Kt.ZERO=new Kt(jt,jt);function iF(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function oF(e){if(e.length<2||e[0]!==2)throw new Error(`Invalid signature integer tag: ${Uh(e)}`);const t=e[1],n=e.subarray(2,t+2);if(!t||n.length!==t)throw new Error("Invalid signature integer: wrong length");if(n[0]===0&&n[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:Al(n),left:e.subarray(t+2)}}function oV(e){if(e.length<2||e[0]!=48)throw new Error(`Invalid signature tag: ${Uh(e)}`);if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:n}=oF(e.subarray(2)),{data:r,left:i}=oF(n);if(i.length)throw new Error(`Invalid signature: left bytes after parsing: ${Uh(i)}`);return{r:t,s:r}}class Lo{constructor(t,n){this.r=t,this.s=n,this.assertValidity()}static fromCompact(t){const n=t instanceof Uint8Array,r="Signature.fromCompact";if(typeof t!="string"&&!n)throw new TypeError(`${r}: Expected string or Uint8Array`);const i=n?Uh(t):t;if(i.length!==128)throw new Error(`${r}: Expected 64-byte hex`);return new Lo(cw(i.slice(0,64)),cw(i.slice(64,128)))}static fromDER(t){const n=t instanceof Uint8Array;if(typeof t!="string"&&!n)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:i}=oV(n?t:of(t));return new Lo(r,i)}static fromHex(t){return this.fromDER(t)}assertValidity(){const{r:t,s:n}=this;if(!lg(t))throw new Error("Invalid Signature: r must be 0 < r < n");if(!lg(n))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const t=In.n>>xn;return this.s>t}normalizeS(){return this.hasHighS()?new Lo(this.r,$e(-this.s,In.n)):this}toDERRawBytes(){return of(this.toDERHex())}toDERHex(){const t=iF(km(this.s)),n=iF(km(this.r)),r=t.length/2,i=n.length/2,o=km(r),a=km(i);return`30${km(i+r+4)}02${a}${n}02${o}${t}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return of(this.toCompactHex())}toCompactHex(){return Nh(this.r)+Nh(this.s)}}function Rl(...e){if(!e.every(r=>r instanceof Uint8Array))throw new Error("Uint8Array list expected");if(e.length===1)return e[0];const t=e.reduce((r,i)=>r+i.length,0),n=new Uint8Array(t);for(let r=0,i=0;rt.toString(16).padStart(2,"0"));function Uh(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");let t="";for(let n=0;n0)return BigInt(e);if(typeof e=="bigint"&&lg(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function $e(e,t=In.P){const n=e%t;return n>=jt?n:t+n}function Gi(e,t){const{P:n}=In;let r=e;for(;t-- >jt;)r*=r,r%=n;return r}function cV(e){const{P:t}=In,n=BigInt(6),r=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),u=BigInt(88),l=e*e*e%t,f=l*l*e%t,p=Gi(f,Gm)*f%t,m=Gi(p,Gm)*f%t,y=Gi(m,Nl)*l%t,w=Gi(y,r)*y%t,b=Gi(w,i)*w%t,x=Gi(b,a)*b%t,_=Gi(x,u)*x%t,O=Gi(_,a)*b%t,N=Gi(O,Gm)*f%t,E=Gi(N,o)*w%t,T=Gi(E,n)*l%t,B=Gi(T,Nl);if(B*B%t!==e)throw new Error("Cannot find square root");return B}function op(e,t=In.P){if(e===jt||t<=jt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=$e(e,t),r=t,i=jt,o=xn;for(;n!==jt;){const u=r/n,l=r%n,f=i-o*u;r=n,n=l,i=o,o=f}if(r!==xn)throw new Error("invert: does not exist");return $e(i,t)}function uV(e,t=In.P){const n=new Array(e.length),r=e.reduce((o,a,u)=>a===jt?o:(n[u]=o,$e(o*a,t)),xn),i=op(r,t);return e.reduceRight((o,a,u)=>a===jt?o:(n[u]=$e(o*n[u],t),$e(o*a,t)),i),n}function lV(e){const t=e.length*8-qh*8,n=Al(e);return t>0?n>>BigInt(t):n}function U_(e,t=!1){const n=lV(e);if(t)return n;const{n:r}=In;return n>=r?n-r:n}let Ch,Km;class dV{constructor(t,n){if(this.hashLen=t,this.qByteLen=n,typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(t).fill(1),this.k=new Uint8Array(t).fill(0),this.counter=0}hmac(...t){return ri.hmacSha256(this.k,...t)}hmacSync(...t){return Km(this.k,...t)}checkSync(){if(typeof Km!="function")throw new tM("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(t=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),t),this.v=await this.hmac(this.v),t.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),t),this.v=await this.hmac(this.v))}reseedSync(t=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),t),this.v=this.hmacSync(this.v),t.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),t),this.v=this.hmacSync(this.v))}async generate(){this.incr();let t=0;const n=[];for(;t0)t=BigInt(e);else if(typeof e=="string"){if(e.length!==2*qh)throw new Error("Expected 32 bytes of private key");t=cw(e)}else if(e instanceof Uint8Array){if(e.length!==qh)throw new Error("Expected 32 bytes of private key");t=Al(e)}else throw new TypeError("Expected valid private key");if(!lg(t))throw new Error("Expected private key: 0 < key < n");return t}function nM(e){return e instanceof Kt?(e.assertValidity(),e):Kt.fromHex(e)}function rM(e){if(e instanceof Lo)return e.assertValidity(),e;try{return Lo.fromDER(e)}catch{return Lo.fromCompact(e)}}function H_(e,t=!1){return Kt.fromPrivateKey(e).toRawBytes(t)}function aF(e){const t=e instanceof Uint8Array,n=typeof e=="string",r=(t||n)&&e.length;return t?r===sw||r===aw:n?r===sw*2||r===aw*2:e instanceof Kt}function iM(e,t,n=!1){if(aF(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!aF(t))throw new TypeError("getSharedSecret: second arg must be public key");const r=nM(t);return r.assertValidity(),r.multiply(dg(e)).toRawBytes(n)}function oM(e){const t=e.length>Fo?e.slice(0,Fo):e;return Al(t)}function hV(e){const t=oM(e),n=$e(t,In.n);return sM(n{e=Hh(e);const t=qh+8;if(e.length1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const n=$e(Al(e),In.n-xn)+xn;return S1(n)},randomBytes:(e=32)=>{if(Si.web)return Si.web.getRandomValues(new Uint8Array(e));if(Si.node){const{randomBytes:t}=Si.node;return Uint8Array.from(t(e))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>ri.hashToPrivateKey(ri.randomBytes(qh+8)),precompute(e=8,t=Kt.BASE){const n=t===Kt.BASE?t:new Kt(t.x,t.y);return n._setWindowSize(e),n.multiply(Gm),n},sha256:async(...e)=>{if(Si.web){const t=await Si.web.subtle.digest("SHA-256",Rl(...e));return new Uint8Array(t)}else if(Si.node){const{createHash:t}=Si.node,n=t("sha256");return e.forEach(r=>n.update(r)),Uint8Array.from(n.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(Si.web){const n=await Si.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),r=Rl(...t),i=await Si.web.subtle.sign("HMAC",n,r);return new Uint8Array(i)}else if(Si.node){const{createHmac:n}=Si.node,r=n("sha256",e);return t.forEach(i=>r.update(i)),Uint8Array.from(r.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(e,...t)=>{let n=b0[e];if(n===void 0){const r=await ri.sha256(Uint8Array.from(e,i=>i.charCodeAt(0)));n=Rl(r,r),b0[e]=n}return ri.sha256(n,...t)},taggedHashSync:(e,...t)=>{if(typeof Ch!="function")throw new tM("sha256Sync is undefined, you need to set it");let n=b0[e];if(n===void 0){const r=Ch(Uint8Array.from(e,i=>i.charCodeAt(0)));n=Rl(r,r),b0[e]=n}return Ch(n,...t)},_JacobianPoint:Vt};Object.defineProperties(ri,{sha256Sync:{configurable:!1,get(){return Ch},set(e){Ch||(Ch=e)}},hmacSha256Sync:{configurable:!1,get(){return Km},set(e){Km||(Km=e)}}});var sx={},ax={},cx={},Rm={},uF;function yV(){return uF||(uF=1,Object.defineProperty(Rm,"__esModule",{value:!0}),Rm.crypto=void 0,Rm.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),Rm}var lF;function zl(){return lF||(lF=1,function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;const t=yV(),n=A=>A instanceof Uint8Array,r=A=>new Uint8Array(A.buffer,A.byteOffset,A.byteLength);e.u8=r;const i=A=>new Uint32Array(A.buffer,A.byteOffset,Math.floor(A.byteLength/4));e.u32=i;const o=A=>new DataView(A.buffer,A.byteOffset,A.byteLength);e.createView=o;const a=(A,U)=>A<<32-U|A>>>U;if(e.rotr=a,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");const u=Array.from({length:256},(A,U)=>U.toString(16).padStart(2,"0"));function l(A){if(!n(A))throw new Error("Uint8Array expected");let U="";for(let v=0;v{};e.nextTick=p;async function m(A,U,v){let R=Date.now();for(let C=0;C=0&&MR+C.length,0));let v=0;return A.forEach(R=>{if(!n(R))throw new Error("Uint8Array expected");U.set(R,v),v+=R.length}),U}e.concatBytes=b;class x{clone(){return this._cloneInto()}}e.Hash=x;const _={}.toString;function O(A,U){if(U!==void 0&&_.call(U)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(A,U)}e.checkOpts=O;function N(A){const U=R=>A().update(w(R)).digest(),v=A();return U.outputLen=v.outputLen,U.blockLen=v.blockLen,U.create=()=>A(),U}e.wrapConstructor=N;function E(A){const U=(R,C)=>A(C).update(w(R)).digest(),v=A({});return U.outputLen=v.outputLen,U.blockLen=v.blockLen,U.create=R=>A(R),U}e.wrapConstructorWithOpts=E;function T(A){const U=(R,C)=>A(C).update(w(R)).digest(),v=A({});return U.outputLen=v.outputLen,U.blockLen=v.blockLen,U.create=R=>A(R),U}e.wrapXOFConstructorWithOpts=T;function B(A=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(A));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=B}(cx)),cx}var dF;function cM(){return dF||(dF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.c32decode=e.c32normalize=e.c32encode=e.c32=void 0;const t=zl();e.c32="0123456789ABCDEFGHJKMNPQRSTVWXYZ";const n="0123456789abcdef";function r(a,u){if(!a.match(/^[0-9a-fA-F]*$/))throw new Error("Not a hex-encoded string");a.length%2!==0&&(a=`0${a}`),a=a.toLowerCase();let l=[],f=0;for(let w=a.length-1;w>=0;w--)if(f<4){const b=n.indexOf(a[w])>>f;let x=0;w!==0&&(x=n.indexOf(a[w-1]));const _=1+f,O=x%(1<<_)<<5-_,N=e.c32[b+O];f=_,l.unshift(N)}else f=0;let p=0;for(let w=0;w=0;x--){y===4&&(p.unshift(n[m]),y=0,m=0);const O=(e.c32.indexOf(a[x])<>4,m>1<0&&!l.includes(u.length))throw new Error(`Expected Uint8Array of length ${l}, not of length=${u.length}`)}Br.bytes=n;function r(u){if(typeof u!="function"||typeof u.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");e(u.outputLen),e(u.blockLen)}Br.hash=r;function i(u,l=!0){if(u.destroyed)throw new Error("Hash instance has been destroyed");if(l&&u.finished)throw new Error("Hash#digest() has already been called")}Br.exists=i;function o(u,l){n(u);const f=l.outputLen;if(u.length>l&f),m=Number(a&f),y=u?4:0,w=u?0:4;i.setUint32(o+y,p,u),i.setUint32(o+w,m,u)}class r extends t.Hash{constructor(o,a,u,l){super(),this.blockLen=o,this.outputLen=a,this.padOffset=u,this.isLE=l,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(o),this.view=(0,t.createView)(this.buffer)}update(o){(0,e.exists)(this);const{view:a,buffer:u,blockLen:l}=this;o=(0,t.toBytes)(o);const f=o.length;for(let p=0;pl-p&&(this.process(u,0),p=0);for(let x=p;xb.length)throw new Error("_sha2: outputLen bigger than state");for(let x=0;xf&p^~f&m,r=(f,p,m)=>f&p^f&m^p&m,i=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);class u extends e.SHA2{constructor(){super(64,32,8,!1),this.A=o[0]|0,this.B=o[1]|0,this.C=o[2]|0,this.D=o[3]|0,this.E=o[4]|0,this.F=o[5]|0,this.G=o[6]|0,this.H=o[7]|0}get(){const{A:p,B:m,C:y,D:w,E:b,F:x,G:_,H:O}=this;return[p,m,y,w,b,x,_,O]}set(p,m,y,w,b,x,_,O){this.A=p|0,this.B=m|0,this.C=y|0,this.D=w|0,this.E=b|0,this.F=x|0,this.G=_|0,this.H=O|0}process(p,m){for(let T=0;T<16;T++,m+=4)a[T]=p.getUint32(m,!1);for(let T=16;T<64;T++){const B=a[T-15],A=a[T-2],U=(0,t.rotr)(B,7)^(0,t.rotr)(B,18)^B>>>3,v=(0,t.rotr)(A,17)^(0,t.rotr)(A,19)^A>>>10;a[T]=v+a[T-7]+U+a[T-16]|0}let{A:y,B:w,C:b,D:x,E:_,F:O,G:N,H:E}=this;for(let T=0;T<64;T++){const B=(0,t.rotr)(_,6)^(0,t.rotr)(_,11)^(0,t.rotr)(_,25),A=E+B+n(_,O,N)+i[T]+a[T]|0,v=((0,t.rotr)(y,2)^(0,t.rotr)(y,13)^(0,t.rotr)(y,22))+r(y,w,b)|0;E=N,N=O,O=_,_=x+A|0,x=b,b=w,w=y,y=A+v|0}y=y+this.A|0,w=w+this.B|0,b=b+this.C|0,x=x+this.D|0,_=_+this.E|0,O=O+this.F|0,N=N+this.G|0,E=E+this.H|0,this.set(y,w,b,x,_,O,N,E)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class l extends u{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}return Bd.sha256=(0,t.wrapConstructor)(()=>new u),Bd.sha224=(0,t.wrapConstructor)(()=>new l),Bd}var mF;function lM(){if(mF)return Ld;mF=1,Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.c32checkDecode=Ld.c32checkEncode=void 0;const e=Yw(),t=zl(),n=cM();function r(a){const u=(0,e.sha256)((0,e.sha256)((0,t.hexToBytes)(a)));return(0,t.bytesToHex)(u.slice(0,4))}function i(a,u){if(a<0||a>=32)throw new Error("Invalid version (must be between 0 and 31)");if(!u.match(/^[0-9a-fA-F]*$/))throw new Error("Invalid data (not a hex string)");u=u.toLowerCase(),u.length%2!==0&&(u=`0${u}`);let l=a.toString(16);l.length===1&&(l=`0${l}`);const f=r(`${l}${u}`),p=(0,n.c32encode)(`${u}${f}`);return`${n.c32[a]}${p}`}Ld.c32checkEncode=i;function o(a){a=(0,n.c32normalize)(a);const u=(0,n.c32decode)(a.slice(1)),l=a[0],f=n.c32.indexOf(l),p=u.slice(-8);let m=f.toString(16);if(m.length===1&&(m=`0${m}`),r(`${m}${u.substring(0,u.length-8)}`)!==p)throw new Error("Invalid c32check string: checksum mismatch");return[f,u.substring(0,u.length-8)]}return Ld.c32checkDecode=o,Ld}var ux={},jd={},lx,gF;function dM(){if(gF)return lx;gF=1;function e(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r>>0,T=new Uint8Array(E);O!==N;){for(var B=b[O],A=0,U=E-1;(B!==0||A<_)&&U!==-1;U--,A++)B+=256*T[U]>>>0,T[U]=B%u>>>0,B=B/u>>>0;if(B!==0)throw new Error("Non-zero carry");_=A,O++}for(var v=E-_;v!==E&&T[v]===0;)v++;for(var R=l.repeat(x);v>>0,E=new Uint8Array(N);b[x];){var T=n[b.charCodeAt(x)];if(T===255)return;for(var B=0,A=N-1;(T!==0||B>>0,E[A]=T%256>>>0,T=T/256>>>0;if(T!==0)throw new Error("Non-zero carry");O=B,x++}for(var U=N-O;U!==N&&E[U]===0;)U++;for(var v=new Uint8Array(_+(N-U)),R=_;U!==N;)v[R++]=E[U++];return v}function w(b){var x=y(b);if(x)return x;throw new Error("Non-base"+u+" character")}return{encode:m,decodeUnsafe:y,decode:w}}return lx=e,lx}var yF;function bV(){if(yF)return jd;yF=1,Object.defineProperty(jd,"__esModule",{value:!0}),jd.decode=jd.encode=void 0;const e=Yw(),t=zl(),n=dM(),r="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function i(a,u="00"){const l=typeof a=="string"?(0,t.hexToBytes)(a):a,f=typeof u=="string"?(0,t.hexToBytes)(u):a;if(!(l instanceof Uint8Array)||!(f instanceof Uint8Array))throw new TypeError("Argument must be of type Uint8Array or string");const p=(0,e.sha256)((0,e.sha256)(new Uint8Array([...f,...l])));return n(r).encode([...f,...l,...p.slice(0,4)])}jd.encode=i;function o(a){const u=n(r).decode(a),l=u.slice(0,1),f=u.slice(1,-4),p=(0,e.sha256)((0,e.sha256)(new Uint8Array([...l,...f])));return u.slice(-4).forEach((m,y)=>{if(m!==p[y])throw new Error("Invalid checksum")}),{prefix:l,data:f}}return jd.decode=o,jd}var wF;function SV(){return wF||(wF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.c32ToB58=e.b58ToC32=e.c32addressDecode=e.c32address=e.versions=void 0;const t=lM(),n=bV(),r=zl();e.versions={mainnet:{p2pkh:22,p2sh:20},testnet:{p2pkh:26,p2sh:21}};const i={};i[0]=e.versions.mainnet.p2pkh,i[5]=e.versions.mainnet.p2sh,i[111]=e.versions.testnet.p2pkh,i[196]=e.versions.testnet.p2sh;const o={};o[e.versions.mainnet.p2pkh]=0,o[e.versions.mainnet.p2sh]=5,o[e.versions.testnet.p2pkh]=111,o[e.versions.testnet.p2sh]=196;function a(p,m){if(!m.match(/^[0-9a-fA-F]{40}$/))throw new Error("Invalid argument: not a hash160 hex string");return`S${(0,t.c32checkEncode)(p,m)}`}e.c32address=a;function u(p){if(p.length<=5)throw new Error("Invalid c32 address: invalid length");if(p[0]!="S")throw new Error('Invalid c32 address: must start with "S"');return(0,t.c32checkDecode)(p.slice(1))}e.c32addressDecode=u;function l(p,m=-1){const y=n.decode(p),w=(0,r.bytesToHex)(y.data),b=parseInt((0,r.bytesToHex)(y.prefix),16);let x;return m<0?(x=b,i[b]!==void 0&&(x=i[b])):x=m,a(x,w)}e.b58ToC32=l;function f(p,m=-1){const y=u(p),w=y[0],b=y[1];let x;m<0?(x=w,o[w]!==void 0&&(x=o[w])):x=m;let _=x.toString(16);return _.length===1&&(_=`0${_}`),n.encode(b,_)}e.c32ToB58=f}(ux)),ux}var bF;function vV(){return bF||(bF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.b58ToC32=e.c32ToB58=e.versions=e.c32normalize=e.c32addressDecode=e.c32address=e.c32checkDecode=e.c32checkEncode=e.c32decode=e.c32encode=void 0;const t=cM();Object.defineProperty(e,"c32encode",{enumerable:!0,get:function(){return t.c32encode}}),Object.defineProperty(e,"c32decode",{enumerable:!0,get:function(){return t.c32decode}}),Object.defineProperty(e,"c32normalize",{enumerable:!0,get:function(){return t.c32normalize}});const n=lM();Object.defineProperty(e,"c32checkEncode",{enumerable:!0,get:function(){return n.c32checkEncode}}),Object.defineProperty(e,"c32checkDecode",{enumerable:!0,get:function(){return n.c32checkDecode}});const r=SV();Object.defineProperty(e,"c32address",{enumerable:!0,get:function(){return r.c32address}}),Object.defineProperty(e,"c32addressDecode",{enumerable:!0,get:function(){return r.c32addressDecode}}),Object.defineProperty(e,"c32ToB58",{enumerable:!0,get:function(){return r.c32ToB58}}),Object.defineProperty(e,"b58ToC32",{enumerable:!0,get:function(){return r.b58ToC32}}),Object.defineProperty(e,"versions",{enumerable:!0,get:function(){return r.versions}})}(sx)),sx}var Xw=vV();function xV(e,t){switch(t=mr(t??Ag),e){case vt.P2PKH:switch(t.transactionVersion){case Ni.Mainnet:return Ao.MainnetSingleSig;case Ni.Testnet:return Ao.TestnetSingleSig;default:throw new Error(`Unexpected transactionVersion ${t.transactionVersion} for hashMode ${e}`)}case vt.P2SH:case vt.P2SHNonSequential:case vt.P2WPKH:case vt.P2WSH:case vt.P2WSHNonSequential:switch(t.transactionVersion){case Ni.Mainnet:return Ao.MainnetMultiSig;case Ni.Testnet:return Ao.TestnetMultiSig;default:throw new Error(`Unexpected transactionVersion ${t.transactionVersion} for hashMode ${e}`)}default:throw new Error(`Unexpected hashMode ${e}`)}}const _V=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),fM=Uint8Array.from({length:16},(e,t)=>t),kV=fM.map(e=>(9*e+5)%16);let z_=[fM],W_=[kV];for(let e=0;e<4;e++)for(let t of[z_,W_])t.push(t[e].map(n=>_V[n]));const hM=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),RV=z_.map((e,t)=>e.map(n=>hM[t][n])),TV=W_.map((e,t)=>e.map(n=>hM[t][n])),OV=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),NV=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),S0=(e,t)=>e<>>32-t;function SF(e,t,n,r){return e===0?t^n^r:e===1?t&n|~t&r:e===2?(t|~n)^r:e===3?t&r|n&~r:t^(n|~r)}const v0=new Uint32Array(16);class CV extends q_{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:n,h2:r,h3:i,h4:o}=this;return[t,n,r,i,o]}set(t,n,r,i,o){this.h0=t|0,this.h1=n|0,this.h2=r|0,this.h3=i|0,this.h4=o|0}process(t,n){for(let w=0;w<16;w++,n+=4)v0[w]=t.getUint32(n,!0);let r=this.h0|0,i=r,o=this.h1|0,a=o,u=this.h2|0,l=u,f=this.h3|0,p=f,m=this.h4|0,y=m;for(let w=0;w<5;w++){const b=4-w,x=OV[w],_=NV[w],O=z_[w],N=W_[w],E=RV[w],T=TV[w];for(let B=0;B<16;B++){const A=S0(r+SF(w,o,u,f)+v0[O[B]]+x,E[B])+m|0;r=m,m=f,f=S0(u,10)|0,u=o,o=A}for(let B=0;B<16;B++){const A=S0(i+SF(b,a,l,p)+v0[N[B]]+_,T[B])+y|0;i=y,y=p,p=S0(l,10)|0,l=a,a=A}}this.set(this.h1+u+p|0,this.h2+f+y|0,this.h3+m+i|0,this.h4+r+a|0,this.h0+o+l|0)}roundClean(){v0.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const pM=vf(()=>new CV),x0=BigInt(2**32-1),v1=BigInt(32);function mM(e,t=!1){return t?{h:Number(e&x0),l:Number(e>>v1&x0)}:{h:Number(e>>v1&x0)|0,l:Number(e&x0)|0}}function EV(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0),FV=(e,t,n)=>e>>>n,IV=(e,t,n)=>e<<32-n|t>>>n,PV=(e,t,n)=>e>>>n|t<<32-n,MV=(e,t,n)=>e<<32-n|t>>>n,LV=(e,t,n)=>e<<64-n|t>>>n-32,BV=(e,t,n)=>e>>>n-32|t<<64-n,jV=(e,t)=>t,DV=(e,t)=>e,JV=(e,t,n)=>e<>>32-n,$V=(e,t,n)=>t<>>32-n,qV=(e,t,n)=>t<>>64-n,UV=(e,t,n)=>e<>>64-n;function HV(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}const zV=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),WV=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,VV=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),GV=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,KV=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),QV=(e,t,n,r,i,o)=>t+n+r+i+o+(e/2**32|0)|0,xt={fromBig:mM,split:EV,toBig:AV,shrSH:FV,shrSL:IV,rotrSH:PV,rotrSL:MV,rotrBH:LV,rotrBL:BV,rotr32H:jV,rotr32L:DV,rotlSH:JV,rotlSL:$V,rotlBH:qV,rotlBL:UV,add:HV,add3L:zV,add3H:WV,add4L:VV,add4H:GV,add5H:QV,add5L:KV},[YV,XV]=xt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),Sl=new Uint32Array(80),vl=new Uint32Array(80);class Zw extends q_{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:n,Bh:r,Bl:i,Ch:o,Cl:a,Dh:u,Dl:l,Eh:f,El:p,Fh:m,Fl:y,Gh:w,Gl:b,Hh:x,Hl:_}=this;return[t,n,r,i,o,a,u,l,f,p,m,y,w,b,x,_]}set(t,n,r,i,o,a,u,l,f,p,m,y,w,b,x,_){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=o|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=f|0,this.El=p|0,this.Fh=m|0,this.Fl=y|0,this.Gh=w|0,this.Gl=b|0,this.Hh=x|0,this.Hl=_|0}process(t,n){for(let E=0;E<16;E++,n+=4)Sl[E]=t.getUint32(n),vl[E]=t.getUint32(n+=4);for(let E=16;E<80;E++){const T=Sl[E-15]|0,B=vl[E-15]|0,A=xt.rotrSH(T,B,1)^xt.rotrSH(T,B,8)^xt.shrSH(T,B,7),U=xt.rotrSL(T,B,1)^xt.rotrSL(T,B,8)^xt.shrSL(T,B,7),v=Sl[E-2]|0,R=vl[E-2]|0,C=xt.rotrSH(v,R,19)^xt.rotrBH(v,R,61)^xt.shrSH(v,R,6),M=xt.rotrSL(v,R,19)^xt.rotrBL(v,R,61)^xt.shrSL(v,R,6),J=xt.add4L(U,M,vl[E-7],vl[E-16]),P=xt.add4H(J,A,C,Sl[E-7],Sl[E-16]);Sl[E]=P|0,vl[E]=J|0}let{Ah:r,Al:i,Bh:o,Bl:a,Ch:u,Cl:l,Dh:f,Dl:p,Eh:m,El:y,Fh:w,Fl:b,Gh:x,Gl:_,Hh:O,Hl:N}=this;for(let E=0;E<80;E++){const T=xt.rotrSH(m,y,14)^xt.rotrSH(m,y,18)^xt.rotrBH(m,y,41),B=xt.rotrSL(m,y,14)^xt.rotrSL(m,y,18)^xt.rotrBL(m,y,41),A=m&w^~m&x,U=y&b^~y&_,v=xt.add5L(N,B,U,XV[E],vl[E]),R=xt.add5H(v,O,T,A,YV[E],Sl[E]),C=v|0,M=xt.rotrSH(r,i,28)^xt.rotrBH(r,i,34)^xt.rotrBH(r,i,39),J=xt.rotrSL(r,i,28)^xt.rotrBL(r,i,34)^xt.rotrBL(r,i,39),P=r&o^r&u^o&u,D=i&a^i&l^a&l;O=x|0,N=_|0,x=w|0,_=b|0,w=m|0,b=y|0,{h:m,l:y}=xt.add(f|0,p|0,R|0,C|0),f=u|0,p=l|0,u=o|0,l=a|0,o=r|0,a=i|0;const q=xt.add3L(C,J,D);r=xt.add3H(q,R,M,P),i=q|0}({h:r,l:i}=xt.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:o,l:a}=xt.add(this.Bh|0,this.Bl|0,o|0,a|0),{h:u,l}=xt.add(this.Ch|0,this.Cl|0,u|0,l|0),{h:f,l:p}=xt.add(this.Dh|0,this.Dl|0,f|0,p|0),{h:m,l:y}=xt.add(this.Eh|0,this.El|0,m|0,y|0),{h:w,l:b}=xt.add(this.Fh|0,this.Fl|0,w|0,b|0),{h:x,l:_}=xt.add(this.Gh|0,this.Gl|0,x|0,_|0),{h:O,l:N}=xt.add(this.Hh|0,this.Hl|0,O|0,N|0),this.set(r,i,o,a,u,l,f,p,m,y,w,b,x,_,O,N)}roundClean(){Sl.fill(0),vl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class ZV extends Zw{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class eG extends Zw{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class tG extends Zw{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const nG=vf(()=>new Zw);vf(()=>new ZV);const rG=vf(()=>new eG);vf(()=>new tG);var Jm={exports:{}};Jm.exports;var vF;function iG(){return vF||(vF=1,function(e,t){var n=200,r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Array]",u="[object Boolean]",l="[object Date]",f="[object Error]",p="[object Function]",m="[object GeneratorFunction]",y="[object Map]",w="[object Number]",b="[object Object]",x="[object Promise]",_="[object RegExp]",O="[object Set]",N="[object String]",E="[object Symbol]",T="[object WeakMap]",B="[object ArrayBuffer]",A="[object DataView]",U="[object Float32Array]",v="[object Float64Array]",R="[object Int8Array]",C="[object Int16Array]",M="[object Int32Array]",J="[object Uint8Array]",P="[object Uint8ClampedArray]",D="[object Uint16Array]",q="[object Uint32Array]",K=/[\\^$.*+?()[\]{}|]/g,Q=/\w*$/,H=/^\[object .+?Constructor\]$/,X=/^(?:0|[1-9]\d*)$/,I={};I[o]=I[a]=I[B]=I[A]=I[u]=I[l]=I[U]=I[v]=I[R]=I[C]=I[M]=I[y]=I[w]=I[b]=I[_]=I[O]=I[N]=I[E]=I[J]=I[P]=I[D]=I[q]=!0,I[f]=I[p]=I[T]=!1;var te=typeof Yd=="object"&&Yd&&Yd.Object===Object&&Yd,ge=typeof self=="object"&&self&&self.Object===Object&&self,oe=te||ge||Function("return this")(),be=t&&!t.nodeType&&t,ke=be&&!0&&e&&!e.nodeType&&e,Ne=ke&&ke.exports===be;function Xe(j,ue){return j.set(ue[0],ue[1]),j}function Ze(j,ue){return j.add(ue),j}function Nt(j,ue){for(var ye=-1,et=j?j.length:0;++ye-1}function Wn(j,ue){var ye=this.__data__,et=Af(ye,j);return et<0?ye.push([j,ue]):ye[et][1]=ue,this}ot.prototype.clear=Ke,ot.prototype.delete=Et,ot.prototype.get=Ut,ot.prototype.has=Lt,ot.prototype.set=Wn;function Xn(j){var ue=-1,ye=j?j.length:0;for(this.clear();++ue-1&&j%1==0&&j-1&&j%1==0&&j<=i}function _s(j){var ue=typeof j;return!!j&&(ue=="object"||ue=="function")}function ny(j){return!!j&&typeof j=="object"}function xp(j){return Xg(j)?Wg(j):Mb(j)}function nd(){return[]}function rd(){return!1}e.exports=Uo}(Jm,Jm.exports)),Jm.exports}var oG=iG();const sG=Ju(oG);var we;(function(e){e.Int="int",e.UInt="uint",e.Buffer="buffer",e.BoolTrue="true",e.BoolFalse="false",e.PrincipalStandard="address",e.PrincipalContract="contract",e.ResponseOk="ok",e.ResponseErr="err",e.OptionalNone="none",e.OptionalSome="some",e.List="list",e.Tuple="tuple",e.StringASCII="ascii",e.StringUTF8="utf8"})(we||(we={}));var nr;(function(e){e[e.int=0]="int",e[e.uint=1]="uint",e[e.buffer=2]="buffer",e[e.true=3]="true",e[e.false=4]="false",e[e.address=5]="address",e[e.contract=6]="contract",e[e.ok=7]="ok",e[e.err=8]="err",e[e.none=9]="none",e[e.some=10]="some",e[e.list=11]="list",e[e.tuple=12]="tuple",e[e.ascii=13]="ascii",e[e.utf8=14]="utf8"})(nr||(nr={}));function V_(e){return nr[e]}function Kd(e,t="hex"){switch(e.type){case we.BoolTrue:return"true";case we.BoolFalse:return"false";case we.Int:return e.value.toString();case we.UInt:return`u${e.value.toString()}`;case we.Buffer:if(t==="tryAscii"){const n=AP(rt(e.value));if(/[ -~]/.test(n))return JSON.stringify(n)}return`0x${e.value}`;case we.OptionalNone:return"none";case we.OptionalSome:return`(some ${Kd(e.value,t)})`;case we.ResponseErr:return`(err ${Kd(e.value,t)})`;case we.ResponseOk:return`(ok ${Kd(e.value,t)})`;case we.PrincipalStandard:case we.PrincipalContract:return e.value;case we.List:return`(list ${e.value.map(n=>Kd(n,t)).join(" ")})`;case we.Tuple:return`(tuple ${Object.keys(e.value).map(n=>`(${n} ${Kd(e.value[n],t)})`).join(" ")})`;case we.StringASCII:return`"${e.value}"`;case we.StringUTF8:return`u"${e.value}"`}}function dh(e){switch(e.type){case we.BoolTrue:case we.BoolFalse:return"bool";case we.Int:return"int";case we.UInt:return"uint";case we.Buffer:return`(buff ${Math.ceil(e.value.length/2)})`;case we.OptionalNone:return"(optional none)";case we.OptionalSome:return`(optional ${dh(e.value)})`;case we.ResponseErr:return`(response UnknownType ${dh(e.value)})`;case we.ResponseOk:return`(response ${dh(e.value)} UnknownType)`;case we.PrincipalStandard:case we.PrincipalContract:return"principal";case we.List:return`(list ${e.value.length} ${e.value.length?dh(e.value[0]):"UnknownType"})`;case we.Tuple:return`(tuple ${Object.keys(e.value).map(t=>`(${t} ${dh(e.value[t])})`).join(" ")})`;case we.StringASCII:return`(string-ascii ${EP(e.value).length})`;case we.StringUTF8:return`(string-utf8 ${as(e.value).length})`}}const aG=()=>({type:we.BoolTrue}),cG=()=>({type:we.BoolFalse}),kr=e=>{if(e.byteLength>1048576)throw new Error("Cannot construct clarity buffer that is greater than 1MB");return{type:we.Buffer,value:at(e)}},xF=BigInt("0xffffffffffffffffffffffffffffffff"),uG=BigInt(0),_F=BigInt("0x7fffffffffffffffffffffffffffffff"),kF=BigInt("-170141183460469231731687303715884105728"),lG=e=>{typeof e=="string"&&e.toLowerCase().startsWith("0x")&&(e=p1(rt(e))),ai(e,Uint8Array)&&(e=p1(e));const t=Yt(e);if(t>_F)throw new RangeError(`Cannot construct clarity integer from value greater than ${_F}`);if(t{const t=Yt(e);if(txF)throw new RangeError(`Cannot construct unsigned clarity integer greater than ${xF}`);return{type:we.UInt,value:t}};function dG(e){return{type:we.List,value:e}}function Rr(){return{type:we.OptionalNone}}function Xi(e){return{type:we.OptionalSome,value:e}}var qe;(function(e){e[e.Address=0]="Address",e[e.Principal=1]="Principal",e[e.LengthPrefixedString=2]="LengthPrefixedString",e[e.MemoString=3]="MemoString",e[e.Asset=4]="Asset",e[e.PostCondition=5]="PostCondition",e[e.PublicKey=6]="PublicKey",e[e.LengthPrefixedList=7]="LengthPrefixedList",e[e.Payload=8]="Payload",e[e.MessageSignature=9]="MessageSignature",e[e.StructuredDataSignature=10]="StructuredDataSignature",e[e.TransactionAuthField=11]="TransactionAuthField"})(qe||(qe={}));function fG(){return{type:qe.Address,version:Ao.MainnetSingleSig,hash160:"0".repeat(40)}}function RF(e){if(e&&RM(e,ow))throw new Error(`Memo exceeds maximum length of ${ow} bytes`);return{type:qe.MemoString,content:e}}function eb(e,t){return{type:qe.LengthPrefixedList,lengthPrefixBytes:4,values:e}}function x1(e){if(rt(e).byteLength!=Fg)throw Error("Invalid signature");return{type:qe.MessageSignature,data:e}}function hG(e,t,n){return typeof e=="string"&&(e=no(e)),typeof n=="string"&&(n=RF(n)),{type:qe.Payload,payloadType:en.TokenTransfer,recipient:e,amount:Yt(t),memo:n??RF("")}}function gM(e,t,n,r){return typeof t=="string"&&(t=Bo(t)),typeof n=="string"&&(n=Bo(n)),{type:qe.Payload,payloadType:en.ContractCall,contractAddress:typeof e=="string"?gs(e):e,contractName:t,functionName:n,functionArgs:r}}function pG(e){return Bo(e,4,1e5)}function TF(e,t,n){return typeof e=="string"&&(e=Bo(e)),typeof t=="string"&&(t=pG(t)),typeof n=="number"?{type:qe.Payload,payloadType:en.VersionedSmartContract,clarityVersion:n,contractName:e,codeBody:t}:{type:qe.Payload,payloadType:en.SmartContract,contractName:e,codeBody:t}}function mG(){return{type:qe.Payload,payloadType:en.PoisonMicroblock}}function OF(e,t){if(e.byteLength!=rf)throw Error(`Coinbase buffer size must be ${rf} bytes`);return t!=null?{type:qe.Payload,payloadType:en.CoinbaseToAltRecipient,coinbaseBytes:e,recipient:t}:{type:qe.Payload,payloadType:en.Coinbase,coinbaseBytes:e}}function gG(e,t,n){if(e.byteLength!=rf)throw Error(`Coinbase buffer size must be ${rf} bytes`);if(n.byteLength!=m1)throw Error(`VRF proof buffer size must be ${m1} bytes`);return{type:qe.Payload,payloadType:en.NakamotoCoinbase,coinbaseBytes:e,recipient:t.type===we.OptionalSome?t.value:void 0,vrfProof:n}}function yG(e,t,n,r,i,o,a){return{type:qe.Payload,payloadType:en.TenureChange,tenureHash:e,previousTenureHash:t,burnViewHash:n,previousTenureEnd:r,previousTenureBlocks:i,cause:o,publicKeyHash:a}}function Bo(e,t,n){const r=t||1,i=n||UW;if(RM(e,i))throw new Error(`String length exceeds maximum bytes ${i}`);return{type:qe.LengthPrefixedString,content:e,lengthPrefixBytes:r,maxLengthBytes:i}}function wG(e,t,n){return{type:qe.Asset,address:gs(e),contractName:Bo(t),assetName:Bo(n)}}function gs(e){const t=Xw.c32addressDecode(e);return{type:qe.Address,version:t[0],hash160:t[1]}}function bG(e,t){const n=gs(e),r=Bo(t);return{type:qe.Principal,prefix:Ai.Contract,address:n,contractName:r}}function SG(e){const t=gs(e);return{type:qe.Principal,prefix:Ai.Standard,address:t}}function Sh(e,t){return{pubKeyEncoding:e,type:qe.TransactionAuthField,contents:t}}function ku(e){switch(e.type){case qe.Address:return Mg(e);case qe.Principal:return yM(e);case qe.LengthPrefixedString:return Wh(e);case qe.MemoString:return xG(e);case qe.Asset:return bM(e);case qe.PostCondition:return vM(e);case qe.PublicKey:return R1(e);case qe.LengthPrefixedList:return G_(e);case qe.Payload:return K_(e);case qe.TransactionAuthField:return OG(e);case qe.MessageSignature:return Q_(e)}}function Mg(e){const t=[];return t.push(rt(Cg(e.version,1))),t.push(rt(e.hash160)),Hn(t)}function zh(e){const t=ai(e,fn)?e:new fn(e),n=Hw(at(t.readBytes(1))),r=at(t.readBytes(20));return{type:qe.Address,version:n,hash160:r}}function yM(e){const t=[];return t.push(e.prefix),(e.prefix===Ai.Standard||e.prefix===Ai.Contract)&&t.push(Mg(e.address)),e.prefix===Ai.Contract&&t.push(Wh(e.contractName)),Hn(t)}function vG(e){const t=ai(e,fn)?e:new fn(e),n=t.readUInt8Enum(Ai,o=>{throw new Ci(`Unexpected Principal payload type: ${o}`)});if(n===Ai.Origin)return{type:qe.Principal,prefix:n};const r=zh(t);if(n===Ai.Standard)return{type:qe.Principal,prefix:n,address:r};const i=to(t);return{type:qe.Principal,prefix:n,address:r,contractName:i}}function Wh(e){const t=[],n=as(e.content),r=n.byteLength;return t.push(rt(Cg(r,e.lengthPrefixBytes))),t.push(n),Hn(t)}function to(e,t,n){t=t||1;const r=ai(e,fn)?e:new fn(e),i=Hw(at(r.readBytes(t))),o=Eg(r.readBytes(i));return Bo(o,t,n??128)}function xG(e){const t=[],n=as(e.content),r=WG(at(n),ow*2);return t.push(rt(r)),Hn(t)}function wM(e){const t=ai(e,fn)?e:new fn(e);let n=Eg(t.readBytes(ow));return n=n.replace(/\u0000*$/,""),{type:qe.MemoString,content:n}}function bM(e){const t=[];return t.push(Mg(e.address)),t.push(Wh(e.contractName)),t.push(Wh(e.assetName)),Hn(t)}function _1(e){const t=ai(e,fn)?e:new fn(e);return{type:qe.Asset,address:zh(t),contractName:to(t),assetName:to(t)}}function G_(e){const t=e.values,n=[];n.push(rt(Cg(t.length,e.lengthPrefixBytes)));for(const r of t)n.push(ku(r));return Hn(n)}function SM(e,t,n){const r=ai(e,fn)?e:new fn(e),i=Hw(at(r.readBytes(4))),o=[];for(let a=0;aBigInt("0xffffffffffffffff"))throw new bh("The post-condition amount may not be larger than 8 bytes");t.push(Ll(e.amount,8))}return Hn(t)}function kG(e){const t=ai(e,fn)?e:new fn(e),n=t.readUInt8Enum(Or,u=>{throw new Ci(`Could not read ${u} as PostConditionType`)}),r=vG(t);let i,o,a;switch(n){case Or.STX:return i=t.readUInt8Enum(Cu,l=>{throw new Ci(`Could not read ${l} as FungibleConditionCode`)}),a=BigInt(`0x${at(t.readBytes(8))}`),{type:qe.PostCondition,conditionType:Or.STX,principal:r,conditionCode:i,amount:a};case Or.Fungible:return o=_1(t),i=t.readUInt8Enum(Cu,l=>{throw new Ci(`Could not read ${l} as FungibleConditionCode`)}),a=BigInt(`0x${at(t.readBytes(8))}`),{type:qe.PostCondition,conditionType:Or.Fungible,principal:r,conditionCode:i,amount:a,asset:o};case Or.NonFungible:o=_1(t);const u=Co(t);return i=t.readUInt8Enum(ug,l=>{throw new Ci(`Could not read ${l} as FungibleConditionCode`)}),{type:qe.PostCondition,conditionType:Or.NonFungible,principal:r,conditionCode:i,asset:o,assetName:u}}}function K_(e){const t=[];switch(t.push(e.payloadType),e.payloadType){case en.TokenTransfer:t.push(Io(e.recipient)),t.push(Ll(e.amount,8)),t.push(ku(e.memo));break;case en.ContractCall:t.push(ku(e.contractAddress)),t.push(ku(e.contractName)),t.push(ku(e.functionName));const n=new Uint8Array(4);hf(n,e.functionArgs.length,0),t.push(n),e.functionArgs.forEach(r=>{t.push(Io(r))});break;case en.SmartContract:t.push(ku(e.contractName)),t.push(ku(e.codeBody));break;case en.VersionedSmartContract:t.push(e.clarityVersion),t.push(ku(e.contractName)),t.push(ku(e.codeBody));break;case en.PoisonMicroblock:break;case en.Coinbase:t.push(e.coinbaseBytes);break;case en.CoinbaseToAltRecipient:t.push(e.coinbaseBytes),t.push(Io(e.recipient));break;case en.NakamotoCoinbase:t.push(e.coinbaseBytes),t.push(Io(e.recipient?Xi(e.recipient):Rr())),t.push(e.vrfProof);break;case en.TenureChange:t.push(rt(e.tenureHash)),t.push(rt(e.previousTenureHash)),t.push(rt(e.burnViewHash)),t.push(rt(e.previousTenureEnd)),t.push(hf(new Uint8Array(4),e.previousTenureBlocks)),t.push(Dm(new Uint8Array(1),e.cause)),t.push(rt(e.publicKeyHash));break}return Hn(t)}function RG(e){const t=ai(e,fn)?e:new fn(e);switch(t.readUInt8Enum(en,r=>{throw new Error(`Cannot recognize PayloadType: ${r}`)})){case en.TokenTransfer:const r=Co(t),i=Yt(t.readBytes(8)),o=wM(t);return hG(r,i,o);case en.ContractCall:const a=zh(t),u=to(t),l=to(t),f=[],p=t.readUInt32BE();for(let T=0;T{throw new Error(`Cannot recognize ClarityVersion: ${U}`)}),B=to(t),A=to(t,4,1e5);return TF(B,A,T)}case en.PoisonMicroblock:return mG();case en.Coinbase:{const T=t.readBytes(rf);return OF(T)}case en.CoinbaseToAltRecipient:{const T=t.readBytes(rf),B=Co(t);return OF(T,B)}case en.NakamotoCoinbase:{const T=t.readBytes(rf),B=Co(t),A=t.readBytes(m1);return gG(T,B,A)}case en.TenureChange:const w=at(t.readBytes(20)),b=at(t.readBytes(20)),x=at(t.readBytes(20)),_=at(t.readBytes(32)),O=t.readUInt32BE(),N=t.readUInt8Enum(y1,T=>{throw new Error(`Cannot recognize TenureChangeCause: ${T}`)}),E=at(t.readBytes(20));return yG(w,b,x,_,O,N,E)}}function k1(e){const t=ai(e,fn)?e:new fn(e);return x1(at(t.readBytes(Fg)))}function TG(e){const t=ai(e,fn)?e:new fn(e),n=t.readUInt8Enum(No,r=>{throw new Ci(`Could not read ${r} as AuthFieldType`)});switch(n){case No.PublicKeyCompressed:return Sh(_n.Compressed,T1(t));case No.PublicKeyUncompressed:return Sh(_n.Uncompressed,us(rK(T1(t).data)));case No.SignatureCompressed:return Sh(_n.Compressed,k1(t));case No.SignatureUncompressed:return Sh(_n.Uncompressed,k1(t));default:throw new Error(`Unknown auth field type: ${JSON.stringify(n)}`)}}function Q_(e){return rt(e.data)}function OG(e){const t=[];switch(e.contents.type){case qe.PublicKey:t.push(e.pubKeyEncoding===_n.Compressed?No.PublicKeyCompressed:No.PublicKeyUncompressed),t.push(rt(nK(e.contents.data)));break;case qe.MessageSignature:t.push(e.pubKeyEncoding===_n.Compressed?No.SignatureCompressed:No.SignatureUncompressed),t.push(Q_(e.contents));break}return Hn(t)}function R1(e){return e.data.slice()}function T1(e){const t=ai(e,fn)?e:new fn(e),n=t.readUInt8(),r=n===4?WW:zW;return us(Hn([n,t.readBytes(r)]))}function Vh(e,t,n,r){if(r.length===0)throw Error("Invalid number of public keys");if((t===vt.P2PKH||t===vt.P2WPKH)&&(r.length!==1||n!==1))throw Error("Invalid number of public keys or signatures");if((t===vt.P2WPKH||t===vt.P2WSH||t===vt.P2WSHNonSequential)&&!r.map(i=>i.data).every(ap))throw Error("Public keys must be compressed for segwit");switch(t){case vt.P2PKH:return $m(e,TM(r[0].data));case vt.P2WPKH:return $m(e,VG(r[0].data));case vt.P2SH:case vt.P2SHNonSequential:return $m(e,GG(n,r.map(R1)));case vt.P2WSH:case vt.P2WSHNonSequential:return $m(e,KG(n,r.map(R1)))}}function $m(e,t){return{type:qe.Address,version:e,hash160:t}}function tb(e){return Xw.c32address(e.version,e.hash160)}function NF(e){const[t,n,r]=e.split(/\.|::/);return wG(t,n,r)}function dx(e){if(e.includes(".")){const[t,n]=e.split(".");return bG(t,n)}else return SG(e)}function no(e){if(e.includes(".")){const[t,n]=e.split(".");return xM(t,n)}else return NG(e)}function NG(e){const t=gs(e);return{type:we.PrincipalStandard,value:tb(t)}}function CG(e){return{type:we.PrincipalStandard,value:tb(e)}}function xM(e,t){const n=gs(e),r=Bo(t);return _M(n,r)}function _M(e,t){if(as(t.content).byteLength>=128)throw new Error("Contract name must be less than 128 bytes");return{type:we.PrincipalContract,value:`${tb(e)}.${t.content}`}}function EG(e){return{type:we.ResponseErr,value:e}}function AG(e){return{type:we.ResponseOk,value:e}}const Qm=e=>({type:we.StringASCII,value:e}),FG=e=>({type:we.StringUTF8,value:e});function uw(e){for(const t in e)if(!QG(t))throw new Error(`"${t}" is not a valid Clarity name`);return{type:we.Tuple,value:e}}function Co(e){let t;if(typeof e=="string"){const r=e.slice(0,2).toLowerCase()==="0x";t=new fn(rt(r?e.slice(2):e))}else e instanceof Uint8Array?t=new fn(e):t=e;switch(t.readUInt8Enum(nr,r=>{throw new Ci(`Cannot recognize Clarity Type: ${r}`)})){case nr.int:return lG(p1(t.readBytes(16)));case nr.uint:return ft(t.readBytes(16));case nr.buffer:const r=t.readUInt32BE();return kr(t.readBytes(r));case nr.true:return aG();case nr.false:return cG();case nr.address:const i=zh(t);return CG(i);case nr.contract:const o=zh(t),a=to(t);return _M(o,a);case nr.ok:return AG(Co(t));case nr.err:return EG(Co(t));case nr.none:return Rr();case nr.some:return Xi(Co(t));case nr.list:const u=t.readUInt32BE(),l=[];for(let x=0;xi.localeCompare(o));for(const i of r){const o=Bo(i);t.push(Wh(o));const a=Io(e.value[i]);t.push(a)}return ys(e.type,Hn(t))}function kM(e,t){const n=[],r=t=="ascii"?EP(e.value):as(e.value),i=new Uint8Array(4);return hf(i,r.length,0),n.push(i),n.push(r),ys(e.type,Hn(n))}function UG(e){return kM(e,"ascii")}function HG(e){return kM(e,"utf8")}function lw(e){return at(Io(e))}function Io(e){switch(e.type){case we.BoolTrue:case we.BoolFalse:return IG(e);case we.OptionalNone:case we.OptionalSome:return PG(e);case we.Buffer:return MG(e);case we.UInt:return BG(e);case we.Int:return LG(e);case we.PrincipalStandard:return jG(e);case we.PrincipalContract:return DG(e);case we.ResponseOk:case we.ResponseErr:return JG(e);case we.List:return $G(e);case we.Tuple:return qG(e);case we.StringASCII:return UG(e);case we.StringUTF8:return HG(e);default:throw new bh("Unable to serialize. Invalid Clarity Value.")}}const zG=e=>e.length%2?`0${e}`:e,WG=(e,t)=>e.padEnd(t,"0"),RM=(e,t)=>e?as(e).length>t:!1;function Fl(e){return sG(e)}function CF(e,t){const n=Fl(e);return delete n[t],n}const fg=e=>pM(Jr(e)),Y_=e=>at(rG(e)),TM=e=>at(fg(e)),VG=e=>{const t=fg(e),n=so(new Uint8Array([0]),new Uint8Array([t.length]),t),r=fg(n);return at(r)},GG=(e,t)=>{if(e>15||t.length>15)throw Error("P2SH multisig address can only contain up to 15 public keys");const n=[];n.push(80+e),t.forEach(o=>{n.push(o.length),n.push(o)}),n.push(80+t.length),n.push(174);const r=Hn(n),i=fg(r);return at(i)},KG=(e,t)=>{if(e>15||t.length>15)throw Error("P2WSH multisig address can only contain up to 15 public keys");const n=[];n.push(80+e),t.forEach(l=>{n.push(l.length),n.push(l)}),n.push(80+t.length),n.push(174);const r=Hn(n),i=Jr(r),o=[];o.push(0),o.push(i.length),o.push(i);const a=Hn(o),u=fg(a);return at(u)};function QG(e){return/^[a-zA-Z]([a-zA-Z0-9]|[-_!?+<>=/*])*$|^[-+=/*]$|^[<>]=?$/.test(e)&&e.length<128}function YG(e){return`0x${lw(e)}`}function sp(e){return Co(e)}const XG=e=>{if(e.okay)return sp(e.result);throw new Error(e.cause)},xf=e=>{try{return Xw.c32addressDecode(e),!0}catch{return!1}};function ZG(e){const[t,n]=e.split(".");if(!t||!n)throw new Error(`Invalid contract identifier: ${e}`);return[t,n]}ri.hmacSha256Sync=(e,...t)=>{const n=Pg.create(Jr,e);return t.forEach(r=>n.update(r)),n.digest()};function eK(e,t="mainnet"){t=mr(t),e=typeof e=="string"?rt(e):e;const n=xV(vt.P2PKH,t),r=$m(n,TM(e));return tb(r)}function us(e){return e=typeof e=="string"?rt(e):e,{type:qe.PublicKey,data:e}}function tK(e,t,n=_n.Compressed){const r=FP(t),i=new Lo(nw(r.r),nw(r.s)),o=Kt.fromSignature(e,i,r.recoveryId),a=n===_n.Compressed;return o.toHex(a)}function OM(e){return typeof e=="string"?e:at(e)}const Gh=OM;function NM(e){return(typeof e=="string"?e.length/2:e.byteLength)===Uz}function ap(e){return!Gh(e).startsWith("04")}function X_(e){e=B_(e);const t=NM(e);return at(H_(e.slice(0,32),t))}function nK(e){return Kt.fromHex(Gh(e)).toHex(!0)}function rK(e){return Kt.fromHex(Gh(e)).toHex(!1)}function CM(e,t){e=B_(e);const[n,r]=aM(t,e.slice(0,32),{canonical:!0,recovered:!0});if(r==null)throw new Error("No signature recoveryId received");return Cg(r,1)+Lo.fromHex(n).toCompactHex()}function iK({messageHash:e,privateKey:t}){return Hz(CM(t,e))}function Z_(){return{type:qe.MessageSignature,data:at(new Uint8Array(Fg))}}function ek(e,t,n,r){const i=Vh(0,e,1,[us(t)]).hash160,o=ap(t)?_n.Compressed:_n.Uncompressed;return{hashMode:e,signer:i,nonce:Yt(n),fee:Yt(r),keyEncoding:o,signature:Z_()}}function oK(e,t,n,r,i){const o=n.map(us),a=Vh(0,e,t,o).hash160;return{hashMode:e,signer:a,nonce:Yt(r),fee:Yt(i),fields:[],signaturesRequired:t}}function Bl(e){return"signature"in e}function O1(e){return e===vt.P2SH||e===vt.P2WSH}function EM(e){return e===vt.P2SHNonSequential||e===vt.P2WSHNonSequential}function EF(e){const t=Fl(e);return t.nonce=0,t.fee=0,Bl(t)?t.signature=Z_():t.fields=[],{...t,nonce:BigInt(0),fee:BigInt(0)}}function sK(e){const t=[e.hashMode,rt(e.signer),Ll(e.nonce,8),Ll(e.fee,8),e.keyEncoding,Q_(e.signature)];return Hn(t)}function aK(e){const t=[e.hashMode,rt(e.signer),Ll(e.nonce,8),Ll(e.fee,8)],n=eb(e.fields);t.push(G_(n));const r=new Uint8Array(2);return Vz(r,e.signaturesRequired,0),t.push(r),Hn(t)}function cK(e,t){const n=at(t.readBytes(20)),r=BigInt(`0x${at(t.readBytes(8))}`),i=BigInt(`0x${at(t.readBytes(8))}`),o=t.readUInt8Enum(_n,u=>{throw new Ci(`Could not parse ${u} as PubKeyEncoding`)});if(e===vt.P2WPKH&&o!=_n.Compressed)throw new Ci("Failed to parse singlesig spending condition: incomaptible hash mode and key encoding");const a=k1(t);return{hashMode:e,signer:n,nonce:r,fee:i,keyEncoding:o,signature:a}}function uK(e,t){const n=at(t.readBytes(20)),r=BigInt("0x"+at(t.readBytes(8))),i=BigInt("0x"+at(t.readBytes(8))),o=SM(t,qe.TransactionAuthField).values;let a=!1,u=0;for(const f of o)switch(f.contents.type){case qe.PublicKey:ap(f.contents.data)||(a=!0);break;case qe.MessageSignature:if(f.pubKeyEncoding===_n.Uncompressed&&(a=!0),u+=1,u===65536)throw new ef("Failed to parse multisig spending condition: too many signatures");break}const l=t.readUInt16BE();if(a&&(e===vt.P2WSH||e===vt.P2WSHNonSequential))throw new ef("Uncompressed keys are not allowed in this hash mode");return{hashMode:e,signer:n,nonce:r,fee:i,fields:o,signaturesRequired:l}}function fx(e){return Bl(e)?sK(e):aK(e)}function hx(e){const t=e.readUInt8Enum(vt,n=>{throw new Ci(`Could not parse ${n} as AddressHashMode`)});return t===vt.P2PKH||t===vt.P2WPKH?cK(t,e):uK(t,e)}function AM(e,t,n,r){const o=e+at(new Uint8Array([t]))+at(Ll(n,8))+at(Ll(r,8));if(rt(o).byteLength!==49)throw Error("Invalid signature hash length");return Y_(rt(o))}function FM(e,t,n){const r=33+Fg,i=ap(t.data)?_n.Compressed:_n.Uncompressed,o=e+zG(i.toString(16))+n,a=rt(o);if(a.byteLength>r)throw Error("Invalid signature hash length");return Y_(a)}function lK(e,t,n,r,i){const o=AM(e,t,n,r),a=CM(i,o),u=us(X_(i)),l=FM(o,u,a);return{nextSig:a,nextSigHash:l}}function tk(e,t,n,r,i,o){const a=AM(e,t,n,r),u=us(tK(a,o,i)),l=FM(a,u,o);return{pubKey:u,nextSigHash:l}}function dK(){const e=ek(vt.P2PKH,"",0,0);return e.signer=fG().hash160,e.keyEncoding=_n.Compressed,e.signature=Z_(),e}function AF(e,t,n){return Bl(e)?fK(e,t,n):hK(e,t,n)}function fK(e,t,n){const{pubKey:r,nextSigHash:i}=tk(t,n,e.fee,e.nonce,e.keyEncoding,e.signature.data),o=Vh(0,e.hashMode,1,[r]).hash160;if(o!==e.signer)throw new ef(`Signer hash does not equal hash of public key(s): ${o} != ${e.signer}`);return i}function hK(e,t,n){const r=[];let i=t,o=!1,a=0;for(const l of e.fields)switch(l.contents.type){case qe.PublicKey:ap(l.contents.data)||(o=!0),r.push(l.contents);break;case qe.MessageSignature:l.pubKeyEncoding===_n.Uncompressed&&(o=!0);const{pubKey:f,nextSigHash:p}=tk(i,n,e.fee,e.nonce,l.pubKeyEncoding,l.contents.data);if(O1(e.hashMode)&&(i=p),r.push(f),a+=1,a===65536)throw new ef("Too many signatures");break}if(O1(e.hashMode)&&a!==e.signaturesRequired||EM(e.hashMode)&&a{throw new Ci(`Could not parse ${r} as AuthType`)});let n;switch(t){case un.Standard:return n=hx(e),nk(n);case un.Sponsored:n=hx(e);const r=hx(e);return rk(n,r)}}var Gt;(function(e){e[e.ClarityAbiTypeUInt128=1]="ClarityAbiTypeUInt128",e[e.ClarityAbiTypeInt128=2]="ClarityAbiTypeInt128",e[e.ClarityAbiTypeBool=3]="ClarityAbiTypeBool",e[e.ClarityAbiTypePrincipal=4]="ClarityAbiTypePrincipal",e[e.ClarityAbiTypeNone=5]="ClarityAbiTypeNone",e[e.ClarityAbiTypeBuffer=6]="ClarityAbiTypeBuffer",e[e.ClarityAbiTypeResponse=7]="ClarityAbiTypeResponse",e[e.ClarityAbiTypeOptional=8]="ClarityAbiTypeOptional",e[e.ClarityAbiTypeTuple=9]="ClarityAbiTypeTuple",e[e.ClarityAbiTypeList=10]="ClarityAbiTypeList",e[e.ClarityAbiTypeStringAscii=11]="ClarityAbiTypeStringAscii",e[e.ClarityAbiTypeStringUtf8=12]="ClarityAbiTypeStringUtf8",e[e.ClarityAbiTypeTraitReference=13]="ClarityAbiTypeTraitReference"})(Gt||(Gt={}));const IM=e=>typeof e=="string",PM=e=>e.buffer!==void 0,MM=e=>e["string-ascii"]!==void 0,LM=e=>e["string-utf8"]!==void 0,BM=e=>e.response!==void 0,jM=e=>e.optional!==void 0,DM=e=>e.tuple!==void 0,JM=e=>e.list!==void 0;function xK(e){if(IM(e)){if(e==="uint128")return{id:Gt.ClarityAbiTypeUInt128,type:e};if(e==="int128")return{id:Gt.ClarityAbiTypeInt128,type:e};if(e==="bool")return{id:Gt.ClarityAbiTypeBool,type:e};if(e==="principal")return{id:Gt.ClarityAbiTypePrincipal,type:e};if(e==="trait_reference")return{id:Gt.ClarityAbiTypeTraitReference,type:e};if(e==="none")return{id:Gt.ClarityAbiTypeNone,type:e};throw new Error(`Unexpected Clarity ABI type primitive: ${JSON.stringify(e)}`)}else{if(PM(e))return{id:Gt.ClarityAbiTypeBuffer,type:e};if(BM(e))return{id:Gt.ClarityAbiTypeResponse,type:e};if(jM(e))return{id:Gt.ClarityAbiTypeOptional,type:e};if(DM(e))return{id:Gt.ClarityAbiTypeTuple,type:e};if(JM(e))return{id:Gt.ClarityAbiTypeList,type:e};if(MM(e))return{id:Gt.ClarityAbiTypeStringAscii,type:e};if(LM(e))return{id:Gt.ClarityAbiTypeStringUtf8,type:e};throw new Error(`Unexpected Clarity ABI type: ${JSON.stringify(e)}`)}}function fh(e){if(IM(e))return e==="int128"?"int":e==="uint128"?"uint":e;if(PM(e))return`(buff ${e.buffer.length})`;if(MM(e))return`(string-ascii ${e["string-ascii"].length})`;if(LM(e))return`(string-utf8 ${e["string-utf8"].length})`;if(BM(e))return`(response ${fh(e.response.ok)} ${fh(e.response.error)})`;if(jM(e))return`(optional ${fh(e.optional)})`;if(DM(e))return`(tuple ${e.tuple.map(t=>`(${t.name} ${fh(t.type)})`).join(" ")})`;if(JM(e))return`(list ${e.list.length} ${fh(e.list.type)})`;throw new Error(`Type string unsupported for Clarity type: ${JSON.stringify(e)}`)}function hh(e,t){const n=xK(t);switch(e.type){case we.BoolTrue:case we.BoolFalse:return n.id===Gt.ClarityAbiTypeBool;case we.Int:return n.id===Gt.ClarityAbiTypeInt128;case we.UInt:return n.id===Gt.ClarityAbiTypeUInt128;case we.Buffer:return n.id===Gt.ClarityAbiTypeBuffer&&n.type.buffer.length>=Math.ceil(e.value.length/2);case we.StringASCII:return n.id===Gt.ClarityAbiTypeStringAscii&&n.type["string-ascii"].length>=e.value.length;case we.StringUTF8:return n.id===Gt.ClarityAbiTypeStringUtf8&&n.type["string-utf8"].length>=e.value.length;case we.OptionalNone:return n.id===Gt.ClarityAbiTypeNone||n.id===Gt.ClarityAbiTypeOptional;case we.OptionalSome:return n.id===Gt.ClarityAbiTypeOptional&&hh(e.value,n.type.optional);case we.ResponseErr:return n.id===Gt.ClarityAbiTypeResponse&&hh(e.value,n.type.response.error);case we.ResponseOk:return n.id===Gt.ClarityAbiTypeResponse&&hh(e.value,n.type.response.ok);case we.PrincipalContract:return n.id===Gt.ClarityAbiTypePrincipal||n.id===Gt.ClarityAbiTypeTraitReference;case we.PrincipalStandard:return n.id===Gt.ClarityAbiTypePrincipal;case we.List:return n.id==Gt.ClarityAbiTypeList&&n.type.list.length>=e.value.length&&e.value.every(r=>hh(r,n.type.list.type));case we.Tuple:if(n.id==Gt.ClarityAbiTypeTuple){const r=Fl(e.value);for(let i=0;ir.name===e.functionName.content);if(n.length===1){const i=n[0].args;if(e.functionArgs.length!==i.length)throw new Error(`Clarity function expects ${i.length} argument(s) but received ${e.functionArgs.length}`);for(let o=0;o{throw new Error(`Could not parse ${p} as TransactionVersion`)}),r=t.readUInt32BE(),i=vK(t),o=t.readUInt8Enum(Ri,p=>{throw new Error(`Could not parse ${p} as AnchorMode`)}),a=t.readUInt8Enum(pf,p=>{throw new Error(`Could not parse ${p} as PostConditionMode`)}),u=SM(t,qe.PostCondition),l=RG(t),f=new $M({transactionVersion:n,chainId:r,auth:i,payload:l,postConditions:u,postConditionMode:a});return f.anchorMode=o,f}function ik(e){return Rz(e.transactionVersion)({[Ni.Mainnet]:Ag,[Ni.Testnet]:ag})}function RK(e){const t=e.auth.spendingCondition.hashMode;if([vt.P2SH,vt.P2WSH].includes(t)){const r=e.auth.spendingCondition,i=r.fields.filter(a=>a.contents.type===qe.MessageSignature).length,o=(r.signaturesRequired-i)*(Fg+1);return e.serializeBytes().byteLength+o}else return e.serializeBytes().byteLength}const TK="/v2/transactions",OK="/v2/fees/transfer",NK="/v2/fees/transaction",CK="/v2/accounts",EK="/v2/contracts/interface",AK="/v2/contracts/call-read";async function So({transaction:e,attachment:t,network:n,client:r}){const i=e.serialize(),o=t?typeof t=="string"?t:at(t):void 0,u={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t?{tx:i,attachment:o}:{tx:i})},l=n??ik(e),f=Object.assign({},hs(mr(l)),r),p=`${f.baseUrl}${TK}`,m=await f.fetch(p,u);if(!m.ok)try{return await m.json()}catch(b){throw Error("Failed to broadcast transaction (unable to parse node response).",{cause:b})}const y=await m.text(),w=y.replace(/["]+/g,"");if(!jz(w))throw new Error(y);return{txid:w}}async function FK({address:e,network:t="mainnet",client:n}){const r=Object.assign({},hs(mr(t)),n),i=`${r.baseUrl}/extended/v1/address/${e}/nonces`,a=await(await r.fetch(i)).json();return BigInt(a.possible_next_nonce)}async function IK(e){try{return await FK(e)}catch{}const t=mr(e.network??"mainnet"),n=Object.assign({},hs(t),e.client),r=`${n.baseUrl}${CK}/${e.address}?proof=0`,i=await n.fetch(r);if(!i.ok){const a=await i.text().catch(()=>"");throw new Error(`Error fetching nonce. Response ${i.status}: ${i.statusText}. Attempted to fetch ${r} and failed with the message: "${a}"`)}const o=await i.json();return BigInt(o.nonce)}async function PK({transaction:e,network:t,client:n}){const r=t??ik(e),i=Object.assign({},hs(mr(r)),n),o=`${i.baseUrl}${OK}`,a=await i.fetch(o,{headers:{Accept:"application/text"}});if(!a.ok){const p=await a.text().catch(()=>"");throw new Error(`Error estimating transfer fee. Response ${a.status}: ${a.statusText}. Attempted to fetch ${o} and failed with the message: "${p}"`)}const u=await a.text(),l=BigInt(Math.ceil(e.serializeBytes().byteLength));return BigInt(u)*l}async function MK({payload:e,estimatedLength:t,network:n="mainnet",client:r}){var p;const o={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({transaction_payload:e,estimated_len:t})},a=Object.assign({},hs(mr(n)),r),u=`${a.baseUrl}${NK}`,l=await a.fetch(u,o);if(!l.ok){const m=await l.json().catch(()=>({}));throw(m==null?void 0:m.reason)==="NoEstimateAvailable"?new QP(((p=m==null?void 0:m.reason_data)==null?void 0:p.message)??""):new Error(`Error estimating transaction fee. Response ${l.status}: ${l.statusText}. Attempted to fetch ${u} and failed with the message: "${m}"`)}return(await l.json()).estimations}async function LK({transaction:e,network:t,client:n}){const r=t??ik(e),i=Object.assign({},hs(mr(r)),n);try{const o=RK(e);return(await MK({payload:at(K_(e.payload)),estimatedLength:o,network:r,client:i}))[1].fee}catch(o){if(!(o instanceof QP))throw o;return await PK({transaction:e,network:r})}}async function BK({contractAddress:e,contractName:t,network:n="mainnet",client:r}){const i=Object.assign({},hs(mr(n)),r),o=`${i.baseUrl}${EK}/${e}/${t}`,a=await i.fetch(o);if(!a.ok){const u=await a.text().catch(()=>"");throw new Error(`Error fetching contract ABI for contract "${t}" at address ${e}. Response ${a.status}: ${a.statusText}. Attempted to fetch ${o} and failed with the message: "${u}"`)}return JSON.parse(await a.text())}async function ph({contractName:e,contractAddress:t,functionName:n,functionArgs:r,senderAddress:i,network:o="mainnet",client:a}){const u={sender:i,arguments:r.map(w=>YG(w))},l={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)},f=encodeURIComponent(n),p=Object.assign({},hs(mr(o)),a),m=`${p.baseUrl}${AK}/${t}/${e}/${f}`,y=await p.fetch(m,l);if(!y.ok){const w=await y.text().catch(()=>"");throw new Error(`Error calling read-only function. Response ${y.status}: ${y.statusText}. Attempted to fetch ${m} and failed with the message: "${w}"`)}return await y.json().then(XG)}const IF={eq:Cu.Equal,gt:Cu.Greater,lt:Cu.Less,gte:Cu.GreaterEqual,lte:Cu.LessEqual},jK={sent:ug.Sends,"not-sent":ug.DoesNotSend};function qM(e){switch(e.type){case"stx-postcondition":return{type:qe.PostCondition,conditionType:Or.STX,principal:e.address==="origin"?{type:qe.Principal,prefix:Ai.Origin}:dx(e.address),conditionCode:IF[e.condition],amount:BigInt(e.amount)};case"ft-postcondition":return{type:qe.PostCondition,conditionType:Or.Fungible,principal:e.address==="origin"?{type:qe.Principal,prefix:Ai.Origin}:dx(e.address),conditionCode:IF[e.condition],amount:BigInt(e.amount),asset:NF(e.asset)};case"nft-postcondition":return{type:qe.PostCondition,conditionType:Or.NonFungible,principal:e.address==="origin"?{type:qe.Principal,prefix:Ai.Origin}:dx(e.address),conditionCode:jK[e.condition],asset:NF(e.asset),assetName:e.assetId};default:throw new Error("Invalid post condition type")}}function UM(e){const t=qM(e);return _G(t)}function DK(e){if(typeof e=="number")return e;if(e==="allow")return pf.Allow;if(e==="deny")return pf.Deny;throw new Error(`Invalid post condition mode: ${e}`)}class HM{constructor(t){this.transaction=t,this.sigHash=t.signBegin(),this.originDone=!1,this.checkOversign=!0,this.checkOverlap=!0;const n=t.auth.spendingCondition;if(n&&!Bl(n)){if(n.fields.filter(r=>r.contents.type===qe.MessageSignature).length>=n.signaturesRequired)throw new Error("SpendingCondition has more signatures than are expected");n.fields.forEach(r=>{if(r.contents.type!==qe.MessageSignature)return;const i=r.contents,o=tk(this.sigHash,t.auth.authType,n.fee,n.nonce,_n.Compressed,i.data);EM(n.hashMode)||(this.sigHash=o.nextSigHash)})}}static createSponsorSigner(t,n){if(t.auth.authType!=un.Sponsored)throw new Zo("Cannot add sponsor to non-sponsored transaction");const r=Fl(t);r.setSponsor(n);const i=r.verifyOrigin(),o=new this(r);return o.originDone=!0,o.sigHash=i,o.checkOversign=!0,o.checkOverlap=!0,o}signOrigin(t){if(this.checkOverlap&&this.originDone)throw new Zo("Cannot sign origin after sponsor key");if(this.transaction.auth===void 0)throw new Zo('"transaction.auth" is undefined');if(this.transaction.auth.spendingCondition===void 0)throw new Zo('"transaction.auth.spendingCondition" is undefined');const n=this.transaction.auth.spendingCondition;if((n.hashMode===vt.P2SH||n.hashMode===vt.P2WSH)&&this.checkOversign&&n.fields.filter(i=>i.contents.type===qe.MessageSignature).length>=n.signaturesRequired)throw new Error("Origin would have too many signatures");const r=this.transaction.signNextOrigin(this.sigHash,t);(Bl(this.transaction.auth.spendingCondition)||O1(this.transaction.auth.spendingCondition.hashMode))&&(this.sigHash=r)}appendOrigin(t){const n=typeof t=="object"&&"type"in t?t:us(t);if(this.checkOverlap&&this.originDone)throw Error("Cannot append public key to origin after sponsor key");if(this.transaction.auth===void 0)throw new Error('"transaction.auth" is undefined');if(this.transaction.auth.spendingCondition===void 0)throw new Error('"transaction.auth.spendingCondition" is undefined');this.transaction.appendPubkey(n)}signSponsor(t){if(this.transaction.auth===void 0)throw new Zo('"transaction.auth" is undefined');if(this.transaction.auth.authType!==un.Sponsored)throw new Zo('"transaction.auth.authType" is not AuthType.Sponsored');const n=this.transaction.signNextSponsor(this.sigHash,t);this.sigHash=n,this.originDone=!0}getTxInComplete(){return Fl(this.transaction)}resume(t){this.transaction=Fl(t),this.sigHash=t.signBegin()}}async function PF(e){const t={fee:BigInt(0),nonce:BigInt(0),network:Ag,postConditionMode:pf.Deny,sponsored:!1},n=Object.assign(t,e);n.network=mr(n.network),n.client=Object.assign({},hs(n.network),n.client),n.postConditionMode=DK(n.postConditionMode);const r=gM(n.contractAddress,n.contractName,n.functionName,n.functionArgs);if(n!=null&&n.validateWithAbi){let f;if(typeof n.validateWithAbi=="boolean")if(n!=null&&n.network)f=await BK({...n});else throw new Error("Network option must be provided in order to validate with ABI");else f=n.validateWithAbi;_K(r,f)}let i=null;if("publicKey"in n)i=ek(vt.P2PKH,n.publicKey,n.nonce,n.fee);else{const f=n.useNonSequentialMultiSig?vt.P2SHNonSequential:vt.P2SH,p=n.address?zM(n.publicKeys.map(Gh),n.numSignatures,f,gs(n.address).hash160):n.publicKeys.map(Gh);i=oK(f,n.numSignatures,p,n.nonce,n.fee)}const o=n.sponsored?rk(i):nk(i),a=(n.postConditions??[]).map(f=>typeof f.type=="string"?qM(f):f),u=eb(a),l=new $M({transactionVersion:n.network.transactionVersion,chainId:n.network.chainId,auth:o,payload:r,postConditions:u,postConditionMode:n.postConditionMode});if(e.fee===void 0||e.fee===null){const f=await LK({transaction:l,...n});l.setFee(f)}if(e.nonce===void 0||e.nonce===null){const f=n.network.addressVersion.singleSig,p=Xw.c32address(f,l.auth.spendingCondition.signer),m=await IK({address:p,...n});l.setNonce(m)}return l}async function vo(e){if("senderKey"in e){const t=X_(e.senderKey),n=CF(e,"senderKey"),r=await PF({publicKey:t,...n}),i=e.senderKey;return new HM(r).signOrigin(i),r}else{const t=CF(e,"signerKeys"),n=await PF(t);return JK(n,e.publicKeys.map(Gh).slice(),e.signerKeys.map(OM),e.address),n}}function JK(e,t,n,r){if(Bl(e.auth.spendingCondition))throw new Error("Transaction is not a multi-sig transaction");const i=new HM(e),o=r?zM(t,e.auth.spendingCondition.signaturesRequired,e.auth.spendingCondition.hashMode,gs(r).hash160):t;for(const a of o){const u=n.find(l=>X_(l)===a);u?i.signOrigin(u):i.appendOrigin(a)}}function zM(e,t,n,r){if(Vh(0,n,t,e.map(us)).hash160===r)return e;const o=e.slice().sort();if(Vh(0,n,t,o.map(us)).hash160===r)return o;throw new Error("Failed to find matching multi-sig address given public-keys.")}const $K=new Uint8Array([83,73,80,48,49,56]);function MF(e){return Jr(Io(e))}function qK(e){return!(e.type!==we.Tuple||!["name","version","chain-id"].every(t=>t in e.value)||!["name","version"].every(t=>e.value[t].type===we.StringASCII)||e.value["chain-id"].type!==we.UInt)}function WM({message:e,domain:t}){const n=MF(e);if(!qK(t))throw new Error("domain parameter must be a valid domain of type TupleCV with keys 'name', 'version', 'chain-id' with respective types StringASCII, StringASCII, UInt");const r=MF(t);return so($K,r,n)}function UK({message:e,domain:t,privateKey:n}){const r=at(Jr(WM({message:e,domain:t})));return iK({messageHash:r,privateKey:n})}var Gn;(function(e){e[e.P2PKH=0]="P2PKH",e[e.P2SH=1]="P2SH",e[e.P2SHP2WPKH=2]="P2SHP2WPKH",e[e.P2SHP2WSH=3]="P2SHP2WSH",e[e.P2WPKH=4]="P2WPKH",e[e.P2WSH=5]="P2WSH",e[e.P2TR=6]="P2TR"})(Gn||(Gn={}));const vh={mainnet:{P2PKH:0,P2SH:5},testnet:{P2PKH:111,P2SH:196},devnet:{P2PKH:111,P2SH:196},mocknet:{P2PKH:111,P2SH:196}},VM=/^(1|3|m|n|2)/,LF=/^(bc1q|tb1q|bcrt1q)/i,BF=/^(bc1p|tb1p|bcrt1p)/i,jF={mainnet:"bc",testnet:"tb",devnet:"bcrt",mocknet:"bcrt"},HK=/^(bc|tb)/i,N1=0,GM=1;var Tl;(function(e){e.Period1="Period1",e.Period2a="Period2a",e.Period2b="Period2b",e.Period3="Period3"})(Tl||(Tl={}));var C1;(function(e){e[e.ERR_STACKING_UNREACHABLE=255]="ERR_STACKING_UNREACHABLE",e[e.ERR_STACKING_CORRUPTED_STATE=254]="ERR_STACKING_CORRUPTED_STATE",e[e.ERR_STACKING_INSUFFICIENT_FUNDS=1]="ERR_STACKING_INSUFFICIENT_FUNDS",e[e.ERR_STACKING_INVALID_LOCK_PERIOD=2]="ERR_STACKING_INVALID_LOCK_PERIOD",e[e.ERR_STACKING_ALREADY_STACKED=3]="ERR_STACKING_ALREADY_STACKED",e[e.ERR_STACKING_NO_SUCH_PRINCIPAL=4]="ERR_STACKING_NO_SUCH_PRINCIPAL",e[e.ERR_STACKING_EXPIRED=5]="ERR_STACKING_EXPIRED",e[e.ERR_STACKING_STX_LOCKED=6]="ERR_STACKING_STX_LOCKED",e[e.ERR_STACKING_PERMISSION_DENIED=9]="ERR_STACKING_PERMISSION_DENIED",e[e.ERR_STACKING_THRESHOLD_NOT_MET=11]="ERR_STACKING_THRESHOLD_NOT_MET",e[e.ERR_STACKING_POX_ADDRESS_IN_USE=12]="ERR_STACKING_POX_ADDRESS_IN_USE",e[e.ERR_STACKING_INVALID_POX_ADDRESS=13]="ERR_STACKING_INVALID_POX_ADDRESS",e[e.ERR_STACKING_ALREADY_REJECTED=17]="ERR_STACKING_ALREADY_REJECTED",e[e.ERR_STACKING_INVALID_AMOUNT=18]="ERR_STACKING_INVALID_AMOUNT",e[e.ERR_NOT_ALLOWED=19]="ERR_NOT_ALLOWED",e[e.ERR_STACKING_ALREADY_DELEGATED=20]="ERR_STACKING_ALREADY_DELEGATED",e[e.ERR_DELEGATION_EXPIRES_DURING_LOCK=21]="ERR_DELEGATION_EXPIRES_DURING_LOCK",e[e.ERR_DELEGATION_TOO_MUCH_LOCKED=22]="ERR_DELEGATION_TOO_MUCH_LOCKED",e[e.ERR_DELEGATION_POX_ADDR_REQUIRED=23]="ERR_DELEGATION_POX_ADDR_REQUIRED",e[e.ERR_INVALID_START_BURN_HEIGHT=24]="ERR_INVALID_START_BURN_HEIGHT",e[e.ERR_NOT_CURRENT_STACKER=25]="ERR_NOT_CURRENT_STACKER",e[e.ERR_STACK_EXTEND_NOT_LOCKED=26]="ERR_STACK_EXTEND_NOT_LOCKED",e[e.ERR_STACK_INCREASE_NOT_LOCKED=27]="ERR_STACK_INCREASE_NOT_LOCKED",e[e.ERR_DELEGATION_NO_REWARD_SLOT=28]="ERR_DELEGATION_NO_REWARD_SLOT",e[e.ERR_DELEGATION_WRONG_REWARD_SLOT=29]="ERR_DELEGATION_WRONG_REWARD_SLOT",e[e.ERR_STACKING_IS_DELEGATED=30]="ERR_STACKING_IS_DELEGATED",e[e.ERR_STACKING_NOT_DELEGATED=31]="ERR_STACKING_NOT_DELEGATED"})(C1||(C1={}));/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function cp(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function Hu(...e){const t=(i,o)=>a=>i(o(a)),n=Array.from(e).reverse().reduce((i,o)=>i?t(i,o.encode):o.encode,void 0),r=e.reduce((i,o)=>i?t(i,o.decode):o.decode,void 0);return{encode:n,decode:r}}function zu(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(cp(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function Wu(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function nb(e,t="="){if(cp(e),typeof t!="string")throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let r of n)if(typeof r!="string")throw new Error(`padding.encode: non-string input=${r}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let i of n)if(typeof i!="string")throw new Error(`padding.decode: non-string input=${i}`);let r=n.length;if(r*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function KM(e){if(typeof e!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function DF(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const i=[],o=Array.from(e);for(o.forEach(a=>{if(cp(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,u=!0;for(let l=r;lt?QM(t,e%t):e,dw=(e,t)=>e+(t-QM(e,t));function E1(e,t,n,r){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(dw(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${dw(t,n)}`);let i=0,o=0;const a=2**n-1,u=[];for(const l of e){if(cp(l),l>=2**t)throw new Error(`convertRadix2: invalid data word=${l} from=${t}`);if(i=i<32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=n;o-=n)u.push((i>>o-n&a)>>>0);i&=2**o-1}if(i=i<=t)throw new Error("Excess padding");if(!r&&i)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&u.push(i>>>0),u}function zK(e){return cp(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return DF(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(DF(t,e,2**8))}}}function Wl(e,t=!1){if(cp(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(dw(8,e)>32||dw(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return E1(Array.from(n),8,e,!t)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(E1(n,e,8,t))}}}function JF(e){if(typeof e!="function")throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}const WK=Hu(Wl(4),zu("0123456789ABCDEF"),Wu("")),VK=Hu(Wl(5),zu("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),nb(5),Wu(""));Hu(Wl(5),zu("0123456789ABCDEFGHIJKLMNOPQRSTUV"),nb(5),Wu(""));Hu(Wl(5),zu("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Wu(""),KM(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const GK=Hu(Wl(6),zu("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),nb(6),Wu("")),KK=Hu(Wl(6),zu("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),nb(6),Wu("")),ok=e=>Hu(zK(58),zu(e),Wu("")),A1=ok("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");ok("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");ok("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const $F=[0,2,3,5,6,7,9,10,11],QK={encode(e){let t="";for(let n=0;n>25;let n=(e&33554431)<<5;for(let r=0;r>r&1)===1&&(n^=qF[r]);return n}function UF(e,t,n=1){const r=e.length;let i=1;for(let o=0;o126)throw new Error(`Invalid prefix (${e})`);i=Om(i)^a>>5}i=Om(i);for(let o=0;oy)throw new TypeError(`Length ${w} exceeds limit ${y}`);return p=p.toLowerCase(),`${p}1${F1.encode(m)}${UF(p,m,t)}`}function u(p,m=90){if(typeof p!="string")throw new Error(`bech32.decode input should be string, not ${typeof p}`);if(p.length<8||m!==!1&&p.length>m)throw new TypeError(`Wrong string length: ${p.length} (${p}). Expected (8..${m})`);const y=p.toLowerCase();if(p!==y&&p!==p.toUpperCase())throw new Error("String must be lowercase or uppercase");p=y;const w=p.lastIndexOf("1");if(w===0||w===-1)throw new Error('Letter "1" must be present between prefix and data only');const b=p.slice(0,w),x=p.slice(w+1);if(x.length<6)throw new Error("Data must be at least 6 characters long");const _=F1.decode(x).slice(0,-6),O=UF(b,_,t);if(!x.endsWith(O))throw new Error(`Invalid checksum in ${p}: expected "${O}"`);return{prefix:b,words:_}}const l=JF(u);function f(p){const{prefix:m,words:y}=u(p,!1);return{prefix:m,words:y,bytes:r(y)}}return{encode:a,decode:u,decodeToBytes:f,decodeUnsafe:l,fromWords:r,fromWordsUnsafe:o,toWords:i}}const fw=YM("bech32"),hw=YM("bech32m"),YK={encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)},XK=Hu(Wl(4),zu("0123456789abcdef"),Wu(""),KM(e=>{if(typeof e!="string"||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})),ZK={utf8:YK,hex:XK,base16:WK,base32:VK,base64:GK,base64url:KK,base58:A1,base58xmr:QK};`${Object.keys(ZK).join(", ")}`;var XM=h_();function eQ(){return typeof crypto<"u"&&typeof crypto.subtle<"u"}const tQ='Crypto lib not found. Either the WebCrypto "crypto.subtle" or Node.js "crypto" module must be available.';async function nQ(){if(eQ())return{lib:crypto.subtle,name:"subtleCrypto"};try{return{lib:require("crypto"),name:"nodeCrypto"}}catch{throw new Error(tQ)}}class rQ{constructor(t,n){this.createCipher=t,this.createDecipher=n}async encrypt(t,n,r,i){if(t!=="aes-128-cbc"&&t!=="aes-256-cbc")throw new Error(`Unsupported cipher algorithm "${t}"`);const o=this.createCipher(t,n,r),a=new Uint8Array(so(o.update(i),o.final()));return Promise.resolve(a)}async decrypt(t,n,r,i){if(t!=="aes-128-cbc"&&t!=="aes-256-cbc")throw new Error(`Unsupported cipher algorithm "${t}"`);const o=this.createDecipher(t,n,r),a=new Uint8Array(so(o.update(i),o.final()));return Promise.resolve(a)}}class iQ{constructor(t){this.subtleCrypto=t}async encrypt(t,n,r,i){let o,a;if(t==="aes-128-cbc")o="AES-CBC",a=128;else if(t==="aes-256-cbc")o="AES-CBC",a=256;else throw new Error(`Unsupported cipher algorithm "${t}"`);const u=await this.subtleCrypto.importKey("raw",n,{name:o,length:a},!1,["encrypt"]),l=await this.subtleCrypto.encrypt({name:o,iv:r},u,i);return new Uint8Array(l)}async decrypt(t,n,r,i){let o,a;if(t==="aes-128-cbc")o="AES-CBC",a=128;else if(t==="aes-256-cbc")o="AES-CBC",a=256;else throw new Error(`Unsupported cipher algorithm "${t}"`);const u=await this.subtleCrypto.importKey("raw",n,{name:o,length:a},!1,["decrypt"]),l=await this.subtleCrypto.decrypt({name:o,iv:r},u,i);return new Uint8Array(l)}}async function ZM(){const e=await nQ();return e.name==="subtleCrypto"?new iQ(e.lib):new rQ(e.lib.createCipheriv,e.lib.createDecipheriv)}var px,HF;function oQ(){return HF||(HF=1,px=dM()("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),px}var sQ=oQ();const e8=Ju(sQ);function aQ(e){return pM(e)}function t8(e){return Jr(e)}function cQ(e){return nG(e)}const uQ=0;ri.hmacSha256Sync=(e,...t)=>{const n=Pg.create(Jr,e);return t.forEach(r=>n.update(r)),n.digest()};function lQ(){return at(ri.randomPrivateKey())}function dQ(e){const t=e8.decode(e),n=t.slice(0,-4),r=t.slice(-4),i=Jr(Jr(n));if(r[0]^i[0]|r[1]^i[1]|r[2]^i[2]|r[3]^i[3])throw new Error("Invalid checksum");if(n.length!==21)throw new TypeError("Invalid address length");const o=IP(n,0),a=n.slice(1);return{version:o,hash:a}}function fQ(e){const t=Jr(Jr(e));return e8.encode(so(e,t).slice(0,e.length+4))}function n8(e,t){return fQ(so(new Uint8Array([e]),t.slice(0,20)))}function r8(e,t=uQ){const n=typeof e=="string"?rt(e):e,r=aQ(t8(n));return n8(t,r)}function i8(e){const t=B_(e);return at(H_(t.slice(0,32),!0))}const hQ=9007199254740991;function o8(e){if(e<0||e>hQ||e%1!==0)throw new RangeError("value out of range")}function pQ(e,t,n=0){return o8(e),t||(t=new Uint8Array(mQ(e))),e<253?Dm(t,e,n):e<=65535?(Dm(t,253,n),Gz(t,e,n+1)):e<=4294967295?(Dm(t,254,n),Zv(t,e,n+1)):(Dm(t,255,n),Zv(t,e>>>0,n+1),Zv(t,e/4294967296|0,n+5)),t}function mQ(e){return o8(e),e<253?1:e<=65535?3:e<=4294967295?5:9}const s8=`Stacks Signed Message: `;function gQ(e,t=s8){return Jr(a8(e,t))}function a8(e,t=s8){const n=typeof e=="string"?as(e):e,r=pQ(n.length);return so(as(t),r,n)}ri.hmacSha256Sync=(e,...t)=>{const n=Pg.create(Jr,e);return t.forEach(r=>n.update(r)),n.digest()};var pw;(function(e){e.InvalidFormat="InvalidFormat",e.IsNotPoint="IsNotPoint"})(pw||(pw={}));async function yQ(e,t,n){return await(await ZM()).encrypt("aes-256-cbc",t,e,n)}async function wQ(e,t,n){return await(await ZM()).decrypt("aes-256-cbc",t,e,n)}function c8(e,t){return Pg(Jr,e,t)}function bQ(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r0)throw new Error("Addresses with a witness version >= 1 should be encoded in bech32m");return{witnessVersion:n,data:fw.fromWords(t.slice(1))}}function FQ(e){const{words:t}=hw.decode(e),n=t[0];if(n==0)throw new Error("Addresses with witness version 1 should be encoded in bech32");return{witnessVersion:n,data:hw.fromWords(t.slice(1))}}function IQ(e){if(LF.test(e))return AQ(e);if(BF.test(e))return FQ(e);throw new Error(`Native segwit address ${e} does not match valid prefix ${LF} or ${BF}`)}function PQ(e){try{if(VM.test(e)){const t=dQ(e);return{version:CQ(t.version),data:t.hash}}else if(HK.test(e)){const t=IQ(e);return{version:EQ(t.witnessVersion,t.data.length),data:t.data}}throw new Error("Unknown BTC address prefix.")}catch(t){throw new NQ(e,t)}}function d8(e){const t=e;if(t.type!==we.Tuple||!t.value)throw new Error("Invalid argument, expected ClarityValue to be a TupleCV");if(!("version"in t.value)||!("hashbytes"in t.value))throw new Error("Invalid argument, expected Clarity tuple value to contain `version` and `hashbytes` keys");const n=t.value.version,r=t.value.hashbytes;if(n.type!==we.Buffer||r.type!==we.Buffer)throw new Error("Invalid argument, expected Clarity tuple value to contain `version` and `hashbytes` buffers");return{version:rt(n.value)[0],hashBytes:rt(r.value)}}function xi(e){const{version:t,data:n}=PQ(e),r=kr(zw(BigInt(t),1)),i=kr(n);return uw({version:r,hashbytes:i})}function MQ(e,t){switch(e){case Gn.P2PKH:return Sh[t].P2PKH;case Gn.P2SH:case Gn.P2SHP2WPKH:case Gn.P2SHP2WSH:return Sh[t].P2SH;default:throw new Error("Invalid pox address version")}}function f8(e,t,n){if(!Zz.includes(n))throw new Error("Invalid network.");switch(typeof t=="string"&&(t=rt(t)),e){case Gn.P2PKH:case Gn.P2SH:case Gn.P2SHP2WPKH:case Gn.P2SHP2WSH:{const r=MQ(e,n);return n8(r,t)}case Gn.P2WPKH:case Gn.P2WSH:{const r=fw.toWords(t);return fw.encode(jF[n],[N1,...r])}case Gn.P2TR:{const r=hw.toWords(t);return hw.encode(jF[n],[GM,...r])}}throw new Error(`Unexpected address version: ${e}`)}function LQ(e,t){const n=d8(e);return f8(n.version,n.hashBytes,t)}function sk(...e){return typeof e[0]=="number"?f8(e[0],e[1],e[2]):LQ(e[0],e[1])}function BQ(e){if(e.type===we.OptionalSome)return e.value;if(e.type!==we.OptionalNone)throw new Error("Object is not an 'Optional'")}function zF(e,t){if(e.type===we.OptionalSome)return t(e.value);if(e.type!==we.OptionalNone)throw new Error("Object is not an 'Optional'")}function mx(e){if(e.period===Rl.Period1)throw new Error(`PoX-2 has not activated yet (currently in period ${e.period} of PoX-2 operation)`)}function ih({contract:e,poxAddress:t}){if(t&&e.endsWith(".pox")&&!VM.test(t))throw new Error("PoX-1 requires P2PKH/P2SH/P2SH-P2WPKH/P2SH-P2WSH bitcoin addresses")}function oh({contract:e,signerKey:t,signerSignature:n,maxAmount:r,authId:i}){const o=typeof r<"u",a=typeof i<"u";if(/\.pox(-[2-3])?$/.test(e)){if(t||n||o||a)throw new Error("PoX-1, PoX-2 and PoX-3 do not accept a `signerKey`, `signerSignature`, `maxAmount` or `authId`")}else if(!t||!o||typeof i>"u")throw new Error("PoX-4 requires a `signerKey` (buff 33), `maxAmount` (uint), and `authId` (uint)")}var Zi;(function(e){e.StackStx="stack-stx",e.AggregateCommit="agg-commit",e.AggregateIncrease="agg-increase",e.StackExtend="stack-extend",e.StackIncrease="stack-increase"})(Zi||(Zi={}));function jQ({topic:e,poxAddress:t,rewardCycle:n,period:r,network:i,privateKey:o,maxAmount:a,authId:u}){return UK({...ak({topic:e,poxAddress:t,rewardCycle:n,period:r,network:i,maxAmount:a,authId:u}),privateKey:o})}function Vl({topic:e,poxAddress:t,rewardCycle:n,period:r,network:i,publicKey:o,signature:a,maxAmount:u,authId:l}){return RQ({message:Jr(WM(ak({topic:e,poxAddress:t,rewardCycle:n,period:r,network:i,maxAmount:u,authId:l}))),publicKey:o,signature:a})}function ak({topic:e,poxAddress:t,rewardCycle:n,period:r,network:i,maxAmount:o,authId:a}){const u=mr(i),l=uw({"pox-addr":xi(t),"reward-cycle":ft(n),topic:Qm(e),period:ft(r),"max-amount":ft(o),"auth-id":ft(a)}),f=uw({name:Qm("pox-4-signer"),version:Qm("1.0.0"),"chain-id":ft(u.chainId)});return{message:l,domain:f}}class xf{constructor(t){this.address=t.address,this.network=mr(t.network??"mainnet"),this.client=Object.assign({},hs(this.network),t.client)}get baseUrl(){return this.client.baseUrl}get fetch(){return this.client.fetch}getCoreInfo(){return this.client.fetch(`${this.client.baseUrl}/v2/info`).then(t=>t.json())}getPoxInfo(){return this.client.fetch(`${this.client.baseUrl}/v2/pox`).then(t=>t.json())}async getTargetBlockTime(){const t=await this.client.fetch(`${this.client.baseUrl}/extended/v1/info/network_block_times`).then(n=>n.json());return this.network.chainId===dn.Mainnet?t.mainnet.target_block_time:t.testnet.target_block_time}async getAccountStatus(){return this.client.fetch(`${this.client.baseUrl}/v2/accounts/${this.address}?proof=0`).then(t=>t.json()).then(t=>(t.balance=BigInt(t.balance),t.locked=BigInt(t.locked),t))}async getAccountBalance(){return this.getAccountStatus().then(t=>t.balance)}async getAccountExtendedBalances(){return this.client.fetch(`${this.client.baseUrl}/extended/v1/address/${this.address}/balances`).then(t=>t.json()).then(t=>(t.stx.balance=BigInt(t.stx.balance),t.stx.total_sent=BigInt(t.stx.total_sent),t.stx.total_received=BigInt(t.stx.total_received),t.stx.locked=BigInt(t.stx.locked),t))}async getAccountBalanceLocked(){return this.getAccountStatus().then(t=>t.locked)}async getCycleDuration(){const t=this.getPoxInfo(),n=await this.getTargetBlockTime();return Promise.all([t,n]).then(([r,i])=>r.reward_cycle_length*i)}async getRewardsTotalForBtcAddress(){return this.client.fetch(`${this.client.baseUrl}/extended/v1/burnchain/rewards/${this.address}/total`).then(t=>t.json()).then(t=>(t.reward_amount=BigInt(t.reward_amount),t))}async getRewardsForBtcAddress(t){let n=`${this.client.baseUrl}/extended/v1/burnchain/rewards/${this.address}`;return t&&(n+=`?limit=${t.limit}&offset=${t.offset}`),this.client.fetch(n).then(r=>r.json())}async getRewardHoldersForBtcAddress(t){let n=`${this.client.baseUrl}/extended/v1/burnchain/reward_slot_holders/${this.address}`;return t&&(n+=`?limit=${t.limit}&offset=${t.offset}`),this.client.fetch(n).then(r=>r.json())}async getRewardSet(t){const[n,r]=this.parseContractId(t==null?void 0:t.contractId),i=await hh({client:this.client,senderAddress:this.address,contractAddress:n,contractName:r,functionArgs:[ft(t.rewardCyleId),ft(t.rewardSetIndex)],functionName:"get-reward-set-pox-address"});return zF(i,o=>({pox_address:{version:rt(o.value["pox-addr"].value.version.value),hashbytes:rt(o.value["pox-addr"].value.hashbytes.value)},total_ustx:BigInt(o.value["total-ustx"].value)}))}async getSecondsUntilNextCycle(){const t=this.getPoxInfo(),n=this.getTargetBlockTime(),r=this.getCoreInfo();return Promise.all([t,n,r]).then(([i,o,a])=>(i.reward_cycle_length-(a.burn_block_height-i.first_burnchain_block_height)%i.reward_cycle_length)*o)}async getSecondsUntilStackingDeadline(){const t=this.getPoxInfo(),n=this.getTargetBlockTime();return Promise.all([t,n]).then(([r,i])=>r.next_cycle.blocks_until_prepare_phase*i)}async getPoxOperationInfo(t){t=t??await this.getPoxInfo();const n=[...t.contract_versions].sort((f,p)=>f.activation_burnchain_block_height-p.activation_burnchain_block_height),[r,i,o,a]=n,u=n.filter(f=>(t==null?void 0:t.current_burnchain_block_height)>=f.activation_burnchain_block_height),l=u[u.length-1];return{period:Rl.Period3,pox1:r,pox2:i,pox3:o,pox4:a,current:l}}async hasMinimumStx(){const t=await this.getAccountBalance(),n=BigInt((await this.getPoxInfo()).min_amount_ustx);return t>=n}async canStack({poxAddress:t,cycles:n}){const r=this.getAccountBalance(),i=this.getPoxInfo();return Promise.all([r,i]).then(([o,a])=>{const u=xi(t),[l,f]=this.parseContractId(a.contract_id);return hh({client:this.client,contractName:f,contractAddress:l,functionName:"can-stack-stx",senderAddress:this.address,functionArgs:[u,ft(o.toString()),ft(a.reward_cycle_id),ft(n.toString())]})}).then(o=>o.type===we.ResponseOk?{eligible:!0}:{eligible:!1,reason:C1[+Kd(o.value)]})}async stack({amountMicroStx:t,poxAddress:n,cycles:r,burnBlockHeight:i,signerKey:o,signerSignature:a,maxAmount:u,authId:l,...f}){const p=await this.getPoxInfo(),m=await this.getPoxOperationInfo(p),y=await this.getStackingContract(m);ih({contract:y,poxAddress:n}),oh({contract:y,signerKey:o,signerSignature:a,maxAmount:u,authId:l});const w=this.getStackOptions({contract:y,amountMicroStx:t,cycles:r,poxAddress:n,burnBlockHeight:i,signerKey:o,signerSignature:a,maxAmount:u,authId:l}),b=await vo({...w,...xo(f)});return So({transaction:b,client:this.client})}async stackExtend({extendCycles:t,poxAddress:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a,...u}){const l=await this.getPoxInfo(),f=await this.getPoxOperationInfo(l);mx(f),oh({contract:l.contract_id,signerKey:r,signerSignature:i,maxAmount:o,authId:a});const p=this.getStackExtendOptions({contract:l.contract_id,extendCycles:t,poxAddress:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a}),m=await vo({...p,...xo(u)});return So({transaction:m,client:this.client})}async stackIncrease({increaseBy:t,signerKey:n,signerSignature:r,maxAmount:i,authId:o,...a}){const u=await this.getPoxInfo(),l=await this.getPoxOperationInfo(u);mx(l),oh({contract:u.contract_id,signerKey:n,signerSignature:r,maxAmount:i,authId:o});const f=this.getStackIncreaseOptions({contract:u.contract_id,increaseBy:t,signerKey:n,signerSignature:r,maxAmount:i,authId:o}),p=await vo({...f,...xo(a)});return So({transaction:p,client:this.client})}async delegateStx({amountMicroStx:t,delegateTo:n,untilBurnBlockHeight:r,poxAddress:i,...o}){const a=await this.getPoxInfo(),u=await this.getPoxOperationInfo(a),l=await this.getStackingContract(u);ih({contract:l,poxAddress:i});const f=this.getDelegateOptions({contract:l,amountMicroStx:t,delegateTo:n,untilBurnBlockHeight:r,poxAddress:i}),p=await vo({...f,...xo(o)});return So({transaction:p,client:this.client})}async delegateStackStx({stacker:t,amountMicroStx:n,poxAddress:r,burnBlockHeight:i,cycles:o,...a}){const u=await this.getPoxInfo(),l=await this.getPoxOperationInfo(u),f=await this.getStackingContract(l);ih({contract:f,poxAddress:r});const p=this.getDelegateStackOptions({contract:f,stacker:t,amountMicroStx:n,poxAddress:r,burnBlockHeight:i,cycles:o}),m=await vo({...p,...xo(a)});return So({transaction:m,client:this.client})}async delegateStackExtend({stacker:t,poxAddress:n,extendCount:r,...i}){const a=(await this.getPoxInfo()).contract_id,u=this.getDelegateStackExtendOptions({contract:a,stacker:t,poxAddress:n,extendCount:r}),l=await vo({...u,...xo(i)});return So({transaction:l,client:this.client})}async delegateStackIncrease({stacker:t,poxAddress:n,increaseBy:r,...i}){const o=await this.getPoxInfo(),a=await this.getPoxOperationInfo(o);mx(a);const u=this.getDelegateStackIncreaseOptions({contract:o.contract_id,stacker:t,poxAddress:n,increaseBy:r}),l=await vo({...u,...xo(i)});return So({transaction:l,client:this.client})}async stackAggregationCommit({poxAddress:t,rewardCycle:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a,...u}){const l=await this.getStackingContract();ih({contract:l,poxAddress:t}),oh({contract:l,signerKey:r,signerSignature:i,maxAmount:o,authId:a});const f=this.getStackAggregationCommitOptions({contract:l,poxAddress:t,rewardCycle:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a}),p=await vo({...f,...xo(u)});return So({transaction:p,client:this.client})}async stackAggregationCommitIndexed({poxAddress:t,rewardCycle:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a,...u}){const l=await this.getStackingContract();ih({contract:l,poxAddress:t}),oh({contract:l,signerKey:r,signerSignature:i,maxAmount:o,authId:a});const f=this.getStackAggregationCommitOptionsIndexed({contract:l,poxAddress:t,rewardCycle:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a}),p=await vo({...f,...xo(u)});return So({transaction:p,client:this.client})}async stackAggregationIncrease({poxAddress:t,rewardCycle:n,rewardIndex:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u,...l}){const f=await this.getStackingContract();ih({contract:f,poxAddress:t}),oh({contract:f,signerKey:i,signerSignature:o,maxAmount:a,authId:u});const p=this.getStackAggregationIncreaseOptions({contract:f,poxAddress:t,rewardCycle:n,rewardCycleIndex:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u}),m=await vo({...p,...xo(l)});return So({transaction:m,client:this.client})}async revokeDelegateStx(t){typeof t=="string"&&(t={privateKey:t});const r=(await this.getPoxInfo()).contract_id,i=this.getRevokeDelegateStxOptions(r),o=await vo({...i,...xo(t)});return So({transaction:o,client:this.client})}getStackOptions({amountMicroStx:t,poxAddress:n,cycles:r,contract:i,burnBlockHeight:o,signerKey:a,signerSignature:u,maxAmount:l,authId:f}){const p=xi(n),[m,y]=this.parseContractId(i),w=[ft(t),p,ft(o),ft(r)];return a&&l&&typeof f<"u"&&(w.push(u?Xi(kr(rt(u))):Rr()),w.push(kr(rt(a))),w.push(ft(l)),w.push(ft(f))),{client:this.client,contractAddress:m,contractName:y,functionName:"stack-stx",functionArgs:w,validateWithAbi:!0,network:this.network}}getStackExtendOptions({extendCycles:t,poxAddress:n,contract:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u}){const l=xi(n),[f,p]=this.parseContractId(r),m=[ft(t),l];return i&&a&&typeof u<"u"&&(m.push(o?Xi(kr(rt(o))):Rr()),m.push(kr(rt(i))),m.push(ft(a)),m.push(ft(u))),{client:this.client,contractAddress:f,contractName:p,functionName:"stack-extend",functionArgs:m,validateWithAbi:!0,network:this.network}}getStackIncreaseOptions({increaseBy:t,contract:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a}){const[u,l]=this.parseContractId(n),f=[ft(t)];return r&&o&&typeof a<"u"&&(f.push(i?Xi(kr(rt(i))):Rr()),f.push(kr(rt(r))),f.push(ft(o)),f.push(ft(a))),{client:this.client,contractAddress:u,contractName:l,functionName:"stack-increase",functionArgs:f,validateWithAbi:!0,network:this.network}}getDelegateOptions({contract:t,amountMicroStx:n,delegateTo:r,untilBurnBlockHeight:i,poxAddress:o}){const a=o?Xi(xi(o)):Rr(),[u,l]=this.parseContractId(t);return{client:this.client,contractAddress:u,contractName:l,functionName:"delegate-stx",functionArgs:[ft(n),no(r),i?Xi(ft(i)):Rr(),a],validateWithAbi:!0,network:this.network}}getDelegateStackOptions({contract:t,stacker:n,amountMicroStx:r,poxAddress:i,burnBlockHeight:o,cycles:a}){const u=xi(i),[l,f]=this.parseContractId(t);return{client:this.client,contractAddress:l,contractName:f,functionName:"delegate-stack-stx",functionArgs:[no(n),ft(r),u,ft(o),ft(a)],validateWithAbi:!0,network:this.network}}getDelegateStackExtendOptions({contract:t,stacker:n,poxAddress:r,extendCount:i}){const o=xi(r),[a,u]=this.parseContractId(t);return{client:this.client,contractAddress:a,contractName:u,functionName:"delegate-stack-extend",functionArgs:[no(n),o,ft(i)],validateWithAbi:!0,network:this.network}}getDelegateStackIncreaseOptions({contract:t,stacker:n,poxAddress:r,increaseBy:i}){const o=xi(r),[a,u]=this.parseContractId(t);return{client:this.client,contractAddress:a,contractName:u,functionName:"delegate-stack-increase",functionArgs:[no(n),o,ft(i)],validateWithAbi:!0,network:this.network}}getStackAggregationCommitOptions({contract:t,poxAddress:n,rewardCycle:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u}){const l=xi(n),[f,p]=this.parseContractId(t),m=[l,ft(r)];return i&&a&&typeof u<"u"&&(m.push(o?Xi(kr(rt(o))):Rr()),m.push(kr(rt(i))),m.push(ft(a)),m.push(ft(u))),{client:this.client,contractAddress:f,contractName:p,functionName:"stack-aggregation-commit",functionArgs:m,validateWithAbi:!0,network:this.network}}getStackAggregationIncreaseOptions({contract:t,poxAddress:n,rewardCycle:r,rewardCycleIndex:i,signerKey:o,signerSignature:a,maxAmount:u,authId:l}){const f=xi(n),[p,m]=this.parseContractId(t),y=[f,ft(r),ft(i)];return o&&u&&typeof l<"u"&&(y.push(a?Xi(kr(rt(a))):Rr()),y.push(kr(rt(o))),y.push(ft(u)),y.push(ft(l))),{client:this.client,contractAddress:p,contractName:m,functionName:"stack-aggregation-increase",functionArgs:y,validateWithAbi:!0,network:this.network}}getStackAggregationCommitOptionsIndexed({contract:t,poxAddress:n,rewardCycle:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u}){const l=xi(n),[f,p]=this.parseContractId(t),m=[l,ft(r)];return i&&a&&typeof u<"u"&&(m.push(o?Xi(kr(rt(o))):Rr()),m.push(kr(rt(i))),m.push(ft(a)),m.push(ft(u))),{client:this.client,contractAddress:f,contractName:p,functionName:"stack-aggregation-commit-indexed",functionArgs:m,validateWithAbi:!0,network:this.network}}getRevokeDelegateStxOptions(t){const[n,r]=this.parseContractId(t);return{client:this.client,contractAddress:n,contractName:r,functionName:"revoke-delegate-stx",functionArgs:[],validateWithAbi:!0,network:this.network}}async getStatus(){const t=await this.getPoxInfo(),[n,r]=this.parseContractId(t.contract_id),i=await this.getAccountStatus();return hh({contractAddress:n,contractName:r,functionName:"get-stacker-info",senderAddress:this.address,functionArgs:[no(this.address)],client:this.client}).then(a=>{if(a.type===we.OptionalSome){const l=a.value,f=l.value["pox-addr"],p=l.value["first-reward-cycle"],m=l.value["lock-period"],y=f.value.version,w=f.value.hashbytes;return{stacked:!0,details:{first_reward_cycle:Number(p.value),lock_period:Number(m.value),unlock_height:i.unlock_height,pox_address:{version:rt(y.value),hashbytes:rt(w.value)}}}}else{if(a.type===we.OptionalNone)return{stacked:!1};throw new Error("Error fetching stacker info")}})}async getDelegationStatus(){const t=await this.getPoxInfo(),[n,r]=this.parseContractId(t.contract_id);return hh({contractAddress:n,contractName:r,functionName:"get-delegation-info",functionArgs:[no(this.address)],senderAddress:this.address,client:this.client}).then(o=>{if(o.type===we.OptionalSome){const a=o.value,u=a.value["amount-ustx"],l=a.value["delegated-to"],f=zF(a.value["pox-addr"],m=>({version:rt(m.value.version.value)[0],hashbytes:rt(m.value.hashbytes.value)})),p=BQ(a.value["until-burn-ht"]);return{delegated:!0,details:{amount_micro_stx:BigInt(u.value),delegated_to:l.value,pox_address:f,until_burn_ht:p?Number(p.value):void 0}}}else{if(o.type===we.OptionalNone)return{delegated:!1};throw new Error("Error fetching delegation info")}})}async verifySignerKeySignature({topic:t,poxAddress:n,rewardCycle:r,period:i,signerSignature:o,signerKey:a,amount:u,maxAmount:l,authId:f}){const p=await this.getPoxInfo(),[m,y]=this.parseContractId(p.contract_id),w="verify-signer-key-sig",b=[xi(n),ft(r),Qm(t),ft(i),o?Xi(kr(rt(o))):Rr(),kr(rt(a)),ft(u),ft(l),ft(f)];return hh({contractAddress:m,contractName:y,functionName:w,functionArgs:b,senderAddress:this.address,client:this.client}).then(x=>x.type===we.ResponseOk)}async getStackingContract(t){switch(t=t??await this.getPoxOperationInfo(),t.period){case Rl.Period1:return t.pox1.contract_id;case Rl.Period2a:case Rl.Period2b:return t.pox2.contract_id;case Rl.Period3:default:return t.current.contract_id}}modifyLockTxFee({tx:t,amountMicroStx:n}){const r=gK(t.auth);return t.payload.functionArgs[0]=ft(Yt(n)-r),t}parseContractId(t){const n=t.split(".");if(n.length===2&&vf(n[0])&&n[1].startsWith("pox"))return n;throw new Error("Stacking contract ID is malformed")}signPoxSignature({topic:t,poxAddress:n,rewardCycle:r,period:i,signerPrivateKey:o,authId:a,maxAmount:u}){return jQ({topic:t,poxAddress:n,rewardCycle:r,period:i,network:this.network,privateKey:o,maxAmount:u,authId:a})}}function xo(e){return e.senderKey=e.privateKey,delete e.privateKey,e}const DQ="https://browser.blockstack.org/auth",JQ={"@type":"Person","@context":"http://schema.org"},h8=["store_write"],$Q="blockstack-session";class rb{constructor(t=h8.slice(),n=(u=>(u=L_("location",{returnEmptyObject:!0}))==null?void 0:u.origin)(),r="",i="/manifest.json",o=void 0,a=DQ){this.appDomain=n,this.scopes=t,this.redirectPath=r,this.manifestPath=i,this.coreNode=o,this.authenticatorURL=a}redirectURI(){return`${this.appDomain}${this.redirectPath}`}manifestURI(){return`${this.appDomain}${this.manifestPath}`}}var Dd={},vu={},vi={},WF;function ib(){if(WF)return vi;WF=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.decode=vi.encode=vi.unescape=vi.escape=vi.pad=void 0;const e=h_();function t(a){return`${a}${"=".repeat(4-(a.length%4||4))}`}vi.pad=t;function n(a){return a.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}vi.escape=n;function r(a){return t(a).replace(/-/g,"+").replace(/_/g,"/")}vi.unescape=r;function i(a){return n((0,e.fromByteArray)(new TextEncoder().encode(a)))}vi.encode=i;function o(a){return new TextDecoder().decode((0,e.toByteArray)(t(r(a))))}return vi.decode=o,vi}var gx={},Nm={},yx={},VF;function qQ(){return VF||(VF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=uM(),n=zl();class r extends n.Hash{constructor(a,u){super(),this.finished=!1,this.destroyed=!1,(0,t.hash)(a);const l=(0,n.toBytes)(u);if(this.iHash=a.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const f=this.blockLen,p=new Uint8Array(f);p.set(l.length>f?a.create().update(l).digest():l);for(let m=0;mnew r(o,a).update(u).digest();e.hmac=i,e.hmac.create=(o,a)=>new r(o,a)}(yx)),yx}var wx={},GF;function UQ(){return GF||(GF=1,function(e){/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.schnorr=e.verify=e.signSync=e.sign=e.getSharedSecret=e.recoverPublicKey=e.getPublicKey=e.Signature=e.Point=e.CURVE=void 0;const t=h4,n=BigInt(0),r=BigInt(1),i=BigInt(2),o=BigInt(3),a=BigInt(8),u=Object.freeze({a:n,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:r,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});e.CURVE=u;const l=(V,L)=>(V+L/i)/L,f={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(V){const{n:L}=u,G=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),Z=-r*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),de=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),me=G,Te=BigInt("0x100000000000000000000000000000000"),Ae=l(me*V,L),nt=l(-Z*V,L);let ze=oe(V-Ae*G-nt*de,L),st=oe(-Ae*Z-nt*me,L);const ot=ze>Te,Ke=st>Te;if(ot&&(ze=L-ze),Ke&&(st=L-st),ze>Te||st>Te)throw new Error("splitScalarEndo: Endomorphism failed, k="+V);return{k1neg:ot,k1:ze,k2neg:Ke,k2:st}}},p=32,m=32,y=32,w=p+1,b=2*p+1;function x(V){const{a:L,b:G}=u,Z=oe(V*V),de=oe(Z*V);return oe(de+L*V+G)}const k=u.a===n;class O extends Error{constructor(L){super(L)}}function N(V){if(!(V instanceof E))throw new TypeError("JacobianPoint expected")}class E{constructor(L,G,Z){this.x=L,this.y=G,this.z=Z}static fromAffine(L){if(!(L instanceof A))throw new TypeError("JacobianPoint#fromAffine: expected Point");return L.equals(A.ZERO)?E.ZERO:new E(L.x,L.y,r)}static toAffineBatch(L){const G=Xe(L.map(Z=>Z.z));return L.map((Z,de)=>Z.toAffine(G[de]))}static normalizeZ(L){return E.toAffineBatch(L).map(E.fromAffine)}equals(L){N(L);const{x:G,y:Z,z:de}=this,{x:me,y:Te,z:Ae}=L,nt=oe(de*de),ze=oe(Ae*Ae),st=oe(G*ze),ot=oe(me*nt),Ke=oe(oe(Z*Ae)*ze),Et=oe(oe(Te*de)*nt);return st===ot&&Ke===Et}negate(){return new E(this.x,oe(-this.y),this.z)}double(){const{x:L,y:G,z:Z}=this,de=oe(L*L),me=oe(G*G),Te=oe(me*me),Ae=L+me,nt=oe(i*(oe(Ae*Ae)-de-Te)),ze=oe(o*de),st=oe(ze*ze),ot=oe(st-i*nt),Ke=oe(ze*(nt-ot)-a*Te),Et=oe(i*G*Z);return new E(ot,Ke,Et)}add(L){N(L);const{x:G,y:Z,z:de}=this,{x:me,y:Te,z:Ae}=L;if(me===n||Te===n)return this;if(G===n||Z===n)return L;const nt=oe(de*de),ze=oe(Ae*Ae),st=oe(G*ze),ot=oe(me*nt),Ke=oe(oe(Z*Ae)*ze),Et=oe(oe(Te*de)*nt),Ut=oe(ot-st),Lt=oe(Et-Ke);if(Ut===n)return Lt===n?this.double():E.ZERO;const Wn=oe(Ut*Ut),Xn=oe(Ut*Wn),di=oe(st*Wn),Ku=oe(Lt*Lt-Xn-i*di),Qu=oe(Lt*(di-Ku)-Ke*Xn),$o=oe(de*Ae*Ut);return new E(Ku,Qu,$o)}subtract(L){return this.add(L.negate())}multiplyUnsafe(L){const G=E.ZERO;if(typeof L=="bigint"&&L===n)return G;let Z=ge(L);if(Z===r)return this;if(!k){let ot=G,Ke=this;for(;Z>n;)Z&r&&(ot=ot.add(Ke)),Ke=Ke.double(),Z>>=r;return ot}let{k1neg:de,k1:me,k2neg:Te,k2:Ae}=f.splitScalar(Z),nt=G,ze=G,st=this;for(;me>n||Ae>n;)me&r&&(nt=nt.add(st)),Ae&r&&(ze=ze.add(st)),st=st.double(),me>>=r,Ae>>=r;return de&&(nt=nt.negate()),Te&&(ze=ze.negate()),ze=new E(oe(ze.x*f.beta),ze.y,ze.z),nt.add(ze)}precomputeWindow(L){const G=k?128/L+1:256/L+1,Z=[];let de=this,me=de;for(let Te=0;Te>=ot,Ut>nt&&(Ut-=st,L+=r);const Lt=Et,Wn=Et+Math.abs(Ut)-1,Xn=Ke%2!==0,di=Ut<0;Ut===0?Te=Te.add(T(Xn,de[Lt])):me=me.add(T(di,de[Wn]))}return{p:me,f:Te}}multiply(L,G){let Z=ge(L),de,me;if(k){const{k1neg:Te,k1:Ae,k2neg:nt,k2:ze}=f.splitScalar(Z);let{p:st,f:ot}=this.wNAF(Ae,G),{p:Ke,f:Et}=this.wNAF(ze,G);st=T(Te,st),Ke=T(nt,Ke),Ke=new E(oe(Ke.x*f.beta),Ke.y,Ke.z),de=st.add(Ke),me=ot.add(Et)}else{const{p:Te,f:Ae}=this.wNAF(Z,G);de=Te,me=Ae}return E.normalizeZ([de,me])[0]}toAffine(L){const{x:G,y:Z,z:de}=this,me=this.equals(E.ZERO);L==null&&(L=me?a:Ne(de));const Te=L,Ae=oe(Te*Te),nt=oe(Ae*Te),ze=oe(G*Ae),st=oe(Z*nt),ot=oe(de*Te);if(me)return A.ZERO;if(ot!==r)throw new Error("invZ was invalid");return new A(ze,st)}}E.BASE=new E(u.Gx,u.Gy,r),E.ZERO=new E(n,r,n);function T(V,L){const G=L.negate();return V?G:L}const B=new WeakMap;class A{constructor(L,G){this.x=L,this.y=G}_setWindowSize(L){this._WINDOW_SIZE=L,B.delete(this)}hasEvenY(){return this.y%i===n}static fromCompressedHex(L){const G=L.length===32,Z=I(G?L:L.subarray(1));if(!Ct(Z))throw new Error("Point is not on curve");const de=x(Z);let me=ke(de);const Te=(me&r)===r;G?Te&&(me=oe(-me)):(L[0]&1)===1!==Te&&(me=oe(-me));const Ae=new A(Z,me);return Ae.assertValidity(),Ae}static fromUncompressedHex(L){const G=I(L.subarray(1,p+1)),Z=I(L.subarray(p+1,p*2+1)),de=new A(G,Z);return de.assertValidity(),de}static fromHex(L){const G=te(L),Z=G.length,de=G[0];if(Z===p)return this.fromCompressedHex(G);if(Z===w&&(de===2||de===3))return this.fromCompressedHex(G);if(Z===b&&de===4)return this.fromUncompressedHex(G);throw new Error(`Point.fromHex: received invalid point. Expected 32-${w} compressed bytes or ${b} uncompressed bytes, not ${Z}`)}static fromPrivateKey(L){return A.BASE.multiply(hn(L))}static fromSignature(L,G,Z){const{r:de,s:me}=cr(G);if(![0,1,2,3].includes(Z))throw new Error("Cannot recover: invalid recovery bit");const Te=Nt(te(L)),{n:Ae}=u,nt=Z===2||Z===3?de+Ae:de,ze=Ne(nt,Ae),st=oe(-Te*ze,Ae),ot=oe(me*ze,Ae),Ke=Z&1?"03":"02",Et=A.fromHex(Ke+q(nt)),Ut=A.BASE.multiplyAndAddUnsafe(Et,st,ot);if(!Ut)throw new Error("Cannot recover signature: point at infinify");return Ut.assertValidity(),Ut}toRawBytes(L=!1){return X(this.toHex(L))}toHex(L=!1){const G=q(this.x);return L?`${this.hasEvenY()?"02":"03"}${G}`:`04${G}${q(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const L="Point is not on elliptic curve",{x:G,y:Z}=this;if(!Ct(G)||!Ct(Z))throw new Error(L);const de=oe(Z*Z),me=x(G);if(oe(de-me)!==n)throw new Error(L)}equals(L){return this.x===L.x&&this.y===L.y}negate(){return new A(this.x,oe(-this.y))}double(){return E.fromAffine(this).double().toAffine()}add(L){return E.fromAffine(this).add(E.fromAffine(L)).toAffine()}subtract(L){return this.add(L.negate())}multiply(L){return E.fromAffine(this).multiply(L,this).toAffine()}multiplyAndAddUnsafe(L,G,Z){const de=E.fromAffine(this),me=G===n||G===r||this!==A.BASE?de.multiplyUnsafe(G):de.multiply(G),Te=E.fromAffine(L).multiplyUnsafe(Z),Ae=me.add(Te);return Ae.equals(E.ZERO)?void 0:Ae.toAffine()}}e.Point=A,A.BASE=new A(u.Gx,u.Gy),A.ZERO=new A(n,n);function U(V){return Number.parseInt(V[0],16)>=8?"00"+V:V}function v(V){if(V.length<2||V[0]!==2)throw new Error(`Invalid signature integer tag: ${P(V)}`);const L=V[1],G=V.subarray(2,L+2);if(!L||G.length!==L)throw new Error("Invalid signature integer: wrong length");if(G[0]===0&&G[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:I(G),left:V.subarray(L+2)}}function R(V){if(V.length<2||V[0]!=48)throw new Error(`Invalid signature tag: ${P(V)}`);if(V[1]!==V.length-2)throw new Error("Invalid signature: incorrect length");const{data:L,left:G}=v(V.subarray(2)),{data:Z,left:de}=v(G);if(de.length)throw new Error(`Invalid signature: left bytes after parsing: ${P(de)}`);return{r:L,s:Z}}class C{constructor(L,G){this.r=L,this.s=G,this.assertValidity()}static fromCompact(L){const G=L instanceof Uint8Array,Z="Signature.fromCompact";if(typeof L!="string"&&!G)throw new TypeError(`${Z}: Expected string or Uint8Array`);const de=G?P(L):L;if(de.length!==128)throw new Error(`${Z}: Expected 64-byte hex`);return new C(H(de.slice(0,64)),H(de.slice(64,128)))}static fromDER(L){const G=L instanceof Uint8Array;if(typeof L!="string"&&!G)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:Z,s:de}=R(G?L:X(L));return new C(Z,de)}static fromHex(L){return this.fromDER(L)}assertValidity(){const{r:L,s:G}=this;if(!Rt(L))throw new Error("Invalid Signature: r must be 0 < r < n");if(!Rt(G))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const L=u.n>>r;return this.s>L}normalizeS(){return this.hasHighS()?new C(this.r,oe(-this.s,u.n)):this}toDERRawBytes(){return X(this.toDERHex())}toDERHex(){const L=U(Q(this.s)),G=U(Q(this.r)),Z=L.length/2,de=G.length/2,me=Q(Z),Te=Q(de);return`30${Q(de+Z+4)}02${Te}${G}02${me}${L}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return X(this.toCompactHex())}toCompactHex(){return q(this.r)+q(this.s)}}e.Signature=C;function M(...V){if(!V.every(Z=>Z instanceof Uint8Array))throw new Error("Uint8Array list expected");if(V.length===1)return V[0];const L=V.reduce((Z,de)=>Z+de.length,0),G=new Uint8Array(L);for(let Z=0,de=0;ZL.toString(16).padStart(2,"0"));function P(V){if(!(V instanceof Uint8Array))throw new Error("Expected Uint8Array");let L="";for(let G=0;G0)return BigInt(V);if(typeof V=="bigint"&&Rt(V))return V;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function oe(V,L=u.P){const G=V%L;return G>=n?G:L+G}function be(V,L){const{P:G}=u;let Z=V;for(;L-- >n;)Z*=Z,Z%=G;return Z}function ke(V){const{P:L}=u,G=BigInt(6),Z=BigInt(11),de=BigInt(22),me=BigInt(23),Te=BigInt(44),Ae=BigInt(88),nt=V*V*V%L,ze=nt*nt*V%L,st=be(ze,o)*ze%L,ot=be(st,o)*ze%L,Ke=be(ot,i)*nt%L,Et=be(Ke,Z)*Ke%L,Ut=be(Et,de)*Et%L,Lt=be(Ut,Te)*Ut%L,Wn=be(Lt,Ae)*Lt%L,Xn=be(Wn,Te)*Ut%L,di=be(Xn,o)*ze%L,Ku=be(di,me)*Et%L,Qu=be(Ku,G)*nt%L,$o=be(Qu,i);if($o*$o%L!==V)throw new Error("Cannot find square root");return $o}function Ne(V,L=u.P){if(V===n||L<=n)throw new Error(`invert: expected positive integers, got n=${V} mod=${L}`);let G=oe(V,L),Z=L,de=n,me=r;for(;G!==n;){const Ae=Z/G,nt=Z%G,ze=de-me*Ae;Z=G,G=nt,de=me,me=ze}if(Z!==r)throw new Error("invert: does not exist");return oe(de,L)}function Xe(V,L=u.P){const G=new Array(V.length),Z=V.reduce((me,Te,Ae)=>Te===n?me:(G[Ae]=me,oe(me*Te,L)),r),de=Ne(Z,L);return V.reduceRight((me,Te,Ae)=>Te===n?me:(G[Ae]=oe(me*G[Ae],L),oe(me*Te,L)),de),G}function Ze(V){const L=V.length*8-m*8,G=I(V);return L>0?G>>BigInt(L):G}function Nt(V,L=!1){const G=Ze(V);if(L)return G;const{n:Z}=u;return G>=Z?G-Z:G}let nn,kt;class En{constructor(L,G){if(this.hashLen=L,this.qByteLen=G,typeof L!="number"||L<2)throw new Error("hashLen must be a number");if(typeof G!="number"||G<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(L).fill(1),this.k=new Uint8Array(L).fill(0),this.counter=0}hmac(...L){return e.utils.hmacSha256(this.k,...L)}hmacSync(...L){return kt(this.k,...L)}checkSync(){if(typeof kt!="function")throw new O("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(L=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),L),this.v=await this.hmac(this.v),L.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),L),this.v=await this.hmac(this.v))}reseedSync(L=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),L),this.v=this.hmacSync(this.v),L.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),L),this.v=this.hmacSync(this.v))}async generate(){this.incr();let L=0;const G=[];for(;L0)L=BigInt(V);else if(typeof V=="string"){if(V.length!==2*m)throw new Error("Expected 32 bytes of private key");L=H(V)}else if(V instanceof Uint8Array){if(V.length!==m)throw new Error("Expected 32 bytes of private key");L=I(V)}else throw new TypeError("Expected valid private key");if(!Rt(L))throw new Error("Expected private key: 0 < key < n");return L}function An(V){return V instanceof A?(V.assertValidity(),V):A.fromHex(V)}function cr(V){if(V instanceof C)return V.assertValidity(),V;try{return C.fromDER(V)}catch{return C.fromCompact(V)}}function zn(V,L=!1){return A.fromPrivateKey(V).toRawBytes(L)}e.getPublicKey=zn;function qt(V,L,G,Z=!1){return A.fromSignature(V,L,G).toRawBytes(Z)}e.recoverPublicKey=qt;function on(V){const L=V instanceof Uint8Array,G=typeof V=="string",Z=(L||G)&&V.length;return L?Z===w||Z===b:G?Z===w*2||Z===b*2:V instanceof A}function ae(V,L,G=!1){if(on(V))throw new TypeError("getSharedSecret: first arg must be private key");if(!on(L))throw new TypeError("getSharedSecret: second arg must be public key");const Z=An(L);return Z.assertValidity(),Z.multiply(hn(V)).toRawBytes(G)}e.getSharedSecret=ae;function Ee(V){const L=V.length>p?V.slice(0,p):V;return I(L)}function Pe(V){const L=Ee(V),G=oe(L,u.n);return Be(G{V=te(V);const L=m+8;if(V.length1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const G=oe(I(V),u.n-r)+r;return K(G)},randomBytes:(V=32)=>{if(Qe.web)return Qe.web.getRandomValues(new Uint8Array(V));if(Qe.node){const{randomBytes:L}=Qe.node;return Uint8Array.from(L(V))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>e.utils.hashToPrivateKey(e.utils.randomBytes(m+8)),precompute(V=8,L=A.BASE){const G=L===A.BASE?L:new A(L.x,L.y);return G._setWindowSize(V),G.multiply(o),G},sha256:async(...V)=>{if(Qe.web){const L=await Qe.web.subtle.digest("SHA-256",M(...V));return new Uint8Array(L)}else if(Qe.node){const{createHash:L}=Qe.node,G=L("sha256");return V.forEach(Z=>G.update(Z)),Uint8Array.from(G.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(V,...L)=>{if(Qe.web){const G=await Qe.web.subtle.importKey("raw",V,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Z=M(...L),de=await Qe.web.subtle.sign("HMAC",G,Z);return new Uint8Array(de)}else if(Qe.node){const{createHmac:G}=Qe.node,Z=G("sha256",V);return L.forEach(de=>Z.update(de)),Uint8Array.from(Z.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(V,...L)=>{let G=Xt[V];if(G===void 0){const Z=await e.utils.sha256(Uint8Array.from(V,de=>de.charCodeAt(0)));G=M(Z,Z),Xt[V]=G}return e.utils.sha256(G,...L)},taggedHashSync:(V,...L)=>{if(typeof nn!="function")throw new O("sha256Sync is undefined, you need to set it");let G=Xt[V];if(G===void 0){const Z=nn(Uint8Array.from(V,de=>de.charCodeAt(0)));G=M(Z,Z),Xt[V]=G}return nn(G,...L)},_JacobianPoint:E},Object.defineProperties(e.utils,{sha256Sync:{configurable:!1,get(){return nn},set(V){nn||(nn=V)}},hmacSha256Sync:{configurable:!1,get(){return kt},set(V){kt||(kt=V)}}})}(wx)),wx}var Jd={},KF;function HQ(){if(KF)return Jd;KF=1,Object.defineProperty(Jd,"__esModule",{value:!0}),Jd.joseToDer=Jd.derToJose=void 0;const e=h_(),t=ib();function n(k){return(k/8|0)+(k%8===0?0:1)}const r={ES256:n(256),ES384:n(384),ES512:n(521)};function i(k){const O=r[k];if(O)return O;throw new Error(`Unknown algorithm "${k}"`)}const o=128,a=0,u=32,l=16,f=2,p=l|u|a<<6,m=f|a<<6;function y(k){if(k instanceof Uint8Array)return k;if(typeof k=="string")return(0,e.toByteArray)((0,t.pad)(k));throw new TypeError("ECDSA signature must be a Base64 string or a Uint8Array")}function w(k,O){const N=y(k),E=i(O),T=E+1,B=N.length;let A=0;if(N[A++]!==p)throw new Error('Could not find expected "seq"');let U=N[A++];if(U===(o|1)&&(U=N[A++]),B-A=o&&--E,E}function x(k,O){k=y(k);const N=i(O),E=k.length;if(E!==N*2)throw new TypeError(`"${O}" signatures must be "${N*2}" bytes, saw "${E}"`);const T=b(k,0,N),B=b(k,N,k.length),A=N-T,U=N-B,v=2+A+1+1+U,R=v{const f=e.hmac.create(t.sha256,u);return l.forEach(p=>f.update(p)),f.digest()};class a{static derivePublicKey(l,f=!0){return l.length===66&&(l=l.slice(0,64)),l.length<64&&(l=l.padStart(64,"0")),(0,o.bytesToHex)(n.getPublicKey(l,f))}static signHash(l,f,p="jose"){if(!l||!f)throw new i.MissingParametersError("a signing input hash and private key are all required");const m=n.signSync(l,f.slice(0,64),{der:!0,canonical:!1});if(p==="der")return(0,o.bytesToHex)(m);if(p==="jose")return(0,r.derToJose)(m,"ES256");throw Error("Invalid signature format")}static loadSignature(l){return(0,r.joseToDer)(l,"ES256")}static verifyHash(l,f,p){if(!l||!f||!p)throw new i.MissingParametersError("a signing input hash, der signature, and public key are all required");return n.verify(f,l,p,{strict:!1})}}return Nm.SECP256K1Client=a,a.algorithmName="ES256K",Nm}var XF;function ck(){return XF||(XF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.cryptoClients=e.SECP256K1Client=void 0;const t=zQ();Object.defineProperty(e,"SECP256K1Client",{enumerable:!0,get:function(){return t.SECP256K1Client}});const n={ES256K:t.SECP256K1Client};e.cryptoClients=n}(gx)),gx}var xu={},ZF;function p8(){if(ZF)return xu;ZF=1;var e=xu&&xu.__awaiter||function(i,o,a,u){function l(f){return f instanceof a?f:new a(function(p){p(f)})}return new(a||(a=Promise))(function(f,p){function m(b){try{w(u.next(b))}catch(x){p(x)}}function y(b){try{w(u.throw(b))}catch(x){p(x)}}function w(b){b.done?f(b.value):l(b.value).then(m,y)}w((u=u.apply(i,o||[])).next())})};Object.defineProperty(xu,"__esModule",{value:!0}),xu.hashSha256Async=xu.hashSha256=void 0;const t=Yw();function n(i){return(0,t.sha256)(i)}xu.hashSha256=n;function r(i){return e(this,void 0,void 0,function*(){try{if(typeof crypto<"u"&&typeof crypto.subtle<"u"){const a=typeof i=="string"?new TextEncoder().encode(i):i,u=yield crypto.subtle.digest("SHA-256",a);return new Uint8Array(u)}else{const a=h4;if(!a.createHash)throw new Error("`crypto` module does not contain `createHash`");return Promise.resolve(a.createHash("sha256").update(i).digest())}}catch(o){return console.log(o),console.log('Crypto lib not found. Neither the global `crypto.subtle` Web Crypto API, nor the or the Node.js `require("crypto").createHash` module is available. Falling back to JS implementation.'),Promise.resolve(n(i))}})}return xu.hashSha256Async=r,xu}var e3;function WQ(){if(e3)return vu;e3=1;var e=vu&&vu.__awaiter||function(l,f,p,m){function y(w){return w instanceof p?w:new p(function(b){b(w)})}return new(p||(p=Promise))(function(w,b){function x(N){try{O(m.next(N))}catch(E){b(E)}}function k(N){try{O(m.throw(N))}catch(E){b(E)}}function O(N){N.done?w(N.value):y(N.value).then(x,k)}O((m=m.apply(l,f||[])).next())})};Object.defineProperty(vu,"__esModule",{value:!0}),vu.TokenSigner=vu.createUnsecuredToken=void 0;const t=ib(),n=ck(),r=ob(),i=p8();function o(l,f){const p=[],m=t.encode(JSON.stringify(f));p.push(m);const y=t.encode(JSON.stringify(l));return p.push(y),p.join(".")}function a(l){return o(l,{typ:"JWT",alg:"none"})+"."}vu.createUnsecuredToken=a;class u{constructor(f,p){if(!(f&&p))throw new r.MissingParametersError("a signing algorithm and private key are required");if(typeof f!="string")throw new Error("signing algorithm parameter must be a string");if(f=f.toUpperCase(),!n.cryptoClients.hasOwnProperty(f))throw new Error("invalid signing algorithm");this.tokenType="JWT",this.cryptoClient=n.cryptoClients[f],this.rawPrivateKey=p}header(f={}){const p={typ:this.tokenType,alg:this.cryptoClient.algorithmName};return Object.assign({},p,f)}sign(f,p=!1,m={}){const y=this.header(m),w=o(f,y),b=(0,i.hashSha256)(w);return this.createWithSignedHash(f,p,y,w,b)}signAsync(f,p=!1,m={}){return e(this,void 0,void 0,function*(){const y=this.header(m),w=o(f,y),b=yield(0,i.hashSha256Async)(w);return this.createWithSignedHash(f,p,y,w,b)})}createWithSignedHash(f,p,m,y,w){const b=this.cryptoClient.signHash(w,this.rawPrivateKey);return p?{header:[t.encode(JSON.stringify(m))],payload:JSON.stringify(f),signature:[b]}:[y,b].join(".")}}return vu.TokenSigner=u,vu}var Cm={},t3;function VQ(){if(t3)return Cm;t3=1,Object.defineProperty(Cm,"__esModule",{value:!0}),Cm.TokenVerifier=void 0;const e=ib(),t=ck(),n=ob(),r=p8();class i{constructor(a,u){if(!(a&&u))throw new n.MissingParametersError("a signing algorithm and public key are required");if(typeof a!="string")throw"signing algorithm parameter must be a string";if(a=a.toUpperCase(),!t.cryptoClients.hasOwnProperty(a))throw"invalid signing algorithm";this.tokenType="JWT",this.cryptoClient=t.cryptoClients[a],this.rawPublicKey=u}verify(a){return typeof a=="string"?this.verifyCompact(a,!1):typeof a=="object"?this.verifyExpanded(a,!1):!1}verifyAsync(a){return typeof a=="string"?this.verifyCompact(a,!0):typeof a=="object"?this.verifyExpanded(a,!0):Promise.resolve(!1)}verifyCompact(a,u){const l=a.split("."),f=l[0]+"."+l[1],p=m=>{const y=this.cryptoClient.loadSignature(l[2]);return this.cryptoClient.verifyHash(m,y,this.rawPublicKey)};if(u)return(0,r.hashSha256Async)(f).then(m=>p(m));{const m=(0,r.hashSha256)(f);return p(m)}}verifyExpanded(a,u){const l=[a.header.join("."),e.encode(a.payload)].join(".");let f=!0;const p=m=>(a.signature.map(y=>{const w=this.cryptoClient.loadSignature(y);this.cryptoClient.verifyHash(m,w,this.rawPublicKey)||(f=!1)}),f);if(u)return(0,r.hashSha256Async)(l).then(m=>p(m));{const m=(0,r.hashSha256)(l);return p(m)}}}return Cm.TokenVerifier=i,Cm}var Em={},n3;function GQ(){if(n3)return Em;n3=1,Object.defineProperty(Em,"__esModule",{value:!0}),Em.decodeToken=void 0;const e=ib();function t(n){if(typeof n=="string"){const r=n.split("."),i=JSON.parse(e.decode(r[0])),o=JSON.parse(e.decode(r[1])),a=r[2];return{header:i,payload:o,signature:a}}else if(typeof n=="object"){if(typeof n.payload!="string")throw new Error("Expected token payload to be a base64 or json string");let r=n.payload;n.payload[0]!=="{"&&(r=e.decode(r));const i=[];return n.header.map(o=>{const a=JSON.parse(e.decode(o));i.push(a)}),{header:i,payload:JSON.parse(r),signature:n.signature}}}return Em.decodeToken=t,Em}var r3;function KQ(){return r3||(r3=1,function(e){var t=Dd&&Dd.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(i,o);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,a,u)}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=Dd&&Dd.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(WQ(),e),n(VQ(),e),n(GQ(),e),n(ob(),e),n(ck(),e)}(Dd)),Dd}var Er=KQ();function QQ(e){return`did:btc-addr:${e}`}function YQ(e){const t=e.split(":");if(t.length!==3)throw new JA("Decentralized IDs must have 3 parts");if(t[0].toLowerCase()!=="did")throw new JA('Decentralized IDs must start with "did"');return t[1].toLowerCase()}function m8(e){if(e)return YQ(e)==="btc-addr"?e.split(":")[2]:void 0}const XQ="1.4.0";function ZQ(){return lQ()}function eY(e,t,n,r=h8.slice(),i,o=Nz().getTime(),a={}){const u=w=>{const b=L_("location",{throwIfUnavailable:!0,usageDesc:`makeAuthRequest([${w}=undefined])`});return b==null?void 0:b.origin};t||(t=`${u("redirectURI")}/`),n||(n=`${u("manifestURI")}/manifest.json`),i||(i=u("appDomain"));const l=Object.assign({},a,{jti:Ez(),iat:Math.floor(new Date().getTime()/1e3),exp:Math.floor(o/1e3),iss:null,public_keys:[],domain_name:i,manifest_uri:n,redirect_uri:t,version:XQ,do_not_include_profile:!0,supports_hub_url:!0,scopes:r}),f=Er.SECP256K1Client.derivePublicKey(e);l.public_keys=[f];const p=r8(f);return l.iss=QQ(p),new Er.TokenSigner("ES256k",e).sign(l)}async function i3(e,t){const n=Eg(rt(t)),r=JSON.parse(n),i=await l8(e,r);if(typeof i!="string")throw new Error("Unable to correctly decrypt private key");return i}function tY(e){const t=Er.decodeToken(e).payload;if(typeof t=="string")throw new Error("Unexpected token payload type of string");const n=t.public_keys;if(n.length===1){const r=n[0];try{return new Er.TokenVerifier("ES256k",r).verify(e)}catch{return!1}}else throw new Error("Multiple public keys are not supported")}function nY(e){const t=Er.decodeToken(e).payload;if(typeof t=="string")throw new Error("Unexpected token payload type of string");const n=t.public_keys,r=m8(t.iss);if(n.length===1){if(r8(n[0])===r)return!0}else throw new Error("Multiple public keys are not supported");return!1}function rY(e){const t=Er.decodeToken(e).payload;if(typeof t=="string")throw new Error("Unexpected token payload type of string");if(t.iat){if(typeof t.iat!="number")return!1;const n=new Date(t.iat*1e3);return!(new Date().getTime()n.getTime())}else return!0}async function oY(e){return(await Promise.all([iY(e),rY(e),tY(e),nY(e)])).every(n=>n)}const o3="1.0.0";class Fl{constructor(t){this.version=o3,this.userData=t.userData,this.transitKey=t.transitKey,this.etags=t.etags?t.etags:{}}static fromJSON(t){if(t.version!==o3)throw new f1(`JSON data version ${t.version} not supported by SessionData`);const n={coreNode:t.coreNode,userData:t.userData,transitKey:t.transitKey,etags:t.etags};return new Fl(n)}toString(){return JSON.stringify(this)}}class g8{constructor(t){if(t){const n=new Fl(t);this.setSessionData(n)}}getSessionData(){throw new Error("Abstract class")}setSessionData(t){throw new Error("Abstract class")}deleteSessionData(){throw new Error("Abstract class")}}class s3 extends g8{constructor(t){super(t),this.sessionData||this.setSessionData(new Fl({}))}getSessionData(){if(!this.sessionData)throw new NP("No session data was found.");return this.sessionData}setSessionData(t){return this.sessionData=t,!0}deleteSessionData(){return this.setSessionData(new Fl({})),!0}}class a3 extends g8{constructor(t){if(super(t),t&&t.storeOptions&&t.storeOptions.localStorageKey&&typeof t.storeOptions.localStorageKey=="string"?this.key=t.storeOptions.localStorageKey:this.key=$Q,!localStorage.getItem(this.key)){const r=new Fl({});this.setSessionData(r)}}getSessionData(){const t=localStorage.getItem(this.key);if(!t)throw new NP("No session data was found in localStorage");const n=JSON.parse(t);return Fl.fromJSON(n)}setSessionData(t){return localStorage.setItem(this.key,t.toString()),!0}deleteSessionData(){return localStorage.removeItem(this.key),this.setSessionData(new Fl({})),!0}}function sY(e,t){const n=Er.decodeToken(e),r=n.payload;if(typeof r=="string")throw new Error("Unexpected token payload type of string");if(r.hasOwnProperty("subject")&&r.subject){if(!r.subject.hasOwnProperty("publicKey"))throw new Error("Token doesn't have a subject public key")}else throw new Error("Token doesn't have a subject");if(r.hasOwnProperty("issuer")&&r.issuer){if(!r.issuer.hasOwnProperty("publicKey"))throw new Error("Token doesn't have an issuer public key")}else throw new Error("Token doesn't have an issuer");if(!r.hasOwnProperty("claim"))throw new Error("Token doesn't have a claim");const i=r.issuer.publicKey,o=eK(i);if(t!==i){if(t!==o)throw new Error("Token issuer public key does not match the verifying value")}const a=new Er.TokenVerifier(n.header.alg,i);if(!a)throw new Error("Invalid token verifier");if(!a.verify(e))throw new Error("Token verification failed");return n}function aY(e,t=null){let n;t?n=sY(e,t):n=Er.decodeToken(e);let r={};if(n.hasOwnProperty("payload")){const i=n.payload;if(typeof i=="string")throw new Error("Unexpected token payload type of string");i.hasOwnProperty("claim")&&(r=i.claim)}return r}const c3="_blockstackDidCheckEchoReply",cY="echoReply",uY="authContinuation";function lY(e){return e?(/^[?#]/.test(e)?e.slice(1):e).split("&").reduce((n,r)=>{const[i,o]=r.split("=");return n[i]=o?decodeURIComponent(o.replace(/\+/g," ")):"",n},{}):{}}function dY(){let e;if(typeof self<"u")e=self;else if(typeof window<"u")e=window;else return!1;if(!e.location||!e.localStorage)return!1;const t=e[c3];if(typeof t=="boolean")return t;const n=lY(e.location.search),r=n[cY];if(r){e[c3]=!0;const i=`echo-reply-${r}`;return e.localStorage.setItem(i,"success"),e.setTimeout(()=>{const o=n[uY];e.location.href=o},10),!0}return!1}class hg{constructor(t){let n=!0;if(typeof window>"u"&&typeof self>"u"&&(n=!1),t&&t.appConfig)this.appConfig=t.appConfig;else if(n)this.appConfig=new rb;else throw new Oz("You need to specify options.appConfig");t&&t.sessionStore?this.store=t.sessionStore:n?t?this.store=new a3(t.sessionOptions):this.store=new a3:t?this.store=new s3(t.sessionOptions):this.store=new s3}makeAuthRequestToken(t,n,r,i,o,a=Cz().getTime(),u={}){const l=this.appConfig;if(!l)throw new f1("Missing AppConfig");return t=t||this.generateAndStoreTransitKey(),n=n||l.redirectURI(),r=r||l.manifestURI(),i=i||l.scopes,o=o||l.appDomain,eY(t,n,r,i,o,a,u)}generateAndStoreTransitKey(){const t=this.store.getSessionData(),n=ZQ();return t.transitKey=n,this.store.setSessionData(t),n}getAuthResponseToken(){var r;const t=(r=L_("location",{throwIfUnavailable:!0,usageDesc:"getAuthResponseToken"}))==null?void 0:r.search;return new URLSearchParams(t).get("authResponse")??""}isSignInPending(){try{if(dY())return yh.info("protocolEchoReply detected from isSignInPending call, the page is about to redirect."),!0}catch(t){yh.error(`Error checking for protocol echo reply isSignInPending: ${t}`)}return!!this.getAuthResponseToken()}isUserSignedIn(){return!!this.store.getSessionData().userData}async handlePendingSignIn(t=this.getAuthResponseToken(),n=PP()){const r=this.store.getSessionData();if(r.userData)throw new u0("Existing user session found.");const i=this.store.getSessionData().transitKey;this.appConfig&&this.appConfig.coreNode;const o=Er.decodeToken(t).payload;if(typeof o=="string")throw new Error("Unexpected token payload type of string");if(!await oY(t))throw new u0("Invalid authentication response.");let u=o.private_key,l=o.core_token;if(Yv(o.version,"1.1.0"))if(i!==void 0&&i!=null){if(o.private_key!==void 0&&o.private_key!==null)try{u=await i3(i,o.private_key)}catch{if(yh.warn("Failed decryption of appPrivateKey, will try to use as given"),!ri.isValidPrivateKey(o.private_key))throw new u0("Failed decrypting appPrivateKey. Usually means that the transit key has changed during login.")}if(l!=null)try{l=await i3(i,l)}catch{yh.info("Failed decryption of coreSessionToken, will try to use as given")}}else throw new u0("Authenticating with protocol > 1.1.0 requires transit key, and none found.");let f=qz,p;Yv(o.version,"1.2.0")&&o.hubUrl!==null&&o.hubUrl!==void 0&&(f=o.hubUrl),Yv(o.version,"1.3.0")&&o.associationToken!==null&&o.associationToken!==void 0&&(p=o.associationToken);const m={profile:o.profile,email:o.email,decentralizedID:o.iss,identityAddress:m8(o.iss),appPrivateKey:u,coreSessionToken:l,authResponseToken:t,hubUrl:f,appPrivateKeyFromWalletSalt:o.appPrivateKeyFromWalletSalt,coreNode:o.blockstackAPIUrl,gaiaAssociationToken:p},y=o.profile_url;if(!m.profile&&y){const w=await n(y);if(!w.ok)m.profile=Object.assign({},JQ);else{const b=await w.text(),x=JSON.parse(b);m.profile=aY(x[0].token)}}else m.profile=o.profile;return r.userData=m,this.store.setSessionData(r),m}loadUserData(){const t=this.store.getSessionData().userData;if(!t)throw new f1("No user data found. Did the user sign in?");return t}encryptContent(t,n){const r=Object.assign({},n);return r.privateKey||(r.privateKey=this.loadUserData().appPrivateKey),TQ(t,r)}decryptContent(t,n){const r=Object.assign({},n);return r.privateKey||(r.privateKey=this.loadUserData().appPrivateKey),OQ(t,r)}signUserOut(t){this.store.deleteSessionData(),t&&typeof location<"u"&&location.href&&(location.href=t)}}hg.prototype.makeAuthRequest=hg.prototype.makeAuthRequestToken;const fY=()=>typeof window>"u"?[]:window.webbtc_stx_providers?window.webbtc_stx_providers:[],hY=(e=[])=>{if(typeof window>"u")return[];const t=fY(),n=e.filter(r=>t.find(o=>o.id===r.id)?!1:!!y8(r.id));return t.concat(n)},y8=e=>e==null?void 0:e.split(".").reduce((t,n)=>t==null?void 0:t[n],window),uk="STX_PROVIDER",w8=()=>typeof window>"u"?null:window.localStorage.getItem(uk),tle=e=>{typeof window<"u"&&window.localStorage.setItem(uk,e)},pY=()=>{typeof window<"u"&&window.localStorage.removeItem(uk)};var bx={},u3;function mY(){return u3||(u3=1,function(){(function(e){(function(t){var n={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};function r(R){return R&&DataView.prototype.isPrototypeOf(R)}if(n.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(R){return R&&i.indexOf(Object.prototype.toString.call(R))>-1};function a(R){if(typeof R!="string"&&(R=String(R)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(R))throw new TypeError("Invalid character in header field name");return R.toLowerCase()}function u(R){return typeof R!="string"&&(R=String(R)),R}function l(R){var C={next:function(){var M=R.shift();return{done:M===void 0,value:M}}};return n.iterable&&(C[Symbol.iterator]=function(){return C}),C}function f(R){this.map={},R instanceof f?R.forEach(function(C,M){this.append(M,C)},this):Array.isArray(R)?R.forEach(function(C){this.append(C[0],C[1])},this):R&&Object.getOwnPropertyNames(R).forEach(function(C){this.append(C,R[C])},this)}f.prototype.append=function(R,C){R=a(R),C=u(C);var M=this.map[R];this.map[R]=M?M+", "+C:C},f.prototype.delete=function(R){delete this.map[a(R)]},f.prototype.get=function(R){return R=a(R),this.has(R)?this.map[R]:null},f.prototype.has=function(R){return this.map.hasOwnProperty(a(R))},f.prototype.set=function(R,C){this.map[a(R)]=u(C)},f.prototype.forEach=function(R,C){for(var M in this.map)this.map.hasOwnProperty(M)&&R.call(C,this.map[M],M,this)},f.prototype.keys=function(){var R=[];return this.forEach(function(C,M){R.push(M)}),l(R)},f.prototype.values=function(){var R=[];return this.forEach(function(C){R.push(C)}),l(R)},f.prototype.entries=function(){var R=[];return this.forEach(function(C,M){R.push([M,C])}),l(R)},n.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function p(R){if(R.bodyUsed)return Promise.reject(new TypeError("Already read"));R.bodyUsed=!0}function m(R){return new Promise(function(C,M){R.onload=function(){C(R.result)},R.onerror=function(){M(R.error)}})}function y(R){var C=new FileReader,M=m(C);return C.readAsArrayBuffer(R),M}function w(R){var C=new FileReader,M=m(C);return C.readAsText(R),M}function b(R){for(var C=new Uint8Array(R),M=new Array(C.length),J=0;J-1?C:R}function E(R,C){C=C||{};var M=C.body;if(R instanceof E){if(R.bodyUsed)throw new TypeError("Already read");this.url=R.url,this.credentials=R.credentials,C.headers||(this.headers=new f(R.headers)),this.method=R.method,this.mode=R.mode,this.signal=R.signal,!M&&R._bodyInit!=null&&(M=R._bodyInit,R.bodyUsed=!0)}else this.url=String(R);if(this.credentials=C.credentials||this.credentials||"same-origin",(C.headers||!this.headers)&&(this.headers=new f(C.headers)),this.method=N(C.method||this.method||"GET"),this.mode=C.mode||this.mode||null,this.signal=C.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&M)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(M)}E.prototype.clone=function(){return new E(this,{body:this._bodyInit})};function T(R){var C=new FormData;return R.trim().split("&").forEach(function(M){if(M){var J=M.split("="),P=J.shift().replace(/\+/g," "),D=J.join("=").replace(/\+/g," ");C.append(decodeURIComponent(P),decodeURIComponent(D))}}),C}function B(R){var C=new f,M=R.replace(/\r?\n[\t ]+/g," ");return M.split(/\r?\n/).forEach(function(J){var P=J.split(":"),D=P.shift().trim();if(D){var q=P.join(":").trim();C.append(D,q)}}),C}k.call(E.prototype);function A(R,C){C||(C={}),this.type="default",this.status=C.status===void 0?200:C.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in C?C.statusText:"OK",this.headers=new f(C.headers),this.url=C.url||"",this._initBody(R)}k.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},A.error=function(){var R=new A(null,{status:0,statusText:""});return R.type="error",R};var U=[301,302,303,307,308];A.redirect=function(R,C){if(U.indexOf(C)===-1)throw new RangeError("Invalid status code");return new A(null,{status:C,headers:{location:R}})},t.DOMException=e.DOMException;try{new t.DOMException}catch{t.DOMException=function(C,M){this.message=C,this.name=M;var J=Error(C);this.stack=J.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function v(R,C){return new Promise(function(M,J){var P=new E(R,C);if(P.signal&&P.signal.aborted)return J(new t.DOMException("Aborted","AbortError"));var D=new XMLHttpRequest;function q(){D.abort()}D.onload=function(){var K={status:D.status,statusText:D.statusText,headers:B(D.getAllResponseHeaders()||"")};K.url="responseURL"in D?D.responseURL:K.headers.get("X-Request-URL");var Q="response"in D?D.response:D.responseText;M(new A(Q,K))},D.onerror=function(){J(new TypeError("Network request failed"))},D.ontimeout=function(){J(new TypeError("Network request failed"))},D.onabort=function(){J(new t.DOMException("Aborted","AbortError"))},D.open(P.method,P.url,!0),P.credentials==="include"?D.withCredentials=!0:P.credentials==="omit"&&(D.withCredentials=!1),"responseType"in D&&n.blob&&(D.responseType="blob"),P.headers.forEach(function(K,Q){D.setRequestHeader(Q,K)}),P.signal&&(P.signal.addEventListener("abort",q),D.onreadystatechange=function(){D.readyState===4&&P.signal.removeEventListener("abort",q)}),D.send(typeof P._bodyInit>"u"?null:P._bodyInit)})}return v.polyfill=!0,e.fetch||(e.fetch=v,e.Headers=f,e.Request=E,e.Response=A),t.Headers=f,t.Request=E,t.Response=A,t.fetch=v,Object.defineProperty(t,"__esModule",{value:!0}),t})({})})(typeof self<"u"?self:bx)}()),bx}mY();const gY={referrerPolicy:"origin",headers:{"x-hiro-product":"stacksjs"}};async function yY(e,t){const n={};return Object.assign(n,gY,t),await fetch(e,n)}function wY(e){let t=yY,n=[];return e.length>0&&typeof e[0]=="function"&&(t=e.shift()),e.length>0&&(n=e),{fetchLib:t,middlewares:n}}function bY(...e){const{fetchLib:t,middlewares:n}=wY(e);return async(i,o)=>{let a={url:i,init:o??{}};for(const l of n)typeof l.pre=="function"&&(a=await Promise.resolve(l.pre({fetch:t,...a}))??a);let u=await t(a.url,a.init);for(const l of n)typeof l.post=="function"&&(u=await Promise.resolve(l.post({fetch:t,url:a.url,init:a.init,response:(u==null?void 0:u.clone())??u}))??u);return u}}function SY(e,t,n){return dk(b8(e),n)}function b8(e,t){let n=e;if(typeof n=="number"){if(!Number.isInteger(n))throw new RangeError("Invalid value. Values of type 'number' must be an integer.");if(n>Number.MAX_SAFE_INTEGER)throw new RangeError(`Invalid value. Values of type 'number' must be less than or equal to ${Number.MAX_SAFE_INTEGER}. For larger values, try using a BigInt instead.`);return BigInt(n)}if(typeof n=="string")if(n.toLowerCase().startsWith("0x")){let r=n.slice(2);r=r.padStart(r.length+r.length%2,"0"),n=pg(r)}else try{return BigInt(n)}catch(r){if(r instanceof SyntaxError)throw new RangeError(`Invalid value. String integer '${n}' is not finite.`)}if(typeof n=="bigint")return n;if(n instanceof Uint8Array)return BigInt(`0x${_Y(n)}`);if(n!=null&&typeof n=="object"&&n.constructor.name==="BN")return BigInt(n.toString());throw new TypeError("Invalid value type. Must be a number, bigint, integer-string, hex-string, or Uint8Array.")}function lk(e,t=8){return(typeof e=="bigint"?e:b8(e)).toString(16).padStart(t*2,"0")}function dk(e,t=16){const n=lk(e,t);return pg(n)}function vY(e,t){if(e<-(BigInt(1)<=BigInt(0)?BigInt(e):e+(BigInt(1)<t.toString(16).padStart(2,"0"));function _Y(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(const n of e)t+=xY[n];return t}function pg(e){if(typeof e!="string")throw new TypeError(`hexToBytes: expected string, got ${typeof e}`);e=e.startsWith("0x")||e.startsWith("0X")?e.slice(2):e;const t=e.length%2?`0${e}`:e,n=new Uint8Array(t.length/2);for(let r=0;r255}function l3(e){if(e.some(RY))throw new Error("Some values are invalid bytes.");return new Uint8Array(e)}function hk(...e){if(!e.every(r=>r instanceof Uint8Array))throw new Error("Uint8Array list expected");if(e.length===1)return e[0];const t=e.reduce((r,i)=>r+i.length,0),n=new Uint8Array(t);for(let r=0,i=0;rtypeof t=="number"?l3([t]):t instanceof Array?l3(t):t))}var Kh;(function(e){e[e.Testnet=2147483648]="Testnet",e[e.Mainnet=1]="Mainnet"})(Kh||(Kh={}));var pf;(function(e){e[e.Mainnet=0]="Mainnet",e[e.Testnet=128]="Testnet"})(pf||(pf={}));var d3;(function(e){e[e.Mainnet=385875968]="Mainnet",e[e.Testnet=4278190080]="Testnet"})(d3||(d3={}));function sb(e,t,n=0){return e[n+3]=t,t>>>=8,e[n+2]=t,t>>>=8,e[n+1]=t,t>>>=8,e[n]=t,e}const TY="https://api.mainnet.hiro.so",OY="https://api.testnet.hiro.so",NY="http://localhost:3999",CY=["mainnet","testnet","devnet","mocknet"];class mf{constructor(t){this.version=pf.Mainnet,this.chainId=Kh.Mainnet,this.bnsLookupUrl="https://api.mainnet.hiro.so",this.broadcastEndpoint="/v2/transactions",this.transferFeeEstimateEndpoint="/v2/fees/transfer",this.transactionFeeEstimateEndpoint="/v2/fees/transaction",this.accountEndpoint="/v2/accounts",this.contractAbiEndpoint="/v2/contracts/interface",this.readOnlyFunctionCallEndpoint="/v2/contracts/call-read",this.isMainnet=()=>this.version===pf.Mainnet,this.getBroadcastApiUrl=()=>`${this.coreApiUrl}${this.broadcastEndpoint}`,this.getTransferFeeEstimateApiUrl=()=>`${this.coreApiUrl}${this.transferFeeEstimateEndpoint}`,this.getTransactionFeeEstimateApiUrl=()=>`${this.coreApiUrl}${this.transactionFeeEstimateEndpoint}`,this.getAccountApiUrl=n=>`${this.coreApiUrl}${this.accountEndpoint}/${n}?proof=0`,this.getAccountExtendedBalancesApiUrl=n=>`${this.coreApiUrl}/extended/v1/address/${n}/balances`,this.getAbiApiUrl=(n,r)=>`${this.coreApiUrl}${this.contractAbiEndpoint}/${n}/${r}`,this.getReadOnlyFunctionCallApiUrl=(n,r,i)=>`${this.coreApiUrl}${this.readOnlyFunctionCallEndpoint}/${n}/${r}/${encodeURIComponent(i)}`,this.getInfoUrl=()=>`${this.coreApiUrl}/v2/info`,this.getBlockTimeInfoUrl=()=>`${this.coreApiUrl}/extended/v1/info/network_block_times`,this.getPoxInfoUrl=()=>`${this.coreApiUrl}/v2/pox`,this.getRewardsUrl=(n,r)=>{let i=`${this.coreApiUrl}/extended/v1/burnchain/rewards/${n}`;return r&&(i=`${i}?limit=${r.limit}&offset=${r.offset}`),i},this.getRewardsTotalUrl=n=>`${this.coreApiUrl}/extended/v1/burnchain/rewards/${n}/total`,this.getRewardHoldersUrl=(n,r)=>{let i=`${this.coreApiUrl}/extended/v1/burnchain/reward_slot_holders/${n}`;return r&&(i=`${i}?limit=${r.limit}&offset=${r.offset}`),i},this.getStackerInfoUrl=(n,r)=>`${this.coreApiUrl}${this.readOnlyFunctionCallEndpoint} - ${n}/${r}/get-stacker-info`,this.getDataVarUrl=(n,r,i)=>`${this.coreApiUrl}/v2/data_var/${n}/${r}/${i}?proof=0`,this.getMapEntryUrl=(n,r,i)=>`${this.coreApiUrl}/v2/map_entry/${n}/${r}/${i}?proof=0`,this.coreApiUrl=t.url,this.fetchFn=t.fetchFn??bY()}getNameInfo(t){const n=`${this.bnsLookupUrl}/v1/names/${t}`;return this.fetchFn(n).then(r=>{if(r.status===404)throw new Error("Name not found");if(r.status!==200)throw new Error(`Bad response status: ${r.status}`);return r.json()}).then(r=>r.address?Object.assign({},r,{address:r.address}):r)}}mf.fromName=e=>{switch(e){case"mainnet":return new I1;case"testnet":return new P1;case"devnet":return new EY;case"mocknet":return new S8;default:throw new Error(`Invalid network name provided. Must be one of the following: ${CY.join(", ")}`)}};mf.fromNameOrNetwork=e=>typeof e!="string"&&"version"in e?e:mf.fromName(e);class I1 extends mf{constructor(t){super({url:(t==null?void 0:t.url)??TY,fetchFn:t==null?void 0:t.fetchFn}),this.version=pf.Mainnet,this.chainId=Kh.Mainnet}}class P1 extends mf{constructor(t){super({url:(t==null?void 0:t.url)??OY,fetchFn:t==null?void 0:t.fetchFn}),this.version=pf.Testnet,this.chainId=Kh.Testnet}}class S8 extends mf{constructor(t){super({url:(t==null?void 0:t.url)??NY,fetchFn:t==null?void 0:t.fetchFn}),this.version=pf.Testnet,this.chainId=Kh.Testnet}}const EY=S8;var M1;(function(e){e[e.Testnet=2147483648]="Testnet",e[e.Mainnet=1]="Mainnet"})(M1||(M1={}));M1.Mainnet;const AY=128,FY=128,v8=16;var L1;(function(e){e[e.Address=0]="Address",e[e.Principal=1]="Principal",e[e.LengthPrefixedString=2]="LengthPrefixedString",e[e.MemoString=3]="MemoString",e[e.AssetInfo=4]="AssetInfo",e[e.PostCondition=5]="PostCondition",e[e.PublicKey=6]="PublicKey",e[e.LengthPrefixedList=7]="LengthPrefixedList",e[e.Payload=8]="Payload",e[e.MessageSignature=9]="MessageSignature",e[e.StructuredDataSignature=10]="StructuredDataSignature",e[e.TransactionAuthField=11]="TransactionAuthField"})(L1||(L1={}));var f3;(function(e){e[e.TokenTransfer=0]="TokenTransfer",e[e.SmartContract=1]="SmartContract",e[e.VersionedSmartContract=6]="VersionedSmartContract",e[e.ContractCall=2]="ContractCall",e[e.PoisonMicroblock=3]="PoisonMicroblock",e[e.Coinbase=4]="Coinbase",e[e.CoinbaseToAltRecipient=5]="CoinbaseToAltRecipient",e[e.TenureChange=7]="TenureChange",e[e.NakamotoCoinbase=8]="NakamotoCoinbase"})(f3||(f3={}));var h3;(function(e){e[e.Clarity1=1]="Clarity1",e[e.Clarity2=2]="Clarity2",e[e.Clarity3=3]="Clarity3"})(h3||(h3={}));var Ro;(function(e){e[e.OnChainOnly=1]="OnChainOnly",e[e.OffChainOnly=2]="OffChainOnly",e[e.Any=3]="Any"})(Ro||(Ro={}));const Sx=["onChainOnly","offChainOnly","any"];Sx[0]+"",Ro.OnChainOnly,Sx[1]+"",Ro.OffChainOnly,Sx[2]+"",Ro.Any,Ro.OnChainOnly+"",Ro.OnChainOnly,Ro.OffChainOnly+"",Ro.OffChainOnly,Ro.Any+"",Ro.Any;var B1;(function(e){e[e.Mainnet=0]="Mainnet",e[e.Testnet=128]="Testnet"})(B1||(B1={}));B1.Mainnet;var p3;(function(e){e[e.Allow=1]="Allow",e[e.Deny=2]="Deny"})(p3||(p3={}));var Qd;(function(e){e[e.STX=0]="STX",e[e.Fungible=1]="Fungible",e[e.NonFungible=2]="NonFungible"})(Qd||(Qd={}));var m3;(function(e){e[e.Standard=4]="Standard",e[e.Sponsored=5]="Sponsored"})(m3||(m3={}));var g3;(function(e){e[e.SerializeP2PKH=0]="SerializeP2PKH",e[e.SerializeP2SH=1]="SerializeP2SH",e[e.SerializeP2WPKH=2]="SerializeP2WPKH",e[e.SerializeP2WSH=3]="SerializeP2WSH",e[e.SerializeP2SHNonSequential=5]="SerializeP2SHNonSequential",e[e.SerializeP2WSHNonSequential=7]="SerializeP2WSHNonSequential"})(g3||(g3={}));var y3;(function(e){e[e.MainnetSingleSig=22]="MainnetSingleSig",e[e.MainnetMultiSig=20]="MainnetMultiSig",e[e.TestnetSingleSig=26]="TestnetSingleSig",e[e.TestnetMultiSig=21]="TestnetMultiSig"})(y3||(y3={}));var w3;(function(e){e[e.Compressed=0]="Compressed",e[e.Uncompressed=1]="Uncompressed"})(w3||(w3={}));var b3;(function(e){e[e.Equal=1]="Equal",e[e.Greater=2]="Greater",e[e.GreaterEqual=3]="GreaterEqual",e[e.Less=4]="Less",e[e.LessEqual=5]="LessEqual"})(b3||(b3={}));var S3;(function(e){e[e.Sends=16]="Sends",e[e.DoesNotSend=17]="DoesNotSend"})(S3||(S3={}));var j1;(function(e){e[e.Origin=1]="Origin",e[e.Standard=2]="Standard",e[e.Contract=3]="Contract"})(j1||(j1={}));var v3;(function(e){e[e.STX=0]="STX",e[e.Fungible=1]="Fungible",e[e.NonFungible=2]="NonFungible"})(v3||(v3={}));var x3;(function(e){e.Serialization="Serialization",e.Deserialization="Deserialization",e.SignatureValidation="SignatureValidation",e.FeeTooLow="FeeTooLow",e.BadNonce="BadNonce",e.NotEnoughFunds="NotEnoughFunds",e.NoSuchContract="NoSuchContract",e.NoSuchPublicFunction="NoSuchPublicFunction",e.BadFunctionArgument="BadFunctionArgument",e.ContractAlreadyExists="ContractAlreadyExists",e.PoisonMicroblocksDoNotConflict="PoisonMicroblocksDoNotConflict",e.PoisonMicroblockHasUnknownPubKeyHash="PoisonMicroblockHasUnknownPubKeyHash",e.PoisonMicroblockIsInvalid="PoisonMicroblockIsInvalid",e.BadAddressVersionByte="BadAddressVersionByte",e.NoCoinbaseViaMempool="NoCoinbaseViaMempool",e.ServerFailureNoSuchChainTip="ServerFailureNoSuchChainTip",e.TooMuchChaining="TooMuchChaining",e.ConflictingNonceInMempool="ConflictingNonceInMempool",e.BadTransactionVersion="BadTransactionVersion",e.TransferRecipientCannotEqualSender="TransferRecipientCannotEqualSender",e.TransferAmountMustBePositive="TransferAmountMustBePositive",e.ServerFailureDatabase="ServerFailureDatabase",e.EstimatorError="EstimatorError",e.TemporarilyBlacklisted="TemporarilyBlacklisted",e.ServerFailureOther="ServerFailureOther"})(x3||(x3={}));function IY(e,t,n){const i=AY;if(KY(e,i))throw new Error(`String length exceeds maximum bytes ${i}`);return{type:L1.LengthPrefixedString,content:e,lengthPrefixBytes:1,maxLengthBytes:i}}var pr;(function(e){e[e.Int=0]="Int",e[e.UInt=1]="UInt",e[e.Buffer=2]="Buffer",e[e.BoolTrue=3]="BoolTrue",e[e.BoolFalse=4]="BoolFalse",e[e.PrincipalStandard=5]="PrincipalStandard",e[e.PrincipalContract=6]="PrincipalContract",e[e.ResponseOk=7]="ResponseOk",e[e.ResponseErr=8]="ResponseErr",e[e.OptionalNone=9]="OptionalNone",e[e.OptionalSome=10]="OptionalSome",e[e.List=11]="List",e[e.Tuple=12]="Tuple",e[e.StringASCII=13]="StringASCII",e[e.StringUTF8=14]="StringUTF8"})(pr||(pr={}));class PY extends Error{constructor(t){super(t),this.message=t,this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class x8 extends PY{constructor(t){super(t)}}function ab(e){const t=[];return t.push(pg(lk(e.version,1))),t.push(pg(e.hash160)),Wu(t)}function MY(e){const t=[];return t.push(e.prefix),t.push(ab(e.address)),e.prefix===j1.Contract&&t.push(mg(e.contractName)),Wu(t)}function mg(e){const t=[],n=fk(e.content),r=n.byteLength;return t.push(pg(lk(r,e.lengthPrefixBytes))),t.push(n),Wu(t)}function LY(e){const t=[];return t.push(ab(e.address)),t.push(mg(e.contractName)),t.push(mg(e.assetName)),Wu(t)}function _8(e){const t=[];if(t.push(e.conditionType),t.push(MY(e.principal)),(e.conditionType===Qd.Fungible||e.conditionType===Qd.NonFungible)&&t.push(LY(e.assetInfo)),e.conditionType===Qd.NonFungible&&t.push(Bl(e.assetName)),t.push(e.conditionCode),e.conditionType===Qd.STX||e.conditionType===Qd.Fungible){if(e.amount>BigInt("0xffffffffffffffff"))throw new x8("The post-condition amount may not be larger than 8 bytes");t.push(SY(e.amount,!1,8))}return Wu(t)}function ws(e,t){return Wu([e,t])}function BY(e){return new Uint8Array([e.type])}function jY(e){return e.type===pr.OptionalNone?new Uint8Array([e.type]):ws(e.type,Bl(e.value))}function DY(e){const t=new Uint8Array(4);return sb(t,e.buffer.length,0),ws(e.type,hk(t,e.buffer))}function JY(e){const t=dk(vY(e.value,BigInt(FY)),v8);return ws(e.type,t)}function $Y(e){const t=dk(e.value,v8);return ws(e.type,t)}function qY(e){return ws(e.type,ab(e.address))}function UY(e){return ws(e.type,hk(ab(e.address),mg(e.contractName)))}function HY(e){return ws(e.type,Bl(e.value))}function zY(e){const t=[],n=new Uint8Array(4);sb(n,e.list.length,0),t.push(n);for(const r of e.list){const i=Bl(r);t.push(i)}return ws(e.type,Wu(t))}function WY(e){const t=[],n=new Uint8Array(4);sb(n,Object.keys(e.data).length,0),t.push(n);const r=Object.keys(e.data).sort((i,o)=>i.localeCompare(o));for(const i of r){const o=IY(i);t.push(mg(o));const a=Bl(e.data[i]);t.push(a)}return ws(e.type,Wu(t))}function k8(e,t){const n=[],r=t=="ascii"?kY(e.data):fk(e.data),i=new Uint8Array(4);return sb(i,r.length,0),n.push(i),n.push(r),ws(e.type,Wu(n))}function VY(e){return k8(e,"ascii")}function GY(e){return k8(e,"utf8")}function Bl(e){switch(e.type){case pr.BoolTrue:case pr.BoolFalse:return BY(e);case pr.OptionalNone:case pr.OptionalSome:return jY(e);case pr.Buffer:return DY(e);case pr.UInt:return $Y(e);case pr.Int:return JY(e);case pr.PrincipalStandard:return qY(e);case pr.PrincipalContract:return UY(e);case pr.ResponseOk:case pr.ResponseErr:return HY(e);case pr.List:return zY(e);case pr.Tuple:return WY(e);case pr.StringASCII:return VY(e);case pr.StringUTF8:return GY(e);default:throw new x8("Unable to serialize. Invalid Clarity Value.")}}const KY=(e,t)=>e?fk(e).length>t:!1,QY="modulepreload",YY=function(e){return"/lockstacks/"+e},_3={},k3=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=YY(l),l in _3)return;_3[l]=!0;const f=l.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${p}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":QY,f||(m.as="script"),m.crossOrigin="",m.href=l,u&&m.setAttribute("nonce",u),document.head.appendChild(m),f)return new Promise((y,w)=>{m.addEventListener("load",y),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return i.then(a=>{for(const u of a||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})},XY="connect-ui";let D0,R8,Ti=!1,D1=!1;const Du=(e,t="")=>()=>{},ZY=(e,t)=>()=>{},eX="{visibility:hidden}.hydrated{visibility:inherit}",R3={},tX="http://www.w3.org/2000/svg",nX="http://www.w3.org/1999/xhtml",rX=e=>e!=null,pk=e=>(e=typeof e,e==="object"||e==="function");function T8(e){var t,n,r;return(r=(n=(t=e.head)===null||t===void 0?void 0:t.querySelector('meta[name="csp-nonce"]'))===null||n===void 0?void 0:n.getAttribute("content"))!==null&&r!==void 0?r:void 0}const iX=(e,t,...n)=>{let r=null,i=!1,o=!1;const a=[],u=f=>{for(let p=0;pf[p]).join(" "))}const l=J1(e,null);return l.$attrs$=t,a.length>0&&(l.$children$=a),l},J1=(e,t)=>{const n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return n.$attrs$=null,n},oX={},sX=e=>e&&e.$tag$===oX,aX=(e,t)=>e!=null&&!pk(e)&&t&4?e==="false"?!1:e===""||!!e:e,nle=e=>up(e).$hostElement$,cX=(e,t,n)=>{const r=Dr.ce(t,n);return e.dispatchEvent(r),r},T3=new WeakMap,uX=(e,t,n)=>{let r=mw.get(e);NX&&n?(r=r||new CSSStyleSheet,typeof r=="string"?r=t:r.replaceSync(t)):r=t,mw.set(e,r)},lX=(e,t,n,r)=>{var i;let o=O8(t);const a=mw.get(o);if(e=e.nodeType===11?e:ts,a)if(typeof a=="string"){e=e.head||e;let u=T3.get(e),l;if(u||T3.set(e,u=new Set),!u.has(o)){{l=ts.createElement("style"),l.innerHTML=a;const f=(i=Dr.$nonce$)!==null&&i!==void 0?i:T8(ts);f!=null&&l.setAttribute("nonce",f),e.insertBefore(l,e.querySelector("link"))}u&&u.add(o)}}else e.adoptedStyleSheets.includes(a)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,a]);return o},dX=e=>{const t=e.$cmpMeta$,n=e.$hostElement$,r=t.$flags$,i=Du("attachStyles",t.$tagName$),o=lX(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);r&10&&(n["s-sc"]=o,n.classList.add(o+"-h")),i()},O8=(e,t)=>"sc-"+e.$tagName$,O3=(e,t,n,r,i,o)=>{if(n!==r){let a=C3(e,t),u=t.toLowerCase();if(t==="class"){const l=e.classList,f=N3(n),p=N3(r);l.remove(...f.filter(m=>m&&!p.includes(m))),l.add(...p.filter(m=>m&&!f.includes(m)))}else if(!a&&t[0]==="o"&&t[1]==="n")t[2]==="-"?t=t.slice(3):C3(cb,u)?t=u.slice(2):t=u[2]+t.slice(3),n&&Dr.rel(e,t,n,!1),r&&Dr.ael(e,t,r,!1);else{const l=pk(r);if((a||l&&r!==null)&&!i)try{if(e.tagName.includes("-"))e[t]=r;else{const f=r??"";t==="list"?a=!1:(n==null||e[t]!=f)&&(e[t]=f)}}catch{}r==null||r===!1?(r!==!1||e.getAttribute(t)==="")&&e.removeAttribute(t):(!a||o&4||i)&&!l&&(r=r===!0?"":r,e.setAttribute(t,r))}}},fX=/\s/,N3=e=>e?e.split(fX):[],N8=(e,t,n,r)=>{const i=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,o=e&&e.$attrs$||R3,a=t.$attrs$||R3;for(r in o)r in a||O3(i,r,o[r],void 0,n,t.$flags$);for(r in a)O3(i,r,o[r],a[r],n,t.$flags$)},mk=(e,t,n,r)=>{const i=t.$children$[n];let o=0,a,u;if(i.$text$!==null)a=i.$elm$=ts.createTextNode(i.$text$);else{if(Ti||(Ti=i.$tag$==="svg"),a=i.$elm$=ts.createElementNS(Ti?tX:nX,i.$tag$),Ti&&i.$tag$==="foreignObject"&&(Ti=!1),N8(null,i,Ti),rX(D0)&&a["s-si"]!==D0&&a.classList.add(a["s-si"]=D0),i.$children$)for(o=0;o{let a=e,u;for(a.shadowRoot&&a.tagName===R8&&(a=a.shadowRoot);i<=o;++i)r[i]&&(u=mk(null,n,i),u&&(r[i].$elm$=u,a.insertBefore(u,t)))},E8=(e,t,n,r,i)=>{for(;t<=n;++t)(r=e[t])&&(i=r.$elm$,i.remove())},hX=(e,t,n,r)=>{let i=0,o=0,a=t.length-1,u=t[0],l=t[a],f=r.length-1,p=r[0],m=r[f],y;for(;i<=a&&o<=f;)u==null?u=t[++i]:l==null?l=t[--a]:p==null?p=r[++o]:m==null?m=r[--f]:_0(u,p)?(qm(u,p),u=t[++i],p=r[++o]):_0(l,m)?(qm(l,m),l=t[--a],m=r[--f]):_0(u,m)?(qm(u,m),e.insertBefore(u.$elm$,l.$elm$.nextSibling),u=t[++i],m=r[--f]):_0(l,p)?(qm(l,p),e.insertBefore(l.$elm$,u.$elm$),l=t[--a],p=r[++o]):(y=mk(t&&t[o],n,o),p=r[++o],y&&u.$elm$.parentNode.insertBefore(y,u.$elm$));i>a?C8(e,r[f+1]==null?null:r[f+1].$elm$,n,r,o,f):o>f&&E8(t,i,a)},_0=(e,t)=>e.$tag$===t.$tag$,qm=(e,t)=>{const n=t.$elm$=e.$elm$,r=e.$children$,i=t.$children$,o=t.$tag$,a=t.$text$;a===null?(Ti=o==="svg"?!0:o==="foreignObject"?!1:Ti,N8(e,t,Ti),r!==null&&i!==null?hX(n,r,t,i):i!==null?(e.$text$!==null&&(n.textContent=""),C8(n,null,t,i,0,i.length-1)):r!==null&&E8(r,0,r.length-1),Ti&&o==="svg"&&(Ti=!1)):e.$text$!==a&&(n.data=a)},pX=(e,t)=>{const n=e.$hostElement$,r=e.$vnode$||J1(null,null),i=sX(t)?t:iX(null,null,t);R8=n.tagName,i.$tag$=null,i.$flags$|=4,e.$vnode$=i,i.$elm$=r.$elm$=n.shadowRoot||n,D0=n["s-sc"],qm(r,i)},A8=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise(n=>e.$onRenderResolve$=n))},gk=(e,t)=>{if(e.$flags$|=16,e.$flags$&4){e.$flags$|=512;return}return A8(e,e.$ancestorComponent$),EX(()=>mX(e,t))},mX=(e,t)=>{const n=Du("scheduleUpdate",e.$cmpMeta$.$tagName$),r=e.$lazyInstance$;let i;return n(),bX(i,()=>gX(e,r,t))},gX=async(e,t,n)=>{const r=e.$hostElement$,i=Du("update",e.$cmpMeta$.$tagName$),o=r["s-rc"];n&&dX(e);const a=Du("render",e.$cmpMeta$.$tagName$);yX(e,t),o&&(o.map(u=>u()),r["s-rc"]=void 0),a(),i();{const u=r["s-p"],l=()=>wX(e);u.length===0?l():(Promise.all(u).then(l),e.$flags$|=4,u.length=0)}},yX=(e,t,n)=>{try{t=t.render(),e.$flags$&=-17,e.$flags$|=2,pX(e,t)}catch(r){gg(r,e.$hostElement$)}return null},wX=e=>{const t=e.$cmpMeta$.$tagName$,n=e.$hostElement$,r=Du("postUpdate",t),i=e.$ancestorComponent$;e.$flags$&64?r():(e.$flags$|=64,I8(n),r(),e.$onReadyResolve$(n),i||F8()),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),e.$flags$&512&&wk(()=>gk(e,!1)),e.$flags$&=-517},F8=e=>{I8(ts.documentElement),wk(()=>cX(cb,"appload",{detail:{namespace:XY}}))},bX=(e,t)=>t(),I8=e=>e.classList.add("hydrated"),SX=(e,t)=>up(e).$instanceValues$.get(t),vX=(e,t,n,r)=>{const i=up(e),o=i.$instanceValues$.get(t),a=i.$flags$,u=i.$lazyInstance$;n=aX(n,r.$members$[t][0]);const l=Number.isNaN(o)&&Number.isNaN(n),f=n!==o&&!l;(!(a&8)||o===void 0)&&f&&(i.$instanceValues$.set(t,n),u&&(a&18)===2&&gk(i,!1))},P8=(e,t,n)=>{if(t.$members$){const r=Object.entries(t.$members$),i=e.prototype;if(r.map(([o,[a]])=>{(a&31||n&2&&a&32)&&Object.defineProperty(i,o,{get(){return SX(this,o)},set(u){vX(this,o,u,t)},configurable:!0,enumerable:!0})}),n&1){const o=new Map;i.attributeChangedCallback=function(a,u,l){Dr.jmp(()=>{const f=o.get(a);if(this.hasOwnProperty(f))l=this[f],delete this[f];else if(i.hasOwnProperty(f)&&typeof this[f]=="number"&&this[f]==l)return;this[f]=l===null&&typeof this[f]=="boolean"?!1:l})},e.observedAttributes=r.filter(([a,u])=>u[0]&15).map(([a,u])=>{const l=u[1]||a;return o.set(l,a),l})}}return e},xX=async(e,t,n,r,i)=>{if(!(t.$flags$&32)){{if(t.$flags$|=32,i=OX(n),i.then){const l=ZY();i=await i,l()}i.isProxied||(P8(i,n,2),i.isProxied=!0);const u=Du("createInstance",n.$tagName$);t.$flags$|=8;try{new i(t)}catch(l){gg(l)}t.$flags$&=-9,u()}if(i.style){let u=i.style;const l=O8(n);if(!mw.has(l)){const f=Du("registerStyles",n.$tagName$);uX(l,u,!!(n.$flags$&1)),f()}}}const o=t.$ancestorComponent$,a=()=>gk(t,!0);o&&o["s-rc"]?o["s-rc"].push(a):a()},_X=e=>{if(!(Dr.$flags$&1)){const t=up(e),n=t.$cmpMeta$,r=Du("connectedCallback",n.$tagName$);if(!(t.$flags$&1)){t.$flags$|=1;{let i=e;for(;i=i.parentNode||i.host;)if(i["s-p"]){A8(t,t.$ancestorComponent$=i);break}}n.$members$&&Object.entries(n.$members$).map(([i,[o]])=>{if(o&31&&e.hasOwnProperty(i)){const a=e[i];delete e[i],e[i]=a}}),xX(e,t,n)}r()}},kX=e=>{Dr.$flags$&1||up(e)},RX=(e,t={})=>{var n;const r=Du(),i=[],o=t.exclude||[],a=cb.customElements,u=ts.head,l=u.querySelector("meta[charset]"),f=ts.createElement("style"),p=[];let m,y=!0;Object.assign(Dr,t),Dr.$resourcesUrl$=new URL(t.resourcesUrl||"./",ts.baseURI).href,e.map(w=>{w[1].map(b=>{const x={$flags$:b[0],$tagName$:b[1],$members$:b[2],$listeners$:b[3]};x.$members$=b[2];const k=x.$tagName$,O=class extends HTMLElement{constructor(N){super(N),N=this,TX(N,x),x.$flags$&1&&N.attachShadow({mode:"open"})}connectedCallback(){m&&(clearTimeout(m),m=null),y?p.push(this):Dr.jmp(()=>_X(this))}disconnectedCallback(){Dr.jmp(()=>kX(this))}componentOnReady(){return up(this).$onReadyPromise$}};x.$lazyBundleId$=w[0],!o.includes(k)&&!a.get(k)&&(i.push(k),a.define(k,P8(O,x,1)))})});{f.innerHTML=i+eX,f.setAttribute("data-styles","");const w=(n=Dr.$nonce$)!==null&&n!==void 0?n:T8(ts);w!=null&&f.setAttribute("nonce",w),u.insertBefore(f,l?l.nextSibling:u.firstChild)}y=!1,p.length?p.map(w=>w.connectedCallback()):Dr.jmp(()=>m=setTimeout(F8,30)),r()},yk=new WeakMap,up=e=>yk.get(e),rle=(e,t)=>yk.set(t.$lazyInstance$=e,t),TX=(e,t)=>{const n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return n.$onReadyPromise$=new Promise(r=>n.$onReadyResolve$=r),e["s-p"]=[],e["s-rc"]=[],yk.set(e,n)},C3=(e,t)=>t in e,gg=(e,t)=>(0,console.error)(e,t),vx=new Map,OX=(e,t,n)=>{const r=e.$tagName$.replace(/-/g,"_"),i=e.$lazyBundleId$,o=vx.get(i);if(o)return o[r];{const a=u=>(vx.set(i,u),u[r]);switch(i){case"connect-modal":return k3(()=>import("./connect-modal.entry-CtT8IFxW.js"),[]).then(a,gg)}}return k3(()=>import(`./${i}.entry.js`),[]).then(a=>(vx.set(i,a),a[r]),gg)},mw=new Map,cb=typeof window<"u"?window:{},ts=cb.document||{head:{}},Dr={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,r)=>e.addEventListener(t,n,r),rel:(e,t,n,r)=>e.removeEventListener(t,n,r),ce:(e,t)=>new CustomEvent(e,t)},M8=e=>Promise.resolve(e),NX=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),E3=[],L8=[],CX=(e,t)=>n=>{e.push(n),D1||(D1=!0,Dr.$flags$&4?wk($1):Dr.raf($1))},A3=e=>{for(let t=0;t{A3(E3),A3(L8),(D1=E3.length>0)&&Dr.raf($1)},wk=e=>M8().then(e),EX=CX(L8),AX=()=>M8(),FX=(e,t)=>typeof window>"u"?Promise.resolve():AX().then(()=>RX([["connect-modal",[[1,"connect-modal",{defaultProviders:[16],installedProviders:[16],persistSelection:[4,"persist-selection"],callback:[16],cancelCallback:[16]}]]]],t));(function(){if(typeof window<"u"&&window.Reflect!==void 0&&window.customElements!==void 0){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}})();var IX=Object.defineProperty,PX=Object.defineProperties,MX=Object.getOwnPropertyDescriptors,gw=Object.getOwnPropertySymbols,B8=Object.prototype.hasOwnProperty,j8=Object.prototype.propertyIsEnumerable,F3=(e,t,n)=>t in e?IX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ar=(e,t)=>{for(var n in t||(t={}))B8.call(t,n)&&F3(e,n,t[n]);if(gw)for(var n of gw(t))j8.call(t,n)&&F3(e,n,t[n]);return e},ao=(e,t)=>PX(e,MX(t)),D8=(e,t)=>{var n={};for(var r in e)B8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gw)for(var r of gw(e))t.indexOf(r)<0&&j8.call(e,r)&&(n[r]=e[r]);return n};function ub(){return y8(w8())||window.StacksProvider||window.BlockstackProvider}function Lg(e){return e?typeof e=="string"?mf.fromName(e):"version"in e?e:"url"in e?new I1({url:e.url}):e.transactionVersion===Ni.Mainnet?new I1({url:e.client.baseUrl}):new P1({url:e.client.baseUrl}):new P1}typeof window<"u"&&(window.__CONNECT_VERSION__="__VERSION__");var LX=e=>{if(!e){let t=new rb(["store_write"],document.location.href);e=new hg({appConfig:t})}return e},BX=async(e,t=ub())=>{if(!t)throw new Error("[Connect] No installed Stacks wallet found");let{redirectTo:n="/",manifestPath:r,onFinish:i,onCancel:o,sendToSignIn:a=!1,userSession:u,appDetails:l}=e,f=LX(u);f.isUserSignedIn()&&f.signUserOut();let p=f.generateAndStoreTransitKey(),m=f.makeAuthRequest(p,`${document.location.origin}${n}`,`${document.location.origin}${r}`,f.appConfig.scopes,void 0,void 0,{sendToSignIn:a,appDetails:l,connectVersion:"__VERSION__"});try{let y=await t.authenticationRequest(m);await f.handlePendingSignIn(y);let w=Er.decodeToken(y),b=w==null?void 0:w.payload;i==null||i({authResponse:y,authResponsePayload:b,userSession:f})}catch(y){console.error("[Connect] Error during auth request",y),o==null||o()}},jX=(e=>(e.ContractCall="contract_call",e.ContractDeploy="smart_contract",e.STXTransfer="token_transfer",e))(jX||{}),DX=(e=>(e.BUFFER="buffer",e.UINT="uint",e.INT="int",e.PRINCIPAL="principal",e.BOOL="bool",e))(DX||{}),lb=e=>{let t=e;if(!t){let n=new rb(["store_write"],document.location.href);t=new hg({appConfig:n})}return t};function J8(e){try{return lb(e).loadUserData().appPrivateKey}catch{return!1}}var $8=e=>{let t=lb(e).loadUserData().appPrivateKey,n=Er.SECP256K1Client.derivePublicKey(t);return{privateKey:t,publicKey:n}};function JX(e){var t;let{stxAddress:n,userSession:r,network:i}=e;if(n)return n;if(!r||!i)return;let o=(t=r==null?void 0:r.loadUserData().profile)==null?void 0:t.stxAddress,a={[dn.Mainnet]:"mainnet",[dn.Testnet]:"testnet"},u=Lg(i);return o==null?void 0:o[a[u.chainId]]}function $X(e){let t=Lg(e.network),n=lb(e.userSession),r=ao(Ar({},e),{network:t,userSession:n});return Ar({stxAddress:JX(r)},r)}async function qX(e,t){let{postConditions:n}=e;return n&&n.length>0&&typeof n[0]!="string"&&(typeof n[0].type=="string"?n=n.map(UM):n=n.map(r=>at(_8(r)))),new Er.TokenSigner("ES256k",t).signAsync(ao(Ar({},e),{postConditions:n}))}function UX(e){let{postConditions:t}=e;return t&&t.length>0&&typeof t[0]!="string"&&(typeof t[0].type=="string"?t=t.map(UM):t=t.map(n=>at(_8(n)))),Er.createUnsecuredToken(ao(Ar({},e),{postConditions:t}))}var HX=async({token:e,options:t},n)=>{var r,i,o;try{let a=await n.transactionRequest(e),{txRaw:u}=a,l=rt(u.replace(/^0x/,"")),f=kK(l);if("sponsored"in t&&t.sponsored){(r=t.onFinish)==null||r.call(t,ao(Ar({},a),{stacksTransaction:f}));return}(i=t.onFinish)==null||i.call(t,ao(Ar({},a),{stacksTransaction:f}))}catch(a){console.error("[Connect] Error during transaction request",a),(o=t.onCancel)==null||o.call(t)}},zX=async e=>{let t=e,{functionArgs:n,appDetails:r,userSession:i}=t,o=D8(t,["functionArgs","appDetails","userSession"]),a=n.map(l=>typeof l=="string"?l:typeof l.type=="string"?lw(l):at(Bl(l)));if(J8(i)){let{privateKey:l,publicKey:f}=$8(i),p=ao(Ar({},o),{functionArgs:a,txType:"contract_call",publicKey:f});return r&&(p.appDetails=r),qX(p,l)}let u=ao(Ar({},o),{functionArgs:a,txType:"contract_call"});return r&&(u.appDetails=r),UX(u)};async function WX(e,t,n){let r=await t(ao(Ar(Ar({},$X(e)),e),{network:Lg(e.network)}));return HX({token:r,options:e},n)}function bk(e,t=ub()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return WX(e,zX,t)}function VX(e){var t;let{userSession:n,network:r}=e;if(!n||!r)return;let i=(t=n==null?void 0:n.loadUserData().profile)==null?void 0:t.stxAddress,o={[dn.Mainnet]:"mainnet",[dn.Testnet]:"testnet"},a=Lg(r);return i==null?void 0:i[o[a.chainId]]}function GX(e){let t=Lg(e.network),n=lb(e.userSession),r=ao(Ar({},e),{network:t,userSession:n});return Ar({stxAddress:VX(r)},r)}async function KX(e,t,n){let r=await t(Ar(Ar({},GX(e)),e));return XX({token:r,options:e},n)}function q8(e){let{message:t,domain:n}=e;return typeof t.type=="string"&&typeof n.type=="string"?ao(Ar({},e),{message:lw(t),domain:lw(n)}):ao(Ar({},e),{message:at(Bl(t)),domain:at(Bl(n))})}async function QX(e,t){return new Er.TokenSigner("ES256k",t).signAsync(q8(e))}async function YX(e){let t=e,{userSession:n}=t,r=D8(t,["userSession"]);if(J8(n)){let{privateKey:i,publicKey:o}=$8(n),a=ao(Ar({},r),{publicKey:o});return QX(a,i)}return Er.createUnsecuredToken(q8(e))}async function XX({token:e,options:t},n){var r,i;try{let o=await n.structuredDataSignatureRequest(e);(r=t.onFinish)==null||r.call(t,o)}catch(o){console.error("[Connect] Error during signature request",o),(i=t.onCancel)==null||i.call(t)}}function ZX(e,t=ub()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return KX(e,YX,t)}var eZ=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.ALL=1]="ALL",e[e.NONE=2]="NONE",e[e.SINGLE=3]="SINGLE",e[e.ANYONECANPAY=128]="ANYONECANPAY",e))(eZ||{}),tZ=[{id:"LeatherProvider",name:"Leather",icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiByeD0iMjYuODM4NyIgZmlsbD0iIzEyMTAwRiIvPgo8cGF0aCBkPSJNNzQuOTE3MSA1Mi43MTE0QzgyLjQ3NjYgNTEuNTQwOCA5My40MDg3IDQzLjU4MDQgOTMuNDA4NyAzNy4zNzYxQzkzLjQwODcgMzUuNTAzMSA5MS44OTY4IDM0LjIxNTQgODkuNjg3MSAzNC4yMTU0Qzg1LjUwMDQgMzQuMjE1NCA3OC40MDYxIDQwLjUzNjggNzQuOTE3MSA1Mi43MTE0Wk0zOS45MTEgODMuNDk5MUMzMC4wMjU2IDgzLjQ5OTEgMjkuMjExNSA5My4zMzI0IDM5LjA5NjkgOTMuMzMyNEM0My41MTYzIDkzLjMzMjQgNDguODY2MSA5MS41NzY0IDUxLjY1NzMgODguNDE1N0M0Ny41ODY4IDg0LjkwMzggNDQuMjE0MSA4My40OTkxIDM5LjkxMSA4My40OTkxWk0xMDIuODI5IDc5LjI4NDhDMTAzLjQxIDk1Ljc5MDcgOTUuMDM2OSAxMDUuMDM5IDgwLjg0ODQgMTA1LjAzOUM3Mi40NzQ4IDEwNS4wMzkgNjguMjg4MSAxMDEuODc4IDU5LjMzMyA5Ni4wMjQ5QzU0LjY4MSAxMDEuMTc2IDQ1Ljg0MjMgMTA1LjAzOSAzOC41MTU0IDEwNS4wMzlDMTMuMjc4NSAxMDUuMDM5IDE0LjMyNTIgNzIuODQ2MyA0MC4wMjczIDcyLjg0NjNDNDUuMzc3MSA3Mi44NDYzIDQ5LjkxMjggNzQuMjUxMSA1NS43Mjc3IDc3Ljg4TDU5LjU2NTYgNjQuNDE3N0M0My43NDg5IDYwLjA4NjQgMzUuODQwNSA0Ny45MTE4IDQzLjYzMjYgMzAuNDY5M0g1Ni4xOTI5QzQ5LjIxNSA0Mi4wNTg2IDUzLjk4MzIgNTEuNjU3OCA2Mi44MjIgNTIuNzExNEM2Ny41OTAzIDM1LjczNzIgNzcuODI0NiAyMi41MDkgOTEuNDMxNiAyMi41MDlDOTkuMTA3NCAyMi41MDkgMTA1LjE1NSAyNy41NDI4IDEwNS4xNTUgMzYuNjczN0MxMDUuMTU1IDUxLjMwNjYgODYuMDgxOSA2My4yNDcxIDcxLjY2MDcgNjQuNDE3N0w2NS43Mjk1IDg1LjM3MjFDNzIuNDc0OCA5My4yMTUzIDkxLjE5OSAxMDAuODI0IDkxLjE5OSA3OS4yODQ4SDEwMi44MjlaIiBmaWxsPSIjRjVGMUVEIi8+Cjwvc3ZnPgo=",webUrl:"https://leather.io",chromeWebStoreUrl:"https://chrome.google.com/webstore/detail/hiro-wallet/ldinpeekobnhjjdofggfgjlcehhmanlj",mozillaAddOnsUrl:"https://leather.io/install-extension"},{id:"XverseProviders.StacksProvider",name:"Xverse Wallet",icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MDAiIGhlaWdodD0iNjAwIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGZpbGw9IiMxNzE3MTciIGQ9Ik0wIDBoNjAwdjYwMEgweiIvPjxwYXRoIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTQ0MCA0MzUuNHYtNTFjMC0yLS44LTMuOS0yLjItNS4zTDIyMCAxNjIuMmE3LjYgNy42IDAgMCAwLTUuNC0yLjJoLTUxLjFjLTIuNSAwLTQuNiAyLTQuNiA0LjZ2NDcuM2MwIDIgLjggNCAyLjIgNS40bDc4LjIgNzcuOGE0LjYgNC42IDAgMCAxIDAgNi41bC03OSA3OC43Yy0xIC45LTEuNCAyLTEuNCAzLjJ2NTJjMCAyLjQgMiA0LjUgNC42IDQuNUgyNDljMi42IDAgNC42LTIgNC42LTQuNlY0MDVjMC0xLjIuNS0yLjQgMS40LTMuM2w0Mi40LTQyLjJhNC42IDQuNiAwIDAgMSA2LjQgMGw3OC43IDc4LjRhNy42IDcuNiAwIDAgMCA1LjQgMi4yaDQ3LjVjMi41IDAgNC42LTIgNC42LTQuNloiLz48cGF0aCBmaWxsPSIjRUU3QTMwIiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0zMjUuNiAyMjcuMmg0Mi44YzIuNiAwIDQuNiAyLjEgNC42IDQuNnY0Mi42YzAgNCA1IDYuMSA4IDMuMmw1OC43LTU4LjVjLjgtLjggMS4zLTIgMS4zLTMuMnYtNTEuMmMwLTIuNi0yLTQuNi00LjYtNC42TDM4NCAxNjBjLTEuMiAwLTIuNC41LTMuMyAxLjNsLTU4LjQgNTguMWE0LjYgNC42IDAgMCAwIDMuMiA3LjhaIi8+PC9nPjwvc3ZnPg==",webUrl:"https://xverse.app",chromeWebStoreUrl:"https://chrome.google.com/webstore/detail/xverse-wallet/idnnbdplmphpflfnlkomgpfbpcgelopg",googlePlayStoreUrl:"https://play.google.com/store/apps/details?id=com.secretkeylabs.xverse",iOSAppStoreUrl:"https://apps.apple.com/app/xverse-bitcoin-web3-wallet/id1552272513",mozillaAddOnsUrl:"https://www.xverse.app/download"},{id:"AsignaProvider",name:"Asigna",icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMDEwMCIgZD0iTTAgMGgzMnYzMkgweiIvPjxwYXRoIGZpbGw9InVybCgjYSkiIGQ9Ik0xNS4xMSA1LjU1YTMgMyAwIDAgMC0xLjgyIDEuM2wtLjA1LjA4LS40My43Mi0uMDcuMTEtLjUuODUtLjA1LjA5LTEuMjkgMi4xOC0uMDQuMDctLjQ3LjgtLjA2LjEtLjQ2Ljc4LS4wNy4xMS0xLjYzIDIuNzYtLjA3LjExLS4zOC42Ni0uMDUuMDgtLjczIDEuMjQtLjM1LjYtLjQuNjctLjA1LjA5TDUuMSAyMC43bC0uMTEuMTgtLjE0LjIzLS4wNy4xMy0uMzMuNTUtLjA0LjA3di4wMWExLjI2IDEuMjYgMCAwIDAtLjE0LjQ3IDEuMzEgMS4zMSAwIDAgMCAxLjI0IDEuNGgxLjVsLjA1LS4wNi4wNC0uMDYuODctMS4yMS4wNS0uMDguNzctMS4wNy4wNS0uMDcuNC0uNTcuMDUtLjA2LjI0LS4zNGExLjUyIDEuNTIgMCAwIDEgMS4zOS0uNjIgMS41IDEuNSAwIDAgMSAuNjQuMiAxLjQ3IDEuNDcgMCAwIDEgLjczIDEuMjcgMS40NCAxLjQ0IDAgMCAxLS4yNy44NGwtLjYzLjg4LS4wNS4wNy0uMzIuNDUtLjA2LjA4LS4wOC4xMi0uMTIuMTYtLjA1LjA4aDIuMTNhMi4zMiAyLjMyIDAgMCAwIDEuNzctLjk2bDEuMTgtMS42My43Ny0xLjA4IDEuMy0xLjhhMS4yNCAxLjI0IDAgMCAxIC41NS0uNDNsLjA4LS4wM2ExLjMgMS4zIDAgMCAxIC4zLS4wNiAxLjI4IDEuMjggMCAwIDEgMS4xNS41NGwuMTEuMmExLjEzIDEuMTMgMCAwIDEgLjEuNDEgMS4xOSAxLjE5IDAgMCAxLS4yMy43N2wtLjAzLjA1LS41Ny44LS43Ljk4LS4yNy4zN2ExLjIyIDEuMjIgMCAwIDAtLjIuNSAxLjA1IDEuMDUgMCAwIDAtLjAyLjIzdi4wNmExLjE3IDEuMTcgMCAwIDAgLjE0LjQzbC4wMi4wNS4wNy4xYTEuNDQgMS40NCAwIDAgMCAuMS4xMWwuMDUuMDYuMDEuMDFhMS44IDEuOCAwIDAgMCAuMTQuMWMwIC4wMi4wMi4wMy4wNC4wM2ExIDEgMCAwIDAgLjA4LjA1bC4wNy4wNGExLjI1IDEuMjUgMCAwIDAgLjUuMWg2LjljLjEgMCAuMi0uMDEuMjktLjAzbC4wNi0uMDJhMS4yNyAxLjI3IDAgMCAwIC4yNy0uMS41Ny41NyAwIDAgMCAuMDctLjAzIDEuMjEgMS4yMSAwIDAgMCAuMjYtLjE5bC4wOC0uMDdhLjkyLjkyIDAgMCAwIC4xNS0uMTkgMS41NSAxLjU1IDAgMCAwIC4wOS0uMTdsLjAyLS4wNWExLjIyIDEuMjIgMCAwIDAgLjA4LS4yNnYtLjA0bC4wMi0uMDh2LS4wOGExLjMyIDEuMzIgMCAwIDAtLjItLjc0bC0xLjYtMi42NC0uMDYtLjEtLjItLjMyLS4zMy0uNTR2LS4wMWwtLjA1LS4wOC0xLjMtMi4xNS0uMDctLjEtLjA0LS4wNi0uOC0xLjMyLS4wNC0uMDctLjItLjM0LS4xLS4xNC0uMS0uMTYtLjUzLS45LS4xMy0uMi0uMDktLjE0LTIuMTctMy41Ny0uMDQtLjA3LS43Mi0xLjE5LS4wNS0uMDctLjQtLjY1YTIuNjUgMi42NSAwIDAgMC0uMy0uNCAyLjk2IDIuOTYgMCAwIDAtLjk3LS43NCAzLjA0IDMuMDQgMCAwIDAtMS4zLS4zYy0uMjUgMC0uNS4wNC0uNzQuMVoiLz48cGF0aCBmaWxsPSJ1cmwoI2IpIiBkPSJNMTkgMTYuM2E1LjQ1IDUuNDUgMCAwIDAtLjgzIDEuNTZsLS4wNC4xNWExLjM2IDEuMzYgMCAwIDEgLjI4LS4xNiAxLjI0IDEuMjQgMCAwIDEgLjM4LS4wOGguMWExLjI4IDEuMjggMCAwIDEgMS4wNS41NGMuMDQuMDYuMDguMTMuMS4yYTEuMjQgMS4yNCAwIDAgMSAuMDkuMjcgMS4xOSAxLjE5IDAgMCAxLS4yLjkxbC0uMDQuMDUtLjU3Ljc5LS43Ljk5LS4yNy4zN2ExLjIzIDEuMjMgMCAwIDAtLjIuNDIgMS4wNiAxLjA2IDAgMCAwLS4wMi4zMXYuMDZhMS4xNyAxLjE3IDAgMCAwIC4xNi40Ny45My45MyAwIDAgMCAuMDcuMSAxLjUgMS41IDAgMCAwIC4xLjEybC4wNS4wNmguMDFhMS45NCAxLjk0IDAgMCAwIC4wOS4wOCAxIDEgMCAwIDAgLjE3LjFsLjA3LjA0YTEuMjUgMS4yNSAwIDAgMCAuNS4xaDYuOWMuMSAwIC4yIDAgLjI4LS4wMmwuMDctLjAyYTEuMzIgMS4zMiAwIDAgMCAuMzQtLjEzbC4xNi0uMS4wMy0uMDNhMS4yOSAxLjI5IDAgMCAwIC4yLS4yIDIuNDMgMi40MyAwIDAgMCAuMTItLjE3Yy4wMy0uMDMuMDUtLjA4LjA3LS4xMmwuMDItLjA1YTEuMjEgMS4yMSAwIDAgMCAuMDktLjN2LS4wOGwuMDEtLjA5YTEuMzIgMS4zMiAwIDAgMC0uMi0uNzNsLTEuNi0yLjY0LS4wNi0uMS0uMi0uMzItLjMzLS41NHYtLjAybC0uMDUtLjA3LTEuMy0yLjE1LS4xMi0uMDctLjA3LS4wNGE0Ljk0IDQuOTQgMCAwIDAtMi40Ni0uNjdjLTEuMDMgMC0xLjc2LjU3LTIuMjYgMS4yWiIvPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xMi4yOSAyMS4wOGMwIC4yOS0uMDkuNTgtLjI3Ljg0bC0xLjMxIDEuODRIN2wyLjUyLTMuNTNhMS41NCAxLjU0IDAgMCAxIDIuMS0uMzZjLjQzLjI4LjY2Ljc0LjY2IDEuMloiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTEuMTYgMjEuMjVhLjU2LjU2IDAgMCAxLS41Ny41NS41Ni41NiAwIDAgMS0uNTctLjU2LjU2LjU2IDAgMCAxIC41Ny0uNTUuNTYuNTYgMCAwIDEgLjU3LjU2WiIvPjxkZWZzPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9IjE1LjIzIiB4Mj0iMTkuMyIgeTE9IjI1Ljc4IiB5Mj0iNi4xMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiM2NTIyRjQiLz48c3RvcCBvZmZzZXQ9Ii41NSIgc3RvcC1jb2xvcj0iIzlCNkJGRiIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0E1ODVGRiIvPjwvbGluZWFyR3JhZGllbnQ+PGxpbmVhckdyYWRpZW50IGlkPSJiIiB4MT0iMjIuNTkiIHgyPSIyNC44IiB5MT0iMjQuNzEiIHkyPSIxNS41MyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiM0MjFGOEIiLz48c3RvcCBvZmZzZXQ9Ii41NSIgc3RvcC1jb2xvcj0iIzcyMzBGRiIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzk3NzNGRiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjwvc3ZnPg==",webUrl:"https://asigna.io",chromeWebStoreUrl:"https://chromewebstore.google.com/detail/asigna-multisig/gopddoinbenlokghakiafackadkbnlid"}];function U8(e,t=!0){return function(n,r){var i;if(r)return e(n,r);let o=w8(),a=ub();if(o&&a)return e(n,a);if(typeof window>"u")return;FX();let u=(i=n==null?void 0:n.defaultProviders)!=null?i:tZ,l=hY(u),f=document.createElement("connect-modal");f.defaultProviders=u,f.installedProviders=l,f.persistSelection=t;let p=document.body.style.overflow;document.body.style.overflow="hidden";let m=()=>{f.remove(),document.body.style.overflow=p};f.callback=w=>{m(),e(n,w)},f.cancelCallback=()=>{var w;m(),(w=n.onCancel)==null||w.call(n)},document.body.appendChild(f);let y=w=>{w.key==="Escape"&&(document.removeEventListener("keydown",y),f.remove())};document.addEventListener("keydown",y)}}var nZ=U8(BX,!1),Do=U8(bk),rZ=pY;const iZ=new rb(["store_write"]),k0=new hg({appConfig:iZ});function oZ(e,t){var o,a,u,l,f,p,m,y;const n=(a=(o=e==null?void 0:e.profile)==null?void 0:o.stxAddress)==null?void 0:a[t],r=(f=(l=(u=e==null?void 0:e.profile)==null?void 0:u.btcAddress)==null?void 0:l.p2tr)==null?void 0:f[t],i=(y=(m=(p=e==null?void 0:e.profile)==null?void 0:p.btcAddress)==null?void 0:m.p2wpkh)==null?void 0:y[t];return vf(n)?{address:n,btcAddressP2tr:r,btcAddressP2wpkh:i}:{address:null,btcAddressP2tr:null,btcAddressP2wpkh:null}}const H8=$.createContext(null);function sZ({children:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(!1),[o,a]=$.useState(!1),{networkName:u}=Pt();function l(){if(t){console.warn("Attempted to sign in while sign is is in progress.");return}n(!0),nZ({userSession:k0,appDetails:tW,onFinish(){n(!1),i(!0)},onCancel(){n(!1)}})}function f(){k0.signUserOut(),rZ(),i(!1)}if(!o)return k0.isUserSignedIn()&&i(!0),a(!0),null;let p=null;try{p=k0.loadUserData()}catch{}const{address:m,btcAddressP2tr:y,btcAddressP2wpkh:w}=oZ(p,u);return d.jsx(d.Fragment,{children:d.jsx(H8.Provider,{value:{isSigningIn:t,isSignedIn:r,signIn:l,signOut:f,userData:p,address:m,btcAddressP2tr:y,btcAddressP2wpkh:w},children:e})})}function Mn(){return $.useContext(H8)}const z8=$.createContext({client:null});function aZ({children:e}){const{address:t}=Mn(),{network:n}=Pt();console.log("network",n);let r=null;return t!==null&&vf(t)&&(r=new xf({address:t,network:n})),d.jsx(d.Fragment,{children:d.jsx(z8.Provider,{value:{client:r},children:e})})}function kn(){return $.useContext(z8)}function cZ(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getCycleDuration",e],()=>e.getCycleDuration())}function uZ(e){if(!e)throw new Error("Expected client to be defined.");return yr(["getStatus",e],()=>e.getStatus())}function Bg(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getStatus",e],()=>e.getStatus())}function Sk(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getPoxOperationInfo",e],()=>e.getPoxOperationInfo())}function lZ(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getAccountBalance",e],()=>e.getAccountBalance())}function vk(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getAccountBalanceLocked",e],()=>e.getAccountBalanceLocked())}function db(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getCoreInfo",e],()=>e.getCoreInfo())}function ci(){const{client:e}=kn();return fb(e)}function fb(e){if(!e)throw new Error("Expected client to be defined.");return yr(["getAccountExtendedBalances",e],()=>e.getAccountExtendedBalances())}function Vu(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getSecondsUntilNextCycle",e],()=>e.getSecondsUntilNextCycle(),{refetchInterval:6e4})}function rn(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getPoxInfo",e],()=>e.getPoxInfo())}function xx(e){const{address:t}=Mn(),{network:n}=Pt(),r=ju(n)[wt.Pox4];return yr(["getAllowanceContractCallers",t,e,n],()=>{if(t){const[i,o]=r.split(".");return hh({contractAddress:i,contractName:o,functionName:"get-allowance-contract-callers",functionArgs:[no(t),no(e)],senderAddress:t,network:n})}else return Promise.resolve(Rr())})}const dZ="/lockstacks/assets/Inter-Medium-3YuqF_3A.woff2",fZ="/lockstacks/assets/Inter-Regular-7RwU4e5T.woff2",hZ="/lockstacks/assets/Inter-SemiBold-B3N5F7BF.woff2",pZ="/lockstacks/assets/opensaucesans-medium-webfont-B8qePigW.woff2",mZ="/lockstacks/assets/opensaucesans-regular-webfont-C8fdHkyR.woff2";function Am(e){return`url(${e})`}async function gZ(){const e=new FontFace("Inter",Am(fZ),{weight:"400"}),t=new FontFace("Inter",Am(dZ),{weight:"500"}),n=new FontFace("Inter",Am(hZ),{weight:"600"}),r=new FontFace("Open Sauce",Am(mZ),{weight:"400"}),i=new FontFace("Open Sauce",Am(pZ),{weight:"500"});await Promise.all([e.load(),t.load(),n.load(),r.load(),i.load()]),document.fonts.add(e),document.fonts.add(t),document.fonts.add(n),document.fonts.add(r),document.fonts.add(i)}function yZ(){const{isSignedIn:e}=Mn();return e?d.jsx(d.Fragment,{children:d.jsx(s_,{})}):d.jsx(Kw,{to:"../sign-in"})}const Ue={white:"#ffffff",black:"#ococod",blue050:"#f7f8fd",blue100:"#eef2fb",blue200:"#e5ebfa",blue300:"#cedafa",blue400:"#7f97f1",blue500:"#5c6cf2",blue600:"#5546ff",blue700:"#2323c7",blue800:"#ofofa9",blue900:"#oboa63",green100:"#f2f9f1",green300:"#d9edd4",green500:"#23a978",green600:"#008051",gray050:"#fafafa",gray100:"#f5f5f5",gray200:"#efefef",gray300:"#dddddd",gray400:"#9a9a9a",gray500:"#777777",gray600:"#666666",gray700:"#333333",gray800:"#262626",gray900:"#171717",orange100:"#fff5eb",orange300:"#ffe0c2",orange500:"#ffbd7a",orange600:"#f59300",red100:"#fceeed",red300:"#f7cdca",red500:"#e76c6a",red600:"#c83532",slate050:"#f9f9fa",slate100:"#f5f5f7",slate200:"#efeff2",slate300:"#dcdde2",slate400:"#989ca3",slate500:"#74777D",slate600:"#62676e",slate700:"#303236",slate800:"#242629",slate900:"#151619"},sf={background:Ue.white,backgroundSubdued:Ue.slate100,surface:Ue.white,surfaceHovered:Ue.slate050,surfacePressed:Ue.slate200,surfacedisabled:Ue.slate100,surfaceSelected:Ue.blue050,surfaceSubdued:Ue.slate100,surfaceContrast:Ue.black,overlay:`${Ue.black}80`,border:Ue.slate300,borderSubdued:Ue.slate200,borderDisabled:Ue.slate200,borderFocused:Ue.blue300,icon:Ue.slate800,iconSubdued:Ue.slate500,iconDisabled:Ue.slate400,iconOnPrimary:Ue.white,iconOnCritical:Ue.white,iconOnWarning:Ue.white,iconOnSuccess:Ue.white,text:Ue.slate800,textSubdued:Ue.slate500,textFaint:Ue.slate400,textDisabled:Ue.slate400,textOnPrimary:Ue.white,textOnCritical:Ue.white,textOnWarning:Ue.white,textOnSuccess:Ue.white,textOnContrast:Ue.white,actionPrimary:Ue.blue600,actionPrimaryHovered:Ue.blue500,actionPrimaryPressed:Ue.blue700,actionPrimaryDisabled:Ue.blue400,actionSubdued:Ue.blue100,actionSubduedHovered:Ue.blue200,actionSubduedPressed:Ue.blue300,actionSubduedDisabled:Ue.gray100,iconOnPrimarySubdued:Ue.blue600,textOnPrimarySubdued:Ue.blue600,secondary:Ue.white,secondarySubdued:Ue.slate100,surfaceSecondary:Ue.slate200,actionSecondary:Ue.white,actionSecondaryHovered:Ue.slate050,actionSecondaryDisabled:Ue.slate050,interactive:Ue.blue600,interactiveHovered:Ue.blue500,interactivePressed:Ue.blue700,interactiveDisabled:Ue.slate300,textSuccess:Ue.green600,iconSuccess:Ue.green600,borderSuccess:Ue.green300,surfaceSuccess:Ue.green300,iconWarning:Ue.orange600,actionWarning:Ue.orange600,borderWarning:Ue.orange300,surfaceWarning:Ue.orange300,textCritical:Ue.red600,iconCritical:Ue.red600,actionCritical:Ue.red600,borderCritical:Ue.red300,surfaceCritical:Ue.red300,accent:Ue.blue600,iconAccent:Ue.blue600,surfaceAccent:Ue.blue050,borderAccent:Ue.blue600};function wZ(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r0&&(i=i.replace(/^[\/]+/,"")),r0?"?":"")+a.join("&"),o}function bZ(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),wZ(e)}var _x={exports:{}},I3;function SZ(){return I3||(I3=1,function(e){(function(t){t.exports.is_uri=r,t.exports.is_http_uri=i,t.exports.is_https_uri=o,t.exports.is_web_uri=a,t.exports.isUri=r,t.exports.isHttpUri=i,t.exports.isHttpsUri=o,t.exports.isWebUri=a;var n=function(u){var l=u.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return l};function r(u){if(u&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(u)&&!/%[^0-9a-f]/i.test(u)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(u)){var l=[],f="",p="",m="",y="",w="",b="";if(l=n(u),f=l[1],p=l[2],m=l[3],y=l[4],w=l[5],!!(f&&f.length&&m.length>=0)){if(p&&p.length){if(!(m.length===0||/^\//.test(m)))return}else if(/^\/\//.test(m))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(f.toLowerCase()))return b+=f+":",p&&p.length&&(b+="//"+p),b+=m,y&&y.length&&(b+="?"+y),w&&w.length&&(b+="#"+w),b}}}function i(u,l){if(r(u)){var f=[],p="",m="",y="",w="",b="",x="",k="";if(f=n(u),p=f[1],m=f[2],y=f[3],b=f[4],x=f[5],!!p){if(l){if(p.toLowerCase()!="https")return}else if(p.toLowerCase()!="http")return;if(m)return/:(\d+)$/.test(m)&&(w=m.match(/:(\d+)$/)[0],m=m.replace(/:\d+$/,"")),k+=p+":",k+="//"+m,w&&(k+=w),k+=y,b&&b.length&&(k+="?"+b),x&&x.length&&(k+="#"+x),k}}}function o(u){return i(u,!0)}function a(u){return i(u)||o(u)}})(e)}(_x)),_x.exports}var vZ=SZ();async function xZ(e){if(vZ.isWebUri(e))return window.open(e)}const _Z="utm_source=stacking-app";function kZ(e,t){return bZ(pW,`${e}?${_Z}&chain=${t}`)}function xk(e,t){return kZ(`/txid/${e}`,t)}function Nl({href:e,children:t,...n}){const r=()=>xZ(e);return d.jsxs(ie,{onClick:r,as:"a",type:"a",cursor:"pointer",display:"block",outline:0,color:ce("brand"),_hover:{textDecoration:"underline"},_focus:{textDecoration:"underline"},...n,children:[t,d.jsx(fe,{display:"inline-block",ml:"extra-tight",mb:"1px",children:"↗"})]})}function RZ(){const{activeNetwork:e}=ms();return d.jsxs(xe,{flexDirection:["column","column","row","row"],justifyContent:"center",py:"tight",px:["loose","loose","tight","tight"],borderTop:`1px solid ${sf.borderSubdued}`,columnGap:"loose",children:[d.jsx(Nl,{color:ce("text-caption"),fontWeight:500,sx:{textDecoration:"underline"},href:`${window.location.origin}/pool-admin${cs(e)}`,children:"Pool Administration"}),d.jsx(Nl,{color:ce("text-caption"),fontWeight:500,sx:{textDecoration:"underline"},href:`${window.location.origin}/signer/generate-signature${cs(e)}`,children:"Signer Key Signature"}),d.jsx(Nl,{color:ce("text-caption"),fontWeight:500,sx:{textDecoration:"underline"},href:"https://leather.io/terms",children:"Terms of Service"}),d.jsx(Nl,{color:ce("text-caption"),fontWeight:500,sx:{textDecoration:"underline"},href:"https://leather.io/privacy-policy",children:"Privacy Policy"})]})}const TZ="data:image/svg+xml,%3csvg%20width='112'%20height='18'%20viewBox='0%200%20112%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1_13)'%3e%3cpath%20d='M38%209.49632C38.0975%2012.1873%2040.0475%2014.0788%2043.382%2014.0788C46.2485%2014.0788%2048.2375%2012.4213%2048.2375%2010.0618C48.2375%207.40982%2045.956%206.66883%2043.733%206.29833C41.6855%205.94732%2040.028%205.61582%2040.028%203.97782C40.028%202.51533%2041.2175%201.73532%2042.992%201.73532C44.8445%201.73532%2046.112%202.76882%2046.307%204.34832H48.062C47.906%201.89132%2046.034%200.194824%2042.992%200.194824C40.223%200.194824%2038.3315%201.75482%2038.3315%204.07532C38.3315%206.72732%2040.5935%207.44882%2042.797%207.81932C44.864%208.17032%2046.541%208.52132%2046.541%2010.2178C46.541%2011.6998%2045.2345%2012.5383%2043.4015%2012.5383C41.315%2012.5383%2039.8915%2011.3293%2039.755%209.49632H38Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M50.8977%2011.3683C50.8977%2013.1233%2051.5802%2013.9618%2053.4912%2013.9618H55.2267V12.4993H53.6472C52.7892%2012.4993%2052.4967%2012.1873%2052.4967%2011.3488V5.47932H55.0707V4.01682H52.4967V1.22832H50.8977V4.01682H49.1037V5.47932H50.8977V11.3683Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M65.2544%2012.4993C64.806%2012.4993%2064.6109%2012.3628%2064.6109%2011.8363V7.48783C64.6109%205.16733%2063.1484%203.89983%2060.6134%203.89983C58.2149%203.89983%2056.6354%205.05033%2056.4014%207.00033H58.0004C58.1954%205.98634%2059.1314%205.32333%2060.5354%205.32333C62.0954%205.32333%2063.0119%206.10333%2063.0119%207.39034V8.07283H60.0869C57.4739%208.07283%2056.0894%209.18433%2056.0894%2011.1733C56.0894%2012.9868%2057.5714%2014.0788%2059.7554%2014.0788C61.4714%2014.0788%2062.4659%2013.3183%2063.0899%2012.4213C63.1094%2013.3963%2063.5579%2013.9618%2064.8839%2013.9618H65.7614V12.4993H65.2544ZM63.0119%209.90583C63.0119%2011.5633%2061.8614%2012.7138%2059.8724%2012.7138C58.5464%2012.7138%2057.7079%2012.0508%2057.7079%2011.0758C57.7079%209.94483%2058.5074%209.41834%2059.9309%209.41834H63.0119V9.90583Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M71.342%2014.0788C73.76%2014.0788%2075.3785%2012.7138%2075.7685%2010.5688H74.072C73.76%2011.8363%2072.785%2012.6553%2071.3615%2012.6553C69.4505%2012.6553%2068.1635%2011.1733%2068.1635%209.00884C68.1635%206.84434%2069.4505%205.32333%2071.3615%205.32333C72.824%205.32333%2073.799%206.12283%2074.0915%207.44883H75.7685C75.359%205.26483%2073.8185%203.89983%2071.381%203.89983C68.495%203.89983%2066.5255%205.96684%2066.5255%209.00884C66.5255%2012.1093%2068.4365%2014.0788%2071.342%2014.0788Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M77.5215%2013.9618H79.1205V11.3488L81.129%209.28183L84.4245%2013.9618H86.355L82.2015%208.13132L86.082%204.01682H84.1125L79.1205%209.30132V0.311829H77.5215V13.9618Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M88.2999%202.33982C88.8849%202.33982%2089.3334%201.91082%2089.3334%201.30632C89.3334%200.701828%2088.8849%200.272827%2088.2999%200.272827C87.7149%200.272827%2087.2664%200.701828%2087.2664%201.30632C87.2664%201.91082%2087.7149%202.33982%2088.2999%202.33982ZM87.4809%2013.9618H89.0799V4.01682H87.4809V13.9618Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M96.1455%203.89983C94.4685%203.89983%2093.4545%204.60183%2092.8695%205.36233L92.655%204.01683H91.2705V13.9618H92.8695V8.98933C92.8695%206.74684%2094.0005%205.36233%2095.8725%205.36233C97.608%205.36233%2098.5635%206.45433%2098.5635%208.52133V13.9618H100.162V8.42383C100.162%205.12833%2098.388%203.89983%2096.1455%203.89983Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M110.04%205.73283C109.416%204.62133%20108.305%203.89983%20106.628%203.89983C103.878%203.89983%20101.85%205.94733%20101.85%208.98933C101.85%2012.2263%20103.878%2014.0788%20106.628%2014.0788C108.305%2014.0788%20109.377%2013.3768%20110.04%2012.2458V13.4158C110.04%2015.5803%20108.909%2016.5553%20106.823%2016.5553C105.165%2016.5553%20104.054%2015.8533%20103.781%2014.6053H102.143C102.396%2016.7893%20104.171%2017.9788%20106.706%2017.9788C110.118%2017.9788%20111.639%2016.3408%20111.639%2013.4743V4.01683H110.255L110.04%205.73283ZM106.784%2012.6553C104.814%2012.6553%20103.488%2011.1538%20103.488%208.98933C103.488%206.82483%20104.814%205.32333%20106.784%205.32333C108.734%205.32333%20110.06%206.84433%20110.06%209.02833C110.06%2011.1538%20108.734%2012.6553%20106.784%2012.6553Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M29.6813%200.0212402L21%2014.2288H23.2264L31.8928%200.0212402H29.6813Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M14%209.66052H9.73913L12.6739%2014.2288H10.5L7.01087%208.86271L3.5%2014.2288H1.32609L4.30435%209.67145H0V7.94469H14V9.66052ZM14%206.27257H0V4.53487H4.18478L1.25%200.0212402H3.42391L6.95652%205.48569L10.5%200.0212402H12.6739L9.72826%204.53487H14V6.27257Z'%20fill='%23C8C8C8'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1_13'%3e%3crect%20width='112'%20height='18'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",OZ="data:image/svg+xml,%3csvg%20width='112'%20height='18'%20viewBox='0%200%20112%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M38%209.49632C38.0975%2012.1873%2040.0475%2014.0788%2043.382%2014.0788C46.2485%2014.0788%2048.2375%2012.4213%2048.2375%2010.0618C48.2375%207.40982%2045.956%206.66883%2043.733%206.29833C41.6855%205.94732%2040.028%205.61582%2040.028%203.97782C40.028%202.51533%2041.2175%201.73532%2042.992%201.73532C44.8445%201.73532%2046.112%202.76882%2046.307%204.34832H48.062C47.906%201.89132%2046.034%200.194824%2042.992%200.194824C40.223%200.194824%2038.3315%201.75482%2038.3315%204.07532C38.3315%206.72732%2040.5935%207.44882%2042.797%207.81932C44.864%208.17032%2046.541%208.52132%2046.541%2010.2178C46.541%2011.6998%2045.2345%2012.5383%2043.4015%2012.5383C41.315%2012.5383%2039.8915%2011.3293%2039.755%209.49632H38Z'%20fill='%23242629'/%3e%3cpath%20d='M50.8977%2011.3683C50.8977%2013.1233%2051.5802%2013.9618%2053.4912%2013.9618H55.2267V12.4993H53.6472C52.7892%2012.4993%2052.4967%2012.1873%2052.4967%2011.3488V5.47932H55.0707V4.01682H52.4967V1.22832H50.8977V4.01682H49.1037V5.47932H50.8977V11.3683Z'%20fill='%23242629'/%3e%3cpath%20d='M65.2544%2012.4993C64.806%2012.4993%2064.6109%2012.3628%2064.6109%2011.8363V7.48782C64.6109%205.16732%2063.1484%203.89982%2060.6134%203.89982C58.2149%203.89982%2056.6354%205.05032%2056.4014%207.00032H58.0004C58.1954%205.98633%2059.1314%205.32332%2060.5354%205.32332C62.0954%205.32332%2063.0119%206.10332%2063.0119%207.39033V8.07282H60.0869C57.4739%208.07282%2056.0894%209.18432%2056.0894%2011.1733C56.0894%2012.9868%2057.5714%2014.0788%2059.7554%2014.0788C61.4714%2014.0788%2062.4659%2013.3183%2063.0899%2012.4213C63.1094%2013.3963%2063.5579%2013.9618%2064.8839%2013.9618H65.7614V12.4993H65.2544ZM63.0119%209.90582C63.0119%2011.5633%2061.8614%2012.7138%2059.8724%2012.7138C58.5464%2012.7138%2057.7079%2012.0508%2057.7079%2011.0758C57.7079%209.94482%2058.5074%209.41833%2059.9309%209.41833H63.0119V9.90582Z'%20fill='%23242629'/%3e%3cpath%20d='M71.342%2014.0788C73.76%2014.0788%2075.3785%2012.7138%2075.7685%2010.5688H74.072C73.76%2011.8363%2072.785%2012.6553%2071.3615%2012.6553C69.4505%2012.6553%2068.1635%2011.1733%2068.1635%209.00883C68.1635%206.84433%2069.4505%205.32332%2071.3615%205.32332C72.824%205.32332%2073.799%206.12282%2074.0915%207.44882H75.7685C75.359%205.26482%2073.8185%203.89982%2071.381%203.89982C68.495%203.89982%2066.5255%205.96683%2066.5255%209.00883C66.5255%2012.1093%2068.4365%2014.0788%2071.342%2014.0788Z'%20fill='%23242629'/%3e%3cpath%20d='M77.5215%2013.9618H79.1205V11.3488L81.129%209.28182L84.4245%2013.9618H86.355L82.2015%208.13132L86.082%204.01682H84.1125L79.1205%209.30132V0.311824H77.5215V13.9618Z'%20fill='%23242629'/%3e%3cpath%20d='M88.2999%202.33982C88.8849%202.33982%2089.3334%201.91082%2089.3334%201.30632C89.3334%200.701825%2088.8849%200.272824%2088.2999%200.272824C87.7149%200.272824%2087.2664%200.701825%2087.2664%201.30632C87.2664%201.91082%2087.7149%202.33982%2088.2999%202.33982ZM87.4809%2013.9618H89.0799V4.01682H87.4809V13.9618Z'%20fill='%23242629'/%3e%3cpath%20d='M96.1455%203.89982C94.4685%203.89982%2093.4545%204.60182%2092.8695%205.36232L92.655%204.01682H91.2705V13.9618H92.8695V8.98932C92.8695%206.74683%2094.0005%205.36232%2095.8725%205.36232C97.608%205.36232%2098.5635%206.45432%2098.5635%208.52132V13.9618H100.162V8.42382C100.162%205.12832%2098.388%203.89982%2096.1455%203.89982Z'%20fill='%23242629'/%3e%3cpath%20d='M110.04%205.73282C109.416%204.62132%20108.305%203.89982%20106.628%203.89982C103.878%203.89982%20101.85%205.94732%20101.85%208.98932C101.85%2012.2263%20103.878%2014.0788%20106.628%2014.0788C108.305%2014.0788%20109.377%2013.3768%20110.04%2012.2458V13.4158C110.04%2015.5803%20108.909%2016.5553%20106.823%2016.5553C105.165%2016.5553%20104.054%2015.8533%20103.781%2014.6053H102.143C102.396%2016.7893%20104.171%2017.9788%20106.706%2017.9788C110.118%2017.9788%20111.639%2016.3408%20111.639%2013.4743V4.01682H110.255L110.04%205.73282ZM106.784%2012.6553C104.814%2012.6553%20103.488%2011.1538%20103.488%208.98932C103.488%206.82482%20104.814%205.32332%20106.784%205.32332C108.734%205.32332%20110.06%206.84432%20110.06%209.02832C110.06%2011.1538%20108.734%2012.6553%20106.784%2012.6553Z'%20fill='%23242629'/%3e%3cpath%20d='M29.6813%200.0212402L21%2014.2288H23.2264L31.8928%200.0212402H29.6813Z'%20fill='%23242629'/%3e%3cpath%20d='M14%209.66052H9.73913L12.6739%2014.2288H10.5L7.01087%208.86271L3.5%2014.2288H1.32609L4.30435%209.67145H0V7.94469H14V9.66052ZM14%206.27257H0V4.53487H4.18478L1.25%200.0212402H3.42391L6.95652%205.48569L10.5%200.0212402H12.6739L9.72826%204.53487H14V6.27257Z'%20fill='%23242629'/%3e%3c/svg%3e";function NZ(e,t=4){return`${e.substring(0,t+2)}…${e.substring(e.length-t)}`}function Mi(e,t=5){var i,o;if(!e)return"";if(e.startsWith("0x"))return NZ(e,t);if(e.includes(".")){const a=e.split("."),u=(i=a[0])==null?void 0:i.substring(0,t),l=(o=a[0])==null?void 0:o.substring(a[0].length-t,a[0].length);return`${u}…${l}.${a[1]}`}if(e.length<=2*t)return e;const n=e==null?void 0:e.substring(0,t),r=e==null?void 0:e.substring(e.length-t,e.length);return`${n}…${r}`}var W8={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},P3=lt.createContext&<.createContext(W8),Il=function(){return Il=Object.assign||function(e){for(var t,n=1,r=arguments.length;nd.jsx(ie,{as:"h1",fontSize:"40px",lineHeight:"56px",display:"block",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",color:ce("text-title"),...t,children:e}),_k={capHeight:2048,ascent:2728,descent:-680,lineGap:0,unitsPerEm:2816},Dg={capHeight:1563,ascent:2105,descent:-525,lineGap:0,unitsPerEm:2048},IZ={fontMetrics:Dg,fontSize:24,leading:32},PZ={fontMetrics:Dg,fontSize:18,leading:28},MZ={fontMetrics:Dg,fontSize:16,leading:24},LZ={fontMetrics:Dg,fontSize:14,leading:20},BZ={fontMetrics:Dg,fontSize:12,leading:16},jZ={fontMetrics:_k,fontSize:14,leading:20},DZ={fontMetrics:_k,fontSize:12,leading:16},JZ={fontMetrics:_k,fontSize:10,leading:16},$Z=e=>{switch(e){case"c3":return JZ;case"c2":return DZ;default:return jZ}},qZ=e=>{switch(e){case"h1":return IZ;case"h2":return PZ;case"h3":return MZ;case"h4":return LZ;case"h5":case"h6":return BZ;default:return}};Gr((e,t)=>d.jsx(ie,{userSelect:"none",letterSpacing:"-0.01em",fontFamily:"'Open Sauce One'",fontWeight:"500",color:ce("text-title"),ref:t,display:"block",css:qZ(e.as),...e}));Gr((e,t)=>d.jsx(ie,{letterSpacing:"-0.01em",color:ce("text-body"),display:"block",lineHeight:"1.5",ref:t,...e}));const Li=Gr(({variant:e,...t},n)=>d.jsx(ie,{letterSpacing:"-0.01em",css:$Z(e),color:ce("text-caption"),display:"block",ref:n,...t})),Nr={HOME:"/",CHOOSE_STACKING_METHOD:"/choose-stacking-method",START_POOLED_STACKING:"/start-pooled-stacking",START_DIRECT_STACKING:"/start-direct-stacking",START_LIQUID_STACKING:"/start-liquid-stacking",DIRECT_STACKING_INFO:"/direct-stacking-info",POOLED_STACKING_INFO:"/pooled-stacking-info",LOCK_MORE:"/lock-more",SELF_SERVICE_EXTEND:"/self-service-extend",SETTINGS_NETWORK:"/settings/network",ADD_NETWORK:"/settings/add-network",DELEGATE_STACK_STX:"/pool-admin/delegate-stack-stx",DELEGATE_STACK_INCREASE:"/pool-admin/delegate-stack-increase",DELEGATE_STACK_EXTEND:"/pool-admin/delegate-stack-extend",STACK_AGGREGATION_COMMIT:"/pool-admin/stack-aggregation-commit",STACK_AGGREGATION_INCREASE:"/pool-admin/stack-aggregation-increase",GENERATE_SIGNATURE:"/signer/generate-signature"};function Yn(){const e=$l(),{activeNetwork:t}=ms();return(n,r)=>{if(typeof n=="number")e(n);else{const i=zP(n,t);e(i,r)}}}const UZ=1e3,HZ=60*UZ,zZ=Gr(({children:e,...t},n)=>d.jsx(xe,{ref:n,alignItems:"center",justify:"center",borderRadius:"24px",py:"4px",px:["8px","8px","12px"],color:"white",borderWidth:"1px",...t,children:d.jsx(ie,{display:"block",lineHeight:"16px",fontSize:["10px","10px","11px"],fontWeight:600,color:"currentColor",children:e})})),G8=({children:e,bold:t})=>d.jsx(Jo,{fontSize:"20px",lineHeight:"28px",display:"block",fontWeight:t?400:void 0,children:e}),K8=({isActive:e,isDisabled:t,...n})=>d.jsx(xe,{opacity:t?.5:1,alignItems:"center",justifyContent:"space-between",position:"relative",zIndex:"999",bg:t?"bg-4":"bg",cursor:t?"not-allowed":"unset",_hover:{bg:t||e?"unset":"bgAlt",cursor:t?"not-allowed":e?"default":"pointer"},...n}),WZ=e=>()=>new rr.InfoApi(new rr.Configuration({basePath:e})).getCoreApiInfo(),Q8=({mode:e})=>d.jsx(zZ,{bg:ce("bg-4"),ml:"8px",color:ce("text-caption"),children:e}),VZ=({item:e,isActive:t,isDisabled:n,onClick:r,isCustom:i,...o})=>{var N,E;const{removeCustomNetwork:a,apiUrls:{mainnet:u,testnet:l}}=ms(),f=e.url===u,p=e.url===l,m=f||p;let y=f?dn.Mainnet:dn.Testnet;const w=n||!e.url||m,{data:b,error:x,isInitialLoading:k}=yr(["customNetworkApiInfo",e.url],WZ(e.url),{staleTime:HZ,enabled:!w,suspense:!1,useErrorBoundary:!1});!m&&b&&(y=(b==null?void 0:b.network_id)&&b.network_id);const O=HP(y)({[dn.Mainnet]:"mainnet",[dn.Testnet]:"testnet"});return d.jsxs(K8,{isActive:t,isDisabled:!!n||!!x||k,...o,children:[d.jsxs(It,{pl:"32px",pr:"32px",py:"16px",width:"100%",flexGrow:1,spacing:"8px",onClick:r,children:[d.jsxs(xe,{alignItems:"center",children:[d.jsx(G8,{children:e.label}),O?d.jsx(Q8,{mode:O}):null]}),d.jsx(Li,{display:"block",children:(N=e==null?void 0:e.url)!=null&&N.includes("//")?(E=e==null?void 0:e.url)==null?void 0:E.split("//")[1]:(e==null?void 0:e.url)||n})]}),d.jsx(xe,{alignItems:"center",pr:"32px",py:"16px",position:"relative",children:i&&!t?d.jsx(a7,{label:"Remove network",children:d.jsx(u7,{position:"relative",zIndex:999,size:"21px",icon:()=>d.jsx("span",{children:d.jsx(FZ,{size:"21px"})}),onClick:()=>a(e),"aria-label":"Remove network",_hover:{bg:"rgba(255, 255, 255, 0.25)"}})}):k?d.jsx(fs,{size:"18px",opacity:.5,color:"#666"}):x?d.jsx(Li,{color:ce("feedback-error"),children:"Offline"}):t?d.jsx(fe,{as:AZ,color:ce("feedback-success"),size:"18px"}):null})]})},GZ=({onClick:e,...t})=>{const n=Yn();return d.jsx(K8,{onClick:r=>{n(Nr.ADD_NETWORK),e==null||e(r)},py:"24px",px:"32px",borderTopWidth:"1px",...t,children:d.jsx(G8,{bold:!0,children:"Add a network"})})};function KZ({onItemClick:e}){const t=$l(),{networks:n,activeNetwork:r}=ms();return d.jsxs(d.Fragment,{children:[Object.values(n).map((i,o)=>{const a=r.url===i.url;return d.jsx(VZ,{isActive:a,item:i,isCustom:o>=3,onClick:()=>{setTimeout(()=>{if(e==null||e(i),!a){const u={pathname:"/",search:cs(i)};t(u)}},250)}},o)}),d.jsx(GZ,{onClick:()=>{e==null||e("new")}})]})}const QZ=lt.memo(KZ);function YZ(){const{networkName:e,networkLabel:t}=Pt(),n=Yn();return d.jsx(Li,{cursor:"pointer",onClick:()=>n(Nr.SETTINGS_NETWORK),children:d.jsxs(ie,{textAlign:"center",color:ce("text-caption"),children:[t,d.jsx(Q8,{mode:e})]})})}function XZ(){const{isSignedIn:e,signOut:t,signIn:n,address:r}=Mn(),[i,o]=Iw(),{activeNetwork:a}=ms(),u=$.useMemo(()=>window.matchMedia("(prefers-color-scheme: dark)").matches?TZ:OZ,[]);return d.jsxs(xe,{flexDirection:"row",justifyContent:"space-between",p:"base-loose",borderBottom:`1px solid ${ce("border")}`,children:[d.jsx(xe,{alignItems:"center",children:d.jsx(Ah,{to:`/${cs(a)}`,children:d.jsx(xe,{alignItems:"center",children:d.jsx("img",{src:u,alt:"Site logo with Stacks symbol and Stacking text"})})})}),d.jsx(fe,{children:d.jsxs(xe,{p:"sm",justify:"right",alignItems:"center",children:[d.jsx(YZ,{}),d.jsx(Nl,{href:"https://wallet.hiro.so/wallet/faq#stacking",px:"loose",children:d.jsx(ie,{color:ce("text-body"),fontWeight:500,children:"FAQ"})}),d.jsx(fe,{pr:"12px",children:e&&r?d.jsx(St,{width:"160px",boxShadow:"none",_hover:{boxShadow:"none"},mode:"tertiary",onClick:()=>t(),...o,children:i?"Sign out":Mi(r)}):d.jsx(St,{boxShadow:"none",_hover:{boxShadow:"none"},mode:"tertiary",onClick:()=>n(),children:"Connect wallet"})})]})})]})}function hb(){return{poxDisabled:!1}}function ZZ({title:e,children:t,...n}){return d.jsxs(fe,{borderRadius:"6px",border:"1px solid",borderColor:ce("border"),boxShadow:"mid",textAlign:"center",width:"100%",...n,children:[e&&d.jsx(xe,{borderBottom:"1px solid",borderColor:ce("border"),height:"40px",justifyContent:"center",alignItems:"center",children:d.jsx(ie,{textStyle:"caption",color:ce("text-caption"),children:e})}),d.jsx(fe,{my:"base",mx:"base",children:t})]})}const eee=ds` +`));return cF(o,f,n,{strict:!1})}function RQ({signature:e,message:t,publicKey:n}){return kQ({signature:zz(e),message:t,publicKey:n})}async function TQ(e,t){const n=Object.assign({},t);let r;if(!n.publicKey){if(!n.privateKey)throw new Error("Either public key or private key must be supplied for encryption.");n.publicKey=i8(n.privateKey)}const i=typeof n.wasString=="boolean"?n.wasString:typeof e=="string",o=typeof e=="string"?as(e):e,a=await xQ(n.publicKey,o,i,n.cipherTextEncoding);let u=JSON.stringify(a);if(n.sign){typeof n.sign=="string"?r=n.sign:r||(r=n.privateKey);const l=_Q(r,u),f={signature:l.signature,publicKey:l.publicKey,cipherText:u};u=JSON.stringify(f)}return u}function OQ(e,t){const n=Object.assign({},t);if(!n.privateKey)throw new Error("Private key is required for decryption.");try{const r=JSON.parse(e);return l8(n.privateKey,r)}catch(r){throw r instanceof SyntaxError?new Error("Failed to parse encrypted content JSON. The content may not be encrypted. If using getFile, try passing { decrypt: false }."):r}}class NQ extends Error{constructor(t,n){const r=`'${t}' is not a valid P2PKH/P2SH/P2WPKH/P2WSH/P2TR address`;super(r),this.message=r,this.name=this.constructor.name,this.innerError=n,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}function CQ(e){switch(e){case vh.mainnet.P2PKH:return Gn.P2PKH;case vh.testnet.P2PKH:return Gn.P2PKH;case vh.mainnet.P2SH:return Gn.P2SH;case vh.testnet.P2SH:return Gn.P2SH;default:throw new Error("Invalid pox address version")}}function EQ(e,t){if(e===N1&&t===20)return Gn.P2WPKH;if(e===N1&&t===32)return Gn.P2WSH;if(e===GM&&t===32)return Gn.P2TR;throw new Error("Invalid native segwit witness version and byte length. Currently, only P2WPKH, P2WSH, and P2TR are supported.")}function AQ(e){const{words:t}=fw.decode(e),n=t[0];if(n>0)throw new Error("Addresses with a witness version >= 1 should be encoded in bech32m");return{witnessVersion:n,data:fw.fromWords(t.slice(1))}}function FQ(e){const{words:t}=hw.decode(e),n=t[0];if(n==0)throw new Error("Addresses with witness version 1 should be encoded in bech32");return{witnessVersion:n,data:hw.fromWords(t.slice(1))}}function IQ(e){if(LF.test(e))return AQ(e);if(BF.test(e))return FQ(e);throw new Error(`Native segwit address ${e} does not match valid prefix ${LF} or ${BF}`)}function PQ(e){try{if(VM.test(e)){const t=dQ(e);return{version:CQ(t.version),data:t.hash}}else if(HK.test(e)){const t=IQ(e);return{version:EQ(t.witnessVersion,t.data.length),data:t.data}}throw new Error("Unknown BTC address prefix.")}catch(t){throw new NQ(e,t)}}function d8(e){const t=e;if(t.type!==we.Tuple||!t.value)throw new Error("Invalid argument, expected ClarityValue to be a TupleCV");if(!("version"in t.value)||!("hashbytes"in t.value))throw new Error("Invalid argument, expected Clarity tuple value to contain `version` and `hashbytes` keys");const n=t.value.version,r=t.value.hashbytes;if(n.type!==we.Buffer||r.type!==we.Buffer)throw new Error("Invalid argument, expected Clarity tuple value to contain `version` and `hashbytes` buffers");return{version:rt(n.value)[0],hashBytes:rt(r.value)}}function xi(e){const{version:t,data:n}=PQ(e),r=kr(zw(BigInt(t),1)),i=kr(n);return uw({version:r,hashbytes:i})}function MQ(e,t){switch(e){case Gn.P2PKH:return vh[t].P2PKH;case Gn.P2SH:case Gn.P2SHP2WPKH:case Gn.P2SHP2WSH:return vh[t].P2SH;default:throw new Error("Invalid pox address version")}}function f8(e,t,n){if(!Zz.includes(n))throw new Error("Invalid network.");switch(typeof t=="string"&&(t=rt(t)),e){case Gn.P2PKH:case Gn.P2SH:case Gn.P2SHP2WPKH:case Gn.P2SHP2WSH:{const r=MQ(e,n);return n8(r,t)}case Gn.P2WPKH:case Gn.P2WSH:{const r=fw.toWords(t);return fw.encode(jF[n],[N1,...r])}case Gn.P2TR:{const r=hw.toWords(t);return hw.encode(jF[n],[GM,...r])}}throw new Error(`Unexpected address version: ${e}`)}function LQ(e,t){const n=d8(e);return f8(n.version,n.hashBytes,t)}function sk(...e){return typeof e[0]=="number"?f8(e[0],e[1],e[2]):LQ(e[0],e[1])}function BQ(e){if(e.type===we.OptionalSome)return e.value;if(e.type!==we.OptionalNone)throw new Error("Object is not an 'Optional'")}function zF(e,t){if(e.type===we.OptionalSome)return t(e.value);if(e.type!==we.OptionalNone)throw new Error("Object is not an 'Optional'")}function mx(e){if(e.period===Tl.Period1)throw new Error(`PoX-2 has not activated yet (currently in period ${e.period} of PoX-2 operation)`)}function oh({contract:e,poxAddress:t}){if(t&&e.endsWith(".pox")&&!VM.test(t))throw new Error("PoX-1 requires P2PKH/P2SH/P2SH-P2WPKH/P2SH-P2WSH bitcoin addresses")}function sh({contract:e,signerKey:t,signerSignature:n,maxAmount:r,authId:i}){const o=typeof r<"u",a=typeof i<"u";if(/\.pox(-[2-3])?$/.test(e)){if(t||n||o||a)throw new Error("PoX-1, PoX-2 and PoX-3 do not accept a `signerKey`, `signerSignature`, `maxAmount` or `authId`")}else if(!t||!o||typeof i>"u")throw new Error("PoX-4 requires a `signerKey` (buff 33), `maxAmount` (uint), and `authId` (uint)")}var Zi;(function(e){e.StackStx="stack-stx",e.AggregateCommit="agg-commit",e.AggregateIncrease="agg-increase",e.StackExtend="stack-extend",e.StackIncrease="stack-increase"})(Zi||(Zi={}));function jQ({topic:e,poxAddress:t,rewardCycle:n,period:r,network:i,privateKey:o,maxAmount:a,authId:u}){return UK({...ak({topic:e,poxAddress:t,rewardCycle:n,period:r,network:i,maxAmount:a,authId:u}),privateKey:o})}function Vl({topic:e,poxAddress:t,rewardCycle:n,period:r,network:i,publicKey:o,signature:a,maxAmount:u,authId:l}){return RQ({message:Jr(WM(ak({topic:e,poxAddress:t,rewardCycle:n,period:r,network:i,maxAmount:u,authId:l}))),publicKey:o,signature:a})}function ak({topic:e,poxAddress:t,rewardCycle:n,period:r,network:i,maxAmount:o,authId:a}){const u=mr(i),l=uw({"pox-addr":xi(t),"reward-cycle":ft(n),topic:Qm(e),period:ft(r),"max-amount":ft(o),"auth-id":ft(a)}),f=uw({name:Qm("pox-4-signer"),version:Qm("1.0.0"),"chain-id":ft(u.chainId)});return{message:l,domain:f}}class _f{constructor(t){this.address=t.address,this.network=mr(t.network??"mainnet"),this.client=Object.assign({},hs(this.network),t.client)}get baseUrl(){return this.client.baseUrl}get fetch(){return this.client.fetch}getCoreInfo(){return this.client.fetch(`${this.client.baseUrl}/v2/info`).then(t=>t.json())}getPoxInfo(){return this.client.fetch(`${this.client.baseUrl}/v2/pox`).then(t=>t.json())}async getTargetBlockTime(){const t=await this.client.fetch(`${this.client.baseUrl}/extended/v1/info/network_block_times`).then(n=>n.json());return this.network.chainId===dn.Mainnet?t.mainnet.target_block_time:t.testnet.target_block_time}async getAccountStatus(){return this.client.fetch(`${this.client.baseUrl}/v2/accounts/${this.address}?proof=0`).then(t=>t.json()).then(t=>(t.balance=BigInt(t.balance),t.locked=BigInt(t.locked),t))}async getAccountBalance(){return this.getAccountStatus().then(t=>t.balance)}async getAccountExtendedBalances(){return this.client.fetch(`${this.client.baseUrl}/extended/v1/address/${this.address}/balances`).then(t=>t.json()).then(t=>(t.stx.balance=BigInt(t.stx.balance),t.stx.total_sent=BigInt(t.stx.total_sent),t.stx.total_received=BigInt(t.stx.total_received),t.stx.locked=BigInt(t.stx.locked),t))}async getAccountBalanceLocked(){return this.getAccountStatus().then(t=>t.locked)}async getCycleDuration(){const t=this.getPoxInfo(),n=await this.getTargetBlockTime();return Promise.all([t,n]).then(([r,i])=>r.reward_cycle_length*i)}async getRewardsTotalForBtcAddress(){return this.client.fetch(`${this.client.baseUrl}/extended/v1/burnchain/rewards/${this.address}/total`).then(t=>t.json()).then(t=>(t.reward_amount=BigInt(t.reward_amount),t))}async getRewardsForBtcAddress(t){let n=`${this.client.baseUrl}/extended/v1/burnchain/rewards/${this.address}`;return t&&(n+=`?limit=${t.limit}&offset=${t.offset}`),this.client.fetch(n).then(r=>r.json())}async getRewardHoldersForBtcAddress(t){let n=`${this.client.baseUrl}/extended/v1/burnchain/reward_slot_holders/${this.address}`;return t&&(n+=`?limit=${t.limit}&offset=${t.offset}`),this.client.fetch(n).then(r=>r.json())}async getRewardSet(t){const[n,r]=this.parseContractId(t==null?void 0:t.contractId),i=await ph({client:this.client,senderAddress:this.address,contractAddress:n,contractName:r,functionArgs:[ft(t.rewardCyleId),ft(t.rewardSetIndex)],functionName:"get-reward-set-pox-address"});return zF(i,o=>({pox_address:{version:rt(o.value["pox-addr"].value.version.value),hashbytes:rt(o.value["pox-addr"].value.hashbytes.value)},total_ustx:BigInt(o.value["total-ustx"].value)}))}async getSecondsUntilNextCycle(){const t=this.getPoxInfo(),n=this.getTargetBlockTime(),r=this.getCoreInfo();return Promise.all([t,n,r]).then(([i,o,a])=>(i.reward_cycle_length-(a.burn_block_height-i.first_burnchain_block_height)%i.reward_cycle_length)*o)}async getSecondsUntilStackingDeadline(){const t=this.getPoxInfo(),n=this.getTargetBlockTime();return Promise.all([t,n]).then(([r,i])=>r.next_cycle.blocks_until_prepare_phase*i)}async getPoxOperationInfo(t){t=t??await this.getPoxInfo();const n=[...t.contract_versions].sort((f,p)=>f.activation_burnchain_block_height-p.activation_burnchain_block_height),[r,i,o,a]=n,u=n.filter(f=>(t==null?void 0:t.current_burnchain_block_height)>=f.activation_burnchain_block_height),l=u[u.length-1];return{period:Tl.Period3,pox1:r,pox2:i,pox3:o,pox4:a,current:l}}async hasMinimumStx(){const t=await this.getAccountBalance(),n=BigInt((await this.getPoxInfo()).min_amount_ustx);return t>=n}async canStack({poxAddress:t,cycles:n}){const r=this.getAccountBalance(),i=this.getPoxInfo();return Promise.all([r,i]).then(([o,a])=>{const u=xi(t),[l,f]=this.parseContractId(a.contract_id);return ph({client:this.client,contractName:f,contractAddress:l,functionName:"can-stack-stx",senderAddress:this.address,functionArgs:[u,ft(o.toString()),ft(a.reward_cycle_id),ft(n.toString())]})}).then(o=>o.type===we.ResponseOk?{eligible:!0}:{eligible:!1,reason:C1[+Kd(o.value)]})}async stack({amountMicroStx:t,poxAddress:n,cycles:r,burnBlockHeight:i,signerKey:o,signerSignature:a,maxAmount:u,authId:l,...f}){const p=await this.getPoxInfo(),m=await this.getPoxOperationInfo(p),y=await this.getStackingContract(m);oh({contract:y,poxAddress:n}),sh({contract:y,signerKey:o,signerSignature:a,maxAmount:u,authId:l});const w=this.getStackOptions({contract:y,amountMicroStx:t,cycles:r,poxAddress:n,burnBlockHeight:i,signerKey:o,signerSignature:a,maxAmount:u,authId:l}),b=await vo({...w,...xo(f)});return So({transaction:b,client:this.client})}async stackExtend({extendCycles:t,poxAddress:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a,...u}){const l=await this.getPoxInfo(),f=await this.getPoxOperationInfo(l);mx(f),sh({contract:l.contract_id,signerKey:r,signerSignature:i,maxAmount:o,authId:a});const p=this.getStackExtendOptions({contract:l.contract_id,extendCycles:t,poxAddress:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a}),m=await vo({...p,...xo(u)});return So({transaction:m,client:this.client})}async stackIncrease({increaseBy:t,signerKey:n,signerSignature:r,maxAmount:i,authId:o,...a}){const u=await this.getPoxInfo(),l=await this.getPoxOperationInfo(u);mx(l),sh({contract:u.contract_id,signerKey:n,signerSignature:r,maxAmount:i,authId:o});const f=this.getStackIncreaseOptions({contract:u.contract_id,increaseBy:t,signerKey:n,signerSignature:r,maxAmount:i,authId:o}),p=await vo({...f,...xo(a)});return So({transaction:p,client:this.client})}async delegateStx({amountMicroStx:t,delegateTo:n,untilBurnBlockHeight:r,poxAddress:i,...o}){const a=await this.getPoxInfo(),u=await this.getPoxOperationInfo(a),l=await this.getStackingContract(u);oh({contract:l,poxAddress:i});const f=this.getDelegateOptions({contract:l,amountMicroStx:t,delegateTo:n,untilBurnBlockHeight:r,poxAddress:i}),p=await vo({...f,...xo(o)});return So({transaction:p,client:this.client})}async delegateStackStx({stacker:t,amountMicroStx:n,poxAddress:r,burnBlockHeight:i,cycles:o,...a}){const u=await this.getPoxInfo(),l=await this.getPoxOperationInfo(u),f=await this.getStackingContract(l);oh({contract:f,poxAddress:r});const p=this.getDelegateStackOptions({contract:f,stacker:t,amountMicroStx:n,poxAddress:r,burnBlockHeight:i,cycles:o}),m=await vo({...p,...xo(a)});return So({transaction:m,client:this.client})}async delegateStackExtend({stacker:t,poxAddress:n,extendCount:r,...i}){const a=(await this.getPoxInfo()).contract_id,u=this.getDelegateStackExtendOptions({contract:a,stacker:t,poxAddress:n,extendCount:r}),l=await vo({...u,...xo(i)});return So({transaction:l,client:this.client})}async delegateStackIncrease({stacker:t,poxAddress:n,increaseBy:r,...i}){const o=await this.getPoxInfo(),a=await this.getPoxOperationInfo(o);mx(a);const u=this.getDelegateStackIncreaseOptions({contract:o.contract_id,stacker:t,poxAddress:n,increaseBy:r}),l=await vo({...u,...xo(i)});return So({transaction:l,client:this.client})}async stackAggregationCommit({poxAddress:t,rewardCycle:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a,...u}){const l=await this.getStackingContract();oh({contract:l,poxAddress:t}),sh({contract:l,signerKey:r,signerSignature:i,maxAmount:o,authId:a});const f=this.getStackAggregationCommitOptions({contract:l,poxAddress:t,rewardCycle:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a}),p=await vo({...f,...xo(u)});return So({transaction:p,client:this.client})}async stackAggregationCommitIndexed({poxAddress:t,rewardCycle:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a,...u}){const l=await this.getStackingContract();oh({contract:l,poxAddress:t}),sh({contract:l,signerKey:r,signerSignature:i,maxAmount:o,authId:a});const f=this.getStackAggregationCommitOptionsIndexed({contract:l,poxAddress:t,rewardCycle:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a}),p=await vo({...f,...xo(u)});return So({transaction:p,client:this.client})}async stackAggregationIncrease({poxAddress:t,rewardCycle:n,rewardIndex:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u,...l}){const f=await this.getStackingContract();oh({contract:f,poxAddress:t}),sh({contract:f,signerKey:i,signerSignature:o,maxAmount:a,authId:u});const p=this.getStackAggregationIncreaseOptions({contract:f,poxAddress:t,rewardCycle:n,rewardCycleIndex:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u}),m=await vo({...p,...xo(l)});return So({transaction:m,client:this.client})}async revokeDelegateStx(t){typeof t=="string"&&(t={privateKey:t});const r=(await this.getPoxInfo()).contract_id,i=this.getRevokeDelegateStxOptions(r),o=await vo({...i,...xo(t)});return So({transaction:o,client:this.client})}getStackOptions({amountMicroStx:t,poxAddress:n,cycles:r,contract:i,burnBlockHeight:o,signerKey:a,signerSignature:u,maxAmount:l,authId:f}){const p=xi(n),[m,y]=this.parseContractId(i),w=[ft(t),p,ft(o),ft(r)];return a&&l&&typeof f<"u"&&(w.push(u?Xi(kr(rt(u))):Rr()),w.push(kr(rt(a))),w.push(ft(l)),w.push(ft(f))),{client:this.client,contractAddress:m,contractName:y,functionName:"stack-stx",functionArgs:w,validateWithAbi:!0,network:this.network}}getStackExtendOptions({extendCycles:t,poxAddress:n,contract:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u}){const l=xi(n),[f,p]=this.parseContractId(r),m=[ft(t),l];return i&&a&&typeof u<"u"&&(m.push(o?Xi(kr(rt(o))):Rr()),m.push(kr(rt(i))),m.push(ft(a)),m.push(ft(u))),{client:this.client,contractAddress:f,contractName:p,functionName:"stack-extend",functionArgs:m,validateWithAbi:!0,network:this.network}}getStackIncreaseOptions({increaseBy:t,contract:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a}){const[u,l]=this.parseContractId(n),f=[ft(t)];return r&&o&&typeof a<"u"&&(f.push(i?Xi(kr(rt(i))):Rr()),f.push(kr(rt(r))),f.push(ft(o)),f.push(ft(a))),{client:this.client,contractAddress:u,contractName:l,functionName:"stack-increase",functionArgs:f,validateWithAbi:!0,network:this.network}}getDelegateOptions({contract:t,amountMicroStx:n,delegateTo:r,untilBurnBlockHeight:i,poxAddress:o}){const a=o?Xi(xi(o)):Rr(),[u,l]=this.parseContractId(t);return{client:this.client,contractAddress:u,contractName:l,functionName:"delegate-stx",functionArgs:[ft(n),no(r),i?Xi(ft(i)):Rr(),a],validateWithAbi:!0,network:this.network}}getDelegateStackOptions({contract:t,stacker:n,amountMicroStx:r,poxAddress:i,burnBlockHeight:o,cycles:a}){const u=xi(i),[l,f]=this.parseContractId(t);return{client:this.client,contractAddress:l,contractName:f,functionName:"delegate-stack-stx",functionArgs:[no(n),ft(r),u,ft(o),ft(a)],validateWithAbi:!0,network:this.network}}getDelegateStackExtendOptions({contract:t,stacker:n,poxAddress:r,extendCount:i}){const o=xi(r),[a,u]=this.parseContractId(t);return{client:this.client,contractAddress:a,contractName:u,functionName:"delegate-stack-extend",functionArgs:[no(n),o,ft(i)],validateWithAbi:!0,network:this.network}}getDelegateStackIncreaseOptions({contract:t,stacker:n,poxAddress:r,increaseBy:i}){const o=xi(r),[a,u]=this.parseContractId(t);return{client:this.client,contractAddress:a,contractName:u,functionName:"delegate-stack-increase",functionArgs:[no(n),o,ft(i)],validateWithAbi:!0,network:this.network}}getStackAggregationCommitOptions({contract:t,poxAddress:n,rewardCycle:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u}){const l=xi(n),[f,p]=this.parseContractId(t),m=[l,ft(r)];return i&&a&&typeof u<"u"&&(m.push(o?Xi(kr(rt(o))):Rr()),m.push(kr(rt(i))),m.push(ft(a)),m.push(ft(u))),{client:this.client,contractAddress:f,contractName:p,functionName:"stack-aggregation-commit",functionArgs:m,validateWithAbi:!0,network:this.network}}getStackAggregationIncreaseOptions({contract:t,poxAddress:n,rewardCycle:r,rewardCycleIndex:i,signerKey:o,signerSignature:a,maxAmount:u,authId:l}){const f=xi(n),[p,m]=this.parseContractId(t),y=[f,ft(r),ft(i)];return o&&u&&typeof l<"u"&&(y.push(a?Xi(kr(rt(a))):Rr()),y.push(kr(rt(o))),y.push(ft(u)),y.push(ft(l))),{client:this.client,contractAddress:p,contractName:m,functionName:"stack-aggregation-increase",functionArgs:y,validateWithAbi:!0,network:this.network}}getStackAggregationCommitOptionsIndexed({contract:t,poxAddress:n,rewardCycle:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u}){const l=xi(n),[f,p]=this.parseContractId(t),m=[l,ft(r)];return i&&a&&typeof u<"u"&&(m.push(o?Xi(kr(rt(o))):Rr()),m.push(kr(rt(i))),m.push(ft(a)),m.push(ft(u))),{client:this.client,contractAddress:f,contractName:p,functionName:"stack-aggregation-commit-indexed",functionArgs:m,validateWithAbi:!0,network:this.network}}getRevokeDelegateStxOptions(t){const[n,r]=this.parseContractId(t);return{client:this.client,contractAddress:n,contractName:r,functionName:"revoke-delegate-stx",functionArgs:[],validateWithAbi:!0,network:this.network}}async getStatus(){const t=await this.getPoxInfo(),[n,r]=this.parseContractId(t.contract_id),i=await this.getAccountStatus();return ph({contractAddress:n,contractName:r,functionName:"get-stacker-info",senderAddress:this.address,functionArgs:[no(this.address)],client:this.client}).then(a=>{if(a.type===we.OptionalSome){const l=a.value,f=l.value["pox-addr"],p=l.value["first-reward-cycle"],m=l.value["lock-period"],y=f.value.version,w=f.value.hashbytes;return{stacked:!0,details:{first_reward_cycle:Number(p.value),lock_period:Number(m.value),unlock_height:i.unlock_height,pox_address:{version:rt(y.value),hashbytes:rt(w.value)}}}}else{if(a.type===we.OptionalNone)return{stacked:!1};throw new Error("Error fetching stacker info")}})}async getDelegationStatus(){const t=await this.getPoxInfo(),[n,r]=this.parseContractId(t.contract_id);return ph({contractAddress:n,contractName:r,functionName:"get-delegation-info",functionArgs:[no(this.address)],senderAddress:this.address,client:this.client}).then(o=>{if(o.type===we.OptionalSome){const a=o.value,u=a.value["amount-ustx"],l=a.value["delegated-to"],f=zF(a.value["pox-addr"],m=>({version:rt(m.value.version.value)[0],hashbytes:rt(m.value.hashbytes.value)})),p=BQ(a.value["until-burn-ht"]);return{delegated:!0,details:{amount_micro_stx:BigInt(u.value),delegated_to:l.value,pox_address:f,until_burn_ht:p?Number(p.value):void 0}}}else{if(o.type===we.OptionalNone)return{delegated:!1};throw new Error("Error fetching delegation info")}})}async verifySignerKeySignature({topic:t,poxAddress:n,rewardCycle:r,period:i,signerSignature:o,signerKey:a,amount:u,maxAmount:l,authId:f}){const p=await this.getPoxInfo(),[m,y]=this.parseContractId(p.contract_id),w="verify-signer-key-sig",b=[xi(n),ft(r),Qm(t),ft(i),o?Xi(kr(rt(o))):Rr(),kr(rt(a)),ft(u),ft(l),ft(f)];return ph({contractAddress:m,contractName:y,functionName:w,functionArgs:b,senderAddress:this.address,client:this.client}).then(x=>x.type===we.ResponseOk)}async getStackingContract(t){switch(t=t??await this.getPoxOperationInfo(),t.period){case Tl.Period1:return t.pox1.contract_id;case Tl.Period2a:case Tl.Period2b:return t.pox2.contract_id;case Tl.Period3:default:return t.current.contract_id}}modifyLockTxFee({tx:t,amountMicroStx:n}){const r=gK(t.auth);return t.payload.functionArgs[0]=ft(Yt(n)-r),t}parseContractId(t){const n=t.split(".");if(n.length===2&&xf(n[0])&&n[1].startsWith("pox"))return n;throw new Error("Stacking contract ID is malformed")}signPoxSignature({topic:t,poxAddress:n,rewardCycle:r,period:i,signerPrivateKey:o,authId:a,maxAmount:u}){return jQ({topic:t,poxAddress:n,rewardCycle:r,period:i,network:this.network,privateKey:o,maxAmount:u,authId:a})}}function xo(e){return e.senderKey=e.privateKey,delete e.privateKey,e}const DQ="https://browser.blockstack.org/auth",JQ={"@type":"Person","@context":"http://schema.org"},h8=["store_write"],$Q="blockstack-session";class rb{constructor(t=h8.slice(),n=(u=>(u=L_("location",{returnEmptyObject:!0}))==null?void 0:u.origin)(),r="",i="/manifest.json",o=void 0,a=DQ){this.appDomain=n,this.scopes=t,this.redirectPath=r,this.manifestPath=i,this.coreNode=o,this.authenticatorURL=a}redirectURI(){return`${this.appDomain}${this.redirectPath}`}manifestURI(){return`${this.appDomain}${this.manifestPath}`}}var Dd={},vu={},vi={},WF;function ib(){if(WF)return vi;WF=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.decode=vi.encode=vi.unescape=vi.escape=vi.pad=void 0;const e=h_();function t(a){return`${a}${"=".repeat(4-(a.length%4||4))}`}vi.pad=t;function n(a){return a.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}vi.escape=n;function r(a){return t(a).replace(/-/g,"+").replace(/_/g,"/")}vi.unescape=r;function i(a){return n((0,e.fromByteArray)(new TextEncoder().encode(a)))}vi.encode=i;function o(a){return new TextDecoder().decode((0,e.toByteArray)(t(r(a))))}return vi.decode=o,vi}var gx={},Nm={},yx={},VF;function qQ(){return VF||(VF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=uM(),n=zl();class r extends n.Hash{constructor(a,u){super(),this.finished=!1,this.destroyed=!1,(0,t.hash)(a);const l=(0,n.toBytes)(u);if(this.iHash=a.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const f=this.blockLen,p=new Uint8Array(f);p.set(l.length>f?a.create().update(l).digest():l);for(let m=0;mnew r(o,a).update(u).digest();e.hmac=i,e.hmac.create=(o,a)=>new r(o,a)}(yx)),yx}var wx={},GF;function UQ(){return GF||(GF=1,function(e){/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.schnorr=e.verify=e.signSync=e.sign=e.getSharedSecret=e.recoverPublicKey=e.getPublicKey=e.Signature=e.Point=e.CURVE=void 0;const t=h4,n=BigInt(0),r=BigInt(1),i=BigInt(2),o=BigInt(3),a=BigInt(8),u=Object.freeze({a:n,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:r,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});e.CURVE=u;const l=(V,L)=>(V+L/i)/L,f={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(V){const{n:L}=u,G=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),Z=-r*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),de=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),me=G,Te=BigInt("0x100000000000000000000000000000000"),Ae=l(me*V,L),nt=l(-Z*V,L);let ze=oe(V-Ae*G-nt*de,L),st=oe(-Ae*Z-nt*me,L);const ot=ze>Te,Ke=st>Te;if(ot&&(ze=L-ze),Ke&&(st=L-st),ze>Te||st>Te)throw new Error("splitScalarEndo: Endomorphism failed, k="+V);return{k1neg:ot,k1:ze,k2neg:Ke,k2:st}}},p=32,m=32,y=32,w=p+1,b=2*p+1;function x(V){const{a:L,b:G}=u,Z=oe(V*V),de=oe(Z*V);return oe(de+L*V+G)}const _=u.a===n;class O extends Error{constructor(L){super(L)}}function N(V){if(!(V instanceof E))throw new TypeError("JacobianPoint expected")}class E{constructor(L,G,Z){this.x=L,this.y=G,this.z=Z}static fromAffine(L){if(!(L instanceof A))throw new TypeError("JacobianPoint#fromAffine: expected Point");return L.equals(A.ZERO)?E.ZERO:new E(L.x,L.y,r)}static toAffineBatch(L){const G=Xe(L.map(Z=>Z.z));return L.map((Z,de)=>Z.toAffine(G[de]))}static normalizeZ(L){return E.toAffineBatch(L).map(E.fromAffine)}equals(L){N(L);const{x:G,y:Z,z:de}=this,{x:me,y:Te,z:Ae}=L,nt=oe(de*de),ze=oe(Ae*Ae),st=oe(G*ze),ot=oe(me*nt),Ke=oe(oe(Z*Ae)*ze),Et=oe(oe(Te*de)*nt);return st===ot&&Ke===Et}negate(){return new E(this.x,oe(-this.y),this.z)}double(){const{x:L,y:G,z:Z}=this,de=oe(L*L),me=oe(G*G),Te=oe(me*me),Ae=L+me,nt=oe(i*(oe(Ae*Ae)-de-Te)),ze=oe(o*de),st=oe(ze*ze),ot=oe(st-i*nt),Ke=oe(ze*(nt-ot)-a*Te),Et=oe(i*G*Z);return new E(ot,Ke,Et)}add(L){N(L);const{x:G,y:Z,z:de}=this,{x:me,y:Te,z:Ae}=L;if(me===n||Te===n)return this;if(G===n||Z===n)return L;const nt=oe(de*de),ze=oe(Ae*Ae),st=oe(G*ze),ot=oe(me*nt),Ke=oe(oe(Z*Ae)*ze),Et=oe(oe(Te*de)*nt),Ut=oe(ot-st),Lt=oe(Et-Ke);if(Ut===n)return Lt===n?this.double():E.ZERO;const Wn=oe(Ut*Ut),Xn=oe(Ut*Wn),di=oe(st*Wn),Qu=oe(Lt*Lt-Xn-i*di),Yu=oe(Lt*(di-Qu)-Ke*Xn),$o=oe(de*Ae*Ut);return new E(Qu,Yu,$o)}subtract(L){return this.add(L.negate())}multiplyUnsafe(L){const G=E.ZERO;if(typeof L=="bigint"&&L===n)return G;let Z=ge(L);if(Z===r)return this;if(!_){let ot=G,Ke=this;for(;Z>n;)Z&r&&(ot=ot.add(Ke)),Ke=Ke.double(),Z>>=r;return ot}let{k1neg:de,k1:me,k2neg:Te,k2:Ae}=f.splitScalar(Z),nt=G,ze=G,st=this;for(;me>n||Ae>n;)me&r&&(nt=nt.add(st)),Ae&r&&(ze=ze.add(st)),st=st.double(),me>>=r,Ae>>=r;return de&&(nt=nt.negate()),Te&&(ze=ze.negate()),ze=new E(oe(ze.x*f.beta),ze.y,ze.z),nt.add(ze)}precomputeWindow(L){const G=_?128/L+1:256/L+1,Z=[];let de=this,me=de;for(let Te=0;Te>=ot,Ut>nt&&(Ut-=st,L+=r);const Lt=Et,Wn=Et+Math.abs(Ut)-1,Xn=Ke%2!==0,di=Ut<0;Ut===0?Te=Te.add(T(Xn,de[Lt])):me=me.add(T(di,de[Wn]))}return{p:me,f:Te}}multiply(L,G){let Z=ge(L),de,me;if(_){const{k1neg:Te,k1:Ae,k2neg:nt,k2:ze}=f.splitScalar(Z);let{p:st,f:ot}=this.wNAF(Ae,G),{p:Ke,f:Et}=this.wNAF(ze,G);st=T(Te,st),Ke=T(nt,Ke),Ke=new E(oe(Ke.x*f.beta),Ke.y,Ke.z),de=st.add(Ke),me=ot.add(Et)}else{const{p:Te,f:Ae}=this.wNAF(Z,G);de=Te,me=Ae}return E.normalizeZ([de,me])[0]}toAffine(L){const{x:G,y:Z,z:de}=this,me=this.equals(E.ZERO);L==null&&(L=me?a:Ne(de));const Te=L,Ae=oe(Te*Te),nt=oe(Ae*Te),ze=oe(G*Ae),st=oe(Z*nt),ot=oe(de*Te);if(me)return A.ZERO;if(ot!==r)throw new Error("invZ was invalid");return new A(ze,st)}}E.BASE=new E(u.Gx,u.Gy,r),E.ZERO=new E(n,r,n);function T(V,L){const G=L.negate();return V?G:L}const B=new WeakMap;class A{constructor(L,G){this.x=L,this.y=G}_setWindowSize(L){this._WINDOW_SIZE=L,B.delete(this)}hasEvenY(){return this.y%i===n}static fromCompressedHex(L){const G=L.length===32,Z=I(G?L:L.subarray(1));if(!Ct(Z))throw new Error("Point is not on curve");const de=x(Z);let me=ke(de);const Te=(me&r)===r;G?Te&&(me=oe(-me)):(L[0]&1)===1!==Te&&(me=oe(-me));const Ae=new A(Z,me);return Ae.assertValidity(),Ae}static fromUncompressedHex(L){const G=I(L.subarray(1,p+1)),Z=I(L.subarray(p+1,p*2+1)),de=new A(G,Z);return de.assertValidity(),de}static fromHex(L){const G=te(L),Z=G.length,de=G[0];if(Z===p)return this.fromCompressedHex(G);if(Z===w&&(de===2||de===3))return this.fromCompressedHex(G);if(Z===b&&de===4)return this.fromUncompressedHex(G);throw new Error(`Point.fromHex: received invalid point. Expected 32-${w} compressed bytes or ${b} uncompressed bytes, not ${Z}`)}static fromPrivateKey(L){return A.BASE.multiply(hn(L))}static fromSignature(L,G,Z){const{r:de,s:me}=cr(G);if(![0,1,2,3].includes(Z))throw new Error("Cannot recover: invalid recovery bit");const Te=Nt(te(L)),{n:Ae}=u,nt=Z===2||Z===3?de+Ae:de,ze=Ne(nt,Ae),st=oe(-Te*ze,Ae),ot=oe(me*ze,Ae),Ke=Z&1?"03":"02",Et=A.fromHex(Ke+q(nt)),Ut=A.BASE.multiplyAndAddUnsafe(Et,st,ot);if(!Ut)throw new Error("Cannot recover signature: point at infinify");return Ut.assertValidity(),Ut}toRawBytes(L=!1){return X(this.toHex(L))}toHex(L=!1){const G=q(this.x);return L?`${this.hasEvenY()?"02":"03"}${G}`:`04${G}${q(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const L="Point is not on elliptic curve",{x:G,y:Z}=this;if(!Ct(G)||!Ct(Z))throw new Error(L);const de=oe(Z*Z),me=x(G);if(oe(de-me)!==n)throw new Error(L)}equals(L){return this.x===L.x&&this.y===L.y}negate(){return new A(this.x,oe(-this.y))}double(){return E.fromAffine(this).double().toAffine()}add(L){return E.fromAffine(this).add(E.fromAffine(L)).toAffine()}subtract(L){return this.add(L.negate())}multiply(L){return E.fromAffine(this).multiply(L,this).toAffine()}multiplyAndAddUnsafe(L,G,Z){const de=E.fromAffine(this),me=G===n||G===r||this!==A.BASE?de.multiplyUnsafe(G):de.multiply(G),Te=E.fromAffine(L).multiplyUnsafe(Z),Ae=me.add(Te);return Ae.equals(E.ZERO)?void 0:Ae.toAffine()}}e.Point=A,A.BASE=new A(u.Gx,u.Gy),A.ZERO=new A(n,n);function U(V){return Number.parseInt(V[0],16)>=8?"00"+V:V}function v(V){if(V.length<2||V[0]!==2)throw new Error(`Invalid signature integer tag: ${P(V)}`);const L=V[1],G=V.subarray(2,L+2);if(!L||G.length!==L)throw new Error("Invalid signature integer: wrong length");if(G[0]===0&&G[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:I(G),left:V.subarray(L+2)}}function R(V){if(V.length<2||V[0]!=48)throw new Error(`Invalid signature tag: ${P(V)}`);if(V[1]!==V.length-2)throw new Error("Invalid signature: incorrect length");const{data:L,left:G}=v(V.subarray(2)),{data:Z,left:de}=v(G);if(de.length)throw new Error(`Invalid signature: left bytes after parsing: ${P(de)}`);return{r:L,s:Z}}class C{constructor(L,G){this.r=L,this.s=G,this.assertValidity()}static fromCompact(L){const G=L instanceof Uint8Array,Z="Signature.fromCompact";if(typeof L!="string"&&!G)throw new TypeError(`${Z}: Expected string or Uint8Array`);const de=G?P(L):L;if(de.length!==128)throw new Error(`${Z}: Expected 64-byte hex`);return new C(H(de.slice(0,64)),H(de.slice(64,128)))}static fromDER(L){const G=L instanceof Uint8Array;if(typeof L!="string"&&!G)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:Z,s:de}=R(G?L:X(L));return new C(Z,de)}static fromHex(L){return this.fromDER(L)}assertValidity(){const{r:L,s:G}=this;if(!Rt(L))throw new Error("Invalid Signature: r must be 0 < r < n");if(!Rt(G))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const L=u.n>>r;return this.s>L}normalizeS(){return this.hasHighS()?new C(this.r,oe(-this.s,u.n)):this}toDERRawBytes(){return X(this.toDERHex())}toDERHex(){const L=U(Q(this.s)),G=U(Q(this.r)),Z=L.length/2,de=G.length/2,me=Q(Z),Te=Q(de);return`30${Q(de+Z+4)}02${Te}${G}02${me}${L}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return X(this.toCompactHex())}toCompactHex(){return q(this.r)+q(this.s)}}e.Signature=C;function M(...V){if(!V.every(Z=>Z instanceof Uint8Array))throw new Error("Uint8Array list expected");if(V.length===1)return V[0];const L=V.reduce((Z,de)=>Z+de.length,0),G=new Uint8Array(L);for(let Z=0,de=0;ZL.toString(16).padStart(2,"0"));function P(V){if(!(V instanceof Uint8Array))throw new Error("Expected Uint8Array");let L="";for(let G=0;G0)return BigInt(V);if(typeof V=="bigint"&&Rt(V))return V;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function oe(V,L=u.P){const G=V%L;return G>=n?G:L+G}function be(V,L){const{P:G}=u;let Z=V;for(;L-- >n;)Z*=Z,Z%=G;return Z}function ke(V){const{P:L}=u,G=BigInt(6),Z=BigInt(11),de=BigInt(22),me=BigInt(23),Te=BigInt(44),Ae=BigInt(88),nt=V*V*V%L,ze=nt*nt*V%L,st=be(ze,o)*ze%L,ot=be(st,o)*ze%L,Ke=be(ot,i)*nt%L,Et=be(Ke,Z)*Ke%L,Ut=be(Et,de)*Et%L,Lt=be(Ut,Te)*Ut%L,Wn=be(Lt,Ae)*Lt%L,Xn=be(Wn,Te)*Ut%L,di=be(Xn,o)*ze%L,Qu=be(di,me)*Et%L,Yu=be(Qu,G)*nt%L,$o=be(Yu,i);if($o*$o%L!==V)throw new Error("Cannot find square root");return $o}function Ne(V,L=u.P){if(V===n||L<=n)throw new Error(`invert: expected positive integers, got n=${V} mod=${L}`);let G=oe(V,L),Z=L,de=n,me=r;for(;G!==n;){const Ae=Z/G,nt=Z%G,ze=de-me*Ae;Z=G,G=nt,de=me,me=ze}if(Z!==r)throw new Error("invert: does not exist");return oe(de,L)}function Xe(V,L=u.P){const G=new Array(V.length),Z=V.reduce((me,Te,Ae)=>Te===n?me:(G[Ae]=me,oe(me*Te,L)),r),de=Ne(Z,L);return V.reduceRight((me,Te,Ae)=>Te===n?me:(G[Ae]=oe(me*G[Ae],L),oe(me*Te,L)),de),G}function Ze(V){const L=V.length*8-m*8,G=I(V);return L>0?G>>BigInt(L):G}function Nt(V,L=!1){const G=Ze(V);if(L)return G;const{n:Z}=u;return G>=Z?G-Z:G}let nn,kt;class En{constructor(L,G){if(this.hashLen=L,this.qByteLen=G,typeof L!="number"||L<2)throw new Error("hashLen must be a number");if(typeof G!="number"||G<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(L).fill(1),this.k=new Uint8Array(L).fill(0),this.counter=0}hmac(...L){return e.utils.hmacSha256(this.k,...L)}hmacSync(...L){return kt(this.k,...L)}checkSync(){if(typeof kt!="function")throw new O("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(L=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),L),this.v=await this.hmac(this.v),L.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),L),this.v=await this.hmac(this.v))}reseedSync(L=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),L),this.v=this.hmacSync(this.v),L.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),L),this.v=this.hmacSync(this.v))}async generate(){this.incr();let L=0;const G=[];for(;L0)L=BigInt(V);else if(typeof V=="string"){if(V.length!==2*m)throw new Error("Expected 32 bytes of private key");L=H(V)}else if(V instanceof Uint8Array){if(V.length!==m)throw new Error("Expected 32 bytes of private key");L=I(V)}else throw new TypeError("Expected valid private key");if(!Rt(L))throw new Error("Expected private key: 0 < key < n");return L}function An(V){return V instanceof A?(V.assertValidity(),V):A.fromHex(V)}function cr(V){if(V instanceof C)return V.assertValidity(),V;try{return C.fromDER(V)}catch{return C.fromCompact(V)}}function zn(V,L=!1){return A.fromPrivateKey(V).toRawBytes(L)}e.getPublicKey=zn;function qt(V,L,G,Z=!1){return A.fromSignature(V,L,G).toRawBytes(Z)}e.recoverPublicKey=qt;function on(V){const L=V instanceof Uint8Array,G=typeof V=="string",Z=(L||G)&&V.length;return L?Z===w||Z===b:G?Z===w*2||Z===b*2:V instanceof A}function ae(V,L,G=!1){if(on(V))throw new TypeError("getSharedSecret: first arg must be private key");if(!on(L))throw new TypeError("getSharedSecret: second arg must be public key");const Z=An(L);return Z.assertValidity(),Z.multiply(hn(V)).toRawBytes(G)}e.getSharedSecret=ae;function Ee(V){const L=V.length>p?V.slice(0,p):V;return I(L)}function Pe(V){const L=Ee(V),G=oe(L,u.n);return Be(G{V=te(V);const L=m+8;if(V.length1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const G=oe(I(V),u.n-r)+r;return K(G)},randomBytes:(V=32)=>{if(Qe.web)return Qe.web.getRandomValues(new Uint8Array(V));if(Qe.node){const{randomBytes:L}=Qe.node;return Uint8Array.from(L(V))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>e.utils.hashToPrivateKey(e.utils.randomBytes(m+8)),precompute(V=8,L=A.BASE){const G=L===A.BASE?L:new A(L.x,L.y);return G._setWindowSize(V),G.multiply(o),G},sha256:async(...V)=>{if(Qe.web){const L=await Qe.web.subtle.digest("SHA-256",M(...V));return new Uint8Array(L)}else if(Qe.node){const{createHash:L}=Qe.node,G=L("sha256");return V.forEach(Z=>G.update(Z)),Uint8Array.from(G.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(V,...L)=>{if(Qe.web){const G=await Qe.web.subtle.importKey("raw",V,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Z=M(...L),de=await Qe.web.subtle.sign("HMAC",G,Z);return new Uint8Array(de)}else if(Qe.node){const{createHmac:G}=Qe.node,Z=G("sha256",V);return L.forEach(de=>Z.update(de)),Uint8Array.from(Z.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(V,...L)=>{let G=Xt[V];if(G===void 0){const Z=await e.utils.sha256(Uint8Array.from(V,de=>de.charCodeAt(0)));G=M(Z,Z),Xt[V]=G}return e.utils.sha256(G,...L)},taggedHashSync:(V,...L)=>{if(typeof nn!="function")throw new O("sha256Sync is undefined, you need to set it");let G=Xt[V];if(G===void 0){const Z=nn(Uint8Array.from(V,de=>de.charCodeAt(0)));G=M(Z,Z),Xt[V]=G}return nn(G,...L)},_JacobianPoint:E},Object.defineProperties(e.utils,{sha256Sync:{configurable:!1,get(){return nn},set(V){nn||(nn=V)}},hmacSha256Sync:{configurable:!1,get(){return kt},set(V){kt||(kt=V)}}})}(wx)),wx}var Jd={},KF;function HQ(){if(KF)return Jd;KF=1,Object.defineProperty(Jd,"__esModule",{value:!0}),Jd.joseToDer=Jd.derToJose=void 0;const e=h_(),t=ib();function n(_){return(_/8|0)+(_%8===0?0:1)}const r={ES256:n(256),ES384:n(384),ES512:n(521)};function i(_){const O=r[_];if(O)return O;throw new Error(`Unknown algorithm "${_}"`)}const o=128,a=0,u=32,l=16,f=2,p=l|u|a<<6,m=f|a<<6;function y(_){if(_ instanceof Uint8Array)return _;if(typeof _=="string")return(0,e.toByteArray)((0,t.pad)(_));throw new TypeError("ECDSA signature must be a Base64 string or a Uint8Array")}function w(_,O){const N=y(_),E=i(O),T=E+1,B=N.length;let A=0;if(N[A++]!==p)throw new Error('Could not find expected "seq"');let U=N[A++];if(U===(o|1)&&(U=N[A++]),B-A=o&&--E,E}function x(_,O){_=y(_);const N=i(O),E=_.length;if(E!==N*2)throw new TypeError(`"${O}" signatures must be "${N*2}" bytes, saw "${E}"`);const T=b(_,0,N),B=b(_,N,_.length),A=N-T,U=N-B,v=2+A+1+1+U,R=v{const f=e.hmac.create(t.sha256,u);return l.forEach(p=>f.update(p)),f.digest()};class a{static derivePublicKey(l,f=!0){return l.length===66&&(l=l.slice(0,64)),l.length<64&&(l=l.padStart(64,"0")),(0,o.bytesToHex)(n.getPublicKey(l,f))}static signHash(l,f,p="jose"){if(!l||!f)throw new i.MissingParametersError("a signing input hash and private key are all required");const m=n.signSync(l,f.slice(0,64),{der:!0,canonical:!1});if(p==="der")return(0,o.bytesToHex)(m);if(p==="jose")return(0,r.derToJose)(m,"ES256");throw Error("Invalid signature format")}static loadSignature(l){return(0,r.joseToDer)(l,"ES256")}static verifyHash(l,f,p){if(!l||!f||!p)throw new i.MissingParametersError("a signing input hash, der signature, and public key are all required");return n.verify(f,l,p,{strict:!1})}}return Nm.SECP256K1Client=a,a.algorithmName="ES256K",Nm}var XF;function ck(){return XF||(XF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.cryptoClients=e.SECP256K1Client=void 0;const t=zQ();Object.defineProperty(e,"SECP256K1Client",{enumerable:!0,get:function(){return t.SECP256K1Client}});const n={ES256K:t.SECP256K1Client};e.cryptoClients=n}(gx)),gx}var xu={},ZF;function p8(){if(ZF)return xu;ZF=1;var e=xu&&xu.__awaiter||function(i,o,a,u){function l(f){return f instanceof a?f:new a(function(p){p(f)})}return new(a||(a=Promise))(function(f,p){function m(b){try{w(u.next(b))}catch(x){p(x)}}function y(b){try{w(u.throw(b))}catch(x){p(x)}}function w(b){b.done?f(b.value):l(b.value).then(m,y)}w((u=u.apply(i,o||[])).next())})};Object.defineProperty(xu,"__esModule",{value:!0}),xu.hashSha256Async=xu.hashSha256=void 0;const t=Yw();function n(i){return(0,t.sha256)(i)}xu.hashSha256=n;function r(i){return e(this,void 0,void 0,function*(){try{if(typeof crypto<"u"&&typeof crypto.subtle<"u"){const a=typeof i=="string"?new TextEncoder().encode(i):i,u=yield crypto.subtle.digest("SHA-256",a);return new Uint8Array(u)}else{const a=h4;if(!a.createHash)throw new Error("`crypto` module does not contain `createHash`");return Promise.resolve(a.createHash("sha256").update(i).digest())}}catch(o){return console.log(o),console.log('Crypto lib not found. Neither the global `crypto.subtle` Web Crypto API, nor the or the Node.js `require("crypto").createHash` module is available. Falling back to JS implementation.'),Promise.resolve(n(i))}})}return xu.hashSha256Async=r,xu}var e3;function WQ(){if(e3)return vu;e3=1;var e=vu&&vu.__awaiter||function(l,f,p,m){function y(w){return w instanceof p?w:new p(function(b){b(w)})}return new(p||(p=Promise))(function(w,b){function x(N){try{O(m.next(N))}catch(E){b(E)}}function _(N){try{O(m.throw(N))}catch(E){b(E)}}function O(N){N.done?w(N.value):y(N.value).then(x,_)}O((m=m.apply(l,f||[])).next())})};Object.defineProperty(vu,"__esModule",{value:!0}),vu.TokenSigner=vu.createUnsecuredToken=void 0;const t=ib(),n=ck(),r=ob(),i=p8();function o(l,f){const p=[],m=t.encode(JSON.stringify(f));p.push(m);const y=t.encode(JSON.stringify(l));return p.push(y),p.join(".")}function a(l){return o(l,{typ:"JWT",alg:"none"})+"."}vu.createUnsecuredToken=a;class u{constructor(f,p){if(!(f&&p))throw new r.MissingParametersError("a signing algorithm and private key are required");if(typeof f!="string")throw new Error("signing algorithm parameter must be a string");if(f=f.toUpperCase(),!n.cryptoClients.hasOwnProperty(f))throw new Error("invalid signing algorithm");this.tokenType="JWT",this.cryptoClient=n.cryptoClients[f],this.rawPrivateKey=p}header(f={}){const p={typ:this.tokenType,alg:this.cryptoClient.algorithmName};return Object.assign({},p,f)}sign(f,p=!1,m={}){const y=this.header(m),w=o(f,y),b=(0,i.hashSha256)(w);return this.createWithSignedHash(f,p,y,w,b)}signAsync(f,p=!1,m={}){return e(this,void 0,void 0,function*(){const y=this.header(m),w=o(f,y),b=yield(0,i.hashSha256Async)(w);return this.createWithSignedHash(f,p,y,w,b)})}createWithSignedHash(f,p,m,y,w){const b=this.cryptoClient.signHash(w,this.rawPrivateKey);return p?{header:[t.encode(JSON.stringify(m))],payload:JSON.stringify(f),signature:[b]}:[y,b].join(".")}}return vu.TokenSigner=u,vu}var Cm={},t3;function VQ(){if(t3)return Cm;t3=1,Object.defineProperty(Cm,"__esModule",{value:!0}),Cm.TokenVerifier=void 0;const e=ib(),t=ck(),n=ob(),r=p8();class i{constructor(a,u){if(!(a&&u))throw new n.MissingParametersError("a signing algorithm and public key are required");if(typeof a!="string")throw"signing algorithm parameter must be a string";if(a=a.toUpperCase(),!t.cryptoClients.hasOwnProperty(a))throw"invalid signing algorithm";this.tokenType="JWT",this.cryptoClient=t.cryptoClients[a],this.rawPublicKey=u}verify(a){return typeof a=="string"?this.verifyCompact(a,!1):typeof a=="object"?this.verifyExpanded(a,!1):!1}verifyAsync(a){return typeof a=="string"?this.verifyCompact(a,!0):typeof a=="object"?this.verifyExpanded(a,!0):Promise.resolve(!1)}verifyCompact(a,u){const l=a.split("."),f=l[0]+"."+l[1],p=m=>{const y=this.cryptoClient.loadSignature(l[2]);return this.cryptoClient.verifyHash(m,y,this.rawPublicKey)};if(u)return(0,r.hashSha256Async)(f).then(m=>p(m));{const m=(0,r.hashSha256)(f);return p(m)}}verifyExpanded(a,u){const l=[a.header.join("."),e.encode(a.payload)].join(".");let f=!0;const p=m=>(a.signature.map(y=>{const w=this.cryptoClient.loadSignature(y);this.cryptoClient.verifyHash(m,w,this.rawPublicKey)||(f=!1)}),f);if(u)return(0,r.hashSha256Async)(l).then(m=>p(m));{const m=(0,r.hashSha256)(l);return p(m)}}}return Cm.TokenVerifier=i,Cm}var Em={},n3;function GQ(){if(n3)return Em;n3=1,Object.defineProperty(Em,"__esModule",{value:!0}),Em.decodeToken=void 0;const e=ib();function t(n){if(typeof n=="string"){const r=n.split("."),i=JSON.parse(e.decode(r[0])),o=JSON.parse(e.decode(r[1])),a=r[2];return{header:i,payload:o,signature:a}}else if(typeof n=="object"){if(typeof n.payload!="string")throw new Error("Expected token payload to be a base64 or json string");let r=n.payload;n.payload[0]!=="{"&&(r=e.decode(r));const i=[];return n.header.map(o=>{const a=JSON.parse(e.decode(o));i.push(a)}),{header:i,payload:JSON.parse(r),signature:n.signature}}}return Em.decodeToken=t,Em}var r3;function KQ(){return r3||(r3=1,function(e){var t=Dd&&Dd.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(i,o);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,a,u)}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=Dd&&Dd.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(WQ(),e),n(VQ(),e),n(GQ(),e),n(ob(),e),n(ck(),e)}(Dd)),Dd}var Er=KQ();function QQ(e){return`did:btc-addr:${e}`}function YQ(e){const t=e.split(":");if(t.length!==3)throw new JA("Decentralized IDs must have 3 parts");if(t[0].toLowerCase()!=="did")throw new JA('Decentralized IDs must start with "did"');return t[1].toLowerCase()}function m8(e){if(e)return YQ(e)==="btc-addr"?e.split(":")[2]:void 0}const XQ="1.4.0";function ZQ(){return lQ()}function eY(e,t,n,r=h8.slice(),i,o=Nz().getTime(),a={}){const u=w=>{const b=L_("location",{throwIfUnavailable:!0,usageDesc:`makeAuthRequest([${w}=undefined])`});return b==null?void 0:b.origin};t||(t=`${u("redirectURI")}/`),n||(n=`${u("manifestURI")}/manifest.json`),i||(i=u("appDomain"));const l=Object.assign({},a,{jti:Ez(),iat:Math.floor(new Date().getTime()/1e3),exp:Math.floor(o/1e3),iss:null,public_keys:[],domain_name:i,manifest_uri:n,redirect_uri:t,version:XQ,do_not_include_profile:!0,supports_hub_url:!0,scopes:r}),f=Er.SECP256K1Client.derivePublicKey(e);l.public_keys=[f];const p=r8(f);return l.iss=QQ(p),new Er.TokenSigner("ES256k",e).sign(l)}async function i3(e,t){const n=Eg(rt(t)),r=JSON.parse(n),i=await l8(e,r);if(typeof i!="string")throw new Error("Unable to correctly decrypt private key");return i}function tY(e){const t=Er.decodeToken(e).payload;if(typeof t=="string")throw new Error("Unexpected token payload type of string");const n=t.public_keys;if(n.length===1){const r=n[0];try{return new Er.TokenVerifier("ES256k",r).verify(e)}catch{return!1}}else throw new Error("Multiple public keys are not supported")}function nY(e){const t=Er.decodeToken(e).payload;if(typeof t=="string")throw new Error("Unexpected token payload type of string");const n=t.public_keys,r=m8(t.iss);if(n.length===1){if(r8(n[0])===r)return!0}else throw new Error("Multiple public keys are not supported");return!1}function rY(e){const t=Er.decodeToken(e).payload;if(typeof t=="string")throw new Error("Unexpected token payload type of string");if(t.iat){if(typeof t.iat!="number")return!1;const n=new Date(t.iat*1e3);return!(new Date().getTime()n.getTime())}else return!0}async function oY(e){return(await Promise.all([iY(e),rY(e),tY(e),nY(e)])).every(n=>n)}const o3="1.0.0";class Il{constructor(t){this.version=o3,this.userData=t.userData,this.transitKey=t.transitKey,this.etags=t.etags?t.etags:{}}static fromJSON(t){if(t.version!==o3)throw new f1(`JSON data version ${t.version} not supported by SessionData`);const n={coreNode:t.coreNode,userData:t.userData,transitKey:t.transitKey,etags:t.etags};return new Il(n)}toString(){return JSON.stringify(this)}}class g8{constructor(t){if(t){const n=new Il(t);this.setSessionData(n)}}getSessionData(){throw new Error("Abstract class")}setSessionData(t){throw new Error("Abstract class")}deleteSessionData(){throw new Error("Abstract class")}}class s3 extends g8{constructor(t){super(t),this.sessionData||this.setSessionData(new Il({}))}getSessionData(){if(!this.sessionData)throw new NP("No session data was found.");return this.sessionData}setSessionData(t){return this.sessionData=t,!0}deleteSessionData(){return this.setSessionData(new Il({})),!0}}class a3 extends g8{constructor(t){if(super(t),t&&t.storeOptions&&t.storeOptions.localStorageKey&&typeof t.storeOptions.localStorageKey=="string"?this.key=t.storeOptions.localStorageKey:this.key=$Q,!localStorage.getItem(this.key)){const r=new Il({});this.setSessionData(r)}}getSessionData(){const t=localStorage.getItem(this.key);if(!t)throw new NP("No session data was found in localStorage");const n=JSON.parse(t);return Il.fromJSON(n)}setSessionData(t){return localStorage.setItem(this.key,t.toString()),!0}deleteSessionData(){return localStorage.removeItem(this.key),this.setSessionData(new Il({})),!0}}function sY(e,t){const n=Er.decodeToken(e),r=n.payload;if(typeof r=="string")throw new Error("Unexpected token payload type of string");if(r.hasOwnProperty("subject")&&r.subject){if(!r.subject.hasOwnProperty("publicKey"))throw new Error("Token doesn't have a subject public key")}else throw new Error("Token doesn't have a subject");if(r.hasOwnProperty("issuer")&&r.issuer){if(!r.issuer.hasOwnProperty("publicKey"))throw new Error("Token doesn't have an issuer public key")}else throw new Error("Token doesn't have an issuer");if(!r.hasOwnProperty("claim"))throw new Error("Token doesn't have a claim");const i=r.issuer.publicKey,o=eK(i);if(t!==i){if(t!==o)throw new Error("Token issuer public key does not match the verifying value")}const a=new Er.TokenVerifier(n.header.alg,i);if(!a)throw new Error("Invalid token verifier");if(!a.verify(e))throw new Error("Token verification failed");return n}function aY(e,t=null){let n;t?n=sY(e,t):n=Er.decodeToken(e);let r={};if(n.hasOwnProperty("payload")){const i=n.payload;if(typeof i=="string")throw new Error("Unexpected token payload type of string");i.hasOwnProperty("claim")&&(r=i.claim)}return r}const c3="_blockstackDidCheckEchoReply",cY="echoReply",uY="authContinuation";function lY(e){return e?(/^[?#]/.test(e)?e.slice(1):e).split("&").reduce((n,r)=>{const[i,o]=r.split("=");return n[i]=o?decodeURIComponent(o.replace(/\+/g," ")):"",n},{}):{}}function dY(){let e;if(typeof self<"u")e=self;else if(typeof window<"u")e=window;else return!1;if(!e.location||!e.localStorage)return!1;const t=e[c3];if(typeof t=="boolean")return t;const n=lY(e.location.search),r=n[cY];if(r){e[c3]=!0;const i=`echo-reply-${r}`;return e.localStorage.setItem(i,"success"),e.setTimeout(()=>{const o=n[uY];e.location.href=o},10),!0}return!1}class hg{constructor(t){let n=!0;if(typeof window>"u"&&typeof self>"u"&&(n=!1),t&&t.appConfig)this.appConfig=t.appConfig;else if(n)this.appConfig=new rb;else throw new Oz("You need to specify options.appConfig");t&&t.sessionStore?this.store=t.sessionStore:n?t?this.store=new a3(t.sessionOptions):this.store=new a3:t?this.store=new s3(t.sessionOptions):this.store=new s3}makeAuthRequestToken(t,n,r,i,o,a=Cz().getTime(),u={}){const l=this.appConfig;if(!l)throw new f1("Missing AppConfig");return t=t||this.generateAndStoreTransitKey(),n=n||l.redirectURI(),r=r||l.manifestURI(),i=i||l.scopes,o=o||l.appDomain,eY(t,n,r,i,o,a,u)}generateAndStoreTransitKey(){const t=this.store.getSessionData(),n=ZQ();return t.transitKey=n,this.store.setSessionData(t),n}getAuthResponseToken(){var r;const t=(r=L_("location",{throwIfUnavailable:!0,usageDesc:"getAuthResponseToken"}))==null?void 0:r.search;return new URLSearchParams(t).get("authResponse")??""}isSignInPending(){try{if(dY())return wh.info("protocolEchoReply detected from isSignInPending call, the page is about to redirect."),!0}catch(t){wh.error(`Error checking for protocol echo reply isSignInPending: ${t}`)}return!!this.getAuthResponseToken()}isUserSignedIn(){return!!this.store.getSessionData().userData}async handlePendingSignIn(t=this.getAuthResponseToken(),n=PP()){const r=this.store.getSessionData();if(r.userData)throw new u0("Existing user session found.");const i=this.store.getSessionData().transitKey;this.appConfig&&this.appConfig.coreNode;const o=Er.decodeToken(t).payload;if(typeof o=="string")throw new Error("Unexpected token payload type of string");if(!await oY(t))throw new u0("Invalid authentication response.");let u=o.private_key,l=o.core_token;if(Yv(o.version,"1.1.0"))if(i!==void 0&&i!=null){if(o.private_key!==void 0&&o.private_key!==null)try{u=await i3(i,o.private_key)}catch{if(wh.warn("Failed decryption of appPrivateKey, will try to use as given"),!ri.isValidPrivateKey(o.private_key))throw new u0("Failed decrypting appPrivateKey. Usually means that the transit key has changed during login.")}if(l!=null)try{l=await i3(i,l)}catch{wh.info("Failed decryption of coreSessionToken, will try to use as given")}}else throw new u0("Authenticating with protocol > 1.1.0 requires transit key, and none found.");let f=qz,p;Yv(o.version,"1.2.0")&&o.hubUrl!==null&&o.hubUrl!==void 0&&(f=o.hubUrl),Yv(o.version,"1.3.0")&&o.associationToken!==null&&o.associationToken!==void 0&&(p=o.associationToken);const m={profile:o.profile,email:o.email,decentralizedID:o.iss,identityAddress:m8(o.iss),appPrivateKey:u,coreSessionToken:l,authResponseToken:t,hubUrl:f,appPrivateKeyFromWalletSalt:o.appPrivateKeyFromWalletSalt,coreNode:o.blockstackAPIUrl,gaiaAssociationToken:p},y=o.profile_url;if(!m.profile&&y){const w=await n(y);if(!w.ok)m.profile=Object.assign({},JQ);else{const b=await w.text(),x=JSON.parse(b);m.profile=aY(x[0].token)}}else m.profile=o.profile;return r.userData=m,this.store.setSessionData(r),m}loadUserData(){const t=this.store.getSessionData().userData;if(!t)throw new f1("No user data found. Did the user sign in?");return t}encryptContent(t,n){const r=Object.assign({},n);return r.privateKey||(r.privateKey=this.loadUserData().appPrivateKey),TQ(t,r)}decryptContent(t,n){const r=Object.assign({},n);return r.privateKey||(r.privateKey=this.loadUserData().appPrivateKey),OQ(t,r)}signUserOut(t){this.store.deleteSessionData(),t&&typeof location<"u"&&location.href&&(location.href=t)}}hg.prototype.makeAuthRequest=hg.prototype.makeAuthRequestToken;const fY=()=>typeof window>"u"?[]:window.webbtc_stx_providers?window.webbtc_stx_providers:[],hY=(e=[])=>{if(typeof window>"u")return[];const t=fY(),n=e.filter(r=>t.find(o=>o.id===r.id)?!1:!!y8(r.id));return t.concat(n)},y8=e=>e==null?void 0:e.split(".").reduce((t,n)=>t==null?void 0:t[n],window),uk="STX_PROVIDER",w8=()=>typeof window>"u"?null:window.localStorage.getItem(uk),tle=e=>{typeof window<"u"&&window.localStorage.setItem(uk,e)},pY=()=>{typeof window<"u"&&window.localStorage.removeItem(uk)};var bx={},u3;function mY(){return u3||(u3=1,function(){(function(e){(function(t){var n={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};function r(R){return R&&DataView.prototype.isPrototypeOf(R)}if(n.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(R){return R&&i.indexOf(Object.prototype.toString.call(R))>-1};function a(R){if(typeof R!="string"&&(R=String(R)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(R))throw new TypeError("Invalid character in header field name");return R.toLowerCase()}function u(R){return typeof R!="string"&&(R=String(R)),R}function l(R){var C={next:function(){var M=R.shift();return{done:M===void 0,value:M}}};return n.iterable&&(C[Symbol.iterator]=function(){return C}),C}function f(R){this.map={},R instanceof f?R.forEach(function(C,M){this.append(M,C)},this):Array.isArray(R)?R.forEach(function(C){this.append(C[0],C[1])},this):R&&Object.getOwnPropertyNames(R).forEach(function(C){this.append(C,R[C])},this)}f.prototype.append=function(R,C){R=a(R),C=u(C);var M=this.map[R];this.map[R]=M?M+", "+C:C},f.prototype.delete=function(R){delete this.map[a(R)]},f.prototype.get=function(R){return R=a(R),this.has(R)?this.map[R]:null},f.prototype.has=function(R){return this.map.hasOwnProperty(a(R))},f.prototype.set=function(R,C){this.map[a(R)]=u(C)},f.prototype.forEach=function(R,C){for(var M in this.map)this.map.hasOwnProperty(M)&&R.call(C,this.map[M],M,this)},f.prototype.keys=function(){var R=[];return this.forEach(function(C,M){R.push(M)}),l(R)},f.prototype.values=function(){var R=[];return this.forEach(function(C){R.push(C)}),l(R)},f.prototype.entries=function(){var R=[];return this.forEach(function(C,M){R.push([M,C])}),l(R)},n.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function p(R){if(R.bodyUsed)return Promise.reject(new TypeError("Already read"));R.bodyUsed=!0}function m(R){return new Promise(function(C,M){R.onload=function(){C(R.result)},R.onerror=function(){M(R.error)}})}function y(R){var C=new FileReader,M=m(C);return C.readAsArrayBuffer(R),M}function w(R){var C=new FileReader,M=m(C);return C.readAsText(R),M}function b(R){for(var C=new Uint8Array(R),M=new Array(C.length),J=0;J-1?C:R}function E(R,C){C=C||{};var M=C.body;if(R instanceof E){if(R.bodyUsed)throw new TypeError("Already read");this.url=R.url,this.credentials=R.credentials,C.headers||(this.headers=new f(R.headers)),this.method=R.method,this.mode=R.mode,this.signal=R.signal,!M&&R._bodyInit!=null&&(M=R._bodyInit,R.bodyUsed=!0)}else this.url=String(R);if(this.credentials=C.credentials||this.credentials||"same-origin",(C.headers||!this.headers)&&(this.headers=new f(C.headers)),this.method=N(C.method||this.method||"GET"),this.mode=C.mode||this.mode||null,this.signal=C.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&M)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(M)}E.prototype.clone=function(){return new E(this,{body:this._bodyInit})};function T(R){var C=new FormData;return R.trim().split("&").forEach(function(M){if(M){var J=M.split("="),P=J.shift().replace(/\+/g," "),D=J.join("=").replace(/\+/g," ");C.append(decodeURIComponent(P),decodeURIComponent(D))}}),C}function B(R){var C=new f,M=R.replace(/\r?\n[\t ]+/g," ");return M.split(/\r?\n/).forEach(function(J){var P=J.split(":"),D=P.shift().trim();if(D){var q=P.join(":").trim();C.append(D,q)}}),C}_.call(E.prototype);function A(R,C){C||(C={}),this.type="default",this.status=C.status===void 0?200:C.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in C?C.statusText:"OK",this.headers=new f(C.headers),this.url=C.url||"",this._initBody(R)}_.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},A.error=function(){var R=new A(null,{status:0,statusText:""});return R.type="error",R};var U=[301,302,303,307,308];A.redirect=function(R,C){if(U.indexOf(C)===-1)throw new RangeError("Invalid status code");return new A(null,{status:C,headers:{location:R}})},t.DOMException=e.DOMException;try{new t.DOMException}catch{t.DOMException=function(C,M){this.message=C,this.name=M;var J=Error(C);this.stack=J.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function v(R,C){return new Promise(function(M,J){var P=new E(R,C);if(P.signal&&P.signal.aborted)return J(new t.DOMException("Aborted","AbortError"));var D=new XMLHttpRequest;function q(){D.abort()}D.onload=function(){var K={status:D.status,statusText:D.statusText,headers:B(D.getAllResponseHeaders()||"")};K.url="responseURL"in D?D.responseURL:K.headers.get("X-Request-URL");var Q="response"in D?D.response:D.responseText;M(new A(Q,K))},D.onerror=function(){J(new TypeError("Network request failed"))},D.ontimeout=function(){J(new TypeError("Network request failed"))},D.onabort=function(){J(new t.DOMException("Aborted","AbortError"))},D.open(P.method,P.url,!0),P.credentials==="include"?D.withCredentials=!0:P.credentials==="omit"&&(D.withCredentials=!1),"responseType"in D&&n.blob&&(D.responseType="blob"),P.headers.forEach(function(K,Q){D.setRequestHeader(Q,K)}),P.signal&&(P.signal.addEventListener("abort",q),D.onreadystatechange=function(){D.readyState===4&&P.signal.removeEventListener("abort",q)}),D.send(typeof P._bodyInit>"u"?null:P._bodyInit)})}return v.polyfill=!0,e.fetch||(e.fetch=v,e.Headers=f,e.Request=E,e.Response=A),t.Headers=f,t.Request=E,t.Response=A,t.fetch=v,Object.defineProperty(t,"__esModule",{value:!0}),t})({})})(typeof self<"u"?self:bx)}()),bx}mY();const gY={referrerPolicy:"origin",headers:{"x-hiro-product":"stacksjs"}};async function yY(e,t){const n={};return Object.assign(n,gY,t),await fetch(e,n)}function wY(e){let t=yY,n=[];return e.length>0&&typeof e[0]=="function"&&(t=e.shift()),e.length>0&&(n=e),{fetchLib:t,middlewares:n}}function bY(...e){const{fetchLib:t,middlewares:n}=wY(e);return async(i,o)=>{let a={url:i,init:o??{}};for(const l of n)typeof l.pre=="function"&&(a=await Promise.resolve(l.pre({fetch:t,...a}))??a);let u=await t(a.url,a.init);for(const l of n)typeof l.post=="function"&&(u=await Promise.resolve(l.post({fetch:t,url:a.url,init:a.init,response:(u==null?void 0:u.clone())??u}))??u);return u}}function SY(e,t,n){return dk(b8(e),n)}function b8(e,t){let n=e;if(typeof n=="number"){if(!Number.isInteger(n))throw new RangeError("Invalid value. Values of type 'number' must be an integer.");if(n>Number.MAX_SAFE_INTEGER)throw new RangeError(`Invalid value. Values of type 'number' must be less than or equal to ${Number.MAX_SAFE_INTEGER}. For larger values, try using a BigInt instead.`);return BigInt(n)}if(typeof n=="string")if(n.toLowerCase().startsWith("0x")){let r=n.slice(2);r=r.padStart(r.length+r.length%2,"0"),n=pg(r)}else try{return BigInt(n)}catch(r){if(r instanceof SyntaxError)throw new RangeError(`Invalid value. String integer '${n}' is not finite.`)}if(typeof n=="bigint")return n;if(n instanceof Uint8Array)return BigInt(`0x${_Y(n)}`);if(n!=null&&typeof n=="object"&&n.constructor.name==="BN")return BigInt(n.toString());throw new TypeError("Invalid value type. Must be a number, bigint, integer-string, hex-string, or Uint8Array.")}function lk(e,t=8){return(typeof e=="bigint"?e:b8(e)).toString(16).padStart(t*2,"0")}function dk(e,t=16){const n=lk(e,t);return pg(n)}function vY(e,t){if(e<-(BigInt(1)<=BigInt(0)?BigInt(e):e+(BigInt(1)<t.toString(16).padStart(2,"0"));function _Y(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(const n of e)t+=xY[n];return t}function pg(e){if(typeof e!="string")throw new TypeError(`hexToBytes: expected string, got ${typeof e}`);e=e.startsWith("0x")||e.startsWith("0X")?e.slice(2):e;const t=e.length%2?`0${e}`:e,n=new Uint8Array(t.length/2);for(let r=0;r255}function l3(e){if(e.some(RY))throw new Error("Some values are invalid bytes.");return new Uint8Array(e)}function hk(...e){if(!e.every(r=>r instanceof Uint8Array))throw new Error("Uint8Array list expected");if(e.length===1)return e[0];const t=e.reduce((r,i)=>r+i.length,0),n=new Uint8Array(t);for(let r=0,i=0;rtypeof t=="number"?l3([t]):t instanceof Array?l3(t):t))}var Kh;(function(e){e[e.Testnet=2147483648]="Testnet",e[e.Mainnet=1]="Mainnet"})(Kh||(Kh={}));var mf;(function(e){e[e.Mainnet=0]="Mainnet",e[e.Testnet=128]="Testnet"})(mf||(mf={}));var d3;(function(e){e[e.Mainnet=385875968]="Mainnet",e[e.Testnet=4278190080]="Testnet"})(d3||(d3={}));function sb(e,t,n=0){return e[n+3]=t,t>>>=8,e[n+2]=t,t>>>=8,e[n+1]=t,t>>>=8,e[n]=t,e}const TY="https://api.mainnet.hiro.so",OY="https://api.testnet.hiro.so",NY="http://localhost:3999",CY=["mainnet","testnet","devnet","mocknet"];class gf{constructor(t){this.version=mf.Mainnet,this.chainId=Kh.Mainnet,this.bnsLookupUrl="https://api.mainnet.hiro.so",this.broadcastEndpoint="/v2/transactions",this.transferFeeEstimateEndpoint="/v2/fees/transfer",this.transactionFeeEstimateEndpoint="/v2/fees/transaction",this.accountEndpoint="/v2/accounts",this.contractAbiEndpoint="/v2/contracts/interface",this.readOnlyFunctionCallEndpoint="/v2/contracts/call-read",this.isMainnet=()=>this.version===mf.Mainnet,this.getBroadcastApiUrl=()=>`${this.coreApiUrl}${this.broadcastEndpoint}`,this.getTransferFeeEstimateApiUrl=()=>`${this.coreApiUrl}${this.transferFeeEstimateEndpoint}`,this.getTransactionFeeEstimateApiUrl=()=>`${this.coreApiUrl}${this.transactionFeeEstimateEndpoint}`,this.getAccountApiUrl=n=>`${this.coreApiUrl}${this.accountEndpoint}/${n}?proof=0`,this.getAccountExtendedBalancesApiUrl=n=>`${this.coreApiUrl}/extended/v1/address/${n}/balances`,this.getAbiApiUrl=(n,r)=>`${this.coreApiUrl}${this.contractAbiEndpoint}/${n}/${r}`,this.getReadOnlyFunctionCallApiUrl=(n,r,i)=>`${this.coreApiUrl}${this.readOnlyFunctionCallEndpoint}/${n}/${r}/${encodeURIComponent(i)}`,this.getInfoUrl=()=>`${this.coreApiUrl}/v2/info`,this.getBlockTimeInfoUrl=()=>`${this.coreApiUrl}/extended/v1/info/network_block_times`,this.getPoxInfoUrl=()=>`${this.coreApiUrl}/v2/pox`,this.getRewardsUrl=(n,r)=>{let i=`${this.coreApiUrl}/extended/v1/burnchain/rewards/${n}`;return r&&(i=`${i}?limit=${r.limit}&offset=${r.offset}`),i},this.getRewardsTotalUrl=n=>`${this.coreApiUrl}/extended/v1/burnchain/rewards/${n}/total`,this.getRewardHoldersUrl=(n,r)=>{let i=`${this.coreApiUrl}/extended/v1/burnchain/reward_slot_holders/${n}`;return r&&(i=`${i}?limit=${r.limit}&offset=${r.offset}`),i},this.getStackerInfoUrl=(n,r)=>`${this.coreApiUrl}${this.readOnlyFunctionCallEndpoint} + ${n}/${r}/get-stacker-info`,this.getDataVarUrl=(n,r,i)=>`${this.coreApiUrl}/v2/data_var/${n}/${r}/${i}?proof=0`,this.getMapEntryUrl=(n,r,i)=>`${this.coreApiUrl}/v2/map_entry/${n}/${r}/${i}?proof=0`,this.coreApiUrl=t.url,this.fetchFn=t.fetchFn??bY()}getNameInfo(t){const n=`${this.bnsLookupUrl}/v1/names/${t}`;return this.fetchFn(n).then(r=>{if(r.status===404)throw new Error("Name not found");if(r.status!==200)throw new Error(`Bad response status: ${r.status}`);return r.json()}).then(r=>r.address?Object.assign({},r,{address:r.address}):r)}}gf.fromName=e=>{switch(e){case"mainnet":return new I1;case"testnet":return new P1;case"devnet":return new EY;case"mocknet":return new S8;default:throw new Error(`Invalid network name provided. Must be one of the following: ${CY.join(", ")}`)}};gf.fromNameOrNetwork=e=>typeof e!="string"&&"version"in e?e:gf.fromName(e);class I1 extends gf{constructor(t){super({url:(t==null?void 0:t.url)??TY,fetchFn:t==null?void 0:t.fetchFn}),this.version=mf.Mainnet,this.chainId=Kh.Mainnet}}class P1 extends gf{constructor(t){super({url:(t==null?void 0:t.url)??OY,fetchFn:t==null?void 0:t.fetchFn}),this.version=mf.Testnet,this.chainId=Kh.Testnet}}class S8 extends gf{constructor(t){super({url:(t==null?void 0:t.url)??NY,fetchFn:t==null?void 0:t.fetchFn}),this.version=mf.Testnet,this.chainId=Kh.Testnet}}const EY=S8;var M1;(function(e){e[e.Testnet=2147483648]="Testnet",e[e.Mainnet=1]="Mainnet"})(M1||(M1={}));M1.Mainnet;const AY=128,FY=128,v8=16;var L1;(function(e){e[e.Address=0]="Address",e[e.Principal=1]="Principal",e[e.LengthPrefixedString=2]="LengthPrefixedString",e[e.MemoString=3]="MemoString",e[e.AssetInfo=4]="AssetInfo",e[e.PostCondition=5]="PostCondition",e[e.PublicKey=6]="PublicKey",e[e.LengthPrefixedList=7]="LengthPrefixedList",e[e.Payload=8]="Payload",e[e.MessageSignature=9]="MessageSignature",e[e.StructuredDataSignature=10]="StructuredDataSignature",e[e.TransactionAuthField=11]="TransactionAuthField"})(L1||(L1={}));var f3;(function(e){e[e.TokenTransfer=0]="TokenTransfer",e[e.SmartContract=1]="SmartContract",e[e.VersionedSmartContract=6]="VersionedSmartContract",e[e.ContractCall=2]="ContractCall",e[e.PoisonMicroblock=3]="PoisonMicroblock",e[e.Coinbase=4]="Coinbase",e[e.CoinbaseToAltRecipient=5]="CoinbaseToAltRecipient",e[e.TenureChange=7]="TenureChange",e[e.NakamotoCoinbase=8]="NakamotoCoinbase"})(f3||(f3={}));var h3;(function(e){e[e.Clarity1=1]="Clarity1",e[e.Clarity2=2]="Clarity2",e[e.Clarity3=3]="Clarity3"})(h3||(h3={}));var Ro;(function(e){e[e.OnChainOnly=1]="OnChainOnly",e[e.OffChainOnly=2]="OffChainOnly",e[e.Any=3]="Any"})(Ro||(Ro={}));const Sx=["onChainOnly","offChainOnly","any"];Sx[0]+"",Ro.OnChainOnly,Sx[1]+"",Ro.OffChainOnly,Sx[2]+"",Ro.Any,Ro.OnChainOnly+"",Ro.OnChainOnly,Ro.OffChainOnly+"",Ro.OffChainOnly,Ro.Any+"",Ro.Any;var B1;(function(e){e[e.Mainnet=0]="Mainnet",e[e.Testnet=128]="Testnet"})(B1||(B1={}));B1.Mainnet;var p3;(function(e){e[e.Allow=1]="Allow",e[e.Deny=2]="Deny"})(p3||(p3={}));var Qd;(function(e){e[e.STX=0]="STX",e[e.Fungible=1]="Fungible",e[e.NonFungible=2]="NonFungible"})(Qd||(Qd={}));var m3;(function(e){e[e.Standard=4]="Standard",e[e.Sponsored=5]="Sponsored"})(m3||(m3={}));var g3;(function(e){e[e.SerializeP2PKH=0]="SerializeP2PKH",e[e.SerializeP2SH=1]="SerializeP2SH",e[e.SerializeP2WPKH=2]="SerializeP2WPKH",e[e.SerializeP2WSH=3]="SerializeP2WSH",e[e.SerializeP2SHNonSequential=5]="SerializeP2SHNonSequential",e[e.SerializeP2WSHNonSequential=7]="SerializeP2WSHNonSequential"})(g3||(g3={}));var y3;(function(e){e[e.MainnetSingleSig=22]="MainnetSingleSig",e[e.MainnetMultiSig=20]="MainnetMultiSig",e[e.TestnetSingleSig=26]="TestnetSingleSig",e[e.TestnetMultiSig=21]="TestnetMultiSig"})(y3||(y3={}));var w3;(function(e){e[e.Compressed=0]="Compressed",e[e.Uncompressed=1]="Uncompressed"})(w3||(w3={}));var b3;(function(e){e[e.Equal=1]="Equal",e[e.Greater=2]="Greater",e[e.GreaterEqual=3]="GreaterEqual",e[e.Less=4]="Less",e[e.LessEqual=5]="LessEqual"})(b3||(b3={}));var S3;(function(e){e[e.Sends=16]="Sends",e[e.DoesNotSend=17]="DoesNotSend"})(S3||(S3={}));var j1;(function(e){e[e.Origin=1]="Origin",e[e.Standard=2]="Standard",e[e.Contract=3]="Contract"})(j1||(j1={}));var v3;(function(e){e[e.STX=0]="STX",e[e.Fungible=1]="Fungible",e[e.NonFungible=2]="NonFungible"})(v3||(v3={}));var x3;(function(e){e.Serialization="Serialization",e.Deserialization="Deserialization",e.SignatureValidation="SignatureValidation",e.FeeTooLow="FeeTooLow",e.BadNonce="BadNonce",e.NotEnoughFunds="NotEnoughFunds",e.NoSuchContract="NoSuchContract",e.NoSuchPublicFunction="NoSuchPublicFunction",e.BadFunctionArgument="BadFunctionArgument",e.ContractAlreadyExists="ContractAlreadyExists",e.PoisonMicroblocksDoNotConflict="PoisonMicroblocksDoNotConflict",e.PoisonMicroblockHasUnknownPubKeyHash="PoisonMicroblockHasUnknownPubKeyHash",e.PoisonMicroblockIsInvalid="PoisonMicroblockIsInvalid",e.BadAddressVersionByte="BadAddressVersionByte",e.NoCoinbaseViaMempool="NoCoinbaseViaMempool",e.ServerFailureNoSuchChainTip="ServerFailureNoSuchChainTip",e.TooMuchChaining="TooMuchChaining",e.ConflictingNonceInMempool="ConflictingNonceInMempool",e.BadTransactionVersion="BadTransactionVersion",e.TransferRecipientCannotEqualSender="TransferRecipientCannotEqualSender",e.TransferAmountMustBePositive="TransferAmountMustBePositive",e.ServerFailureDatabase="ServerFailureDatabase",e.EstimatorError="EstimatorError",e.TemporarilyBlacklisted="TemporarilyBlacklisted",e.ServerFailureOther="ServerFailureOther"})(x3||(x3={}));function IY(e,t,n){const i=AY;if(KY(e,i))throw new Error(`String length exceeds maximum bytes ${i}`);return{type:L1.LengthPrefixedString,content:e,lengthPrefixBytes:1,maxLengthBytes:i}}var pr;(function(e){e[e.Int=0]="Int",e[e.UInt=1]="UInt",e[e.Buffer=2]="Buffer",e[e.BoolTrue=3]="BoolTrue",e[e.BoolFalse=4]="BoolFalse",e[e.PrincipalStandard=5]="PrincipalStandard",e[e.PrincipalContract=6]="PrincipalContract",e[e.ResponseOk=7]="ResponseOk",e[e.ResponseErr=8]="ResponseErr",e[e.OptionalNone=9]="OptionalNone",e[e.OptionalSome=10]="OptionalSome",e[e.List=11]="List",e[e.Tuple=12]="Tuple",e[e.StringASCII=13]="StringASCII",e[e.StringUTF8=14]="StringUTF8"})(pr||(pr={}));class PY extends Error{constructor(t){super(t),this.message=t,this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class x8 extends PY{constructor(t){super(t)}}function ab(e){const t=[];return t.push(pg(lk(e.version,1))),t.push(pg(e.hash160)),Vu(t)}function MY(e){const t=[];return t.push(e.prefix),t.push(ab(e.address)),e.prefix===j1.Contract&&t.push(mg(e.contractName)),Vu(t)}function mg(e){const t=[],n=fk(e.content),r=n.byteLength;return t.push(pg(lk(r,e.lengthPrefixBytes))),t.push(n),Vu(t)}function LY(e){const t=[];return t.push(ab(e.address)),t.push(mg(e.contractName)),t.push(mg(e.assetName)),Vu(t)}function _8(e){const t=[];if(t.push(e.conditionType),t.push(MY(e.principal)),(e.conditionType===Qd.Fungible||e.conditionType===Qd.NonFungible)&&t.push(LY(e.assetInfo)),e.conditionType===Qd.NonFungible&&t.push(jl(e.assetName)),t.push(e.conditionCode),e.conditionType===Qd.STX||e.conditionType===Qd.Fungible){if(e.amount>BigInt("0xffffffffffffffff"))throw new x8("The post-condition amount may not be larger than 8 bytes");t.push(SY(e.amount,!1,8))}return Vu(t)}function ws(e,t){return Vu([e,t])}function BY(e){return new Uint8Array([e.type])}function jY(e){return e.type===pr.OptionalNone?new Uint8Array([e.type]):ws(e.type,jl(e.value))}function DY(e){const t=new Uint8Array(4);return sb(t,e.buffer.length,0),ws(e.type,hk(t,e.buffer))}function JY(e){const t=dk(vY(e.value,BigInt(FY)),v8);return ws(e.type,t)}function $Y(e){const t=dk(e.value,v8);return ws(e.type,t)}function qY(e){return ws(e.type,ab(e.address))}function UY(e){return ws(e.type,hk(ab(e.address),mg(e.contractName)))}function HY(e){return ws(e.type,jl(e.value))}function zY(e){const t=[],n=new Uint8Array(4);sb(n,e.list.length,0),t.push(n);for(const r of e.list){const i=jl(r);t.push(i)}return ws(e.type,Vu(t))}function WY(e){const t=[],n=new Uint8Array(4);sb(n,Object.keys(e.data).length,0),t.push(n);const r=Object.keys(e.data).sort((i,o)=>i.localeCompare(o));for(const i of r){const o=IY(i);t.push(mg(o));const a=jl(e.data[i]);t.push(a)}return ws(e.type,Vu(t))}function k8(e,t){const n=[],r=t=="ascii"?kY(e.data):fk(e.data),i=new Uint8Array(4);return sb(i,r.length,0),n.push(i),n.push(r),ws(e.type,Vu(n))}function VY(e){return k8(e,"ascii")}function GY(e){return k8(e,"utf8")}function jl(e){switch(e.type){case pr.BoolTrue:case pr.BoolFalse:return BY(e);case pr.OptionalNone:case pr.OptionalSome:return jY(e);case pr.Buffer:return DY(e);case pr.UInt:return $Y(e);case pr.Int:return JY(e);case pr.PrincipalStandard:return qY(e);case pr.PrincipalContract:return UY(e);case pr.ResponseOk:case pr.ResponseErr:return HY(e);case pr.List:return zY(e);case pr.Tuple:return WY(e);case pr.StringASCII:return VY(e);case pr.StringUTF8:return GY(e);default:throw new x8("Unable to serialize. Invalid Clarity Value.")}}const KY=(e,t)=>e?fk(e).length>t:!1,QY="modulepreload",YY=function(e){return"/lockstacks/"+e},_3={},k3=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=YY(l),l in _3)return;_3[l]=!0;const f=l.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${p}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":QY,f||(m.as="script"),m.crossOrigin="",m.href=l,u&&m.setAttribute("nonce",u),document.head.appendChild(m),f)return new Promise((y,w)=>{m.addEventListener("load",y),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return i.then(a=>{for(const u of a||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})},XY="connect-ui";let D0,R8,Ti=!1,D1=!1;const Du=(e,t="")=>()=>{},ZY=(e,t)=>()=>{},eX="{visibility:hidden}.hydrated{visibility:inherit}",R3={},tX="http://www.w3.org/2000/svg",nX="http://www.w3.org/1999/xhtml",rX=e=>e!=null,pk=e=>(e=typeof e,e==="object"||e==="function");function T8(e){var t,n,r;return(r=(n=(t=e.head)===null||t===void 0?void 0:t.querySelector('meta[name="csp-nonce"]'))===null||n===void 0?void 0:n.getAttribute("content"))!==null&&r!==void 0?r:void 0}const iX=(e,t,...n)=>{let r=null,i=!1,o=!1;const a=[],u=f=>{for(let p=0;pf[p]).join(" "))}const l=J1(e,null);return l.$attrs$=t,a.length>0&&(l.$children$=a),l},J1=(e,t)=>{const n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return n.$attrs$=null,n},oX={},sX=e=>e&&e.$tag$===oX,aX=(e,t)=>e!=null&&!pk(e)&&t&4?e==="false"?!1:e===""||!!e:e,nle=e=>up(e).$hostElement$,cX=(e,t,n)=>{const r=Dr.ce(t,n);return e.dispatchEvent(r),r},T3=new WeakMap,uX=(e,t,n)=>{let r=mw.get(e);NX&&n?(r=r||new CSSStyleSheet,typeof r=="string"?r=t:r.replaceSync(t)):r=t,mw.set(e,r)},lX=(e,t,n,r)=>{var i;let o=O8(t);const a=mw.get(o);if(e=e.nodeType===11?e:ts,a)if(typeof a=="string"){e=e.head||e;let u=T3.get(e),l;if(u||T3.set(e,u=new Set),!u.has(o)){{l=ts.createElement("style"),l.innerHTML=a;const f=(i=Dr.$nonce$)!==null&&i!==void 0?i:T8(ts);f!=null&&l.setAttribute("nonce",f),e.insertBefore(l,e.querySelector("link"))}u&&u.add(o)}}else e.adoptedStyleSheets.includes(a)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,a]);return o},dX=e=>{const t=e.$cmpMeta$,n=e.$hostElement$,r=t.$flags$,i=Du("attachStyles",t.$tagName$),o=lX(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);r&10&&(n["s-sc"]=o,n.classList.add(o+"-h")),i()},O8=(e,t)=>"sc-"+e.$tagName$,O3=(e,t,n,r,i,o)=>{if(n!==r){let a=C3(e,t),u=t.toLowerCase();if(t==="class"){const l=e.classList,f=N3(n),p=N3(r);l.remove(...f.filter(m=>m&&!p.includes(m))),l.add(...p.filter(m=>m&&!f.includes(m)))}else if(!a&&t[0]==="o"&&t[1]==="n")t[2]==="-"?t=t.slice(3):C3(cb,u)?t=u.slice(2):t=u[2]+t.slice(3),n&&Dr.rel(e,t,n,!1),r&&Dr.ael(e,t,r,!1);else{const l=pk(r);if((a||l&&r!==null)&&!i)try{if(e.tagName.includes("-"))e[t]=r;else{const f=r??"";t==="list"?a=!1:(n==null||e[t]!=f)&&(e[t]=f)}}catch{}r==null||r===!1?(r!==!1||e.getAttribute(t)==="")&&e.removeAttribute(t):(!a||o&4||i)&&!l&&(r=r===!0?"":r,e.setAttribute(t,r))}}},fX=/\s/,N3=e=>e?e.split(fX):[],N8=(e,t,n,r)=>{const i=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,o=e&&e.$attrs$||R3,a=t.$attrs$||R3;for(r in o)r in a||O3(i,r,o[r],void 0,n,t.$flags$);for(r in a)O3(i,r,o[r],a[r],n,t.$flags$)},mk=(e,t,n,r)=>{const i=t.$children$[n];let o=0,a,u;if(i.$text$!==null)a=i.$elm$=ts.createTextNode(i.$text$);else{if(Ti||(Ti=i.$tag$==="svg"),a=i.$elm$=ts.createElementNS(Ti?tX:nX,i.$tag$),Ti&&i.$tag$==="foreignObject"&&(Ti=!1),N8(null,i,Ti),rX(D0)&&a["s-si"]!==D0&&a.classList.add(a["s-si"]=D0),i.$children$)for(o=0;o{let a=e,u;for(a.shadowRoot&&a.tagName===R8&&(a=a.shadowRoot);i<=o;++i)r[i]&&(u=mk(null,n,i),u&&(r[i].$elm$=u,a.insertBefore(u,t)))},E8=(e,t,n,r,i)=>{for(;t<=n;++t)(r=e[t])&&(i=r.$elm$,i.remove())},hX=(e,t,n,r)=>{let i=0,o=0,a=t.length-1,u=t[0],l=t[a],f=r.length-1,p=r[0],m=r[f],y;for(;i<=a&&o<=f;)u==null?u=t[++i]:l==null?l=t[--a]:p==null?p=r[++o]:m==null?m=r[--f]:_0(u,p)?(qm(u,p),u=t[++i],p=r[++o]):_0(l,m)?(qm(l,m),l=t[--a],m=r[--f]):_0(u,m)?(qm(u,m),e.insertBefore(u.$elm$,l.$elm$.nextSibling),u=t[++i],m=r[--f]):_0(l,p)?(qm(l,p),e.insertBefore(l.$elm$,u.$elm$),l=t[--a],p=r[++o]):(y=mk(t&&t[o],n,o),p=r[++o],y&&u.$elm$.parentNode.insertBefore(y,u.$elm$));i>a?C8(e,r[f+1]==null?null:r[f+1].$elm$,n,r,o,f):o>f&&E8(t,i,a)},_0=(e,t)=>e.$tag$===t.$tag$,qm=(e,t)=>{const n=t.$elm$=e.$elm$,r=e.$children$,i=t.$children$,o=t.$tag$,a=t.$text$;a===null?(Ti=o==="svg"?!0:o==="foreignObject"?!1:Ti,N8(e,t,Ti),r!==null&&i!==null?hX(n,r,t,i):i!==null?(e.$text$!==null&&(n.textContent=""),C8(n,null,t,i,0,i.length-1)):r!==null&&E8(r,0,r.length-1),Ti&&o==="svg"&&(Ti=!1)):e.$text$!==a&&(n.data=a)},pX=(e,t)=>{const n=e.$hostElement$,r=e.$vnode$||J1(null,null),i=sX(t)?t:iX(null,null,t);R8=n.tagName,i.$tag$=null,i.$flags$|=4,e.$vnode$=i,i.$elm$=r.$elm$=n.shadowRoot||n,D0=n["s-sc"],qm(r,i)},A8=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise(n=>e.$onRenderResolve$=n))},gk=(e,t)=>{if(e.$flags$|=16,e.$flags$&4){e.$flags$|=512;return}return A8(e,e.$ancestorComponent$),EX(()=>mX(e,t))},mX=(e,t)=>{const n=Du("scheduleUpdate",e.$cmpMeta$.$tagName$),r=e.$lazyInstance$;let i;return n(),bX(i,()=>gX(e,r,t))},gX=async(e,t,n)=>{const r=e.$hostElement$,i=Du("update",e.$cmpMeta$.$tagName$),o=r["s-rc"];n&&dX(e);const a=Du("render",e.$cmpMeta$.$tagName$);yX(e,t),o&&(o.map(u=>u()),r["s-rc"]=void 0),a(),i();{const u=r["s-p"],l=()=>wX(e);u.length===0?l():(Promise.all(u).then(l),e.$flags$|=4,u.length=0)}},yX=(e,t,n)=>{try{t=t.render(),e.$flags$&=-17,e.$flags$|=2,pX(e,t)}catch(r){gg(r,e.$hostElement$)}return null},wX=e=>{const t=e.$cmpMeta$.$tagName$,n=e.$hostElement$,r=Du("postUpdate",t),i=e.$ancestorComponent$;e.$flags$&64?r():(e.$flags$|=64,I8(n),r(),e.$onReadyResolve$(n),i||F8()),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),e.$flags$&512&&wk(()=>gk(e,!1)),e.$flags$&=-517},F8=e=>{I8(ts.documentElement),wk(()=>cX(cb,"appload",{detail:{namespace:XY}}))},bX=(e,t)=>t(),I8=e=>e.classList.add("hydrated"),SX=(e,t)=>up(e).$instanceValues$.get(t),vX=(e,t,n,r)=>{const i=up(e),o=i.$instanceValues$.get(t),a=i.$flags$,u=i.$lazyInstance$;n=aX(n,r.$members$[t][0]);const l=Number.isNaN(o)&&Number.isNaN(n),f=n!==o&&!l;(!(a&8)||o===void 0)&&f&&(i.$instanceValues$.set(t,n),u&&(a&18)===2&&gk(i,!1))},P8=(e,t,n)=>{if(t.$members$){const r=Object.entries(t.$members$),i=e.prototype;if(r.map(([o,[a]])=>{(a&31||n&2&&a&32)&&Object.defineProperty(i,o,{get(){return SX(this,o)},set(u){vX(this,o,u,t)},configurable:!0,enumerable:!0})}),n&1){const o=new Map;i.attributeChangedCallback=function(a,u,l){Dr.jmp(()=>{const f=o.get(a);if(this.hasOwnProperty(f))l=this[f],delete this[f];else if(i.hasOwnProperty(f)&&typeof this[f]=="number"&&this[f]==l)return;this[f]=l===null&&typeof this[f]=="boolean"?!1:l})},e.observedAttributes=r.filter(([a,u])=>u[0]&15).map(([a,u])=>{const l=u[1]||a;return o.set(l,a),l})}}return e},xX=async(e,t,n,r,i)=>{if(!(t.$flags$&32)){{if(t.$flags$|=32,i=OX(n),i.then){const l=ZY();i=await i,l()}i.isProxied||(P8(i,n,2),i.isProxied=!0);const u=Du("createInstance",n.$tagName$);t.$flags$|=8;try{new i(t)}catch(l){gg(l)}t.$flags$&=-9,u()}if(i.style){let u=i.style;const l=O8(n);if(!mw.has(l)){const f=Du("registerStyles",n.$tagName$);uX(l,u,!!(n.$flags$&1)),f()}}}const o=t.$ancestorComponent$,a=()=>gk(t,!0);o&&o["s-rc"]?o["s-rc"].push(a):a()},_X=e=>{if(!(Dr.$flags$&1)){const t=up(e),n=t.$cmpMeta$,r=Du("connectedCallback",n.$tagName$);if(!(t.$flags$&1)){t.$flags$|=1;{let i=e;for(;i=i.parentNode||i.host;)if(i["s-p"]){A8(t,t.$ancestorComponent$=i);break}}n.$members$&&Object.entries(n.$members$).map(([i,[o]])=>{if(o&31&&e.hasOwnProperty(i)){const a=e[i];delete e[i],e[i]=a}}),xX(e,t,n)}r()}},kX=e=>{Dr.$flags$&1||up(e)},RX=(e,t={})=>{var n;const r=Du(),i=[],o=t.exclude||[],a=cb.customElements,u=ts.head,l=u.querySelector("meta[charset]"),f=ts.createElement("style"),p=[];let m,y=!0;Object.assign(Dr,t),Dr.$resourcesUrl$=new URL(t.resourcesUrl||"./",ts.baseURI).href,e.map(w=>{w[1].map(b=>{const x={$flags$:b[0],$tagName$:b[1],$members$:b[2],$listeners$:b[3]};x.$members$=b[2];const _=x.$tagName$,O=class extends HTMLElement{constructor(N){super(N),N=this,TX(N,x),x.$flags$&1&&N.attachShadow({mode:"open"})}connectedCallback(){m&&(clearTimeout(m),m=null),y?p.push(this):Dr.jmp(()=>_X(this))}disconnectedCallback(){Dr.jmp(()=>kX(this))}componentOnReady(){return up(this).$onReadyPromise$}};x.$lazyBundleId$=w[0],!o.includes(_)&&!a.get(_)&&(i.push(_),a.define(_,P8(O,x,1)))})});{f.innerHTML=i+eX,f.setAttribute("data-styles","");const w=(n=Dr.$nonce$)!==null&&n!==void 0?n:T8(ts);w!=null&&f.setAttribute("nonce",w),u.insertBefore(f,l?l.nextSibling:u.firstChild)}y=!1,p.length?p.map(w=>w.connectedCallback()):Dr.jmp(()=>m=setTimeout(F8,30)),r()},yk=new WeakMap,up=e=>yk.get(e),rle=(e,t)=>yk.set(t.$lazyInstance$=e,t),TX=(e,t)=>{const n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return n.$onReadyPromise$=new Promise(r=>n.$onReadyResolve$=r),e["s-p"]=[],e["s-rc"]=[],yk.set(e,n)},C3=(e,t)=>t in e,gg=(e,t)=>(0,console.error)(e,t),vx=new Map,OX=(e,t,n)=>{const r=e.$tagName$.replace(/-/g,"_"),i=e.$lazyBundleId$,o=vx.get(i);if(o)return o[r];{const a=u=>(vx.set(i,u),u[r]);switch(i){case"connect-modal":return k3(()=>import("./connect-modal.entry-DFVxUKHn.js"),[]).then(a,gg)}}return k3(()=>import(`./${i}.entry.js`),[]).then(a=>(vx.set(i,a),a[r]),gg)},mw=new Map,cb=typeof window<"u"?window:{},ts=cb.document||{head:{}},Dr={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,r)=>e.addEventListener(t,n,r),rel:(e,t,n,r)=>e.removeEventListener(t,n,r),ce:(e,t)=>new CustomEvent(e,t)},M8=e=>Promise.resolve(e),NX=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),E3=[],L8=[],CX=(e,t)=>n=>{e.push(n),D1||(D1=!0,Dr.$flags$&4?wk($1):Dr.raf($1))},A3=e=>{for(let t=0;t{A3(E3),A3(L8),(D1=E3.length>0)&&Dr.raf($1)},wk=e=>M8().then(e),EX=CX(L8),AX=()=>M8(),FX=(e,t)=>typeof window>"u"?Promise.resolve():AX().then(()=>RX([["connect-modal",[[1,"connect-modal",{defaultProviders:[16],installedProviders:[16],persistSelection:[4,"persist-selection"],callback:[16],cancelCallback:[16]}]]]],t));(function(){if(typeof window<"u"&&window.Reflect!==void 0&&window.customElements!==void 0){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}})();var IX=Object.defineProperty,PX=Object.defineProperties,MX=Object.getOwnPropertyDescriptors,gw=Object.getOwnPropertySymbols,B8=Object.prototype.hasOwnProperty,j8=Object.prototype.propertyIsEnumerable,F3=(e,t,n)=>t in e?IX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ar=(e,t)=>{for(var n in t||(t={}))B8.call(t,n)&&F3(e,n,t[n]);if(gw)for(var n of gw(t))j8.call(t,n)&&F3(e,n,t[n]);return e},ao=(e,t)=>PX(e,MX(t)),D8=(e,t)=>{var n={};for(var r in e)B8.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gw)for(var r of gw(e))t.indexOf(r)<0&&j8.call(e,r)&&(n[r]=e[r]);return n};function ub(){return y8(w8())||window.StacksProvider||window.BlockstackProvider}function Lg(e){return e?typeof e=="string"?gf.fromName(e):"version"in e?e:"url"in e?new I1({url:e.url}):e.transactionVersion===Ni.Mainnet?new I1({url:e.client.baseUrl}):new P1({url:e.client.baseUrl}):new P1}typeof window<"u"&&(window.__CONNECT_VERSION__="__VERSION__");var LX=e=>{if(!e){let t=new rb(["store_write"],document.location.href);e=new hg({appConfig:t})}return e},BX=async(e,t=ub())=>{if(!t)throw new Error("[Connect] No installed Stacks wallet found");let{redirectTo:n="/",manifestPath:r,onFinish:i,onCancel:o,sendToSignIn:a=!1,userSession:u,appDetails:l}=e,f=LX(u);f.isUserSignedIn()&&f.signUserOut();let p=f.generateAndStoreTransitKey(),m=f.makeAuthRequest(p,`${document.location.origin}${n}`,`${document.location.origin}${r}`,f.appConfig.scopes,void 0,void 0,{sendToSignIn:a,appDetails:l,connectVersion:"__VERSION__"});try{let y=await t.authenticationRequest(m);await f.handlePendingSignIn(y);let w=Er.decodeToken(y),b=w==null?void 0:w.payload;i==null||i({authResponse:y,authResponsePayload:b,userSession:f})}catch(y){console.error("[Connect] Error during auth request",y),o==null||o()}},jX=(e=>(e.ContractCall="contract_call",e.ContractDeploy="smart_contract",e.STXTransfer="token_transfer",e))(jX||{}),DX=(e=>(e.BUFFER="buffer",e.UINT="uint",e.INT="int",e.PRINCIPAL="principal",e.BOOL="bool",e))(DX||{}),lb=e=>{let t=e;if(!t){let n=new rb(["store_write"],document.location.href);t=new hg({appConfig:n})}return t};function J8(e){try{return lb(e).loadUserData().appPrivateKey}catch{return!1}}var $8=e=>{let t=lb(e).loadUserData().appPrivateKey,n=Er.SECP256K1Client.derivePublicKey(t);return{privateKey:t,publicKey:n}};function JX(e){var t;let{stxAddress:n,userSession:r,network:i}=e;if(n)return n;if(!r||!i)return;let o=(t=r==null?void 0:r.loadUserData().profile)==null?void 0:t.stxAddress,a={[dn.Mainnet]:"mainnet",[dn.Testnet]:"testnet"},u=Lg(i);return o==null?void 0:o[a[u.chainId]]}function $X(e){let t=Lg(e.network),n=lb(e.userSession),r=ao(Ar({},e),{network:t,userSession:n});return Ar({stxAddress:JX(r)},r)}async function qX(e,t){let{postConditions:n}=e;return n&&n.length>0&&typeof n[0]!="string"&&(typeof n[0].type=="string"?n=n.map(UM):n=n.map(r=>at(_8(r)))),new Er.TokenSigner("ES256k",t).signAsync(ao(Ar({},e),{postConditions:n}))}function UX(e){let{postConditions:t}=e;return t&&t.length>0&&typeof t[0]!="string"&&(typeof t[0].type=="string"?t=t.map(UM):t=t.map(n=>at(_8(n)))),Er.createUnsecuredToken(ao(Ar({},e),{postConditions:t}))}var HX=async({token:e,options:t},n)=>{var r,i,o;try{let a=await n.transactionRequest(e),{txRaw:u}=a,l=rt(u.replace(/^0x/,"")),f=kK(l);if("sponsored"in t&&t.sponsored){(r=t.onFinish)==null||r.call(t,ao(Ar({},a),{stacksTransaction:f}));return}(i=t.onFinish)==null||i.call(t,ao(Ar({},a),{stacksTransaction:f}))}catch(a){console.error("[Connect] Error during transaction request",a),(o=t.onCancel)==null||o.call(t)}},zX=async e=>{let t=e,{functionArgs:n,appDetails:r,userSession:i}=t,o=D8(t,["functionArgs","appDetails","userSession"]),a=n.map(l=>typeof l=="string"?l:typeof l.type=="string"?lw(l):at(jl(l)));if(J8(i)){let{privateKey:l,publicKey:f}=$8(i),p=ao(Ar({},o),{functionArgs:a,txType:"contract_call",publicKey:f});return r&&(p.appDetails=r),qX(p,l)}let u=ao(Ar({},o),{functionArgs:a,txType:"contract_call"});return r&&(u.appDetails=r),UX(u)};async function WX(e,t,n){let r=await t(ao(Ar(Ar({},$X(e)),e),{network:Lg(e.network)}));return HX({token:r,options:e},n)}function bk(e,t=ub()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return WX(e,zX,t)}function VX(e){var t;let{userSession:n,network:r}=e;if(!n||!r)return;let i=(t=n==null?void 0:n.loadUserData().profile)==null?void 0:t.stxAddress,o={[dn.Mainnet]:"mainnet",[dn.Testnet]:"testnet"},a=Lg(r);return i==null?void 0:i[o[a.chainId]]}function GX(e){let t=Lg(e.network),n=lb(e.userSession),r=ao(Ar({},e),{network:t,userSession:n});return Ar({stxAddress:VX(r)},r)}async function KX(e,t,n){let r=await t(Ar(Ar({},GX(e)),e));return XX({token:r,options:e},n)}function q8(e){let{message:t,domain:n}=e;return typeof t.type=="string"&&typeof n.type=="string"?ao(Ar({},e),{message:lw(t),domain:lw(n)}):ao(Ar({},e),{message:at(jl(t)),domain:at(jl(n))})}async function QX(e,t){return new Er.TokenSigner("ES256k",t).signAsync(q8(e))}async function YX(e){let t=e,{userSession:n}=t,r=D8(t,["userSession"]);if(J8(n)){let{privateKey:i,publicKey:o}=$8(n),a=ao(Ar({},r),{publicKey:o});return QX(a,i)}return Er.createUnsecuredToken(q8(e))}async function XX({token:e,options:t},n){var r,i;try{let o=await n.structuredDataSignatureRequest(e);(r=t.onFinish)==null||r.call(t,o)}catch(o){console.error("[Connect] Error during signature request",o),(i=t.onCancel)==null||i.call(t)}}function ZX(e,t=ub()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return KX(e,YX,t)}var eZ=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.ALL=1]="ALL",e[e.NONE=2]="NONE",e[e.SINGLE=3]="SINGLE",e[e.ANYONECANPAY=128]="ANYONECANPAY",e))(eZ||{}),tZ=[{id:"LeatherProvider",name:"Leather",icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiByeD0iMjYuODM4NyIgZmlsbD0iIzEyMTAwRiIvPgo8cGF0aCBkPSJNNzQuOTE3MSA1Mi43MTE0QzgyLjQ3NjYgNTEuNTQwOCA5My40MDg3IDQzLjU4MDQgOTMuNDA4NyAzNy4zNzYxQzkzLjQwODcgMzUuNTAzMSA5MS44OTY4IDM0LjIxNTQgODkuNjg3MSAzNC4yMTU0Qzg1LjUwMDQgMzQuMjE1NCA3OC40MDYxIDQwLjUzNjggNzQuOTE3MSA1Mi43MTE0Wk0zOS45MTEgODMuNDk5MUMzMC4wMjU2IDgzLjQ5OTEgMjkuMjExNSA5My4zMzI0IDM5LjA5NjkgOTMuMzMyNEM0My41MTYzIDkzLjMzMjQgNDguODY2MSA5MS41NzY0IDUxLjY1NzMgODguNDE1N0M0Ny41ODY4IDg0LjkwMzggNDQuMjE0MSA4My40OTkxIDM5LjkxMSA4My40OTkxWk0xMDIuODI5IDc5LjI4NDhDMTAzLjQxIDk1Ljc5MDcgOTUuMDM2OSAxMDUuMDM5IDgwLjg0ODQgMTA1LjAzOUM3Mi40NzQ4IDEwNS4wMzkgNjguMjg4MSAxMDEuODc4IDU5LjMzMyA5Ni4wMjQ5QzU0LjY4MSAxMDEuMTc2IDQ1Ljg0MjMgMTA1LjAzOSAzOC41MTU0IDEwNS4wMzlDMTMuMjc4NSAxMDUuMDM5IDE0LjMyNTIgNzIuODQ2MyA0MC4wMjczIDcyLjg0NjNDNDUuMzc3MSA3Mi44NDYzIDQ5LjkxMjggNzQuMjUxMSA1NS43Mjc3IDc3Ljg4TDU5LjU2NTYgNjQuNDE3N0M0My43NDg5IDYwLjA4NjQgMzUuODQwNSA0Ny45MTE4IDQzLjYzMjYgMzAuNDY5M0g1Ni4xOTI5QzQ5LjIxNSA0Mi4wNTg2IDUzLjk4MzIgNTEuNjU3OCA2Mi44MjIgNTIuNzExNEM2Ny41OTAzIDM1LjczNzIgNzcuODI0NiAyMi41MDkgOTEuNDMxNiAyMi41MDlDOTkuMTA3NCAyMi41MDkgMTA1LjE1NSAyNy41NDI4IDEwNS4xNTUgMzYuNjczN0MxMDUuMTU1IDUxLjMwNjYgODYuMDgxOSA2My4yNDcxIDcxLjY2MDcgNjQuNDE3N0w2NS43Mjk1IDg1LjM3MjFDNzIuNDc0OCA5My4yMTUzIDkxLjE5OSAxMDAuODI0IDkxLjE5OSA3OS4yODQ4SDEwMi44MjlaIiBmaWxsPSIjRjVGMUVEIi8+Cjwvc3ZnPgo=",webUrl:"https://leather.io",chromeWebStoreUrl:"https://chrome.google.com/webstore/detail/hiro-wallet/ldinpeekobnhjjdofggfgjlcehhmanlj",mozillaAddOnsUrl:"https://leather.io/install-extension"},{id:"XverseProviders.StacksProvider",name:"Xverse Wallet",icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MDAiIGhlaWdodD0iNjAwIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGZpbGw9IiMxNzE3MTciIGQ9Ik0wIDBoNjAwdjYwMEgweiIvPjxwYXRoIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTQ0MCA0MzUuNHYtNTFjMC0yLS44LTMuOS0yLjItNS4zTDIyMCAxNjIuMmE3LjYgNy42IDAgMCAwLTUuNC0yLjJoLTUxLjFjLTIuNSAwLTQuNiAyLTQuNiA0LjZ2NDcuM2MwIDIgLjggNCAyLjIgNS40bDc4LjIgNzcuOGE0LjYgNC42IDAgMCAxIDAgNi41bC03OSA3OC43Yy0xIC45LTEuNCAyLTEuNCAzLjJ2NTJjMCAyLjQgMiA0LjUgNC42IDQuNUgyNDljMi42IDAgNC42LTIgNC42LTQuNlY0MDVjMC0xLjIuNS0yLjQgMS40LTMuM2w0Mi40LTQyLjJhNC42IDQuNiAwIDAgMSA2LjQgMGw3OC43IDc4LjRhNy42IDcuNiAwIDAgMCA1LjQgMi4yaDQ3LjVjMi41IDAgNC42LTIgNC42LTQuNloiLz48cGF0aCBmaWxsPSIjRUU3QTMwIiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0zMjUuNiAyMjcuMmg0Mi44YzIuNiAwIDQuNiAyLjEgNC42IDQuNnY0Mi42YzAgNCA1IDYuMSA4IDMuMmw1OC43LTU4LjVjLjgtLjggMS4zLTIgMS4zLTMuMnYtNTEuMmMwLTIuNi0yLTQuNi00LjYtNC42TDM4NCAxNjBjLTEuMiAwLTIuNC41LTMuMyAxLjNsLTU4LjQgNTguMWE0LjYgNC42IDAgMCAwIDMuMiA3LjhaIi8+PC9nPjwvc3ZnPg==",webUrl:"https://xverse.app",chromeWebStoreUrl:"https://chrome.google.com/webstore/detail/xverse-wallet/idnnbdplmphpflfnlkomgpfbpcgelopg",googlePlayStoreUrl:"https://play.google.com/store/apps/details?id=com.secretkeylabs.xverse",iOSAppStoreUrl:"https://apps.apple.com/app/xverse-bitcoin-web3-wallet/id1552272513",mozillaAddOnsUrl:"https://www.xverse.app/download"},{id:"AsignaProvider",name:"Asigna",icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMDEwMCIgZD0iTTAgMGgzMnYzMkgweiIvPjxwYXRoIGZpbGw9InVybCgjYSkiIGQ9Ik0xNS4xMSA1LjU1YTMgMyAwIDAgMC0xLjgyIDEuM2wtLjA1LjA4LS40My43Mi0uMDcuMTEtLjUuODUtLjA1LjA5LTEuMjkgMi4xOC0uMDQuMDctLjQ3LjgtLjA2LjEtLjQ2Ljc4LS4wNy4xMS0xLjYzIDIuNzYtLjA3LjExLS4zOC42Ni0uMDUuMDgtLjczIDEuMjQtLjM1LjYtLjQuNjctLjA1LjA5TDUuMSAyMC43bC0uMTEuMTgtLjE0LjIzLS4wNy4xMy0uMzMuNTUtLjA0LjA3di4wMWExLjI2IDEuMjYgMCAwIDAtLjE0LjQ3IDEuMzEgMS4zMSAwIDAgMCAxLjI0IDEuNGgxLjVsLjA1LS4wNi4wNC0uMDYuODctMS4yMS4wNS0uMDguNzctMS4wNy4wNS0uMDcuNC0uNTcuMDUtLjA2LjI0LS4zNGExLjUyIDEuNTIgMCAwIDEgMS4zOS0uNjIgMS41IDEuNSAwIDAgMSAuNjQuMiAxLjQ3IDEuNDcgMCAwIDEgLjczIDEuMjcgMS40NCAxLjQ0IDAgMCAxLS4yNy44NGwtLjYzLjg4LS4wNS4wNy0uMzIuNDUtLjA2LjA4LS4wOC4xMi0uMTIuMTYtLjA1LjA4aDIuMTNhMi4zMiAyLjMyIDAgMCAwIDEuNzctLjk2bDEuMTgtMS42My43Ny0xLjA4IDEuMy0xLjhhMS4yNCAxLjI0IDAgMCAxIC41NS0uNDNsLjA4LS4wM2ExLjMgMS4zIDAgMCAxIC4zLS4wNiAxLjI4IDEuMjggMCAwIDEgMS4xNS41NGwuMTEuMmExLjEzIDEuMTMgMCAwIDEgLjEuNDEgMS4xOSAxLjE5IDAgMCAxLS4yMy43N2wtLjAzLjA1LS41Ny44LS43Ljk4LS4yNy4zN2ExLjIyIDEuMjIgMCAwIDAtLjIuNSAxLjA1IDEuMDUgMCAwIDAtLjAyLjIzdi4wNmExLjE3IDEuMTcgMCAwIDAgLjE0LjQzbC4wMi4wNS4wNy4xYTEuNDQgMS40NCAwIDAgMCAuMS4xMWwuMDUuMDYuMDEuMDFhMS44IDEuOCAwIDAgMCAuMTQuMWMwIC4wMi4wMi4wMy4wNC4wM2ExIDEgMCAwIDAgLjA4LjA1bC4wNy4wNGExLjI1IDEuMjUgMCAwIDAgLjUuMWg2LjljLjEgMCAuMi0uMDEuMjktLjAzbC4wNi0uMDJhMS4yNyAxLjI3IDAgMCAwIC4yNy0uMS41Ny41NyAwIDAgMCAuMDctLjAzIDEuMjEgMS4yMSAwIDAgMCAuMjYtLjE5bC4wOC0uMDdhLjkyLjkyIDAgMCAwIC4xNS0uMTkgMS41NSAxLjU1IDAgMCAwIC4wOS0uMTdsLjAyLS4wNWExLjIyIDEuMjIgMCAwIDAgLjA4LS4yNnYtLjA0bC4wMi0uMDh2LS4wOGExLjMyIDEuMzIgMCAwIDAtLjItLjc0bC0xLjYtMi42NC0uMDYtLjEtLjItLjMyLS4zMy0uNTR2LS4wMWwtLjA1LS4wOC0xLjMtMi4xNS0uMDctLjEtLjA0LS4wNi0uOC0xLjMyLS4wNC0uMDctLjItLjM0LS4xLS4xNC0uMS0uMTYtLjUzLS45LS4xMy0uMi0uMDktLjE0LTIuMTctMy41Ny0uMDQtLjA3LS43Mi0xLjE5LS4wNS0uMDctLjQtLjY1YTIuNjUgMi42NSAwIDAgMC0uMy0uNCAyLjk2IDIuOTYgMCAwIDAtLjk3LS43NCAzLjA0IDMuMDQgMCAwIDAtMS4zLS4zYy0uMjUgMC0uNS4wNC0uNzQuMVoiLz48cGF0aCBmaWxsPSJ1cmwoI2IpIiBkPSJNMTkgMTYuM2E1LjQ1IDUuNDUgMCAwIDAtLjgzIDEuNTZsLS4wNC4xNWExLjM2IDEuMzYgMCAwIDEgLjI4LS4xNiAxLjI0IDEuMjQgMCAwIDEgLjM4LS4wOGguMWExLjI4IDEuMjggMCAwIDEgMS4wNS41NGMuMDQuMDYuMDguMTMuMS4yYTEuMjQgMS4yNCAwIDAgMSAuMDkuMjcgMS4xOSAxLjE5IDAgMCAxLS4yLjkxbC0uMDQuMDUtLjU3Ljc5LS43Ljk5LS4yNy4zN2ExLjIzIDEuMjMgMCAwIDAtLjIuNDIgMS4wNiAxLjA2IDAgMCAwLS4wMi4zMXYuMDZhMS4xNyAxLjE3IDAgMCAwIC4xNi40Ny45My45MyAwIDAgMCAuMDcuMSAxLjUgMS41IDAgMCAwIC4xLjEybC4wNS4wNmguMDFhMS45NCAxLjk0IDAgMCAwIC4wOS4wOCAxIDEgMCAwIDAgLjE3LjFsLjA3LjA0YTEuMjUgMS4yNSAwIDAgMCAuNS4xaDYuOWMuMSAwIC4yIDAgLjI4LS4wMmwuMDctLjAyYTEuMzIgMS4zMiAwIDAgMCAuMzQtLjEzbC4xNi0uMS4wMy0uMDNhMS4yOSAxLjI5IDAgMCAwIC4yLS4yIDIuNDMgMi40MyAwIDAgMCAuMTItLjE3Yy4wMy0uMDMuMDUtLjA4LjA3LS4xMmwuMDItLjA1YTEuMjEgMS4yMSAwIDAgMCAuMDktLjN2LS4wOGwuMDEtLjA5YTEuMzIgMS4zMiAwIDAgMC0uMi0uNzNsLTEuNi0yLjY0LS4wNi0uMS0uMi0uMzItLjMzLS41NHYtLjAybC0uMDUtLjA3LTEuMy0yLjE1LS4xMi0uMDctLjA3LS4wNGE0Ljk0IDQuOTQgMCAwIDAtMi40Ni0uNjdjLTEuMDMgMC0xLjc2LjU3LTIuMjYgMS4yWiIvPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xMi4yOSAyMS4wOGMwIC4yOS0uMDkuNTgtLjI3Ljg0bC0xLjMxIDEuODRIN2wyLjUyLTMuNTNhMS41NCAxLjU0IDAgMCAxIDIuMS0uMzZjLjQzLjI4LjY2Ljc0LjY2IDEuMloiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTEuMTYgMjEuMjVhLjU2LjU2IDAgMCAxLS41Ny41NS41Ni41NiAwIDAgMS0uNTctLjU2LjU2LjU2IDAgMCAxIC41Ny0uNTUuNTYuNTYgMCAwIDEgLjU3LjU2WiIvPjxkZWZzPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9IjE1LjIzIiB4Mj0iMTkuMyIgeTE9IjI1Ljc4IiB5Mj0iNi4xMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiM2NTIyRjQiLz48c3RvcCBvZmZzZXQ9Ii41NSIgc3RvcC1jb2xvcj0iIzlCNkJGRiIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0E1ODVGRiIvPjwvbGluZWFyR3JhZGllbnQ+PGxpbmVhckdyYWRpZW50IGlkPSJiIiB4MT0iMjIuNTkiIHgyPSIyNC44IiB5MT0iMjQuNzEiIHkyPSIxNS41MyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiM0MjFGOEIiLz48c3RvcCBvZmZzZXQ9Ii41NSIgc3RvcC1jb2xvcj0iIzcyMzBGRiIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzk3NzNGRiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjwvc3ZnPg==",webUrl:"https://asigna.io",chromeWebStoreUrl:"https://chromewebstore.google.com/detail/asigna-multisig/gopddoinbenlokghakiafackadkbnlid"}];function U8(e,t=!0){return function(n,r){var i;if(r)return e(n,r);let o=w8(),a=ub();if(o&&a)return e(n,a);if(typeof window>"u")return;FX();let u=(i=n==null?void 0:n.defaultProviders)!=null?i:tZ,l=hY(u),f=document.createElement("connect-modal");f.defaultProviders=u,f.installedProviders=l,f.persistSelection=t;let p=document.body.style.overflow;document.body.style.overflow="hidden";let m=()=>{f.remove(),document.body.style.overflow=p};f.callback=w=>{m(),e(n,w)},f.cancelCallback=()=>{var w;m(),(w=n.onCancel)==null||w.call(n)},document.body.appendChild(f);let y=w=>{w.key==="Escape"&&(document.removeEventListener("keydown",y),f.remove())};document.addEventListener("keydown",y)}}var nZ=U8(BX,!1),Do=U8(bk),rZ=pY;const iZ=new rb(["store_write"]),k0=new hg({appConfig:iZ});function oZ(e,t){var o,a,u,l,f,p,m,y;const n=(a=(o=e==null?void 0:e.profile)==null?void 0:o.stxAddress)==null?void 0:a[t],r=(f=(l=(u=e==null?void 0:e.profile)==null?void 0:u.btcAddress)==null?void 0:l.p2tr)==null?void 0:f[t],i=(y=(m=(p=e==null?void 0:e.profile)==null?void 0:p.btcAddress)==null?void 0:m.p2wpkh)==null?void 0:y[t];return xf(n)?{address:n,btcAddressP2tr:r,btcAddressP2wpkh:i}:{address:null,btcAddressP2tr:null,btcAddressP2wpkh:null}}const H8=$.createContext(null);function sZ({children:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(!1),[o,a]=$.useState(!1),{networkName:u}=Pt();function l(){if(t){console.warn("Attempted to sign in while sign is is in progress.");return}n(!0),nZ({userSession:k0,appDetails:tW,onFinish(){n(!1),i(!0)},onCancel(){n(!1)}})}function f(){k0.signUserOut(),rZ(),i(!1)}if(!o)return k0.isUserSignedIn()&&i(!0),a(!0),null;let p=null;try{p=k0.loadUserData()}catch{}const{address:m,btcAddressP2tr:y,btcAddressP2wpkh:w}=oZ(p,u);return d.jsx(d.Fragment,{children:d.jsx(H8.Provider,{value:{isSigningIn:t,isSignedIn:r,signIn:l,signOut:f,userData:p,address:m,btcAddressP2tr:y,btcAddressP2wpkh:w},children:e})})}function Mn(){return $.useContext(H8)}const z8=$.createContext({client:null});function aZ({children:e}){const{address:t}=Mn(),{network:n}=Pt();console.log("network",n);let r=null;return t!==null&&xf(t)&&(r=new _f({address:t,network:n})),d.jsx(d.Fragment,{children:d.jsx(z8.Provider,{value:{client:r},children:e})})}function kn(){return $.useContext(z8)}function cZ(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getCycleDuration",e],()=>e.getCycleDuration())}function uZ(e){if(!e)throw new Error("Expected client to be defined.");return yr(["getStatus",e],()=>e.getStatus())}function Bg(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getStatus",e],()=>e.getStatus())}function Sk(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getPoxOperationInfo",e],()=>e.getPoxOperationInfo())}function lZ(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getAccountBalance",e],()=>e.getAccountBalance())}function vk(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getAccountBalanceLocked",e],()=>e.getAccountBalanceLocked())}function db(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getCoreInfo",e],()=>e.getCoreInfo())}function ci(){const{client:e}=kn();return fb(e)}function fb(e){if(!e)throw new Error("Expected client to be defined.");return yr(["getAccountExtendedBalances",e],()=>e.getAccountExtendedBalances())}function Gu(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getSecondsUntilNextCycle",e],()=>e.getSecondsUntilNextCycle(),{refetchInterval:6e4})}function rn(){const{client:e}=kn();if(!e)throw new Error("Expected client to be defined.");return yr(["getPoxInfo",e],()=>e.getPoxInfo())}function xx(e){const{address:t}=Mn(),{network:n}=Pt(),r=ju(n)[wt.Pox4];return yr(["getAllowanceContractCallers",t,e,n],()=>{if(t){const[i,o]=r.split(".");return ph({contractAddress:i,contractName:o,functionName:"get-allowance-contract-callers",functionArgs:[no(t),no(e)],senderAddress:t,network:n})}else return Promise.resolve(Rr())})}const dZ="/lockstacks/assets/Inter-Medium-3YuqF_3A.woff2",fZ="/lockstacks/assets/Inter-Regular-7RwU4e5T.woff2",hZ="/lockstacks/assets/Inter-SemiBold-B3N5F7BF.woff2",pZ="/lockstacks/assets/opensaucesans-medium-webfont-B8qePigW.woff2",mZ="/lockstacks/assets/opensaucesans-regular-webfont-C8fdHkyR.woff2";function Am(e){return`url(${e})`}async function gZ(){const e=new FontFace("Inter",Am(fZ),{weight:"400"}),t=new FontFace("Inter",Am(dZ),{weight:"500"}),n=new FontFace("Inter",Am(hZ),{weight:"600"}),r=new FontFace("Open Sauce",Am(mZ),{weight:"400"}),i=new FontFace("Open Sauce",Am(pZ),{weight:"500"});await Promise.all([e.load(),t.load(),n.load(),r.load(),i.load()]),document.fonts.add(e),document.fonts.add(t),document.fonts.add(n),document.fonts.add(r),document.fonts.add(i)}function yZ(){const{isSignedIn:e}=Mn();return e?d.jsx(d.Fragment,{children:d.jsx(s_,{})}):d.jsx(Kw,{to:"../sign-in"})}const Ue={white:"#ffffff",black:"#ococod",blue050:"#f7f8fd",blue100:"#eef2fb",blue200:"#e5ebfa",blue300:"#cedafa",blue400:"#7f97f1",blue500:"#5c6cf2",blue600:"#5546ff",blue700:"#2323c7",blue800:"#ofofa9",blue900:"#oboa63",green100:"#f2f9f1",green300:"#d9edd4",green500:"#23a978",green600:"#008051",gray050:"#fafafa",gray100:"#f5f5f5",gray200:"#efefef",gray300:"#dddddd",gray400:"#9a9a9a",gray500:"#777777",gray600:"#666666",gray700:"#333333",gray800:"#262626",gray900:"#171717",orange100:"#fff5eb",orange300:"#ffe0c2",orange500:"#ffbd7a",orange600:"#f59300",red100:"#fceeed",red300:"#f7cdca",red500:"#e76c6a",red600:"#c83532",slate050:"#f9f9fa",slate100:"#f5f5f7",slate200:"#efeff2",slate300:"#dcdde2",slate400:"#989ca3",slate500:"#74777D",slate600:"#62676e",slate700:"#303236",slate800:"#242629",slate900:"#151619"},sf={background:Ue.white,backgroundSubdued:Ue.slate100,surface:Ue.white,surfaceHovered:Ue.slate050,surfacePressed:Ue.slate200,surfacedisabled:Ue.slate100,surfaceSelected:Ue.blue050,surfaceSubdued:Ue.slate100,surfaceContrast:Ue.black,overlay:`${Ue.black}80`,border:Ue.slate300,borderSubdued:Ue.slate200,borderDisabled:Ue.slate200,borderFocused:Ue.blue300,icon:Ue.slate800,iconSubdued:Ue.slate500,iconDisabled:Ue.slate400,iconOnPrimary:Ue.white,iconOnCritical:Ue.white,iconOnWarning:Ue.white,iconOnSuccess:Ue.white,text:Ue.slate800,textSubdued:Ue.slate500,textFaint:Ue.slate400,textDisabled:Ue.slate400,textOnPrimary:Ue.white,textOnCritical:Ue.white,textOnWarning:Ue.white,textOnSuccess:Ue.white,textOnContrast:Ue.white,actionPrimary:Ue.blue600,actionPrimaryHovered:Ue.blue500,actionPrimaryPressed:Ue.blue700,actionPrimaryDisabled:Ue.blue400,actionSubdued:Ue.blue100,actionSubduedHovered:Ue.blue200,actionSubduedPressed:Ue.blue300,actionSubduedDisabled:Ue.gray100,iconOnPrimarySubdued:Ue.blue600,textOnPrimarySubdued:Ue.blue600,secondary:Ue.white,secondarySubdued:Ue.slate100,surfaceSecondary:Ue.slate200,actionSecondary:Ue.white,actionSecondaryHovered:Ue.slate050,actionSecondaryDisabled:Ue.slate050,interactive:Ue.blue600,interactiveHovered:Ue.blue500,interactivePressed:Ue.blue700,interactiveDisabled:Ue.slate300,textSuccess:Ue.green600,iconSuccess:Ue.green600,borderSuccess:Ue.green300,surfaceSuccess:Ue.green300,iconWarning:Ue.orange600,actionWarning:Ue.orange600,borderWarning:Ue.orange300,surfaceWarning:Ue.orange300,textCritical:Ue.red600,iconCritical:Ue.red600,actionCritical:Ue.red600,borderCritical:Ue.red300,surfaceCritical:Ue.red300,accent:Ue.blue600,iconAccent:Ue.blue600,surfaceAccent:Ue.blue050,borderAccent:Ue.blue600};function wZ(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r0&&(i=i.replace(/^[\/]+/,"")),r0?"?":"")+a.join("&"),o}function bZ(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),wZ(e)}var _x={exports:{}},I3;function SZ(){return I3||(I3=1,function(e){(function(t){t.exports.is_uri=r,t.exports.is_http_uri=i,t.exports.is_https_uri=o,t.exports.is_web_uri=a,t.exports.isUri=r,t.exports.isHttpUri=i,t.exports.isHttpsUri=o,t.exports.isWebUri=a;var n=function(u){var l=u.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return l};function r(u){if(u&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(u)&&!/%[^0-9a-f]/i.test(u)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(u)){var l=[],f="",p="",m="",y="",w="",b="";if(l=n(u),f=l[1],p=l[2],m=l[3],y=l[4],w=l[5],!!(f&&f.length&&m.length>=0)){if(p&&p.length){if(!(m.length===0||/^\//.test(m)))return}else if(/^\/\//.test(m))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(f.toLowerCase()))return b+=f+":",p&&p.length&&(b+="//"+p),b+=m,y&&y.length&&(b+="?"+y),w&&w.length&&(b+="#"+w),b}}}function i(u,l){if(r(u)){var f=[],p="",m="",y="",w="",b="",x="",_="";if(f=n(u),p=f[1],m=f[2],y=f[3],b=f[4],x=f[5],!!p){if(l){if(p.toLowerCase()!="https")return}else if(p.toLowerCase()!="http")return;if(m)return/:(\d+)$/.test(m)&&(w=m.match(/:(\d+)$/)[0],m=m.replace(/:\d+$/,"")),_+=p+":",_+="//"+m,w&&(_+=w),_+=y,b&&b.length&&(_+="?"+b),x&&x.length&&(_+="#"+x),_}}}function o(u){return i(u,!0)}function a(u){return i(u)||o(u)}})(e)}(_x)),_x.exports}var vZ=SZ();async function xZ(e){if(vZ.isWebUri(e))return window.open(e)}const _Z="utm_source=stacking-app";function kZ(e,t){return bZ(pW,`${e}?${_Z}&chain=${t}`)}function xk(e,t){return kZ(`/txid/${e}`,t)}function Cl({href:e,children:t,...n}){const r=()=>xZ(e);return d.jsxs(ie,{onClick:r,as:"a",type:"a",cursor:"pointer",display:"block",outline:0,color:ce("brand"),_hover:{textDecoration:"underline"},_focus:{textDecoration:"underline"},...n,children:[t,d.jsx(fe,{display:"inline-block",ml:"extra-tight",mb:"1px",children:"↗"})]})}function RZ(){const{activeNetwork:e}=ms();return d.jsxs(xe,{flexDirection:["column","column","row","row"],justifyContent:"center",py:"tight",px:["loose","loose","tight","tight"],borderTop:`1px solid ${sf.borderSubdued}`,columnGap:"loose",children:[d.jsx(Cl,{color:ce("text-caption"),fontWeight:500,sx:{textDecoration:"underline"},href:`${window.location.origin}/pool-admin${cs(e)}`,children:"Pool Administration"}),d.jsx(Cl,{color:ce("text-caption"),fontWeight:500,sx:{textDecoration:"underline"},href:`${window.location.origin}/signer/generate-signature${cs(e)}`,children:"Signer Key Signature"}),d.jsx(Cl,{color:ce("text-caption"),fontWeight:500,sx:{textDecoration:"underline"},href:"https://leather.io/terms",children:"Terms of Service"}),d.jsx(Cl,{color:ce("text-caption"),fontWeight:500,sx:{textDecoration:"underline"},href:"https://leather.io/privacy-policy",children:"Privacy Policy"})]})}const TZ="data:image/svg+xml,%3csvg%20width='112'%20height='18'%20viewBox='0%200%20112%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1_13)'%3e%3cpath%20d='M38%209.49632C38.0975%2012.1873%2040.0475%2014.0788%2043.382%2014.0788C46.2485%2014.0788%2048.2375%2012.4213%2048.2375%2010.0618C48.2375%207.40982%2045.956%206.66883%2043.733%206.29833C41.6855%205.94732%2040.028%205.61582%2040.028%203.97782C40.028%202.51533%2041.2175%201.73532%2042.992%201.73532C44.8445%201.73532%2046.112%202.76882%2046.307%204.34832H48.062C47.906%201.89132%2046.034%200.194824%2042.992%200.194824C40.223%200.194824%2038.3315%201.75482%2038.3315%204.07532C38.3315%206.72732%2040.5935%207.44882%2042.797%207.81932C44.864%208.17032%2046.541%208.52132%2046.541%2010.2178C46.541%2011.6998%2045.2345%2012.5383%2043.4015%2012.5383C41.315%2012.5383%2039.8915%2011.3293%2039.755%209.49632H38Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M50.8977%2011.3683C50.8977%2013.1233%2051.5802%2013.9618%2053.4912%2013.9618H55.2267V12.4993H53.6472C52.7892%2012.4993%2052.4967%2012.1873%2052.4967%2011.3488V5.47932H55.0707V4.01682H52.4967V1.22832H50.8977V4.01682H49.1037V5.47932H50.8977V11.3683Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M65.2544%2012.4993C64.806%2012.4993%2064.6109%2012.3628%2064.6109%2011.8363V7.48783C64.6109%205.16733%2063.1484%203.89983%2060.6134%203.89983C58.2149%203.89983%2056.6354%205.05033%2056.4014%207.00033H58.0004C58.1954%205.98634%2059.1314%205.32333%2060.5354%205.32333C62.0954%205.32333%2063.0119%206.10333%2063.0119%207.39034V8.07283H60.0869C57.4739%208.07283%2056.0894%209.18433%2056.0894%2011.1733C56.0894%2012.9868%2057.5714%2014.0788%2059.7554%2014.0788C61.4714%2014.0788%2062.4659%2013.3183%2063.0899%2012.4213C63.1094%2013.3963%2063.5579%2013.9618%2064.8839%2013.9618H65.7614V12.4993H65.2544ZM63.0119%209.90583C63.0119%2011.5633%2061.8614%2012.7138%2059.8724%2012.7138C58.5464%2012.7138%2057.7079%2012.0508%2057.7079%2011.0758C57.7079%209.94483%2058.5074%209.41834%2059.9309%209.41834H63.0119V9.90583Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M71.342%2014.0788C73.76%2014.0788%2075.3785%2012.7138%2075.7685%2010.5688H74.072C73.76%2011.8363%2072.785%2012.6553%2071.3615%2012.6553C69.4505%2012.6553%2068.1635%2011.1733%2068.1635%209.00884C68.1635%206.84434%2069.4505%205.32333%2071.3615%205.32333C72.824%205.32333%2073.799%206.12283%2074.0915%207.44883H75.7685C75.359%205.26483%2073.8185%203.89983%2071.381%203.89983C68.495%203.89983%2066.5255%205.96684%2066.5255%209.00884C66.5255%2012.1093%2068.4365%2014.0788%2071.342%2014.0788Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M77.5215%2013.9618H79.1205V11.3488L81.129%209.28183L84.4245%2013.9618H86.355L82.2015%208.13132L86.082%204.01682H84.1125L79.1205%209.30132V0.311829H77.5215V13.9618Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M88.2999%202.33982C88.8849%202.33982%2089.3334%201.91082%2089.3334%201.30632C89.3334%200.701828%2088.8849%200.272827%2088.2999%200.272827C87.7149%200.272827%2087.2664%200.701828%2087.2664%201.30632C87.2664%201.91082%2087.7149%202.33982%2088.2999%202.33982ZM87.4809%2013.9618H89.0799V4.01682H87.4809V13.9618Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M96.1455%203.89983C94.4685%203.89983%2093.4545%204.60183%2092.8695%205.36233L92.655%204.01683H91.2705V13.9618H92.8695V8.98933C92.8695%206.74684%2094.0005%205.36233%2095.8725%205.36233C97.608%205.36233%2098.5635%206.45433%2098.5635%208.52133V13.9618H100.162V8.42383C100.162%205.12833%2098.388%203.89983%2096.1455%203.89983Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M110.04%205.73283C109.416%204.62133%20108.305%203.89983%20106.628%203.89983C103.878%203.89983%20101.85%205.94733%20101.85%208.98933C101.85%2012.2263%20103.878%2014.0788%20106.628%2014.0788C108.305%2014.0788%20109.377%2013.3768%20110.04%2012.2458V13.4158C110.04%2015.5803%20108.909%2016.5553%20106.823%2016.5553C105.165%2016.5553%20104.054%2015.8533%20103.781%2014.6053H102.143C102.396%2016.7893%20104.171%2017.9788%20106.706%2017.9788C110.118%2017.9788%20111.639%2016.3408%20111.639%2013.4743V4.01683H110.255L110.04%205.73283ZM106.784%2012.6553C104.814%2012.6553%20103.488%2011.1538%20103.488%208.98933C103.488%206.82483%20104.814%205.32333%20106.784%205.32333C108.734%205.32333%20110.06%206.84433%20110.06%209.02833C110.06%2011.1538%20108.734%2012.6553%20106.784%2012.6553Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M29.6813%200.0212402L21%2014.2288H23.2264L31.8928%200.0212402H29.6813Z'%20fill='%23C8C8C8'/%3e%3cpath%20d='M14%209.66052H9.73913L12.6739%2014.2288H10.5L7.01087%208.86271L3.5%2014.2288H1.32609L4.30435%209.67145H0V7.94469H14V9.66052ZM14%206.27257H0V4.53487H4.18478L1.25%200.0212402H3.42391L6.95652%205.48569L10.5%200.0212402H12.6739L9.72826%204.53487H14V6.27257Z'%20fill='%23C8C8C8'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1_13'%3e%3crect%20width='112'%20height='18'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",OZ="data:image/svg+xml,%3csvg%20width='112'%20height='18'%20viewBox='0%200%20112%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M38%209.49632C38.0975%2012.1873%2040.0475%2014.0788%2043.382%2014.0788C46.2485%2014.0788%2048.2375%2012.4213%2048.2375%2010.0618C48.2375%207.40982%2045.956%206.66883%2043.733%206.29833C41.6855%205.94732%2040.028%205.61582%2040.028%203.97782C40.028%202.51533%2041.2175%201.73532%2042.992%201.73532C44.8445%201.73532%2046.112%202.76882%2046.307%204.34832H48.062C47.906%201.89132%2046.034%200.194824%2042.992%200.194824C40.223%200.194824%2038.3315%201.75482%2038.3315%204.07532C38.3315%206.72732%2040.5935%207.44882%2042.797%207.81932C44.864%208.17032%2046.541%208.52132%2046.541%2010.2178C46.541%2011.6998%2045.2345%2012.5383%2043.4015%2012.5383C41.315%2012.5383%2039.8915%2011.3293%2039.755%209.49632H38Z'%20fill='%23242629'/%3e%3cpath%20d='M50.8977%2011.3683C50.8977%2013.1233%2051.5802%2013.9618%2053.4912%2013.9618H55.2267V12.4993H53.6472C52.7892%2012.4993%2052.4967%2012.1873%2052.4967%2011.3488V5.47932H55.0707V4.01682H52.4967V1.22832H50.8977V4.01682H49.1037V5.47932H50.8977V11.3683Z'%20fill='%23242629'/%3e%3cpath%20d='M65.2544%2012.4993C64.806%2012.4993%2064.6109%2012.3628%2064.6109%2011.8363V7.48782C64.6109%205.16732%2063.1484%203.89982%2060.6134%203.89982C58.2149%203.89982%2056.6354%205.05032%2056.4014%207.00032H58.0004C58.1954%205.98633%2059.1314%205.32332%2060.5354%205.32332C62.0954%205.32332%2063.0119%206.10332%2063.0119%207.39033V8.07282H60.0869C57.4739%208.07282%2056.0894%209.18432%2056.0894%2011.1733C56.0894%2012.9868%2057.5714%2014.0788%2059.7554%2014.0788C61.4714%2014.0788%2062.4659%2013.3183%2063.0899%2012.4213C63.1094%2013.3963%2063.5579%2013.9618%2064.8839%2013.9618H65.7614V12.4993H65.2544ZM63.0119%209.90582C63.0119%2011.5633%2061.8614%2012.7138%2059.8724%2012.7138C58.5464%2012.7138%2057.7079%2012.0508%2057.7079%2011.0758C57.7079%209.94482%2058.5074%209.41833%2059.9309%209.41833H63.0119V9.90582Z'%20fill='%23242629'/%3e%3cpath%20d='M71.342%2014.0788C73.76%2014.0788%2075.3785%2012.7138%2075.7685%2010.5688H74.072C73.76%2011.8363%2072.785%2012.6553%2071.3615%2012.6553C69.4505%2012.6553%2068.1635%2011.1733%2068.1635%209.00883C68.1635%206.84433%2069.4505%205.32332%2071.3615%205.32332C72.824%205.32332%2073.799%206.12282%2074.0915%207.44882H75.7685C75.359%205.26482%2073.8185%203.89982%2071.381%203.89982C68.495%203.89982%2066.5255%205.96683%2066.5255%209.00883C66.5255%2012.1093%2068.4365%2014.0788%2071.342%2014.0788Z'%20fill='%23242629'/%3e%3cpath%20d='M77.5215%2013.9618H79.1205V11.3488L81.129%209.28182L84.4245%2013.9618H86.355L82.2015%208.13132L86.082%204.01682H84.1125L79.1205%209.30132V0.311824H77.5215V13.9618Z'%20fill='%23242629'/%3e%3cpath%20d='M88.2999%202.33982C88.8849%202.33982%2089.3334%201.91082%2089.3334%201.30632C89.3334%200.701825%2088.8849%200.272824%2088.2999%200.272824C87.7149%200.272824%2087.2664%200.701825%2087.2664%201.30632C87.2664%201.91082%2087.7149%202.33982%2088.2999%202.33982ZM87.4809%2013.9618H89.0799V4.01682H87.4809V13.9618Z'%20fill='%23242629'/%3e%3cpath%20d='M96.1455%203.89982C94.4685%203.89982%2093.4545%204.60182%2092.8695%205.36232L92.655%204.01682H91.2705V13.9618H92.8695V8.98932C92.8695%206.74683%2094.0005%205.36232%2095.8725%205.36232C97.608%205.36232%2098.5635%206.45432%2098.5635%208.52132V13.9618H100.162V8.42382C100.162%205.12832%2098.388%203.89982%2096.1455%203.89982Z'%20fill='%23242629'/%3e%3cpath%20d='M110.04%205.73282C109.416%204.62132%20108.305%203.89982%20106.628%203.89982C103.878%203.89982%20101.85%205.94732%20101.85%208.98932C101.85%2012.2263%20103.878%2014.0788%20106.628%2014.0788C108.305%2014.0788%20109.377%2013.3768%20110.04%2012.2458V13.4158C110.04%2015.5803%20108.909%2016.5553%20106.823%2016.5553C105.165%2016.5553%20104.054%2015.8533%20103.781%2014.6053H102.143C102.396%2016.7893%20104.171%2017.9788%20106.706%2017.9788C110.118%2017.9788%20111.639%2016.3408%20111.639%2013.4743V4.01682H110.255L110.04%205.73282ZM106.784%2012.6553C104.814%2012.6553%20103.488%2011.1538%20103.488%208.98932C103.488%206.82482%20104.814%205.32332%20106.784%205.32332C108.734%205.32332%20110.06%206.84432%20110.06%209.02832C110.06%2011.1538%20108.734%2012.6553%20106.784%2012.6553Z'%20fill='%23242629'/%3e%3cpath%20d='M29.6813%200.0212402L21%2014.2288H23.2264L31.8928%200.0212402H29.6813Z'%20fill='%23242629'/%3e%3cpath%20d='M14%209.66052H9.73913L12.6739%2014.2288H10.5L7.01087%208.86271L3.5%2014.2288H1.32609L4.30435%209.67145H0V7.94469H14V9.66052ZM14%206.27257H0V4.53487H4.18478L1.25%200.0212402H3.42391L6.95652%205.48569L10.5%200.0212402H12.6739L9.72826%204.53487H14V6.27257Z'%20fill='%23242629'/%3e%3c/svg%3e";function NZ(e,t=4){return`${e.substring(0,t+2)}…${e.substring(e.length-t)}`}function Mi(e,t=5){var i,o;if(!e)return"";if(e.startsWith("0x"))return NZ(e,t);if(e.includes(".")){const a=e.split("."),u=(i=a[0])==null?void 0:i.substring(0,t),l=(o=a[0])==null?void 0:o.substring(a[0].length-t,a[0].length);return`${u}…${l}.${a[1]}`}if(e.length<=2*t)return e;const n=e==null?void 0:e.substring(0,t),r=e==null?void 0:e.substring(e.length-t,e.length);return`${n}…${r}`}var W8={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},P3=lt.createContext&<.createContext(W8),Pl=function(){return Pl=Object.assign||function(e){for(var t,n=1,r=arguments.length;nd.jsx(ie,{as:"h1",fontSize:"40px",lineHeight:"56px",display:"block",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",color:ce("text-title"),...t,children:e}),_k={capHeight:2048,ascent:2728,descent:-680,lineGap:0,unitsPerEm:2816},Dg={capHeight:1563,ascent:2105,descent:-525,lineGap:0,unitsPerEm:2048},IZ={fontMetrics:Dg,fontSize:24,leading:32},PZ={fontMetrics:Dg,fontSize:18,leading:28},MZ={fontMetrics:Dg,fontSize:16,leading:24},LZ={fontMetrics:Dg,fontSize:14,leading:20},BZ={fontMetrics:Dg,fontSize:12,leading:16},jZ={fontMetrics:_k,fontSize:14,leading:20},DZ={fontMetrics:_k,fontSize:12,leading:16},JZ={fontMetrics:_k,fontSize:10,leading:16},$Z=e=>{switch(e){case"c3":return JZ;case"c2":return DZ;default:return jZ}},qZ=e=>{switch(e){case"h1":return IZ;case"h2":return PZ;case"h3":return MZ;case"h4":return LZ;case"h5":case"h6":return BZ;default:return}};Gr((e,t)=>d.jsx(ie,{userSelect:"none",letterSpacing:"-0.01em",fontFamily:"'Open Sauce One'",fontWeight:"500",color:ce("text-title"),ref:t,display:"block",css:qZ(e.as),...e}));Gr((e,t)=>d.jsx(ie,{letterSpacing:"-0.01em",color:ce("text-body"),display:"block",lineHeight:"1.5",ref:t,...e}));const Li=Gr(({variant:e,...t},n)=>d.jsx(ie,{letterSpacing:"-0.01em",css:$Z(e),color:ce("text-caption"),display:"block",ref:n,...t})),Nr={HOME:"/",CHOOSE_STACKING_METHOD:"/choose-stacking-method",START_POOLED_STACKING:"/start-pooled-stacking",START_DIRECT_STACKING:"/start-direct-stacking",START_LIQUID_STACKING:"/start-liquid-stacking",DIRECT_STACKING_INFO:"/direct-stacking-info",POOLED_STACKING_INFO:"/pooled-stacking-info",LOCK_MORE:"/lock-more",SELF_SERVICE_EXTEND:"/self-service-extend",SETTINGS_NETWORK:"/settings/network",ADD_NETWORK:"/settings/add-network",DELEGATE_STACK_STX:"/pool-admin/delegate-stack-stx",DELEGATE_STACK_INCREASE:"/pool-admin/delegate-stack-increase",DELEGATE_STACK_EXTEND:"/pool-admin/delegate-stack-extend",STACK_AGGREGATION_COMMIT:"/pool-admin/stack-aggregation-commit",STACK_AGGREGATION_INCREASE:"/pool-admin/stack-aggregation-increase",GENERATE_SIGNATURE:"/signer/generate-signature"};function Yn(){const e=$l(),{activeNetwork:t}=ms();return(n,r)=>{if(typeof n=="number")e(n);else{const i=zP(n,t);e(i,r)}}}const UZ=1e3,HZ=60*UZ,zZ=Gr(({children:e,...t},n)=>d.jsx(xe,{ref:n,alignItems:"center",justify:"center",borderRadius:"24px",py:"4px",px:["8px","8px","12px"],color:"white",borderWidth:"1px",...t,children:d.jsx(ie,{display:"block",lineHeight:"16px",fontSize:["10px","10px","11px"],fontWeight:600,color:"currentColor",children:e})})),G8=({children:e,bold:t})=>d.jsx(Jo,{fontSize:"20px",lineHeight:"28px",display:"block",fontWeight:t?400:void 0,children:e}),K8=({isActive:e,isDisabled:t,...n})=>d.jsx(xe,{opacity:t?.5:1,alignItems:"center",justifyContent:"space-between",position:"relative",zIndex:"999",bg:t?"bg-4":"bg",cursor:t?"not-allowed":"unset",_hover:{bg:t||e?"unset":"bgAlt",cursor:t?"not-allowed":e?"default":"pointer"},...n}),WZ=e=>()=>new rr.InfoApi(new rr.Configuration({basePath:e})).getCoreApiInfo(),Q8=({mode:e})=>d.jsx(zZ,{bg:ce("bg-4"),ml:"8px",color:ce("text-caption"),children:e}),VZ=({item:e,isActive:t,isDisabled:n,onClick:r,isCustom:i,...o})=>{var N,E;const{removeCustomNetwork:a,apiUrls:{mainnet:u,testnet:l}}=ms(),f=e.url===u,p=e.url===l,m=f||p;let y=f?dn.Mainnet:dn.Testnet;const w=n||!e.url||m,{data:b,error:x,isInitialLoading:_}=yr(["customNetworkApiInfo",e.url],WZ(e.url),{staleTime:HZ,enabled:!w,suspense:!1,useErrorBoundary:!1});!m&&b&&(y=(b==null?void 0:b.network_id)&&b.network_id);const O=HP(y)({[dn.Mainnet]:"mainnet",[dn.Testnet]:"testnet"});return d.jsxs(K8,{isActive:t,isDisabled:!!n||!!x||_,...o,children:[d.jsxs(It,{pl:"32px",pr:"32px",py:"16px",width:"100%",flexGrow:1,spacing:"8px",onClick:r,children:[d.jsxs(xe,{alignItems:"center",children:[d.jsx(G8,{children:e.label}),O?d.jsx(Q8,{mode:O}):null]}),d.jsx(Li,{display:"block",children:(N=e==null?void 0:e.url)!=null&&N.includes("//")?(E=e==null?void 0:e.url)==null?void 0:E.split("//")[1]:(e==null?void 0:e.url)||n})]}),d.jsx(xe,{alignItems:"center",pr:"32px",py:"16px",position:"relative",children:i&&!t?d.jsx(a7,{label:"Remove network",children:d.jsx(u7,{position:"relative",zIndex:999,size:"21px",icon:()=>d.jsx("span",{children:d.jsx(FZ,{size:"21px"})}),onClick:()=>a(e),"aria-label":"Remove network",_hover:{bg:"rgba(255, 255, 255, 0.25)"}})}):_?d.jsx(fs,{size:"18px",opacity:.5,color:"#666"}):x?d.jsx(Li,{color:ce("feedback-error"),children:"Offline"}):t?d.jsx(fe,{as:AZ,color:ce("feedback-success"),size:"18px"}):null})]})},GZ=({onClick:e,...t})=>{const n=Yn();return d.jsx(K8,{onClick:r=>{n(Nr.ADD_NETWORK),e==null||e(r)},py:"24px",px:"32px",borderTopWidth:"1px",...t,children:d.jsx(G8,{bold:!0,children:"Add a network"})})};function KZ({onItemClick:e}){const t=$l(),{networks:n,activeNetwork:r}=ms();return d.jsxs(d.Fragment,{children:[Object.values(n).map((i,o)=>{const a=r.url===i.url;return d.jsx(VZ,{isActive:a,item:i,isCustom:o>=3,onClick:()=>{setTimeout(()=>{if(e==null||e(i),!a){const u={pathname:"/",search:cs(i)};t(u)}},250)}},o)}),d.jsx(GZ,{onClick:()=>{e==null||e("new")}})]})}const QZ=lt.memo(KZ);function YZ(){const{networkName:e,networkLabel:t}=Pt(),n=Yn();return d.jsx(Li,{cursor:"pointer",onClick:()=>n(Nr.SETTINGS_NETWORK),children:d.jsxs(ie,{textAlign:"center",color:ce("text-caption"),children:[t,d.jsx(Q8,{mode:e})]})})}function XZ(){const{isSignedIn:e,signOut:t,signIn:n,address:r}=Mn(),[i,o]=Iw(),{activeNetwork:a}=ms(),u=$.useMemo(()=>window.matchMedia("(prefers-color-scheme: dark)").matches?TZ:OZ,[]);return d.jsxs(xe,{flexDirection:"row",justifyContent:"space-between",p:"base-loose",borderBottom:`1px solid ${ce("border")}`,children:[d.jsx(xe,{alignItems:"center",children:d.jsx(Ah,{to:`/${cs(a)}`,children:d.jsx(xe,{alignItems:"center",children:d.jsx("img",{src:u,alt:"Site logo with Stacks symbol and Stacking text"})})})}),d.jsx(fe,{children:d.jsxs(xe,{p:"sm",justify:"right",alignItems:"center",children:[d.jsx(YZ,{}),d.jsx(Cl,{href:"https://wallet.hiro.so/wallet/faq#stacking",px:"loose",children:d.jsx(ie,{color:ce("text-body"),fontWeight:500,children:"FAQ"})}),d.jsx(fe,{pr:"12px",children:e&&r?d.jsx(St,{width:"160px",boxShadow:"none",_hover:{boxShadow:"none"},mode:"tertiary",onClick:()=>t(),...o,children:i?"Sign out":Mi(r)}):d.jsx(St,{boxShadow:"none",_hover:{boxShadow:"none"},mode:"tertiary",onClick:()=>n(),children:"Connect wallet"})})]})})]})}function hb(){return{poxDisabled:!1}}function ZZ({title:e,children:t,...n}){return d.jsxs(fe,{borderRadius:"6px",border:"1px solid",borderColor:ce("border"),boxShadow:"mid",textAlign:"center",width:"100%",...n,children:[e&&d.jsx(xe,{borderBottom:"1px solid",borderColor:ce("border"),height:"40px",justifyContent:"center",alignItems:"center",children:d.jsx(ie,{textStyle:"caption",color:ce("text-caption"),children:e})}),d.jsx(fe,{my:"base",mx:"base",children:t})]})}const eee=ds` &::-webkit-scrollbar { display: none; } `,tee="mousedown",Y8="touchstart",M3=[tee,Y8],L3=e=>{if(e===Y8&&r9())return{passive:!0}};function nee(e,t){const n=!t,r=o9(t);$.useEffect(()=>{if(n)return;const i=o=>{!e.current||!r.current||e.current.contains(o.target)||r.current(o)};return M3.forEach(o=>{document.addEventListener(o,i,L3(o))}),()=>{M3.forEach(o=>{document.removeEventListener(o,i,L3(o))})}},[e,r,n])}function ree(e){return jg({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",y1:"12",x2:"5",y2:"12"}},{tag:"polyline",attr:{points:"12 19 5 12 12 5"}}]})(e)}function iee(e){return jg({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"12",y1:"16",x2:"12",y2:"12"}},{tag:"line",attr:{x1:"12",y1:"8",x2:"12.01",y2:"8"}}]})(e)}function oee(e){return jg({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"}},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"}}]})(e)}function B3(e){const{icon:t,isWaitingOnPerformedAction:n,onAction:r}=e,[i,o]=Iw();return d.jsxs(p_,{_hover:{color:ce("text-title"),cursor:n?"unset":"pointer"},borderRadius:"100%",color:ce("text-caption"),onClick:n?void 0:r,opacity:n?"0.3":"unset",placeItems:"center",position:"relative",size:"36px",transition:Pu,userSelect:"none",zIndex:9,...o,children:[d.jsx(fe,{as:t,size:"20px",color:ce("text-caption")}),d.jsx(fe,{bg:ce("invert"),borderRadius:"100%",left:0,opacity:i&&!n?.12:0,position:"absolute",size:"100%",top:0,transition:Pu})]})}function see({enableGoBack:e,icon:t,isWaitingOnPerformedAction:n,onClose:r,onGoBack:i,title:o,waitingOnPerformedActionMessage:a}){const[u,l]=Iw();return d.jsxs(xe,{pb:"base",justifyContent:"space-between",alignItems:"center",pt:"loose",px:"loose",...l,children:[e?d.jsx(B3,{icon:ree,isWaitingOnPerformedAction:n,onAction:i}):d.jsx(fe,{size:"36px"}),t&&t,o&&d.jsx(Jo,{fontSize:"20px",lineHeight:"28px",children:o}),u&&n&&d.jsx(Li,{fontSize:"14px",fontWeight:500,children:a}),r?d.jsx(B3,{icon:oee,isWaitingOnPerformedAction:n,onAction:r}):d.jsx(fe,{size:"36px"})]})}function aee(e,t,n){const r=$.useRef(null),i=$.useCallback(o=>{e&&o.key==="Escape"&&t()},[t,e]);return nee(r,!n&&e?t:null),GJ("keydown",i),r}const cee=e=>{const{children:t,enableGoBack:n,icon:r,isShowing:i,isWaitingOnPerformedAction:o,onClose:a,pauseOnClickOutside:u,title:l,waitingOnPerformedActionMessage:f,...p}=e,m=aee(i,a||(()=>{}),u),y=Yn(),w=()=>y(-1);return d.jsx(xe,{display:i?"flex":"none",bg:`rgba(0,0,0,0.${i?4:0})`,transition:Pu,position:"fixed",top:0,left:0,height:"100%",pt:"loose",width:"100%",alignItems:["flex-end","center","center"],justifyContent:"center",flexDirection:"column",zIndex:1e3,style:{pointerEvents:i?"unset":"none",userSelect:i?"unset":"none",willChange:"background"},...p,children:d.jsx(xe,{flexDirection:"column",flexGrow:0,ref:m,opacity:i?1:0,transform:i?"none":"translateY(35px)",transition:i?Pu+" 0.1s":Pu,transitionDuration:"0.4s",willChange:"transform, opacity",width:"100%",maxWidth:"472px",bg:ce("bg"),borderTopLeftRadius:"16px",borderTopRightRadius:"16px",borderBottomLeftRadius:[0,"16px","16px","16px"],borderBottomRightRadius:[0,"16px","16px","16px"],position:"relative",mt:["auto","unset","unset","unset"],maxHeight:["calc(100vh - 24px)","calc(100vh - 96px)"],children:d.jsxs(fe,{css:ds` overflow-y: scroll; ${eee} - `,children:[d.jsx(see,{enableGoBack:n,icon:r,isWaitingOnPerformedAction:o,onClose:a,onGoBack:w,title:l,waitingOnPerformedActionMessage:f}),d.jsx(xe,{maxHeight:"100%",flexGrow:1,flexDirection:"column",children:d.jsx($.Suspense,{fallback:d.jsx(d.Fragment,{}),children:t})})]})})})},lp=$.memo(cee);function uee(e){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:d.jsx("path",{d:"M5.9971 12C9.28565 12 12 9.28565 12 6.0029C12 2.71435 9.27985 0 5.9913 0C2.70855 0 0 2.71435 0 6.0029C0 9.28565 2.71435 12 5.9971 12ZM5.9971 10.7994C3.33494 10.7994 1.20638 8.65926 1.20638 6.0029C1.20638 3.34074 3.33494 1.20058 5.9913 1.20058C8.65346 1.20058 10.7936 3.34074 10.7994 6.0029C10.8052 8.65926 8.65926 10.7994 5.9971 10.7994ZM5.8695 7.14548C6.1885 7.14548 6.39149 6.96568 6.40889 6.72789C6.40889 6.70469 6.41469 6.67569 6.41469 6.65829C6.43209 6.35669 6.64089 6.1595 7.01208 5.9159C7.58627 5.53891 7.95167 5.20251 7.95167 4.53552C7.95167 3.57274 7.08168 3.01595 6.0493 3.01595C5.05752 3.01595 4.38473 3.46834 4.19913 4.01353C4.16433 4.11213 4.14693 4.21653 4.14693 4.32093C4.14693 4.59932 4.36153 4.77332 4.63412 4.77332C4.97052 4.77332 5.05172 4.59932 5.22571 4.40213C5.41131 4.11213 5.66071 3.94393 5.9971 3.94393C6.46109 3.94393 6.75689 4.20493 6.75689 4.59352C6.75689 4.94732 6.51329 5.13871 6.0203 5.48091C5.60851 5.7651 5.31271 6.0609 5.31271 6.58289V6.64669C5.31271 6.97728 5.50991 7.14548 5.8695 7.14548ZM5.8579 8.93185C6.2349 8.93185 6.54229 8.65926 6.54229 8.28806C6.54229 7.92267 6.2407 7.65007 5.8579 7.65007C5.48091 7.65007 5.17351 7.92267 5.17351 8.28806C5.17351 8.65346 5.48671 8.93185 5.8579 8.93185Z",fill:"#A1A7B3"})})}const lee=({children:e,text:t,...n})=>d.jsx(T_,{zIndex:9999999,content:d.jsx(fe,{p:"base-tight",color:"white",background:"black",borderRadius:"6px",textStyle:"body.small.medium",whiteSpace:"normal",maxWidth:"290px",children:t}),children:d.jsx(fe,{as:"span",...n,children:e})}),dee=({children:e,...t})=>d.jsx(T_,{zIndex:9999999,content:d.jsx(fe,{p:"base-tight",color:"white",background:"black",borderRadius:"6px",textStyle:"body.small.medium",whiteSpace:"normal",maxWidth:"290px",...t,children:e}),children:d.jsx(fe,{mr:"tight",children:d.jsx(uee,{cursor:"help"})})}),fee=e=>d.jsx(lee,{display:"inherit",text:"This link will take you to an external third-party website that is not affiliated with lockstacks.com.",...e});function $r({children:e,...t}){return d.jsx(fee,{display:"inline-block",children:d.jsx(Nl,{...t,children:e})})}function hee(){const{poxDisabled:e}=hb();return d.jsx(lp,{title:"PoX Disabled During Cycle #59",isShowing:e,icon:d.jsx(DP,{}),children:d.jsx(ZZ,{p:"loose",children:d.jsxs(fe,{mt:["tight","base","base","extra-loose"],mb:"extra-loose",children:[d.jsx(Fm,{children:`There was an issue in the Stacking protocol's contract with the "stack-increase" function that has required an emergency network upgrade.`}),d.jsx(Fm,{children:"Do not interact with current stacking (pox-2) now. It is just a waste of transaction fees."}),d.jsxs(Fm,{children:["During cycle #58 and #59 your STX are unlocked. Enjoy your liquid STX! Wait until the new stacking (pox-3) is live and available here. Estimated date:"," ",d.jsx($r,{href:"https://stacks-network.github.io/when-activation/2.4/",children:"end of May 2023"}),"."]}),d.jsx(Fm,{children:"There will be no stacking rewards for #58 and #59 because disabling PoX means a switch to Proof of Burn. Rewards for cycle #57 are reduced due to the stack-increase issue. The stacked amount for each reward slot has been calculated incorrectly as 180k STX."}),d.jsxs(Fm,{children:["The Stacks blockchain has been upgraded to Stacks 2.3 and there will be another upgrade from Stacks 2.3 to Stacks 2.4 at the end of cycle #59. The details are described in the governance proposal 22. See"," ",d.jsx($r,{href:"https://github.com/stacksgov/sips/blob/main/sips/sip-022/sip-022-emergency-pox-fix.md#enroll-beta",children:"SIP-22"}),"."]})]})})})}function Fm({...e}){return d.jsx(xe,{alignItems:"center",my:"base",children:d.jsx(ie,{display:"block",textStyle:"body.large.medium",color:ce("text-body"),...e})})}function j3(){return d.jsx(d.Fragment,{children:d.jsxs(xe,{h:"100vh",flexDirection:"column",children:[d.jsx(XZ,{}),d.jsx(hee,{}),d.jsx(fe,{flexGrow:1,children:d.jsx(s_,{})}),d.jsx(RZ,{})]})})}function bs({id:e,children:t}){return d.jsx(fe,{bg:ce("feedback-error"),icon:d.jsx(DP,{size:16}),title:`Error ${e||""}`,color:ce("text-body"),px:"loose",children:t})}function Pn(e){return d.jsx(fe,{height:"1px",width:"100%",backgroundColor:ce("border"),...e})}function Ln(e){return d.jsx(xe,{flexDirection:"column",boxShadow:"low",border:`1px solid ${ce("border")}`,borderRadius:"8px",minHeight:"84px",...e})}const wr=({children:e,...t})=>{const n=Array.isArray(e)?e:[e],r=n.flatMap((i,o)=>$.isValidElement(i)?[$.cloneElement(i,{key:o,mb:o===n.length?"280px":void 0}),o!==n.length-1&&d.jsx(Pn,{my:"loose"},o.toString()+"-hr")]:null);return d.jsx(fe,{...t,children:r})},bt=({children:e,...t})=>d.jsx(It,{...t,spacing:"base-tight",children:e}),Me=e=>d.jsx(xe,{justifyContent:"space-between",...e}),Ve=({children:e,...t})=>d.jsxs(xe,{color:ce("text-caption"),alignItems:"center",...t,children:[d.jsx(fe,{mr:t.explainer?"tight":void 0,children:e}),t.explainer&&d.jsx(dee,{children:t.explainer})]}),Ge=e=>d.jsx(ie,{textStyle:"body.large.medium",textAlign:"right",color:ce("text-caption"),...e});function Mt({id:e,children:t}){return d.jsx(Ln,{m:"extra-loose",justify:"center",align:"center",bg:ce("feedback-error"),children:d.jsx(bs,{id:e,children:t})})}function br(){return d.jsx(xe,{justify:"center",align:"center",m:"loose",p:"loose",children:d.jsx(fs,{})})}function X8(){return d.jsx(fe,{color:ce("text-caption"),backgroundColor:ce("bg"),fontSize:"12px",textAlign:"center",px:"24px",py:"8px",children:"This website provides the interface to connect with the Stacking protocol or delegate to a Stacking pool provider directly. We don't provide the Stacking service ourselves."})}function pee(e){return e.tx_type==="contract_call"}function mee(e){return e.tx_type==="contract_call"}function gee(e,t,n){return e.find(r=>!mee(r)||!r.is_unanchored?!1:sp(r.tx_result.hex).type===we.ResponseOk&&n(r,t))}function yee(e,t,n){return e.find(r=>pee(r)?n(r,t):!1)}async function pb({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,transactionPredicate:i,transactionConverter:o}){const[a,u,l]=await Promise.all([e.getStackingContract(),t.getAccountTransactions({principal:n,unanchored:!0,limit:50}),r.getAddressMempoolTransactions({address:n,unanchored:!0})]),f=gee(u.results,a,i),p=yee(l.results,a,i),m=wee(f,p);return m?o(m):null}function wee(e,t){if(!e&&t)return t;if(e&&!t)return e;if(e&&t)return e.nonce>t.nonce?e:t}function Z8(e,t){if(!e||e.type!==we.UInt)throw new Error(`Expected '${t}' to be of type 'UInt'.`);return BigInt(e.value)}function bee(e){return["delegate-stx","revoke-delegate-stx"].includes(e.contract_call.function_name)}function See(e){if(!e||e.type!==we.PrincipalStandard&&e.type!==we.PrincipalContract)throw new Error("Expected `delegate-to` to be defined.");return Kd(e)}function vee(e){return t=>{const n=ju(e);if(t.contract_call.function_name==="revoke-delegate-stx")return{delegated:!1};if(t.contract_call.function_name==="delegate-stx"){const r=t.contract_call.function_args;if(!Array.isArray(r))return console.error("Detected a non-standard delegate-stx transaction."),{delegated:!1};const[i,o,a,u]=r.map(w=>sp(w.hex));if(!i||i.type!==we.UInt)throw new Error("Expected `amount-ustx` to be defined.");const l=BigInt(i.value);let f;t.contract_call.contract_id===n[wt.WrapperFastPool]||t.contract_call.contract_id===n[wt.WrapperRestake]?f=void 0:a&&a.type===we.OptionalSome&&a.value.type===we.UInt&&(f=Number(a.value.value));const p=t.contract_call.contract_id===n[wt.WrapperFastPool]?n[wt.WrapperFastPool]:t.contract_call.contract_id===n[wt.WrapperRestake]?n[wt.WrapperRestake]:See(o),y=u!==void 0?(w=>{const{version:b,hashBytes:x}=d8(w);return{version:b,hashbytes:x}})(u):void 0;return{delegated:!0,details:{amount_micro_stx:l,delegated_to:p,until_burn_ht:f,pox_address:y}}}return console.error("Processed a non-delegation transaction. Only delegation-related transaction should be used with this function."),{delegated:!1}}}async function xee({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,network:i}){const o=await pb({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,transactionConverter:vee(i),transactionPredicate:bee});return o!==null?o:e.getDelegationStatus()}function mb(){const{client:e}=kn(),{address:t}=Mn(),{network:n}=Pt();return gb({client:e,address:t,network:n})}function gb({client:e,address:t,network:n}){const{accountsApi:r,smartContractsApi:i,transactionsApi:o}=Qw();if(!e)throw new Error("Expected to have a StackingClient available in the context.");if(!t)throw new Error("Expected `address` to be defined.");return yr(["delegation-status",e,r,t,i,o],async()=>xee({stackingClient:e,accountsApi:r,address:t,smartContractsApi:i,transactionsApi:o,network:n}),{refetchInterval:5e3})}const _ee="/lockstacks/assets/stack-by-yourself-BjH61a7H.svg";function kee(e){return d.jsxs("svg",{width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 5c0 .675-.223 1.299-.6 1.8C7.372 7.53 8 8.69 8 10v4H0v-4c0-1.309.628-2.47 1.6-3.2A3 3 0 1 1 7 5ZM4 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-2 4a2 2 0 1 1 4 0v2H2v-2Z",fill:"#000"}),d.jsx("path",{d:"M16 5a1 1 0 0 0-1-1h-4a1 1 0 1 0 0 2h4a1 1 0 0 0 1-1Z",fill:"#000"})]})}const Ree=e=>d.jsx(fe,{maxWidth:"1400px",height:"100%",as:"main",mx:"auto",...e}),Tee=e=>d.jsx(xe,{justifyContent:"space-between",flexDirection:["column","column","column","row"],width:"100%",my:"56px",...e}),kk=({children:e,...t})=>d.jsx(xe,{px:"loose",py:"extra-loose",as:"section",flexDirection:"column",borderRadius:"6px",margin:"auto",flex:1,maxWidth:[null,null,"320px","420px"],...t,children:e}),Rk=e=>d.jsx(Jo,{fontSize:"32px",mt:"base-loose",...e}),Tk=e=>d.jsx(ie,{color:ce("text-body"),textStyle:"body.large",mt:"extra-loose",...e}),Ok=e=>d.jsx(fe,{mt:["tight","base","base","extra-loose"],mb:"extra-loose",...e}),ns=e=>{const{icon:t,...n}=e;return d.jsxs(xe,{alignItems:"center",my:"base",children:[d.jsx(xe,{width:"32px",justifyContent:"center",alignItems:"center",mr:"tight",children:d.jsx(t,{})}),d.jsx(ie,{display:"block",textStyle:"body.large.medium",color:ce("text-body"),...n})]})},Nk=e=>d.jsx(St,{alignSelf:"flex-start",mt:"base",...e}),e5=e=>d.jsxs(xe,{color:ce("feedback-alert"),ml:"base",mt:"base-tight",alignItems:"center",textStyle:"body.small",...e,children:[d.jsx(KJ,{width:"16px",mt:"1px",mr:"6px"}),"Insufficient balance"]});function Ck(e){return e.hasExistingDelegation||e.hasExistingDelegatedStacking||e.hasExistingDirectStacking}function Oee(e){const t=Yn(),{signIn:n,isSigningIn:r}=Mn(),i=e.isSignedIn?Ck(e)||!e.hasEnoughBalanceToDirectStack:r;return d.jsx(Nk,{onClick:()=>{if(!e.isSignedIn){n();return}t("../start-direct-stacking")},isDisabled:i,children:"Stack independently"})}function Nee(e){return e.isSignedIn?d.jsx(d.Fragment,{children:!e.hasEnoughBalanceToDirectStack&&d.jsx(e5,{})}):null}function Cee(e){return d.jsxs(kk,{mt:["extra-loose",null,null,"unset"],children:[d.jsx(fe,{height:"130px",children:d.jsx("img",{src:_ee,width:"150px",alt:"A dark fishbowl with a lone fish facing right, perhaps contemplating the benefits of Stacking, by Eugenia Digon"})}),d.jsx(Rk,{children:"Stack independently"}),d.jsx(Tk,{children:"When you stack Independently, you'll interact with the protocol directly. This approach could be suitable if you prefer stacking in a trustless manner and meet the minimum requirement"}),d.jsxs(Ok,{children:[d.jsx(ns,{icon:ps,children:"Interact with the protocol directly"}),d.jsx(ns,{icon:kee,children:"No intermediaries"}),e.isSignedIn?d.jsxs(ns,{icon:iw,children:["Dynamic minimum (currently ",Jt(e.stackingMinimumAmountUstx),")"]}):d.jsx(ns,{icon:iw,children:"Dynamic minimum"})]}),d.jsxs(xe,{alignItems:"center",children:[d.jsx(Oee,{...e}),d.jsx(Nee,{...e})]})]})}const Eee="/lockstacks/assets/liquid-stacking-D5-0GGEi.svg";function t5(e){return d.jsxs("svg",{width:16,height:17,viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 4.644c0 .991-.48 1.87-1.221 2.416a4.013 4.013 0 0 1 1.996 2.26A4 4 0 0 1 15 12.644v2.999H1v-5A4 4 0 0 1 3.221 7.06 3 3 0 1 1 8 4.644Zm-2 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm1 9v-3a2 2 0 0 0-4 0v3h4Zm2 0h4v-1a2 2 0 0 0-4 0v1Z",fill:"#000"}),d.jsx("path",{d:"M11 8.644a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z",fill:"#000"})]})}function Aee(e){const t=Yn(),{signIn:n,isSigningIn:r}=Mn(),i=e.isSignedIn?!e.hasEnoughBalanceToPool:r;return d.jsx(Nk,{onClick:()=>{if(!e.isSignedIn){n();return}t("../start-liquid-stacking")},isDisabled:i,children:"Stack liquid"})}function n5(e){return e.isSignedIn?d.jsx(d.Fragment,{children:!e.hasEnoughBalanceToPool&&d.jsx(e5,{})}):null}function Fee(e){return d.jsxs(kk,{children:[d.jsx(fe,{height:"130px",children:d.jsx("img",{src:Eee,width:"110px",alt:"Diving board illustration with a blue gradient and ominous-looking hole by Eugenia Digon"})}),d.jsx(Rk,{children:"Liquid Stacking"}),d.jsx(Tk,{children:"Stack with a liquid stacking protocol, enabling you to retain your liquidity in stSTX tokens and auto-compound yield in STX. The provider may charge a small commission on rewards."}),d.jsxs(Ok,{children:[d.jsx(ns,{icon:ps,children:"Interact with liquid stacking contracts"}),d.jsx(ns,{icon:t5,children:"A protocol stacks on your behalf"}),d.jsx(ns,{icon:iw,children:"No minimum required"})]}),d.jsxs(xe,{alignItems:"center",children:[d.jsx(Aee,{...e}),d.jsx(n5,{...e})]})]})}function Fi({title:e,children:t,icon:n}){let r;return typeof t=="string"?r=d.jsx(_f,{children:t}):r=t,d.jsx(fe,{background:ce("bg-alt"),py:"base",px:"base-loose",borderRadius:"10px",children:d.jsxs(xe,{children:[d.jsx(fe,{mr:"base-tight",mt:"2px",children:n??d.jsx(iee,{color:ce("accent")})}),d.jsxs(fe,{children:[e&&d.jsx(ie,{textStyle:"body.small.medium",children:e}),t&&r]})]})})}function _f({children:e}){return d.jsx(ie,{textStyle:"body.small",color:ce("text-caption"),lineHeight:"22px",mt:"extra-tight",children:e})}function Iee({hasEnoughBalanceToDirectStack:e,hasEnoughBalanceToPool:t,hasExistingDelegatedStacking:n,hasExistingDelegation:r,hasExistingDirectStacking:i}){const{activeNetwork:o}=ms();return d.jsxs(It,{spacing:"base-tight",children:[(r||n)&&d.jsx(Fi,{icon:d.jsx(Th,{}),children:d.jsxs(It,{children:[d.jsx(ie,{children:"It appears that you're currently pooling. If you recently revoked your delegation after the pool unlocked your funds, you'll soon be able to pool again. This usually takes a few seconds."}),d.jsx(ie,{children:d.jsx(Li,{color:ce("brand"),to:`../pooled-stacking-info${cs(o)}`,as:Ah,children:"View your pooling info."})})]})}),i&&d.jsx(Fi,{icon:d.jsx(Th,{}),children:d.jsxs(It,{children:[d.jsx(ie,{children:"It appears that you're currently stacking. If your locking period recently ended, you'll soon be able to stack again."}),d.jsx(Li,{color:ce("brand"),to:`/direct-stacking-info${cs(o)}`,as:Ah,children:"View your stacking info."})]})}),!Ck&&!t&&!e&&d.jsx(Fi,{icon:d.jsx(Th,{}),children:d.jsxs(It,{children:[d.jsxs(ie,{children:["It appears that you don't have enough funds yet. If you recently transferred funds to this account, you'll soon be able to stack."," "]}),d.jsx($r,{display:"inline",href:SW,children:"Consider topping up your account"})]})})]})}const Pee="/lockstacks/assets/stack-in-a-pool-CnRsr47x.svg";function Mee(e){const t=Yn(),{signIn:n,isSigningIn:r}=Mn(),i=e.isSignedIn?Ck(e)||!e.hasEnoughBalanceToPool:r;return d.jsx(Nk,{onClick:()=>{if(!e.isSignedIn){n();return}t("../start-pooled-stacking")},isDisabled:i,children:"Stack in a pool"})}function Lee(e){return d.jsxs(kk,{children:[d.jsx(fe,{height:"130px",children:d.jsx("img",{src:Pee,width:"150px",alt:"Diving board illustration with a blue gradient and ominous-looking hole by Eugenia Digon"})}),d.jsx(Rk,{children:"Stack in a pool"}),d.jsx(Tk,{children:"Delegate to a Stacking pool provider, enabling you to stack even if you don't meet the minimum. The Stacking provider may maintain discretion with payment of rewards."}),d.jsxs(Ok,{children:[d.jsx(ns,{icon:ps,children:"Interact with the protocol directly"}),d.jsx(ns,{icon:t5,children:"A pool stacks on your behalf"}),d.jsx(ns,{icon:iw,children:"No minimum required"})]}),d.jsxs(xe,{alignItems:"center",children:[d.jsx(Mee,{...e}),d.jsx(n5,{...e})]})]})}function D3(){return d.jsx(fe,{display:["none","none","none","inherit"],borderLeft:`1px solid ${sf.borderSubdued}`})}function r5(e){return d.jsx(Ree,{children:d.jsxs(It,{height:"100%",justifyContent:"center",children:[e.isSignedIn&&d.jsx(fe,{pt:"base",children:d.jsx(Iee,{...e})}),d.jsxs(Tee,{children:[d.jsx(Lee,{...e}),d.jsx(D3,{}),d.jsx(Fee,{...e}),d.jsx(D3,{}),d.jsx(Cee,{...e})]})]})})}function Bee(){var i,o;const{transactionsApi:e}=Qw(),{address:t}=Mn();if(!t)throw new Error("Expected `address` to be defined.");const n=ci(),r=(o=(i=n.data)==null?void 0:i.stx)==null?void 0:o.lock_tx_id;return yr(["stacker",r,t,e],async()=>{if(!r)return{address:null};const a=await e.getTransactionById({txId:r});return jee(a)?{address:a.contract_call.contract_id}:{address:a.sender_address}},{enabled:!n.isLoading})}function jee(e){return UP(e.contract_call.contract_id)}function Dee(){return d.jsxs(fe,{children:[d.jsx(X8,{}),d.jsx(i5,{})]})}function i5(){const{isSignedIn:e}=Mn();return e?d.jsx($ee,{}):d.jsx(Jee,{})}function Jee(){return d.jsx(r5,{isSignedIn:!1})}function $ee(){const{address:e}=Mn(),t=mb(),n=vk(),r=Bee(),i=lZ(),o=rn();if(t.isLoading||n.isLoading||r.isLoading||i.isLoading||o.isLoading)return d.jsx(br,{});if(t.isError||!t.data||n.isError||typeof n.data!="bigint"||r.isError||!r.data||i.isError||typeof i.data!="bigint"||o.isError||!o.data){const w="Error retrieving stacking or delegation info.",b="beae38f3-59fb-4e0f-abdc-b837e2b6ebde";return console.error(b,w,t,n,r,i,o),d.jsx(Mt,{id:b,children:w})}const a=BigInt(o.data.min_amount_ustx),u=i.data>0,l=i.data>a,f=n.data!==0n,p=t.data.delegated,m=f&&e!==r.data.address,y=f&&e===r.data.address;return d.jsx(r5,{isSignedIn:!0,hasExistingDelegation:p,hasExistingDelegatedStacking:m,hasExistingDirectStacking:y,hasEnoughBalanceToPool:u,hasEnoughBalanceToDirectStack:l,stackingMinimumAmountUstx:a})}var qee=function(t){return Uee(t)&&!Hee(t)};function Uee(e){return!!e&&typeof e=="object"}function Hee(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Vee(e)}var zee=typeof Symbol=="function"&&Symbol.for,Wee=zee?Symbol.for("react.element"):60103;function Vee(e){return e.$$typeof===Wee}function Gee(e){return Array.isArray(e)?[]:{}}function yw(e,t){return t.clone!==!1&&t.isMergeableObject(e)?yg(Gee(e),e,t):e}function Kee(e,t,n){return e.concat(t).map(function(r){return yw(r,n)})}function Qee(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=yw(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=yw(t[i],n):r[i]=yg(e[i],t[i],n)}),r}function yg(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Kee,n.isMergeableObject=n.isMergeableObject||qee;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):Qee(e,t,n):yw(t,n)}yg.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return yg(r,i,n)},{})};var q1=yg,o5=typeof global=="object"&&global&&global.Object===Object&&global,Yee=typeof self=="object"&&self&&self.Object===Object&&self,Ss=o5||Yee||Function("return this")(),jl=Ss.Symbol,s5=Object.prototype,Xee=s5.hasOwnProperty,Zee=s5.toString,Im=jl?jl.toStringTag:void 0;function ete(e){var t=Xee.call(e,Im),n=e[Im];try{e[Im]=void 0;var r=!0}catch{}var i=Zee.call(e);return r&&(t?e[Im]=n:delete e[Im]),i}var tte=Object.prototype,nte=tte.toString;function rte(e){return nte.call(e)}var ite="[object Null]",ote="[object Undefined]",J3=jl?jl.toStringTag:void 0;function kf(e){return e==null?e===void 0?ote:ite:J3&&J3 in Object(e)?ete(e):rte(e)}function a5(e,t){return function(n){return e(t(n))}}var Ek=a5(Object.getPrototypeOf,Object);function Rf(e){return e!=null&&typeof e=="object"}var ste="[object Object]",ate=Function.prototype,cte=Object.prototype,c5=ate.toString,ute=cte.hasOwnProperty,lte=c5.call(Object);function $3(e){if(!Rf(e)||kf(e)!=ste)return!1;var t=Ek(e);if(t===null)return!0;var n=ute.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&c5.call(n)==lte}var kx,q3;function dte(){if(q3)return kx;q3=1;var e=Array.isArray,t=Object.keys,n=Object.prototype.hasOwnProperty,r=typeof Element<"u";function i(o,a){if(o===a)return!0;if(o&&a&&typeof o=="object"&&typeof a=="object"){var u=e(o),l=e(a),f,p,m;if(u&&l){if(p=o.length,p!=a.length)return!1;for(f=p;f--!==0;)if(!i(o[f],a[f]))return!1;return!0}if(u!=l)return!1;var y=o instanceof Date,w=a instanceof Date;if(y!=w)return!1;if(y&&w)return o.getTime()==a.getTime();var b=o instanceof RegExp,x=a instanceof RegExp;if(b!=x)return!1;if(b&&x)return o.toString()==a.toString();var k=t(o);if(p=k.length,p!==t(a).length)return!1;for(f=p;f--!==0;)if(!n.call(a,k[f]))return!1;if(r&&o instanceof Element&&a instanceof Element)return o===a;for(f=p;f--!==0;)if(m=k[f],!(m==="_owner"&&o.$$typeof)&&!i(o[m],a[m]))return!1;return!0}return o!==o&&a!==a}return kx=function(a,u){try{return i(a,u)}catch(l){if(l.message&&l.message.match(/stack|recursion/i)||l.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",l.name,l.message),!1;throw l}},kx}var fte=dte();const zd=Ju(fte);function hte(){this.__data__=[],this.size=0}function u5(e,t){return e===t||e!==e&&t!==t}function yb(e,t){for(var n=e.length;n--;)if(u5(e[n][0],t))return n;return-1}var pte=Array.prototype,mte=pte.splice;function gte(e){var t=this.__data__,n=yb(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():mte.call(t,n,1),--this.size,!0}function yte(e){var t=this.__data__,n=yb(t,e);return n<0?void 0:t[n][1]}function wte(e){return yb(this.__data__,e)>-1}function bte(e,t){var n=this.__data__,r=yb(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Gu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=bne}var Sne="[object Arguments]",vne="[object Array]",xne="[object Boolean]",_ne="[object Date]",kne="[object Error]",Rne="[object Function]",Tne="[object Map]",One="[object Number]",Nne="[object Object]",Cne="[object RegExp]",Ene="[object Set]",Ane="[object String]",Fne="[object WeakMap]",Ine="[object ArrayBuffer]",Pne="[object DataView]",Mne="[object Float32Array]",Lne="[object Float64Array]",Bne="[object Int8Array]",jne="[object Int16Array]",Dne="[object Int32Array]",Jne="[object Uint8Array]",$ne="[object Uint8ClampedArray]",qne="[object Uint16Array]",Une="[object Uint32Array]",gn={};gn[Mne]=gn[Lne]=gn[Bne]=gn[jne]=gn[Dne]=gn[Jne]=gn[$ne]=gn[qne]=gn[Une]=!0;gn[Sne]=gn[vne]=gn[Ine]=gn[xne]=gn[Pne]=gn[_ne]=gn[kne]=gn[Rne]=gn[Tne]=gn[One]=gn[Nne]=gn[Cne]=gn[Ene]=gn[Ane]=gn[Fne]=!1;function Hne(e){return Rf(e)&&g5(e.length)&&!!gn[kf(e)]}function Ak(e){return function(t){return e(t)}}var y5=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ym=y5&&typeof module=="object"&&module&&!module.nodeType&&module,zne=Ym&&Ym.exports===y5,Tx=zne&&o5.process,Qh=function(){try{var e=Ym&&Ym.require&&Ym.require("util").types;return e||Tx&&Tx.binding&&Tx.binding("util")}catch{}}(),G3=Qh&&Qh.isTypedArray,Wne=G3?Ak(G3):Hne,Vne=Object.prototype,Gne=Vne.hasOwnProperty;function w5(e,t){var n=$g(e),r=!n&&fne(e),i=!n&&!r&&m5(e),o=!n&&!r&&!i&&Wne(e),a=n||r||i||o,u=a?cne(e.length,String):[],l=u.length;for(var f in e)(t||Gne.call(e,f))&&!(a&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||wne(f,l)))&&u.push(f);return u}var Kne=Object.prototype;function Fk(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Kne;return e===n}var Qne=a5(Object.keys,Object),Yne=Object.prototype,Xne=Yne.hasOwnProperty;function Zne(e){if(!Fk(e))return Qne(e);var t=[];for(var n in Object(e))Xne.call(e,n)&&n!="constructor"&&t.push(n);return t}function b5(e){return e!=null&&g5(e.length)&&!l5(e)}function Ik(e){return b5(e)?w5(e):Zne(e)}function ere(e,t){return e&&bb(t,Ik(t),e)}function tre(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var nre=Object.prototype,rre=nre.hasOwnProperty;function ire(e){if(!Jg(e))return tre(e);var t=Fk(e),n=[];for(var r in e)r=="constructor"&&(t||!rre.call(e,r))||n.push(r);return n}function Pk(e){return b5(e)?w5(e,!0):ire(e)}function ore(e,t){return e&&bb(t,Pk(t),e)}var S5=typeof exports=="object"&&exports&&!exports.nodeType&&exports,K3=S5&&typeof module=="object"&&module&&!module.nodeType&&module,sre=K3&&K3.exports===S5,Q3=sre?Ss.Buffer:void 0,Y3=Q3?Q3.allocUnsafe:void 0;function are(e,t){if(t)return e.slice();var n=e.length,r=Y3?Y3(n):new e.constructor(n);return e.copy(r),r}function v5(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}var Sb=$.createContext(void 0);Sb.displayName="FormikContext";var qie=Sb.Provider;Sb.Consumer;function ar(){var e=$.useContext(Sb);return e}var ki=function(t){return typeof t=="function"},qg=function(t){return t!==null&&typeof t=="object"},Uie=function(t){return String(Math.floor(Number(t)))===t},Ox=function(t){return Object.prototype.toString.call(t)==="[object String]"},Hie=function(t){return $.Children.count(t)===0},Nx=function(t){return qg(t)&&ki(t.then)};function _i(e,t,n,r){r===void 0&&(r=0);for(var i=A5(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function F5(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?Ee.map(function(Be){return C(Be,_i(ae,Be))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Pe).then(function(Be){return Be.reduce(function(it,ht,Tt){return ht==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||ht&&(it=af(it,Ee[Tt],ht)),it},{})})},[C]),J=$.useCallback(function(ae){return Promise.all([M(ae),y.validationSchema?R(ae):{},y.validate?v(ae):{}]).then(function(Ee){var Pe=Ee[0],Be=Ee[1],it=Ee[2],ht=q1.all([Pe,Be,it],{arrayMerge:Kie});return ht})},[y.validate,y.validationSchema,M,v,R]),P=Ki(function(ae){return ae===void 0&&(ae=A.values),U({type:"SET_ISVALIDATING",payload:!0}),J(ae).then(function(Ee){return O.current&&(U({type:"SET_ISVALIDATING",payload:!1}),U({type:"SET_ERRORS",payload:Ee})),Ee})});$.useEffect(function(){a&&O.current===!0&&zd(w.current,y.initialValues)&&P(w.current)},[a,P]);var D=$.useCallback(function(ae){var Ee=ae&&ae.values?ae.values:w.current,Pe=ae&&ae.errors?ae.errors:b.current?b.current:y.initialErrors||{},Be=ae&&ae.touched?ae.touched:x.current?x.current:y.initialTouched||{},it=ae&&ae.status?ae.status:k.current?k.current:y.initialStatus;w.current=Ee,b.current=Pe,x.current=Be,k.current=it;var ht=function(){U({type:"RESET_FORM",payload:{isSubmitting:!!ae&&!!ae.isSubmitting,errors:Pe,touched:Be,status:it,values:Ee,isValidating:!!ae&&!!ae.isValidating,submitCount:ae&&ae.submitCount&&typeof ae.submitCount=="number"?ae.submitCount:0}})};if(y.onReset){var Tt=y.onReset(A.values,Rt);Nx(Tt)?Tt.then(ht):ht()}else ht()},[y.initialErrors,y.initialStatus,y.initialTouched]);$.useEffect(function(){O.current===!0&&!zd(w.current,y.initialValues)&&f&&(w.current=y.initialValues,D(),a&&P(w.current))},[f,y.initialValues,D,a,P]),$.useEffect(function(){f&&O.current===!0&&!zd(b.current,y.initialErrors)&&(b.current=y.initialErrors||qd,U({type:"SET_ERRORS",payload:y.initialErrors||qd}))},[f,y.initialErrors]),$.useEffect(function(){f&&O.current===!0&&!zd(x.current,y.initialTouched)&&(x.current=y.initialTouched||R0,U({type:"SET_TOUCHED",payload:y.initialTouched||R0}))},[f,y.initialTouched]),$.useEffect(function(){f&&O.current===!0&&!zd(k.current,y.initialStatus)&&(k.current=y.initialStatus,U({type:"SET_STATUS",payload:y.initialStatus}))},[f,y.initialStatus,y.initialTouched]);var q=Ki(function(ae){if(N.current[ae]&&ki(N.current[ae].validate)){var Ee=_i(A.values,ae),Pe=N.current[ae].validate(Ee);return Nx(Pe)?(U({type:"SET_ISVALIDATING",payload:!0}),Pe.then(function(Be){return Be}).then(function(Be){U({type:"SET_FIELD_ERROR",payload:{field:ae,value:Be}}),U({type:"SET_ISVALIDATING",payload:!1})})):(U({type:"SET_FIELD_ERROR",payload:{field:ae,value:Pe}}),Promise.resolve(Pe))}else if(y.validationSchema)return U({type:"SET_ISVALIDATING",payload:!0}),R(A.values,ae).then(function(Be){return Be}).then(function(Be){U({type:"SET_FIELD_ERROR",payload:{field:ae,value:_i(Be,ae)}}),U({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),K=$.useCallback(function(ae,Ee){var Pe=Ee.validate;N.current[ae]={validate:Pe}},[]),Q=$.useCallback(function(ae){delete N.current[ae]},[]),H=Ki(function(ae,Ee){U({type:"SET_TOUCHED",payload:ae});var Pe=Ee===void 0?i:Ee;return Pe?P(A.values):Promise.resolve()}),X=$.useCallback(function(ae){U({type:"SET_ERRORS",payload:ae})},[]),I=Ki(function(ae,Ee){var Pe=ki(ae)?ae(A.values):ae;U({type:"SET_VALUES",payload:Pe});var Be=Ee===void 0?n:Ee;return Be?P(Pe):Promise.resolve()}),te=$.useCallback(function(ae,Ee){U({type:"SET_FIELD_ERROR",payload:{field:ae,value:Ee}})},[]),ge=Ki(function(ae,Ee,Pe){U({type:"SET_FIELD_VALUE",payload:{field:ae,value:Ee}});var Be=Pe===void 0?n:Pe;return Be?P(af(A.values,ae,Ee)):Promise.resolve()}),oe=$.useCallback(function(ae,Ee){var Pe=Ee,Be=ae,it;if(!Ox(ae)){ae.persist&&ae.persist();var ht=ae.target?ae.target:ae.currentTarget,Tt=ht.type,Bn=ht.name,Sr=ht.id,ur=ht.value,Kr=ht.checked,le=ht.outerHTML,z=ht.options,ne=ht.multiple;Pe=Ee||Bn||Sr,Be=/number|range/.test(Tt)?(it=parseFloat(ur),isNaN(it)?"":it):/checkbox/.test(Tt)?Yie(_i(A.values,Pe),Kr,ur):z&&ne?Qie(z):ur}Pe&&ge(Pe,Be)},[ge,A.values]),be=Ki(function(ae){if(Ox(ae))return function(Ee){return oe(Ee,ae)};oe(ae)}),ke=Ki(function(ae,Ee,Pe){Ee===void 0&&(Ee=!0),U({type:"SET_FIELD_TOUCHED",payload:{field:ae,value:Ee}});var Be=Pe===void 0?i:Pe;return Be?P(A.values):Promise.resolve()}),Ne=$.useCallback(function(ae,Ee){ae.persist&&ae.persist();var Pe=ae.target,Be=Pe.name,it=Pe.id,ht=Pe.outerHTML,Tt=Ee||Be||it;ke(Tt,!0)},[ke]),Xe=Ki(function(ae){if(Ox(ae))return function(Ee){return Ne(Ee,ae)};Ne(ae)}),Ze=$.useCallback(function(ae){ki(ae)?U({type:"SET_FORMIK_STATE",payload:ae}):U({type:"SET_FORMIK_STATE",payload:function(){return ae}})},[]),Nt=$.useCallback(function(ae){U({type:"SET_STATUS",payload:ae})},[]),nn=$.useCallback(function(ae){U({type:"SET_ISSUBMITTING",payload:ae})},[]),kt=Ki(function(){return U({type:"SUBMIT_ATTEMPT"}),P().then(function(ae){var Ee=ae instanceof Error,Pe=!Ee&&Object.keys(ae).length===0;if(Pe){var Be;try{if(Be=Ct(),Be===void 0)return}catch(it){throw it}return Promise.resolve(Be).then(function(it){return O.current&&U({type:"SUBMIT_SUCCESS"}),it}).catch(function(it){if(O.current)throw U({type:"SUBMIT_FAILURE"}),it})}else if(O.current&&(U({type:"SUBMIT_FAILURE"}),Ee))throw ae})}),En=Ki(function(ae){ae&&ae.preventDefault&&ki(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&ki(ae.stopPropagation)&&ae.stopPropagation(),kt().catch(function(Ee){console.warn("Warning: An unhandled error was caught from submitForm()",Ee)})}),Rt={resetForm:D,validateForm:P,validateField:q,setErrors:X,setFieldError:te,setFieldTouched:ke,setFieldValue:ge,setStatus:Nt,setSubmitting:nn,setTouched:H,setValues:I,setFormikState:Ze,submitForm:kt},Ct=Ki(function(){return p(A.values,Rt)}),gt=Ki(function(ae){ae&&ae.preventDefault&&ki(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&ki(ae.stopPropagation)&&ae.stopPropagation(),D()}),hn=$.useCallback(function(ae){return{value:_i(A.values,ae),error:_i(A.errors,ae),touched:!!_i(A.touched,ae),initialValue:_i(w.current,ae),initialTouched:!!_i(x.current,ae),initialError:_i(b.current,ae)}},[A.errors,A.touched,A.values]),An=$.useCallback(function(ae){return{setValue:function(Pe,Be){return ge(ae,Pe,Be)},setTouched:function(Pe,Be){return ke(ae,Pe,Be)},setError:function(Pe){return te(ae,Pe)}}},[ge,ke,te]),cr=$.useCallback(function(ae){var Ee=qg(ae),Pe=Ee?ae.name:ae,Be=_i(A.values,Pe),it={name:Pe,value:Be,onChange:be,onBlur:Xe};if(Ee){var ht=ae.type,Tt=ae.value,Bn=ae.as,Sr=ae.multiple;ht==="checkbox"?Tt===void 0?it.checked=!!Be:(it.checked=!!(Array.isArray(Be)&&~Be.indexOf(Tt)),it.value=Tt):ht==="radio"?(it.checked=Be===Tt,it.value=Tt):Bn==="select"&&Sr&&(it.value=it.value||[],it.multiple=!0)}return it},[Xe,be,A.values]),zn=$.useMemo(function(){return!zd(w.current,A.values)},[w.current,A.values]),qt=$.useMemo(function(){return typeof u<"u"?zn?A.errors&&Object.keys(A.errors).length===0:u!==!1&&ki(u)?u(y):u:A.errors&&Object.keys(A.errors).length===0},[u,zn,A.errors,y]),on=yn({},A,{initialValues:w.current,initialErrors:b.current,initialTouched:x.current,initialStatus:k.current,handleBlur:Xe,handleChange:be,handleReset:gt,handleSubmit:En,resetForm:D,setErrors:X,setFormikState:Ze,setFieldTouched:ke,setFieldValue:ge,setFieldError:te,setStatus:Nt,setSubmitting:nn,setTouched:H,setValues:I,submitForm:kt,validateForm:P,validateField:q,isValid:qt,dirty:zn,unregisterField:Q,registerField:K,getFieldProps:cr,getFieldMeta:hn,getFieldHelpers:An,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return on}function Bi(e){var t=Wie(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return $.useImperativeHandle(o,function(){return t}),$.createElement(qie,{value:t},n?$.createElement(n,t):i?i(t):r?ki(r)?r(t):Hie(r)?null:$.Children.only(r):null)}function Vie(e){var t={};if(e.inner){if(e.inner.length===0)return af(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;_i(t,a.path)||(t=af(t,a.path,a.message))}}return t}function Gie(e,t,n,r){n===void 0&&(n=!1);var i=V1(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function V1(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||$3(i)?V1(i):i!==""?i:void 0}):$3(e[r])?t[r]=V1(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function Kie(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var u=n.clone!==!1,l=u&&n.isMergeableObject(o);r[a]=l?q1(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=q1(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function Qie(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function Yie(e,t,n){if(typeof e=="boolean")return!!t;var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var Xie=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?$.useLayoutEffect:$.useEffect;function Ki(e){var t=$.useRef(e);return Xie(function(){t.current=e}),$.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i=this._maxSize&&this.clear(),O in this._values||this._size++,this._values[O]=N};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,i=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,a=512,u=new e(a),l=new e(a),f=new e(a);Ex={Cache:e,split:m,normalizePath:p,setter:function(O){var N=p(O);return l.get(O)||l.set(O,function(T,B){for(var A=0,U=N.length,v=T;Ap.match(e)||[],n=p=>p[0].toUpperCase()+p.slice(1),r=(p,m)=>t(p).join(m).toLowerCase(),i=p=>t(p).reduce((m,y)=>`${m}${m?y[0].toUpperCase()+y.slice(1).toLowerCase():y.toLowerCase()}`,"");return Ax={words:t,upperFirst:n,camelCase:i,pascalCase:p=>n(i(p)),snakeCase:p=>r(p,"_"),kebabCase:p=>r(p,"-"),sentenceCase:p=>n(r(p," ")),titleCase:p=>t(p).map(n).join(" ")},Ax}var Fx=eoe(),T0={exports:{}},mI;function toe(){if(mI)return T0.exports;mI=1,T0.exports=function(i){return e(t(i),i)},T0.exports.array=e;function e(i,o){var a=i.length,u=new Array(a),l={},f=a,p=n(o),m=r(i);for(o.forEach(function(w){if(!m.has(w[0])||!m.has(w[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});f--;)l[f]||y(i[f],f,new Set);return u;function y(w,b,x){if(x.has(w)){var k;try{k=", node was:"+JSON.stringify(w)}catch{k=""}throw new Error("Cyclic dependency"+k)}if(!m.has(w))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(w));if(!l[b]){l[b]=!0;var O=p.get(w)||new Set;if(O=Array.from(O),b=O.length){x.add(w);do{var N=O[--b];y(N,m.get(N),x)}while(b);x.delete(w)}u[--a]=w}}}function t(i){for(var o=new Set,a=0,u=i.length;a"",coe=/^Symbol\((.*)\)(.*)$/;function uoe(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function gI(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return uoe(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return aoe.call(e).replace(coe,"Symbol($1)");const r=ioe.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+ooe.call(e)+"]":r==="RegExp"?soe.call(e):null}function Ch(e,t){let n=gI(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let o=gI(this[r],t);return o!==null?o:i},2)}function I5(e){return e==null?[]:[].concat(e)}let loe=/\$\{\s*(\w+)\s*\}/g;class Oi extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=Object.assign({},n,{path:r})),typeof t=="string"?t.replace(loe,(i,o)=>Ch(n[o])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],I5(t).forEach(o=>{Oi.isError(o)?(this.errors.push(...o.errors),this.inner=this.inner.concat(o.inner.length?o.inner:o)):this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,Oi)}}let Tu={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${Ch(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Ch(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Ch(n,!0)}\``+i}},ko={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},xl={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},G1={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},doe={isValue:"${path} field must be ${value}"},K1={noUnknown:"${path} field has unspecified keys: ${unknown}"},foe={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:Tu,string:ko,number:xl,date:G1,object:K1,array:foe,boolean:doe});const Dk=e=>e&&e.__isYupSchema__;class ww{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:o}=n,a=typeof r=="function"?r:(...u)=>u.every(l=>l===r);return new ww(t,(u,l)=>{var f;let p=a(...u)?i:o;return(f=p==null?void 0:p(l))!=null?f:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(o=>o.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!Dk(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const O0={context:"$",value:"."};class Nf{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===O0.context,this.isValue=this.key[0]===O0.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?O0.context:this.isValue?O0.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&cf.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Nf.prototype.__isYupRef=!0;const Eu=e=>e==null;function sh(e){function t({value:n,path:r="",options:i,originalValue:o,schema:a},u,l){const{name:f,test:p,params:m,message:y,skipAbsent:w}=e;let{parent:b,context:x,abortEarly:k=a.spec.abortEarly}=i;function O(C){return Nf.isRef(C)?C.getValue(n,b,x):C}function N(C={}){const M=Object.assign({value:n,originalValue:o,label:a.spec.label,path:C.path||r,spec:a.spec},m,C.params);for(const P of Object.keys(M))M[P]=O(M[P]);const J=new Oi(Oi.formatError(C.message||y,M),n,M.path,C.type||f);return J.params=M,J}const E=k?u:l;let T={path:r,parent:b,type:f,from:i.from,createError:N,resolve:O,options:i,originalValue:o,schema:a};const B=C=>{Oi.isError(C)?E(C):C?l(null):E(N())},A=C=>{Oi.isError(C)?E(C):u(C)},U=w&&Eu(n);if(!i.sync){try{Promise.resolve(U?!0:p.call(T,n,T)).then(B,A)}catch(C){A(C)}return}let v;try{var R;if(v=U?!0:p.call(T,n,T),typeof((R=v)==null?void 0:R.then)=="function")throw new Error(`Validation test of type: "${T.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(C){A(C);return}B(v)}return t.OPTIONS=e,t}function hoe(e,t,n,r=n){let i,o,a;return t?(cf.forEach(t,(u,l,f)=>{let p=l?u.slice(1,u.length-1):u;e=e.resolve({context:r,parent:i,value:n});let m=e.type==="tuple",y=f?parseInt(p,10):0;if(e.innerType||m){if(m&&!f)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&y>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[y],e=m?e.spec.types[y]:e.innerType}if(!f){if(!e.fields||!e.fields[p])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);i=n,n=n&&n[p],e=e.fields[p]}o=p,a=l?"["+u+"]":"."+u}),{schema:e,parent:i,parentPath:o}):{parent:i,parentPath:t,schema:e}}class bw extends Set{describe(){const t=[];for(const n of this.values())t.push(Nf.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new bw(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function xh(e,t=new Map){if(Dk(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r{this.typeError(Tu.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=xh(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(o=>{t.tests.forEach(a=>{o.test(a.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,o)=>o.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",o=r._cast(t,n);if(n.assert!==!1&&!r.isType(o)){if(i&&Eu(o))return o;let a=Ch(t),u=Ch(o);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". + `,children:[d.jsx(see,{enableGoBack:n,icon:r,isWaitingOnPerformedAction:o,onClose:a,onGoBack:w,title:l,waitingOnPerformedActionMessage:f}),d.jsx(xe,{maxHeight:"100%",flexGrow:1,flexDirection:"column",children:d.jsx($.Suspense,{fallback:d.jsx(d.Fragment,{}),children:t})})]})})})},lp=$.memo(cee);function uee(e){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:d.jsx("path",{d:"M5.9971 12C9.28565 12 12 9.28565 12 6.0029C12 2.71435 9.27985 0 5.9913 0C2.70855 0 0 2.71435 0 6.0029C0 9.28565 2.71435 12 5.9971 12ZM5.9971 10.7994C3.33494 10.7994 1.20638 8.65926 1.20638 6.0029C1.20638 3.34074 3.33494 1.20058 5.9913 1.20058C8.65346 1.20058 10.7936 3.34074 10.7994 6.0029C10.8052 8.65926 8.65926 10.7994 5.9971 10.7994ZM5.8695 7.14548C6.1885 7.14548 6.39149 6.96568 6.40889 6.72789C6.40889 6.70469 6.41469 6.67569 6.41469 6.65829C6.43209 6.35669 6.64089 6.1595 7.01208 5.9159C7.58627 5.53891 7.95167 5.20251 7.95167 4.53552C7.95167 3.57274 7.08168 3.01595 6.0493 3.01595C5.05752 3.01595 4.38473 3.46834 4.19913 4.01353C4.16433 4.11213 4.14693 4.21653 4.14693 4.32093C4.14693 4.59932 4.36153 4.77332 4.63412 4.77332C4.97052 4.77332 5.05172 4.59932 5.22571 4.40213C5.41131 4.11213 5.66071 3.94393 5.9971 3.94393C6.46109 3.94393 6.75689 4.20493 6.75689 4.59352C6.75689 4.94732 6.51329 5.13871 6.0203 5.48091C5.60851 5.7651 5.31271 6.0609 5.31271 6.58289V6.64669C5.31271 6.97728 5.50991 7.14548 5.8695 7.14548ZM5.8579 8.93185C6.2349 8.93185 6.54229 8.65926 6.54229 8.28806C6.54229 7.92267 6.2407 7.65007 5.8579 7.65007C5.48091 7.65007 5.17351 7.92267 5.17351 8.28806C5.17351 8.65346 5.48671 8.93185 5.8579 8.93185Z",fill:"#A1A7B3"})})}const lee=({children:e,text:t,...n})=>d.jsx(T_,{zIndex:9999999,content:d.jsx(fe,{p:"base-tight",color:"white",background:"black",borderRadius:"6px",textStyle:"body.small.medium",whiteSpace:"normal",maxWidth:"290px",children:t}),children:d.jsx(fe,{as:"span",...n,children:e})}),dee=({children:e,...t})=>d.jsx(T_,{zIndex:9999999,content:d.jsx(fe,{p:"base-tight",color:"white",background:"black",borderRadius:"6px",textStyle:"body.small.medium",whiteSpace:"normal",maxWidth:"290px",...t,children:e}),children:d.jsx(fe,{mr:"tight",children:d.jsx(uee,{cursor:"help"})})}),fee=e=>d.jsx(lee,{display:"inherit",text:"This link will take you to an external third-party website that is not affiliated with lockstacks.com.",...e});function $r({children:e,...t}){return d.jsx(fee,{display:"inline-block",children:d.jsx(Cl,{...t,children:e})})}function hee(){const{poxDisabled:e}=hb();return d.jsx(lp,{title:"PoX Disabled During Cycle #59",isShowing:e,icon:d.jsx(DP,{}),children:d.jsx(ZZ,{p:"loose",children:d.jsxs(fe,{mt:["tight","base","base","extra-loose"],mb:"extra-loose",children:[d.jsx(Fm,{children:`There was an issue in the Stacking protocol's contract with the "stack-increase" function that has required an emergency network upgrade.`}),d.jsx(Fm,{children:"Do not interact with current stacking (pox-2) now. It is just a waste of transaction fees."}),d.jsxs(Fm,{children:["During cycle #58 and #59 your STX are unlocked. Enjoy your liquid STX! Wait until the new stacking (pox-3) is live and available here. Estimated date:"," ",d.jsx($r,{href:"https://stacks-network.github.io/when-activation/2.4/",children:"end of May 2023"}),"."]}),d.jsx(Fm,{children:"There will be no stacking rewards for #58 and #59 because disabling PoX means a switch to Proof of Burn. Rewards for cycle #57 are reduced due to the stack-increase issue. The stacked amount for each reward slot has been calculated incorrectly as 180k STX."}),d.jsxs(Fm,{children:["The Stacks blockchain has been upgraded to Stacks 2.3 and there will be another upgrade from Stacks 2.3 to Stacks 2.4 at the end of cycle #59. The details are described in the governance proposal 22. See"," ",d.jsx($r,{href:"https://github.com/stacksgov/sips/blob/main/sips/sip-022/sip-022-emergency-pox-fix.md#enroll-beta",children:"SIP-22"}),"."]})]})})})}function Fm({...e}){return d.jsx(xe,{alignItems:"center",my:"base",children:d.jsx(ie,{display:"block",textStyle:"body.large.medium",color:ce("text-body"),...e})})}function j3(){return d.jsx(d.Fragment,{children:d.jsxs(xe,{h:"100vh",flexDirection:"column",children:[d.jsx(XZ,{}),d.jsx(hee,{}),d.jsx(fe,{flexGrow:1,children:d.jsx(s_,{})}),d.jsx(RZ,{})]})})}function bs({id:e,children:t}){return d.jsx(fe,{bg:ce("feedback-error"),icon:d.jsx(DP,{size:16}),title:`Error ${e||""}`,color:ce("text-body"),px:"loose",children:t})}function Pn(e){return d.jsx(fe,{height:"1px",width:"100%",backgroundColor:ce("border"),...e})}function Ln(e){return d.jsx(xe,{flexDirection:"column",boxShadow:"low",border:`1px solid ${ce("border")}`,borderRadius:"8px",minHeight:"84px",...e})}const wr=({children:e,...t})=>{const n=Array.isArray(e)?e:[e],r=n.flatMap((i,o)=>$.isValidElement(i)?[$.cloneElement(i,{key:o,mb:o===n.length?"280px":void 0}),o!==n.length-1&&d.jsx(Pn,{my:"loose"},o.toString()+"-hr")]:null);return d.jsx(fe,{...t,children:r})},bt=({children:e,...t})=>d.jsx(It,{...t,spacing:"base-tight",children:e}),Me=e=>d.jsx(xe,{justifyContent:"space-between",...e}),Ve=({children:e,...t})=>d.jsxs(xe,{color:ce("text-caption"),alignItems:"center",...t,children:[d.jsx(fe,{mr:t.explainer?"tight":void 0,children:e}),t.explainer&&d.jsx(dee,{children:t.explainer})]}),Ge=e=>d.jsx(ie,{textStyle:"body.large.medium",textAlign:"right",color:ce("text-caption"),...e});function Mt({id:e,children:t}){return d.jsx(Ln,{m:"extra-loose",justify:"center",align:"center",bg:ce("feedback-error"),children:d.jsx(bs,{id:e,children:t})})}function br(){return d.jsx(xe,{justify:"center",align:"center",m:"loose",p:"loose",children:d.jsx(fs,{})})}function X8(){return d.jsx(fe,{color:ce("text-caption"),backgroundColor:ce("bg"),fontSize:"12px",textAlign:"center",px:"24px",py:"8px",children:"This website provides the interface to connect with the Stacking protocol or delegate to a Stacking pool provider directly. We don't provide the Stacking service ourselves."})}function pee(e){return e.tx_type==="contract_call"}function mee(e){return e.tx_type==="contract_call"}function gee(e,t,n){return e.find(r=>!mee(r)||!r.is_unanchored?!1:sp(r.tx_result.hex).type===we.ResponseOk&&n(r,t))}function yee(e,t,n){return e.find(r=>pee(r)?n(r,t):!1)}async function pb({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,transactionPredicate:i,transactionConverter:o}){const[a,u,l]=await Promise.all([e.getStackingContract(),t.getAccountTransactions({principal:n,unanchored:!0,limit:50}),r.getAddressMempoolTransactions({address:n,unanchored:!0})]),f=gee(u.results,a,i),p=yee(l.results,a,i),m=wee(f,p);return m?o(m):null}function wee(e,t){if(!e&&t)return t;if(e&&!t)return e;if(e&&t)return e.nonce>t.nonce?e:t}function Z8(e,t){if(!e||e.type!==we.UInt)throw new Error(`Expected '${t}' to be of type 'UInt'.`);return BigInt(e.value)}function bee(e){return["delegate-stx","revoke-delegate-stx"].includes(e.contract_call.function_name)}function See(e){if(!e||e.type!==we.PrincipalStandard&&e.type!==we.PrincipalContract)throw new Error("Expected `delegate-to` to be defined.");return Kd(e)}function vee(e){return t=>{const n=ju(e);if(t.contract_call.function_name==="revoke-delegate-stx")return{delegated:!1};if(t.contract_call.function_name==="delegate-stx"){const r=t.contract_call.function_args;if(!Array.isArray(r))return console.error("Detected a non-standard delegate-stx transaction."),{delegated:!1};const[i,o,a,u]=r.map(w=>sp(w.hex));if(!i||i.type!==we.UInt)throw new Error("Expected `amount-ustx` to be defined.");const l=BigInt(i.value);let f;t.contract_call.contract_id===n[wt.WrapperFastPool]||t.contract_call.contract_id===n[wt.WrapperRestake]?f=void 0:a&&a.type===we.OptionalSome&&a.value.type===we.UInt&&(f=Number(a.value.value));const p=t.contract_call.contract_id===n[wt.WrapperFastPool]?n[wt.WrapperFastPool]:t.contract_call.contract_id===n[wt.WrapperRestake]?n[wt.WrapperRestake]:See(o),y=u!==void 0?(w=>{const{version:b,hashBytes:x}=d8(w);return{version:b,hashbytes:x}})(u):void 0;return{delegated:!0,details:{amount_micro_stx:l,delegated_to:p,until_burn_ht:f,pox_address:y}}}return console.error("Processed a non-delegation transaction. Only delegation-related transaction should be used with this function."),{delegated:!1}}}async function xee({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,network:i}){const o=await pb({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,transactionConverter:vee(i),transactionPredicate:bee});return o!==null?o:e.getDelegationStatus()}function mb(){const{client:e}=kn(),{address:t}=Mn(),{network:n}=Pt();return gb({client:e,address:t,network:n})}function gb({client:e,address:t,network:n}){const{accountsApi:r,smartContractsApi:i,transactionsApi:o}=Qw();if(!e)throw new Error("Expected to have a StackingClient available in the context.");if(!t)throw new Error("Expected `address` to be defined.");return yr(["delegation-status",e,r,t,i,o],async()=>xee({stackingClient:e,accountsApi:r,address:t,smartContractsApi:i,transactionsApi:o,network:n}),{refetchInterval:5e3})}const _ee="/lockstacks/assets/stack-by-yourself-BjH61a7H.svg";function kee(e){return d.jsxs("svg",{width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 5c0 .675-.223 1.299-.6 1.8C7.372 7.53 8 8.69 8 10v4H0v-4c0-1.309.628-2.47 1.6-3.2A3 3 0 1 1 7 5ZM4 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-2 4a2 2 0 1 1 4 0v2H2v-2Z",fill:"#000"}),d.jsx("path",{d:"M16 5a1 1 0 0 0-1-1h-4a1 1 0 1 0 0 2h4a1 1 0 0 0 1-1Z",fill:"#000"})]})}const Ree=e=>d.jsx(fe,{maxWidth:"1400px",height:"100%",as:"main",mx:"auto",...e}),Tee=e=>d.jsx(xe,{justifyContent:"space-between",flexDirection:["column","column","column","row"],width:"100%",my:"56px",...e}),kk=({children:e,...t})=>d.jsx(xe,{px:"loose",py:"extra-loose",as:"section",flexDirection:"column",borderRadius:"6px",margin:"auto",flex:1,maxWidth:[null,null,"320px","420px"],...t,children:e}),Rk=e=>d.jsx(Jo,{fontSize:"32px",mt:"base-loose",...e}),Tk=e=>d.jsx(ie,{color:ce("text-body"),textStyle:"body.large",mt:"extra-loose",...e}),Ok=e=>d.jsx(fe,{mt:["tight","base","base","extra-loose"],mb:"extra-loose",...e}),ns=e=>{const{icon:t,...n}=e;return d.jsxs(xe,{alignItems:"center",my:"base",children:[d.jsx(xe,{width:"32px",justifyContent:"center",alignItems:"center",mr:"tight",children:d.jsx(t,{})}),d.jsx(ie,{display:"block",textStyle:"body.large.medium",color:ce("text-body"),...n})]})},Nk=e=>d.jsx(St,{alignSelf:"flex-start",mt:"base",...e}),e5=e=>d.jsxs(xe,{color:ce("feedback-alert"),ml:"base",mt:"base-tight",alignItems:"center",textStyle:"body.small",...e,children:[d.jsx(KJ,{width:"16px",mt:"1px",mr:"6px"}),"Insufficient balance"]});function Ck(e){return e.hasExistingDelegation||e.hasExistingDelegatedStacking||e.hasExistingDirectStacking}function Oee(e){const t=Yn(),{signIn:n,isSigningIn:r}=Mn(),i=e.isSignedIn?Ck(e)||!e.hasEnoughBalanceToDirectStack:r;return d.jsx(Nk,{onClick:()=>{if(!e.isSignedIn){n();return}t("../start-direct-stacking")},isDisabled:i,children:"Stack independently"})}function Nee(e){return e.isSignedIn?d.jsx(d.Fragment,{children:!e.hasEnoughBalanceToDirectStack&&d.jsx(e5,{})}):null}function Cee(e){return d.jsxs(kk,{mt:["extra-loose",null,null,"unset"],children:[d.jsx(fe,{height:"130px",children:d.jsx("img",{src:_ee,width:"150px",alt:"A dark fishbowl with a lone fish facing right, perhaps contemplating the benefits of Stacking, by Eugenia Digon"})}),d.jsx(Rk,{children:"Stack independently"}),d.jsx(Tk,{children:"When you stack Independently, you'll interact with the protocol directly. This approach could be suitable if you prefer stacking in a trustless manner and meet the minimum requirement"}),d.jsxs(Ok,{children:[d.jsx(ns,{icon:ps,children:"Interact with the protocol directly"}),d.jsx(ns,{icon:kee,children:"No intermediaries"}),e.isSignedIn?d.jsxs(ns,{icon:iw,children:["Dynamic minimum (currently ",Jt(e.stackingMinimumAmountUstx),")"]}):d.jsx(ns,{icon:iw,children:"Dynamic minimum"})]}),d.jsxs(xe,{alignItems:"center",children:[d.jsx(Oee,{...e}),d.jsx(Nee,{...e})]})]})}const Eee="/lockstacks/assets/liquid-stacking-D5-0GGEi.svg";function t5(e){return d.jsxs("svg",{width:16,height:17,viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 4.644c0 .991-.48 1.87-1.221 2.416a4.013 4.013 0 0 1 1.996 2.26A4 4 0 0 1 15 12.644v2.999H1v-5A4 4 0 0 1 3.221 7.06 3 3 0 1 1 8 4.644Zm-2 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm1 9v-3a2 2 0 0 0-4 0v3h4Zm2 0h4v-1a2 2 0 0 0-4 0v1Z",fill:"#000"}),d.jsx("path",{d:"M11 8.644a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z",fill:"#000"})]})}function Aee(e){const t=Yn(),{signIn:n,isSigningIn:r}=Mn(),i=e.isSignedIn?!e.hasEnoughBalanceToPool:r;return d.jsx(Nk,{onClick:()=>{if(!e.isSignedIn){n();return}t("../start-liquid-stacking")},isDisabled:i,children:"Stack liquid"})}function n5(e){return e.isSignedIn?d.jsx(d.Fragment,{children:!e.hasEnoughBalanceToPool&&d.jsx(e5,{})}):null}function Fee(e){return d.jsxs(kk,{children:[d.jsx(fe,{height:"130px",children:d.jsx("img",{src:Eee,width:"110px",alt:"Diving board illustration with a blue gradient and ominous-looking hole by Eugenia Digon"})}),d.jsx(Rk,{children:"Liquid Stacking"}),d.jsx(Tk,{children:"Stack with a liquid stacking protocol, enabling you to retain your liquidity in stSTX tokens and auto-compound yield in STX. The provider may charge a small commission on rewards."}),d.jsxs(Ok,{children:[d.jsx(ns,{icon:ps,children:"Interact with liquid stacking contracts"}),d.jsx(ns,{icon:t5,children:"A protocol stacks on your behalf"}),d.jsx(ns,{icon:iw,children:"No minimum required"})]}),d.jsxs(xe,{alignItems:"center",children:[d.jsx(Aee,{...e}),d.jsx(n5,{...e})]})]})}function Fi({title:e,children:t,icon:n}){let r;return typeof t=="string"?r=d.jsx(kf,{children:t}):r=t,d.jsx(fe,{background:ce("bg-alt"),py:"base",px:"base-loose",borderRadius:"10px",children:d.jsxs(xe,{children:[d.jsx(fe,{mr:"base-tight",mt:"2px",children:n??d.jsx(iee,{color:ce("accent")})}),d.jsxs(fe,{children:[e&&d.jsx(ie,{textStyle:"body.small.medium",children:e}),t&&r]})]})})}function kf({children:e}){return d.jsx(ie,{textStyle:"body.small",color:ce("text-caption"),lineHeight:"22px",mt:"extra-tight",children:e})}function Iee({hasEnoughBalanceToDirectStack:e,hasEnoughBalanceToPool:t,hasExistingDelegatedStacking:n,hasExistingDelegation:r,hasExistingDirectStacking:i}){const{activeNetwork:o}=ms();return d.jsxs(It,{spacing:"base-tight",children:[(r||n)&&d.jsx(Fi,{icon:d.jsx(Oh,{}),children:d.jsxs(It,{children:[d.jsx(ie,{children:"It appears that you're currently pooling. If you recently revoked your delegation after the pool unlocked your funds, you'll soon be able to pool again. This usually takes a few seconds."}),d.jsx(ie,{children:d.jsx(Li,{color:ce("brand"),to:`../pooled-stacking-info${cs(o)}`,as:Ah,children:"View your pooling info."})})]})}),i&&d.jsx(Fi,{icon:d.jsx(Oh,{}),children:d.jsxs(It,{children:[d.jsx(ie,{children:"It appears that you're currently stacking. If your locking period recently ended, you'll soon be able to stack again."}),d.jsx(Li,{color:ce("brand"),to:`/direct-stacking-info${cs(o)}`,as:Ah,children:"View your stacking info."})]})}),!Ck&&!t&&!e&&d.jsx(Fi,{icon:d.jsx(Oh,{}),children:d.jsxs(It,{children:[d.jsxs(ie,{children:["It appears that you don't have enough funds yet. If you recently transferred funds to this account, you'll soon be able to stack."," "]}),d.jsx($r,{display:"inline",href:SW,children:"Consider topping up your account"})]})})]})}const Pee="/lockstacks/assets/stack-in-a-pool-CnRsr47x.svg";function Mee(e){const t=Yn(),{signIn:n,isSigningIn:r}=Mn(),i=e.isSignedIn?Ck(e)||!e.hasEnoughBalanceToPool:r;return d.jsx(Nk,{onClick:()=>{if(!e.isSignedIn){n();return}t("../start-pooled-stacking")},isDisabled:i,children:"Stack in a pool"})}function Lee(e){return d.jsxs(kk,{children:[d.jsx(fe,{height:"130px",children:d.jsx("img",{src:Pee,width:"150px",alt:"Diving board illustration with a blue gradient and ominous-looking hole by Eugenia Digon"})}),d.jsx(Rk,{children:"Stack in a pool"}),d.jsx(Tk,{children:"Delegate to a Stacking pool provider, enabling you to stack even if you don't meet the minimum. The Stacking provider may maintain discretion with payment of rewards."}),d.jsxs(Ok,{children:[d.jsx(ns,{icon:ps,children:"Interact with the protocol directly"}),d.jsx(ns,{icon:t5,children:"A pool stacks on your behalf"}),d.jsx(ns,{icon:iw,children:"No minimum required"})]}),d.jsxs(xe,{alignItems:"center",children:[d.jsx(Mee,{...e}),d.jsx(n5,{...e})]})]})}function D3(){return d.jsx(fe,{display:["none","none","none","inherit"],borderLeft:`1px solid ${sf.borderSubdued}`})}function r5(e){return d.jsx(Ree,{children:d.jsxs(It,{height:"100%",justifyContent:"center",children:[e.isSignedIn&&d.jsx(fe,{pt:"base",children:d.jsx(Iee,{...e})}),d.jsxs(Tee,{children:[d.jsx(Lee,{...e}),d.jsx(D3,{}),d.jsx(Fee,{...e}),d.jsx(D3,{}),d.jsx(Cee,{...e})]})]})})}function Bee(){var i,o;const{transactionsApi:e}=Qw(),{address:t}=Mn();if(!t)throw new Error("Expected `address` to be defined.");const n=ci(),r=(o=(i=n.data)==null?void 0:i.stx)==null?void 0:o.lock_tx_id;return yr(["stacker",r,t,e],async()=>{if(!r)return{address:null};const a=await e.getTransactionById({txId:r});return jee(a)?{address:a.contract_call.contract_id}:{address:a.sender_address}},{enabled:!n.isLoading})}function jee(e){return UP(e.contract_call.contract_id)}function Dee(){return d.jsxs(fe,{children:[d.jsx(X8,{}),d.jsx(i5,{})]})}function i5(){const{isSignedIn:e}=Mn();return e?d.jsx($ee,{}):d.jsx(Jee,{})}function Jee(){return d.jsx(r5,{isSignedIn:!1})}function $ee(){const{address:e}=Mn(),t=mb(),n=vk(),r=Bee(),i=lZ(),o=rn();if(t.isLoading||n.isLoading||r.isLoading||i.isLoading||o.isLoading)return d.jsx(br,{});if(t.isError||!t.data||n.isError||typeof n.data!="bigint"||r.isError||!r.data||i.isError||typeof i.data!="bigint"||o.isError||!o.data){const w="Error retrieving stacking or delegation info.",b="beae38f3-59fb-4e0f-abdc-b837e2b6ebde";return console.error(b,w,t,n,r,i,o),d.jsx(Mt,{id:b,children:w})}const a=BigInt(o.data.min_amount_ustx),u=i.data>0,l=i.data>a,f=n.data!==0n,p=t.data.delegated,m=f&&e!==r.data.address,y=f&&e===r.data.address;return d.jsx(r5,{isSignedIn:!0,hasExistingDelegation:p,hasExistingDelegatedStacking:m,hasExistingDirectStacking:y,hasEnoughBalanceToPool:u,hasEnoughBalanceToDirectStack:l,stackingMinimumAmountUstx:a})}var qee=function(t){return Uee(t)&&!Hee(t)};function Uee(e){return!!e&&typeof e=="object"}function Hee(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Vee(e)}var zee=typeof Symbol=="function"&&Symbol.for,Wee=zee?Symbol.for("react.element"):60103;function Vee(e){return e.$$typeof===Wee}function Gee(e){return Array.isArray(e)?[]:{}}function yw(e,t){return t.clone!==!1&&t.isMergeableObject(e)?yg(Gee(e),e,t):e}function Kee(e,t,n){return e.concat(t).map(function(r){return yw(r,n)})}function Qee(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=yw(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=yw(t[i],n):r[i]=yg(e[i],t[i],n)}),r}function yg(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Kee,n.isMergeableObject=n.isMergeableObject||qee;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):Qee(e,t,n):yw(t,n)}yg.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return yg(r,i,n)},{})};var q1=yg,o5=typeof global=="object"&&global&&global.Object===Object&&global,Yee=typeof self=="object"&&self&&self.Object===Object&&self,Ss=o5||Yee||Function("return this")(),Dl=Ss.Symbol,s5=Object.prototype,Xee=s5.hasOwnProperty,Zee=s5.toString,Im=Dl?Dl.toStringTag:void 0;function ete(e){var t=Xee.call(e,Im),n=e[Im];try{e[Im]=void 0;var r=!0}catch{}var i=Zee.call(e);return r&&(t?e[Im]=n:delete e[Im]),i}var tte=Object.prototype,nte=tte.toString;function rte(e){return nte.call(e)}var ite="[object Null]",ote="[object Undefined]",J3=Dl?Dl.toStringTag:void 0;function Rf(e){return e==null?e===void 0?ote:ite:J3&&J3 in Object(e)?ete(e):rte(e)}function a5(e,t){return function(n){return e(t(n))}}var Ek=a5(Object.getPrototypeOf,Object);function Tf(e){return e!=null&&typeof e=="object"}var ste="[object Object]",ate=Function.prototype,cte=Object.prototype,c5=ate.toString,ute=cte.hasOwnProperty,lte=c5.call(Object);function $3(e){if(!Tf(e)||Rf(e)!=ste)return!1;var t=Ek(e);if(t===null)return!0;var n=ute.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&c5.call(n)==lte}var kx,q3;function dte(){if(q3)return kx;q3=1;var e=Array.isArray,t=Object.keys,n=Object.prototype.hasOwnProperty,r=typeof Element<"u";function i(o,a){if(o===a)return!0;if(o&&a&&typeof o=="object"&&typeof a=="object"){var u=e(o),l=e(a),f,p,m;if(u&&l){if(p=o.length,p!=a.length)return!1;for(f=p;f--!==0;)if(!i(o[f],a[f]))return!1;return!0}if(u!=l)return!1;var y=o instanceof Date,w=a instanceof Date;if(y!=w)return!1;if(y&&w)return o.getTime()==a.getTime();var b=o instanceof RegExp,x=a instanceof RegExp;if(b!=x)return!1;if(b&&x)return o.toString()==a.toString();var _=t(o);if(p=_.length,p!==t(a).length)return!1;for(f=p;f--!==0;)if(!n.call(a,_[f]))return!1;if(r&&o instanceof Element&&a instanceof Element)return o===a;for(f=p;f--!==0;)if(m=_[f],!(m==="_owner"&&o.$$typeof)&&!i(o[m],a[m]))return!1;return!0}return o!==o&&a!==a}return kx=function(a,u){try{return i(a,u)}catch(l){if(l.message&&l.message.match(/stack|recursion/i)||l.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",l.name,l.message),!1;throw l}},kx}var fte=dte();const zd=Ju(fte);function hte(){this.__data__=[],this.size=0}function u5(e,t){return e===t||e!==e&&t!==t}function yb(e,t){for(var n=e.length;n--;)if(u5(e[n][0],t))return n;return-1}var pte=Array.prototype,mte=pte.splice;function gte(e){var t=this.__data__,n=yb(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():mte.call(t,n,1),--this.size,!0}function yte(e){var t=this.__data__,n=yb(t,e);return n<0?void 0:t[n][1]}function wte(e){return yb(this.__data__,e)>-1}function bte(e,t){var n=this.__data__,r=yb(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Ku(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=bne}var Sne="[object Arguments]",vne="[object Array]",xne="[object Boolean]",_ne="[object Date]",kne="[object Error]",Rne="[object Function]",Tne="[object Map]",One="[object Number]",Nne="[object Object]",Cne="[object RegExp]",Ene="[object Set]",Ane="[object String]",Fne="[object WeakMap]",Ine="[object ArrayBuffer]",Pne="[object DataView]",Mne="[object Float32Array]",Lne="[object Float64Array]",Bne="[object Int8Array]",jne="[object Int16Array]",Dne="[object Int32Array]",Jne="[object Uint8Array]",$ne="[object Uint8ClampedArray]",qne="[object Uint16Array]",Une="[object Uint32Array]",gn={};gn[Mne]=gn[Lne]=gn[Bne]=gn[jne]=gn[Dne]=gn[Jne]=gn[$ne]=gn[qne]=gn[Une]=!0;gn[Sne]=gn[vne]=gn[Ine]=gn[xne]=gn[Pne]=gn[_ne]=gn[kne]=gn[Rne]=gn[Tne]=gn[One]=gn[Nne]=gn[Cne]=gn[Ene]=gn[Ane]=gn[Fne]=!1;function Hne(e){return Tf(e)&&g5(e.length)&&!!gn[Rf(e)]}function Ak(e){return function(t){return e(t)}}var y5=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ym=y5&&typeof module=="object"&&module&&!module.nodeType&&module,zne=Ym&&Ym.exports===y5,Tx=zne&&o5.process,Qh=function(){try{var e=Ym&&Ym.require&&Ym.require("util").types;return e||Tx&&Tx.binding&&Tx.binding("util")}catch{}}(),G3=Qh&&Qh.isTypedArray,Wne=G3?Ak(G3):Hne,Vne=Object.prototype,Gne=Vne.hasOwnProperty;function w5(e,t){var n=$g(e),r=!n&&fne(e),i=!n&&!r&&m5(e),o=!n&&!r&&!i&&Wne(e),a=n||r||i||o,u=a?cne(e.length,String):[],l=u.length;for(var f in e)(t||Gne.call(e,f))&&!(a&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||wne(f,l)))&&u.push(f);return u}var Kne=Object.prototype;function Fk(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Kne;return e===n}var Qne=a5(Object.keys,Object),Yne=Object.prototype,Xne=Yne.hasOwnProperty;function Zne(e){if(!Fk(e))return Qne(e);var t=[];for(var n in Object(e))Xne.call(e,n)&&n!="constructor"&&t.push(n);return t}function b5(e){return e!=null&&g5(e.length)&&!l5(e)}function Ik(e){return b5(e)?w5(e):Zne(e)}function ere(e,t){return e&&bb(t,Ik(t),e)}function tre(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var nre=Object.prototype,rre=nre.hasOwnProperty;function ire(e){if(!Jg(e))return tre(e);var t=Fk(e),n=[];for(var r in e)r=="constructor"&&(t||!rre.call(e,r))||n.push(r);return n}function Pk(e){return b5(e)?w5(e,!0):ire(e)}function ore(e,t){return e&&bb(t,Pk(t),e)}var S5=typeof exports=="object"&&exports&&!exports.nodeType&&exports,K3=S5&&typeof module=="object"&&module&&!module.nodeType&&module,sre=K3&&K3.exports===S5,Q3=sre?Ss.Buffer:void 0,Y3=Q3?Q3.allocUnsafe:void 0;function are(e,t){if(t)return e.slice();var n=e.length,r=Y3?Y3(n):new e.constructor(n);return e.copy(r),r}function v5(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}var Sb=$.createContext(void 0);Sb.displayName="FormikContext";var qie=Sb.Provider;Sb.Consumer;function ar(){var e=$.useContext(Sb);return e}var ki=function(t){return typeof t=="function"},qg=function(t){return t!==null&&typeof t=="object"},Uie=function(t){return String(Math.floor(Number(t)))===t},Ox=function(t){return Object.prototype.toString.call(t)==="[object String]"},Hie=function(t){return $.Children.count(t)===0},Nx=function(t){return qg(t)&&ki(t.then)};function _i(e,t,n,r){r===void 0&&(r=0);for(var i=A5(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function F5(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?Ee.map(function(Be){return C(Be,_i(ae,Be))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Pe).then(function(Be){return Be.reduce(function(it,ht,Tt){return ht==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||ht&&(it=af(it,Ee[Tt],ht)),it},{})})},[C]),J=$.useCallback(function(ae){return Promise.all([M(ae),y.validationSchema?R(ae):{},y.validate?v(ae):{}]).then(function(Ee){var Pe=Ee[0],Be=Ee[1],it=Ee[2],ht=q1.all([Pe,Be,it],{arrayMerge:Kie});return ht})},[y.validate,y.validationSchema,M,v,R]),P=Ki(function(ae){return ae===void 0&&(ae=A.values),U({type:"SET_ISVALIDATING",payload:!0}),J(ae).then(function(Ee){return O.current&&(U({type:"SET_ISVALIDATING",payload:!1}),U({type:"SET_ERRORS",payload:Ee})),Ee})});$.useEffect(function(){a&&O.current===!0&&zd(w.current,y.initialValues)&&P(w.current)},[a,P]);var D=$.useCallback(function(ae){var Ee=ae&&ae.values?ae.values:w.current,Pe=ae&&ae.errors?ae.errors:b.current?b.current:y.initialErrors||{},Be=ae&&ae.touched?ae.touched:x.current?x.current:y.initialTouched||{},it=ae&&ae.status?ae.status:_.current?_.current:y.initialStatus;w.current=Ee,b.current=Pe,x.current=Be,_.current=it;var ht=function(){U({type:"RESET_FORM",payload:{isSubmitting:!!ae&&!!ae.isSubmitting,errors:Pe,touched:Be,status:it,values:Ee,isValidating:!!ae&&!!ae.isValidating,submitCount:ae&&ae.submitCount&&typeof ae.submitCount=="number"?ae.submitCount:0}})};if(y.onReset){var Tt=y.onReset(A.values,Rt);Nx(Tt)?Tt.then(ht):ht()}else ht()},[y.initialErrors,y.initialStatus,y.initialTouched]);$.useEffect(function(){O.current===!0&&!zd(w.current,y.initialValues)&&f&&(w.current=y.initialValues,D(),a&&P(w.current))},[f,y.initialValues,D,a,P]),$.useEffect(function(){f&&O.current===!0&&!zd(b.current,y.initialErrors)&&(b.current=y.initialErrors||qd,U({type:"SET_ERRORS",payload:y.initialErrors||qd}))},[f,y.initialErrors]),$.useEffect(function(){f&&O.current===!0&&!zd(x.current,y.initialTouched)&&(x.current=y.initialTouched||R0,U({type:"SET_TOUCHED",payload:y.initialTouched||R0}))},[f,y.initialTouched]),$.useEffect(function(){f&&O.current===!0&&!zd(_.current,y.initialStatus)&&(_.current=y.initialStatus,U({type:"SET_STATUS",payload:y.initialStatus}))},[f,y.initialStatus,y.initialTouched]);var q=Ki(function(ae){if(N.current[ae]&&ki(N.current[ae].validate)){var Ee=_i(A.values,ae),Pe=N.current[ae].validate(Ee);return Nx(Pe)?(U({type:"SET_ISVALIDATING",payload:!0}),Pe.then(function(Be){return Be}).then(function(Be){U({type:"SET_FIELD_ERROR",payload:{field:ae,value:Be}}),U({type:"SET_ISVALIDATING",payload:!1})})):(U({type:"SET_FIELD_ERROR",payload:{field:ae,value:Pe}}),Promise.resolve(Pe))}else if(y.validationSchema)return U({type:"SET_ISVALIDATING",payload:!0}),R(A.values,ae).then(function(Be){return Be}).then(function(Be){U({type:"SET_FIELD_ERROR",payload:{field:ae,value:_i(Be,ae)}}),U({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),K=$.useCallback(function(ae,Ee){var Pe=Ee.validate;N.current[ae]={validate:Pe}},[]),Q=$.useCallback(function(ae){delete N.current[ae]},[]),H=Ki(function(ae,Ee){U({type:"SET_TOUCHED",payload:ae});var Pe=Ee===void 0?i:Ee;return Pe?P(A.values):Promise.resolve()}),X=$.useCallback(function(ae){U({type:"SET_ERRORS",payload:ae})},[]),I=Ki(function(ae,Ee){var Pe=ki(ae)?ae(A.values):ae;U({type:"SET_VALUES",payload:Pe});var Be=Ee===void 0?n:Ee;return Be?P(Pe):Promise.resolve()}),te=$.useCallback(function(ae,Ee){U({type:"SET_FIELD_ERROR",payload:{field:ae,value:Ee}})},[]),ge=Ki(function(ae,Ee,Pe){U({type:"SET_FIELD_VALUE",payload:{field:ae,value:Ee}});var Be=Pe===void 0?n:Pe;return Be?P(af(A.values,ae,Ee)):Promise.resolve()}),oe=$.useCallback(function(ae,Ee){var Pe=Ee,Be=ae,it;if(!Ox(ae)){ae.persist&&ae.persist();var ht=ae.target?ae.target:ae.currentTarget,Tt=ht.type,Bn=ht.name,Sr=ht.id,ur=ht.value,Kr=ht.checked,le=ht.outerHTML,z=ht.options,ne=ht.multiple;Pe=Ee||Bn||Sr,Be=/number|range/.test(Tt)?(it=parseFloat(ur),isNaN(it)?"":it):/checkbox/.test(Tt)?Yie(_i(A.values,Pe),Kr,ur):z&&ne?Qie(z):ur}Pe&&ge(Pe,Be)},[ge,A.values]),be=Ki(function(ae){if(Ox(ae))return function(Ee){return oe(Ee,ae)};oe(ae)}),ke=Ki(function(ae,Ee,Pe){Ee===void 0&&(Ee=!0),U({type:"SET_FIELD_TOUCHED",payload:{field:ae,value:Ee}});var Be=Pe===void 0?i:Pe;return Be?P(A.values):Promise.resolve()}),Ne=$.useCallback(function(ae,Ee){ae.persist&&ae.persist();var Pe=ae.target,Be=Pe.name,it=Pe.id,ht=Pe.outerHTML,Tt=Ee||Be||it;ke(Tt,!0)},[ke]),Xe=Ki(function(ae){if(Ox(ae))return function(Ee){return Ne(Ee,ae)};Ne(ae)}),Ze=$.useCallback(function(ae){ki(ae)?U({type:"SET_FORMIK_STATE",payload:ae}):U({type:"SET_FORMIK_STATE",payload:function(){return ae}})},[]),Nt=$.useCallback(function(ae){U({type:"SET_STATUS",payload:ae})},[]),nn=$.useCallback(function(ae){U({type:"SET_ISSUBMITTING",payload:ae})},[]),kt=Ki(function(){return U({type:"SUBMIT_ATTEMPT"}),P().then(function(ae){var Ee=ae instanceof Error,Pe=!Ee&&Object.keys(ae).length===0;if(Pe){var Be;try{if(Be=Ct(),Be===void 0)return}catch(it){throw it}return Promise.resolve(Be).then(function(it){return O.current&&U({type:"SUBMIT_SUCCESS"}),it}).catch(function(it){if(O.current)throw U({type:"SUBMIT_FAILURE"}),it})}else if(O.current&&(U({type:"SUBMIT_FAILURE"}),Ee))throw ae})}),En=Ki(function(ae){ae&&ae.preventDefault&&ki(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&ki(ae.stopPropagation)&&ae.stopPropagation(),kt().catch(function(Ee){console.warn("Warning: An unhandled error was caught from submitForm()",Ee)})}),Rt={resetForm:D,validateForm:P,validateField:q,setErrors:X,setFieldError:te,setFieldTouched:ke,setFieldValue:ge,setStatus:Nt,setSubmitting:nn,setTouched:H,setValues:I,setFormikState:Ze,submitForm:kt},Ct=Ki(function(){return p(A.values,Rt)}),gt=Ki(function(ae){ae&&ae.preventDefault&&ki(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&ki(ae.stopPropagation)&&ae.stopPropagation(),D()}),hn=$.useCallback(function(ae){return{value:_i(A.values,ae),error:_i(A.errors,ae),touched:!!_i(A.touched,ae),initialValue:_i(w.current,ae),initialTouched:!!_i(x.current,ae),initialError:_i(b.current,ae)}},[A.errors,A.touched,A.values]),An=$.useCallback(function(ae){return{setValue:function(Pe,Be){return ge(ae,Pe,Be)},setTouched:function(Pe,Be){return ke(ae,Pe,Be)},setError:function(Pe){return te(ae,Pe)}}},[ge,ke,te]),cr=$.useCallback(function(ae){var Ee=qg(ae),Pe=Ee?ae.name:ae,Be=_i(A.values,Pe),it={name:Pe,value:Be,onChange:be,onBlur:Xe};if(Ee){var ht=ae.type,Tt=ae.value,Bn=ae.as,Sr=ae.multiple;ht==="checkbox"?Tt===void 0?it.checked=!!Be:(it.checked=!!(Array.isArray(Be)&&~Be.indexOf(Tt)),it.value=Tt):ht==="radio"?(it.checked=Be===Tt,it.value=Tt):Bn==="select"&&Sr&&(it.value=it.value||[],it.multiple=!0)}return it},[Xe,be,A.values]),zn=$.useMemo(function(){return!zd(w.current,A.values)},[w.current,A.values]),qt=$.useMemo(function(){return typeof u<"u"?zn?A.errors&&Object.keys(A.errors).length===0:u!==!1&&ki(u)?u(y):u:A.errors&&Object.keys(A.errors).length===0},[u,zn,A.errors,y]),on=yn({},A,{initialValues:w.current,initialErrors:b.current,initialTouched:x.current,initialStatus:_.current,handleBlur:Xe,handleChange:be,handleReset:gt,handleSubmit:En,resetForm:D,setErrors:X,setFormikState:Ze,setFieldTouched:ke,setFieldValue:ge,setFieldError:te,setStatus:Nt,setSubmitting:nn,setTouched:H,setValues:I,submitForm:kt,validateForm:P,validateField:q,isValid:qt,dirty:zn,unregisterField:Q,registerField:K,getFieldProps:cr,getFieldMeta:hn,getFieldHelpers:An,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return on}function Bi(e){var t=Wie(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return $.useImperativeHandle(o,function(){return t}),$.createElement(qie,{value:t},n?$.createElement(n,t):i?i(t):r?ki(r)?r(t):Hie(r)?null:$.Children.only(r):null)}function Vie(e){var t={};if(e.inner){if(e.inner.length===0)return af(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;_i(t,a.path)||(t=af(t,a.path,a.message))}}return t}function Gie(e,t,n,r){n===void 0&&(n=!1);var i=V1(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function V1(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||$3(i)?V1(i):i!==""?i:void 0}):$3(e[r])?t[r]=V1(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function Kie(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var u=n.clone!==!1,l=u&&n.isMergeableObject(o);r[a]=l?q1(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=q1(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function Qie(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function Yie(e,t,n){if(typeof e=="boolean")return!!t;var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var Xie=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?$.useLayoutEffect:$.useEffect;function Ki(e){var t=$.useRef(e);return Xie(function(){t.current=e}),$.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i=this._maxSize&&this.clear(),O in this._values||this._size++,this._values[O]=N};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,i=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,a=512,u=new e(a),l=new e(a),f=new e(a);Ex={Cache:e,split:m,normalizePath:p,setter:function(O){var N=p(O);return l.get(O)||l.set(O,function(T,B){for(var A=0,U=N.length,v=T;Ap.match(e)||[],n=p=>p[0].toUpperCase()+p.slice(1),r=(p,m)=>t(p).join(m).toLowerCase(),i=p=>t(p).reduce((m,y)=>`${m}${m?y[0].toUpperCase()+y.slice(1).toLowerCase():y.toLowerCase()}`,"");return Ax={words:t,upperFirst:n,camelCase:i,pascalCase:p=>n(i(p)),snakeCase:p=>r(p,"_"),kebabCase:p=>r(p,"-"),sentenceCase:p=>n(r(p," ")),titleCase:p=>t(p).map(n).join(" ")},Ax}var Fx=eoe(),T0={exports:{}},mI;function toe(){if(mI)return T0.exports;mI=1,T0.exports=function(i){return e(t(i),i)},T0.exports.array=e;function e(i,o){var a=i.length,u=new Array(a),l={},f=a,p=n(o),m=r(i);for(o.forEach(function(w){if(!m.has(w[0])||!m.has(w[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});f--;)l[f]||y(i[f],f,new Set);return u;function y(w,b,x){if(x.has(w)){var _;try{_=", node was:"+JSON.stringify(w)}catch{_=""}throw new Error("Cyclic dependency"+_)}if(!m.has(w))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(w));if(!l[b]){l[b]=!0;var O=p.get(w)||new Set;if(O=Array.from(O),b=O.length){x.add(w);do{var N=O[--b];y(N,m.get(N),x)}while(b);x.delete(w)}u[--a]=w}}}function t(i){for(var o=new Set,a=0,u=i.length;a"",coe=/^Symbol\((.*)\)(.*)$/;function uoe(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function gI(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return uoe(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return aoe.call(e).replace(coe,"Symbol($1)");const r=ioe.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+ooe.call(e)+"]":r==="RegExp"?soe.call(e):null}function Eh(e,t){let n=gI(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let o=gI(this[r],t);return o!==null?o:i},2)}function I5(e){return e==null?[]:[].concat(e)}let loe=/\$\{\s*(\w+)\s*\}/g;class Oi extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=Object.assign({},n,{path:r})),typeof t=="string"?t.replace(loe,(i,o)=>Eh(n[o])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],I5(t).forEach(o=>{Oi.isError(o)?(this.errors.push(...o.errors),this.inner=this.inner.concat(o.inner.length?o.inner:o)):this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,Oi)}}let Tu={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${Eh(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Eh(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Eh(n,!0)}\``+i}},ko={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},_l={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},G1={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},doe={isValue:"${path} field must be ${value}"},K1={noUnknown:"${path} field has unspecified keys: ${unknown}"},foe={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:Tu,string:ko,number:_l,date:G1,object:K1,array:foe,boolean:doe});const Dk=e=>e&&e.__isYupSchema__;class ww{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:o}=n,a=typeof r=="function"?r:(...u)=>u.every(l=>l===r);return new ww(t,(u,l)=>{var f;let p=a(...u)?i:o;return(f=p==null?void 0:p(l))!=null?f:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(o=>o.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!Dk(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const O0={context:"$",value:"."};class Cf{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===O0.context,this.isValue=this.key[0]===O0.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?O0.context:this.isValue?O0.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&cf.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Cf.prototype.__isYupRef=!0;const Eu=e=>e==null;function ah(e){function t({value:n,path:r="",options:i,originalValue:o,schema:a},u,l){const{name:f,test:p,params:m,message:y,skipAbsent:w}=e;let{parent:b,context:x,abortEarly:_=a.spec.abortEarly}=i;function O(C){return Cf.isRef(C)?C.getValue(n,b,x):C}function N(C={}){const M=Object.assign({value:n,originalValue:o,label:a.spec.label,path:C.path||r,spec:a.spec},m,C.params);for(const P of Object.keys(M))M[P]=O(M[P]);const J=new Oi(Oi.formatError(C.message||y,M),n,M.path,C.type||f);return J.params=M,J}const E=_?u:l;let T={path:r,parent:b,type:f,from:i.from,createError:N,resolve:O,options:i,originalValue:o,schema:a};const B=C=>{Oi.isError(C)?E(C):C?l(null):E(N())},A=C=>{Oi.isError(C)?E(C):u(C)},U=w&&Eu(n);if(!i.sync){try{Promise.resolve(U?!0:p.call(T,n,T)).then(B,A)}catch(C){A(C)}return}let v;try{var R;if(v=U?!0:p.call(T,n,T),typeof((R=v)==null?void 0:R.then)=="function")throw new Error(`Validation test of type: "${T.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(C){A(C);return}B(v)}return t.OPTIONS=e,t}function hoe(e,t,n,r=n){let i,o,a;return t?(cf.forEach(t,(u,l,f)=>{let p=l?u.slice(1,u.length-1):u;e=e.resolve({context:r,parent:i,value:n});let m=e.type==="tuple",y=f?parseInt(p,10):0;if(e.innerType||m){if(m&&!f)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&y>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[y],e=m?e.spec.types[y]:e.innerType}if(!f){if(!e.fields||!e.fields[p])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);i=n,n=n&&n[p],e=e.fields[p]}o=p,a=l?"["+u+"]":"."+u}),{schema:e,parent:i,parentPath:o}):{parent:i,parentPath:t,schema:e}}class bw extends Set{describe(){const t=[];for(const n of this.values())t.push(Cf.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new bw(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function _h(e,t=new Map){if(Dk(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r{this.typeError(Tu.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=_h(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(o=>{t.tests.forEach(a=>{o.test(a.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,o)=>o.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",o=r._cast(t,n);if(n.assert!==!1&&!r.isType(o)){if(i&&Eu(o))return o;let a=Eh(t),u=Eh(o);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". attempted value: ${a} -`+(u!==a?`result of cast: ${u}`:""))}return o}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,o)=>o.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:o,originalValue:a=t,strict:u=this.spec.strict}=n,l=t;u||(l=this._cast(l,Object.assign({assert:!1},n)));let f=[];for(let p of Object.values(this.internalTests))p&&f.push(p);this.runTests({path:o,value:l,originalValue:a,options:n,tests:f},r,p=>{if(p.length)return i(p,l);this.runTests({path:o,value:l,originalValue:a,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:o,value:a,originalValue:u,path:l,options:f}=t,p=x=>{i||(i=!0,n(x,a))},m=x=>{i||(i=!0,r(x,a))},y=o.length,w=[];if(!y)return m([]);let b={value:a,originalValue:u,path:l,options:f,schema:this};for(let x=0;xthis.resolve(p)._validate(f,p,y,w)}validate(t,n){let r=this.resolve(Object.assign({},n,{value:t}));return new Promise((i,o)=>r._validate(t,n,(a,u)=>{Oi.isError(a)&&(a.value=u),o(a)},(a,u)=>{a.length?o(new Oi(a,u)):i(u)}))}validateSync(t,n){let r=this.resolve(Object.assign({},n,{value:t})),i;return r._validate(t,Object.assign({},n,{sync:!0}),(o,a)=>{throw Oi.isError(o)&&(o.value=a),o},(o,a)=>{if(o.length)throw new Oi(o,t);i=a}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Oi.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Oi.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):xh(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=sh({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=sh({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=Tu.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Tu.notNull){return this.nullability(!1,t)}required(t=Tu.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Tu.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=sh(n),o=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(a=>!(a.OPTIONS.name===n.name&&(o||a.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=I5(t).map(o=>new Nf(o));return i.forEach(o=>{o.isSibling&&r.deps.push(o.key)}),r.conditions.push(typeof n=="function"?new ww(i,n):ww.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=sh({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=Tu.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=sh({message:n,name:"oneOf",skipAbsent:!0,test(i){let o=this.schema._whitelist,a=o.resolveAll(this.resolve);return a.includes(i)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:a}})}}),r}notOneOf(t,n=Tu.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=sh({message:n,name:"notOneOf",test(i){let o=this.schema._blacklist,a=o.resolveAll(this.resolve);return a.includes(i)?this.createError({params:{values:Array.from(o).join(", "),resolved:a}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:o,nullable:a}=n.spec;return{meta:i,label:r,optional:o,nullable:a,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,f,p)=>p.findIndex(m=>m.name===l.name)===f)}}}jo.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])jo.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:o,schema:a}=hoe(this,t,n,r.context);return a[e](i&&i[o],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])jo.prototype[e]=jo.prototype.oneOf;for(const e of["not","nope"])jo.prototype[e]=jo.prototype.notOneOf;let poe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,moe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,goe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,yoe=e=>Eu(e)||e===e.trim(),woe={}.toString();function cn(){return new P5}class P5 extends jo{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===woe?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Tu.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=ko.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=ko.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=ko.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,o;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:o}=n:i=n),this.test({name:o||"matches",message:i||ko.matches,params:{regex:t},skipAbsent:!0,test:a=>a===""&&r||a.search(t)!==-1})}email(t=ko.email){return this.matches(poe,{name:"email",message:t,excludeEmptyString:!0})}url(t=ko.url){return this.matches(moe,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=ko.uuid){return this.matches(goe,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=ko.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:yoe})}lowercase(t=ko.lowercase){return this.transform(n=>Eu(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Eu(n)||n===n.toLowerCase()})}uppercase(t=ko.uppercase){return this.transform(n=>Eu(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Eu(n)||n===n.toUpperCase()})}}cn.prototype=P5.prototype;let boe=e=>e!=+e;function Wr(){return new M5}class M5 extends jo{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!boe(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return r.isType(i)||i===null?i:parseFloat(i)})})}min(t,n=xl.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=xl.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=xl.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return rthis.resolve(t)}})}positive(t=xl.positive){return this.moreThan(0,t)}negative(t=xl.negative){return this.lessThan(0,t)}integer(t=xl.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>Eu(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(i=>Eu(i)?i:Math[t](i))}}Wr.prototype=M5.prototype;var Soe=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function voe(e){var t=[1,4,5,6,7,10,11],n=0,r,i;if(i=Soe.exec(e)){for(var o=0,a;a=t[o];++o)i[a]=+i[a]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?r=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(n=i[10]*60+i[11],i[9]==="+"&&(n=0-n)),r=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let xoe=new Date(""),_oe=e=>Object.prototype.toString.call(e)==="[object Date]";class vb extends jo{constructor(){super({type:"date",check(t){return _oe(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=voe(t),isNaN(t)?vb.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Nf.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=G1.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=G1.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}vb.INVALID_DATE=xoe;vb.prototype;function koe(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([a,u])=>`${a}-${u}`));function o(a,u){let l=cf.split(a)[0];r.add(l),i.has(`${u}-${l}`)||n.push([u,l])}for(const a of Object.keys(e)){let u=e[a];r.add(a),Nf.isRef(u)&&u.isSibling?o(u.path,a):Dk(u)&&"deps"in u&&u.deps.forEach(l=>o(l,a))}return roe.array(Array.from(r),n).reverse()}function yI(e,t){let n=1/0;return e.some((r,i)=>{var o;if((o=t.path)!=null&&o.includes(r))return n=i,!0}),n}function L5(e){return(t,n)=>yI(e,t)-yI(e,n)}const Roe=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function $0(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=$0(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=$0(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map($0)}):"optional"in e?e.optional():e}const Toe=(e,t)=>{const n=[...cf.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=cf.getter(cf.join(n),!0)(e);return!!(i&&r in i)};let wI=e=>Object.prototype.toString.call(e)==="[object Object]";function Ooe(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const Noe=L5([]);function li(e){return new B5(e)}class B5 extends jo{constructor(t){super({type:"object",check(n){return wI(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Noe,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let o=this.fields,a=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,u=[].concat(this._nodes,Object.keys(i).filter(m=>!this._nodes.includes(m))),l={},f=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),p=!1;for(const m of u){let y=o[m],w=m in i;if(y){let b,x=i[m];f.path=(n.path?`${n.path}.`:"")+m,y=y.resolve({value:x,context:n.context,parent:l});let k=y instanceof jo?y.spec:void 0,O=k==null?void 0:k.strict;if(k!=null&&k.strip){p=p||m in i;continue}b=!n.__validating||!O?y.cast(i[m],f):i[m],b!==void 0&&(l[m]=b)}else w&&!a&&(l[m]=i[m]);(w!==m in l||l[m]!==i[m])&&(p=!0)}return p?l:i}_validate(t,n={},r,i){let{from:o=[],originalValue:a=t,recursive:u=this.spec.recursive}=n;n.from=[{schema:this,value:a},...o],n.__validating=!0,n.originalValue=a,super._validate(t,n,r,(l,f)=>{if(!u||!wI(f)){i(l,f);return}a=a||f;let p=[];for(let m of this._nodes){let y=this.fields[m];!y||Nf.isRef(y)||p.push(y.asNestedTest({options:n,key:m,parent:f,parentPath:n.path,originalParent:a}))}this.runTests({tests:p,value:f,originalValue:a,options:n},r,m=>{i(m.sort(this._sortErrors).concat(l),f)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,o]of Object.entries(this.fields)){const a=r[i];r[i]=a===void 0?o:a}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const o=this.fields[r];let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[r]})),n[r]=o&&"getDefault"in o?o.getDefault(a):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=koe(t,n),r._sortErrors=L5(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return $0(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n)}omit(t){const n=Object.assign({},this.fields);for(const r of t)delete n[r];return this.setFields(n)}from(t,n,r){let i=cf.getter(t,!0);return this.transform(o=>{if(!o)return o;let a=o;return Toe(o,t)&&(a=Object.assign({},o),r||delete a[t],a[n]=i(o)),a})}json(){return this.transform(Roe)}noUnknown(t=!0,n=K1.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const o=Ooe(this.schema,i);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=K1.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(Fx.camelCase)}snakeCase(){return this.transformKeys(Fx.snakeCase)}constantCase(){return this.transformKeys(t=>Fx.snakeCase(t).toUpperCase())}describe(t){let n=super.describe(t);n.fields={};for(const[i,o]of Object.entries(this.fields)){var r;let a=t;(r=a)!=null&&r.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),n.fields[i]=o.describe(a)}return n}}li.prototype=B5.prototype;const Coe=()=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",fill:"none",viewBox:"0 0 12 12",children:[d.jsx("circle",{cx:"6",cy:"6",r:"6",fill:"#DE0014"}),d.jsx("path",{fill:"#fff",d:"M6.62 3.64a.622.622 0 10-1.244 0l.083 2.983a.54.54 0 001.081 0l.08-2.984zM6 9c.368 0 .687-.31.69-.694A.7.7 0 006 7.617.69.69 0 006 9z"})]}),wn=({children:e,size:t="sm",...n})=>d.jsxs(xe,{mt:3,...n,children:[d.jsx(fe,{mr:2,position:"relative",top:{sm:"1px",md:"4px"}[t],children:d.jsx(Coe,{})}),d.jsx(fe,{children:e})]}),bn=({children:e,...t})=>d.jsx(ie,{textAlign:"left",lineHeight:"16px",display:"block",textStyle:"caption",color:ce("feedback-error"),...t,children:e}),bI=e=>{const t=encodeURIComponent(new URL(e).hostname),n=encodeURIComponent(new URL(e).port);return`${t==="localhost"?"http://":"https://"}${t}${n?`:${n}`:""}`},SI=e=>new rr.InfoApi(new rr.Configuration({basePath:e})).getCoreApiInfo().then(t=>Object.values(dn).includes(t.network_id)?t.network_id:void 0).catch(),Eoe=()=>{const{addCustomNetwork:e}=ms(),t=$l();return d.jsx(Bi,{validateOnChange:!1,validateOnBlur:!1,initialValues:{label:"",url:""},validate:async n=>{const r={};if(n.label||(r.label="You need to specify a label for this network."),!n.url)r.url="You need to specify a URL for this network.";else if(!await cn().matches(/^(?:([a-z0-9+.-]+):\/\/)(?:\S+(?::\S*)?@)?(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/).isValid(n.url))r.url="Please check the formatting of the URL passed.";else try{await SI(bI(n.url))||(r.genericError="The API did not return a valid network_id.")}catch(o){o.message.includes("Failed to fetch")?r.genericError="Could not connect to supplied network URL.":r.genericError=o.message}return r},onSubmit:async({url:n,label:r})=>{const i=bI(n),o=await SI(i);if(o){const a={label:r.trim(),url:i,networkId:o,mode:DW[o],isCustomNetwork:!0};e(a).then(()=>{t({pathname:"/",search:cs(a)})})}},children:n=>d.jsx(ui,{children:d.jsxs(It,{spacing:"24px",children:[d.jsxs(It,{spacing:"16px",children:[d.jsx(Cx,{name:"label",children:({field:r,form:i})=>d.jsxs(fe,{children:[d.jsx(lO,{children:"Name"}),d.jsx(sr,{...r,placeholder:"My Stacks API"}),i.touched&&i.errors.label&&d.jsx(wn,{children:d.jsx(bn,{children:i.errors.label})})]})}),d.jsx(Cx,{name:"url",children:({field:r,form:i})=>d.jsxs(fe,{children:[d.jsx(lO,{children:"URL"}),d.jsx(sr,{...r,placeholder:"https://"}),i.touched&&i.errors.url&&d.jsx(wn,{children:d.jsx(bn,{children:i.errors.url})})]})})]}),d.jsx(Cx,{name:"genericError",children:({form:r})=>d.jsx(fe,{style:{marginTop:0},children:r.touched&&r.errors.genericError&&d.jsx(wn,{children:d.jsx(bn,{children:r.errors.genericError})})})}),d.jsx(fe,{children:d.jsx(St,{isLoading:n.isValidating,width:"100%",type:"submit",children:"Add and select"})})]})})})},Aoe=()=>{const e=Yn();return d.jsx(lp,{title:"Add a network",isShowing:!0,onClose:()=>e(Nr.HOME),children:d.jsx(xe,{alignItems:"center",flexDirection:"column",pb:["loose","48px"],px:"loose",children:d.jsx(Ln,{width:"420px",children:d.jsxs(fe,{m:["loose","extra-loose"],children:[d.jsx(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:d.jsxs(ie,{fontSize:"14px",color:"textBody",children:["Use this form to add a new instance of the"," ",d.jsx(Li,{display:"inline",as:"a",href:"https://github.com/hirosystems/stacks-blockchain-api",target:"_blank",color:ce("brand"),children:"Stacks Blockchain API"}),". Make sure you review and trust the host before you add it."]})}),d.jsx(Eoe,{})]})})})})},Foe=()=>{const e=Yn();return d.jsx(lp,{title:"Select network",isShowing:!0,onClose:()=>{e(Nr.HOME)},children:d.jsx(xe,{alignItems:"center",flexDirection:"column",pb:["loose","48px"],px:"loose",children:d.jsx(Ln,{width:"420px",children:d.jsx(QZ,{})})})})};function Ioe(){return d.jsx(fe,{padding:"12px",children:d.jsx(fe,{backgroundColor:Ue.gray900,borderRadius:"12px",px:["12px","34px","60px","88px"],py:["12px","34px","60px","88px"],maxWidth:"1400px",margin:"auto",mt:"48px",backgroundImage:["inherit","inherit",'url("welcome.png")','url("welcome.png")'],backgroundRepeat:"no-repeat",backgroundPosition:"right",backgroundSize:"auto 100%",children:d.jsxs(fe,{maxWidth:["100%","100%","60%","calc(100% - 500px)"],children:[d.jsx(fe,{fontSize:"40px",weight:500,color:sf.textOnPrimary,pb:"24px",children:"What is Stacking?"}),d.jsx(fe,{fontSize:"20px",color:sf.textOnPrimary,pb:"24px",children:"By stacking, you temporarily lock up your tokens in order to provide valuable information to Stacks' consensus mechanism. In return, you are eligible to receive rewards in the form of BTC"}),d.jsx(fe,{fontSize:"16px",color:sf.textSubdued,children:"If you meet the protocol minimum, you can Stack your STX independently by directly interacting with the protocol. You also have the option to delegate your STX to a stacking pool provider."})]})})})}function Poe(){const{isSignedIn:e}=Mn();return e?d.jsx(Kw,{to:"../choose-stacking-method",replace:!0}):d.jsxs(fe,{children:[d.jsx(X8,{}),d.jsx(Ioe,{}),d.jsx(i5,{})]})}function co({address:e}){const{onCopy:t}=rP(e);return d.jsxs(d.Fragment,{children:[d.jsx(ie,{children:Mi(e)})," ",d.jsx(fe,{onClick:t,display:"inline-block",sx:{cursor:"pointer"},children:d.jsx(JP,{size:14})})]})}function Moe(e){return({version:t,hashbytes:n})=>sk(t[0],n,e)}const Dl=(e,t)=>Moe(HP(e.chainId)({[dn.Mainnet]:"mainnet",[dn.Testnet]:"testnet"}))(t);function Jk(e){return`${e} cycle${e!==1?"s":""}`}function j5({pendingStackExtend:e}){return d.jsx(fe,{pb:"base-loose",children:d.jsx(Fi,{icon:d.jsx(cg,{}),title:"Waiting for transaction confirmation",children:d.jsxs(_f,{children:["A stacking request was successfully submitted to the blockchain. Once confirmed, your STX will be stacking for an extra ",e.extendCycles.toString()," cycles."]})})})}function Loe(){const e=Yn();async function t(){e("../lock-more-stx")}async function n(){e("../extend-stacking")}return d.jsxs(Me,{mt:"loose",justifyContent:"space-evenly",children:[d.jsx(St,{mode:"tertiary",onClick:t,children:"Lock more STX"}),d.jsx(St,{mode:"tertiary",onClick:n,children:"Extend stacking"})]})}function Boe({lockedAmount:e,stackerInfoDetails:t,rewardCycleId:n,pendingStackExtend:r,pendingStackIncrease:i}){const{network:o}=Pt(),a=Math.max(n-t.first_reward_cycle,0),u=Math.min(a,t.lock_period),l=n{const n=t.contract_call.function_args;if(!n)throw new Error("Expected `args` to be defined.");const[r,i,o,a]=n.map(m=>sp(m.hex));if(!o||o.type!==we.UInt)throw new Error("Expected `startBurnHeightCV` to be of type `UInt`.");const u=BigInt(o.value);if(!r||r.type!==we.UInt)throw new Error("Expected `amountMicroStxCV` to be of type `UInt`.");const l=BigInt(r.value),f=sk(i,e);if(!a||a.type!==we.UInt)throw new Error("Expected `lockPeriodCV` to be of type `UInt`.");const p=BigInt(a.value);return{transactionId:t.tx_id,startBurnHeight:u,amountMicroStx:l,poxAddress:f,lockPeriod:p}}}async function qoe({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,network:i}){return pb({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,transactionPredicate:Joe,transactionConverter:$oe(i)})}function Uoe(e,t){return e.contract_call.function_name==="stack-extend"&&e.contract_call.contract_id===t}function Hoe(e){return t=>{const n=t.contract_call.function_args;if(!n)throw new Error("Expected `args` to be defined.");const[r,i]=n.map(u=>sp(u.hex)),o=Z8(r,"extendCycles"),a=sk(i,e);return{transactionId:t.tx_id,extendCycles:o,poxAddress:a}}}async function zoe({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,network:i}){return pb({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,transactionPredicate:Uoe,transactionConverter:Hoe(i)})}function Woe(e,t){return e.contract_call.function_name==="stack-increase"&&e.contract_call.contract_id===t}function Voe(e){const t=e.contract_call.function_args;if(!t)throw new Error("Expected `args` to be defined.");const[n]=t.map(i=>sp(i.hex)),r=Z8(n,"increaseBy");return{transactionId:e.tx_id,increaseBy:r}}async function Goe({stackingClient:e,accountsApi:t,address:n,transactionsApi:r}){return pb({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,transactionPredicate:Woe,transactionConverter:Voe})}function xb(){const{accountsApi:e,transactionsApi:t}=Qw(),{client:n}=kn(),{address:r}=Mn(),{networkName:i}=Pt();if(!n)throw new Error("Expected to have a StackingClient available in the context.");if(!r)throw new Error("Expected `address` to be defined.");const o=yr(["pending-stacking-status",n,e,r,t,i],async()=>qoe({stackingClient:n,accountsApi:e,address:r,transactionsApi:t,network:i}),{refetchInterval:5e3}),a=yr(["pending-stack-increase",n,e,r,t,i],async()=>Goe({stackingClient:n,accountsApi:e,address:r,transactionsApi:t}),{refetchInterval:5e3}),u=yr(["pending-stack-extend",n,e,r,t,i],async()=>zoe({stackingClient:n,accountsApi:e,address:r,transactionsApi:t,network:i}),{refetchInterval:5e3});return{getHasPendingDirectStackingQuery:o,getHasPendingStackIncreaseQuery:a,getHasPendingStackExtendQuery:u}}function Koe(){var m;const{networkName:e}=Pt(),t=Bg(),n=ci(),r=db(),i=vk(),o=rn(),{getHasPendingDirectStackingQuery:a,getHasPendingStackIncreaseQuery:u,getHasPendingStackExtendQuery:l}=xb();if(t.isLoading||n.isLoading||r.isLoading||o.isLoading||i.isLoading||a.isLoading||u.isLoading||l.isLoading)return d.jsx(br,{});if(t.isError||!t.data||n.isError||!n.data||i.isError||typeof i.data!="bigint"||r.isError||!r.data||o.isError||!o.data||a.isError||a.data===void 0||u.isError||u.data===void 0||l.isLoading||l.data===void 0){const y="Error while loading data, try reloading the page.";return console.error(y),d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:y})})}const f=t.data.stacked;if(!f&&a.data===null)return d.jsx(joe,{});const p=(m=a.data)==null?void 0:m.transactionId;if(!f&&a.data)return d.jsx(Doe,{data:a.data,transactionId:p,networkName:e});if(!t.data.stacked){const y="ee504e56-9cc5-49b4-ae98-a5cac5c35dbf",w="Expected account to be stacked";return console.error(y,w),d.jsx(Mt,{id:y,children:w})}return d.jsx(Boe,{rewardCycleId:o.data.reward_cycle_id,lockedAmount:i.data,stackerInfoDetails:t.data.details,pendingStackIncrease:u.data,pendingStackExtend:l.data})}function Ug({txResult:e}){return d.jsx(fe,{my:"loose",children:d.jsx(Fi,{title:"Last tx result",children:d.jsx(_f,{children:e.txId})})})}function Sn(e){const{title:t,children:n,...r}=e;return d.jsxs(xe,{flexDirection:"column",mt:"extra-loose",...r,children:[d.jsx(Jo,{fontSize:"24px",mt:"extra-tight",mr:"tight",children:t}),d.jsx(fe,{children:n})]})}function Cn({children:e}){return d.jsx(It,{display:"block",textStyle:"body.large",spacing:"base",children:e})}const Yh=Gr(({children:e,...t},n)=>d.jsx(St,{size:"md",mt:"loose",ref:n,...t,children:e}));function fp({isLoading:e,title:t,actionLabel:n,isDisabled:r}){return d.jsx(Sn,{title:t,children:d.jsx(Yh,{type:"submit",isLoading:e,isDisabled:r,children:n})})}function vs(e){return d.jsx(xe,{flexDirection:"column",position:"sticky",minWidth:[null,null,"360px","420px"],top:"124px",...e})}const _b=$.forwardRef((e,t)=>{var u;const{fieldName:n,children:r,addressType:i,...o}=e,[a]=$t(n);return d.jsxs(d.Fragment,{children:[d.jsx(sr,{id:n,name:n,mt:"loose",maxWidth:"400px",fontFamily:(u=a==null?void 0:a.value)!=null&&u.length?"monospace":"unset",ref:t,placeholder:i==="BTC"?"Bitcoin address (Legacy, Native SegWit or Taproot)":i==="STX"?"Stacks address":void 0,...o}),r]})});_b.displayName="CryptoAddressInput";function Cf({description:e}){const[t,n]=$t("poxAddress"),r=Sk();if(r.isLoading)return d.jsx(fs,{});if(r.isError||!r.data){const o="e69b0abe-495d-4587-9693-8bd4541dddaf",a="Failed to establish current PoX period.";return console.error(o,a),d.jsx(bs,{id:o,children:a})}const i=n.error?d.jsx(wn,{maxWidth:"430px",children:d.jsx(bn,{lineHeight:"18px",children:n.error})}):null;return d.jsx(d.Fragment,{children:d.jsxs(Sn,{title:"Bitcoin address",children:[d.jsx(Cn,{children:e?d.jsx(ie,{color:ce("text-caption"),children:e}):d.jsx(ie,{color:ce("text-caption"),children:"Enter the Bitcoin address where you'd like to receive your rewards."})}),d.jsx(_b,{fieldName:"poxAddress",addressType:"BTC",...t,children:n.touched&&i})]})})}const $k=e=>{const t=rn();if(t.isLoading)return d.jsx(fs,{});if(t.isError||!t.data){const n="d447780e-7df2-4953-b409-aef9e91cf2e8",r="Failed to retrieve necessary data.";return console.error(n,r),d.jsx(bs,{id:n,children:r})}return d.jsxs(ie,{display:"block",textStyle:"body.small",color:ce("text-caption"),...e,children:["Cycles last ",t.data.reward_cycle_length," Bitcoin blocks."]})},Qoe=()=>d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M8.00378 16C12.3907 16 16 12.3983 16 8.00378C16 3.60925 12.3907 0 7.99622 0C3.6017 0 0 3.60925 0 8.00378C0 12.3983 3.60925 16 8.00378 16ZM8.00378 13.9462C4.70411 13.9462 2.06135 11.2959 2.06135 8.00378C2.06135 4.71166 4.70411 2.0538 7.99622 2.0538C11.2883 2.0538 13.9462 4.71166 13.9462 8.00378C13.9538 11.2959 11.2959 13.9462 8.00378 13.9462ZM5.08919 8.86456H10.9108C11.4167 8.86456 11.7867 8.51723 11.7867 8.01888C11.7867 7.50543 11.4243 7.15809 10.9108 7.15809H5.08919C4.57574 7.15809 4.21331 7.50543 4.21331 8.01888C4.21331 8.51723 4.58329 8.86456 5.08919 8.86456Z",fill:"currentColor"})}),Yoe=()=>d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M8.00378 16C12.3907 16 16 12.3983 16 8.00378C16 3.60925 12.3907 0 7.99622 0C3.6017 0 0 3.60925 0 8.00378C0 12.3983 3.60925 16 8.00378 16ZM8.00378 13.9462C4.70411 13.9462 2.06135 11.2959 2.06135 8.00378C2.06135 4.71166 4.70411 2.0538 7.99622 2.0538C11.2883 2.0538 13.9462 4.71166 13.9462 8.00378C13.9538 11.2959 11.2959 13.9462 8.00378 13.9462ZM7.99622 11.5602C8.50212 11.5602 8.84946 11.1977 8.84946 10.6843V8.86456H10.79C11.2959 8.86456 11.6659 8.51723 11.6659 8.01133C11.6659 7.50543 11.3034 7.15054 10.79 7.15054H8.84946V5.26286C8.84946 4.74941 8.50212 4.38697 7.99622 4.38697C7.49033 4.38697 7.14299 4.75696 7.14299 5.26286V7.15054H5.21C4.69655 7.15054 4.33412 7.50543 4.33412 8.01133C4.33412 8.51723 4.70411 8.86456 5.21 8.86456H7.14299V10.6843C7.14299 11.1902 7.49033 11.5602 7.99622 11.5602Z",fill:"currentColor"})}),D5=e=>t=>e+t,Sw=D5(1),J5=D5(-1),Q1=`1px solid ${ce("border")}`,vI=({children:e,...t})=>d.jsx(xe,{as:"button",type:"button",alignItems:"center",justifyContent:"center",width:"52px",height:"48px",border:Q1,outline:0,zIndex:1,_focus:{borderColor:"#C5CCFF",boxShadow:"0 0 0 3px rgba(170,179,255,0.75)"},...t,children:e}),qk=e=>{const{amount:t,onIncrement:n,onDecrement:r,...i}=e;return d.jsx(fe,{...i,children:d.jsxs(xe,{children:[d.jsx(vI,{color:ce(t===1?"text-caption":"brand"),pointerEvents:t===1?"none":"all",onClick:()=>r(J5(t)),borderRadius:"6px 0 0 6px",children:d.jsx(Qoe,{})}),d.jsx(xe,{borderTop:Q1,borderBottom:Q1,flexDirection:"column",justifyContent:"center",alignItems:"center",minWidth:"100px",children:d.jsx(ie,{textStyle:"body.small",mb:"3px",mx:"base",children:Jk(t)})}),d.jsx(vI,{color:ce(t===12?"text-caption":"brand"),pointerEvents:t===12?"none":"all",onClick:()=>n(Sw(t)),borderRadius:"0 6px 6px 0",children:d.jsx(Yoe,{})})]})})};function Uk({fieldName:e,description:t}){const[n,r,i]=$t(e||"lockPeriod");return d.jsx(d.Fragment,{children:d.jsxs(Sn,{title:"Duration",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:t||"Number of cycles to lock STX for this stacker"})}),d.jsx(qk,{mt:"loose",amount:n.value,onIncrement:o=>{o>Ww||i.setValue(o)},onDecrement:o=>{o1?"s":"")+" required, but only "+t.length+" present")}function Cr(e){ji(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Y1(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Xoe(e,t){ji(2,arguments);var n=Cr(e).getTime(),r=q5(t);return new Date(n+r)}var Zoe={};function ese(){return Zoe}function xI(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function U5(e,t){ji(2,arguments);var n=q5(t);return Xoe(e,n*1e3)}function q0(e,t){ji(2,arguments);var n=Cr(e),r=Cr(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function tse(e,t){ji(2,arguments);var n=Cr(e),r=Cr(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function nse(e,t){return ji(2,arguments),Cr(e).getTime()-Cr(t).getTime()}var _I={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},rse="trunc";function ise(e){return e?_I[e]:_I[rse]}function ose(e){ji(1,arguments);var t=Cr(e);return t.setHours(23,59,59,999),t}function sse(e){ji(1,arguments);var t=Cr(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function ase(e){ji(1,arguments);var t=Cr(e);return ose(t).getTime()===sse(t).getTime()}function cse(e,t){ji(2,arguments);var n=Cr(e),r=Cr(t),i=q0(n,r),o=Math.abs(tse(n,r)),a;if(o<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*o);var u=q0(n,r)===-i;ase(Cr(e))&&o===1&&q0(e,r)===1&&(u=!1),a=i*(o-Number(u))}return a===0?0:a}function use(e,t,n){ji(2,arguments);var r=nse(e,t)/1e3;return ise(void 0)(r)}var lse={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},dse=function(t,n,r){var i,o=lse[t];return typeof o=="string"?i=o:n===1?i=o.one:i=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};function Ix(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var fse={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},hse={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},pse={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mse={date:Ix({formats:fse,defaultWidth:"full"}),time:Ix({formats:hse,defaultWidth:"full"}),dateTime:Ix({formats:pse,defaultWidth:"full"})},gse={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yse=function(t,n,r,i){return gse[t]};function Pm(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{var u=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[u]}var f=e.argumentCallback?e.argumentCallback(t):t;return i[f]}}var wse={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},bse={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Sse={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vse={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xse={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},_se={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},kse=function(t,n){var r=Number(t),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Rse={ordinalNumber:kse,era:Pm({values:wse,defaultWidth:"wide"}),quarter:Pm({values:bse,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Pm({values:Sse,defaultWidth:"wide"}),day:Pm({values:vse,defaultWidth:"wide"}),dayPeriod:Pm({values:xse,defaultWidth:"wide",formattingValues:_se,defaultFormattingWidth:"wide"})};function Mm(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a=o[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?Ose(u,function(m){return m.test(a)}):Tse(u,function(m){return m.test(a)}),f;f=e.valueCallback?e.valueCallback(l):l,f=n.valueCallback?n.valueCallback(f):f;var p=t.slice(a.length);return{value:f,rest:p}}}function Tse(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function Ose(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[0],o=t.match(e.parsePattern);if(!o)return null;var a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;var u=t.slice(i.length);return{value:a,rest:u}}}var Cse=/^(\d+)(th|st|nd|rd)?/i,Ese=/\d+/i,Ase={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Fse={any:[/^b/i,/^(a|c)/i]},Ise={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Pse={any:[/1/i,/2/i,/3/i,/4/i]},Mse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Lse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Bse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},jse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Dse={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Jse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$se={ordinalNumber:Nse({matchPattern:Cse,parsePattern:Ese,valueCallback:function(t){return parseInt(t,10)}}),era:Mm({matchPatterns:Ase,defaultMatchWidth:"wide",parsePatterns:Fse,defaultParseWidth:"any"}),quarter:Mm({matchPatterns:Ise,defaultMatchWidth:"wide",parsePatterns:Pse,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Mm({matchPatterns:Mse,defaultMatchWidth:"wide",parsePatterns:Lse,defaultParseWidth:"any"}),day:Mm({matchPatterns:Bse,defaultMatchWidth:"wide",parsePatterns:jse,defaultParseWidth:"any"}),dayPeriod:Mm({matchPatterns:Dse,defaultMatchWidth:"any",parsePatterns:Jse,defaultParseWidth:"any"})},qse={code:"en-US",formatDistance:dse,formatLong:mse,formatRelative:yse,localize:Rse,match:$se,options:{weekStartsOn:0,firstWeekContainsDate:1}};function H5(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function Use(e){return H5({},e)}var kI=1440,Hse=2520,Px=43200,zse=86400;function Wse(e,t,n){var r,i;ji(2,arguments);var o=ese(),a=(r=(i=void 0)!==null&&i!==void 0?i:o.locale)!==null&&r!==void 0?r:qse;if(!a.formatDistance)throw new RangeError("locale must contain formatDistance property");var u=q0(e,t);if(isNaN(u))throw new RangeError("Invalid time value");var l=H5(Use(n),{addSuffix:!1,comparison:u}),f,p;u>0?(f=Cr(t),p=Cr(e)):(f=Cr(e),p=Cr(t));var m=use(p,f),y=(xI(p)-xI(f))/1e3,w=Math.round((m-y)/60),b;if(w<2)return w===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",w,l);if(w<45)return a.formatDistance("xMinutes",w,l);if(w<90)return a.formatDistance("aboutXHours",1,l);if(wd.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M8.00378 16C12.3907 16 16 12.3983 16 8.00378C16 3.60925 12.3907 0 7.99622 0C3.6017 0 0 3.60925 0 8.00378C0 12.3983 3.60925 16 8.00378 16ZM4.45493 9.18924C4.03209 9.18924 3.70741 8.85701 3.70741 8.43417C3.70741 8.01888 4.03209 7.68664 4.45493 7.68664H7.2487V3.78292C7.2487 3.36008 7.58093 3.03539 7.99622 3.03539C8.41907 3.03539 8.74375 3.36008 8.74375 3.78292V8.43417C8.74375 8.85701 8.41907 9.18924 7.99622 9.18924H4.45493Z",fill:"currentColor"})});function Rb({timeUntilNextCycle:e,...t}){const n=z5(U5(new Date,e));return d.jsxs(xe,{...t,children:[d.jsx(xe,{width:"44px",height:"44px",background:ce("bg-4"),borderRadius:"50%",alignItems:"center",justifyContent:"center",children:d.jsx(Vse,{size:"14px"})}),d.jsxs(xe,{ml:"base",flexDirection:"column",children:[d.jsx(ie,{as:"h4",display:"block",textStyle:"body.large.medium",lineHeight:"20px",children:"Next cycle starts in"}),d.jsx(ie,{display:"block",textStyle:"body.large",color:ce("text-caption"),lineHeight:"20px",mt:"extra-tight",children:n})]})]})}function W5({children:e,...t}){return d.jsx(ie,{textStyle:"body.large",display:"block",color:ce("text-caption"),...t,children:e})}function hp(e){const{timeUntilNextCycle:t,estimatedStackingMinimum:n,children:r}=e;return d.jsxs(d.Fragment,{children:[d.jsx(Jo,{children:"Manage your pool"}),d.jsx(W5,{mt:"base-loose",children:r}),d.jsxs(xe,{alignItems:"baseline",children:[d.jsx(Rb,{timeUntilNextCycle:t,mt:"40px"}),d.jsx($5,{ml:"extra-loose",estimatedStackingMinimum:n})]})]})}const Tb=e=>d.jsx(xe,{flexDirection:"column",maxWidth:"1216px",mb:"extra-loose",mx:["loose","loose","extra-loose","extra-loose","auto"],...e});function pp(e){const{intro:t,poolAdminPanel:n,poolAdminForm:r}=e;return d.jsx(Tb,{pt:"80px",mb:"extra-loose",children:d.jsxs(xe,{flexDirection:["column-reverse","column-reverse","row"],justifyContent:"space-between",children:[d.jsxs(fe,{maxWidth:[null,null,"544px"],mr:[null,null,"extra-loose"],children:[t,d.jsx(fe,{display:["block",null,"none"],mt:["extra-loose",null,null,null,"base"],children:n}),r]}),d.jsx(fe,{display:["none",null,"block"],children:n})]})})}function Kl({children:e}){const t=Array.isArray(e)?e:[e],n=t.flatMap((r,i)=>$.isValidElement(r)?[d.jsx(Pn,{mt:"extra-loose",mb:"48px"},i.toString()+"-hr"),$.cloneElement(r,{key:i,step:Sw(i),mb:Sw(i)===t.length?"280px":void 0})]:null);return d.jsx(fe,{mt:"48px",children:n})}function Gse({address:e,children:t}){const{setFieldValue:n}=ar(),{network:r}=Pt(),i=new xf({address:e,network:r}),o=fb(i),a=gb({client:i,address:e,network:r});return $.useEffect(()=>{!a.data||!o.data||(n("lockedAmount",o.data.stx.locked),n("totalAmount",o.data.stx.balance),n("delegated",a.data.delegated),a.data.delegated?(n("delegatedAmount",a.data.details.amount_micro_stx),n("delegatedTo",a.data.details.delegated_to)):(n("delegatedAmount",0n),n("delegatedTo","")))},[n,o.data,a.data]),d.jsx(Kl,{children:t})}function zk({children:e}){const{values:t}=ar(),n=t.stacker,r=vf(n);return d.jsx(d.Fragment,{children:r?d.jsx(Gse,{address:n,children:e}):d.jsx(Kl,{children:e})})}function Kse({stacker:e}){var o;const{network:t}=Pt(),n=new xf({address:e,network:t}),r=fb(n);let i=null;return!r.isError&&((o=r.data)!=null&&o.stx)&&(i=Yt(r.data.stx.locked)),i===null||i===0n?d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"Pool member can't be extended"}),d.jsx(ie,{textStyle:"body.large.medium",children:"Locked amount: 0 STX"}),d.jsx(co,{address:e})]}):d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You'll extend locking of"}),d.jsxs(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:[Jt(i??0)," for"]}),d.jsx(co,{address:e})]})}function Qse(){var a;const e=ar(),t=rn(),{stacker:n,poxAddress:r,extendCount:i}=e.values,o=n&&vf(n)&&e.errors.stacker===void 0;return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsx(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:o?d.jsx(Kse,{stacker:n}):d.jsx(ie,{textStyle:"body.large.medium",children:"Choose pool member first!"})}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:`One cycle lasts ${(a=t.data)==null?void 0:a.reward_cycle_length} blocks on the Bitcoin blockchain`,children:"Cycles to be added"}),d.jsx(Ge,{children:i})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool PoX address"}),d.jsx(Ge,{children:r?Mi(r):"—"})]})})]})]})})}/*! ***************************************************************************** +`+(u!==a?`result of cast: ${u}`:""))}return o}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,o)=>o.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:o,originalValue:a=t,strict:u=this.spec.strict}=n,l=t;u||(l=this._cast(l,Object.assign({assert:!1},n)));let f=[];for(let p of Object.values(this.internalTests))p&&f.push(p);this.runTests({path:o,value:l,originalValue:a,options:n,tests:f},r,p=>{if(p.length)return i(p,l);this.runTests({path:o,value:l,originalValue:a,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:o,value:a,originalValue:u,path:l,options:f}=t,p=x=>{i||(i=!0,n(x,a))},m=x=>{i||(i=!0,r(x,a))},y=o.length,w=[];if(!y)return m([]);let b={value:a,originalValue:u,path:l,options:f,schema:this};for(let x=0;xthis.resolve(p)._validate(f,p,y,w)}validate(t,n){let r=this.resolve(Object.assign({},n,{value:t}));return new Promise((i,o)=>r._validate(t,n,(a,u)=>{Oi.isError(a)&&(a.value=u),o(a)},(a,u)=>{a.length?o(new Oi(a,u)):i(u)}))}validateSync(t,n){let r=this.resolve(Object.assign({},n,{value:t})),i;return r._validate(t,Object.assign({},n,{sync:!0}),(o,a)=>{throw Oi.isError(o)&&(o.value=a),o},(o,a)=>{if(o.length)throw new Oi(o,t);i=a}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Oi.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Oi.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):_h(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=ah({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=ah({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=Tu.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Tu.notNull){return this.nullability(!1,t)}required(t=Tu.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Tu.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=ah(n),o=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(a=>!(a.OPTIONS.name===n.name&&(o||a.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=I5(t).map(o=>new Cf(o));return i.forEach(o=>{o.isSibling&&r.deps.push(o.key)}),r.conditions.push(typeof n=="function"?new ww(i,n):ww.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=ah({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=Tu.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=ah({message:n,name:"oneOf",skipAbsent:!0,test(i){let o=this.schema._whitelist,a=o.resolveAll(this.resolve);return a.includes(i)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:a}})}}),r}notOneOf(t,n=Tu.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=ah({message:n,name:"notOneOf",test(i){let o=this.schema._blacklist,a=o.resolveAll(this.resolve);return a.includes(i)?this.createError({params:{values:Array.from(o).join(", "),resolved:a}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:o,nullable:a}=n.spec;return{meta:i,label:r,optional:o,nullable:a,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,f,p)=>p.findIndex(m=>m.name===l.name)===f)}}}jo.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])jo.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:o,schema:a}=hoe(this,t,n,r.context);return a[e](i&&i[o],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])jo.prototype[e]=jo.prototype.oneOf;for(const e of["not","nope"])jo.prototype[e]=jo.prototype.notOneOf;let poe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,moe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,goe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,yoe=e=>Eu(e)||e===e.trim(),woe={}.toString();function cn(){return new P5}class P5 extends jo{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===woe?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Tu.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=ko.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=ko.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=ko.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,o;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:o}=n:i=n),this.test({name:o||"matches",message:i||ko.matches,params:{regex:t},skipAbsent:!0,test:a=>a===""&&r||a.search(t)!==-1})}email(t=ko.email){return this.matches(poe,{name:"email",message:t,excludeEmptyString:!0})}url(t=ko.url){return this.matches(moe,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=ko.uuid){return this.matches(goe,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=ko.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:yoe})}lowercase(t=ko.lowercase){return this.transform(n=>Eu(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Eu(n)||n===n.toLowerCase()})}uppercase(t=ko.uppercase){return this.transform(n=>Eu(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Eu(n)||n===n.toUpperCase()})}}cn.prototype=P5.prototype;let boe=e=>e!=+e;function Wr(){return new M5}class M5 extends jo{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!boe(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return r.isType(i)||i===null?i:parseFloat(i)})})}min(t,n=_l.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=_l.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=_l.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return rthis.resolve(t)}})}positive(t=_l.positive){return this.moreThan(0,t)}negative(t=_l.negative){return this.lessThan(0,t)}integer(t=_l.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>Eu(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(i=>Eu(i)?i:Math[t](i))}}Wr.prototype=M5.prototype;var Soe=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function voe(e){var t=[1,4,5,6,7,10,11],n=0,r,i;if(i=Soe.exec(e)){for(var o=0,a;a=t[o];++o)i[a]=+i[a]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?r=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(n=i[10]*60+i[11],i[9]==="+"&&(n=0-n)),r=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let xoe=new Date(""),_oe=e=>Object.prototype.toString.call(e)==="[object Date]";class vb extends jo{constructor(){super({type:"date",check(t){return _oe(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=voe(t),isNaN(t)?vb.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Cf.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=G1.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=G1.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}vb.INVALID_DATE=xoe;vb.prototype;function koe(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([a,u])=>`${a}-${u}`));function o(a,u){let l=cf.split(a)[0];r.add(l),i.has(`${u}-${l}`)||n.push([u,l])}for(const a of Object.keys(e)){let u=e[a];r.add(a),Cf.isRef(u)&&u.isSibling?o(u.path,a):Dk(u)&&"deps"in u&&u.deps.forEach(l=>o(l,a))}return roe.array(Array.from(r),n).reverse()}function yI(e,t){let n=1/0;return e.some((r,i)=>{var o;if((o=t.path)!=null&&o.includes(r))return n=i,!0}),n}function L5(e){return(t,n)=>yI(e,t)-yI(e,n)}const Roe=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function $0(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=$0(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=$0(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map($0)}):"optional"in e?e.optional():e}const Toe=(e,t)=>{const n=[...cf.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=cf.getter(cf.join(n),!0)(e);return!!(i&&r in i)};let wI=e=>Object.prototype.toString.call(e)==="[object Object]";function Ooe(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const Noe=L5([]);function li(e){return new B5(e)}class B5 extends jo{constructor(t){super({type:"object",check(n){return wI(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Noe,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let o=this.fields,a=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,u=[].concat(this._nodes,Object.keys(i).filter(m=>!this._nodes.includes(m))),l={},f=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),p=!1;for(const m of u){let y=o[m],w=m in i;if(y){let b,x=i[m];f.path=(n.path?`${n.path}.`:"")+m,y=y.resolve({value:x,context:n.context,parent:l});let _=y instanceof jo?y.spec:void 0,O=_==null?void 0:_.strict;if(_!=null&&_.strip){p=p||m in i;continue}b=!n.__validating||!O?y.cast(i[m],f):i[m],b!==void 0&&(l[m]=b)}else w&&!a&&(l[m]=i[m]);(w!==m in l||l[m]!==i[m])&&(p=!0)}return p?l:i}_validate(t,n={},r,i){let{from:o=[],originalValue:a=t,recursive:u=this.spec.recursive}=n;n.from=[{schema:this,value:a},...o],n.__validating=!0,n.originalValue=a,super._validate(t,n,r,(l,f)=>{if(!u||!wI(f)){i(l,f);return}a=a||f;let p=[];for(let m of this._nodes){let y=this.fields[m];!y||Cf.isRef(y)||p.push(y.asNestedTest({options:n,key:m,parent:f,parentPath:n.path,originalParent:a}))}this.runTests({tests:p,value:f,originalValue:a,options:n},r,m=>{i(m.sort(this._sortErrors).concat(l),f)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,o]of Object.entries(this.fields)){const a=r[i];r[i]=a===void 0?o:a}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const o=this.fields[r];let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[r]})),n[r]=o&&"getDefault"in o?o.getDefault(a):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=koe(t,n),r._sortErrors=L5(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return $0(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n)}omit(t){const n=Object.assign({},this.fields);for(const r of t)delete n[r];return this.setFields(n)}from(t,n,r){let i=cf.getter(t,!0);return this.transform(o=>{if(!o)return o;let a=o;return Toe(o,t)&&(a=Object.assign({},o),r||delete a[t],a[n]=i(o)),a})}json(){return this.transform(Roe)}noUnknown(t=!0,n=K1.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const o=Ooe(this.schema,i);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=K1.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(Fx.camelCase)}snakeCase(){return this.transformKeys(Fx.snakeCase)}constantCase(){return this.transformKeys(t=>Fx.snakeCase(t).toUpperCase())}describe(t){let n=super.describe(t);n.fields={};for(const[i,o]of Object.entries(this.fields)){var r;let a=t;(r=a)!=null&&r.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),n.fields[i]=o.describe(a)}return n}}li.prototype=B5.prototype;const Coe=()=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",fill:"none",viewBox:"0 0 12 12",children:[d.jsx("circle",{cx:"6",cy:"6",r:"6",fill:"#DE0014"}),d.jsx("path",{fill:"#fff",d:"M6.62 3.64a.622.622 0 10-1.244 0l.083 2.983a.54.54 0 001.081 0l.08-2.984zM6 9c.368 0 .687-.31.69-.694A.7.7 0 006 7.617.69.69 0 006 9z"})]}),wn=({children:e,size:t="sm",...n})=>d.jsxs(xe,{mt:3,...n,children:[d.jsx(fe,{mr:2,position:"relative",top:{sm:"1px",md:"4px"}[t],children:d.jsx(Coe,{})}),d.jsx(fe,{children:e})]}),bn=({children:e,...t})=>d.jsx(ie,{textAlign:"left",lineHeight:"16px",display:"block",textStyle:"caption",color:ce("feedback-error"),...t,children:e}),bI=e=>{const t=encodeURIComponent(new URL(e).hostname),n=encodeURIComponent(new URL(e).port);return`${t==="localhost"?"http://":"https://"}${t}${n?`:${n}`:""}`},SI=e=>new rr.InfoApi(new rr.Configuration({basePath:e})).getCoreApiInfo().then(t=>Object.values(dn).includes(t.network_id)?t.network_id:void 0).catch(),Eoe=()=>{const{addCustomNetwork:e}=ms(),t=$l();return d.jsx(Bi,{validateOnChange:!1,validateOnBlur:!1,initialValues:{label:"",url:""},validate:async n=>{const r={};if(n.label||(r.label="You need to specify a label for this network."),!n.url)r.url="You need to specify a URL for this network.";else if(!await cn().matches(/^(?:([a-z0-9+.-]+):\/\/)(?:\S+(?::\S*)?@)?(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/).isValid(n.url))r.url="Please check the formatting of the URL passed.";else try{await SI(bI(n.url))||(r.genericError="The API did not return a valid network_id.")}catch(o){o.message.includes("Failed to fetch")?r.genericError="Could not connect to supplied network URL.":r.genericError=o.message}return r},onSubmit:async({url:n,label:r})=>{const i=bI(n),o=await SI(i);if(o){const a={label:r.trim(),url:i,networkId:o,mode:DW[o],isCustomNetwork:!0};e(a).then(()=>{t({pathname:"/",search:cs(a)})})}},children:n=>d.jsx(ui,{children:d.jsxs(It,{spacing:"24px",children:[d.jsxs(It,{spacing:"16px",children:[d.jsx(Cx,{name:"label",children:({field:r,form:i})=>d.jsxs(fe,{children:[d.jsx(lO,{children:"Name"}),d.jsx(sr,{...r,placeholder:"My Stacks API"}),i.touched&&i.errors.label&&d.jsx(wn,{children:d.jsx(bn,{children:i.errors.label})})]})}),d.jsx(Cx,{name:"url",children:({field:r,form:i})=>d.jsxs(fe,{children:[d.jsx(lO,{children:"URL"}),d.jsx(sr,{...r,placeholder:"https://"}),i.touched&&i.errors.url&&d.jsx(wn,{children:d.jsx(bn,{children:i.errors.url})})]})})]}),d.jsx(Cx,{name:"genericError",children:({form:r})=>d.jsx(fe,{style:{marginTop:0},children:r.touched&&r.errors.genericError&&d.jsx(wn,{children:d.jsx(bn,{children:r.errors.genericError})})})}),d.jsx(fe,{children:d.jsx(St,{isLoading:n.isValidating,width:"100%",type:"submit",children:"Add and select"})})]})})})},Aoe=()=>{const e=Yn();return d.jsx(lp,{title:"Add a network",isShowing:!0,onClose:()=>e(Nr.HOME),children:d.jsx(xe,{alignItems:"center",flexDirection:"column",pb:["loose","48px"],px:"loose",children:d.jsx(Ln,{width:"420px",children:d.jsxs(fe,{m:["loose","extra-loose"],children:[d.jsx(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:d.jsxs(ie,{fontSize:"14px",color:"textBody",children:["Use this form to add a new instance of the"," ",d.jsx(Li,{display:"inline",as:"a",href:"https://github.com/hirosystems/stacks-blockchain-api",target:"_blank",color:ce("brand"),children:"Stacks Blockchain API"}),". Make sure you review and trust the host before you add it."]})}),d.jsx(Eoe,{})]})})})})},Foe=()=>{const e=Yn();return d.jsx(lp,{title:"Select network",isShowing:!0,onClose:()=>{e(Nr.HOME)},children:d.jsx(xe,{alignItems:"center",flexDirection:"column",pb:["loose","48px"],px:"loose",children:d.jsx(Ln,{width:"420px",children:d.jsx(QZ,{})})})})};function Ioe(){return d.jsx(fe,{padding:"12px",children:d.jsx(fe,{backgroundColor:Ue.gray900,borderRadius:"12px",px:["12px","34px","60px","88px"],py:["12px","34px","60px","88px"],maxWidth:"1400px",margin:"auto",mt:"48px",backgroundImage:["inherit","inherit",'url("welcome.png")','url("welcome.png")'],backgroundRepeat:"no-repeat",backgroundPosition:"right",backgroundSize:"auto 100%",children:d.jsxs(fe,{maxWidth:["100%","100%","60%","calc(100% - 500px)"],children:[d.jsx(fe,{fontSize:"40px",weight:500,color:sf.textOnPrimary,pb:"24px",children:"What is Stacking?"}),d.jsx(fe,{fontSize:"20px",color:sf.textOnPrimary,pb:"24px",children:"By stacking, you temporarily lock up your tokens in order to provide valuable information to Stacks' consensus mechanism. In return, you are eligible to receive rewards in the form of BTC"}),d.jsx(fe,{fontSize:"16px",color:sf.textSubdued,children:"If you meet the protocol minimum, you can Stack your STX independently by directly interacting with the protocol. You also have the option to delegate your STX to a stacking pool provider."})]})})})}function Poe(){const{isSignedIn:e}=Mn();return e?d.jsx(Kw,{to:"../choose-stacking-method",replace:!0}):d.jsxs(fe,{children:[d.jsx(X8,{}),d.jsx(Ioe,{}),d.jsx(i5,{})]})}function co({address:e}){const{onCopy:t}=rP(e);return d.jsxs(d.Fragment,{children:[d.jsx(ie,{children:Mi(e)})," ",d.jsx(fe,{onClick:t,display:"inline-block",sx:{cursor:"pointer"},children:d.jsx(JP,{size:14})})]})}function Moe(e){return({version:t,hashbytes:n})=>sk(t[0],n,e)}const Jl=(e,t)=>Moe(HP(e.chainId)({[dn.Mainnet]:"mainnet",[dn.Testnet]:"testnet"}))(t);function Jk(e){return`${e} cycle${e!==1?"s":""}`}function j5({pendingStackExtend:e}){return d.jsx(fe,{pb:"base-loose",children:d.jsx(Fi,{icon:d.jsx(cg,{}),title:"Waiting for transaction confirmation",children:d.jsxs(kf,{children:["A stacking request was successfully submitted to the blockchain. Once confirmed, your STX will be stacking for an extra ",e.extendCycles.toString()," cycles."]})})})}function Loe(){const e=Yn();async function t(){e("../lock-more-stx")}async function n(){e("../extend-stacking")}return d.jsxs(Me,{mt:"loose",justifyContent:"space-evenly",children:[d.jsx(St,{mode:"tertiary",onClick:t,children:"Lock more STX"}),d.jsx(St,{mode:"tertiary",onClick:n,children:"Extend stacking"})]})}function Boe({lockedAmount:e,stackerInfoDetails:t,rewardCycleId:n,pendingStackExtend:r,pendingStackIncrease:i}){const{network:o}=Pt(),a=Math.max(n-t.first_reward_cycle,0),u=Math.min(a,t.lock_period),l=n{const n=t.contract_call.function_args;if(!n)throw new Error("Expected `args` to be defined.");const[r,i,o,a]=n.map(m=>sp(m.hex));if(!o||o.type!==we.UInt)throw new Error("Expected `startBurnHeightCV` to be of type `UInt`.");const u=BigInt(o.value);if(!r||r.type!==we.UInt)throw new Error("Expected `amountMicroStxCV` to be of type `UInt`.");const l=BigInt(r.value),f=sk(i,e);if(!a||a.type!==we.UInt)throw new Error("Expected `lockPeriodCV` to be of type `UInt`.");const p=BigInt(a.value);return{transactionId:t.tx_id,startBurnHeight:u,amountMicroStx:l,poxAddress:f,lockPeriod:p}}}async function qoe({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,network:i}){return pb({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,transactionPredicate:Joe,transactionConverter:$oe(i)})}function Uoe(e,t){return e.contract_call.function_name==="stack-extend"&&e.contract_call.contract_id===t}function Hoe(e){return t=>{const n=t.contract_call.function_args;if(!n)throw new Error("Expected `args` to be defined.");const[r,i]=n.map(u=>sp(u.hex)),o=Z8(r,"extendCycles"),a=sk(i,e);return{transactionId:t.tx_id,extendCycles:o,poxAddress:a}}}async function zoe({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,network:i}){return pb({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,transactionPredicate:Uoe,transactionConverter:Hoe(i)})}function Woe(e,t){return e.contract_call.function_name==="stack-increase"&&e.contract_call.contract_id===t}function Voe(e){const t=e.contract_call.function_args;if(!t)throw new Error("Expected `args` to be defined.");const[n]=t.map(i=>sp(i.hex)),r=Z8(n,"increaseBy");return{transactionId:e.tx_id,increaseBy:r}}async function Goe({stackingClient:e,accountsApi:t,address:n,transactionsApi:r}){return pb({stackingClient:e,accountsApi:t,address:n,transactionsApi:r,transactionPredicate:Woe,transactionConverter:Voe})}function xb(){const{accountsApi:e,transactionsApi:t}=Qw(),{client:n}=kn(),{address:r}=Mn(),{networkName:i}=Pt();if(!n)throw new Error("Expected to have a StackingClient available in the context.");if(!r)throw new Error("Expected `address` to be defined.");const o=yr(["pending-stacking-status",n,e,r,t,i],async()=>qoe({stackingClient:n,accountsApi:e,address:r,transactionsApi:t,network:i}),{refetchInterval:5e3}),a=yr(["pending-stack-increase",n,e,r,t,i],async()=>Goe({stackingClient:n,accountsApi:e,address:r,transactionsApi:t}),{refetchInterval:5e3}),u=yr(["pending-stack-extend",n,e,r,t,i],async()=>zoe({stackingClient:n,accountsApi:e,address:r,transactionsApi:t,network:i}),{refetchInterval:5e3});return{getHasPendingDirectStackingQuery:o,getHasPendingStackIncreaseQuery:a,getHasPendingStackExtendQuery:u}}function Koe(){var m;const{networkName:e}=Pt(),t=Bg(),n=ci(),r=db(),i=vk(),o=rn(),{getHasPendingDirectStackingQuery:a,getHasPendingStackIncreaseQuery:u,getHasPendingStackExtendQuery:l}=xb();if(t.isLoading||n.isLoading||r.isLoading||o.isLoading||i.isLoading||a.isLoading||u.isLoading||l.isLoading)return d.jsx(br,{});if(t.isError||!t.data||n.isError||!n.data||i.isError||typeof i.data!="bigint"||r.isError||!r.data||o.isError||!o.data||a.isError||a.data===void 0||u.isError||u.data===void 0||l.isLoading||l.data===void 0){const y="Error while loading data, try reloading the page.";return console.error(y),d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:y})})}const f=t.data.stacked;if(!f&&a.data===null)return d.jsx(joe,{});const p=(m=a.data)==null?void 0:m.transactionId;if(!f&&a.data)return d.jsx(Doe,{data:a.data,transactionId:p,networkName:e});if(!t.data.stacked){const y="ee504e56-9cc5-49b4-ae98-a5cac5c35dbf",w="Expected account to be stacked";return console.error(y,w),d.jsx(Mt,{id:y,children:w})}return d.jsx(Boe,{rewardCycleId:o.data.reward_cycle_id,lockedAmount:i.data,stackerInfoDetails:t.data.details,pendingStackIncrease:u.data,pendingStackExtend:l.data})}function Ug({txResult:e}){return d.jsx(fe,{my:"loose",children:d.jsx(Fi,{title:"Last tx result",children:d.jsx(kf,{children:e.txId})})})}function Sn(e){const{title:t,children:n,...r}=e;return d.jsxs(xe,{flexDirection:"column",mt:"extra-loose",...r,children:[d.jsx(Jo,{fontSize:"24px",mt:"extra-tight",mr:"tight",children:t}),d.jsx(fe,{children:n})]})}function Cn({children:e}){return d.jsx(It,{display:"block",textStyle:"body.large",spacing:"base",children:e})}const Yh=Gr(({children:e,...t},n)=>d.jsx(St,{size:"md",mt:"loose",ref:n,...t,children:e}));function fp({isLoading:e,title:t,actionLabel:n,isDisabled:r}){return d.jsx(Sn,{title:t,children:d.jsx(Yh,{type:"submit",isLoading:e,isDisabled:r,children:n})})}function vs(e){return d.jsx(xe,{flexDirection:"column",position:"sticky",minWidth:[null,null,"360px","420px"],top:"124px",...e})}const _b=$.forwardRef((e,t)=>{var u;const{fieldName:n,children:r,addressType:i,...o}=e,[a]=$t(n);return d.jsxs(d.Fragment,{children:[d.jsx(sr,{id:n,name:n,mt:"loose",maxWidth:"400px",fontFamily:(u=a==null?void 0:a.value)!=null&&u.length?"monospace":"unset",ref:t,placeholder:i==="BTC"?"Bitcoin address (Legacy, Native SegWit or Taproot)":i==="STX"?"Stacks address":void 0,...o}),r]})});_b.displayName="CryptoAddressInput";function Ef({description:e}){const[t,n]=$t("poxAddress"),r=Sk();if(r.isLoading)return d.jsx(fs,{});if(r.isError||!r.data){const o="e69b0abe-495d-4587-9693-8bd4541dddaf",a="Failed to establish current PoX period.";return console.error(o,a),d.jsx(bs,{id:o,children:a})}const i=n.error?d.jsx(wn,{maxWidth:"430px",children:d.jsx(bn,{lineHeight:"18px",children:n.error})}):null;return d.jsx(d.Fragment,{children:d.jsxs(Sn,{title:"Bitcoin address",children:[d.jsx(Cn,{children:e?d.jsx(ie,{color:ce("text-caption"),children:e}):d.jsx(ie,{color:ce("text-caption"),children:"Enter the Bitcoin address where you'd like to receive your rewards."})}),d.jsx(_b,{fieldName:"poxAddress",addressType:"BTC",...t,children:n.touched&&i})]})})}const $k=e=>{const t=rn();if(t.isLoading)return d.jsx(fs,{});if(t.isError||!t.data){const n="d447780e-7df2-4953-b409-aef9e91cf2e8",r="Failed to retrieve necessary data.";return console.error(n,r),d.jsx(bs,{id:n,children:r})}return d.jsxs(ie,{display:"block",textStyle:"body.small",color:ce("text-caption"),...e,children:["Cycles last ",t.data.reward_cycle_length," Bitcoin blocks."]})},Qoe=()=>d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M8.00378 16C12.3907 16 16 12.3983 16 8.00378C16 3.60925 12.3907 0 7.99622 0C3.6017 0 0 3.60925 0 8.00378C0 12.3983 3.60925 16 8.00378 16ZM8.00378 13.9462C4.70411 13.9462 2.06135 11.2959 2.06135 8.00378C2.06135 4.71166 4.70411 2.0538 7.99622 2.0538C11.2883 2.0538 13.9462 4.71166 13.9462 8.00378C13.9538 11.2959 11.2959 13.9462 8.00378 13.9462ZM5.08919 8.86456H10.9108C11.4167 8.86456 11.7867 8.51723 11.7867 8.01888C11.7867 7.50543 11.4243 7.15809 10.9108 7.15809H5.08919C4.57574 7.15809 4.21331 7.50543 4.21331 8.01888C4.21331 8.51723 4.58329 8.86456 5.08919 8.86456Z",fill:"currentColor"})}),Yoe=()=>d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M8.00378 16C12.3907 16 16 12.3983 16 8.00378C16 3.60925 12.3907 0 7.99622 0C3.6017 0 0 3.60925 0 8.00378C0 12.3983 3.60925 16 8.00378 16ZM8.00378 13.9462C4.70411 13.9462 2.06135 11.2959 2.06135 8.00378C2.06135 4.71166 4.70411 2.0538 7.99622 2.0538C11.2883 2.0538 13.9462 4.71166 13.9462 8.00378C13.9538 11.2959 11.2959 13.9462 8.00378 13.9462ZM7.99622 11.5602C8.50212 11.5602 8.84946 11.1977 8.84946 10.6843V8.86456H10.79C11.2959 8.86456 11.6659 8.51723 11.6659 8.01133C11.6659 7.50543 11.3034 7.15054 10.79 7.15054H8.84946V5.26286C8.84946 4.74941 8.50212 4.38697 7.99622 4.38697C7.49033 4.38697 7.14299 4.75696 7.14299 5.26286V7.15054H5.21C4.69655 7.15054 4.33412 7.50543 4.33412 8.01133C4.33412 8.51723 4.70411 8.86456 5.21 8.86456H7.14299V10.6843C7.14299 11.1902 7.49033 11.5602 7.99622 11.5602Z",fill:"currentColor"})}),D5=e=>t=>e+t,Sw=D5(1),J5=D5(-1),Q1=`1px solid ${ce("border")}`,vI=({children:e,...t})=>d.jsx(xe,{as:"button",type:"button",alignItems:"center",justifyContent:"center",width:"52px",height:"48px",border:Q1,outline:0,zIndex:1,_focus:{borderColor:"#C5CCFF",boxShadow:"0 0 0 3px rgba(170,179,255,0.75)"},...t,children:e}),qk=e=>{const{amount:t,onIncrement:n,onDecrement:r,...i}=e;return d.jsx(fe,{...i,children:d.jsxs(xe,{children:[d.jsx(vI,{color:ce(t===1?"text-caption":"brand"),pointerEvents:t===1?"none":"all",onClick:()=>r(J5(t)),borderRadius:"6px 0 0 6px",children:d.jsx(Qoe,{})}),d.jsx(xe,{borderTop:Q1,borderBottom:Q1,flexDirection:"column",justifyContent:"center",alignItems:"center",minWidth:"100px",children:d.jsx(ie,{textStyle:"body.small",mb:"3px",mx:"base",children:Jk(t)})}),d.jsx(vI,{color:ce(t===12?"text-caption":"brand"),pointerEvents:t===12?"none":"all",onClick:()=>n(Sw(t)),borderRadius:"0 6px 6px 0",children:d.jsx(Yoe,{})})]})})};function Uk({fieldName:e,description:t}){const[n,r,i]=$t(e||"lockPeriod");return d.jsx(d.Fragment,{children:d.jsxs(Sn,{title:"Duration",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:t||"Number of cycles to lock STX for this stacker"})}),d.jsx(qk,{mt:"loose",amount:n.value,onIncrement:o=>{o>Ww||i.setValue(o)},onDecrement:o=>{o1?"s":"")+" required, but only "+t.length+" present")}function Cr(e){ji(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Y1(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Xoe(e,t){ji(2,arguments);var n=Cr(e).getTime(),r=q5(t);return new Date(n+r)}var Zoe={};function ese(){return Zoe}function xI(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function U5(e,t){ji(2,arguments);var n=q5(t);return Xoe(e,n*1e3)}function q0(e,t){ji(2,arguments);var n=Cr(e),r=Cr(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function tse(e,t){ji(2,arguments);var n=Cr(e),r=Cr(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function nse(e,t){return ji(2,arguments),Cr(e).getTime()-Cr(t).getTime()}var _I={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},rse="trunc";function ise(e){return e?_I[e]:_I[rse]}function ose(e){ji(1,arguments);var t=Cr(e);return t.setHours(23,59,59,999),t}function sse(e){ji(1,arguments);var t=Cr(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function ase(e){ji(1,arguments);var t=Cr(e);return ose(t).getTime()===sse(t).getTime()}function cse(e,t){ji(2,arguments);var n=Cr(e),r=Cr(t),i=q0(n,r),o=Math.abs(tse(n,r)),a;if(o<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*o);var u=q0(n,r)===-i;ase(Cr(e))&&o===1&&q0(e,r)===1&&(u=!1),a=i*(o-Number(u))}return a===0?0:a}function use(e,t,n){ji(2,arguments);var r=nse(e,t)/1e3;return ise(void 0)(r)}var lse={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},dse=function(t,n,r){var i,o=lse[t];return typeof o=="string"?i=o:n===1?i=o.one:i=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};function Ix(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var fse={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},hse={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},pse={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mse={date:Ix({formats:fse,defaultWidth:"full"}),time:Ix({formats:hse,defaultWidth:"full"}),dateTime:Ix({formats:pse,defaultWidth:"full"})},gse={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yse=function(t,n,r,i){return gse[t]};function Pm(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{var u=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[u]}var f=e.argumentCallback?e.argumentCallback(t):t;return i[f]}}var wse={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},bse={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Sse={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vse={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xse={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},_se={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},kse=function(t,n){var r=Number(t),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Rse={ordinalNumber:kse,era:Pm({values:wse,defaultWidth:"wide"}),quarter:Pm({values:bse,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Pm({values:Sse,defaultWidth:"wide"}),day:Pm({values:vse,defaultWidth:"wide"}),dayPeriod:Pm({values:xse,defaultWidth:"wide",formattingValues:_se,defaultFormattingWidth:"wide"})};function Mm(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a=o[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?Ose(u,function(m){return m.test(a)}):Tse(u,function(m){return m.test(a)}),f;f=e.valueCallback?e.valueCallback(l):l,f=n.valueCallback?n.valueCallback(f):f;var p=t.slice(a.length);return{value:f,rest:p}}}function Tse(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function Ose(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[0],o=t.match(e.parsePattern);if(!o)return null;var a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;var u=t.slice(i.length);return{value:a,rest:u}}}var Cse=/^(\d+)(th|st|nd|rd)?/i,Ese=/\d+/i,Ase={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Fse={any:[/^b/i,/^(a|c)/i]},Ise={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Pse={any:[/1/i,/2/i,/3/i,/4/i]},Mse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Lse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Bse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},jse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Dse={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Jse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$se={ordinalNumber:Nse({matchPattern:Cse,parsePattern:Ese,valueCallback:function(t){return parseInt(t,10)}}),era:Mm({matchPatterns:Ase,defaultMatchWidth:"wide",parsePatterns:Fse,defaultParseWidth:"any"}),quarter:Mm({matchPatterns:Ise,defaultMatchWidth:"wide",parsePatterns:Pse,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Mm({matchPatterns:Mse,defaultMatchWidth:"wide",parsePatterns:Lse,defaultParseWidth:"any"}),day:Mm({matchPatterns:Bse,defaultMatchWidth:"wide",parsePatterns:jse,defaultParseWidth:"any"}),dayPeriod:Mm({matchPatterns:Dse,defaultMatchWidth:"any",parsePatterns:Jse,defaultParseWidth:"any"})},qse={code:"en-US",formatDistance:dse,formatLong:mse,formatRelative:yse,localize:Rse,match:$se,options:{weekStartsOn:0,firstWeekContainsDate:1}};function H5(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function Use(e){return H5({},e)}var kI=1440,Hse=2520,Px=43200,zse=86400;function Wse(e,t,n){var r,i;ji(2,arguments);var o=ese(),a=(r=(i=void 0)!==null&&i!==void 0?i:o.locale)!==null&&r!==void 0?r:qse;if(!a.formatDistance)throw new RangeError("locale must contain formatDistance property");var u=q0(e,t);if(isNaN(u))throw new RangeError("Invalid time value");var l=H5(Use(n),{addSuffix:!1,comparison:u}),f,p;u>0?(f=Cr(t),p=Cr(e)):(f=Cr(e),p=Cr(t));var m=use(p,f),y=(xI(p)-xI(f))/1e3,w=Math.round((m-y)/60),b;if(w<2)return w===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",w,l);if(w<45)return a.formatDistance("xMinutes",w,l);if(w<90)return a.formatDistance("aboutXHours",1,l);if(wd.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M8.00378 16C12.3907 16 16 12.3983 16 8.00378C16 3.60925 12.3907 0 7.99622 0C3.6017 0 0 3.60925 0 8.00378C0 12.3983 3.60925 16 8.00378 16ZM4.45493 9.18924C4.03209 9.18924 3.70741 8.85701 3.70741 8.43417C3.70741 8.01888 4.03209 7.68664 4.45493 7.68664H7.2487V3.78292C7.2487 3.36008 7.58093 3.03539 7.99622 3.03539C8.41907 3.03539 8.74375 3.36008 8.74375 3.78292V8.43417C8.74375 8.85701 8.41907 9.18924 7.99622 9.18924H4.45493Z",fill:"currentColor"})});function Rb({timeUntilNextCycle:e,...t}){const n=z5(U5(new Date,e));return d.jsxs(xe,{...t,children:[d.jsx(xe,{width:"44px",height:"44px",background:ce("bg-4"),borderRadius:"50%",alignItems:"center",justifyContent:"center",children:d.jsx(Vse,{size:"14px"})}),d.jsxs(xe,{ml:"base",flexDirection:"column",children:[d.jsx(ie,{as:"h4",display:"block",textStyle:"body.large.medium",lineHeight:"20px",children:"Next cycle starts in"}),d.jsx(ie,{display:"block",textStyle:"body.large",color:ce("text-caption"),lineHeight:"20px",mt:"extra-tight",children:n})]})]})}function W5({children:e,...t}){return d.jsx(ie,{textStyle:"body.large",display:"block",color:ce("text-caption"),...t,children:e})}function hp(e){const{timeUntilNextCycle:t,estimatedStackingMinimum:n,children:r}=e;return d.jsxs(d.Fragment,{children:[d.jsx(Jo,{children:"Manage your pool"}),d.jsx(W5,{mt:"base-loose",children:r}),d.jsxs(xe,{alignItems:"baseline",children:[d.jsx(Rb,{timeUntilNextCycle:t,mt:"40px"}),d.jsx($5,{ml:"extra-loose",estimatedStackingMinimum:n})]})]})}const Tb=e=>d.jsx(xe,{flexDirection:"column",maxWidth:"1216px",mb:"extra-loose",mx:["loose","loose","extra-loose","extra-loose","auto"],...e});function pp(e){const{intro:t,poolAdminPanel:n,poolAdminForm:r}=e;return d.jsx(Tb,{pt:"80px",mb:"extra-loose",children:d.jsxs(xe,{flexDirection:["column-reverse","column-reverse","row"],justifyContent:"space-between",children:[d.jsxs(fe,{maxWidth:[null,null,"544px"],mr:[null,null,"extra-loose"],children:[t,d.jsx(fe,{display:["block",null,"none"],mt:["extra-loose",null,null,null,"base"],children:n}),r]}),d.jsx(fe,{display:["none",null,"block"],children:n})]})})}function Kl({children:e}){const t=Array.isArray(e)?e:[e],n=t.flatMap((r,i)=>$.isValidElement(r)?[d.jsx(Pn,{mt:"extra-loose",mb:"48px"},i.toString()+"-hr"),$.cloneElement(r,{key:i,step:Sw(i),mb:Sw(i)===t.length?"280px":void 0})]:null);return d.jsx(fe,{mt:"48px",children:n})}function Gse({address:e,children:t}){const{setFieldValue:n}=ar(),{network:r}=Pt(),i=new _f({address:e,network:r}),o=fb(i),a=gb({client:i,address:e,network:r});return $.useEffect(()=>{!a.data||!o.data||(n("lockedAmount",o.data.stx.locked),n("totalAmount",o.data.stx.balance),n("delegated",a.data.delegated),a.data.delegated?(n("delegatedAmount",a.data.details.amount_micro_stx),n("delegatedTo",a.data.details.delegated_to)):(n("delegatedAmount",0n),n("delegatedTo","")))},[n,o.data,a.data]),d.jsx(Kl,{children:t})}function zk({children:e}){const{values:t}=ar(),n=t.stacker,r=xf(n);return d.jsx(d.Fragment,{children:r?d.jsx(Gse,{address:n,children:e}):d.jsx(Kl,{children:e})})}function Kse({stacker:e}){var o;const{network:t}=Pt(),n=new _f({address:e,network:t}),r=fb(n);let i=null;return!r.isError&&((o=r.data)!=null&&o.stx)&&(i=Yt(r.data.stx.locked)),i===null||i===0n?d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"Pool member can't be extended"}),d.jsx(ie,{textStyle:"body.large.medium",children:"Locked amount: 0 STX"}),d.jsx(co,{address:e})]}):d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You'll extend locking of"}),d.jsxs(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:[Jt(i??0)," for"]}),d.jsx(co,{address:e})]})}function Qse(){var a;const e=ar(),t=rn(),{stacker:n,poxAddress:r,extendCount:i}=e.values,o=n&&xf(n)&&e.errors.stacker===void 0;return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsx(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:o?d.jsx(Kse,{stacker:n}):d.jsx(ie,{textStyle:"body.large.medium",children:"Choose pool member first!"})}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:`One cycle lasts ${(a=t.data)==null?void 0:a.reward_cycle_length} blocks on the Bitcoin blockchain`,children:"Cycles to be added"}),d.jsx(Ge,{children:i})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool PoX address"}),d.jsx(Ge,{children:r?Mi(r):"—"})]})})]})]})})}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -796,5 +796,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var vw=function(){return vw=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{if(!e||typeof e!="string")throw new Error(`Expected base58 string but got “${e}”`);if(e.match(/[IOl0]/gmu))throw new Error(`Invalid base58 character “${e.match(/[IOl0]/gmu)}”`);const t=e.match(/^1+/gmu),n=t?t[0].length:0,r=(e.length-n)*(Math.log(58)/Math.log(256))+1>>>0;return new Uint8Array([...new Uint8Array(n),...e.match(/.{1}/gmu).map(o=>X1.indexOf(o)).reduce((o,a)=>o=o.map(u=>{const l=58*u+a;return a=l>>8,l}),new Uint8Array(r)).reverse().filter((i=!1,o=>i=i||o))]);var i};(()=>{const e=Array(256).fill(-1);for(let t=0;t>25;return(33554431&m)<<5^996825010&-(y>>0&1)^642813549&-(y>>1&1)^513874426&-(y>>2&1)^1027748829&-(y>>3&1)^705979059&-(y>>4&1)}function o(m){let y=1;for(let w=0;w126)return"Invalid prefix ("+m+")";y=i(y)^b>>5}y=i(y);for(let w=0;w=w;)k-=w,N.push(x>>k&O);if(b)k>0&&N.push(x<=y)return"Excess padding";if(x<x)return"Exceeds length limit";const k=b.toLowerCase(),O=b.toUpperCase();if(b!==k&&b!==O)return"Mixed-case string "+b;const N=(b=k).lastIndexOf("1");if(N===-1)return"No separator character for "+b;if(N===0)return"Missing prefix for "+b;const E=b.slice(0,N),T=b.slice(N+1);if(T.length<6)return"Data too short";let B=o(E);if(typeof B=="string")return B;const A=[];for(let U=0;U=T.length||A.push(R)}return B!==y?"Invalid checksum for "+b:{prefix:E,words:A}}return y=m==="bech32"?1:734539939,{decodeUnsafe:function(b,x){const k=w(b,x);if(typeof k=="object")return k},decode:function(b,x){const k=w(b,x);if(typeof k=="object")return k;throw new Error(k)},encode:function(b,x,k){if(k=k||90,b.length+7+x.length>k)throw new TypeError("Exceeds length limit");let O=o(b=b.toLowerCase());if(typeof O=="string")throw new Error(O);let N=b+"1";for(let E=0;E>5)throw new Error("Non 5-bit word");O=i(O)^T,N+=n.charAt(T)}for(let E=0;E<6;++E)O=i(O);O^=y;for(let E=0;E<6;++E)N+=n.charAt(O>>5*(5-E)&31);return N},toWords:u,fromWordsUnsafe:l,fromWords:f}}t.bech32=p("bech32"),t.bech32m=p("bech32m")},RI(Mx={exports:{}},Mx.exports),Mx.exports);(N0=Wk)&&N0.__esModule&&Object.prototype.hasOwnProperty.call(N0,"default")&&N0.default;var Zse=Wk.bech32m,TI=Wk.bech32;const eae=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];class tae{constructor(){this.A=1779033703,this.B=-1150833019,this.C=1013904242,this.D=-1521486534,this.E=1359893119,this.F=-1694144372,this.G=528734635,this.H=1541459225,this._size=0,this._sp=0,(!C0||Lm>=8e3)&&(C0=new ArrayBuffer(8e3),Lm=0),this._byte=new Uint8Array(C0,Lm,80),this._word=new Int32Array(C0,Lm,20),Lm+=80}update(t){if(typeof t=="string")return this._utf8(t);if(t==null)throw new TypeError("Invalid type: "+typeof t);const n=t.byteOffset,r=t.byteLength;let i=r/64|0,o=0;if(i&&!(3&n)&&!(this._size%64)){const a=new Int32Array(t.buffer,n,16*i);for(;i--;)this._int32(a,o>>2),o+=64;this._size+=o}if(t.BYTES_PER_ELEMENT!==1&&t.buffer){const a=new Uint8Array(t.buffer,n+o,r-o);return this._uint8(a)}return o===r?this:this._uint8(t,o)}_uint8(t,n){const{_byte:r,_word:i}=this,o=t.length;for(n|=0;n=64&&this._int32(i),this._size+=u-a}return this}_utf8(t){const{_byte:n,_word:r}=this,i=t.length;let o=this._sp;for(let a=0;a>>6,n[l++]=128|63&f):f<55296||f>57343?(n[l++]=224|f>>>12,n[l++]=128|f>>>6&63,n[l++]=128|63&f):o?(f=((1023&o)<<10)+(1023&f)+65536,n[l++]=240|f>>>18,n[l++]=128|f>>>12&63,n[l++]=128|f>>>6&63,n[l++]=128|63&f,o=0):o=f}l>=64&&(this._int32(r),r[0]=r[16]),this._size+=l-u}return this._sp=o,this}_int32(t,n){let{A:r,B:i,C:o,D:a,E:u,F:l,G:f,H:p}=this,m=0;for(n|=0;m<16;)Ud[m++]=_o(t[n++]);for(m=16;m<64;m++)Ud[m]=aae(Ud[m-2])+Ud[m-7]+sae(Ud[m-15])+Ud[m-16]|0;for(m=0;m<64;m++){const y=p+oae(u)+nae(u,l,f)+eae[m]+Ud[m]|0,w=iae(r)+rae(r,i,o)|0;p=f,f=l,l=u,u=a+y|0,a=o,o=i,i=r,r=y+w|0}this.A=r+this.A|0,this.B=i+this.B|0,this.C=o+this.C|0,this.D=a+this.D|0,this.E=u+this.E|0,this.F=l+this.F|0,this.G=f+this.G|0,this.H=p+this.H|0}digest(t){const{_byte:n,_word:r}=this;let i=this._size%64|0;for(n[i++]=128;3&i;)n[i++]=0;if(i>>=2,i>14){for(;i<16;)r[i++]=0;i=0,this._int32(r)}for(;i<16;)r[i++]=0;const o=8*this._size,a=(4294967295&o)>>>0,u=(o-a)/4294967296;return u&&(r[14]=_o(u)),a&&(r[15]=_o(a)),this._int32(r),t==="hex"?this._hex():this._bin()}_hex(){const{A:t,B:n,C:r,D:i,E:o,F:a,G:u,H:l}=this;return vl(t)+vl(n)+vl(r)+vl(i)+vl(o)+vl(a)+vl(u)+vl(l)}_bin(){const{A:t,B:n,C:r,D:i,E:o,F:a,G:u,H:l,_byte:f,_word:p}=this;return p[0]=_o(t),p[1]=_o(n),p[2]=_o(r),p[3]=_o(i),p[4]=_o(o),p[5]=_o(a),p[6]=_o(u),p[7]=_o(l),f.slice(0,32)}}const Ud=new Int32Array(64);let C0,Lm=0;const vl=e=>(e+4294967296).toString(16).substr(-8),_o=new Uint8Array(new Uint16Array([65279]).buffer)[0]===254?e=>e:e=>e<<24&4278190080|e<<8&16711680|e>>8&65280|e>>24&255,nae=(e,t,n)=>n^e&(t^n),rae=(e,t,n)=>e&t|n&(e|t),iae=e=>(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),oae=e=>(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7),sae=e=>(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3,aae=e=>(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10;var Au,Fu,OI=function(e){return function(t){return new tae}().update(e).digest()};(function(e){e.mainnet="mainnet",e.testnet="testnet",e.regtest="regtest"})(Au||(Au={})),function(e){e.p2pkh="p2pkh",e.p2sh="p2sh",e.p2wpkh="p2wpkh",e.p2wsh="p2wsh",e.p2tr="p2tr"}(Fu||(Fu={}));var NI={0:{type:Fu.p2pkh,network:Au.mainnet},111:{type:Fu.p2pkh,network:Au.testnet},5:{type:Fu.p2sh,network:Au.mainnet},196:{type:Fu.p2sh,network:Au.testnet}},V5=function(e){var t,n=e.substr(0,2).toLowerCase();if(n==="bc"||n==="tb")return function(l){var f;try{f=l.startsWith("bc1p")||l.startsWith("tb1p")||l.startsWith("bcrt1p")?Zse.decode(l):TI.decode(l)}catch{throw new Error("Invalid address")}var p={bc:Au.mainnet,tb:Au.testnet,bcrt:Au.regtest}[f.prefix];if(p===void 0)throw new Error("Invalid address");var m=f.words[0];if(m<0||m>16)throw new Error("Invalid address");return{bech32:!0,network:p,address:l,type:TI.fromWords(f.words.slice(1)).length===20?Fu.p2wpkh:m===1?Fu.p2tr:Fu.p2wsh}}(e);try{t=Xse(e)}catch{throw new Error("Invalid address")}var r=t.length;if(r!==25)throw new Error("Invalid address");var i=t[0],o=t.slice(r-4,r),a=t.slice(0,r-4),u=OI(OI(a)).slice(0,4);if(o.some(function(l,f){return l!==u[f]}))throw new Error("Invalid address");if(!Object.keys(NI).map(Number).includes(i))throw new Error("Invalid address");return vw(vw({},NI[i]),{address:e,bech32:!1})},cae=function(e,t){try{var n=V5(e);return!t||t===n.network}catch{return!1}};function uae(e,t){if(!cae(e))return"Invalid BTC address";const r=V5(e);return r?t==="mainnet"&&r.network==="testnet"?"Testnet addresses not supported on Mainnet":t==="testnet"&&r.network==="mainnet"?"Mainnet addresses not supported on Testnet":wW.includes(r.type)?!0:"Unsupported BTC address type":"Invalid BTC address"}function Ql({network:e}){return cn().defined("Enter the BTC address where you'd like to recieve your rewards").test({name:"btc-address",message:"The BTC address you've entered is not valid",test(t){if(t==null||typeof t!="string")return!1;const n=uae(t,e);return typeof n=="string"?this.createError({message:n}):n}})}function lae(e,t){const n=e.substring(0,2);return t==="testnet"?n==="SN"||n==="ST":t==="mainnet"?n==="SM"||n==="SP":!1}function Vk(e,t){return e.defined("Must define a STX address").test({name:"address-validation",test(n,r){if(!n)return!1;const[i,o]=n.split(".");return!vf(i)||o===""?r.createError({message:"Input address is not a valid STX address"}):lae(n,t)?!0:r.createError({message:`Must use a ${t} STX address`})}})}function dae({network:e}){return li().shape({stacker:Vk(cn(),e),extendCount:Wr().defined().positive().integer().min(1).max(12),poxAddress:Ql({network:e})})}function fae({client:e,setIsContractCallExtensionPageOpen:t,setTxResult:n,network:r}){return async function(o){const[a]=await Promise.all([e.getStackingContract()]),u=e.getDelegateStackExtendOptions({contract:a,stacker:o.stacker,poxAddress:o.poxAddress,extendCount:o.extendCount});console.log(u),Do({...u,network:r,onFinish(l){n(l),t(!1)},onCancel(){t(!1)}}),t(!0)}}const hae={stacker:"",poxAddress:"",extendCount:0,totalAmount:void 0,lockedAmount:void 0,unlockHeight:void 0,delegated:void 0,delegatedTo:void 0,delegatedAmount:void 0};function pae(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(mae,{client:e})}function mae({client:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(),{networkName:o,network:a}=Pt(),u=Vu(),l=rn(),f=ci();if(u.isLoading||l.isLoading||f.isLoading)return d.jsx(br,{});if(u.isError||typeof u.data!="number"||l.isError||!l.data||f.isError||typeof f.data.stx.balance!="string"){const y="Failed to load necessary data.",w="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(w,y),d.jsx(Mt,{id:w,children:y})}const p=dae({currentBurnHt:l.data.current_burnchain_block_height||0,network:o}),m=fae({client:e,setIsContractCallExtensionPageOpen:n,setTxResult:i,network:a});return d.jsx(Bi,{initialValues:{...hae,startBurnHt:l.data.current_burnchain_block_height?l.data.current_burnchain_block_height+10:0},onSubmit:y=>{m(y)},validationSchema:p,children:d.jsx(pp,{intro:d.jsx(hp,{estimatedStackingMinimum:BigInt(l.data.min_amount_ustx),timeUntilNextCycle:u.data,children:"You can extend the duration of an existing pool member. This will not change the amount."}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(Qse,{})})}),poolAdminForm:d.jsx(ui,{children:d.jsxs(d.Fragment,{children:[d.jsxs(zk,{children:[d.jsx(Hk,{}),d.jsx(Uk,{fieldName:"extendCount",description:"Number of extra cycles to add for this stacker"}),d.jsx(Cf,{}),d.jsx(fp,{isLoading:t,title:"Extend locking period",actionLabel:"Confirm and extend"})]}),r&&d.jsx(Ug,{txResult:r})]})})})})}function gae(){const{values:e}=ar(),{delegated:t,lockedAmount:n,totalAmount:r,delegatedAmount:i}=e;return t===void 0||!n||!r||!i?null:d.jsxs(d.Fragment,{children:[d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight",children:["Available balance: ",Jt(r)]}),d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight",children:["Locked amount: ",Jt(n)]}),d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight",children:["Delegated amount: ",Jt(i)]})]})}function G5(){const e=rn(),[t,n]=$t("amount");if(e.isError||!e.data){const r="134098d7-444b-4591-abfe-8767af6def3f",i="Failed to load necessary data.";return console.error(r,i),d.jsx(bs,{id:r,children:i})}return d.jsxs(Sn,{title:"Choose amount",children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsx(ie,{children:"Must be less than or equal to the delegated amount and the stacker's balance."})})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"stxAmount",placeholder:"Amount of STX to Stack",mt:"loose",...t}),n.touched&&n.error&&d.jsx(wn,{children:d.jsx(bn,{children:n.error})})]}),d.jsx(gae,{})]})}function Hg(e){if(e==="")return Jt(0);const t=Un(e);return t.isNaN()||t.gt($h)?"—":Jt(t)}function yae({stacker:e,amount:t}){return d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You'll lock"}),d.jsxs(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:[Hg(t??0)," for"]}),d.jsx(co,{address:e})]})}function wae({stacker:e,amount:t}){const{network:n}=Pt(),r=new xf({address:e,network:n}),i=fb(r);if(i.isError||!i.data)return d.jsx(Ge,{children:"0 STX"});const o=Yt(t)*1000000n-Yt(i.data.stx.locked);return d.jsx(Ge,{children:Jt(o>0n?o:0n)})}function bae(){const e=ar(),{stacker:t,amount:n,poxAddress:r}=e.values,i=t&&vf(t)&&e.errors.stacker===void 0;return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsx(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:i?d.jsx(yae,{stacker:t,amount:n}):d.jsx(ie,{textStyle:"body.large.medium",children:"Choose pool member first!"})}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"Additional STX to be locked and use in the stacking transaction.",children:"Increase by"}),i?d.jsx(wae,{stacker:t,amount:n}):d.jsx(Ge,{children:"0 STX"})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool PoX address"}),d.jsx(Ge,{children:r?Mi(r):"—"})]})})]})]})})}function Ob(e){return t=>{const n=new Qt(t).toString(10).split(".")[1];return n===void 0||n.length<=e}}function K5(){return{name:"test-delegated-stx-amount",message:"You must stack less than the stacker balance and delegation amount",test:(e,t)=>{if(e==null)return!1;if(t.parent.totalAmount===void 0||t.parent.delegatedAmount===void 0)return!0;const n=Un(e);return n.isLessThanOrEqualTo(new Qt(t.parent.totalAmount.toString()))&&n.isLessThanOrEqualTo(new Qt(t.parent.delegatedAmount.toString()))}}}function mp(){return Wr().required("Enter an amount of STX").positive("You must stack something").typeError("STX amount must be a number")}function Sae({network:e}){return li().shape({amount:mp().test("test-precision","You cannot stack with a precision of less than 1 STX",t=>t===void 0?!0:Ob(0)(t)).test({name:"test-increase",message:"You must stack more than the currently locked amount",test:(t,n)=>t==null?!1:n.parent.lockedAmount===void 0?!0:Un(t).isGreaterThan(new Qt(n.parent.lockedAmount.toString()))}).test(K5()),stacker:Vk(cn(),e),poxAddress:Ql({network:e})})}function vae({client:e,setIsContractCallExtensionPageOpen:t,setTxResult:n,network:r}){return async function(o){if(o.amount===null)throw new Error("Expected a non-null amount to be submitted.");const u=await new xf({address:o.stacker,network:r}).getAccountExtendedBalances(),l=Yt(Un(o.amount).toString())-Yt(u.stx.locked),[f]=await Promise.all([e.getStackingContract()]),p=e.getDelegateStackIncreaseOptions({contract:f,stacker:o.stacker,increaseBy:l.toString(),poxAddress:o.poxAddress});Do({...p,network:r,onFinish(m){n(m),t(!1)},onCancel(){t(!1)}}),t(!0)}}const xae={stacker:"",amount:"",poxAddress:"",totalAmount:void 0,lockedAmount:void 0,unlockHeight:void 0,delegated:void 0,delegatedTo:void 0,delegatedAmount:void 0};function _ae(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(kae,{client:e})}function kae({client:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(),{networkName:o,network:a}=Pt(),u=Vu(),l=rn(),f=ci();if(u.isLoading||l.isLoading||f.isLoading)return d.jsx(br,{});if(u.isError||typeof u.data!="number"||l.isError||!l.data||f.isError||typeof f.data.stx.balance!="string"){const y="Failed to load necessary data.",w="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(w,y),d.jsx(Mt,{id:w,children:y})}const p=Sae({network:o}),m=vae({client:e,setIsContractCallExtensionPageOpen:n,setTxResult:i,network:a});return d.jsx(Bi,{initialValues:{...xae,startBurnHt:l.data.current_burnchain_block_height?l.data.current_burnchain_block_height+10:0},onSubmit:y=>{m(y)},validationSchema:p,children:d.jsx(pp,{intro:d.jsx(hp,{estimatedStackingMinimum:BigInt(l.data.min_amount_ustx),timeUntilNextCycle:u.data,children:"You can increase the locked amount for an existing pool member. The amount will be used from the next cycle onwards."}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(bae,{})})}),poolAdminForm:d.jsx(ui,{children:d.jsxs(d.Fragment,{children:[d.jsxs(zk,{children:[d.jsx(Hk,{}),d.jsx(G5,{}),d.jsx(Cf,{}),d.jsx(fp,{isLoading:t,title:"Increase stacking amount",actionLabel:"Confirm and lock more"})]}),r&&d.jsx(Ug,{txResult:r})]})})})})}function Rae(){const e=rn(),[t,n]=$t("startBurnHt");if(e.isError||!e.data){const r="134098d7-444b-4591-abfe-8767af6def3f",i="Failed to load necessary data.";return console.error(r,i),d.jsx(bs,{id:r,children:i})}return d.jsxs(Sn,{title:"Choose start burn height",children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsxs(ie,{children:["Current burn height is ",e.data.current_burnchain_block_height,". The value must be in the future and before the anchor block of the next cycle. Add for example 10 blocks."]})})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"startBurnHt",placeholder:"Bitcoin block",mt:"loose",...t}),n.touched&&n.error&&d.jsx(wn,{children:d.jsx(bn,{children:n.error})})]})]})}function Tae(){var u;const e=ar(),t=rn(),{stacker:n,amount:r,lockPeriod:i,poxAddress:o,startBurnHt:a}=e.values;return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You'll lock"}),d.jsxs(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:[Hg(r??0)," for"]}),d.jsx(co,{address:n})]}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:`One cycle lasts ${(u=t.data)==null?void 0:u.reward_cycle_length} blocks on the Bitcoin blockchain`,children:"Cycles"}),d.jsx(Ge,{children:i})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Start Burn Height"}),d.jsx(Ge,{children:a})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool PoX address"}),d.jsx(Ge,{children:o?Mi(o):"—"})]})})]})]})})}function Oae({currentBurnHt:e,network:t}){return li().shape({amount:mp().test("test-precision","You cannot stack with a precision of less than 1 STX",n=>n===void 0?!0:Ob(0)(n)).test(K5()),lockPeriod:Wr().defined(),startBurnHt:Wr().test({name:"test-future-start-burn-height",message:"Start burn height must be in the future.",test:n=>n==null?!1:n>e}),stacker:cn().defined(),poxAddress:Ql({network:t})})}function Nae({client:e,setIsContractCallExtensionPageOpen:t,setTxResult:n,network:r}){return async function(o){if(o.amount===null)throw new Error("Expected a non-null amount to be submitted.");const[a]=await Promise.all([e.getStackingContract()]),u=e.getDelegateStackOptions({contract:a,stacker:o.stacker,amountMicroStx:Un(o.amount).toString(10),cycles:o.lockPeriod,poxAddress:o.poxAddress,burnBlockHeight:o.startBurnHt});Do({...u,network:r,onFinish(l){n(l),t(!1)},onCancel(){t(!1)}}),t(!0)}}const Cae={stacker:"",amount:"",lockPeriod:12,poxAddress:"",startBurnHt:0,totalAmount:void 0,lockedAmount:void 0,unlockHeight:void 0,delegated:void 0,delegatedTo:void 0,delegatedAmount:void 0};function Eae(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(Aae,{client:e})}function Aae({client:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(),{networkName:o,network:a}=Pt(),u=Vu(),l=rn();if(u.isLoading||l.isLoading)return d.jsx(br,{});if(u.isError||typeof u.data!="number"||l.isError||!l.data){const m="Failed to load necessary data.",y="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(y,m),d.jsx(Mt,{id:y,children:m})}const f=Oae({availableBalanceUStx:Yt($h.toString()),currentBurnHt:l.data.current_burnchain_block_height||0,network:o}),p=Nae({client:e,setIsContractCallExtensionPageOpen:n,setTxResult:i,network:a});return d.jsx(Bi,{initialValues:{...Cae,startBurnHt:l.data.current_burnchain_block_height?l.data.current_burnchain_block_height+10:0},onSubmit:m=>{p(m)},validationSchema:f,children:d.jsx(pp,{intro:d.jsx(hp,{estimatedStackingMinimum:BigInt(l.data.min_amount_ustx),timeUntilNextCycle:u.data,children:"You need to lock STX for your pool members for 1 or more cycles. You also need to finalized each cycle."}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(Tae,{})})}),poolAdminForm:d.jsx(ui,{children:d.jsxs(d.Fragment,{children:[d.jsxs(zk,{children:[d.jsx(Hk,{}),d.jsx(G5,{}),d.jsx(Uk,{}),d.jsx(Rae,{}),d.jsx(Cf,{}),d.jsx(fp,{isLoading:t,title:"Lock STX for pool member",actionLabel:"Confirm and lock STX"})]}),r&&d.jsx(Ug,{txResult:r})]})})})})}function Fae(){const e=rn();return e.isLoading?null:e.isError||!e.data?d.jsx(d.Fragment,{children:"Failed to load Pox data"}):d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsx(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:d.jsx(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:"Cycles"})}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{explainer:`One cycle lasts ${e.data.reward_cycle_length} blocks on the Bitcoin blockchain`,children:"Current Cycle"}),d.jsx(Ge,{children:e.data.current_cycle.id})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Total Stacked"}),d.jsx(Ge,{children:Jt(e.data.current_cycle.stacked_ustx)})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Per Slot"}),d.jsx(Ge,{children:Jt(e.data.current_cycle.min_threshold_ustx)})]})]}),d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{children:"Next Cycle"}),d.jsx(Ge,{children:e.data.next_cycle.id})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Starts in"}),d.jsxs(Ge,{children:[e.data.next_cycle.blocks_until_prepare_phase," blocks"]})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Total Stacked"}),d.jsx(Ge,{children:Jt(e.data.next_cycle.stacked_ustx)})]}),d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"The price per slot can change until the last block",children:"Per Slot (estimated)"}),d.jsx(Ge,{children:Jt(e.data.next_cycle.min_threshold_ustx)})]})]})]})]})})}function CI(){VI(),Mn();const e=Vu(),t=rn(),n=Yn();if(e.isLoading||t.isLoading)return d.jsx(br,{});if(e.isError||typeof e.data!="number"||t.isError||!t.data){const r="Failed to load necessary data.",i="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(i,r),d.jsx(Mt,{id:i,children:r})}return d.jsx(pp,{intro:d.jsxs(hp,{estimatedStackingMinimum:BigInt(t.data.min_amount_ustx),timeUntilNextCycle:e.data,children:["Managing a stacking pool usually happens directly through the pox-4 contract. For each pool member, who delegated to your pool address, you have to stack their stack and later extend and/or increase their locked tokens.",d.jsx("br",{}),"After locking your members' STX, you have to finalized the cycle by calling stack aggregation commit."]}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(Fae,{})})}),poolAdminForm:d.jsx(d.Fragment,{children:d.jsxs(It,{spacing:"base",mt:"extra-loose",children:[d.jsx(St,{onClick:()=>n(Nr.DELEGATE_STACK_STX),children:"Delegate Stack STX"}),d.jsx(St,{onClick:()=>n(Nr.DELEGATE_STACK_EXTEND),children:"Delegate Stack Extend"}),d.jsx(St,{onClick:()=>n(Nr.DELEGATE_STACK_INCREASE),children:"Delegate Stack Increase"}),d.jsx(St,{onClick:()=>n(Nr.STACK_AGGREGATION_COMMIT),children:"Stack Aggregation Commit"}),d.jsx(St,{onClick:()=>n(Nr.STACK_AGGREGATION_INCREASE),children:"Stack Aggregation Increase"})]})})})}function Q5(){const e=rn(),[t,n]=$t("rewardCycleId");if(e.isError||!e.data){const r="134098d7-444b-4591-abfe-8767af6def3f",i="Failed to load necessary data.";return console.error(r,i),d.jsx(bs,{id:r,children:i})}return d.jsxs(Sn,{title:"Choose reward cycle",children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsxs(ie,{color:ce("text-caption"),children:["Next cycle is ",e.data.reward_cycle_id+1]})})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"rewardCycle",placeholder:"Next cycle",mt:"loose",...t}),(n.touched||t)&&n.error&&d.jsx(wn,{children:d.jsx(bn,{children:n.error})})]})]})}function E0({title:e,text:t,fieldName:n,placeholder:r}){const[i,o,a]=$t(n);return d.jsxs(d.Fragment,{children:[d.jsx(Jo,{fontSize:"20px",children:e}),t,d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{...i,mt:"loose",onChange:u=>{if("value"in u.target){const{value:l}=u.target;return l?a.setValue(l.replaceAll("0x","")):i.onChange(u)}return i.onChange(u)},placeholder:r}),o.touched&&o.error&&d.jsx(wn,{children:d.jsx(bn,{children:o.error})})]})]})}function zg(){const{setValues:e}=ar(),[t,n]=$.useState(""),{activeNetwork:r}=ms(),i=o=>{if(o.preventDefault(),n(""),o.clipboardData&&o.clipboardData.items.length>0&&o.clipboardData.items[0].kind==="string"){const a=async u=>{try{const l=JSON.parse(u),f=BigInt(l.maxAmount);e(p=>({...p,signatureJSON:u,signerKey:l.signerKey,maxAmount:j_(f),authId:l.authId,signerSignature:l.signerSignature}),!0)}catch(l){console.error(l),n("Invalid signer data")}};o.clipboardData.items[0].getAsString(a)}};return d.jsx(d.Fragment,{children:d.jsxs(Sn,{title:"Signer Information",children:[d.jsx(Cn,{children:d.jsxs(ie,{color:ce("text-caption"),children:["When you engage in Stacking, you're associating your locked STX with a signer actively involved in the Stacks network's consensus process. With the"," ",d.jsx($r,{href:"https://www.nakamoto.run/",children:"Nakamoto Release"}),", Stackers who choose to stack independently will need to run their own signer software."]})}),d.jsxs(ie,{mt:"loose",color:ce("text-caption"),children:["If you're interested in running your own signer, please consult"," ",d.jsx($r,{href:"https://docs.stacks.co/nakamoto-upgrade/signing-and-stacking/stacking-flow",children:"these documents"})," ","on how to Stack as a signer and fill out"," ",d.jsx(Nl,{href:`/signer/generate-signature${cs(r)}`,display:"inline-block",children:"this page"})," ","to generate a signer signature. If you prefer not to manage your own signer, we suggest"," ",d.jsx(Nl,{href:`/start-pooled-stacking${cs(r)}`,display:"inline-block",children:"Stacking using another method"}),". Users who are not running their own signer software will need to request this data from the signer that you're using. Enter the data you receive here:"]}),d.jsx(sr,{onPaste:i,placeholder:"paste signature JSON here..",my:"base-loose"}),t&&d.jsx(wn,{children:d.jsx(bn,{children:t})}),d.jsx(ie,{mb:"base",color:ce("text-caption"),children:"Alternatively, enter the information manually."}),d.jsx(E0,{title:"Signer Public Key",text:d.jsx(ie,{color:ce("text-caption"),children:"Enter the signer's public key in hexadecimal format:"}),placeholder:"public key 0x1234..ef",fieldName:"signerKey"}),d.jsx(E0,{title:"Signer Signature (optional)",text:d.jsx(ie,{color:ce("text-caption"),children:"Enter the hexadecimal signature from the signer enabling you to Stack with their key. Leave this field blank if the signature is universal for all Stackers who use this signer:"}),placeholder:"signature 0x1234..0123..ef",fieldName:"signerSignature"}),d.jsx(E0,{title:"Max Amount",text:d.jsx(ie,{color:ce("text-caption"),children:"Enter the maximum amount of STX that can be locked while using this signature:"}),placeholder:"Maximum amount of STX to lock",fieldName:"maxAmount"}),d.jsx(E0,{title:"Auth ID",text:d.jsx(ie,{color:ce("text-caption"),children:"Enter the signer's Auth ID, a randomly generated number that prevents signer signature reuse:"}),placeholder:"value provided by signer",fieldName:"authId"})]})})}const Y5=340282366920938463463374607431768211455n,Iae=new Qt(j_(Y5)),Sg=j_(Y5),qn=li().shape({signerKey:cn().required(),signerSignature:cn().required(),authId:cn().required(),rewardCycle:cn().required(),maxAmount:cn().required(),period:cn().required(),poxAddress:cn().required(),method:cn().required()});function Nb({signatureData:e}){return d.jsxs(d.Fragment,{children:[d.jsxs(bt,{children:[d.jsx(Me,{children:d.jsx(Ve,{children:d.jsx(xe,{alignItems:"center",justifyContent:"center",children:d.jsx(ie,{children:"Public Key"})})})}),d.jsx(Me,{children:d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:e?`0x${e.publicKey}`:"—"})})})]}),d.jsxs(bt,{children:[d.jsx(Me,{children:d.jsx(Ve,{children:d.jsx(xe,{alignItems:"center",justifyContent:"center",children:d.jsx(ie,{children:"Signature"})})})}),d.jsx(Me,{children:d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:e?`0x${e.signature}`:"—"})})})]}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Max Amount"}),d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:e&&e.maxAmount?e.maxAmount===Sg?"MAX":e.maxAmount:"—"})})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Auth ID"}),d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:e?e.authId:"—"})})]})})]})}function Pae(){const e=ar(),{rewardCycleId:t,poxAddress:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a}=e.values;return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You'll finalize"}),d.jsxs(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:["Cycle ",t]})]}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool PoX address"}),d.jsx(Ge,{children:n?Mi(n):"—"})]})}),d.jsx(Nb,{signatureData:i&&r?{signature:i,publicKey:r,maxAmount:o,authId:a}:void 0})]})]})})}function yf(){return cn().test("no-0x","Value may not start with 0x",e=>typeof e!="string"||!e.length?!0:!e.startsWith("0x"))}function Mae({network:e}){return li().shape({rewardCycleId:Wr().defined().test("matches-signature-reward-cycle","Reward cycle does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return parseInt(r.rewardCycle,10)===t}),poxAddress:Ql({network:e.networkName}).test("matches-signature-pox-address","BTC Address does not match signature data",function(t){const n=this.parent.signatureJSON;return typeof n!="string"?!0:qn.json().cast(n).poxAddress===t}),signerKey:yf().required(),signerSignature:yf().test("matches-topic","Signature was not generated for stack-aggregation-commit",function(t){const n=this.parent.signatureJSON;return typeof n!="string"?!0:qn.json().cast(n).method==="agg-commit"}).test("valid-signature","Unable to validate signature",function(t,n){if(typeof t!="string")return!0;const r={topic:"agg-commit",rewardCycle:n.parent.rewardCycleId,poxAddress:n.parent.poxAddress,authId:n.parent.authId,network:e.network,publicKey:n.parent.signerKey,signature:t,period:1,maxAmount:Vr(n.parent.maxAmount)};return console.log(r),Vl(r)}),maxAmount:cn().defined().test("matches-signature-max-amount","Max amount does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return Pi(r.maxAmount).isEqualTo(Pi(Vr(t)))}),signatureJSON:cn(),authId:Wr().defined().test("matches-signature","Auth ID does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return BigInt(r.authId)===BigInt(t)})})}function Lae({client:e,poxOperationInfo:t,setIsContractCallExtensionPageOpen:n,setTxResult:r}){return async function(o){const[a]=await Promise.all([e.getStackingContract()]),u=t.current===t.pox4,l=parseInt(o.authId,10),f=Vr(o.maxAmount);typeof o.signerSignature=="string"&&(Vl({topic:"agg-commit",poxAddress:o.poxAddress,rewardCycle:o.rewardCycleId,authId:l,maxAmount:f,period:1,network:e.network,publicKey:o.signerKey,signature:o.signerSignature})?console.log("Signature is valid"):console.warn("Unable to verify signature."));const p=e.getStackAggregationCommitOptionsIndexed({contract:a,poxAddress:o.poxAddress,rewardCycle:o.rewardCycleId,signerKey:u?o.signerKey:void 0,signerSignature:u?o.signerSignature:void 0,maxAmount:f,authId:l});Do({...p,onFinish(m){r(m),n(!1)},onCancel(){n(!1)}}),n(!0)}}const Bae={poxAddress:"",rewardCycleId:0,signerKey:"",signerSignature:"",maxAmount:"",authId:""};function jae(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(Dae,{client:e})}function Dae({client:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(),o=Pt(),{btcAddressP2wpkh:a}=Mn(),u=Vu(),l=rn(),f=ci(),p=Sk();if(u.isLoading||l.isLoading||f.isLoading||p.isLoading)return d.jsx(br,{});if(u.isError||typeof u.data!="number"||l.isError||!l.data||f.isError||typeof f.data.stx.balance!="string"||p.isError||!p.data){const w="Failed to load necessary data.",b="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(b,w),d.jsx(Mt,{id:b,children:w})}const m=Mae({network:o}),y=Lae({client:e,poxOperationInfo:p.data,setIsContractCallExtensionPageOpen:n,setTxResult:i});return d.jsx(Bi,{initialValues:{...Bae,poxAddress:a??"",rewardCycleId:l.data.reward_cycle_id+1},onSubmit:w=>{y(w)},validationSchema:m,children:d.jsx(pp,{intro:d.jsx(hp,{estimatedStackingMinimum:BigInt(l.data.min_amount_ustx),timeUntilNextCycle:u.data,children:"You need to finalized each cycle."}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(Pae,{})})}),poolAdminForm:d.jsx(ui,{children:d.jsxs(d.Fragment,{children:[d.jsxs(Kl,{children:[d.jsx(Q5,{}),d.jsx(Cf,{}),d.jsx(zg,{}),d.jsx(fp,{isLoading:t,title:"Stack Aggregation Commit",actionLabel:"Finalize cycle"})]}),r&&d.jsx(Ug,{txResult:r})]})})})})}function Jae(){const[e,t]=$t("rewardCycleIndex");return d.jsxs(Sn,{title:"Choose Reward Cycle Index",children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsx(ie,{color:ce("text-caption"),children:"The reward cycle index is the identifier of your stacking. It is returned by Stack Aggegation Commit action."})})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"rewardCycleIndex",placeholder:"Indentifier for the cycle",mt:"loose",...e}),(t.touched||e)&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})})]})]})}function $ae(){const e=ar(),{rewardCycleId:t,rewardCycleIndex:n,poxAddress:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u}=e.values;return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You'll increase Stacking for"}),d.jsxs(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:["Cycle ",t]})]}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Reward Cycle Index"}),d.jsx(Ge,{children:n||"—"})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool PoX address"}),d.jsx(Ge,{children:r?Mi(r):"—"})]})}),d.jsx(Nb,{signatureData:o&&i?{signature:o,publicKey:i,maxAmount:a,authId:u}:void 0})]})]})})}function qae({network:e}){return li().shape({rewardCycleId:Wr().defined().test("matches-signature-reward-cycle","Reward cycle does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return parseInt(r.rewardCycle,10)===t}),poxAddress:Ql({network:e.networkName}).test("matches-signature-pox-address","BTC Address does not match signature data",function(t){const n=this.parent.signatureJSON;return typeof n!="string"?!0:qn.json().cast(n).poxAddress===t}),signerKey:yf().required(),signerSignature:yf().test("matches-topic","Signature was not generated for stack-aggregation-increase",function(t){const n=this.parent.signatureJSON;return typeof n!="string"?!0:qn.json().cast(n).method==="agg-increase"}).test("valid-signature","Unable to validate signature",function(t,n){if(typeof t!="string")return!0;const r={topic:"agg-increase",rewardCycle:n.parent.rewardCycleId,poxAddress:n.parent.poxAddress,authId:n.parent.authId,network:e.network,publicKey:n.parent.signerKey,signature:t,period:1,maxAmount:Vr(n.parent.maxAmount)};return Vl(r)}),maxAmount:cn().defined().test("matches-signature-max-amount","Max amount does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return Pi(r.maxAmount).isEqualTo(Pi(Vr(t)))}),signatureJSON:cn(),authId:Wr().defined().test("matches-signature","Auth ID does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return BigInt(r.authId)===BigInt(t)})})}function Uae({client:e,poxOperationInfo:t,setIsContractCallExtensionPageOpen:n,setTxResult:r}){return async function(o){const[a]=await Promise.all([e.getStackingContract()]),u=t.current===t.pox4,l=parseInt(o.authId,10),f=Vr(o.maxAmount);typeof o.signerSignature=="string"&&(Vl({topic:"agg-increase",poxAddress:o.poxAddress,rewardCycle:o.rewardCycleId,authId:l,maxAmount:f,period:1,network:e.network,publicKey:o.signerKey,signature:o.signerSignature})?console.log("Signature is valid"):console.warn("Unable to verify signature."));const p=e.getStackAggregationIncreaseOptions({contract:a,poxAddress:o.poxAddress,rewardCycle:o.rewardCycleId,rewardCycleIndex:o.rewardCycleIndex,signerKey:u?o.signerKey:void 0,signerSignature:u?o.signerSignature:void 0,maxAmount:f,authId:l});bk({...p,onFinish(m){r(m),n(!1)},onCancel(){n(!1)}}),n(!0)}}const Hae={poxAddress:"",rewardCycleId:0,rewardCycleIndex:0,signerKey:"",signerSignature:"",maxAmount:"",authId:""};function zae(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(Wae,{client:e})}function Wae({client:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(),o=Pt(),{btcAddressP2wpkh:a}=Mn(),u=Vu(),l=rn(),f=ci(),p=Sk();if(u.isLoading||l.isLoading||f.isLoading||p.isLoading)return d.jsx(br,{});if(u.isError||typeof u.data!="number"||l.isError||!l.data||f.isError||typeof f.data.stx.balance!="string"||p.isError||!p.data){const w="Failed to load necessary data.",b="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(b,w),d.jsx(Mt,{id:b,children:w})}const m=qae({network:o}),y=Uae({client:e,poxOperationInfo:p.data,setIsContractCallExtensionPageOpen:n,setTxResult:i});return d.jsx(Bi,{initialValues:{...Hae,poxAddress:a??"",rewardCycleId:l.data.reward_cycle_id+1},onSubmit:w=>{y(w)},validationSchema:m,children:d.jsx(pp,{intro:d.jsx(hp,{estimatedStackingMinimum:BigInt(l.data.min_amount_ustx),timeUntilNextCycle:u.data,children:"You need to finalized each cycle."}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx($ae,{})})}),poolAdminForm:d.jsx(ui,{children:d.jsxs(d.Fragment,{children:[d.jsxs(Kl,{children:[d.jsx(Q5,{}),d.jsx(Jae,{}),d.jsx(Cf,{}),d.jsx(zg,{}),d.jsx(fp,{isLoading:t,title:"Stack Aggregation Increase",actionLabel:"Increase Stacking Amount"})]}),r&&d.jsx(Ug,{txResult:r})]})})})})}const Vae=()=>d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM3 8C3 10.7614 5.23858 13 8 13C9.01911 13 9.967 12.6951 10.7574 12.1716L3.82843 5.24255C3.30489 6.033 3 6.98089 3 8ZM8 3C6.98089 3 6.033 3.30489 5.24255 3.82843L12.1716 10.7574C12.6951 9.967 13 9.01911 13 8C13 5.23858 10.7614 3 8 3Z",fill:"#74777D"})});function Gk({stackerInfoDetails:e,poxAddress:t}){const n=rn(),r=e.first_reward_cycle+e.lock_period-1,i=n.data&&n.data.current_cycle.id>=r,o=n.data&&n.data.current_cycle.id>=e.first_reward_cycle;return d.jsxs(d.Fragment,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{explainer:o?`Rewards became active in cycle ${e.first_reward_cycle}`:`Rewards will become active in cycle ${e.first_reward_cycle}`,children:"Rewards active?"}),d.jsx(Ge,{color:ce(o?"feedback-success":"feedback-alert"),children:o?"Yes":"No"})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Start"}),d.jsxs(Ge,{children:["Cycle ",e.first_reward_cycle," "]})]}),d.jsxs(Me,{children:[d.jsx(Ve,{explainer:i?"STX will unlock after the current cycle. For continous stacking, you need to extend your pooled stacking.":"STX will unlock after that cycle",children:"End"}),d.jsxs(Ge,{color:i?ce("feedback-error"):void 0,children:["Cycle ",r]})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool reward address"}),d.jsx(Ge,{children:d.jsx(co,{address:t})})]})]})}function Gae({handleKeepPoolingClick:e,handleStopPoolingClick:t,handleDelegateAgainClick:n,isSelfService:r}){return d.jsx(Ln,{children:d.jsx(fe,{mx:["loose","extra-loose"],children:d.jsxs(xe,{flexDirection:"column",pt:"loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"Increase pooling amount"}),r?d.jsxs(d.Fragment,{children:[d.jsx(ie,{py:"loose",children:"To increase the amount of STX you can just delegate a higher amount for the next cycle."}),d.jsxs(It,{children:[d.jsx(St,{mode:"tertiary",onClick:e,children:"Keep same amount"}),d.jsx(St,{onClick:n,children:"Delegate again"})]})]}):d.jsxs(d.Fragment,{children:[d.jsx(ie,{py:"loose",children:"To increase the amount of STX you must first stop the current pool and start pooling again, your pool operator can then lock a higher amount for the next cycles."}),d.jsxs(It,{children:[d.jsx(St,{mode:"tertiary",onClick:e,children:"Keep pooling"}),d.jsx(St,{onClick:t,children:"I understand I want to stop pooling"})]})]})," "]})})})}function X5({extendedStxBalances:e}){var i;const n=(i=db().data)==null?void 0:i.burn_block_height;let r="0";if(n&&e){const o=e.burnchain_unlock_height-e.burnchain_lock_height;if(o>0){const a=e.burnchain_unlock_height-n;r=Math.max((o-a)/o*100,0).toFixed(2)}}return d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"This percentage measures the number of blocks between when you locked STX to when your STX are unlocked",children:"Progress"}),d.jsxs(Ge,{children:[r,"%"]})]})}function Kae({networkName:e}){return li().shape({stacker:Vk(cn(),e)})}function Qae({navigate:e,setIsContractCallExtensionPageOpen:t,delegatedTo:n,network:r}){return async({stacker:i})=>{const[o,a]=ju(r)[n].split("."),u={contractAddress:o,contractName:a,functionName:"delegate-stack-stx",functionArgs:[no(i)],network:r};t(!0),Do({...u,onCancel(){t(!1)},onFinish(){t(!1),e(Nr.POOLED_STACKING_INFO)}})}}function Yae(e,t){const n=t.reward_cycle_length/2,r=t.reward_cycle_length-(e-t.first_burnchain_block_height+n-1)%t.reward_cycle_length,i=r-n-t.prepare_phase_block_length-1,o=r=n}function Xae(){var u;const e=Yn(),t=rn(),r=(u=db().data)==null?void 0:u.burn_block_height;if(!t.data||!r)return d.jsx(d.Fragment,{});const{extendWindow:i,tooEarly:o,tooLate:a}=Yae(r,t.data);return d.jsxs(d.Fragment,{children:[o||a?d.jsxs(Me,{children:[d.jsxs(Ve,{children:["Extend to cycle ",t.data.current_cycle.id+1," in"]}),d.jsxs(Ge,{children:[i.blocksUntilStart," blocks"]})]}):d.jsxs(Me,{children:[d.jsx(Ve,{children:"Time left to extend"}),d.jsxs(Ge,{children:[i.blocksUntilEnd," blocks"]})]}),d.jsx(Me,{justifyContent:"space-evenly",children:d.jsx(St,{isDisabled:o||a,onClick:()=>e(Nr.SELF_SERVICE_EXTEND),children:"Extend pooled stacking"})})]})}function Zae({delegationInfoDetails:e,poolAddress:t,isContractCallExtensionPageOpen:n,handleStopPoolingClick:r,extendedStxBalance:i,stackerInfo:o}){const a=Yn(),u=o.stacked,[l,f]=$.useState(!1),{network:p}=Pt(),m=e.delegated_to===ju(p)[wt.WrapperFastPool]||e.delegated_to===ju(p)[wt.WrapperRestake];return d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You're pooling"}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",mb:"extra-loose",children:Jt(e.amount_micro_stx)}),d.jsx(Pn,{}),d.jsx(wr,{my:"extra-loose",children:d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{children:"Status"}),d.jsx(Ge,{color:u?"green":ce("text-caption"),children:u?"Active":"Waiting on pool"})]}),d.jsx(X5,{extendedStxBalances:i}),u&&d.jsxs(d.Fragment,{children:[d.jsx(Gk,{stackerInfoDetails:o.details,poxAddress:Dl(p,o.details.pox_address)}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Stacked amount"}),d.jsx(Ge,{children:Jt(Yt(i.locked))})]})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Type"}),d.jsx(Ge,{children:e.until_burn_ht?"Limted permission":"Indefinite permission"})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool address"}),d.jsx(Ge,{children:d.jsx(co,{address:t})})]}),m&&u&&!l&&d.jsx(Xae,{}),l?d.jsx(Gae,{isSelfService:m,handleStopPoolingClick:()=>{f(!1),r()},handleKeepPoolingClick:()=>f(!1),handleDelegateAgainClick:()=>a(Nr.START_POOLED_STACKING)}):d.jsx(Me,{justifyContent:"space-evenly",children:d.jsx(St,{mode:"tertiary",onClick:()=>f(!0),children:"Increase pooling amount"})})]})}),d.jsx(Pn,{}),d.jsx(wr,{my:"extra-loose",children:d.jsx(bt,{children:!l&&d.jsx(Me,{children:d.jsx(Ve,{children:d.jsxs(St,{variant:"link",isDisabled:n,onClick:()=>{r()},color:ce("text-caption"),children:[d.jsx(fe,{pr:"tight",children:d.jsx(Vae,{})})," ","Stop pooling"]})})})})})]})}function ece({isContractCallExtensionPageOpen:e,handleStopPoolingClick:t}){return d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"display.large",children:"You've finished pooling"}),d.jsx(ie,{pb:"base-loose",children:"Revoke the pool's permission to stack on your behalf to start stacking again."}),d.jsx(fe,{children:d.jsx(St,{disabled:e,onClick:()=>{t()},children:"Revoke permission"})})]})}function xw({to:e,children:t,...n}){return d.jsx(fe,{display:"inline",cursor:"pointer",outline:0,color:ce("brand"),_hover:{textDecoration:"underline"},_focus:{textDecoration:"underline"},...n,children:d.jsx(Ah,{to:e,children:t})})}function tce({extendedStxBalances:e,poolAddress:t}){return d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"display.large",children:"You're pooling"}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",my:"extra-loose",children:Jt(Yt(e.locked))}),d.jsx(Pn,{}),d.jsxs(wr,{my:"extra-loose",children:[d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{children:"Status"}),d.jsx(Ge,{color:"green",children:"Active"})]}),d.jsx(X5,{extendedStxBalances:e})]}),t&&d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool address"}),d.jsx(Ge,{children:d.jsx(co,{address:t})})]})}),d.jsx(bt,{children:d.jsxs(Fi,{icon:d.jsx(Th,{}),children:["You've revoked the pool's delegation. You may want to"," ",d.jsx(Li,{display:"inline",to:"../start-pooled-stacking",as:xw,color:ce("brand"),children:"start pooling"})," ","again or"," ",d.jsx(Li,{display:"inline",to:"../choose-stacking-method",as:xw,color:ce("brand"),children:"choose a different stacking method"}),"."]})})]})]})}function nce(){return d.jsx(xe,{height:"100%",justify:"center",align:"center",m:"loose",children:d.jsx(Ln,{p:"extra-loose",width:["360px","360px","360px","420px"],children:d.jsx(Fi,{icon:d.jsx(Th,{}),children:d.jsxs(It,{children:[d.jsx(ie,{children:"It appears that you're not pooling yet. If you recently started to pool, your pooling info will appear here in a few seconds."}),d.jsxs(ie,{children:["You may want to"," ",d.jsx(Li,{display:"inline",to:"../start-pooled-stacking",as:xw,color:ce("brand"),children:"start pooling"})," ","or"," ",d.jsx(Li,{display:"inline",to:"../choose-stacking-method",as:xw,color:ce("brand"),children:"choose your stacking method"}),"."]})]})})})})}function rce(){var u,l,f,p;const{client:e}=kn(),{address:t}=Mn(),{transactionsApi:n}=Qw();if(!e)throw new Error("Expected to have a StackingClient available in the context.");if(!t)throw new Error("Expected `address` to be defined.");const r=ci(),i=mb(),o=(l=(u=r.data)==null?void 0:u.stx)==null?void 0:l.lock_tx_id,a=(f=i.data)!=null&&f.delegated?(p=i.data)==null?void 0:p.details.delegated_to:void 0;return yr(["stacker",{txId:o,poolAddress:a}],async({queryKey:m})=>{const{txId:y,poolAddress:w}=m[1];return w?{poolAddress:w}:y?{address:(await n.getTransactionById({txId:y})).sender_address}:{address:null}},{enabled:!r.isLoading&&!i.isLoading})}function ice(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.";return console.error(t),d.jsx(Mt,{id:"6f080d24-1e87-45ab-b8f7-41ba9bd53e97",children:t})}return d.jsx(oce,{client:e})}function oce({client:e}){const[t,n]=$.useState(!1),r=mb(),i=Bg(),o=ci(),a=db(),u=rn(),l=rce();if(r.isLoading||i.isLoading||o.isLoading||a.isLoading||l.isLoading||l.isFetching||u.isLoading)return d.jsx(br,{});if(r.isError||!r.data||i.isError||!i.data||o.isError||!o.data||l.isError||!l.data||a.isError||!a.data||u.isError||!u.data){const w="Error while loading data, try reloading the page.";return console.error(w),d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:w})})}const f=i.data.stacked,p=l.data.address||(r.data.delegated?r.data.details.delegated_to:void 0);if(!r.data.delegated&&!f||!p)return d.jsx(nce,{});const m=r.data.delegated&&r.data.details.until_burn_ht!==void 0&&!Number.isNaN(r.data.details.until_burn_ht)&&r.data.details.until_burn_hto(!0),children:"Lock for other pool members"})})]}):d.jsxs(d.Fragment,{children:[d.jsx(ie,{py:"loose",children:"You are not part of a pool."}),d.jsx(Me,{m:"loose",justifyContent:"space-evenly",children:d.jsx(St,{onClick:()=>o(!0),children:"Lock for other pool members"})})]})}function ace({address:e,stackerInfoDetails:t,delegationStatus:n,requiresExtension:r}){const{network:i}=Pt();if(!n.delegated)return d.jsxs(Mt,{children:["User ",Mi(e)," is not part of any pool."]});const o=n.details.delegated_to,a=UP(o),u=n.details.pox_address?Dl(i,{version:new Uint8Array([n.details.pox_address.version]),hashbytes:n.details.pox_address.hashbytes}):void 0,l=t!=null&&t.pox_address?Dl(i,t.pox_address):void 0;return r?d.jsxs(d.Fragment,{children:[t&&l&&d.jsx(Gk,{stackerInfoDetails:t,poxAddress:l}),a?d.jsxs(d.Fragment,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool address"}),d.jsx(Ge,{children:d.jsx(co,{address:o})})]}),u&&d.jsxs(Me,{children:[d.jsx(Ve,{children:"Required pool reward address"}),d.jsx(Ge,{children:d.jsx(co,{address:u})})]}),d.jsx(Pn,{}),d.jsx(ie,{children:"Lock their delegated STX for 1 more cycle."})]}):d.jsx(Fi,{children:d.jsx(_f,{children:"User is not stacking with a Self-Service Pool."})})]}):d.jsx(ie,{children:"User is already stacking for the next cycle. No need to lock again now."})}function cce({onClose:e,isContractCallExtensionPageOpen:t}){const[n,r]=$.useState(!1),[i,o]=$t("stacker"),{network:a}=Pt(),u=i.value,l=new xf({address:u,network:a}),f=uZ(l),p=rn(),m=gb({client:l,address:u,network:a});if(p.isError||!p.data||m.isError||!m.data||f.isError||!f.data)return d.jsx(br,{});const y=f.data.stacked?f.data.details:void 0,w=y?Z5(y,p.data):!0,b=m.data;return d.jsxs(d.Fragment,{children:[n?d.jsx(ace,{address:u,stackerInfoDetails:y,delegationStatus:b,requiresExtension:w}):d.jsx(ie,{children:"Enter the Stacks address of a pool member to lock their delegated STX for 1 more cycle."}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"stacker",placeholder:"Stacks address",mt:"loose",isDisabled:n,...i}),o.touched&&o.error&&d.jsx(wn,{children:d.jsx(bn,{children:o.error})})]}),d.jsxs(Me,{m:"loose",justifyContent:"space-between",children:[d.jsx(St,{mode:"tertiary",onClick:e,children:"Cancel"}),n?d.jsxs(St,{type:"submit",isLoading:t,isDisabled:!w||!b.delegated,children:[d.jsx(fe,{mr:"loose",children:d.jsx(ps,{})}),"Lock STX"]}):d.jsx(St,{onClick:x=>{x.preventDefault(),r(!0)},children:"Preview"})]})]})}function uce({stackerInfoDetails:e,showExtendForOtherUser:t,lockedBalance:n}){return d.jsx(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:e&&!t?d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You're stacking"}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",children:Jt(n)})]}):d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"Self-service pooling with"}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",children:"Fast Pool"})]})})}function lce(e){const{currentUser:t,stackerInfoDetails:n,poxInfo:r,lockedBalance:i,isContractCallExtensionPageOpen:o}=e,[a,u]=$.useState(!1),l=Yn(),{poxDisabled:f}=hb(),p=()=>{l(Nr.POOLED_STACKING_INFO)},m=n?"Extend stacking":"Stack again";return d.jsx(lp,{title:m,isShowing:!f,onClose:p,children:d.jsx(xe,{alignItems:"center",flexDirection:"column",pb:["loose","48px"],px:"loose",children:d.jsx(Ln,{width:"420px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsx(uce,{stackerInfoDetails:n,showExtendForOtherUser:a,lockedBalance:i}),d.jsx(Pn,{}),d.jsx(wr,{pt:"base-loose",children:d.jsx(bt,{children:a?d.jsx(cce,{onClose:p,isContractCallExtensionPageOpen:o}):d.jsx(sce,{poxInfo:r,address:t,stackerInfoDetails:n,onClose:p,isContractCallExtensionPageOpen:o,setShowExtendForOtherUser:u})})})]})})})})}function dce(){var O,N,E,T;const e=Yn(),t=Bg(),n=mb(),r=vk(),i=rn(),{client:o}=kn(),{address:a}=Mn(),{network:u,networkName:l}=Pt(),[f,p]=$.useState(!1);if(t.isLoading||n.isLoading||r.isLoading||i.isLoading)return d.jsx(br,{});if(a===null)return d.jsx(Mt,{children:d.jsx(ie,{children:" Authentication required"})});if(t.isError||!t.data||r.isError||typeof r.data!="bigint"||i.isError||!i.data||n.isError||!n.data||!o){const B="Error while loading data, try reloading the page.";return console.error(B),d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:B})})}const m=(O=t.data)!=null&&O.stacked?(N=t.data)==null?void 0:N.details:void 0,y=(E=n.data)!=null&&E.delegated?(T=n.data)==null?void 0:T.details:void 0,w=ju(u);let b;switch(y==null?void 0:y.delegated_to){case w[wt.WrapperFastPool]:b=wt.WrapperFastPool;break;case w[wt.WrapperRestake]:b=wt.WrapperRestake;break;default:b=void 0}if(b===void 0)return d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:"Not pooling with a self-service pool"})});const x=Kae({networkName:l}),k=Qae({navigate:e,setIsContractCallExtensionPageOpen:p,delegatedTo:b,network:u});return d.jsx(Bi,{initialValues:{stacker:a||""},onSubmit:k,validationSchema:x,children:d.jsx(ui,{children:d.jsx(lce,{currentUser:a,stackerInfoDetails:m,lockedBalance:r.data,poxInfo:i.data,isContractCallExtensionPageOpen:f})})})}function fce(){kn();const[e,t]=$.useState(null),n=Pt();return{openSignatureRequest:$.useCallback(async i=>{const{message:o,domain:a}=ak({topic:i.topic,period:i.period,network:n.network,rewardCycle:i.rewardCycle,poxAddress:i.poxAddress,maxAmount:i.maxAmount,authId:i.authId});await ZX({domain:a,message:o,onFinish:u=>{console.log("signature done",u);const l=Vl({topic:i.topic,period:i.period,network:n.network,rewardCycle:i.rewardCycle,poxAddress:i.poxAddress,signature:u.signature,publicKey:u.publicKey,maxAmount:i.maxAmount,authId:i.authId});console.log(l),t(u)}})},[n.network,t]),signatureData:e}}function hce(){const[e,t,n]=$t("authId"),r=lt.useCallback(()=>{n.setValue(Math.floor(Math.random()*1e7))},[n]);return d.jsxs(Sn,{title:"Auth ID",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:"A random number that is used to prevent re-use of the signature"})}),d.jsxs(fe,{position:"relative",my:"loose",children:[d.jsx(sr,{id:"authId",placeholder:"Authorisation id",...e}),t.touched&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})}),d.jsx(St,{type:"button",mode:"tertiary",size:"sm",height:"28px",right:"12px",top:"10px",style:{position:"absolute"},width:"110px",onClick:r,children:"Random"})]})]})}function pce(){const e=rn(),[t,n]=$t("rewardCycleId"),[r,i]=$t("topic");if(e.isError||!e.data){const o="134098d7-444b-4591-abfe-8767af6def3f",a="Failed to load necessary data.";return console.error(o,a),d.jsx(bs,{id:o,children:a})}return d.jsxs(Sn,{title:"Choose reward cycle",children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsxs(ie,{color:ce("text-caption"),children:["Next cycle is ",e.data.reward_cycle_id+1]})})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"rewardCycle",placeholder:"Next cycle",mt:"loose",...t}),(n.touched||i.touched)&&n.error&&d.jsx(wn,{children:d.jsx(bn,{children:n.error})})]})]})}function mce(){const[e,t,n]=$t("maxAmount"),r=lt.useCallback(()=>{n.setValue(Sg.toString())},[n]);return d.jsxs(Sn,{title:"Max Amount",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:"Enter the maximum amount of STX that can be locked while using this signature"})}),d.jsxs(fe,{position:"relative",my:"loose",children:[d.jsx(sr,{id:"maxAmount",placeholder:"Maximum amount of STX to lock",...e}),t.touched&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})}),d.jsx(St,{type:"button",mode:"tertiary",size:"sm",height:"28px",right:"12px",top:"10px",style:{position:"absolute"},width:"110px",onClick:r,isDisabled:e.value===Sg.toString(),children:"Max Amount"})]})]})}function gce(){const[e,t]=$t("topic"),[n,r,i]=$t("period");return lt.useEffect(()=>{(e.value==="agg-commit"||e.value==="agg-increase")&&i.setValue(1)},[e.value,i]),d.jsxs(Sn,{title:"Topic",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:"Select the topic (stacking method) for this signature"})}),d.jsx(fe,{border:"1px solid var(--colors-border)",borderRadius:"5px",padding:"14px 16px",my:"loose",children:d.jsxs("select",{...e,id:"topic",name:"topic",value:e.value,style:{background:"none",width:"100%",color:ce("text-caption"),fontSize:"14px"},children:[d.jsx("option",{value:"stack-stx",children:"stack-stx"}),d.jsx("option",{value:"agg-commit",children:"stack-aggregation-commit"}),d.jsx("option",{value:"stack-extend",children:"stack-extend"}),d.jsx("option",{value:"stack-increase",children:"stack-increase"}),d.jsx("option",{value:"agg-increase",children:"stack-aggregation-increase"})]})})]})}function yce({signatureData:e}){var y;const{values:t,isValid:n}=ar(),{poxAddress:r,topic:i,period:o,rewardCycleId:a,authId:u,maxAmount:l}=t,f=rn(),p=$.useMemo(()=>{if(!e)return"";const w={signerKey:e.publicKey,signerSignature:e.signature,authId:u,rewardCycle:a.toString(),maxAmount:Vr(l),period:o.toString(),poxAddress:r,method:i};return JSON.stringify(w,null,2)},[e,l,u,o,r,i,a]),{onCopy:m}=rP(p);return d.jsx(Tb,{pt:"80px",mb:"extra-loose",children:d.jsxs(xe,{flexDirection:["column-reverse","column-reverse","row"],justifyContent:"space-between",children:[d.jsxs(fe,{maxWidth:[null,null,"544px"],mr:[null,null,"extra-loose"],children:[d.jsx(Jo,{children:"Generate a signer key signature"}),d.jsx(ie,{textStyle:"body.large",display:"block",color:ce("text-caption"),mt:4,children:"When making certain Stacking transactions, it's required that you provide a signature and other information to ensure that the signer you're using is authorizing the transaction."}),d.jsxs(Kl,{children:[d.jsx(pce,{}),d.jsx(Cf,{description:"Enter the bitcoin address you use for stacking or the bitcoin address of a stacker using your signing service."}),d.jsx(gce,{}),d.jsx(mce,{}),d.jsx(hce,{}),d.jsx(Uk,{fieldName:"period"}),d.jsx(fp,{isLoading:!1,title:"Submit",actionLabel:"Generate Signature",isDisabled:!n})]})]}),d.jsx(fe,{children:d.jsx(vs,{children:d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],maxWidth:[null,null,"400px"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"Signature details"}),d.jsx(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em"})]}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{children:"Reward Cycle"}),d.jsx(Ge,{children:a})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Current cycle"}),d.jsx(Ge,{children:(y=f.data)==null?void 0:y.current_cycle.id})]})]}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Topic"}),d.jsx(Ge,{children:d.jsx(ie,{fontFamily:"monospace",children:i})})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Cycles"}),d.jsx(Ge,{children:o})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Bitcoin address"}),d.jsx(Ge,{children:r?Mi(r):"—"})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"The maximum amount of STX that can be locked while using this signature",children:"Max Amount"}),d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:l===Sg?"MAX":l})})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Auth ID"}),d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:u})})]})}),d.jsx(d.Fragment,{children:e===null?null:d.jsxs(d.Fragment,{children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Signer Details to share with Stackers"}),d.jsx(fe,{display:"inline-block",cursor:"pointer",ml:"5px",onClick:m,children:d.jsx(JP,{size:16})})]})}),d.jsx(Nb,{signatureData:{...e,maxAmount:l,authId:u}})]})})]})]})})})})]})})}function wce({network:e,currentCycle:t}){return li().shape({topic:cn().oneOf(["stack-extend","agg-commit","stack-stx","stack-increase","agg-increase"],"Invalid topic"),poxAddress:Ql({network:e}),period:Wr().defined().test({name:"is-1-if-agg-commit",message:"Period must be 1 for pooled Stacking functions",test:(n,r)=>{const{topic:i}=r.parent;return i==="agg-commit"||i==="agg-increase"?n===1:!0}}),rewardCycleId:Wr().required("Reward cycle is required").test("is-in-future","Reward cycle must be in the future for pool functions",function(n){const r=this.parent.topic;return r==="agg-commit"||r==="agg-increase"?n>t:!0}).test("is-now-for-solo-stacking","Reward cycle must be the current cycle for solo stacking signatures",function(n){const r=this.parent.topic;return r==="stack-stx"||r==="stack-extend"||r==="stack-increase"?n===t:!0}),authId:Wr().required("Auth ID is required").positive("Auth ID must be a positive integer").test("is-int","Auth ID must be an integer",n=>typeof n>"u"?!1:Number.isInteger(n)),maxAmount:cn().required("Max amount is required").test("is-u128","Amount too high",n=>{try{return typeof n>"u"?!1:Iae.gte(Pi(n))}catch{return!1}})})}const bce={topic:Zi.StackStx,period:1,rewardCycleId:1,poxAddress:"bc1qultv5ks9qcyxxwcnkfmpdh4y9u0tpw6s4mng7v",maxAmount:Sg.toString(),authId:""};$.createContext({signature:null});function Sce(){const{topic:e}=VI(),t=$.useMemo(()=>e===Zi.AggregateCommit?Zi.AggregateCommit:e===Zi.StackExtend?Zi.StackExtend:e===Zi.StackStx?Zi.StackStx:e===Zi.AggregateIncrease?Zi.AggregateIncrease:(e&&console.warn(`Received invalid topic parameter: ${e}`),Zi.StackStx),[e]),n=$.useMemo(()=>Math.floor(Math.random()*1e6),[]),r=rn(),{btcAddressP2wpkh:i}=Mn(),{openSignatureRequest:o,signatureData:a}=fce(),{networkName:u}=Pt();if(r.isLoading)return d.jsx(br,{});if(r.isError||!r.data){const f="Failed to load necessary data.",p="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(p,f),d.jsx(Mt,{id:p,children:f})}const l=wce({network:u,currentCycle:r.data.current_cycle.id});return d.jsx(Bi,{initialValues:{...bce,poxAddress:i??"",rewardCycleId:r.data.reward_cycle_id,topic:t,authId:n},onSubmit:async f=>{console.log("values",f),console.log(Pi(f.maxAmount).toFixed(6)),await o({poxAddress:f.poxAddress,period:f.period,rewardCycle:f.rewardCycleId,topic:f.topic,maxAmount:Vr(f.maxAmount),authId:f.authId})},validationSchema:l,children:d.jsx(ui,{children:d.jsx(yce,{signatureData:a})})})}function vce(){const e=Yn();return d.jsx(Tb,{pt:"80px",mb:"extra-loose",children:d.jsx(xe,{flexDirection:["column-reverse","column-reverse","row"],justifyContent:"space-between",children:d.jsxs(fe,{maxWidth:[null,null,"544px"],mr:[null,null,"extra-loose"],children:[d.jsx(Jo,{children:"Signer Details"}),"As a signer, you contribute to the consensus of the Stacks blockchain.",d.jsx(fe,{mt:["extra-loose",null,null,null,"base"],children:"Stackers can add their Stacked STX to your signing service. For that, you need to provide a signature for each stacker."}),d.jsx(St,{mt:"loose",onClick:()=>e("./generate-signature"),children:"Generate Signatures"})]})})})}function xce(){return d.jsx(vce,{})}function Z1(e){return Object.keys(e).length>0}function _ce(e){const{title:t,details:n,pendingStackExtend:r,isContractCallExtensionPageOpen:i}=e,{poxDisabled:o}=hb(),a=Yn(),{network:u}=Pt(),l=Dl(u,n.pox_address),{errors:f}=ar(),[p,m,y]=$t("extendCycles"),w=()=>{a(Nr.DIRECT_STACKING_INFO)},b=n.first_reward_cycle+n.lock_period-1+p.value,x=$.useMemo(()=>{if(Z1(f))return Object.entries(f).map(([k,O])=>`${k}: ${O}`).join(` -`)},[f]);return $.useEffect(()=>{x&&console.error(x)},[x]),d.jsx(lp,{title:t,isShowing:!o,onClose:w,children:d.jsx(xe,{alignItems:"center",flexDirection:"column",pb:["loose","48px"],px:"loose",children:d.jsx(Ln,{width:"420px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You're stacking"}),d.jsxs(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",children:["for ",n.lock_period," cycles"]})]}),d.jsx(Pn,{}),r&&d.jsx(j5,{pendingStackExtend:r}),d.jsx(Cn,{children:d.jsx(ie,{children:"Increase the amount of cycles you want to lock your STX. Currently each cycle lasts around 15 days and the maximum locked period is 12 cycles."})}),d.jsx(xe,{justifyContent:"center",children:d.jsx(qk,{mt:"loose",amount:p.value,onIncrement:k=>{k>Ww||(y.setTouched(!0),y.setValue(k))},onDecrement:k=>{kt<=12}),poxAddress:Ql({network:e})})}function Rce({client:e,navigate:t,setIsContractCallExtensionPageOpen:n}){return async({extendCycles:r,poxAddress:i,signerKey:o,signerSignature:a,maxAmount:u,authId:l})=>{if(!e)return;const f=await e.getStackingContract(),p=Vr(u),m=e.getStackExtendOptions({contract:f,extendCycles:r,poxAddress:i,signerKey:o,signerSignature:a,maxAmount:p,authId:parseInt(l)});n(!0),Do({...m,onCancel(){n(!1)},onFinish(){n(!1),t(Nr.DIRECT_STACKING_INFO)}})}}function Tce(){const e=Yn(),t=Bg(),{getHasPendingStackExtendQuery:n}=xb(),{client:r}=kn(),{network:i,networkName:o}=Pt(),[a,u]=$.useState(!1);if(t.isLoading||n.isLoading)return d.jsx(br,{});if(t.isError||!t.data||n.isError||n.data===void 0||!r){const m="Error while loading data, try reloading the page.";return console.error(m),d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:m})})}if(!t.data.stacked)return d.jsx(Mt,{children:d.jsx(ie,{children:"Not stacking"})});const l=t.data.details,f=Rce({client:r,navigate:e,setIsContractCallExtensionPageOpen:u}),p=kce({network:o});return d.jsx(Bi,{initialValues:{poxAddress:Dl(i,l.pox_address),extendCycles:12-l.lock_period,signerKey:"",signerSignature:"",maxAmount:"",authId:""},onSubmit:f,validationSchema:p,children:d.jsx(ui,{children:d.jsx(_ce,{title:"Continue stacking",details:l,pendingStackExtend:n.data,isContractCallExtensionPageOpen:a})})})}function Oce(){return $.useMemo(()=>({feeRate:bW}),[])}function e6(){const{feeRate:e}=Oce();return $.useCallback(t=>BigInt(new Qt(e).multipliedBy(t).toString()),[e])}function Nce({pendingStackIncrease:e}){return d.jsx(fe,{pb:"base-loose",children:d.jsx(Fi,{icon:d.jsx(cg,{}),title:"Waiting for transaction confirmation",children:d.jsxs(_f,{children:["A stacking request was successfully submitted to the blockchain. Once confirmed, an additional amount of ",Jt(e.increaseBy)," will be stacking."]})})})}function t6(e){return{name:"test-balance",message:"Amount must be lower than balance",test:t=>t===void 0?!1:Un(t).isLessThanOrEqualTo(new Qt(e.toString()))}}function Cce({availableBalanceUStx:e,transactionFeeUStx:t,network:n,rewardCycleId:r,stackerInfo:i}){if(!i.stacked)throw new Error("User is not stacked - cannot increase");const o=i.details.lock_period;return li().shape({increaseBy:mp().test(t6(BigInt(e.toString()))).test("test-precision","You cannot stack with a precision of less than 1 STX",a=>a===void 0?!0:Ob(0)(a)).test({name:"test-fee-margin",message:"You must stack less than your entire balance to allow for the transaction fee",test:a=>a==null?!1:!Un(a).isGreaterThan(new Qt(e.toString()).minus(t.toString()))}),signerSignature:yf().test("matches-topic","Signature was not generated for stack-stx",function(a){const u=this.parent.signatureJSON;return typeof u!="string"?!0:qn.json().cast(u).method==="stack-increase"}).test("matches-lock-period",`"Period" argument when generating signature must match current lock period (${o})`,function(a){const u=this.parent.signatureJSON;if(typeof u!="string")return!0;const l=qn.json().cast(u);return parseInt(l.period,10)!==i.details.lock_period?this.createError({message:`"Period" argument when generating signature was ${l.period}, but it must match current lock period (${o})`,path:"signerSignature"}):!0}).test("valid-signature","Unable to validate signature",function(a,u){const l=u.parent.signatureJSON;if(typeof l!="string"||typeof a!="string")return!0;const f=qn.json().cast(l),p=Dl(n.network,i.details.pox_address),m={topic:"stack-increase",rewardCycle:parseInt(f.rewardCycle,10),poxAddress:p,authId:u.parent.authId,network:n.network,publicKey:u.parent.signerKey,signature:a,period:i.details.lock_period,maxAmount:Vr(u.parent.maxAmount)};return Vl(m)}).test("matches-reward-cycle","Signature is not valid for current reward cycle",function(a,u){const l=u.parent.signatureJSON;if(typeof l!="string"||typeof a!="string")return!0;const f=qn.json().cast(l);return parseInt(f.rewardCycle,10)===r})})}function Ece({client:e,navigate:t,setIsContractCallExtensionPageOpen:n}){return async({increaseBy:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u})=>{if(!e)return;const l=Vr(a),f=await e.getStackingContract(),p=e.getStackIncreaseOptions({contract:f,increaseBy:Un(r).toString(),signerKey:i,signerSignature:o,maxAmount:l,authId:parseInt(u)});n(!0),Do({...p,onCancel(){n(!1)},onFinish(){n(!1),t(Nr.DIRECT_STACKING_INFO)}})}}function n6(e,t){return new Qt(e.balance.toString()).minus(new Qt(e.locked.toString())).minus(new Qt(t?t.increaseBy.toString():0))}function Ace(){var u;const e=ci(),{getHasPendingStackIncreaseQuery:t}=xb(),[n,r,i]=$t("increaseBy"),o=(u=e.data)!=null&&u.stx?n6(e.data.stx,t.data):void 0,a=()=>{o&&i.setValue(Jh(o).toFixed(0,Qt.ROUND_DOWN))};return d.jsxs(It,{children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsx(ie,{children:"Choose how much you want to add to the current value you are already stacking."})})}),d.jsxs(fe,{position:"relative",my:"loose",children:[d.jsx(sr,{id:"stxAmount",placeholder:"Amount of additional STX to stack",...n}),r.touched&&r.error&&d.jsx(wn,{children:d.jsx(bn,{children:r.error})}),d.jsx(St,{type:"button",mode:"tertiary",size:"sm",height:"28px",right:"12px",top:"10px",style:{position:"absolute"},width:"80px",onClick:a,isDisabled:!o,children:"Stack max"})]})]})}function Fce(e){const{poxDisabled:t}=hb(),{title:n,extendedStxBalances:r,pendingStackIncrease:i,isContractCallExtensionPageOpen:o}=e,a=$l(),{errors:u}=ar(),l=()=>{a(Nr.DIRECT_STACKING_INFO)};return d.jsx(lp,{title:n,isShowing:!t,onClose:l,children:d.jsx(xe,{alignItems:"center",flexDirection:"column",pb:["loose","48px"],px:"loose",children:d.jsx(Ln,{width:"420px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You're stacking"}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",children:Jt(r.locked.toString())})]}),d.jsx(Pn,{}),i&&d.jsx(Nce,{pendingStackIncrease:i}),d.jsx(wr,{pt:"base-loose",children:d.jsxs(bt,{children:[d.jsx(Me,{children:d.jsx(Ace,{})}),d.jsx(zg,{}),d.jsxs(Me,{m:"loose",justifyContent:"space-between",children:[d.jsx(St,{mode:"tertiary",onClick:l,children:"Cancel"}),d.jsxs(St,{isLoading:o,isDisabled:Z1(u),children:[d.jsx(fe,{mr:"loose",children:d.jsx(ps,{})}),"Confirm Increase"]})]})]})})]})})})})}function Ice(){const t=e6()(D_),n=$l(),r=Bg(),i=Pt(),o=ci(),{getHasPendingStackIncreaseQuery:a}=xb(),u=rn(),{client:l}=kn(),[f,p]=$.useState(!1);if(r.isLoading||o.isLoading||a.isLoading||u.isLoading)return d.jsx(br,{});if(r.isError||!r.data||u.isError||!u.data||o.isError||!o.data||a.isError||a.data===void 0||!l){const x="Error while loading data, try reloading the page.";return console.error(x),d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:x})})}if(!r.data.stacked)return d.jsx(Mt,{children:d.jsx(ie,{children:"Not stacking"})});const m=o.data.stx,y=n6(m,a.data),w=Ece({client:l,navigate:n,setIsContractCallExtensionPageOpen:p}),b=Cce({availableBalanceUStx:y,transactionFeeUStx:t,stackerInfo:r.data,network:i,rewardCycleId:u.data.reward_cycle_id});return d.jsx(Bi,{initialValues:{increaseBy:hW(y),signerKey:"",signerSignature:"",maxAmount:"",authId:""},onSubmit:w,validationSchema:b,children:d.jsx(ui,{children:d.jsx(Fce,{title:"Lock more STX",extendedStxBalances:o.data.stx,pendingStackIncrease:a.data,isContractCallExtensionPageOpen:f})})})}function Kk(e){const{intro:t,stackingInfoPanel:n,stackingForm:r}=e;return d.jsx(Tb,{pt:"80px",mb:"extra-loose",children:d.jsxs(xe,{flexDirection:["column-reverse","column-reverse","row"],justifyContent:"space-between",children:[d.jsxs(fe,{maxWidth:[null,null,"544px"],mr:[null,null,"extra-loose"],children:[t,d.jsx(fe,{display:["block",null,"none"],mt:["extra-loose",null,null,null,"base"],children:n}),r]}),d.jsx(fe,{display:["none",null,"block"],children:n})]})})}function Cb(e,t="4px"){return{position:"relative",_before:{content:'""',top:0,left:0,borderRadius:"8px",width:t,height:"100%",position:"absolute",background:ce(e)}}}const Pce=Qt.clone({ROUNDING_MODE:Qt.ROUND_FLOOR});function r6(e,t){return new Pce(e).dividedBy(t).integerValue()}function i6(e,t){return t.isEqualTo(0)||e.isLessThan(t)?null:e.modulo(t).decimalPlaces(0,Qt.ROUND_FLOOR)}const Mce=Qt.clone({ROUNDING_MODE:Qt.ROUND_FLOOR});function Lce(){const e=ci(),t=rn(),[n,r,i]=$t("amount");if(e.isLoading||t.isLoading)return d.jsx(fs,{});if(e.isError||typeof e.data.stx.balance!="string"||t.isError||!t.data){const w="134098d7-444b-4591-abfe-8767af6def3f",b="Failed to load necessary data.";return console.error(w,b),d.jsx(bs,{id:w,children:b})}const o=e.data.stx.balance,a=t.data.min_amount_ustx,u=Un(n.value||0),l=u.isGreaterThanOrEqualTo(a);let f=new Mce(new Qt(o).minus(D_).toString()).decimalPlaces(0);f.isNegative()&&(f=new Qt(0));const p=()=>{i.setValue(Jh(f.toString()).toFixed(0,Qt.ROUND_DOWN))},m=r6(u,new Qt(a)).integerValue(),y=i6(u,new Qt(a));return d.jsxs(Sn,{title:"Choose amount",children:[d.jsx(Cn,{children:d.jsxs(It,{alignItems:"flex-start",spacing:"base",children:[d.jsx(ie,{color:ce("text-caption"),children:"You'll be eligible for one reward slot for every multiple of the minimum you stack."}),d.jsx(ie,{color:ce("text-caption"),children:"The estimated minimum per slot can change by multiples of 10,000 every cycle, so you may want to add a buffer to increase your chance of keeping the same number of slots."}),d.jsx($r,{href:mW,children:"Learn more about risks of stacking at or near the minimum"}),d.jsx($r,{href:gW,children:"View the minimum for next cycle"})]})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"stxAmount",placeholder:"Amount of STX to Stack",mt:"loose",...n}),r.touched&&r.error&&d.jsx(wn,{children:d.jsx(bn,{children:r.error})}),d.jsx(St,{type:"button",mode:"tertiary",size:"sm",height:"28px",right:"12px",top:"10px",style:{position:"absolute"},width:"80px",onClick:p,children:"Stack max"})]}),l&&d.jsxs(d.Fragment,{children:[d.jsx(It,{textStyle:"body.small",color:ce("text-caption"),spacing:"base",mt:"base",children:d.jsxs(ie,{children:["This entered amount would get you ",m.toString()," reward slot",m.toNumber()===1?"":"s"," with a"," ",Jt(y||0)," buffer at the current minimum. However, that minimum is subject to change and there is no guarantee you will get any reward slots."]})}),y!==null&&y.isEqualTo(0)&&d.jsxs(fe,{textStyle:"body.small",color:ce("text-body"),border:"1px solid",p:"loose",mt:"base",borderRadius:"6px",borderColor:ce("border"),...Cb("feedback-alert"),children:["Add a buffer for a higher chance (though no guarantee) of keeping the same number of reward slots should the minimum increase. If you can’t add a buffer, consider Stacking in a pool instead.",d.jsx(St,{variant:"link",type:"button",display:"block",mt:"tight",onClick:()=>i.setValue(new Qt(n.value).plus(1e4).toString()),children:"Add 10,000 STX buffer"})]})]})]})}function Qk(e){const{onChange:t,...n}=e;return d.jsxs(fe,{as:"label",display:"block",py:"base",textStyle:"body.small",color:ce("text-caption"),userSelect:"none",...n,children:[d.jsx(fe,{mr:"base-tight",display:"inline-block",children:d.jsx("input",{type:"checkbox",onChange:r=>t(r.target.checked)})}),"I have read and understand the above"]})}function Pl(e){const{title:t,icon:n,children:r,...i}=e;return d.jsxs(xe,{alignItems:"baseline",...i,children:[d.jsx(xe,{width:"16px",mr:"base-tight",children:n}),d.jsxs(It,{spacing:"extra-tight",children:[d.jsx(ie,{as:"h3",textStyle:"body.large.medium",children:t}),d.jsx(It,{spacing:"base",textStyle:"body.large",color:ce("text-caption"),children:r})]})]})}const Bce=e=>d.jsxs(It,{textStyle:["body.small","body.large"],spacing:"base-loose",pl:"base",...Cb("feedback-alert"),...e,children:[d.jsxs(Pl,{title:"This transaction can’t be reversed",icon:d.jsx(ps,{width:"16px",height:"16px"}),children:[d.jsx(ie,{color:ce("text-body"),children:"STX will be locked in your wallet for your chosen duration, even if an increase in the minimum causes you to end up with fewer or no reward slots."}),d.jsx(ie,{color:ce("text-body"),children:"There will be no way to unlock your STX before the chosen duration is finished."}),d.jsx(ie,{color:ce("text-body"),children:"Nor will you be able to change the entered BTC address. Ensure it's entered correctly and you have control over it."})]}),d.jsx(Pl,{title:"Dynamic minimum",icon:d.jsx(kb,{width:"16px",height:"16px"}),children:d.jsx(ie,{color:ce("text-body"),children:"If the minimum increases, you could end up with fewer or no reward slots, even if you’ve added a buffer. There will be no way to lock more STX for Stacking with this address until the selected duration is finished."})})]});function jce({isLoading:e}){const[t,n]=$.useState(!1);return d.jsxs(Sn,{title:"Confirm and stack",children:[d.jsx(Bce,{mt:"loose"}),d.jsx(Qk,{onChange:r=>n(r),mt:"extra-loose"}),d.jsx(Yh,{type:"submit",isLoading:e,isDisabled:!t,children:"Confirm and start stacking"})]})}function Dce(e){if(!e)return 0;try{if(typeof e!="number"){const t=parseFloat(e);return Number.isFinite(t)?t:0}return e}catch{return 0}}function Jce(){var y,w,b;const e=ar(),t=rn(),{amount:n,lockPeriod:r,poxAddress:i,signerKey:o,signerSignature:a,maxAmount:u,authId:l}=e.values,f=$.useMemo(()=>Un(Dce(n)).integerValue(),[n]),p=r6(f,new Qt(((y=t.data)==null?void 0:y.min_amount_ustx)||0)).integerValue(),m=i6(f,new Qt(((w=t.data)==null?void 0:w.min_amount_ustx)||0));return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",color:ce("text-body"),children:"You'll lock"}),d.jsx(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",color:ce("text-caption"),children:Hg(n??0)})]}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"This is the estimated number of reward slots. The minimum can change before the next cycle begins.",children:"Reward slots"}),d.jsx(Ge,{children:p.toString()})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Buffer"}),d.jsx(Ge,{children:m===null?"No buffer":Jt(m)})]})]}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:`One cycle lasts ${(b=t.data)==null?void 0:b.reward_cycle_length} blocks on the Bitcoin blockchain`,children:"Cycles"}),d.jsx(Ge,{children:r})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Bitcoin address"}),d.jsx(Ge,{children:i?Mi(i):"—"})]})}),d.jsx(Nb,{signatureData:a&&o?{signature:a,publicKey:o,maxAmount:u,authId:l}:void 0})]})]})})}function $ce(e){const{timeUntilNextCycle:t,estimatedStackingMinimum:n}=e;return d.jsxs(d.Fragment,{children:[d.jsx(Jo,{children:"Stack independently"}),d.jsx(W5,{mt:"base-loose",children:"When you stack by yourself you'll earn Bitcoin each cycle for every reward slot that you hold. The STX required per reward slot can fluctuate from cycle to cycle. If you're close to the current minimum, consider pooling instead to make sure you won't end up without rewards."}),d.jsxs(xe,{alignItems:"baseline",children:[d.jsx(Rb,{timeUntilNextCycle:t,mt:"40px"}),d.jsx($5,{ml:"extra-loose",estimatedStackingMinimum:n})]})]})}function qce(){const[e,t,n]=$t("lockPeriod"),[r]=$t("signatureJSON");return d.jsx(d.Fragment,{children:d.jsxs(Sn,{title:"Duration",children:[d.jsxs(Cn,{children:[d.jsx(ie,{color:ce("text-caption"),children:"Every cycle, each of your reward slots will be eligible for rewards. After your chosen duration, you'll need to wait one cycle before you can stack from this address again."}),d.jsx(ie,{href:"",children:"Learn more about cycles."})]}),d.jsx(qk,{mt:"loose",amount:e.value,onIncrement:i=>{i>Ww||n.setValue(i)},onDecrement:i=>{io===void 0?!0:Ob(0)(o)).test({name:"test-fee-margin",message:"You must stack less than your entire balance to allow for the transaction fee",test:o=>o==null?!1:!Un(o).isGreaterThan(new Qt(e.toString()).minus(t.toString()))}).test({name:"test-min-utx",message:`You must stack with at least ${Jt(n)}`,test:o=>{if(o==null)return!1;const a=Un(o);return new Qt(n.toString()).isLessThanOrEqualTo(a)}}),lockPeriod:Wr().defined().test("matches-period-pox-address","Duration does not match signature data",function(o){const a=this.parent.signatureJSON;if(typeof a!="string")return!0;const u=qn.json().cast(a);return parseInt(u.period,10)===o}),poxAddress:Ql({network:r.networkName}).test("matches-signature-pox-address","BTC Address does not match signature data",function(o){const a=this.parent.signatureJSON;return typeof a!="string"?!0:qn.json().cast(a).poxAddress===o}),signatureJSON:cn(),signerKey:yf().required(),signerSignature:yf().test("matches-topic","Signature was not generated for stack-stx",function(o){const a=this.parent.signatureJSON;return typeof a!="string"?!0:qn.json().cast(a).method==="stack-stx"}).test("valid-signature","Unable to validate signature",function(o,a){const u=a.parent.signatureJSON;if(typeof u!="string"||typeof o!="string")return!0;const l=qn.json().cast(u),f={topic:"stack-stx",rewardCycle:parseInt(l.rewardCycle,10),poxAddress:a.parent.poxAddress,authId:a.parent.authId,network:r.network,publicKey:a.parent.signerKey,signature:o,period:a.parent.lockPeriod,maxAmount:Vr(a.parent.maxAmount)};return Vl(f)}).test("matches-reward-cycle","Signature is not valid for current reward cycle",function(o,a){const u=a.parent.signatureJSON;if(typeof u!="string"||typeof o!="string")return!0;const l=qn.json().cast(u);return parseInt(l.rewardCycle,10)===i}),maxAmount:cn().defined().test("matches-signature-max-amount","Max amount does not match signature data",function(o){const a=this.parent.signatureJSON;if(typeof a!="string")return!0;const u=qn.json().cast(a);return Pi(u.maxAmount).isEqualTo(Pi(Vr(o)))}),authId:Wr().defined().test("matches-signature","Auth ID does not match signature data",function(o){const a=this.parent.signatureJSON;if(typeof a!="string")return!0;const u=qn.json().cast(a);return BigInt(u.authId)===BigInt(o)})})}function Hce({client:e,setIsContractCallExtensionPageOpen:t,navigate:n}){return async function(i){if(i.amount===null)throw new Error("Expected a non-null amount to be submitted.");const[o,a]=await Promise.all([e.getStackingContract(),e.getPoxInfo()]),u=a.current_burnchain_block_height;if(typeof u!="number")throw new Error("Unable to get current block height.");const l=parseInt(i.authId,10),f=Vr(i.maxAmount);typeof i.signerSignature=="string"&&(Vl({topic:"stack-stx",poxAddress:i.poxAddress,rewardCycle:a.current_cycle.id,authId:l,maxAmount:f,period:i.lockPeriod,network:e.network,publicKey:i.signerKey,signature:i.signerSignature})?console.log("✅ Signature verified"):console.warn("⚠️ Unable to verify signature."));const p=e.getStackOptions({contract:o,amountMicroStx:Vr(i.amount),cycles:i.lockPeriod,poxAddress:i.poxAddress,burnBlockHeight:u,signerKey:i.signerKey,signerSignature:i.signerSignature,maxAmount:f,authId:l});Do({...p,onFinish(){t(!1),n("../direct-stacking-info")},onCancel(){t(!1)}}),t(!0)}}const zce={amount:"",lockPeriod:12,poxAddress:"",signerKey:"",signerSignature:"",maxAmount:"",authId:""};function Wce(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(Vce,{client:e})}function Vce({client:e}){const[t,n]=$.useState(!1),r=Pt(),i=Vu(),o=rn(),a=ci(),{btcAddressP2wpkh:u}=Mn(),l=Yn(),p=e6()(D_);if(i.isLoading||o.isLoading||a.isLoading)return d.jsx(br,{});if(i.isError||typeof i.data!="number"||o.isError||!o.data||a.isError||typeof a.data.stx.balance!="string"){const w="Failed to load necessary data.",b="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(b,w),d.jsx(Mt,{id:b,children:w})}const m=Uce({minimumAmountUStx:BigInt(o.data.min_amount_ustx),transactionFeeUStx:p,availableBalanceUStx:Yt(a.data.stx.balance),network:r,rewardCycleId:o.data.current_cycle.id}),y=Hce({client:e,navigate:l,setIsContractCallExtensionPageOpen:n});return d.jsx(Bi,{initialValues:{...zce,poxAddress:u||""},onSubmit:w=>{y(w)},validationSchema:m,children:d.jsx(Kk,{intro:d.jsx($ce,{estimatedStackingMinimum:BigInt(o.data.min_amount_ustx),timeUntilNextCycle:i.data}),stackingInfoPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(Jce,{})})}),stackingForm:d.jsx(ui,{children:d.jsxs(Kl,{children:[d.jsx(Lce,{}),d.jsx(qce,{}),d.jsx(Cf,{}),d.jsx(zg,{}),d.jsx(jce,{isLoading:t})]})})})})}function Gce(){var u,l;const[e,t,n]=$t("amount"),r=ci(),i=(u=r.data)!=null&&u.stx.balance?Yt(r.data.stx.balance):void 0,o=(l=r.data)!=null&&l.stx.locked?Yt(r.data.stx.locked):void 0,a=i&&o?i-o:void 0;return d.jsxs(Sn,{title:"Amount",children:[d.jsxs(Cn,{children:[d.jsx(ie,{children:"Choose how much you'll stack. Your liquid stacking protocol may require a minimum."}),d.jsx(ie,{children:"The STX tokens will leave your wallet and you will get stSTX or LiSTX which represents your principal plus yield."})]}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"stxAmount",mt:"loose",placeholder:"Amount of STX to Stack",...e}),t.touched&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})})]}),d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight","aria-busy":r.isLoading,children:["Available balance:"," ",r.isLoading?d.jsx(fs,{}):a?d.jsx(St,{variant:"link",type:"button",onClick:()=>n.setValue(Jh(a)),children:Jt(a)}):d.jsx(bs,{children:"Failed to load"})]})]})}var e_=(e=>(e.StackingDao="StackingDAO",e.Lisa="Lisa",e))(e_||{}),Oo=(e=>(e[e.WrapperStackingDAO=0]="WrapperStackingDAO",e[e.Lisa=1]="Lisa",e))(Oo||{});const Wd={[mt.devnet]:{0:"",1:""},[mt.testnet]:{0:"ST2PABAF9FTAJYNFZH93XENAJ8FVY99RRM4DF2YCW.stacking-dao-core-v1",1:""},[mt.mainnet]:{0:"SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-v1",1:"SM3KNVZS30WM7F89SXKVVFY4SN9RMPZZ9FX929N0V.auto-whitelist-mint-helper"}};var t_=(e=>(e.ST_STX="stSTX",e.LI_STX="LiSTX",e.OTHER="OTHER",e))(t_||{});const EI=({src:e})=>d.jsx("img",{src:e,width:"32px",alt:"name"}),vg={StackingDAO:{name:e_.StackingDao,description:"Enjoy automatic protocol operations and auto-compounded yield. Locked STX will stay stacked indefinitely.",duration:1,website:"https://www.stackingdao.com",liquidContract:Oo.WrapperStackingDAO,liquidToken:t_.ST_STX,protocolAddress:{[mt.mainnet]:Wd[mt.mainnet][Oo.WrapperStackingDAO],[mt.testnet]:Wd[mt.testnet][Oo.WrapperStackingDAO],[mt.devnet]:Wd[mt.devnet][Oo.WrapperStackingDAO]},minimumDelegationAmount:1e6,icon:d.jsx(EI,{src:"/32x32_StackingDao.png"})},Lisa:{name:e_.Lisa,description:"See your balance increase automatically and always exchange at 1 STX to 1 LiSTX",duration:1,website:"https://www.lisalab.io/",liquidContract:Oo.Lisa,liquidToken:t_.LI_STX,protocolAddress:{[mt.mainnet]:Wd[mt.mainnet][Oo.Lisa],[mt.testnet]:Wd[mt.testnet][Oo.Lisa],[mt.devnet]:Wd[mt.devnet][Oo.Lisa]},minimumDelegationAmount:1e6,icon:d.jsx(EI,{src:"/32x32_Lisa.png"})}};function Kce(e){const{name:t,description:n,url:r,icon:i,activeProtocolName:o,onChange:a,...u}=e,[l,f]=k_();return d.jsx(fe,{borderRadius:l?"12px":void 0,borderWidth:"2px",borderColor:l?sf.borderFocused:"#00000000",_hover:{cursor:"pointer"},borderStyle:"solid",children:d.jsx(xe,{minHeight:"72px",p:"base-loose",as:"label",border:`1px solid ${ce("border")}`,borderRadius:"12px",_hover:{cursor:"pointer"},position:"relative",...u,children:d.jsxs(xe,{width:"100%",children:[d.jsx(fe,{position:"relative",top:"-3px",children:i}),d.jsx(xe,{ml:"base-loose",width:"100%",flexDirection:["column","row"],children:d.jsxs(fe,{children:[d.jsx(ie,{textStyle:"body.small",fontWeight:500,display:"block",style:{wordBreak:"break-all"},children:t}),d.jsx(ie,{textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:n}),r&&d.jsx($r,{href:r,textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:"Learn more"})]})}),d.jsx(xe,{ml:"loose",alignItems:"center",children:d.jsx("input",{type:"radio",id:t,name:"protocolName",value:t,checked:t===o,style:{transform:"scale(1.2)",outline:0},onChange:p=>a(p.target.value),...f})})]})})})}function Qce({onProtocolChange:e}){const[t,,n]=$t("protocolName"),r=i=>{n.setValue(i),e(i)};return d.jsxs(Sn,{title:"Liquid Stacking",children:[d.jsx(Cn,{children:d.jsxs(ie,{children:["Select a protocol to start liquid stacking or"," ",d.jsx($r,{display:"inline",href:"https://www.stacks.co/learn/stacking",children:"discover others on stacks.co."})]})}),d.jsx(It,{spacing:"base",mt:"extra-loose",children:Object.keys(vg).map((i,o)=>{const a=vg[i];return d.jsx(Kce,{name:a.name,icon:a.icon,description:a.description,url:a.website,activeProtocolName:t.value,onChange:r},o)})})]})}function o6(e){return d.jsx("svg",{width:14,height:15,viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:d.jsx("path",{d:"M14 9.66H9.74l2.934 4.569H10.5L7.01 8.863 3.5 14.229H1.326l2.978-4.557H0V7.945h14V9.66Zm0-3.387H0V4.535h4.185L1.25.021h2.174l3.533 5.465L10.5.02h2.174L9.728 4.535H14v1.738Z",fill:"#242629"})})}function Yce({...e}){return d.jsxs(It,{textStyle:["body.small","body.large"],spacing:"base-loose",pl:"base",...Cb("feedback-alert"),...e,children:[d.jsx(Pl,{title:"This transaction can’t be reversed",icon:d.jsx(ps,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"You are transferring STX to the liquid stacking protocol. To receive STX back, you must request them from the protocol."})}),d.jsx(Pl,{title:"Research your protocol",icon:d.jsx(kb,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"Paying out rewards is at the discretion of the protocol. Make sure you’ve researched and trust the protocol you’re using."})}),d.jsx(Pl,{title:"Stacking with Protocol Contract",icon:d.jsx(o6,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"The protocol uses a smart contract that handles your stacking. By allowing the contract to call Stacking functions, you agree to the rules of the Protocol contract."})})]})}function Xce({isLoading:e}){const[t,n]=$.useState(!1);return d.jsxs(Sn,{title:"Confirm and stack",children:[d.jsx(Yce,{mt:"loose"}),d.jsx(Qk,{onChange:r=>n(r)}),d.jsx(Yh,{type:"submit",isLoading:e,isDisabled:!t,children:"Confirm and start liquid stacking"})]})}function Zce({title:e,amountText:t}){return d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:e}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",children:t})]})}function eue(e){const t=ar(),{networkName:n,networkInstance:r}=Pt(),i=t.values.amount,o=t.values.protocolName,a=o?vg[o]:void 0,u=(a!=null&&a.protocolAddress?a.protocolAddress[r]:void 0)||t.values.protocolAddress,l=Hg(i);return d.jsx(d.Fragment,{children:d.jsx(Ln,{...e,children:d.jsxs(fe,{mx:["loose","extra-loose"],sx:{},children:[d.jsx(Zce,{title:"You'll liquid stack",amountText:l}),d.jsx(Pn,{}),d.jsxs(wr,{mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"How long you will liquid stack with the protocol. By default, any liquid stacking protocol will stack your STX indefinitely until you decide to unstack.",children:"Duration"}),d.jsx(Ge,{children:"Indefinite"})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Contract"}),d.jsx(Ge,{children:u&&d.jsx($r,{href:xk(u,n),children:Mi(u)})})]})})]})]})})})}function tue({timeUntilNextCycle:e}){return d.jsxs(d.Fragment,{children:[d.jsx(Jo,{children:"Liquid Stacking"}),d.jsx(Rb,{mt:"extra-loose",timeUntilNextCycle:e})]})}function nue(e){return e.chainId===dn.Mainnet?mt.mainnet:e.client.baseUrl===Dh?mt.devnet:mt.testnet}function rue(e,t){return Wd[e][t].split(".")}function iue(){return li().shape({amount:mp().test({name:"test-min-allowed-stacking",message:"You must stack at least the protocol's minimum.",test(e,t){const n=t.parent.protocolName;if(!n)return!0;const r=vg[n].minimumDelegationAmount;return Un(e||0).isLessThan(r)?t.createError({message:`You must stack at least ${Jt(r)}`}):!0}}).test({name:"test-max-allowed-stacking",message:`You cannot stack more than ${Jt($h)}`,test(e){return e===void 0?!1:Un(e).isLessThanOrEqualTo($h)}})})}function oue(e,t){const n=e.protocolName?vg[e.protocolName]:void 0;if(!n)throw new Error("Invalid Protocol Name");const r=nue(t),[i,o]=rue(r,n.liquidContract),a=Un(e.amount).toString(),u=e.stxAddress,{functionArgs:l,functionName:f}=n.liquidContract===Oo.WrapperStackingDAO?{functionArgs:[xM(i,"reserve-v1"),ft(a),Rr()],functionName:"deposit"}:n.liquidContract===Oo.Lisa?{functionArgs:[ft(a)],functionName:"request-mint"}:{functionArgs:[],functionName:"deposit"};return{contractAddress:i,contractName:o,functionName:f,functionArgs:l,network:t,postConditions:[{type:"stx-postcondition",address:u,condition:"lte",amount:a}]}}function sue({network:e,setIsContractCallExtensionPageOpen:t,navigate:n}){return async function(i){const o=oue(i,e);bk({...o,onFinish(){t(!1),n("../direct-stacking-info")},onCancel(){t(!1)}}),t(!0)}}const aue={amount:"",stxAddress:"",protocolAddress:""};function cue(){const{address:e}=Mn(),{networkName:t}=Pt();if(!e){const n="Expected `address` to be defined.";return console.error(n),d.jsx(Mt,{children:n})}if(!t){const n="Expected `networkName` to be defined.";return console.error(n),d.jsx(Mt,{children:n})}return d.jsx(uue,{currentAccountAddresses:{address:e}})}function uue({currentAccountAddresses:e}){const{network:t}=Pt(),[n,r]=$.useState(!1),i=Vu(),o=Yn(),a=iue(),u=sue({network:t,navigate:o,setIsContractCallExtensionPageOpen:r});if(i.isLoading)return d.jsx(br,{});if(i.isError||typeof i.data!="number"){const l="0106e9bf-ae2f-4fcc-bf00-5fe083001adb",f="Failed to load necessary data.";return console.error(l,f),d.jsx(Mt,{id:l,children:f})}return d.jsx(Bi,{initialValues:{...aue,stxAddress:e.address},onSubmit:u,validationSchema:a,children:d.jsx(Kk,{intro:d.jsx(tue,{timeUntilNextCycle:i.data}),stackingInfoPanel:d.jsx(vs,{children:d.jsx(eue,{})}),stackingForm:d.jsx(d.Fragment,{children:d.jsx(ui,{children:d.jsxs(Kl,{children:[d.jsxs("p",{children:["Liquid Stacking, a new feature developed by ecosystem builders, gives users the ability to lock their STX in exchange for a tokenized representation of stacked Stacks (stSTX or LiSTX). This allows users to leverage their Stacked STX throughout the ecosystem while continuing to earn Stacking rewards. Unlike Stacking, there' no minimum STX requirement for participation. Users can trade back to STX at any time. ",d.jsx("br",{})," ",d.jsx("br",{}),"Visit their websites and read their documents to learn more about"," ",d.jsx($r,{href:"https://stackingdao.com",children:"StackingDAO"})," ","and"," ",d.jsx($r,{href:"https://lisalab.io",children:"LISA"}),".",d.jsx("br",{}),d.jsx("span",{className:"mt-4",children:"Important: Leather allows users to integrate with liquid stacking features, but does not manage or have any control over the liquid stacking process."})]}),d.jsx(Qce,{onProtocolChange:()=>{}}),d.jsx(Gce,{}),d.jsx(Xce,{isLoading:n})]})})})})})}function lue(){var a,u;const[e,t,n]=$t("amount"),r=ci(),i=(a=r.data)!=null&&a.stx.balance?Yt(r.data.stx.balance):void 0,o=(u=r.data)!=null&&u.stx.locked?Yt(r.data.stx.locked):void 0;return d.jsxs(Sn,{title:"Amount",children:[d.jsxs(Cn,{children:[d.jsx(ie,{color:ce("text-caption"),children:"Choose how much you'll pool. Your pool may require a minimum."}),d.jsx(ie,{color:ce("text-caption"),children:"The pooled amount can be higher than your current balance to allow the pool to stack more in the future."}),d.jsx(ie,{color:ce("text-caption"),children:"The pool may stack less than the delegated amount to leave some change to pay for transaction fees."})]}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"stxAmount",mt:"loose",placeholder:"Amount of STX to Stack",...e}),t.touched&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})})]}),d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight","aria-busy":r.isLoading,children:["Available balance:"," ",r.isLoading?d.jsx(fs,{}):i?d.jsxs(St,{variant:"link",type:"button",onClick:()=>n.setValue(Jh(i)),children:[Jt(i)," "]}):d.jsx(bs,{children:"Failed to load"})]}),o?d.jsxs(d.Fragment,{children:[d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight","aria-busy":r.isLoading,children:["Minimum amount:"," ",d.jsxs(St,{variant:"link",type:"button",onClick:()=>n.setValue(Jh(o)),children:[Jt(o)," "]})]}),d.jsx(fe,{background:ce("bg-alt"),my:"tight",py:"tight",px:"base-loose",borderRadius:"10px",children:d.jsx(xe,{children:d.jsx(fe,{textStyle:"body.small",color:ce("text-caption"),children:"The minimum amount is what is already stacked. For continuous stacking, you will have to pool this amount or more."})})})]}):null]})}function AI(e){return d.jsx(fe,{as:"button",type:"button",backgroundColor:ce("bg-4"),_hover:{color:ce("brand")},style:{userSelect:"none"},display:"inline-block",width:"28px",height:"28px",borderRadius:"50%",fontWeight:800,outline:0,...e})}const due=()=>new Array(12).fill(null).map((e,t)=>t+1),Lx=e=>e??1;function fue(){const e=cZ(),[t,,n]=$t("numberOfCycles"),r=t.value??1,i=$.useMemo(()=>typeof e.data!="number"?[]:due().map(o=>`${Jk(o)} ends in about ${z5(U5(new Date,o*e.data))}`),[e.data]);return e.isLoading?d.jsx(fs,{}):(typeof e.data!="number"&&console.error("Expected `data` to be a number."),typeof r!="number"&&console.error("Expected `duration` to be a number."),d.jsx(d.Fragment,{children:d.jsxs(xe,{alignItems:"center",justifyContent:"space-between",mt:"base",padding:"8px",boxShadow:"low",border:`1px solid ${ce("border")}`,borderRadius:"8px",onClick:o=>(o.stopPropagation(),o.preventDefault()),position:"relative",zIndex:10,children:[d.jsx(ie,{alignItems:"center",ml:"tight",color:ce("text-title"),children:i[Lx(r)-1]}),d.jsxs(fe,{children:[d.jsx(AI,{onClick:o=>{o.stopPropagation(),n.setValue(Math.max(Vw,J5(Lx(r))))},children:"-"}),d.jsx(AI,{ml:[null,"extra-tight"],onClick:o=>{o.stopPropagation(),n.setValue(Math.min(Ww,Sw(Lx(r))))},children:"+"})]})]})}))}function FI(e){const{title:t,icon:n,delegationType:r,activeDelegationType:i,onChange:o,children:a,...u}=e,[l,f]=k_();return d.jsx(xe,{minHeight:"72px",p:"base-loose",as:"label",htmlFor:r,border:`1px solid ${ce("border")}`,borderRadius:"12px",position:"relative",...l?{_before:{content:'""',position:"absolute",top:"-1px",left:"-1px",right:"-1px",bottom:"-1px",borderRadius:"12px",border:"2px solid #CEDAFA"}}:{},...u,children:d.jsxs(xe,{width:"100%",children:[d.jsx(fe,{position:"relative",top:"-3px",children:n}),d.jsx(xe,{ml:"base-loose",width:"100%",flexDirection:["column","row"],children:d.jsxs(fe,{children:[d.jsx(ie,{textStyle:"body.small",fontWeight:500,display:"block",style:{wordBreak:"break-all"},children:t}),d.jsx(ie,{textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:a})]})}),d.jsx(xe,{ml:"loose",alignItems:"center",children:d.jsx("input",{type:"radio",id:r,name:"delegationType",value:r,checked:r===i,style:{transform:"scale(1.2)",outline:0},onChange:p=>o(p.target.value),...f})})]})})}const hue=e=>d.jsx(fe,{...e,children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"none",viewBox:"0 0 48 48",children:[d.jsx("path",{stroke:"#5546FF",strokeWidth:"2",d:"M1 13h46v31a3 3 0 01-3 3H4a3 3 0 01-3-3V13zM1 13h46V8a3 3 0 00-3-3H4a3 3 0 00-3 3v5z"}),d.jsx("g",{clipPath:"url(#clip0)",children:d.jsx("path",{fill:"#5546FF",d:"M21.233 22.494a8 8 0 018.22 1.652l.84-.84c.63-.63 1.707-.184 1.707.707V28h-3.987c-.891 0-1.337-1.077-.707-1.707l.731-.732a6 6 0 101.378 7.024 1 1 0 011.805.861 8 8 0 11-9.987-10.952z"})}),d.jsx("path",{stroke:"#5546FF",strokeLinecap:"round",strokeWidth:"2",d:"M12 1v6M36 1v6"}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0",children:d.jsx("path",{fill:"#fff",d:"M0 0H16V16H0z",transform:"matrix(1 0 0 -1 16 38)"})})})]})}),pue=({cycles:e})=>d.jsx(fe,{children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"none",viewBox:"0 0 48 48",children:[d.jsx("path",{stroke:"#5546FF",strokeWidth:"2",d:"M1 13h46v31a3 3 0 01-3 3H4a3 3 0 01-3-3V13z"}),d.jsx("path",{stroke:"#5546FF",strokeWidth:"2",d:"M1 13h46V8a3 3 0 00-3-3H4a3 3 0 00-3 3v5z"}),d.jsx("path",{stroke:"#5546FF",strokeLinecap:"round",strokeWidth:"2",d:"M12 1v6M36 1v6"}),d.jsx("text",{fill:"#5546FF",x:"49%",y:"62%",dominantBaseline:"middle",textAnchor:"middle",style:{fontFamily:"Inter",fontWeight:500,fontSize:"16px"},children:e})]})});function II({children:e}){return d.jsx(fe,{background:ce("bg-alt"),my:"loose",py:"loose",px:"base-loose",borderRadius:"10px",children:d.jsx(xe,{children:d.jsxs(fe,{children:[d.jsx(ie,{fontSize:"14px",lineHeight:"20px",display:"block",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",color:ce("text-title"),mb:"base",children:"Recommended for"}),d.jsxs(ie,{children:[e," "]})]})})})}function mue(){var l;const[e]=$t("poolName"),[t]=$t("numberOfCycles"),[n,r,i]=$t("delegationDurationType"),[o,a]=$.useState(!1),u=(l=Mo[e.value])==null?void 0:l.duration;return!o&&u>0?d.jsx(Sn,{title:"Duration",children:d.jsxs(Cn,{children:[d.jsxs(ie,{color:ce("text-caption"),children:["The pool looks your STX for ",u," cycle",u>1?"s":""," at the time. You can revoke the pool permission at any time and your STX will be unlocked after the end of the next cycle."]}),d.jsxs(ie,{color:ce("text-caption"),children:["By default, you will be part of the pool until you revoke (indefinite duration). You can set a limit to leave the pool automatically"," ",d.jsx(St,{variant:"link",type:"button",onClick:()=>{i.setValue("limited"),a(!0)},children:"here"}),"."]})]})}):d.jsxs(Sn,{title:"Duration",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:"Choose whether you want to pool with a limited duration, or give the pool indefinite permission. Each cycles lasts around 15 days."})}),d.jsxs(It,{spacing:"base",mt:"extra-loose",children:[d.jsxs(FI,{title:"Indefinite permission",icon:d.jsx(hue,{}),delegationType:"indefinite",activeDelegationType:n.value,onChange:f=>i.setValue(f),children:[d.jsx(ie,{children:"Allow the pool to stack on your behalf for a max of 12 cycles at a time. You can unlock them at any moment by revoking the pool permission but keep in mind that your STX will be locked until completing the duration initially set by the pool."}),d.jsx(II,{children:"Users who wish to stack continuously and, when wishing to access STX again, understand revocation must be done before funds are re-stacked by pool."})]}),d.jsxs(FI,{title:"Limited permission",delegationType:"limited",icon:d.jsx(pue,{cycles:t.value||1}),activeDelegationType:n.value,onChange:f=>i.setValue(f),children:[d.jsx(ie,{children:"Set a limit between 1 and 12 cycles for how long the pool can stack on your behalf. Make sure you don't set it lower than the number of cycles your pool intends to stack."}),n.value==="limited"&&d.jsx(fue,{}),d.jsx(II,{children:"Users who want to guarantee funds are not locked beyond a certain period."})]}),u>0&&d.jsxs(ie,{children:["Reset to default indefinite duration"," ",d.jsx(St,{variant:"link",type:"button",onClick:()=>{i.setValue("indefinite"),a(!1)},children:"here"}),"."]})]}),r.touched&&r.error&&d.jsx(wn,{mt:"base-loose",children:d.jsx(bn,{children:r.error})})]})}function gue(){const[e,t]=$t("poolAddress");return d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:"The pool will provide this address for you."}),d.jsx(_b,{fieldName:"poolAddress",addressType:"STX",placeholder:"Pool address",...e,children:t.touched&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})})})]})}function yue(e){const{name:t,description:n,url:r,icon:i,activePoolName:o,onChange:a,...u}=e,[l,f]=k_();return d.jsx(fe,{borderRadius:l?"12px":void 0,borderWidth:"2px",borderColor:l?sf.borderFocused:"#00000000",_hover:{cursor:"pointer"},borderStyle:"solid",children:d.jsx(xe,{minHeight:"72px",p:"base-loose",as:"label",border:`1px solid ${ce("border")}`,borderRadius:"12px",_hover:{cursor:"pointer"},position:"relative",...u,children:d.jsxs(xe,{width:"100%",children:[d.jsx(fe,{position:"relative",top:"-3px",children:i}),d.jsx(xe,{ml:"base-loose",width:"100%",flexDirection:["column","row"],children:d.jsxs(fe,{children:[d.jsx(ie,{textStyle:"body.small",fontWeight:500,display:"block",style:{wordBreak:"break-all"},children:t}),d.jsx(ie,{textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:n}),t==es.CustomPool?d.jsx(gue,{}):r&&d.jsx($r,{href:r,textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:"Learn more"})]})}),d.jsx(xe,{ml:"loose",alignItems:"center",children:d.jsx("input",{type:"radio",id:t,name:"poolName",value:t,checked:t===o,style:{transform:"scale(1.2)",outline:0},onChange:p=>a(p.target.value),...f})})]})})})}function wue({onPoolChange:e}){const[t,,n]=$t("poolName"),[,,r]=$t("delegationDurationType"),i=o=>{r.setValue(Mo[o].duration>0?"indefinite":"limited"),n.setValue(o),e(o)};return d.jsxs(Sn,{title:"Pool",children:[d.jsx(Cn,{children:d.jsxs(ie,{children:["Select a pool to start stacking or"," ",d.jsx($r,{display:"inline",href:"https://www.stacks.co/learn/stacking",children:"discover others on stacks.co."})]})}),d.jsx(It,{spacing:"base",mt:"extra-loose",children:Object.keys(Mo).map((o,a)=>{const u=Mo[o];return u.disabled?null:d.jsx(yue,{name:u.name,icon:u.icon,description:u.description,url:u.website,activePoolName:t.value,onChange:i},a)})})]})}function bue({editable:e}){const[t,n]=$t("rewardAddress");return d.jsxs(Sn,{title:"Bitcoin address",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:"Enter the Bitcoin address where you'd like to receive your rewards."})}),d.jsx(fe,{position:"relative",maxWidth:"400px",children:d.jsx(_b,{fieldName:"poxAddress",addressType:"BTC",isDisabled:!e,...t,children:n.touched&&n.error&&d.jsx(wn,{children:d.jsx(bn,{children:n.error})})})}),e?d.jsx(fe,{textStyle:"body.small",color:ce("feedback-alert"),mt:"base-tight",children:"Make sure you control this BTC address. It is written on-chain and pool operators use the address as is."}):d.jsx(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight",children:"This is your BTC address."})]})}function Sue({showPoxWrapperTermItem:e,...t}){return d.jsxs(It,{textStyle:["body.small","body.large"],spacing:"base-loose",pl:"base",...Cb("feedback-alert"),...t,children:[d.jsx(Pl,{title:"This transaction can’t be reversed",icon:d.jsx(ps,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"There will be no way to unlock your STX once the pool has started stacking them. You will need to wait until they unlock at the end of the pool's chosen number of cycles."})}),d.jsx(Pl,{title:"Research your pool",icon:d.jsx(kb,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"Paying out rewards is at the discretion of the pool. Make sure you’ve researched and trust the pool you’re using."})}),e&&d.jsx(Pl,{title:"Stacking with Pool Contract",icon:d.jsx(o6,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"The pool uses a smart contract that handles your stacking. By allowing the contract to call Stacking functions, you agree to the rules of the Pool contract."})})]})}function vue({isDisabled:e,poolName:t,hasUserConfirmedPoolWrapperContract:n}){var f;const{network:r,networkInstance:i}=Pt(),o=ju(r),u=Mo[t].poxContract,l=(f=n[i])==null?void 0:f[o[u]];return d.jsxs(It,{children:[d.jsxs(Yh,{type:"submit",isDisabled:e||l,children:["Step 1: Allow pool contract ",l?d.jsx(lW,{}):null]}),d.jsx(Yh,{type:"submit",isDisabled:e||!l,children:"Step 2: Confirm and start pooling"})]})}function xue({isLoading:e,requiresAllowContractCaller:t,allowContractCallerTxId:n,hasUserConfirmedPoolWrapperContract:r}){const[i,o]=$.useState(!1),a=ar();return d.jsxs(Sn,{title:"Confirm and pool",children:[d.jsx(Sue,{showPoxWrapperTermItem:t,mt:"loose"}),d.jsx(Qk,{onChange:u=>o(u)}),t&&a.values.poolName?d.jsx(vue,{hasUserConfirmedPoolWrapperContract:r,poolName:a.values.poolName,isDisabled:!i}):d.jsx(Yh,{type:"submit",isLoading:e,isDisabled:!i||t&&!n,children:"Confirm and start pooling"})]})}function s6(e){const{cycles:t,rewardCycleLength:n,firstBurnchainBlockHeight:r,currentCycleId:i}=e;return new Qt(r).plus(new Qt(i).plus(1).multipliedBy(n)).plus(new Qt(t).multipliedBy(n)).toNumber()}const _ue=({title:e,amountText:t})=>d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",color:ce("text-caption"),children:e}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",color:ce("text-caption"),children:t})]});function kue(e){var b;const t=ar(),n=rn(),{networkName:r,networkInstance:i}=Pt(),o=t.values.amount,a=t.values.delegationDurationType,u=t.values.poolName,l=u?Mo[u]:void 0,f=(l!=null&&l.poolAddress?l.poolAddress[i]:void 0)||t.values.poolAddress,p=(l!=null&&l.poxContract?_W(i,l.poxContract):void 0)||((b=n.data)==null?void 0:b.contract_id),m=t.values.delegationDurationType==="limited"?t.values.numberOfCycles:null,y=m&&n.data?s6({cycles:m,rewardCycleLength:n.data.reward_cycle_length,currentCycleId:n.data.current_cycle.id,firstBurnchainBlockHeight:n.data.first_burnchain_block_height}):null,w=Hg(o);return d.jsx(d.Fragment,{children:d.jsx(Ln,{...e,children:d.jsxs(fe,{mx:["loose","extra-loose"],sx:{},children:[d.jsx(_ue,{title:"You'll pool up to",amountText:w}),d.jsx(Pn,{}),d.jsxs(wr,{mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"How long you want to delegate to the pool. This is not necessarily the locking duration. However, the locking period cannot be longer than the delegation duration.",children:"Duration"}),d.jsxs(Ge,{children:[!a&&"—",a==="limited"&&Jk(m??0),a==="indefinite"&&"Indefinite"]})]})}),d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"How you want to delegate to the pool. This is not necessarily the locking duration. However, the locking period cannot be longer than the delegation duration.",children:"Type"}),d.jsxs(Ge,{children:[a===null&&"—",a==="limited"&&"Limited permission",a==="indefinite"&&"Indefinite"]})]}),y&&d.jsxs(Me,{children:[d.jsx(Ve,{children:"Burn height"}),d.jsx(Ge,{children:y})]})]}),d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"This address is provided to you by your chosen pool for Stacking delegation specifically.",children:"Pool address"}),d.jsx(Ge,{children:f?Mi(f):"—"})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Contract"}),d.jsx(Ge,{children:p&&d.jsx($r,{href:xk(p,r),children:Mi(p)})})]})]})]})]})})})}function Rue({timeUntilNextCycle:e}){return d.jsxs(d.Fragment,{children:[d.jsx(Jo,{children:"Stack in a pool"}),d.jsx(Rb,{mt:"extra-loose",timeUntilNextCycle:e})]})}function Tue({handleDelegateStxSubmit:e,handleAllowContractCallerSubmit:t,hasUserConfirmedPoolWrapperContract:n,setHasUserConfirmedPoolWrapperContract:r,network:i}){return async function(a){var u;if(a.poolName&&vW(a.poolName)){const l=xW(a.poolName,i),f=Gw(i);if((u=n[f])!=null&&u[l]){e(a);return}else{t({poxWrapperContract:l,onFinish:()=>{r({...n,[f]:{...n[f],[l]:!0}})}});return}}else{e(a);return}}}function Oue(e,t,n){const[r,i]=t.split("."),o=[no(e),Rr()];return{contractAddress:r,contractName:i,functionName:"allow-contract-caller",functionArgs:o,network:n}}function Nue({client:e,network:t,setIsContractCallExtensionPageOpen:n}){return async function({poxWrapperContract:i,onFinish:o}){const[a]=await Promise.all([e.getStackingContract()]),u=Oue(i,a,t);Do({...u,onFinish(){n(!1),o()},onCancel(){n(!1)}}),n(!0)}}function Cue(e){return li().shape({poolAddress:cn(),amount:mp().test({name:"test-min-allowed-delegated-stacking",message:"You must delegate at least the pool's minimum.",test(t,n){const r=n.parent.poolName;if(!r)return!0;const i=Mo[r].minimumDelegationAmount;return Un(t||0).isLessThan(i)?n.createError({message:`You must delegate at least ${Jt(i)}`}):!0}}).test({name:"test-max-allowed-delegated-stacking",message:`You cannot delegate more than ${Jt($h)}`,test(t){return t===void 0?!1:Un(t).isLessThanOrEqualTo($h)}}),delegationDurationType:cn().required("Please select the delegation duration type.")})}function Eue(e,t,n,r,i){var f;const o=e.delegationDurationType==="limited"?s6({cycles:e.numberOfCycles,rewardCycleLength:t.reward_cycle_length,currentCycleId:t.current_cycle.id,firstBurnchainBlockHeight:t.first_burnchain_block_height}):void 0,a=e.poolName?Mo[e.poolName]:void 0;if(!a)throw new Error("Invalid Pool Name");const u=Gw(i),l=((f=a.poolAddress)==null?void 0:f[u])||e.poolAddress;if(e.poolName===es.CustomPool)return r.getDelegateOptions({contract:n,amountMicroStx:Un(e.amount).toString(),delegateTo:l,untilBurnBlockHeight:o});{const[p,m]=kW(u,a.poxContract);let y;switch(a.poxContract){case wt.WrapperOneCycle:y=[ft(Un(e.amount).toString()),no(l),o?Xi(ft(o)):Rr(),Rr(),xi(e.rewardAddress),Rr()];break;case wt.WrapperFastPool:case wt.WrapperRestake:y=[ft(Un(e.amount).toString())];break;default:y=[]}return{contractAddress:p,contractName:m,functionName:"delegate-stx",functionArgs:y,network:i}}}function Aue({client:e,network:t,setIsContractCallExtensionPageOpen:n,navigate:r}){return async function(o){const[a,u]=await Promise.all([e.getPoxInfo(),e.getStackingContract()]),l=Eue(o,a,u,e,t);Do({...l,onFinish(){n(!1),r("../pooled-stacking-info")},onCancel(){n(!1)}}),n(!0)}}const Fue={amount:"",poolAddress:"",delegationDurationType:void 0,numberOfCycles:1};function Iue(){const{client:e}=kn(),{address:t,btcAddressP2tr:n,btcAddressP2wpkh:r}=Mn(),{networkName:i}=Pt();if(!t){const o="Expected `address` to be defined.";return console.error(o),d.jsx(Mt,{children:o})}if(!e){const o="Expected `client` to be defined.";return console.error(o),d.jsx(Mt,{children:o})}if(!i){const o="Expected `networkName` to be defined.";return console.error(o),d.jsx(Mt,{children:o})}return d.jsx(Pue,{client:e,currentAccountAddresses:{address:t,btcAddressP2tr:n,btcAddressP2wpkh:r},networkName:i})}function Pue({client:e,networkName:t,currentAccountAddresses:n}){var C,M,J;const{network:r,networkInstance:i}=Pt(),o=ju(r),[a,u]=$.useState(!1),[l,f]=$.useState(!0),[p,m]=$.useState(!0),[y,w]=$.useState(!0),b=Vu(),x=xx(o[wt.WrapperFastPool]),k=xx(o[wt.WrapperRestake]),O=xx(o[wt.WrapperOneCycle]),[N,E]=$.useState({});$.useEffect(()=>{E(P=>{var D,q,K;return{...P,[i]:{[o[wt.Pox4]]:!0,[o[wt.WrapperFastPool]]:((D=x==null?void 0:x.data)==null?void 0:D.type)===we.OptionalSome,[o[wt.WrapperRestake]]:((q=k==null?void 0:k.data)==null?void 0:q.type)===we.OptionalSome,[o[wt.WrapperOneCycle]]:((K=O==null?void 0:O.data)==null?void 0:K.type)===we.OptionalSome}}})},[o,i,(C=x==null?void 0:x.data)==null?void 0:C.type,(M=k==null?void 0:k.data)==null?void 0:M.type,(J=O==null?void 0:O.data)==null?void 0:J.type,E]);const T=Yn(),B=Cue({currentAccountAddress:n.address,networkName:t}),A=Aue({client:e,network:r,navigate:T,setIsContractCallExtensionPageOpen:u}),U=Nue({client:e,network:r,setIsContractCallExtensionPageOpen:u}),v=Tue({handleDelegateStxSubmit:A,handleAllowContractCallerSubmit:U,hasUserConfirmedPoolWrapperContract:N,setHasUserConfirmedPoolWrapperContract:E,network:r}),R=P=>{if(P===es.CustomPool)f(!0),m(!1),w(!1);else{const D=Mo[P];f(D.payoutMethod===Vd.BTC&&D.allowCustomRewardAddress===!0),m(D.payoutMethod==="BTC"),w(qP(D))}};if(b.isLoading)return d.jsx(br,{});if(b.isError||typeof b.data!="number"){const P="0106e9bf-ae2f-4fcc-bf00-5fe083001adb",D="Failed to load necessary data.";return console.error(P,D),d.jsx(Mt,{id:P,children:D})}return d.jsx(Bi,{initialValues:{...Fue,rewardAddress:n.btcAddressP2wpkh},onSubmit:v,validationSchema:B,children:d.jsx(Kk,{intro:d.jsx(Rue,{timeUntilNextCycle:b.data}),stackingInfoPanel:d.jsx(vs,{children:d.jsx(kue,{})}),stackingForm:d.jsx(d.Fragment,{children:d.jsx(ui,{children:d.jsxs(Kl,{children:[d.jsx(wue,{onPoolChange:R}),p?d.jsx(bue,{btcAddress:n.btcAddressP2wpkh||"",editable:l||!n.btcAddressP2wpkh}):null,d.jsx(lue,{}),d.jsx(mue,{}),d.jsx(xue,{isLoading:a,allowContractCallerTxId:"",requiresAllowContractCaller:y,hasUserConfirmedPoolWrapperContract:N})]})})})})})}const Mue=new k7({defaultOptions:{queries:{refetchInterval:1e3*60,refetchOnWindowFocus:!1}}});function Lue(){$.useEffect(()=>void gZ(),[]);const[e]=cj(),t=e.get("chain"),n=e.get("api"),r=t||"mainnet",i=n;return d.jsx(I7,{client:Mue,children:d.jsx(JW,{cookies:LP?document==null?void 0:document.cookie:"",apiUrls:j0,queryNetworkMode:r,queryApiUrl:i,children:d.jsx(sZ,{children:d.jsx(aZ,{children:d.jsx($W,{children:d.jsxs(DJ,{children:[zJ,d.jsx(s_,{})]})})})})})})}const Bue=nj([{path:"/",element:d.jsx(Lue,{}),children:[{index:!0,element:d.jsx(Kw,{to:"sign-in"})},{path:"sign-in",element:d.jsx(j3,{}),children:[{index:!0,element:d.jsx(Poe,{})}]},{element:d.jsx(yZ,{}),children:[{element:d.jsx(j3,{}),children:[{path:"choose-stacking-method",element:d.jsx(Dee,{})},{path:"start-pooled-stacking",element:d.jsx(Iue,{})},{path:"pooled-stacking-info",element:d.jsx(ice,{})},{path:"start-direct-stacking",element:d.jsx(Wce,{})},{path:"direct-stacking-info",element:d.jsx(Koe,{})},{path:"start-liquid-stacking",element:d.jsx(cue,{})},{path:"lock-more-stx",element:d.jsx(Ice,{})},{path:"extend-stacking",element:d.jsx(Tce,{})},{path:"self-service-extend",element:d.jsx(dce,{})},{path:"signer",children:[{index:!0,element:d.jsx(xce,{})},{path:"generate-signature",element:d.jsx(Sce,{})}]},{path:"pool/:poolAddress",element:d.jsx(CI,{})},{path:"pool-admin",children:[{index:!0,element:d.jsx(CI,{})},{path:"delegate-stack-stx",element:d.jsx(Eae,{})},{path:"delegate-stack-extend",element:d.jsx(pae,{})},{path:"delegate-stack-increase",element:d.jsx(_ae,{})},{path:"stack-aggregation-commit",element:d.jsx(jae,{})},{path:"stack-aggregation-increase",element:d.jsx(zae,{})}]},{path:"settings",children:[{path:"add-network",element:d.jsx(Aoe,{})},{path:"network",element:d.jsx(Foe,{})}]}]}]}]}]);function jue(){return console.log("sdlfkjsdlfkjsldkf"),d.jsx(WB,{router:Bue})}BigInt.prototype.toJSON=function(){return this.toString()};UL.createRoot(document.getElementById("root")).render(d.jsx(lt.StrictMode,{children:d.jsx(jue,{})}));export{nle as a,y8 as g,iX as h,rle as r,tle as s}; +***************************************************************************** */var vw=function(){return vw=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{if(!e||typeof e!="string")throw new Error(`Expected base58 string but got “${e}”`);if(e.match(/[IOl0]/gmu))throw new Error(`Invalid base58 character “${e.match(/[IOl0]/gmu)}”`);const t=e.match(/^1+/gmu),n=t?t[0].length:0,r=(e.length-n)*(Math.log(58)/Math.log(256))+1>>>0;return new Uint8Array([...new Uint8Array(n),...e.match(/.{1}/gmu).map(o=>X1.indexOf(o)).reduce((o,a)=>o=o.map(u=>{const l=58*u+a;return a=l>>8,l}),new Uint8Array(r)).reverse().filter((i=!1,o=>i=i||o))]);var i};(()=>{const e=Array(256).fill(-1);for(let t=0;t>25;return(33554431&m)<<5^996825010&-(y>>0&1)^642813549&-(y>>1&1)^513874426&-(y>>2&1)^1027748829&-(y>>3&1)^705979059&-(y>>4&1)}function o(m){let y=1;for(let w=0;w126)return"Invalid prefix ("+m+")";y=i(y)^b>>5}y=i(y);for(let w=0;w=w;)_-=w,N.push(x>>_&O);if(b)_>0&&N.push(x<=y)return"Excess padding";if(x<x)return"Exceeds length limit";const _=b.toLowerCase(),O=b.toUpperCase();if(b!==_&&b!==O)return"Mixed-case string "+b;const N=(b=_).lastIndexOf("1");if(N===-1)return"No separator character for "+b;if(N===0)return"Missing prefix for "+b;const E=b.slice(0,N),T=b.slice(N+1);if(T.length<6)return"Data too short";let B=o(E);if(typeof B=="string")return B;const A=[];for(let U=0;U=T.length||A.push(R)}return B!==y?"Invalid checksum for "+b:{prefix:E,words:A}}return y=m==="bech32"?1:734539939,{decodeUnsafe:function(b,x){const _=w(b,x);if(typeof _=="object")return _},decode:function(b,x){const _=w(b,x);if(typeof _=="object")return _;throw new Error(_)},encode:function(b,x,_){if(_=_||90,b.length+7+x.length>_)throw new TypeError("Exceeds length limit");let O=o(b=b.toLowerCase());if(typeof O=="string")throw new Error(O);let N=b+"1";for(let E=0;E>5)throw new Error("Non 5-bit word");O=i(O)^T,N+=n.charAt(T)}for(let E=0;E<6;++E)O=i(O);O^=y;for(let E=0;E<6;++E)N+=n.charAt(O>>5*(5-E)&31);return N},toWords:u,fromWordsUnsafe:l,fromWords:f}}t.bech32=p("bech32"),t.bech32m=p("bech32m")},RI(Mx={exports:{}},Mx.exports),Mx.exports);(N0=Wk)&&N0.__esModule&&Object.prototype.hasOwnProperty.call(N0,"default")&&N0.default;var Zse=Wk.bech32m,TI=Wk.bech32;const eae=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];class tae{constructor(){this.A=1779033703,this.B=-1150833019,this.C=1013904242,this.D=-1521486534,this.E=1359893119,this.F=-1694144372,this.G=528734635,this.H=1541459225,this._size=0,this._sp=0,(!C0||Lm>=8e3)&&(C0=new ArrayBuffer(8e3),Lm=0),this._byte=new Uint8Array(C0,Lm,80),this._word=new Int32Array(C0,Lm,20),Lm+=80}update(t){if(typeof t=="string")return this._utf8(t);if(t==null)throw new TypeError("Invalid type: "+typeof t);const n=t.byteOffset,r=t.byteLength;let i=r/64|0,o=0;if(i&&!(3&n)&&!(this._size%64)){const a=new Int32Array(t.buffer,n,16*i);for(;i--;)this._int32(a,o>>2),o+=64;this._size+=o}if(t.BYTES_PER_ELEMENT!==1&&t.buffer){const a=new Uint8Array(t.buffer,n+o,r-o);return this._uint8(a)}return o===r?this:this._uint8(t,o)}_uint8(t,n){const{_byte:r,_word:i}=this,o=t.length;for(n|=0;n=64&&this._int32(i),this._size+=u-a}return this}_utf8(t){const{_byte:n,_word:r}=this,i=t.length;let o=this._sp;for(let a=0;a>>6,n[l++]=128|63&f):f<55296||f>57343?(n[l++]=224|f>>>12,n[l++]=128|f>>>6&63,n[l++]=128|63&f):o?(f=((1023&o)<<10)+(1023&f)+65536,n[l++]=240|f>>>18,n[l++]=128|f>>>12&63,n[l++]=128|f>>>6&63,n[l++]=128|63&f,o=0):o=f}l>=64&&(this._int32(r),r[0]=r[16]),this._size+=l-u}return this._sp=o,this}_int32(t,n){let{A:r,B:i,C:o,D:a,E:u,F:l,G:f,H:p}=this,m=0;for(n|=0;m<16;)Ud[m++]=_o(t[n++]);for(m=16;m<64;m++)Ud[m]=aae(Ud[m-2])+Ud[m-7]+sae(Ud[m-15])+Ud[m-16]|0;for(m=0;m<64;m++){const y=p+oae(u)+nae(u,l,f)+eae[m]+Ud[m]|0,w=iae(r)+rae(r,i,o)|0;p=f,f=l,l=u,u=a+y|0,a=o,o=i,i=r,r=y+w|0}this.A=r+this.A|0,this.B=i+this.B|0,this.C=o+this.C|0,this.D=a+this.D|0,this.E=u+this.E|0,this.F=l+this.F|0,this.G=f+this.G|0,this.H=p+this.H|0}digest(t){const{_byte:n,_word:r}=this;let i=this._size%64|0;for(n[i++]=128;3&i;)n[i++]=0;if(i>>=2,i>14){for(;i<16;)r[i++]=0;i=0,this._int32(r)}for(;i<16;)r[i++]=0;const o=8*this._size,a=(4294967295&o)>>>0,u=(o-a)/4294967296;return u&&(r[14]=_o(u)),a&&(r[15]=_o(a)),this._int32(r),t==="hex"?this._hex():this._bin()}_hex(){const{A:t,B:n,C:r,D:i,E:o,F:a,G:u,H:l}=this;return xl(t)+xl(n)+xl(r)+xl(i)+xl(o)+xl(a)+xl(u)+xl(l)}_bin(){const{A:t,B:n,C:r,D:i,E:o,F:a,G:u,H:l,_byte:f,_word:p}=this;return p[0]=_o(t),p[1]=_o(n),p[2]=_o(r),p[3]=_o(i),p[4]=_o(o),p[5]=_o(a),p[6]=_o(u),p[7]=_o(l),f.slice(0,32)}}const Ud=new Int32Array(64);let C0,Lm=0;const xl=e=>(e+4294967296).toString(16).substr(-8),_o=new Uint8Array(new Uint16Array([65279]).buffer)[0]===254?e=>e:e=>e<<24&4278190080|e<<8&16711680|e>>8&65280|e>>24&255,nae=(e,t,n)=>n^e&(t^n),rae=(e,t,n)=>e&t|n&(e|t),iae=e=>(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),oae=e=>(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7),sae=e=>(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3,aae=e=>(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10;var Au,Fu,OI=function(e){return function(t){return new tae}().update(e).digest()};(function(e){e.mainnet="mainnet",e.testnet="testnet",e.regtest="regtest"})(Au||(Au={})),function(e){e.p2pkh="p2pkh",e.p2sh="p2sh",e.p2wpkh="p2wpkh",e.p2wsh="p2wsh",e.p2tr="p2tr"}(Fu||(Fu={}));var NI={0:{type:Fu.p2pkh,network:Au.mainnet},111:{type:Fu.p2pkh,network:Au.testnet},5:{type:Fu.p2sh,network:Au.mainnet},196:{type:Fu.p2sh,network:Au.testnet}},V5=function(e){var t,n=e.substr(0,2).toLowerCase();if(n==="bc"||n==="tb")return function(l){var f;try{f=l.startsWith("bc1p")||l.startsWith("tb1p")||l.startsWith("bcrt1p")?Zse.decode(l):TI.decode(l)}catch{throw new Error("Invalid address")}var p={bc:Au.mainnet,tb:Au.testnet,bcrt:Au.regtest}[f.prefix];if(p===void 0)throw new Error("Invalid address");var m=f.words[0];if(m<0||m>16)throw new Error("Invalid address");return{bech32:!0,network:p,address:l,type:TI.fromWords(f.words.slice(1)).length===20?Fu.p2wpkh:m===1?Fu.p2tr:Fu.p2wsh}}(e);try{t=Xse(e)}catch{throw new Error("Invalid address")}var r=t.length;if(r!==25)throw new Error("Invalid address");var i=t[0],o=t.slice(r-4,r),a=t.slice(0,r-4),u=OI(OI(a)).slice(0,4);if(o.some(function(l,f){return l!==u[f]}))throw new Error("Invalid address");if(!Object.keys(NI).map(Number).includes(i))throw new Error("Invalid address");return vw(vw({},NI[i]),{address:e,bech32:!1})},cae=function(e,t){try{var n=V5(e);return!t||t===n.network}catch{return!1}};function uae(e,t){if(!cae(e))return"Invalid BTC address";const r=V5(e);return r?t==="mainnet"&&r.network==="testnet"?"Testnet addresses not supported on Mainnet":t==="testnet"&&r.network==="mainnet"?"Mainnet addresses not supported on Testnet":wW.includes(r.type)?!0:"Unsupported BTC address type":"Invalid BTC address"}function Ql({network:e}){return cn().defined("Enter the BTC address where you'd like to recieve your rewards").test({name:"btc-address",message:"The BTC address you've entered is not valid",test(t){if(t==null||typeof t!="string")return!1;const n=uae(t,e);return typeof n=="string"?this.createError({message:n}):n}})}function lae(e,t){const n=e.substring(0,2);return t==="testnet"?n==="SN"||n==="ST":t==="mainnet"?n==="SM"||n==="SP":!1}function Vk(e,t){return e.defined("Must define a STX address").test({name:"address-validation",test(n,r){if(!n)return!1;const[i,o]=n.split(".");return!xf(i)||o===""?r.createError({message:"Input address is not a valid STX address"}):lae(n,t)?!0:r.createError({message:`Must use a ${t} STX address`})}})}function dae({network:e}){return li().shape({stacker:Vk(cn(),e),extendCount:Wr().defined().positive().integer().min(1).max(12),poxAddress:Ql({network:e})})}function fae({client:e,setIsContractCallExtensionPageOpen:t,setTxResult:n,network:r}){return async function(o){const[a]=await Promise.all([e.getStackingContract()]),u=e.getDelegateStackExtendOptions({contract:a,stacker:o.stacker,poxAddress:o.poxAddress,extendCount:o.extendCount});console.log(u),Do({...u,network:r,onFinish(l){n(l),t(!1)},onCancel(){t(!1)}}),t(!0)}}const hae={stacker:"",poxAddress:"",extendCount:0,totalAmount:void 0,lockedAmount:void 0,unlockHeight:void 0,delegated:void 0,delegatedTo:void 0,delegatedAmount:void 0};function pae(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(mae,{client:e})}function mae({client:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(),{networkName:o,network:a}=Pt(),u=Gu(),l=rn(),f=ci();if(u.isLoading||l.isLoading||f.isLoading)return d.jsx(br,{});if(u.isError||typeof u.data!="number"||l.isError||!l.data||f.isError||typeof f.data.stx.balance!="string"){const y="Failed to load necessary data.",w="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(w,y),d.jsx(Mt,{id:w,children:y})}const p=dae({currentBurnHt:l.data.current_burnchain_block_height||0,network:o}),m=fae({client:e,setIsContractCallExtensionPageOpen:n,setTxResult:i,network:a});return d.jsx(Bi,{initialValues:{...hae,startBurnHt:l.data.current_burnchain_block_height?l.data.current_burnchain_block_height+10:0},onSubmit:y=>{m(y)},validationSchema:p,children:d.jsx(pp,{intro:d.jsx(hp,{estimatedStackingMinimum:BigInt(l.data.min_amount_ustx),timeUntilNextCycle:u.data,children:"You can extend the duration of an existing pool member. This will not change the amount."}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(Qse,{})})}),poolAdminForm:d.jsx(ui,{children:d.jsxs(d.Fragment,{children:[d.jsxs(zk,{children:[d.jsx(Hk,{}),d.jsx(Uk,{fieldName:"extendCount",description:"Number of extra cycles to add for this stacker"}),d.jsx(Ef,{}),d.jsx(fp,{isLoading:t,title:"Extend locking period",actionLabel:"Confirm and extend"})]}),r&&d.jsx(Ug,{txResult:r})]})})})})}function gae(){const{values:e}=ar(),{delegated:t,lockedAmount:n,totalAmount:r,delegatedAmount:i}=e;return t===void 0||!n||!r||!i?null:d.jsxs(d.Fragment,{children:[d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight",children:["Available balance: ",Jt(r)]}),d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight",children:["Locked amount: ",Jt(n)]}),d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight",children:["Delegated amount: ",Jt(i)]})]})}function G5(){const e=rn(),[t,n]=$t("amount");if(e.isError||!e.data){const r="134098d7-444b-4591-abfe-8767af6def3f",i="Failed to load necessary data.";return console.error(r,i),d.jsx(bs,{id:r,children:i})}return d.jsxs(Sn,{title:"Choose amount",children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsx(ie,{children:"Must be less than or equal to the delegated amount and the stacker's balance."})})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"stxAmount",placeholder:"Amount of STX to Stack",mt:"loose",...t}),n.touched&&n.error&&d.jsx(wn,{children:d.jsx(bn,{children:n.error})})]}),d.jsx(gae,{})]})}function Hg(e){if(e==="")return Jt(0);const t=Un(e);return t.isNaN()||t.gt($h)?"—":Jt(t)}function yae({stacker:e,amount:t}){return d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You'll lock"}),d.jsxs(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:[Hg(t??0)," for"]}),d.jsx(co,{address:e})]})}function wae({stacker:e,amount:t}){const{network:n}=Pt(),r=new _f({address:e,network:n}),i=fb(r);if(i.isError||!i.data)return d.jsx(Ge,{children:"0 STX"});const o=Yt(t)*1000000n-Yt(i.data.stx.locked);return d.jsx(Ge,{children:Jt(o>0n?o:0n)})}function bae(){const e=ar(),{stacker:t,amount:n,poxAddress:r}=e.values,i=t&&xf(t)&&e.errors.stacker===void 0;return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsx(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:i?d.jsx(yae,{stacker:t,amount:n}):d.jsx(ie,{textStyle:"body.large.medium",children:"Choose pool member first!"})}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"Additional STX to be locked and use in the stacking transaction.",children:"Increase by"}),i?d.jsx(wae,{stacker:t,amount:n}):d.jsx(Ge,{children:"0 STX"})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool PoX address"}),d.jsx(Ge,{children:r?Mi(r):"—"})]})})]})]})})}function Ob(e){return t=>{const n=new Qt(t).toString(10).split(".")[1];return n===void 0||n.length<=e}}function K5(){return{name:"test-delegated-stx-amount",message:"You must stack less than the stacker balance and delegation amount",test:(e,t)=>{if(e==null)return!1;if(t.parent.totalAmount===void 0||t.parent.delegatedAmount===void 0)return!0;const n=Un(e);return n.isLessThanOrEqualTo(new Qt(t.parent.totalAmount.toString()))&&n.isLessThanOrEqualTo(new Qt(t.parent.delegatedAmount.toString()))}}}function mp(){return Wr().required("Enter an amount of STX").positive("You must stack something").typeError("STX amount must be a number")}function Sae({network:e}){return li().shape({amount:mp().test("test-precision","You cannot stack with a precision of less than 1 STX",t=>t===void 0?!0:Ob(0)(t)).test({name:"test-increase",message:"You must stack more than the currently locked amount",test:(t,n)=>t==null?!1:n.parent.lockedAmount===void 0?!0:Un(t).isGreaterThan(new Qt(n.parent.lockedAmount.toString()))}).test(K5()),stacker:Vk(cn(),e),poxAddress:Ql({network:e})})}function vae({client:e,setIsContractCallExtensionPageOpen:t,setTxResult:n,network:r}){return async function(o){if(o.amount===null)throw new Error("Expected a non-null amount to be submitted.");const u=await new _f({address:o.stacker,network:r}).getAccountExtendedBalances(),l=Yt(Un(o.amount).toString())-Yt(u.stx.locked),[f]=await Promise.all([e.getStackingContract()]),p=e.getDelegateStackIncreaseOptions({contract:f,stacker:o.stacker,increaseBy:l.toString(),poxAddress:o.poxAddress});Do({...p,network:r,onFinish(m){n(m),t(!1)},onCancel(){t(!1)}}),t(!0)}}const xae={stacker:"",amount:"",poxAddress:"",totalAmount:void 0,lockedAmount:void 0,unlockHeight:void 0,delegated:void 0,delegatedTo:void 0,delegatedAmount:void 0};function _ae(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(kae,{client:e})}function kae({client:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(),{networkName:o,network:a}=Pt(),u=Gu(),l=rn(),f=ci();if(u.isLoading||l.isLoading||f.isLoading)return d.jsx(br,{});if(u.isError||typeof u.data!="number"||l.isError||!l.data||f.isError||typeof f.data.stx.balance!="string"){const y="Failed to load necessary data.",w="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(w,y),d.jsx(Mt,{id:w,children:y})}const p=Sae({network:o}),m=vae({client:e,setIsContractCallExtensionPageOpen:n,setTxResult:i,network:a});return d.jsx(Bi,{initialValues:{...xae,startBurnHt:l.data.current_burnchain_block_height?l.data.current_burnchain_block_height+10:0},onSubmit:y=>{m(y)},validationSchema:p,children:d.jsx(pp,{intro:d.jsx(hp,{estimatedStackingMinimum:BigInt(l.data.min_amount_ustx),timeUntilNextCycle:u.data,children:"You can increase the locked amount for an existing pool member. The amount will be used from the next cycle onwards."}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(bae,{})})}),poolAdminForm:d.jsx(ui,{children:d.jsxs(d.Fragment,{children:[d.jsxs(zk,{children:[d.jsx(Hk,{}),d.jsx(G5,{}),d.jsx(Ef,{}),d.jsx(fp,{isLoading:t,title:"Increase stacking amount",actionLabel:"Confirm and lock more"})]}),r&&d.jsx(Ug,{txResult:r})]})})})})}function Rae(){const e=rn(),[t,n]=$t("startBurnHt");if(e.isError||!e.data){const r="134098d7-444b-4591-abfe-8767af6def3f",i="Failed to load necessary data.";return console.error(r,i),d.jsx(bs,{id:r,children:i})}return d.jsxs(Sn,{title:"Choose start burn height",children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsxs(ie,{children:["Current burn height is ",e.data.current_burnchain_block_height,". The value must be in the future and before the anchor block of the next cycle. Add for example 10 blocks."]})})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"startBurnHt",placeholder:"Bitcoin block",mt:"loose",...t}),n.touched&&n.error&&d.jsx(wn,{children:d.jsx(bn,{children:n.error})})]})]})}function Tae(){var u;const e=ar(),t=rn(),{stacker:n,amount:r,lockPeriod:i,poxAddress:o,startBurnHt:a}=e.values;return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You'll lock"}),d.jsxs(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:[Hg(r??0)," for"]}),d.jsx(co,{address:n})]}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:`One cycle lasts ${(u=t.data)==null?void 0:u.reward_cycle_length} blocks on the Bitcoin blockchain`,children:"Cycles"}),d.jsx(Ge,{children:i})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Start Burn Height"}),d.jsx(Ge,{children:a})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool PoX address"}),d.jsx(Ge,{children:o?Mi(o):"—"})]})})]})]})})}function Oae({currentBurnHt:e,network:t}){return li().shape({amount:mp().test("test-precision","You cannot stack with a precision of less than 1 STX",n=>n===void 0?!0:Ob(0)(n)).test(K5()),lockPeriod:Wr().defined(),startBurnHt:Wr().test({name:"test-future-start-burn-height",message:"Start burn height must be in the future.",test:n=>n==null?!1:n>e}),stacker:cn().defined(),poxAddress:Ql({network:t})})}function Nae({client:e,setIsContractCallExtensionPageOpen:t,setTxResult:n,network:r}){return async function(o){if(o.amount===null)throw new Error("Expected a non-null amount to be submitted.");const[a]=await Promise.all([e.getStackingContract()]),u=e.getDelegateStackOptions({contract:a,stacker:o.stacker,amountMicroStx:Un(o.amount).toString(10),cycles:o.lockPeriod,poxAddress:o.poxAddress,burnBlockHeight:o.startBurnHt});Do({...u,network:r,onFinish(l){n(l),t(!1)},onCancel(){t(!1)}}),t(!0)}}const Cae={stacker:"",amount:"",lockPeriod:12,poxAddress:"",startBurnHt:0,totalAmount:void 0,lockedAmount:void 0,unlockHeight:void 0,delegated:void 0,delegatedTo:void 0,delegatedAmount:void 0};function Eae(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(Aae,{client:e})}function Aae({client:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(),{networkName:o,network:a}=Pt(),u=Gu(),l=rn();if(u.isLoading||l.isLoading)return d.jsx(br,{});if(u.isError||typeof u.data!="number"||l.isError||!l.data){const m="Failed to load necessary data.",y="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(y,m),d.jsx(Mt,{id:y,children:m})}const f=Oae({availableBalanceUStx:Yt($h.toString()),currentBurnHt:l.data.current_burnchain_block_height||0,network:o}),p=Nae({client:e,setIsContractCallExtensionPageOpen:n,setTxResult:i,network:a});return d.jsx(Bi,{initialValues:{...Cae,startBurnHt:l.data.current_burnchain_block_height?l.data.current_burnchain_block_height+10:0},onSubmit:m=>{p(m)},validationSchema:f,children:d.jsx(pp,{intro:d.jsx(hp,{estimatedStackingMinimum:BigInt(l.data.min_amount_ustx),timeUntilNextCycle:u.data,children:"You need to lock STX for your pool members for 1 or more cycles. You also need to finalized each cycle."}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(Tae,{})})}),poolAdminForm:d.jsx(ui,{children:d.jsxs(d.Fragment,{children:[d.jsxs(zk,{children:[d.jsx(Hk,{}),d.jsx(G5,{}),d.jsx(Uk,{}),d.jsx(Rae,{}),d.jsx(Ef,{}),d.jsx(fp,{isLoading:t,title:"Lock STX for pool member",actionLabel:"Confirm and lock STX"})]}),r&&d.jsx(Ug,{txResult:r})]})})})})}function Fae(){const e=rn();return e.isLoading?null:e.isError||!e.data?d.jsx(d.Fragment,{children:"Failed to load Pox data"}):d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsx(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:d.jsx(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:"Cycles"})}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{explainer:`One cycle lasts ${e.data.reward_cycle_length} blocks on the Bitcoin blockchain`,children:"Current Cycle"}),d.jsx(Ge,{children:e.data.current_cycle.id})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Total Stacked"}),d.jsx(Ge,{children:Jt(e.data.current_cycle.stacked_ustx)})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Per Slot"}),d.jsx(Ge,{children:Jt(e.data.current_cycle.min_threshold_ustx)})]})]}),d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{children:"Next Cycle"}),d.jsx(Ge,{children:e.data.next_cycle.id})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Starts in"}),d.jsxs(Ge,{children:[e.data.next_cycle.blocks_until_prepare_phase," blocks"]})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Total Stacked"}),d.jsx(Ge,{children:Jt(e.data.next_cycle.stacked_ustx)})]}),d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"The price per slot can change until the last block",children:"Per Slot (estimated)"}),d.jsx(Ge,{children:Jt(e.data.next_cycle.min_threshold_ustx)})]})]})]})]})})}function CI(){VI(),Mn();const e=Gu(),t=rn(),n=Yn();if(e.isLoading||t.isLoading)return d.jsx(br,{});if(e.isError||typeof e.data!="number"||t.isError||!t.data){const r="Failed to load necessary data.",i="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(i,r),d.jsx(Mt,{id:i,children:r})}return d.jsx(pp,{intro:d.jsxs(hp,{estimatedStackingMinimum:BigInt(t.data.min_amount_ustx),timeUntilNextCycle:e.data,children:["Managing a stacking pool usually happens directly through the pox-4 contract. For each pool member, who delegated to your pool address, you have to stack their stack and later extend and/or increase their locked tokens.",d.jsx("br",{}),"After locking your members' STX, you have to finalized the cycle by calling stack aggregation commit."]}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(Fae,{})})}),poolAdminForm:d.jsx(d.Fragment,{children:d.jsxs(It,{spacing:"base",mt:"extra-loose",children:[d.jsx(St,{onClick:()=>n(Nr.DELEGATE_STACK_STX),children:"Delegate Stack STX"}),d.jsx(St,{onClick:()=>n(Nr.DELEGATE_STACK_EXTEND),children:"Delegate Stack Extend"}),d.jsx(St,{onClick:()=>n(Nr.DELEGATE_STACK_INCREASE),children:"Delegate Stack Increase"}),d.jsx(St,{onClick:()=>n(Nr.STACK_AGGREGATION_COMMIT),children:"Stack Aggregation Commit"}),d.jsx(St,{onClick:()=>n(Nr.STACK_AGGREGATION_INCREASE),children:"Stack Aggregation Increase"})]})})})}function Q5(){const e=rn(),[t,n]=$t("rewardCycleId");if(e.isError||!e.data){const r="134098d7-444b-4591-abfe-8767af6def3f",i="Failed to load necessary data.";return console.error(r,i),d.jsx(bs,{id:r,children:i})}return d.jsxs(Sn,{title:"Choose reward cycle",children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsxs(ie,{color:ce("text-caption"),children:["Next cycle is ",e.data.reward_cycle_id+1]})})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"rewardCycle",placeholder:"Next cycle",mt:"loose",...t}),(n.touched||t)&&n.error&&d.jsx(wn,{children:d.jsx(bn,{children:n.error})})]})]})}function E0({title:e,text:t,fieldName:n,placeholder:r}){const[i,o,a]=$t(n);return d.jsxs(d.Fragment,{children:[d.jsx(Jo,{fontSize:"20px",children:e}),t,d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{...i,mt:"loose",onChange:u=>{if("value"in u.target){const{value:l}=u.target;return l?a.setValue(l.replaceAll("0x","")):i.onChange(u)}return i.onChange(u)},placeholder:r}),o.touched&&o.error&&d.jsx(wn,{children:d.jsx(bn,{children:o.error})})]})]})}function zg(){const{setValues:e}=ar(),[t,n]=$.useState(""),{activeNetwork:r}=ms(),i=o=>{if(o.preventDefault(),n(""),o.clipboardData&&o.clipboardData.items.length>0&&o.clipboardData.items[0].kind==="string"){const a=async u=>{try{const l=JSON.parse(u),f=BigInt(l.maxAmount);e(p=>({...p,signatureJSON:u,signerKey:l.signerKey,maxAmount:j_(f),authId:l.authId,signerSignature:l.signerSignature}),!0)}catch(l){console.error(l),n("Invalid signer data")}};o.clipboardData.items[0].getAsString(a)}};return d.jsx(d.Fragment,{children:d.jsxs(Sn,{title:"Signer Information",children:[d.jsx(Cn,{children:d.jsxs(ie,{color:ce("text-caption"),children:["When you engage in Stacking, you're associating your locked STX with a signer actively involved in the Stacks network's consensus process. With the"," ",d.jsx($r,{href:"https://www.nakamoto.run/",children:"Nakamoto Release"}),", Stackers who choose to stack independently will need to run their own signer software."]})}),d.jsxs(ie,{mt:"loose",color:ce("text-caption"),children:["If you're interested in running your own signer, please consult"," ",d.jsx($r,{href:"https://docs.stacks.co/nakamoto-upgrade/signing-and-stacking/stacking-flow",children:"these documents"})," ","on how to Stack as a signer and fill out"," ",d.jsx(Cl,{href:`/signer/generate-signature${cs(r)}`,display:"inline-block",children:"this page"})," ","to generate a signer signature. If you prefer not to manage your own signer, we suggest"," ",d.jsx(Cl,{href:`/start-pooled-stacking${cs(r)}`,display:"inline-block",children:"Stacking using another method"}),". Users who are not running their own signer software will need to request this data from the signer that you're using. Enter the data you receive here:"]}),d.jsx(sr,{onPaste:i,placeholder:"paste signature JSON here..",my:"base-loose"}),t&&d.jsx(wn,{children:d.jsx(bn,{children:t})}),d.jsx(ie,{mb:"base",color:ce("text-caption"),children:"Alternatively, enter the information manually."}),d.jsx(E0,{title:"Signer Public Key",text:d.jsx(ie,{color:ce("text-caption"),children:"Enter the signer's public key in hexadecimal format:"}),placeholder:"public key 0x1234..ef",fieldName:"signerKey"}),d.jsx(E0,{title:"Signer Signature (optional)",text:d.jsx(ie,{color:ce("text-caption"),children:"Enter the hexadecimal signature from the signer enabling you to Stack with their key. Leave this field blank if the signature is universal for all Stackers who use this signer:"}),placeholder:"signature 0x1234..0123..ef",fieldName:"signerSignature"}),d.jsx(E0,{title:"Max Amount",text:d.jsx(ie,{color:ce("text-caption"),children:"Enter the maximum amount of STX that can be locked while using this signature:"}),placeholder:"Maximum amount of STX to lock",fieldName:"maxAmount"}),d.jsx(E0,{title:"Auth ID",text:d.jsx(ie,{color:ce("text-caption"),children:"Enter the signer's Auth ID, a randomly generated number that prevents signer signature reuse:"}),placeholder:"value provided by signer",fieldName:"authId"})]})})}const Y5=340282366920938463463374607431768211455n,Iae=new Qt(j_(Y5)),Sg=j_(Y5),qn=li().shape({signerKey:cn().required(),signerSignature:cn().required(),authId:cn().required(),rewardCycle:cn().required(),maxAmount:cn().required(),period:cn().required(),poxAddress:cn().required(),method:cn().required()});function Nb({signatureData:e}){return d.jsxs(d.Fragment,{children:[d.jsxs(bt,{children:[d.jsx(Me,{children:d.jsx(Ve,{children:d.jsx(xe,{alignItems:"center",justifyContent:"center",children:d.jsx(ie,{children:"Public Key"})})})}),d.jsx(Me,{children:d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:e?`0x${e.publicKey}`:"—"})})})]}),d.jsxs(bt,{children:[d.jsx(Me,{children:d.jsx(Ve,{children:d.jsx(xe,{alignItems:"center",justifyContent:"center",children:d.jsx(ie,{children:"Signature"})})})}),d.jsx(Me,{children:d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:e?`0x${e.signature}`:"—"})})})]}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Max Amount"}),d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:e&&e.maxAmount?e.maxAmount===Sg?"MAX":e.maxAmount:"—"})})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Auth ID"}),d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:e?e.authId:"—"})})]})})]})}function Pae(){const e=ar(),{rewardCycleId:t,poxAddress:n,signerKey:r,signerSignature:i,maxAmount:o,authId:a}=e.values;return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You'll finalize"}),d.jsxs(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:["Cycle ",t]})]}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool PoX address"}),d.jsx(Ge,{children:n?Mi(n):"—"})]})}),d.jsx(Nb,{signatureData:i&&r?{signature:i,publicKey:r,maxAmount:o,authId:a}:void 0})]})]})})}function wf(){return cn().test("no-0x","Value may not start with 0x",e=>typeof e!="string"||!e.length?!0:!e.startsWith("0x"))}function Mae({network:e}){return li().shape({rewardCycleId:Wr().defined().test("matches-signature-reward-cycle","Reward cycle does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return parseInt(r.rewardCycle,10)===t}),poxAddress:Ql({network:e.networkName}).test("matches-signature-pox-address","BTC Address does not match signature data",function(t){const n=this.parent.signatureJSON;return typeof n!="string"?!0:qn.json().cast(n).poxAddress===t}),signerKey:wf().required(),signerSignature:wf().test("matches-topic","Signature was not generated for stack-aggregation-commit",function(t){const n=this.parent.signatureJSON;return typeof n!="string"?!0:qn.json().cast(n).method==="agg-commit"}).test("valid-signature","Unable to validate signature",function(t,n){if(typeof t!="string")return!0;const r={topic:"agg-commit",rewardCycle:n.parent.rewardCycleId,poxAddress:n.parent.poxAddress,authId:n.parent.authId,network:e.network,publicKey:n.parent.signerKey,signature:t,period:1,maxAmount:Vr(n.parent.maxAmount)};return console.log(r),Vl(r)}),maxAmount:cn().defined().test("matches-signature-max-amount","Max amount does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return Pi(r.maxAmount).isEqualTo(Pi(Vr(t)))}),signatureJSON:cn(),authId:Wr().defined().test("matches-signature","Auth ID does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return BigInt(r.authId)===BigInt(t)})})}function Lae({client:e,poxOperationInfo:t,setIsContractCallExtensionPageOpen:n,setTxResult:r}){return async function(o){const[a]=await Promise.all([e.getStackingContract()]),u=t.current===t.pox4,l=parseInt(o.authId,10),f=Vr(o.maxAmount);typeof o.signerSignature=="string"&&(Vl({topic:"agg-commit",poxAddress:o.poxAddress,rewardCycle:o.rewardCycleId,authId:l,maxAmount:f,period:1,network:e.network,publicKey:o.signerKey,signature:o.signerSignature})?console.log("Signature is valid"):console.warn("Unable to verify signature."));const p=e.getStackAggregationCommitOptionsIndexed({contract:a,poxAddress:o.poxAddress,rewardCycle:o.rewardCycleId,signerKey:u?o.signerKey:void 0,signerSignature:u?o.signerSignature:void 0,maxAmount:f,authId:l});Do({...p,onFinish(m){r(m),n(!1)},onCancel(){n(!1)}}),n(!0)}}const Bae={poxAddress:"",rewardCycleId:0,signerKey:"",signerSignature:"",maxAmount:"",authId:""};function jae(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(Dae,{client:e})}function Dae({client:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(),o=Pt(),{btcAddressP2wpkh:a}=Mn(),u=Gu(),l=rn(),f=ci(),p=Sk();if(u.isLoading||l.isLoading||f.isLoading||p.isLoading)return d.jsx(br,{});if(u.isError||typeof u.data!="number"||l.isError||!l.data||f.isError||typeof f.data.stx.balance!="string"||p.isError||!p.data){const w="Failed to load necessary data.",b="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(b,w),d.jsx(Mt,{id:b,children:w})}const m=Mae({network:o}),y=Lae({client:e,poxOperationInfo:p.data,setIsContractCallExtensionPageOpen:n,setTxResult:i});return d.jsx(Bi,{initialValues:{...Bae,poxAddress:a??"",rewardCycleId:l.data.reward_cycle_id+1},onSubmit:w=>{y(w)},validationSchema:m,children:d.jsx(pp,{intro:d.jsx(hp,{estimatedStackingMinimum:BigInt(l.data.min_amount_ustx),timeUntilNextCycle:u.data,children:"You need to finalized each cycle."}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(Pae,{})})}),poolAdminForm:d.jsx(ui,{children:d.jsxs(d.Fragment,{children:[d.jsxs(Kl,{children:[d.jsx(Q5,{}),d.jsx(Ef,{}),d.jsx(zg,{}),d.jsx(fp,{isLoading:t,title:"Stack Aggregation Commit",actionLabel:"Finalize cycle"})]}),r&&d.jsx(Ug,{txResult:r})]})})})})}function Jae(){const[e,t]=$t("rewardCycleIndex");return d.jsxs(Sn,{title:"Choose Reward Cycle Index",children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsx(ie,{color:ce("text-caption"),children:"The reward cycle index is the identifier of your stacking. It is returned by Stack Aggegation Commit action."})})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"rewardCycleIndex",placeholder:"Indentifier for the cycle",mt:"loose",...e}),(t.touched||e)&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})})]})]})}function $ae(){const e=ar(),{rewardCycleId:t,rewardCycleIndex:n,poxAddress:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u}=e.values;return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You'll increase Stacking for"}),d.jsxs(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",children:["Cycle ",t]})]}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Reward Cycle Index"}),d.jsx(Ge,{children:n||"—"})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool PoX address"}),d.jsx(Ge,{children:r?Mi(r):"—"})]})}),d.jsx(Nb,{signatureData:o&&i?{signature:o,publicKey:i,maxAmount:a,authId:u}:void 0})]})]})})}function qae({network:e}){return li().shape({rewardCycleId:Wr().defined().test("matches-signature-reward-cycle","Reward cycle does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return parseInt(r.rewardCycle,10)===t}),poxAddress:Ql({network:e.networkName}).test("matches-signature-pox-address","BTC Address does not match signature data",function(t){const n=this.parent.signatureJSON;return typeof n!="string"?!0:qn.json().cast(n).poxAddress===t}),signerKey:wf().required(),signerSignature:wf().test("matches-topic","Signature was not generated for stack-aggregation-increase",function(t){const n=this.parent.signatureJSON;return typeof n!="string"?!0:qn.json().cast(n).method==="agg-increase"}).test("valid-signature","Unable to validate signature",function(t,n){if(typeof t!="string")return!0;const r={topic:"agg-increase",rewardCycle:n.parent.rewardCycleId,poxAddress:n.parent.poxAddress,authId:n.parent.authId,network:e.network,publicKey:n.parent.signerKey,signature:t,period:1,maxAmount:Vr(n.parent.maxAmount)};return Vl(r)}),maxAmount:cn().defined().test("matches-signature-max-amount","Max amount does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return Pi(r.maxAmount).isEqualTo(Pi(Vr(t)))}),signatureJSON:cn(),authId:Wr().defined().test("matches-signature","Auth ID does not match signature data",function(t){const n=this.parent.signatureJSON;if(typeof n!="string")return!0;const r=qn.json().cast(n);return BigInt(r.authId)===BigInt(t)})})}function Uae({client:e,poxOperationInfo:t,setIsContractCallExtensionPageOpen:n,setTxResult:r}){return async function(o){const[a]=await Promise.all([e.getStackingContract()]),u=t.current===t.pox4,l=parseInt(o.authId,10),f=Vr(o.maxAmount);typeof o.signerSignature=="string"&&(Vl({topic:"agg-increase",poxAddress:o.poxAddress,rewardCycle:o.rewardCycleId,authId:l,maxAmount:f,period:1,network:e.network,publicKey:o.signerKey,signature:o.signerSignature})?console.log("Signature is valid"):console.warn("Unable to verify signature."));const p=e.getStackAggregationIncreaseOptions({contract:a,poxAddress:o.poxAddress,rewardCycle:o.rewardCycleId,rewardCycleIndex:o.rewardCycleIndex,signerKey:u?o.signerKey:void 0,signerSignature:u?o.signerSignature:void 0,maxAmount:f,authId:l});bk({...p,onFinish(m){r(m),n(!1)},onCancel(){n(!1)}}),n(!0)}}const Hae={poxAddress:"",rewardCycleId:0,rewardCycleIndex:0,signerKey:"",signerSignature:"",maxAmount:"",authId:""};function zae(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(Wae,{client:e})}function Wae({client:e}){const[t,n]=$.useState(!1),[r,i]=$.useState(),o=Pt(),{btcAddressP2wpkh:a}=Mn(),u=Gu(),l=rn(),f=ci(),p=Sk();if(u.isLoading||l.isLoading||f.isLoading||p.isLoading)return d.jsx(br,{});if(u.isError||typeof u.data!="number"||l.isError||!l.data||f.isError||typeof f.data.stx.balance!="string"||p.isError||!p.data){const w="Failed to load necessary data.",b="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(b,w),d.jsx(Mt,{id:b,children:w})}const m=qae({network:o}),y=Uae({client:e,poxOperationInfo:p.data,setIsContractCallExtensionPageOpen:n,setTxResult:i});return d.jsx(Bi,{initialValues:{...Hae,poxAddress:a??"",rewardCycleId:l.data.reward_cycle_id+1},onSubmit:w=>{y(w)},validationSchema:m,children:d.jsx(pp,{intro:d.jsx(hp,{estimatedStackingMinimum:BigInt(l.data.min_amount_ustx),timeUntilNextCycle:u.data,children:"You need to finalized each cycle."}),poolAdminPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx($ae,{})})}),poolAdminForm:d.jsx(ui,{children:d.jsxs(d.Fragment,{children:[d.jsxs(Kl,{children:[d.jsx(Q5,{}),d.jsx(Jae,{}),d.jsx(Ef,{}),d.jsx(zg,{}),d.jsx(fp,{isLoading:t,title:"Stack Aggregation Increase",actionLabel:"Increase Stacking Amount"})]}),r&&d.jsx(Ug,{txResult:r})]})})})})}const Vae=()=>d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM3 8C3 10.7614 5.23858 13 8 13C9.01911 13 9.967 12.6951 10.7574 12.1716L3.82843 5.24255C3.30489 6.033 3 6.98089 3 8ZM8 3C6.98089 3 6.033 3.30489 5.24255 3.82843L12.1716 10.7574C12.6951 9.967 13 9.01911 13 8C13 5.23858 10.7614 3 8 3Z",fill:"#74777D"})});function Gk({stackerInfoDetails:e,poxAddress:t}){const n=rn(),r=e.first_reward_cycle+e.lock_period-1,i=n.data&&n.data.current_cycle.id>=r,o=n.data&&n.data.current_cycle.id>=e.first_reward_cycle;return d.jsxs(d.Fragment,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{explainer:o?`Rewards became active in cycle ${e.first_reward_cycle}`:`Rewards will become active in cycle ${e.first_reward_cycle}`,children:"Rewards active?"}),d.jsx(Ge,{color:ce(o?"feedback-success":"feedback-alert"),children:o?"Yes":"No"})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Start"}),d.jsxs(Ge,{children:["Cycle ",e.first_reward_cycle," "]})]}),d.jsxs(Me,{children:[d.jsx(Ve,{explainer:i?"STX will unlock after the current cycle. For continous stacking, you need to extend your pooled stacking.":"STX will unlock after that cycle",children:"End"}),d.jsxs(Ge,{color:i?ce("feedback-error"):void 0,children:["Cycle ",r]})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool reward address"}),d.jsx(Ge,{children:d.jsx(co,{address:t})})]})]})}function Gae({handleKeepPoolingClick:e,handleStopPoolingClick:t,handleDelegateAgainClick:n,isSelfService:r}){return d.jsx(Ln,{children:d.jsx(fe,{mx:["loose","extra-loose"],children:d.jsxs(xe,{flexDirection:"column",pt:"loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"Increase pooling amount"}),r?d.jsxs(d.Fragment,{children:[d.jsx(ie,{py:"loose",children:"To increase the amount of STX you can just delegate a higher amount for the next cycle."}),d.jsxs(It,{children:[d.jsx(St,{mode:"tertiary",onClick:e,children:"Keep same amount"}),d.jsx(St,{onClick:n,children:"Delegate again"})]})]}):d.jsxs(d.Fragment,{children:[d.jsx(ie,{py:"loose",children:"To increase the amount of STX you must first stop the current pool and start pooling again, your pool operator can then lock a higher amount for the next cycles."}),d.jsxs(It,{children:[d.jsx(St,{mode:"tertiary",onClick:e,children:"Keep pooling"}),d.jsx(St,{onClick:t,children:"I understand I want to stop pooling"})]})]})," "]})})})}function X5({extendedStxBalances:e}){var i;const n=(i=db().data)==null?void 0:i.burn_block_height;let r="0";if(n&&e){const o=e.burnchain_unlock_height-e.burnchain_lock_height;if(o>0){const a=e.burnchain_unlock_height-n;r=Math.max((o-a)/o*100,0).toFixed(2)}}return d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"This percentage measures the number of blocks between when you locked STX to when your STX are unlocked",children:"Progress"}),d.jsxs(Ge,{children:[r,"%"]})]})}function Kae({networkName:e}){return li().shape({stacker:Vk(cn(),e)})}function Qae({navigate:e,setIsContractCallExtensionPageOpen:t,delegatedTo:n,network:r}){return async({stacker:i})=>{const[o,a]=ju(r)[n].split("."),u={contractAddress:o,contractName:a,functionName:"delegate-stack-stx",functionArgs:[no(i)],network:r};t(!0),Do({...u,onCancel(){t(!1)},onFinish(){t(!1),e(Nr.POOLED_STACKING_INFO)}})}}function Yae(e,t){const n=t.reward_cycle_length/2,r=t.reward_cycle_length-(e-t.first_burnchain_block_height+n-1)%t.reward_cycle_length,i=r-n-t.prepare_phase_block_length-1,o=r=n}function Xae(){var u;const e=Yn(),t=rn(),r=(u=db().data)==null?void 0:u.burn_block_height;if(!t.data||!r)return d.jsx(d.Fragment,{});const{extendWindow:i,tooEarly:o,tooLate:a}=Yae(r,t.data);return d.jsxs(d.Fragment,{children:[o||a?d.jsxs(Me,{children:[d.jsxs(Ve,{children:["Extend to cycle ",t.data.current_cycle.id+1," in"]}),d.jsxs(Ge,{children:[i.blocksUntilStart," blocks"]})]}):d.jsxs(Me,{children:[d.jsx(Ve,{children:"Time left to extend"}),d.jsxs(Ge,{children:[i.blocksUntilEnd," blocks"]})]}),d.jsx(Me,{justifyContent:"space-evenly",children:d.jsx(St,{isDisabled:o||a,onClick:()=>e(Nr.SELF_SERVICE_EXTEND),children:"Extend pooled stacking"})})]})}function Zae({delegationInfoDetails:e,poolAddress:t,isContractCallExtensionPageOpen:n,handleStopPoolingClick:r,extendedStxBalance:i,stackerInfo:o}){const a=Yn(),u=o.stacked,[l,f]=$.useState(!1),{network:p}=Pt(),m=e.delegated_to===ju(p)[wt.WrapperFastPool]||e.delegated_to===ju(p)[wt.WrapperRestake];return d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You're pooling"}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",mb:"extra-loose",children:Jt(e.amount_micro_stx)}),d.jsx(Pn,{}),d.jsx(wr,{my:"extra-loose",children:d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{children:"Status"}),d.jsx(Ge,{color:u?"green":ce("text-caption"),children:u?"Active":"Waiting on pool"})]}),d.jsx(X5,{extendedStxBalances:i}),u&&d.jsxs(d.Fragment,{children:[d.jsx(Gk,{stackerInfoDetails:o.details,poxAddress:Jl(p,o.details.pox_address)}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Stacked amount"}),d.jsx(Ge,{children:Jt(Yt(i.locked))})]})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Type"}),d.jsx(Ge,{children:e.until_burn_ht?"Limted permission":"Indefinite permission"})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool address"}),d.jsx(Ge,{children:d.jsx(co,{address:t})})]}),m&&u&&!l&&d.jsx(Xae,{}),l?d.jsx(Gae,{isSelfService:m,handleStopPoolingClick:()=>{f(!1),r()},handleKeepPoolingClick:()=>f(!1),handleDelegateAgainClick:()=>a(Nr.START_POOLED_STACKING)}):d.jsx(Me,{justifyContent:"space-evenly",children:d.jsx(St,{mode:"tertiary",onClick:()=>f(!0),children:"Increase pooling amount"})})]})}),d.jsx(Pn,{}),d.jsx(wr,{my:"extra-loose",children:d.jsx(bt,{children:!l&&d.jsx(Me,{children:d.jsx(Ve,{children:d.jsxs(St,{variant:"link",isDisabled:n,onClick:()=>{r()},color:ce("text-caption"),children:[d.jsx(fe,{pr:"tight",children:d.jsx(Vae,{})})," ","Stop pooling"]})})})})})]})}function ece({isContractCallExtensionPageOpen:e,handleStopPoolingClick:t}){return d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"display.large",children:"You've finished pooling"}),d.jsx(ie,{pb:"base-loose",children:"Revoke the pool's permission to stack on your behalf to start stacking again."}),d.jsx(fe,{children:d.jsx(St,{disabled:e,onClick:()=>{t()},children:"Revoke permission"})})]})}function xw({to:e,children:t,...n}){return d.jsx(fe,{display:"inline",cursor:"pointer",outline:0,color:ce("brand"),_hover:{textDecoration:"underline"},_focus:{textDecoration:"underline"},...n,children:d.jsx(Ah,{to:e,children:t})})}function tce({extendedStxBalances:e,poolAddress:t}){return d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"display.large",children:"You're pooling"}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",my:"extra-loose",children:Jt(Yt(e.locked))}),d.jsx(Pn,{}),d.jsxs(wr,{my:"extra-loose",children:[d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{children:"Status"}),d.jsx(Ge,{color:"green",children:"Active"})]}),d.jsx(X5,{extendedStxBalances:e})]}),t&&d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool address"}),d.jsx(Ge,{children:d.jsx(co,{address:t})})]})}),d.jsx(bt,{children:d.jsxs(Fi,{icon:d.jsx(Oh,{}),children:["You've revoked the pool's delegation. You may want to"," ",d.jsx(Li,{display:"inline",to:"../start-pooled-stacking",as:xw,color:ce("brand"),children:"start pooling"})," ","again or"," ",d.jsx(Li,{display:"inline",to:"../choose-stacking-method",as:xw,color:ce("brand"),children:"choose a different stacking method"}),"."]})})]})]})}function nce(){return d.jsx(xe,{height:"100%",justify:"center",align:"center",m:"loose",children:d.jsx(Ln,{p:"extra-loose",width:["360px","360px","360px","420px"],children:d.jsx(Fi,{icon:d.jsx(Oh,{}),children:d.jsxs(It,{children:[d.jsx(ie,{children:"It appears that you're not pooling yet. If you recently started to pool, your pooling info will appear here in a few seconds."}),d.jsxs(ie,{children:["You may want to"," ",d.jsx(Li,{display:"inline",to:"../start-pooled-stacking",as:xw,color:ce("brand"),children:"start pooling"})," ","or"," ",d.jsx(Li,{display:"inline",to:"../choose-stacking-method",as:xw,color:ce("brand"),children:"choose your stacking method"}),"."]})]})})})})}function rce(){var u,l,f,p;const{client:e}=kn(),{address:t}=Mn(),{transactionsApi:n}=Qw();if(!e)throw new Error("Expected to have a StackingClient available in the context.");if(!t)throw new Error("Expected `address` to be defined.");const r=ci(),i=mb(),o=(l=(u=r.data)==null?void 0:u.stx)==null?void 0:l.lock_tx_id,a=(f=i.data)!=null&&f.delegated?(p=i.data)==null?void 0:p.details.delegated_to:void 0;return yr(["stacker",{txId:o,poolAddress:a}],async({queryKey:m})=>{const{txId:y,poolAddress:w}=m[1];return w?{poolAddress:w}:y?{address:(await n.getTransactionById({txId:y})).sender_address}:{address:null}},{enabled:!r.isLoading&&!i.isLoading})}function ice(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.";return console.error(t),d.jsx(Mt,{id:"6f080d24-1e87-45ab-b8f7-41ba9bd53e97",children:t})}return d.jsx(oce,{client:e})}function oce({client:e}){const[t,n]=$.useState(!1),r=mb(),i=Bg(),o=ci(),a=db(),u=rn(),l=rce();if(r.isLoading||i.isLoading||o.isLoading||a.isLoading||l.isLoading||l.isFetching||u.isLoading)return d.jsx(br,{});if(r.isError||!r.data||i.isError||!i.data||o.isError||!o.data||l.isError||!l.data||a.isError||!a.data||u.isError||!u.data){const w="Error while loading data, try reloading the page.";return console.error(w),d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:w})})}const f=i.data.stacked,p=l.data.address||(r.data.delegated?r.data.details.delegated_to:void 0);if(!r.data.delegated&&!f||!p)return d.jsx(nce,{});const m=r.data.delegated&&r.data.details.until_burn_ht!==void 0&&!Number.isNaN(r.data.details.until_burn_ht)&&r.data.details.until_burn_hto(!0),children:"Lock for other pool members"})})]}):d.jsxs(d.Fragment,{children:[d.jsx(ie,{py:"loose",children:"You are not part of a pool."}),d.jsx(Me,{m:"loose",justifyContent:"space-evenly",children:d.jsx(St,{onClick:()=>o(!0),children:"Lock for other pool members"})})]})}function ace({address:e,stackerInfoDetails:t,delegationStatus:n,requiresExtension:r}){const{network:i}=Pt();if(!n.delegated)return d.jsxs(Mt,{children:["User ",Mi(e)," is not part of any pool."]});const o=n.details.delegated_to,a=UP(o),u=n.details.pox_address?Jl(i,{version:new Uint8Array([n.details.pox_address.version]),hashbytes:n.details.pox_address.hashbytes}):void 0,l=t!=null&&t.pox_address?Jl(i,t.pox_address):void 0;return r?d.jsxs(d.Fragment,{children:[t&&l&&d.jsx(Gk,{stackerInfoDetails:t,poxAddress:l}),a?d.jsxs(d.Fragment,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{children:"Pool address"}),d.jsx(Ge,{children:d.jsx(co,{address:o})})]}),u&&d.jsxs(Me,{children:[d.jsx(Ve,{children:"Required pool reward address"}),d.jsx(Ge,{children:d.jsx(co,{address:u})})]}),d.jsx(Pn,{}),d.jsx(ie,{children:"Lock their delegated STX for 1 more cycle."})]}):d.jsx(Fi,{children:d.jsx(kf,{children:"User is not stacking with a Self-Service Pool."})})]}):d.jsx(ie,{children:"User is already stacking for the next cycle. No need to lock again now."})}function cce({onClose:e,isContractCallExtensionPageOpen:t}){const[n,r]=$.useState(!1),[i,o]=$t("stacker"),{network:a}=Pt(),u=i.value,l=new _f({address:u,network:a}),f=uZ(l),p=rn(),m=gb({client:l,address:u,network:a});if(p.isError||!p.data||m.isError||!m.data||f.isError||!f.data)return d.jsx(br,{});const y=f.data.stacked?f.data.details:void 0,w=y?Z5(y,p.data):!0,b=m.data;return d.jsxs(d.Fragment,{children:[n?d.jsx(ace,{address:u,stackerInfoDetails:y,delegationStatus:b,requiresExtension:w}):d.jsx(ie,{children:"Enter the Stacks address of a pool member to lock their delegated STX for 1 more cycle."}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"stacker",placeholder:"Stacks address",mt:"loose",isDisabled:n,...i}),o.touched&&o.error&&d.jsx(wn,{children:d.jsx(bn,{children:o.error})})]}),d.jsxs(Me,{m:"loose",justifyContent:"space-between",children:[d.jsx(St,{mode:"tertiary",onClick:e,children:"Cancel"}),n?d.jsxs(St,{type:"submit",isLoading:t,isDisabled:!w||!b.delegated,children:[d.jsx(fe,{mr:"loose",children:d.jsx(ps,{})}),"Lock STX"]}):d.jsx(St,{onClick:x=>{x.preventDefault(),r(!0)},children:"Preview"})]})]})}function uce({stackerInfoDetails:e,showExtendForOtherUser:t,lockedBalance:n}){return d.jsx(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:e&&!t?d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You're stacking"}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",children:Jt(n)})]}):d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.large.medium",children:"Self-service pooling with"}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",children:"Fast Pool"})]})})}function lce(e){const{currentUser:t,stackerInfoDetails:n,poxInfo:r,lockedBalance:i,isContractCallExtensionPageOpen:o}=e,[a,u]=$.useState(!1),l=Yn(),{poxDisabled:f}=hb(),p=()=>{l(Nr.POOLED_STACKING_INFO)},m=n?"Extend stacking":"Stack again";return d.jsx(lp,{title:m,isShowing:!f,onClose:p,children:d.jsx(xe,{alignItems:"center",flexDirection:"column",pb:["loose","48px"],px:"loose",children:d.jsx(Ln,{width:"420px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsx(uce,{stackerInfoDetails:n,showExtendForOtherUser:a,lockedBalance:i}),d.jsx(Pn,{}),d.jsx(wr,{pt:"base-loose",children:d.jsx(bt,{children:a?d.jsx(cce,{onClose:p,isContractCallExtensionPageOpen:o}):d.jsx(sce,{poxInfo:r,address:t,stackerInfoDetails:n,onClose:p,isContractCallExtensionPageOpen:o,setShowExtendForOtherUser:u})})})]})})})})}function dce(){var O,N,E,T;const e=Yn(),t=Bg(),n=mb(),r=vk(),i=rn(),{client:o}=kn(),{address:a}=Mn(),{network:u,networkName:l}=Pt(),[f,p]=$.useState(!1);if(t.isLoading||n.isLoading||r.isLoading||i.isLoading)return d.jsx(br,{});if(a===null)return d.jsx(Mt,{children:d.jsx(ie,{children:" Authentication required"})});if(t.isError||!t.data||r.isError||typeof r.data!="bigint"||i.isError||!i.data||n.isError||!n.data||!o){const B="Error while loading data, try reloading the page.";return console.error(B),d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:B})})}const m=(O=t.data)!=null&&O.stacked?(N=t.data)==null?void 0:N.details:void 0,y=(E=n.data)!=null&&E.delegated?(T=n.data)==null?void 0:T.details:void 0,w=ju(u);let b;switch(y==null?void 0:y.delegated_to){case w[wt.WrapperFastPool]:b=wt.WrapperFastPool;break;case w[wt.WrapperRestake]:b=wt.WrapperRestake;break;default:b=void 0}if(b===void 0)return d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:"Not pooling with a self-service pool"})});const x=Kae({networkName:l}),_=Qae({navigate:e,setIsContractCallExtensionPageOpen:p,delegatedTo:b,network:u});return d.jsx(Bi,{initialValues:{stacker:a||""},onSubmit:_,validationSchema:x,children:d.jsx(ui,{children:d.jsx(lce,{currentUser:a,stackerInfoDetails:m,lockedBalance:r.data,poxInfo:i.data,isContractCallExtensionPageOpen:f})})})}function fce(){kn();const[e,t]=$.useState(null),n=Pt();return{openSignatureRequest:$.useCallback(async i=>{const{message:o,domain:a}=ak({topic:i.topic,period:i.period,network:n.network,rewardCycle:i.rewardCycle,poxAddress:i.poxAddress,maxAmount:i.maxAmount,authId:i.authId});await ZX({domain:a,message:o,onFinish:u=>{console.log("signature done",u);const l=Vl({topic:i.topic,period:i.period,network:n.network,rewardCycle:i.rewardCycle,poxAddress:i.poxAddress,signature:u.signature,publicKey:u.publicKey,maxAmount:i.maxAmount,authId:i.authId});console.log(l),t(u)}})},[n.network,t]),signatureData:e}}function hce(){const[e,t,n]=$t("authId"),r=lt.useCallback(()=>{n.setValue(Math.floor(Math.random()*1e7))},[n]);return d.jsxs(Sn,{title:"Auth ID",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:"A random number that is used to prevent re-use of the signature"})}),d.jsxs(fe,{position:"relative",my:"loose",children:[d.jsx(sr,{id:"authId",placeholder:"Authorisation id",...e}),t.touched&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})}),d.jsx(St,{type:"button",mode:"tertiary",size:"sm",height:"28px",right:"12px",top:"10px",style:{position:"absolute"},width:"110px",onClick:r,children:"Random"})]})]})}function pce(){const e=rn(),[t,n]=$t("rewardCycleId"),[r,i]=$t("topic");if(e.isError||!e.data){const o="134098d7-444b-4591-abfe-8767af6def3f",a="Failed to load necessary data.";return console.error(o,a),d.jsx(bs,{id:o,children:a})}return d.jsxs(Sn,{title:"Choose reward cycle",children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsxs(ie,{color:ce("text-caption"),children:["Next cycle is ",e.data.reward_cycle_id+1]})})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"rewardCycle",placeholder:"Next cycle",mt:"loose",...t}),(n.touched||i.touched)&&n.error&&d.jsx(wn,{children:d.jsx(bn,{children:n.error})})]})]})}function mce(){const[e,t,n]=$t("maxAmount"),r=lt.useCallback(()=>{n.setValue(Sg.toString())},[n]);return d.jsxs(Sn,{title:"Max Amount",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:"Enter the maximum amount of STX that can be locked while using this signature"})}),d.jsxs(fe,{position:"relative",my:"loose",children:[d.jsx(sr,{id:"maxAmount",placeholder:"Maximum amount of STX to lock",...e}),t.touched&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})}),d.jsx(St,{type:"button",mode:"tertiary",size:"sm",height:"28px",right:"12px",top:"10px",style:{position:"absolute"},width:"110px",onClick:r,isDisabled:e.value===Sg.toString(),children:"Max Amount"})]})]})}function gce(){const[e,t]=$t("topic"),[n,r,i]=$t("period");return lt.useEffect(()=>{(e.value==="agg-commit"||e.value==="agg-increase")&&i.setValue(1)},[e.value,i]),d.jsxs(Sn,{title:"Topic",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:"Select the topic (stacking method) for this signature"})}),d.jsx(fe,{border:"1px solid var(--colors-border)",borderRadius:"5px",padding:"14px 16px",my:"loose",children:d.jsxs("select",{...e,id:"topic",name:"topic",value:e.value,style:{background:"none",width:"100%",color:ce("text-caption"),fontSize:"14px"},children:[d.jsx("option",{value:"stack-stx",children:"stack-stx"}),d.jsx("option",{value:"agg-commit",children:"stack-aggregation-commit"}),d.jsx("option",{value:"stack-extend",children:"stack-extend"}),d.jsx("option",{value:"stack-increase",children:"stack-increase"}),d.jsx("option",{value:"agg-increase",children:"stack-aggregation-increase"})]})})]})}function yce({signatureData:e}){var y;const{values:t,isValid:n}=ar(),{poxAddress:r,topic:i,period:o,rewardCycleId:a,authId:u,maxAmount:l}=t,f=rn(),p=$.useMemo(()=>{if(!e)return"";const w={signerKey:e.publicKey,signerSignature:e.signature,authId:u,rewardCycle:a.toString(),maxAmount:Vr(l),period:o.toString(),poxAddress:r,method:i};return JSON.stringify(w,null,2)},[e,l,u,o,r,i,a]),{onCopy:m}=rP(p);return d.jsx(Tb,{pt:"80px",mb:"extra-loose",children:d.jsxs(xe,{flexDirection:["column-reverse","column-reverse","row"],justifyContent:"space-between",children:[d.jsxs(fe,{maxWidth:[null,null,"544px"],mr:[null,null,"extra-loose"],children:[d.jsx(Jo,{children:"Generate a signer key signature"}),d.jsx(ie,{textStyle:"body.large",display:"block",color:ce("text-caption"),mt:4,children:"When making certain Stacking transactions, it's required that you provide a signature and other information to ensure that the signer you're using is authorizing the transaction."}),d.jsxs(Kl,{children:[d.jsx(pce,{}),d.jsx(Ef,{description:"Enter the bitcoin address you use for stacking or the bitcoin address of a stacker using your signing service."}),d.jsx(gce,{}),d.jsx(mce,{}),d.jsx(hce,{}),d.jsx(Uk,{fieldName:"period"}),d.jsx(fp,{isLoading:!1,title:"Submit",actionLabel:"Generate Signature",isDisabled:!n})]})]}),d.jsx(fe,{children:d.jsx(vs,{children:d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],maxWidth:[null,null,"400px"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"Signature details"}),d.jsx(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em"})]}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{children:"Reward Cycle"}),d.jsx(Ge,{children:a})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Current cycle"}),d.jsx(Ge,{children:(y=f.data)==null?void 0:y.current_cycle.id})]})]}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Topic"}),d.jsx(Ge,{children:d.jsx(ie,{fontFamily:"monospace",children:i})})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Cycles"}),d.jsx(Ge,{children:o})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Bitcoin address"}),d.jsx(Ge,{children:r?Mi(r):"—"})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"The maximum amount of STX that can be locked while using this signature",children:"Max Amount"}),d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:l===Sg?"MAX":l})})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Auth ID"}),d.jsx(Ge,{children:d.jsx(ie,{textStyle:"caption",overflowWrap:"anywhere",fontFamily:"monospace",children:u})})]})}),d.jsx(d.Fragment,{children:e===null?null:d.jsxs(d.Fragment,{children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Signer Details to share with Stackers"}),d.jsx(fe,{display:"inline-block",cursor:"pointer",ml:"5px",onClick:m,children:d.jsx(JP,{size:16})})]})}),d.jsx(Nb,{signatureData:{...e,maxAmount:l,authId:u}})]})})]})]})})})})]})})}function wce({network:e,currentCycle:t}){return li().shape({topic:cn().oneOf(["stack-extend","agg-commit","stack-stx","stack-increase","agg-increase"],"Invalid topic"),poxAddress:Ql({network:e}),period:Wr().defined().test({name:"is-1-if-agg-commit",message:"Period must be 1 for pooled Stacking functions",test:(n,r)=>{const{topic:i}=r.parent;return i==="agg-commit"||i==="agg-increase"?n===1:!0}}),rewardCycleId:Wr().required("Reward cycle is required").test("is-in-future","Reward cycle must be in the future for pool functions",function(n){const r=this.parent.topic;return r==="agg-commit"||r==="agg-increase"?n>t:!0}).test("is-now-for-solo-stacking","Reward cycle must be the current cycle for solo stacking signatures",function(n){const r=this.parent.topic;return r==="stack-stx"||r==="stack-extend"||r==="stack-increase"?n===t:!0}),authId:Wr().required("Auth ID is required").positive("Auth ID must be a positive integer").test("is-int","Auth ID must be an integer",n=>typeof n>"u"?!1:Number.isInteger(n)),maxAmount:cn().required("Max amount is required").test("is-u128","Amount too high",n=>{try{return typeof n>"u"?!1:Iae.gte(Pi(n))}catch{return!1}})})}const bce={topic:Zi.StackStx,period:1,rewardCycleId:1,poxAddress:"bc1qultv5ks9qcyxxwcnkfmpdh4y9u0tpw6s4mng7v",maxAmount:Sg.toString(),authId:""};$.createContext({signature:null});function Sce(){const{topic:e}=VI(),t=$.useMemo(()=>e===Zi.AggregateCommit?Zi.AggregateCommit:e===Zi.StackExtend?Zi.StackExtend:e===Zi.StackStx?Zi.StackStx:e===Zi.AggregateIncrease?Zi.AggregateIncrease:(e&&console.warn(`Received invalid topic parameter: ${e}`),Zi.StackStx),[e]),n=$.useMemo(()=>Math.floor(Math.random()*1e6),[]),r=rn(),{btcAddressP2wpkh:i}=Mn(),{openSignatureRequest:o,signatureData:a}=fce(),{networkName:u}=Pt();if(r.isLoading)return d.jsx(br,{});if(r.isError||!r.data){const f="Failed to load necessary data.",p="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(p,f),d.jsx(Mt,{id:p,children:f})}const l=wce({network:u,currentCycle:r.data.current_cycle.id});return d.jsx(Bi,{initialValues:{...bce,poxAddress:i??"",rewardCycleId:r.data.reward_cycle_id,topic:t,authId:n},onSubmit:async f=>{console.log("values",f),console.log(Pi(f.maxAmount).toFixed(6)),await o({poxAddress:f.poxAddress,period:f.period,rewardCycle:f.rewardCycleId,topic:f.topic,maxAmount:Vr(f.maxAmount),authId:f.authId})},validationSchema:l,children:d.jsx(ui,{children:d.jsx(yce,{signatureData:a})})})}function vce(){const e=Yn();return d.jsx(Tb,{pt:"80px",mb:"extra-loose",children:d.jsx(xe,{flexDirection:["column-reverse","column-reverse","row"],justifyContent:"space-between",children:d.jsxs(fe,{maxWidth:[null,null,"544px"],mr:[null,null,"extra-loose"],children:[d.jsx(Jo,{children:"Signer Details"}),"As a signer, you contribute to the consensus of the Stacks blockchain.",d.jsx(fe,{mt:["extra-loose",null,null,null,"base"],children:"Stackers can add their Stacked STX to your signing service. For that, you need to provide a signature for each stacker."}),d.jsx(St,{mt:"loose",onClick:()=>e("./generate-signature"),children:"Generate Signatures"})]})})})}function xce(){return d.jsx(vce,{})}function Z1(e){return Object.keys(e).length>0}function _ce(e){const{title:t,details:n,pendingStackExtend:r,isContractCallExtensionPageOpen:i}=e,{poxDisabled:o}=hb(),a=Yn(),{network:u}=Pt(),l=Jl(u,n.pox_address),{errors:f}=ar(),[p,m,y]=$t("extendCycles"),w=()=>{a(Nr.DIRECT_STACKING_INFO)},b=n.first_reward_cycle+n.lock_period-1+p.value,x=$.useMemo(()=>{if(Z1(f))return Object.entries(f).map(([_,O])=>`${_}: ${O}`).join(` +`)},[f]);return $.useEffect(()=>{x&&console.error(x)},[x]),d.jsx(lp,{title:t,isShowing:!o,onClose:w,children:d.jsx(xe,{alignItems:"center",flexDirection:"column",pb:["loose","48px"],px:"loose",children:d.jsx(Ln,{width:"420px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You're stacking"}),d.jsxs(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",children:["for ",n.lock_period," cycles"]})]}),d.jsx(Pn,{}),r&&d.jsx(j5,{pendingStackExtend:r}),d.jsx(Cn,{children:d.jsx(ie,{children:"Increase the amount of cycles you want to lock your STX. Currently each cycle lasts around 15 days and the maximum locked period is 12 cycles."})}),d.jsx(xe,{justifyContent:"center",children:d.jsx(qk,{mt:"loose",amount:p.value,onIncrement:_=>{_>Ww||(y.setTouched(!0),y.setValue(_))},onDecrement:_=>{_t<=12}),poxAddress:Ql({network:e})})}function Rce({client:e,navigate:t,setIsContractCallExtensionPageOpen:n}){return async({extendCycles:r,poxAddress:i,signerKey:o,signerSignature:a,maxAmount:u,authId:l})=>{if(!e)return;const f=await e.getStackingContract(),p=Vr(u),m=e.getStackExtendOptions({contract:f,extendCycles:r,poxAddress:i,signerKey:o,signerSignature:a,maxAmount:p,authId:parseInt(l)});n(!0),Do({...m,onCancel(){n(!1)},onFinish(){n(!1),t(Nr.DIRECT_STACKING_INFO)}})}}function Tce(){const e=Yn(),t=Bg(),{getHasPendingStackExtendQuery:n}=xb(),{client:r}=kn(),{network:i,networkName:o}=Pt(),[a,u]=$.useState(!1);if(t.isLoading||n.isLoading)return d.jsx(br,{});if(t.isError||!t.data||n.isError||n.data===void 0||!r){const m="Error while loading data, try reloading the page.";return console.error(m),d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:m})})}if(!t.data.stacked)return d.jsx(Mt,{children:d.jsx(ie,{children:"Not stacking"})});const l=t.data.details,f=Rce({client:r,navigate:e,setIsContractCallExtensionPageOpen:u}),p=kce({network:o});return d.jsx(Bi,{initialValues:{poxAddress:Jl(i,l.pox_address),extendCycles:12-l.lock_period,signerKey:"",signerSignature:"",maxAmount:"",authId:""},onSubmit:f,validationSchema:p,children:d.jsx(ui,{children:d.jsx(_ce,{title:"Continue stacking",details:l,pendingStackExtend:n.data,isContractCallExtensionPageOpen:a})})})}function Oce(){return $.useMemo(()=>({feeRate:bW}),[])}function e6(){const{feeRate:e}=Oce();return $.useCallback(t=>BigInt(new Qt(e).multipliedBy(t).toString()),[e])}function Nce({pendingStackIncrease:e}){return d.jsx(fe,{pb:"base-loose",children:d.jsx(Fi,{icon:d.jsx(cg,{}),title:"Waiting for transaction confirmation",children:d.jsxs(kf,{children:["A stacking request was successfully submitted to the blockchain. Once confirmed, an additional amount of ",Jt(e.increaseBy)," will be stacking."]})})})}function t6(e){return{name:"test-balance",message:"Amount must be lower than balance",test:t=>t===void 0?!1:Un(t).isLessThanOrEqualTo(new Qt(e.toString()))}}function Cce({availableBalanceUStx:e,transactionFeeUStx:t,network:n,rewardCycleId:r,stackerInfo:i}){if(!i.stacked)throw new Error("User is not stacked - cannot increase");const o=i.details.lock_period;return li().shape({increaseBy:mp().test(t6(BigInt(e.toString()))).test("test-precision","You cannot stack with a precision of less than 1 STX",a=>a===void 0?!0:Ob(0)(a)).test({name:"test-fee-margin",message:"You must stack less than your entire balance to allow for the transaction fee",test:a=>a==null?!1:!Un(a).isGreaterThan(new Qt(e.toString()).minus(t.toString()))}),signerSignature:wf().test("matches-topic","Signature was not generated for stack-stx",function(a){const u=this.parent.signatureJSON;return typeof u!="string"?!0:qn.json().cast(u).method==="stack-increase"}).test("matches-lock-period",`"Period" argument when generating signature must match current lock period (${o})`,function(a){const u=this.parent.signatureJSON;if(typeof u!="string")return!0;const l=qn.json().cast(u);return parseInt(l.period,10)!==i.details.lock_period?this.createError({message:`"Period" argument when generating signature was ${l.period}, but it must match current lock period (${o})`,path:"signerSignature"}):!0}).test("valid-signature","Unable to validate signature",function(a,u){const l=u.parent.signatureJSON;if(typeof l!="string"||typeof a!="string")return!0;const f=qn.json().cast(l),p=Jl(n.network,i.details.pox_address),m={topic:"stack-increase",rewardCycle:parseInt(f.rewardCycle,10),poxAddress:p,authId:u.parent.authId,network:n.network,publicKey:u.parent.signerKey,signature:a,period:i.details.lock_period,maxAmount:Vr(u.parent.maxAmount)};return Vl(m)}).test("matches-reward-cycle","Signature is not valid for current reward cycle",function(a,u){const l=u.parent.signatureJSON;if(typeof l!="string"||typeof a!="string")return!0;const f=qn.json().cast(l);return parseInt(f.rewardCycle,10)===r})})}function Ece({client:e,navigate:t,setIsContractCallExtensionPageOpen:n}){return async({increaseBy:r,signerKey:i,signerSignature:o,maxAmount:a,authId:u})=>{if(!e)return;const l=Vr(a),f=await e.getStackingContract(),p=e.getStackIncreaseOptions({contract:f,increaseBy:Un(r).toString(),signerKey:i,signerSignature:o,maxAmount:l,authId:parseInt(u)});n(!0),Do({...p,onCancel(){n(!1)},onFinish(){n(!1),t(Nr.DIRECT_STACKING_INFO)}})}}function n6(e,t){return new Qt(e.balance.toString()).minus(new Qt(e.locked.toString())).minus(new Qt(t?t.increaseBy.toString():0))}function Ace(){var u;const e=ci(),{getHasPendingStackIncreaseQuery:t}=xb(),[n,r,i]=$t("increaseBy"),o=(u=e.data)!=null&&u.stx?n6(e.data.stx,t.data):void 0,a=()=>{o&&i.setValue(Jh(o).toFixed(0,Qt.ROUND_DOWN))};return d.jsxs(It,{children:[d.jsx(Cn,{children:d.jsx(It,{alignItems:"flex-start",spacing:"base",children:d.jsx(ie,{children:"Choose how much you want to add to the current value you are already stacking."})})}),d.jsxs(fe,{position:"relative",my:"loose",children:[d.jsx(sr,{id:"stxAmount",placeholder:"Amount of additional STX to stack",...n}),r.touched&&r.error&&d.jsx(wn,{children:d.jsx(bn,{children:r.error})}),d.jsx(St,{type:"button",mode:"tertiary",size:"sm",height:"28px",right:"12px",top:"10px",style:{position:"absolute"},width:"80px",onClick:a,isDisabled:!o,children:"Stack max"})]})]})}function Fce(e){const{poxDisabled:t}=hb(),{title:n,extendedStxBalances:r,pendingStackIncrease:i,isContractCallExtensionPageOpen:o}=e,a=$l(),{errors:u}=ar(),l=()=>{a(Nr.DIRECT_STACKING_INFO)};return d.jsx(lp,{title:n,isShowing:!t,onClose:l,children:d.jsx(xe,{alignItems:"center",flexDirection:"column",pb:["loose","48px"],px:"loose",children:d.jsx(Ln,{width:"420px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:"You're stacking"}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",children:Jt(r.locked.toString())})]}),d.jsx(Pn,{}),i&&d.jsx(Nce,{pendingStackIncrease:i}),d.jsx(wr,{pt:"base-loose",children:d.jsxs(bt,{children:[d.jsx(Me,{children:d.jsx(Ace,{})}),d.jsx(zg,{}),d.jsxs(Me,{m:"loose",justifyContent:"space-between",children:[d.jsx(St,{mode:"tertiary",onClick:l,children:"Cancel"}),d.jsxs(St,{isLoading:o,isDisabled:Z1(u),children:[d.jsx(fe,{mr:"loose",children:d.jsx(ps,{})}),"Confirm Increase"]})]})]})})]})})})})}function Ice(){const t=e6()(D_),n=$l(),r=Bg(),i=Pt(),o=ci(),{getHasPendingStackIncreaseQuery:a}=xb(),u=rn(),{client:l}=kn(),[f,p]=$.useState(!1);if(r.isLoading||o.isLoading||a.isLoading||u.isLoading)return d.jsx(br,{});if(r.isError||!r.data||u.isError||!u.data||o.isError||!o.data||a.isError||a.data===void 0||!l){const x="Error while loading data, try reloading the page.";return console.error(x),d.jsx(Mt,{id:"0abc083b-06c7-4795-8491-68264595f1b4",children:d.jsx(ie,{children:x})})}if(!r.data.stacked)return d.jsx(Mt,{children:d.jsx(ie,{children:"Not stacking"})});const m=o.data.stx,y=n6(m,a.data),w=Ece({client:l,navigate:n,setIsContractCallExtensionPageOpen:p}),b=Cce({availableBalanceUStx:y,transactionFeeUStx:t,stackerInfo:r.data,network:i,rewardCycleId:u.data.reward_cycle_id});return d.jsx(Bi,{initialValues:{increaseBy:hW(y),signerKey:"",signerSignature:"",maxAmount:"",authId:""},onSubmit:w,validationSchema:b,children:d.jsx(ui,{children:d.jsx(Fce,{title:"Lock more STX",extendedStxBalances:o.data.stx,pendingStackIncrease:a.data,isContractCallExtensionPageOpen:f})})})}function Kk(e){const{intro:t,stackingInfoPanel:n,stackingForm:r}=e;return d.jsx(Tb,{pt:"80px",mb:"extra-loose",children:d.jsxs(xe,{flexDirection:["column-reverse","column-reverse","row"],justifyContent:"space-between",children:[d.jsxs(fe,{maxWidth:[null,null,"544px"],mr:[null,null,"extra-loose"],children:[t,d.jsx(fe,{display:["block",null,"none"],mt:["extra-loose",null,null,null,"base"],children:n}),r]}),d.jsx(fe,{display:["none",null,"block"],children:n})]})})}function Cb(e,t="4px"){return{position:"relative",_before:{content:'""',top:0,left:0,borderRadius:"8px",width:t,height:"100%",position:"absolute",background:ce(e)}}}const Pce=Qt.clone({ROUNDING_MODE:Qt.ROUND_FLOOR});function r6(e,t){return new Pce(e).dividedBy(t).integerValue()}function i6(e,t){return t.isEqualTo(0)||e.isLessThan(t)?null:e.modulo(t).decimalPlaces(0,Qt.ROUND_FLOOR)}const Mce=Qt.clone({ROUNDING_MODE:Qt.ROUND_FLOOR});function Lce(){const e=ci(),t=rn(),[n,r,i]=$t("amount");if(e.isLoading||t.isLoading)return d.jsx(fs,{});if(e.isError||typeof e.data.stx.balance!="string"||t.isError||!t.data){const w="134098d7-444b-4591-abfe-8767af6def3f",b="Failed to load necessary data.";return console.error(w,b),d.jsx(bs,{id:w,children:b})}const o=e.data.stx.balance,a=t.data.min_amount_ustx,u=Un(n.value||0),l=u.isGreaterThanOrEqualTo(a);let f=new Mce(new Qt(o).minus(D_).toString()).decimalPlaces(0);f.isNegative()&&(f=new Qt(0));const p=()=>{i.setValue(Jh(f.toString()).toFixed(0,Qt.ROUND_DOWN))},m=r6(u,new Qt(a)).integerValue(),y=i6(u,new Qt(a));return d.jsxs(Sn,{title:"Choose amount",children:[d.jsx(Cn,{children:d.jsxs(It,{alignItems:"flex-start",spacing:"base",children:[d.jsx(ie,{color:ce("text-caption"),children:"You'll be eligible for one reward slot for every multiple of the minimum you stack."}),d.jsx(ie,{color:ce("text-caption"),children:"The estimated minimum per slot can change by multiples of 10,000 every cycle, so you may want to add a buffer to increase your chance of keeping the same number of slots."}),d.jsx($r,{href:mW,children:"Learn more about risks of stacking at or near the minimum"}),d.jsx($r,{href:gW,children:"View the minimum for next cycle"})]})}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"stxAmount",placeholder:"Amount of STX to Stack",mt:"loose",...n}),r.touched&&r.error&&d.jsx(wn,{children:d.jsx(bn,{children:r.error})}),d.jsx(St,{type:"button",mode:"tertiary",size:"sm",height:"28px",right:"12px",top:"10px",style:{position:"absolute"},width:"80px",onClick:p,children:"Stack max"})]}),l&&d.jsxs(d.Fragment,{children:[d.jsx(It,{textStyle:"body.small",color:ce("text-caption"),spacing:"base",mt:"base",children:d.jsxs(ie,{children:["This entered amount would get you ",m.toString()," reward slot",m.toNumber()===1?"":"s"," with a"," ",Jt(y||0)," buffer at the current minimum. However, that minimum is subject to change and there is no guarantee you will get any reward slots."]})}),y!==null&&y.isEqualTo(0)&&d.jsxs(fe,{textStyle:"body.small",color:ce("text-body"),border:"1px solid",p:"loose",mt:"base",borderRadius:"6px",borderColor:ce("border"),...Cb("feedback-alert"),children:["Add a buffer for a higher chance (though no guarantee) of keeping the same number of reward slots should the minimum increase. If you can’t add a buffer, consider Stacking in a pool instead.",d.jsx(St,{variant:"link",type:"button",display:"block",mt:"tight",onClick:()=>i.setValue(new Qt(n.value).plus(1e4).toString()),children:"Add 10,000 STX buffer"})]})]})]})}function Qk(e){const{onChange:t,...n}=e;return d.jsxs(fe,{as:"label",display:"block",py:"base",textStyle:"body.small",color:ce("text-caption"),userSelect:"none",...n,children:[d.jsx(fe,{mr:"base-tight",display:"inline-block",children:d.jsx("input",{type:"checkbox",onChange:r=>t(r.target.checked)})}),"I have read and understand the above"]})}function Ml(e){const{title:t,icon:n,children:r,...i}=e;return d.jsxs(xe,{alignItems:"baseline",...i,children:[d.jsx(xe,{width:"16px",mr:"base-tight",children:n}),d.jsxs(It,{spacing:"extra-tight",children:[d.jsx(ie,{as:"h3",textStyle:"body.large.medium",children:t}),d.jsx(It,{spacing:"base",textStyle:"body.large",color:ce("text-caption"),children:r})]})]})}const Bce=e=>d.jsxs(It,{textStyle:["body.small","body.large"],spacing:"base-loose",pl:"base",...Cb("feedback-alert"),...e,children:[d.jsxs(Ml,{title:"This transaction can’t be reversed",icon:d.jsx(ps,{width:"16px",height:"16px"}),children:[d.jsx(ie,{color:ce("text-body"),children:"STX will be locked in your wallet for your chosen duration, even if an increase in the minimum causes you to end up with fewer or no reward slots."}),d.jsx(ie,{color:ce("text-body"),children:"There will be no way to unlock your STX before the chosen duration is finished."}),d.jsx(ie,{color:ce("text-body"),children:"Nor will you be able to change the entered BTC address. Ensure it's entered correctly and you have control over it."})]}),d.jsx(Ml,{title:"Dynamic minimum",icon:d.jsx(kb,{width:"16px",height:"16px"}),children:d.jsx(ie,{color:ce("text-body"),children:"If the minimum increases, you could end up with fewer or no reward slots, even if you’ve added a buffer. There will be no way to lock more STX for Stacking with this address until the selected duration is finished."})})]});function jce({isLoading:e}){const[t,n]=$.useState(!1);return d.jsxs(Sn,{title:"Confirm and stack",children:[d.jsx(Bce,{mt:"loose"}),d.jsx(Qk,{onChange:r=>n(r),mt:"extra-loose"}),d.jsx(Yh,{type:"submit",isLoading:e,isDisabled:!t,children:"Confirm and start stacking"})]})}function Dce(e){if(!e)return 0;try{if(typeof e!="number"){const t=parseFloat(e);return Number.isFinite(t)?t:0}return e}catch{return 0}}function Jce(){var y,w,b;const e=ar(),t=rn(),{amount:n,lockPeriod:r,poxAddress:i,signerKey:o,signerSignature:a,maxAmount:u,authId:l}=e.values,f=$.useMemo(()=>Un(Dce(n)).integerValue(),[n]),p=r6(f,new Qt(((y=t.data)==null?void 0:y.min_amount_ustx)||0)).integerValue(),m=i6(f,new Qt(((w=t.data)==null?void 0:w.min_amount_ustx)||0));return d.jsx(Ln,{minHeight:"84px",children:d.jsxs(fe,{mx:["loose","extra-loose"],children:[d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",color:ce("text-body"),children:"You'll lock"}),d.jsx(ie,{fontSize:"24px",mt:"extra-tight",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",color:ce("text-caption"),children:Hg(n??0)})]}),d.jsx(Pn,{}),d.jsxs(wr,{width:"100%",mt:"base-loose",mb:"extra-loose",children:[d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"This is the estimated number of reward slots. The minimum can change before the next cycle begins.",children:"Reward slots"}),d.jsx(Ge,{children:p.toString()})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Buffer"}),d.jsx(Ge,{children:m===null?"No buffer":Jt(m)})]})]}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:`One cycle lasts ${(b=t.data)==null?void 0:b.reward_cycle_length} blocks on the Bitcoin blockchain`,children:"Cycles"}),d.jsx(Ge,{children:r})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Bitcoin address"}),d.jsx(Ge,{children:i?Mi(i):"—"})]})}),d.jsx(Nb,{signatureData:a&&o?{signature:a,publicKey:o,maxAmount:u,authId:l}:void 0})]})]})})}function $ce(e){const{timeUntilNextCycle:t,estimatedStackingMinimum:n}=e;return d.jsxs(d.Fragment,{children:[d.jsx(Jo,{children:"Stack independently"}),d.jsx(W5,{mt:"base-loose",children:"When you stack by yourself you'll earn Bitcoin each cycle for every reward slot that you hold. The STX required per reward slot can fluctuate from cycle to cycle. If you're close to the current minimum, consider pooling instead to make sure you won't end up without rewards."}),d.jsxs(xe,{alignItems:"baseline",children:[d.jsx(Rb,{timeUntilNextCycle:t,mt:"40px"}),d.jsx($5,{ml:"extra-loose",estimatedStackingMinimum:n})]})]})}function qce(){const[e,t,n]=$t("lockPeriod"),[r]=$t("signatureJSON");return d.jsx(d.Fragment,{children:d.jsxs(Sn,{title:"Duration",children:[d.jsxs(Cn,{children:[d.jsx(ie,{color:ce("text-caption"),children:"Every cycle, each of your reward slots will be eligible for rewards. After your chosen duration, you'll need to wait one cycle before you can stack from this address again."}),d.jsx(ie,{href:"",children:"Learn more about cycles."})]}),d.jsx(qk,{mt:"loose",amount:e.value,onIncrement:i=>{i>Ww||n.setValue(i)},onDecrement:i=>{io===void 0?!0:Ob(0)(o)).test({name:"test-fee-margin",message:"You must stack less than your entire balance to allow for the transaction fee",test:o=>o==null?!1:!Un(o).isGreaterThan(new Qt(e.toString()).minus(t.toString()))}).test({name:"test-min-utx",message:`You must stack with at least ${Jt(n)}`,test:o=>{if(o==null)return!1;const a=Un(o);return new Qt(n.toString()).isLessThanOrEqualTo(a)}}),lockPeriod:Wr().defined().test("matches-period-pox-address","Duration does not match signature data",function(o){const a=this.parent.signatureJSON;if(typeof a!="string")return!0;const u=qn.json().cast(a);return parseInt(u.period,10)===o}),poxAddress:Ql({network:r.networkName}).test("matches-signature-pox-address","BTC Address does not match signature data",function(o){const a=this.parent.signatureJSON;return typeof a!="string"?!0:qn.json().cast(a).poxAddress===o}),signatureJSON:cn(),signerKey:wf().required(),signerSignature:wf().test("matches-topic","Signature was not generated for stack-stx",function(o){const a=this.parent.signatureJSON;return typeof a!="string"?!0:qn.json().cast(a).method==="stack-stx"}).test("valid-signature","Unable to validate signature",function(o,a){const u=a.parent.signatureJSON;if(typeof u!="string"||typeof o!="string")return!0;const l=qn.json().cast(u),f={topic:"stack-stx",rewardCycle:parseInt(l.rewardCycle,10),poxAddress:a.parent.poxAddress,authId:a.parent.authId,network:r.network,publicKey:a.parent.signerKey,signature:o,period:a.parent.lockPeriod,maxAmount:Vr(a.parent.maxAmount)};return Vl(f)}).test("matches-reward-cycle","Signature is not valid for current reward cycle",function(o,a){const u=a.parent.signatureJSON;if(typeof u!="string"||typeof o!="string")return!0;const l=qn.json().cast(u);return parseInt(l.rewardCycle,10)===i}),maxAmount:cn().defined().test("matches-signature-max-amount","Max amount does not match signature data",function(o){const a=this.parent.signatureJSON;if(typeof a!="string")return!0;const u=qn.json().cast(a);return Pi(u.maxAmount).isEqualTo(Pi(Vr(o)))}),authId:Wr().defined().test("matches-signature","Auth ID does not match signature data",function(o){const a=this.parent.signatureJSON;if(typeof a!="string")return!0;const u=qn.json().cast(a);return BigInt(u.authId)===BigInt(o)})})}function Hce({client:e,setIsContractCallExtensionPageOpen:t,navigate:n}){return async function(i){if(i.amount===null)throw new Error("Expected a non-null amount to be submitted.");const[o,a]=await Promise.all([e.getStackingContract(),e.getPoxInfo()]),u=a.current_burnchain_block_height;if(typeof u!="number")throw new Error("Unable to get current block height.");const l=parseInt(i.authId,10),f=Vr(i.maxAmount);typeof i.signerSignature=="string"&&(Vl({topic:"stack-stx",poxAddress:i.poxAddress,rewardCycle:a.current_cycle.id,authId:l,maxAmount:f,period:i.lockPeriod,network:e.network,publicKey:i.signerKey,signature:i.signerSignature})?console.log("✅ Signature verified"):console.warn("⚠️ Unable to verify signature."));const p=e.getStackOptions({contract:o,amountMicroStx:Vr(i.amount),cycles:i.lockPeriod,poxAddress:i.poxAddress,burnBlockHeight:u,signerKey:i.signerKey,signerSignature:i.signerSignature,maxAmount:f,authId:l});Do({...p,onFinish(){t(!1),n("../direct-stacking-info")},onCancel(){t(!1)}}),t(!0)}}const zce={amount:"",lockPeriod:12,poxAddress:"",signerKey:"",signerSignature:"",maxAmount:"",authId:""};function Wce(){const{client:e}=kn();if(!e){const t="Expected `client` to be defined.",n="32bd8efa-c6cb-4d1c-8f92-f39cd7f3cd74";return console.error(t),d.jsx(Mt,{id:n,children:t})}return d.jsx(Vce,{client:e})}function Vce({client:e}){const[t,n]=$.useState(!1),r=Pt(),i=Gu(),o=rn(),a=ci(),{btcAddressP2wpkh:u}=Mn(),l=Yn(),p=e6()(D_);if(i.isLoading||o.isLoading||a.isLoading)return d.jsx(br,{});if(i.isError||typeof i.data!="number"||o.isError||!o.data||a.isError||typeof a.data.stx.balance!="string"){const w="Failed to load necessary data.",b="8c12f6b2-c839-4813-8471-b0fd542b845f";return console.error(b,w),d.jsx(Mt,{id:b,children:w})}const m=Uce({minimumAmountUStx:BigInt(o.data.min_amount_ustx),transactionFeeUStx:p,availableBalanceUStx:Yt(a.data.stx.balance),network:r,rewardCycleId:o.data.current_cycle.id}),y=Hce({client:e,navigate:l,setIsContractCallExtensionPageOpen:n});return d.jsx(Bi,{initialValues:{...zce,poxAddress:u||""},onSubmit:w=>{y(w)},validationSchema:m,children:d.jsx(Kk,{intro:d.jsx($ce,{estimatedStackingMinimum:BigInt(o.data.min_amount_ustx),timeUntilNextCycle:i.data}),stackingInfoPanel:d.jsx(d.Fragment,{children:d.jsx(vs,{children:d.jsx(Jce,{})})}),stackingForm:d.jsx(ui,{children:d.jsxs(Kl,{children:[d.jsx(Lce,{}),d.jsx(qce,{}),d.jsx(Ef,{}),d.jsx(zg,{}),d.jsx(jce,{isLoading:t})]})})})})}function Gce(){var u,l;const[e,t,n]=$t("amount"),r=ci(),i=(u=r.data)!=null&&u.stx.balance?Yt(r.data.stx.balance):void 0,o=(l=r.data)!=null&&l.stx.locked?Yt(r.data.stx.locked):void 0,a=i&&o?i-o:void 0;return d.jsxs(Sn,{title:"Amount",children:[d.jsxs(Cn,{children:[d.jsx(ie,{children:"Choose how much you'll stack. Your liquid stacking protocol may require a minimum."}),d.jsx(ie,{children:"The STX tokens will leave your wallet and you will get stSTX or LiSTX which represents your principal plus yield."})]}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"stxAmount",mt:"loose",placeholder:"Amount of STX to Stack",...e}),t.touched&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})})]}),d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight","aria-busy":r.isLoading,children:["Available balance:"," ",r.isLoading?d.jsx(fs,{}):a?d.jsx(St,{variant:"link",type:"button",onClick:()=>n.setValue(Jh(a)),children:Jt(a)}):d.jsx(bs,{children:"Failed to load"})]})]})}var e_=(e=>(e.StackingDao="StackingDAO",e.Lisa="Lisa",e))(e_||{}),Oo=(e=>(e[e.WrapperStackingDAO=0]="WrapperStackingDAO",e[e.Lisa=1]="Lisa",e))(Oo||{});const Wd={[mt.devnet]:{0:"",1:""},[mt.testnet]:{0:"ST2PABAF9FTAJYNFZH93XENAJ8FVY99RRM4DF2YCW.stacking-dao-core-v1",1:""},[mt.mainnet]:{0:"SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-v1",1:"SM3KNVZS30WM7F89SXKVVFY4SN9RMPZZ9FX929N0V.auto-whitelist-mint-helper"}};var t_=(e=>(e.ST_STX="stSTX",e.LI_STX="LiSTX",e.OTHER="OTHER",e))(t_||{});const EI=({src:e})=>d.jsx("img",{src:e,width:"32px",alt:"name"}),vg={StackingDAO:{name:e_.StackingDao,description:"Enjoy automatic protocol operations and auto-compounded yield. Locked STX will stay stacked indefinitely.",duration:1,website:"https://www.stackingdao.com",liquidContract:Oo.WrapperStackingDAO,liquidToken:t_.ST_STX,protocolAddress:{[mt.mainnet]:Wd[mt.mainnet][Oo.WrapperStackingDAO],[mt.testnet]:Wd[mt.testnet][Oo.WrapperStackingDAO],[mt.devnet]:Wd[mt.devnet][Oo.WrapperStackingDAO]},minimumDelegationAmount:1e6,icon:d.jsx(EI,{src:"/32x32_StackingDao.png"})},Lisa:{name:e_.Lisa,description:"See your balance increase automatically and always exchange at 1 STX to 1 LiSTX",duration:1,website:"https://www.lisalab.io/",liquidContract:Oo.Lisa,liquidToken:t_.LI_STX,protocolAddress:{[mt.mainnet]:Wd[mt.mainnet][Oo.Lisa],[mt.testnet]:Wd[mt.testnet][Oo.Lisa],[mt.devnet]:Wd[mt.devnet][Oo.Lisa]},minimumDelegationAmount:1e6,icon:d.jsx(EI,{src:"/32x32_Lisa.png"})}};function Kce(e){const{name:t,description:n,url:r,icon:i,activeProtocolName:o,onChange:a,...u}=e,[l,f]=k_();return d.jsx(fe,{borderRadius:l?"12px":void 0,borderWidth:"2px",borderColor:l?sf.borderFocused:"#00000000",_hover:{cursor:"pointer"},borderStyle:"solid",children:d.jsx(xe,{minHeight:"72px",p:"base-loose",as:"label",border:`1px solid ${ce("border")}`,borderRadius:"12px",_hover:{cursor:"pointer"},position:"relative",...u,children:d.jsxs(xe,{width:"100%",children:[d.jsx(fe,{position:"relative",top:"-3px",children:i}),d.jsx(xe,{ml:"base-loose",width:"100%",flexDirection:["column","row"],children:d.jsxs(fe,{children:[d.jsx(ie,{textStyle:"body.small",fontWeight:500,display:"block",style:{wordBreak:"break-all"},children:t}),d.jsx(ie,{textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:n}),r&&d.jsx($r,{href:r,textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:"Learn more"})]})}),d.jsx(xe,{ml:"loose",alignItems:"center",children:d.jsx("input",{type:"radio",id:t,name:"protocolName",value:t,checked:t===o,style:{transform:"scale(1.2)",outline:0},onChange:p=>a(p.target.value),...f})})]})})})}function Qce({onProtocolChange:e}){const[t,,n]=$t("protocolName"),r=i=>{n.setValue(i),e(i)};return d.jsxs(Sn,{title:"Liquid Stacking",children:[d.jsx(Cn,{children:d.jsxs(ie,{children:["Select a protocol to start liquid stacking or"," ",d.jsx($r,{display:"inline",href:"https://www.stacks.co/learn/stacking",children:"discover others on stacks.co."})]})}),d.jsx(It,{spacing:"base",mt:"extra-loose",children:Object.keys(vg).map((i,o)=>{const a=vg[i];return d.jsx(Kce,{name:a.name,icon:a.icon,description:a.description,url:a.website,activeProtocolName:t.value,onChange:r},o)})})]})}function o6(e){return d.jsx("svg",{width:14,height:15,viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:d.jsx("path",{d:"M14 9.66H9.74l2.934 4.569H10.5L7.01 8.863 3.5 14.229H1.326l2.978-4.557H0V7.945h14V9.66Zm0-3.387H0V4.535h4.185L1.25.021h2.174l3.533 5.465L10.5.02h2.174L9.728 4.535H14v1.738Z",fill:"#242629"})})}function Yce({...e}){return d.jsxs(It,{textStyle:["body.small","body.large"],spacing:"base-loose",pl:"base",...Cb("feedback-alert"),...e,children:[d.jsx(Ml,{title:"This transaction can’t be reversed",icon:d.jsx(ps,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"You are transferring STX to the liquid stacking protocol. To receive STX back, you must request them from the protocol."})}),d.jsx(Ml,{title:"Research your protocol",icon:d.jsx(kb,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"Paying out rewards is at the discretion of the protocol. Make sure you’ve researched and trust the protocol you’re using."})}),d.jsx(Ml,{title:"Stacking with Protocol Contract",icon:d.jsx(o6,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"The protocol uses a smart contract that handles your stacking. By allowing the contract to call Stacking functions, you agree to the rules of the Protocol contract."})})]})}function Xce({isLoading:e}){const[t,n]=$.useState(!1);return d.jsxs(Sn,{title:"Confirm and stack",children:[d.jsx(Yce,{mt:"loose"}),d.jsx(Qk,{onChange:r=>n(r)}),d.jsx(Yh,{type:"submit",isLoading:e,isDisabled:!t,children:"Confirm and start liquid stacking"})]})}function Zce({title:e,amountText:t}){return d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",children:e}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",children:t})]})}function eue(e){const t=ar(),{networkName:n,networkInstance:r}=Pt(),i=t.values.amount,o=t.values.protocolName,a=o?vg[o]:void 0,u=(a!=null&&a.protocolAddress?a.protocolAddress[r]:void 0)||t.values.protocolAddress,l=Hg(i);return d.jsx(d.Fragment,{children:d.jsx(Ln,{...e,children:d.jsxs(fe,{mx:["loose","extra-loose"],sx:{},children:[d.jsx(Zce,{title:"You'll liquid stack",amountText:l}),d.jsx(Pn,{}),d.jsxs(wr,{mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"How long you will liquid stack with the protocol. By default, any liquid stacking protocol will stack your STX indefinitely until you decide to unstack.",children:"Duration"}),d.jsx(Ge,{children:"Indefinite"})]})}),d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{children:"Contract"}),d.jsx(Ge,{children:u&&d.jsx($r,{href:xk(u,n),children:Mi(u)})})]})})]})]})})})}function tue({timeUntilNextCycle:e}){return d.jsxs(d.Fragment,{children:[d.jsx(Jo,{children:"Liquid Stacking"}),d.jsx(Rb,{mt:"extra-loose",timeUntilNextCycle:e})]})}function nue(e){return e.chainId===dn.Mainnet?mt.mainnet:e.client.baseUrl===Dh?mt.devnet:mt.testnet}function rue(e,t){return Wd[e][t].split(".")}function iue(){return li().shape({amount:mp().test({name:"test-min-allowed-stacking",message:"You must stack at least the protocol's minimum.",test(e,t){const n=t.parent.protocolName;if(!n)return!0;const r=vg[n].minimumDelegationAmount;return Un(e||0).isLessThan(r)?t.createError({message:`You must stack at least ${Jt(r)}`}):!0}}).test({name:"test-max-allowed-stacking",message:`You cannot stack more than ${Jt($h)}`,test(e){return e===void 0?!1:Un(e).isLessThanOrEqualTo($h)}})})}function oue(e,t){const n=e.protocolName?vg[e.protocolName]:void 0;if(!n)throw new Error("Invalid Protocol Name");const r=nue(t),[i,o]=rue(r,n.liquidContract),a=Un(e.amount).toString(),u=e.stxAddress,{functionArgs:l,functionName:f}=n.liquidContract===Oo.WrapperStackingDAO?{functionArgs:[xM(i,"reserve-v1"),ft(a),Rr()],functionName:"deposit"}:n.liquidContract===Oo.Lisa?{functionArgs:[ft(a)],functionName:"request-mint"}:{functionArgs:[],functionName:"deposit"};return{contractAddress:i,contractName:o,functionName:f,functionArgs:l,network:t,postConditions:[{type:"stx-postcondition",address:u,condition:"lte",amount:a}]}}function sue({network:e,setIsContractCallExtensionPageOpen:t,navigate:n}){return async function(i){const o=oue(i,e);bk({...o,onFinish(){t(!1),n("../direct-stacking-info")},onCancel(){t(!1)}}),t(!0)}}const aue={amount:"",stxAddress:"",protocolAddress:""};function cue(){const{address:e}=Mn(),{networkName:t}=Pt();if(!e){const n="Expected `address` to be defined.";return console.error(n),d.jsx(Mt,{children:n})}if(!t){const n="Expected `networkName` to be defined.";return console.error(n),d.jsx(Mt,{children:n})}return d.jsx(uue,{currentAccountAddresses:{address:e}})}function uue({currentAccountAddresses:e}){const{network:t}=Pt(),[n,r]=$.useState(!1),i=Gu(),o=Yn(),a=iue(),u=sue({network:t,navigate:o,setIsContractCallExtensionPageOpen:r});if(i.isLoading)return d.jsx(br,{});if(i.isError||typeof i.data!="number"){const l="0106e9bf-ae2f-4fcc-bf00-5fe083001adb",f="Failed to load necessary data.";return console.error(l,f),d.jsx(Mt,{id:l,children:f})}return d.jsx(Bi,{initialValues:{...aue,stxAddress:e.address},onSubmit:u,validationSchema:a,children:d.jsx(Kk,{intro:d.jsx(tue,{timeUntilNextCycle:i.data}),stackingInfoPanel:d.jsx(vs,{children:d.jsx(eue,{})}),stackingForm:d.jsx(d.Fragment,{children:d.jsx(ui,{children:d.jsxs(Kl,{children:[d.jsxs("p",{children:["Liquid Stacking, a new feature developed by ecosystem builders, gives users the ability to lock their STX in exchange for a tokenized representation of stacked Stacks (stSTX or LiSTX). This allows users to leverage their Stacked STX throughout the ecosystem while continuing to earn Stacking rewards. Unlike Stacking, there' no minimum STX requirement for participation. Users can trade back to STX at any time. ",d.jsx("br",{})," ",d.jsx("br",{}),"Visit their websites and read their documents to learn more about"," ",d.jsx($r,{href:"https://stackingdao.com",children:"StackingDAO"})," ","and"," ",d.jsx($r,{href:"https://lisalab.io",children:"LISA"}),".",d.jsx("br",{}),d.jsx("span",{className:"mt-4",children:"Important: Leather allows users to integrate with liquid stacking features, but does not manage or have any control over the liquid stacking process."})]}),d.jsx(Qce,{onProtocolChange:()=>{}}),d.jsx(Gce,{}),d.jsx(Xce,{isLoading:n})]})})})})})}function lue(){var a,u;const[e,t,n]=$t("amount"),r=ci(),i=(a=r.data)!=null&&a.stx.balance?Yt(r.data.stx.balance):void 0,o=(u=r.data)!=null&&u.stx.locked?Yt(r.data.stx.locked):void 0;return d.jsxs(Sn,{title:"Amount",children:[d.jsxs(Cn,{children:[d.jsx(ie,{color:ce("text-caption"),children:"Choose how much you'll pool. Your pool may require a minimum."}),d.jsx(ie,{color:ce("text-caption"),children:"The pooled amount can be higher than your current balance to allow the pool to stack more in the future."}),d.jsx(ie,{color:ce("text-caption"),children:"The pool may stack less than the delegated amount to leave some change to pay for transaction fees."})]}),d.jsxs(fe,{position:"relative",maxWidth:"400px",children:[d.jsx(sr,{id:"stxAmount",mt:"loose",placeholder:"Amount of STX to Stack",...e}),t.touched&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})})]}),d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight","aria-busy":r.isLoading,children:["Available balance:"," ",r.isLoading?d.jsx(fs,{}):i?d.jsxs(St,{variant:"link",type:"button",onClick:()=>n.setValue(Jh(i)),children:[Jt(i)," "]}):d.jsx(bs,{children:"Failed to load"})]}),o?d.jsxs(d.Fragment,{children:[d.jsxs(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight","aria-busy":r.isLoading,children:["Minimum amount:"," ",d.jsxs(St,{variant:"link",type:"button",onClick:()=>n.setValue(Jh(o)),children:[Jt(o)," "]})]}),d.jsx(fe,{background:ce("bg-alt"),my:"tight",py:"tight",px:"base-loose",borderRadius:"10px",children:d.jsx(xe,{children:d.jsx(fe,{textStyle:"body.small",color:ce("text-caption"),children:"The minimum amount is what is already stacked. For continuous stacking, you will have to pool this amount or more."})})})]}):null]})}function AI(e){return d.jsx(fe,{as:"button",type:"button",backgroundColor:ce("bg-4"),_hover:{color:ce("brand")},style:{userSelect:"none"},display:"inline-block",width:"28px",height:"28px",borderRadius:"50%",fontWeight:800,outline:0,...e})}const due=()=>new Array(12).fill(null).map((e,t)=>t+1),Lx=e=>e??1;function fue(){const e=cZ(),[t,,n]=$t("numberOfCycles"),r=t.value??1,i=$.useMemo(()=>typeof e.data!="number"?[]:due().map(o=>`${Jk(o)} ends in about ${z5(U5(new Date,o*e.data))}`),[e.data]);return e.isLoading?d.jsx(fs,{}):(typeof e.data!="number"&&console.error("Expected `data` to be a number."),typeof r!="number"&&console.error("Expected `duration` to be a number."),d.jsx(d.Fragment,{children:d.jsxs(xe,{alignItems:"center",justifyContent:"space-between",mt:"base",padding:"8px",boxShadow:"low",border:`1px solid ${ce("border")}`,borderRadius:"8px",onClick:o=>(o.stopPropagation(),o.preventDefault()),position:"relative",zIndex:10,children:[d.jsx(ie,{alignItems:"center",ml:"tight",color:ce("text-title"),children:i[Lx(r)-1]}),d.jsxs(fe,{children:[d.jsx(AI,{onClick:o=>{o.stopPropagation(),n.setValue(Math.max(Vw,J5(Lx(r))))},children:"-"}),d.jsx(AI,{ml:[null,"extra-tight"],onClick:o=>{o.stopPropagation(),n.setValue(Math.min(Ww,Sw(Lx(r))))},children:"+"})]})]})}))}function FI(e){const{title:t,icon:n,delegationType:r,activeDelegationType:i,onChange:o,children:a,...u}=e,[l,f]=k_();return d.jsx(xe,{minHeight:"72px",p:"base-loose",as:"label",htmlFor:r,border:`1px solid ${ce("border")}`,borderRadius:"12px",position:"relative",...l?{_before:{content:'""',position:"absolute",top:"-1px",left:"-1px",right:"-1px",bottom:"-1px",borderRadius:"12px",border:"2px solid #CEDAFA"}}:{},...u,children:d.jsxs(xe,{width:"100%",children:[d.jsx(fe,{position:"relative",top:"-3px",children:n}),d.jsx(xe,{ml:"base-loose",width:"100%",flexDirection:["column","row"],children:d.jsxs(fe,{children:[d.jsx(ie,{textStyle:"body.small",fontWeight:500,display:"block",style:{wordBreak:"break-all"},children:t}),d.jsx(ie,{textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:a})]})}),d.jsx(xe,{ml:"loose",alignItems:"center",children:d.jsx("input",{type:"radio",id:r,name:"delegationType",value:r,checked:r===i,style:{transform:"scale(1.2)",outline:0},onChange:p=>o(p.target.value),...f})})]})})}const hue=e=>d.jsx(fe,{...e,children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"none",viewBox:"0 0 48 48",children:[d.jsx("path",{stroke:"#5546FF",strokeWidth:"2",d:"M1 13h46v31a3 3 0 01-3 3H4a3 3 0 01-3-3V13zM1 13h46V8a3 3 0 00-3-3H4a3 3 0 00-3 3v5z"}),d.jsx("g",{clipPath:"url(#clip0)",children:d.jsx("path",{fill:"#5546FF",d:"M21.233 22.494a8 8 0 018.22 1.652l.84-.84c.63-.63 1.707-.184 1.707.707V28h-3.987c-.891 0-1.337-1.077-.707-1.707l.731-.732a6 6 0 101.378 7.024 1 1 0 011.805.861 8 8 0 11-9.987-10.952z"})}),d.jsx("path",{stroke:"#5546FF",strokeLinecap:"round",strokeWidth:"2",d:"M12 1v6M36 1v6"}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0",children:d.jsx("path",{fill:"#fff",d:"M0 0H16V16H0z",transform:"matrix(1 0 0 -1 16 38)"})})})]})}),pue=({cycles:e})=>d.jsx(fe,{children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"none",viewBox:"0 0 48 48",children:[d.jsx("path",{stroke:"#5546FF",strokeWidth:"2",d:"M1 13h46v31a3 3 0 01-3 3H4a3 3 0 01-3-3V13z"}),d.jsx("path",{stroke:"#5546FF",strokeWidth:"2",d:"M1 13h46V8a3 3 0 00-3-3H4a3 3 0 00-3 3v5z"}),d.jsx("path",{stroke:"#5546FF",strokeLinecap:"round",strokeWidth:"2",d:"M12 1v6M36 1v6"}),d.jsx("text",{fill:"#5546FF",x:"49%",y:"62%",dominantBaseline:"middle",textAnchor:"middle",style:{fontFamily:"Inter",fontWeight:500,fontSize:"16px"},children:e})]})});function II({children:e}){return d.jsx(fe,{background:ce("bg-alt"),my:"loose",py:"loose",px:"base-loose",borderRadius:"10px",children:d.jsx(xe,{children:d.jsxs(fe,{children:[d.jsx(ie,{fontSize:"14px",lineHeight:"20px",display:"block",fontWeight:500,fontFamily:"Open Sauce",letterSpacing:"-0.02em",color:ce("text-title"),mb:"base",children:"Recommended for"}),d.jsxs(ie,{children:[e," "]})]})})})}function mue(){var l;const[e]=$t("poolName"),[t]=$t("numberOfCycles"),[n,r,i]=$t("delegationDurationType"),[o,a]=$.useState(!1),u=(l=Mo[e.value])==null?void 0:l.duration;return!o&&u>0?d.jsx(Sn,{title:"Duration",children:d.jsxs(Cn,{children:[d.jsxs(ie,{color:ce("text-caption"),children:["The pool looks your STX for ",u," cycle",u>1?"s":""," at the time. You can revoke the pool permission at any time and your STX will be unlocked after the end of the next cycle."]}),d.jsxs(ie,{color:ce("text-caption"),children:["By default, you will be part of the pool until you revoke (indefinite duration). You can set a limit to leave the pool automatically"," ",d.jsx(St,{variant:"link",type:"button",onClick:()=>{i.setValue("limited"),a(!0)},children:"here"}),"."]})]})}):d.jsxs(Sn,{title:"Duration",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:"Choose whether you want to pool with a limited duration, or give the pool indefinite permission. Each cycles lasts around 15 days."})}),d.jsxs(It,{spacing:"base",mt:"extra-loose",children:[d.jsxs(FI,{title:"Indefinite permission",icon:d.jsx(hue,{}),delegationType:"indefinite",activeDelegationType:n.value,onChange:f=>i.setValue(f),children:[d.jsx(ie,{children:"Allow the pool to stack on your behalf for a max of 12 cycles at a time. You can unlock them at any moment by revoking the pool permission but keep in mind that your STX will be locked until completing the duration initially set by the pool."}),d.jsx(II,{children:"Users who wish to stack continuously and, when wishing to access STX again, understand revocation must be done before funds are re-stacked by pool."})]}),d.jsxs(FI,{title:"Limited permission",delegationType:"limited",icon:d.jsx(pue,{cycles:t.value||1}),activeDelegationType:n.value,onChange:f=>i.setValue(f),children:[d.jsx(ie,{children:"Set a limit between 1 and 12 cycles for how long the pool can stack on your behalf. Make sure you don't set it lower than the number of cycles your pool intends to stack."}),n.value==="limited"&&d.jsx(fue,{}),d.jsx(II,{children:"Users who want to guarantee funds are not locked beyond a certain period."})]}),u>0&&d.jsxs(ie,{children:["Reset to default indefinite duration"," ",d.jsx(St,{variant:"link",type:"button",onClick:()=>{i.setValue("indefinite"),a(!1)},children:"here"}),"."]})]}),r.touched&&r.error&&d.jsx(wn,{mt:"base-loose",children:d.jsx(bn,{children:r.error})})]})}function gue(){const[e,t]=$t("poolAddress");return d.jsxs(d.Fragment,{children:[d.jsx(ie,{textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:"The pool will provide this address for you."}),d.jsx(_b,{fieldName:"poolAddress",addressType:"STX",placeholder:"Pool address",...e,children:t.touched&&t.error&&d.jsx(wn,{children:d.jsx(bn,{children:t.error})})})]})}function yue(e){const{name:t,description:n,url:r,icon:i,activePoolName:o,onChange:a,...u}=e,[l,f]=k_();return d.jsx(fe,{borderRadius:l?"12px":void 0,borderWidth:"2px",borderColor:l?sf.borderFocused:"#00000000",_hover:{cursor:"pointer"},borderStyle:"solid",children:d.jsx(xe,{minHeight:"72px",p:"base-loose",as:"label",border:`1px solid ${ce("border")}`,borderRadius:"12px",_hover:{cursor:"pointer"},position:"relative",...u,children:d.jsxs(xe,{width:"100%",children:[d.jsx(fe,{position:"relative",top:"-3px",children:i}),d.jsx(xe,{ml:"base-loose",width:"100%",flexDirection:["column","row"],children:d.jsxs(fe,{children:[d.jsx(ie,{textStyle:"body.small",fontWeight:500,display:"block",style:{wordBreak:"break-all"},children:t}),d.jsx(ie,{textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:n}),t==es.CustomPool?d.jsx(gue,{}):r&&d.jsx($r,{href:r,textStyle:"body.small",color:ce("text-caption"),mt:"tight",display:"inline-block",lineHeight:"18px",children:"Learn more"})]})}),d.jsx(xe,{ml:"loose",alignItems:"center",children:d.jsx("input",{type:"radio",id:t,name:"poolName",value:t,checked:t===o,style:{transform:"scale(1.2)",outline:0},onChange:p=>a(p.target.value),...f})})]})})})}function wue({onPoolChange:e}){const[t,,n]=$t("poolName"),[,,r]=$t("delegationDurationType"),i=o=>{r.setValue(Mo[o].duration>0?"indefinite":"limited"),n.setValue(o),e(o)};return d.jsxs(Sn,{title:"Pool",children:[d.jsx(Cn,{children:d.jsxs(ie,{children:["Select a pool to start stacking or"," ",d.jsx($r,{display:"inline",href:"https://www.stacks.co/learn/stacking",children:"discover others on stacks.co."})]})}),d.jsx(It,{spacing:"base",mt:"extra-loose",children:Object.keys(Mo).map((o,a)=>{const u=Mo[o];return u.disabled?null:d.jsx(yue,{name:u.name,icon:u.icon,description:u.description,url:u.website,activePoolName:t.value,onChange:i},a)})})]})}function bue({editable:e}){const[t,n]=$t("rewardAddress");return d.jsxs(Sn,{title:"Bitcoin address",children:[d.jsx(Cn,{children:d.jsx(ie,{color:ce("text-caption"),children:"Enter the Bitcoin address where you'd like to receive your rewards."})}),d.jsx(fe,{position:"relative",maxWidth:"400px",children:d.jsx(_b,{fieldName:"poxAddress",addressType:"BTC",isDisabled:!e,...t,children:n.touched&&n.error&&d.jsx(wn,{children:d.jsx(bn,{children:n.error})})})}),e?d.jsx(fe,{textStyle:"body.small",color:ce("feedback-alert"),mt:"base-tight",children:"Make sure you control this BTC address. It is written on-chain and pool operators use the address as is."}):d.jsx(fe,{textStyle:"body.small",color:ce("text-caption"),mt:"base-tight",children:"This is your BTC address."})]})}function Sue({showPoxWrapperTermItem:e,...t}){return d.jsxs(It,{textStyle:["body.small","body.large"],spacing:"base-loose",pl:"base",...Cb("feedback-alert"),...t,children:[d.jsx(Ml,{title:"This transaction can’t be reversed",icon:d.jsx(ps,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"There will be no way to unlock your STX once the pool has started stacking them. You will need to wait until they unlock at the end of the pool's chosen number of cycles."})}),d.jsx(Ml,{title:"Research your pool",icon:d.jsx(kb,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"Paying out rewards is at the discretion of the pool. Make sure you’ve researched and trust the pool you’re using."})}),e&&d.jsx(Ml,{title:"Stacking with Pool Contract",icon:d.jsx(o6,{width:"16px",height:"16px"}),children:d.jsx(ie,{children:"The pool uses a smart contract that handles your stacking. By allowing the contract to call Stacking functions, you agree to the rules of the Pool contract."})})]})}function vue({isDisabled:e,poolName:t,hasUserConfirmedPoolWrapperContract:n}){var f;const{network:r,networkInstance:i}=Pt(),o=ju(r),u=Mo[t].poxContract,l=(f=n[i])==null?void 0:f[o[u]];return d.jsxs(It,{children:[d.jsxs(Yh,{type:"submit",isDisabled:e||l,children:["Step 1: Allow pool contract ",l?d.jsx(lW,{}):null]}),d.jsx(Yh,{type:"submit",isDisabled:e||!l,children:"Step 2: Confirm and start pooling"})]})}function xue({isLoading:e,requiresAllowContractCaller:t,allowContractCallerTxId:n,hasUserConfirmedPoolWrapperContract:r}){const[i,o]=$.useState(!1),a=ar();return d.jsxs(Sn,{title:"Confirm and pool",children:[d.jsx(Sue,{showPoxWrapperTermItem:t,mt:"loose"}),d.jsx(Qk,{onChange:u=>o(u)}),t&&a.values.poolName?d.jsx(vue,{hasUserConfirmedPoolWrapperContract:r,poolName:a.values.poolName,isDisabled:!i}):d.jsx(Yh,{type:"submit",isLoading:e,isDisabled:!i||t&&!n,children:"Confirm and start pooling"})]})}function s6(e){const{cycles:t,rewardCycleLength:n,firstBurnchainBlockHeight:r,currentCycleId:i}=e;return new Qt(r).plus(new Qt(i).plus(1).multipliedBy(n)).plus(new Qt(t).multipliedBy(n)).toNumber()}const _ue=({title:e,amountText:t})=>d.jsxs(xe,{flexDirection:"column",pt:"extra-loose",pb:"base-loose",children:[d.jsx(ie,{textStyle:"body.large.medium",color:ce("text-caption"),children:e}),d.jsx(ie,{fontSize:"24px",fontFamily:"Open Sauce",fontWeight:500,letterSpacing:"-0.02em",mt:"extra-tight",color:ce("text-caption"),children:t})]});function kue(e){var b;const t=ar(),n=rn(),{networkName:r,networkInstance:i}=Pt(),o=t.values.amount,a=t.values.delegationDurationType,u=t.values.poolName,l=u?Mo[u]:void 0,f=(l!=null&&l.poolAddress?l.poolAddress[i]:void 0)||t.values.poolAddress,p=(l!=null&&l.poxContract?_W(i,l.poxContract):void 0)||((b=n.data)==null?void 0:b.contract_id),m=t.values.delegationDurationType==="limited"?t.values.numberOfCycles:null,y=m&&n.data?s6({cycles:m,rewardCycleLength:n.data.reward_cycle_length,currentCycleId:n.data.current_cycle.id,firstBurnchainBlockHeight:n.data.first_burnchain_block_height}):null,w=Hg(o);return d.jsx(d.Fragment,{children:d.jsx(Ln,{...e,children:d.jsxs(fe,{mx:["loose","extra-loose"],sx:{},children:[d.jsx(_ue,{title:"You'll pool up to",amountText:w}),d.jsx(Pn,{}),d.jsxs(wr,{mt:"base-loose",mb:"extra-loose",children:[d.jsx(bt,{children:d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"How long you want to delegate to the pool. This is not necessarily the locking duration. However, the locking period cannot be longer than the delegation duration.",children:"Duration"}),d.jsxs(Ge,{children:[!a&&"—",a==="limited"&&Jk(m??0),a==="indefinite"&&"Indefinite"]})]})}),d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"How you want to delegate to the pool. This is not necessarily the locking duration. However, the locking period cannot be longer than the delegation duration.",children:"Type"}),d.jsxs(Ge,{children:[a===null&&"—",a==="limited"&&"Limited permission",a==="indefinite"&&"Indefinite"]})]}),y&&d.jsxs(Me,{children:[d.jsx(Ve,{children:"Burn height"}),d.jsx(Ge,{children:y})]})]}),d.jsxs(bt,{children:[d.jsxs(Me,{children:[d.jsx(Ve,{explainer:"This address is provided to you by your chosen pool for Stacking delegation specifically.",children:"Pool address"}),d.jsx(Ge,{children:f?Mi(f):"—"})]}),d.jsxs(Me,{children:[d.jsx(Ve,{children:"Contract"}),d.jsx(Ge,{children:p&&d.jsx($r,{href:xk(p,r),children:Mi(p)})})]})]})]})]})})})}function Rue({timeUntilNextCycle:e}){return d.jsxs(d.Fragment,{children:[d.jsx(Jo,{children:"Stack in a pool"}),d.jsx(Rb,{mt:"extra-loose",timeUntilNextCycle:e})]})}function Tue({handleDelegateStxSubmit:e,handleAllowContractCallerSubmit:t,hasUserConfirmedPoolWrapperContract:n,setHasUserConfirmedPoolWrapperContract:r,network:i}){return async function(a){var u;if(a.poolName&&vW(a.poolName)){const l=xW(a.poolName,i),f=Gw(i);if((u=n[f])!=null&&u[l]){e(a);return}else{t({poxWrapperContract:l,onFinish:()=>{r({...n,[f]:{...n[f],[l]:!0}})}});return}}else{e(a);return}}}function Oue(e,t,n){const[r,i]=t.split("."),o=[no(e),Rr()];return{contractAddress:r,contractName:i,functionName:"allow-contract-caller",functionArgs:o,network:n}}function Nue({client:e,network:t,setIsContractCallExtensionPageOpen:n}){return async function({poxWrapperContract:i,onFinish:o}){const[a]=await Promise.all([e.getStackingContract()]),u=Oue(i,a,t);Do({...u,onFinish(){n(!1),o()},onCancel(){n(!1)}}),n(!0)}}function Cue(e){return li().shape({poolAddress:cn(),amount:mp().test({name:"test-min-allowed-delegated-stacking",message:"You must delegate at least the pool's minimum.",test(t,n){const r=n.parent.poolName;if(!r)return!0;const i=Mo[r].minimumDelegationAmount;return Un(t||0).isLessThan(i)?n.createError({message:`You must delegate at least ${Jt(i)}`}):!0}}).test({name:"test-max-allowed-delegated-stacking",message:`You cannot delegate more than ${Jt($h)}`,test(t){return t===void 0?!1:Un(t).isLessThanOrEqualTo($h)}}),delegationDurationType:cn().required("Please select the delegation duration type.")})}function Eue(e,t,n,r,i){var f;const o=e.delegationDurationType==="limited"?s6({cycles:e.numberOfCycles,rewardCycleLength:t.reward_cycle_length,currentCycleId:t.current_cycle.id,firstBurnchainBlockHeight:t.first_burnchain_block_height}):void 0,a=e.poolName?Mo[e.poolName]:void 0;if(!a)throw new Error("Invalid Pool Name");const u=Gw(i),l=((f=a.poolAddress)==null?void 0:f[u])||e.poolAddress;if(e.poolName===es.CustomPool)return r.getDelegateOptions({contract:n,amountMicroStx:Un(e.amount).toString(),delegateTo:l,untilBurnBlockHeight:o});{const[p,m]=kW(u,a.poxContract);let y;switch(a.poxContract){case wt.WrapperOneCycle:y=[ft(Un(e.amount).toString()),no(l),o?Xi(ft(o)):Rr(),Rr(),xi(e.rewardAddress),Rr()];break;case wt.WrapperFastPool:case wt.WrapperRestake:y=[ft(Un(e.amount).toString())];break;default:y=[]}return{contractAddress:p,contractName:m,functionName:"delegate-stx",functionArgs:y,network:i}}}function Aue({client:e,network:t,setIsContractCallExtensionPageOpen:n,navigate:r}){return async function(o){const[a,u]=await Promise.all([e.getPoxInfo(),e.getStackingContract()]),l=Eue(o,a,u,e,t);Do({...l,onFinish(){n(!1),r("../pooled-stacking-info")},onCancel(){n(!1)}}),n(!0)}}const Fue={amount:"",poolAddress:"",delegationDurationType:void 0,numberOfCycles:1};function Iue(){const{client:e}=kn(),{address:t,btcAddressP2tr:n,btcAddressP2wpkh:r}=Mn(),{networkName:i}=Pt();if(!t){const o="Expected `address` to be defined.";return console.error(o),d.jsx(Mt,{children:o})}if(!e){const o="Expected `client` to be defined.";return console.error(o),d.jsx(Mt,{children:o})}if(!i){const o="Expected `networkName` to be defined.";return console.error(o),d.jsx(Mt,{children:o})}return d.jsx(Pue,{client:e,currentAccountAddresses:{address:t,btcAddressP2tr:n,btcAddressP2wpkh:r},networkName:i})}function Pue({client:e,networkName:t,currentAccountAddresses:n}){var C,M,J;const{network:r,networkInstance:i}=Pt(),o=ju(r),[a,u]=$.useState(!1),[l,f]=$.useState(!0),[p,m]=$.useState(!0),[y,w]=$.useState(!0),b=Gu(),x=xx(o[wt.WrapperFastPool]),_=xx(o[wt.WrapperRestake]),O=xx(o[wt.WrapperOneCycle]),[N,E]=$.useState({});$.useEffect(()=>{E(P=>{var D,q,K;return{...P,[i]:{[o[wt.Pox4]]:!0,[o[wt.WrapperFastPool]]:((D=x==null?void 0:x.data)==null?void 0:D.type)===we.OptionalSome,[o[wt.WrapperRestake]]:((q=_==null?void 0:_.data)==null?void 0:q.type)===we.OptionalSome,[o[wt.WrapperOneCycle]]:((K=O==null?void 0:O.data)==null?void 0:K.type)===we.OptionalSome}}})},[o,i,(C=x==null?void 0:x.data)==null?void 0:C.type,(M=_==null?void 0:_.data)==null?void 0:M.type,(J=O==null?void 0:O.data)==null?void 0:J.type,E]);const T=Yn(),B=Cue({currentAccountAddress:n.address,networkName:t}),A=Aue({client:e,network:r,navigate:T,setIsContractCallExtensionPageOpen:u}),U=Nue({client:e,network:r,setIsContractCallExtensionPageOpen:u}),v=Tue({handleDelegateStxSubmit:A,handleAllowContractCallerSubmit:U,hasUserConfirmedPoolWrapperContract:N,setHasUserConfirmedPoolWrapperContract:E,network:r}),R=P=>{if(P===es.CustomPool)f(!0),m(!1),w(!1);else{const D=Mo[P];f(D.payoutMethod===Vd.BTC&&D.allowCustomRewardAddress===!0),m(D.payoutMethod==="BTC"),w(qP(D))}};if(b.isLoading)return d.jsx(br,{});if(b.isError||typeof b.data!="number"){const P="0106e9bf-ae2f-4fcc-bf00-5fe083001adb",D="Failed to load necessary data.";return console.error(P,D),d.jsx(Mt,{id:P,children:D})}return d.jsx(Bi,{initialValues:{...Fue,rewardAddress:n.btcAddressP2wpkh},onSubmit:v,validationSchema:B,children:d.jsx(Kk,{intro:d.jsx(Rue,{timeUntilNextCycle:b.data}),stackingInfoPanel:d.jsx(vs,{children:d.jsx(kue,{})}),stackingForm:d.jsx(d.Fragment,{children:d.jsx(ui,{children:d.jsxs(Kl,{children:[d.jsx(wue,{onPoolChange:R}),p?d.jsx(bue,{btcAddress:n.btcAddressP2wpkh||"",editable:l||!n.btcAddressP2wpkh}):null,d.jsx(lue,{}),d.jsx(mue,{}),d.jsx(xue,{isLoading:a,allowContractCallerTxId:"",requiresAllowContractCaller:y,hasUserConfirmedPoolWrapperContract:N})]})})})})})}const Mue=new k7({defaultOptions:{queries:{refetchInterval:1e3*60,refetchOnWindowFocus:!1}}});function Lue(){$.useEffect(()=>void gZ(),[]);const[e]=cj(),t=e.get("chain"),n=e.get("api"),r=t||"mainnet",i=n;return d.jsx(I7,{client:Mue,children:d.jsx(JW,{cookies:LP?document==null?void 0:document.cookie:"",apiUrls:j0,queryNetworkMode:r,queryApiUrl:i,children:d.jsx(sZ,{children:d.jsx(aZ,{children:d.jsx($W,{children:d.jsxs(DJ,{children:[zJ,d.jsx(s_,{})]})})})})})})}const Bue=nj([{path:"/",element:d.jsx(Lue,{}),children:[{index:!0,element:d.jsx(Kw,{to:"sign-in"})},{path:"sign-in",element:d.jsx(j3,{}),children:[{index:!0,element:d.jsx(Poe,{})}]},{element:d.jsx(yZ,{}),children:[{element:d.jsx(j3,{}),children:[{path:"choose-stacking-method",element:d.jsx(Dee,{})},{path:"start-pooled-stacking",element:d.jsx(Iue,{})},{path:"pooled-stacking-info",element:d.jsx(ice,{})},{path:"start-direct-stacking",element:d.jsx(Wce,{})},{path:"direct-stacking-info",element:d.jsx(Koe,{})},{path:"start-liquid-stacking",element:d.jsx(cue,{})},{path:"lock-more-stx",element:d.jsx(Ice,{})},{path:"extend-stacking",element:d.jsx(Tce,{})},{path:"self-service-extend",element:d.jsx(dce,{})},{path:"signer",children:[{index:!0,element:d.jsx(xce,{})},{path:"generate-signature",element:d.jsx(Sce,{})}]},{path:"pool/:poolAddress",element:d.jsx(CI,{})},{path:"pool-admin",children:[{index:!0,element:d.jsx(CI,{})},{path:"delegate-stack-stx",element:d.jsx(Eae,{})},{path:"delegate-stack-extend",element:d.jsx(pae,{})},{path:"delegate-stack-increase",element:d.jsx(_ae,{})},{path:"stack-aggregation-commit",element:d.jsx(jae,{})},{path:"stack-aggregation-increase",element:d.jsx(zae,{})}]},{path:"settings",children:[{path:"add-network",element:d.jsx(Aoe,{})},{path:"network",element:d.jsx(Foe,{})}]}]}]}]}]);function jue(){return console.log("aaaaaaaaaaaaaa"),d.jsx(WB,{router:Bue})}BigInt.prototype.toJSON=function(){return this.toString()};UL.createRoot(document.getElementById("root")).render(d.jsx(lt.StrictMode,{children:d.jsx(jue,{})}));export{nle as a,y8 as g,iX as h,rle as r,tle as s}; diff --git a/index.html b/index.html index d48c6de..24dce95 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Stacking - +