@babylonlabs-io/core-ui 1.35.2 → 1.35.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),p=require("react"),N=require("tailwind-merge"),Ei=require("react-dom");function Ai(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Bt=Ai(p),wa=Ai(Ei);function zt({value:e,defaultValue:t,onStateChange:r}={}){const[n,s]=p.useState(t),{current:i}=p.useRef(e!=null),a=i?e:n,o=p.useCallback(c=>{i||s(c),r==null||r(c)},[i,r,s]);return[a,o]}const Wn=p.createContext({disabled:!1,expanded:!1});function ja({expanded:e,defaultExpanded:t,onChange:r,className:n,disabled:s=!1,fluid:i=!1,children:a}){const[o=!1,c]=zt({value:e,defaultValue:t,onStateChange:r}),f=p.useCallback(()=>{c(!o)},[c,o]),u=p.useMemo(()=>({defaultExpanded:t,disabled:s,expanded:o&&!s,toggle:s?void 0:f}),[t,o,s,f]);return l.jsx(Wn.Provider,{value:u,children:l.jsx("div",{className:N.twJoin("bbn-accordion",s&&"bbn-accordion-disabled",i&&"bbn-accordion-fluid",n),children:a})})}const Me=p.forwardRef(({variant:e="contained",size:t="large",color:r="primary",fluid:n=!1,className:s,disabled:i,...a},o)=>l.jsx("button",{...a,disabled:i,ref:o,className:N.twJoin("bbn-btn",`bbn-btn-${e}`,`bbn-btn-${r}`,`bbn-btn-${t}`,n&&"bbn-btn-fluid",s)}));Me.displayName="Button";const zn=p.forwardRef(({variant:e="outlined",size:t="large",className:r,...n},s)=>l.jsx("button",{...n,ref:s,className:N.twJoin("bbn-btn-icon",`bbn-btn-icon-${e}`,`bbn-btn-icon-${t}`,r)})),Jn=p.forwardRef(({className:e,...t},r)=>l.jsx(Me,{...t,ref:r,variant:"contained",className:N.twJoin("!bg-error-main text-white font-medium !text-sm hover:!bg-error-main/90 transition-colors",e)}));Jn.displayName="WalletDisconnectButton";function Ca({className:e,iconClassName:t,iconProps:r,children:n,renderIcon:s=()=>null}){const{expanded:i,toggle:a}=p.useContext(Wn),o=s(i);return l.jsxs("div",{className:N.twJoin("bbn-accordion-summary",e),onClick:a,children:[n,o&&l.jsx(zn,{className:N.twJoin("bbn-accordion-icon",t),...r,children:o})]})}function Un(e,t){return typeof e!="number"?typeof t=="number"?Un(t):t:`${e}px`}function Na(e=!0){const[t,r]=p.useState("0px"),[n,s]=p.useState(),i=p.useRef(null);return p.useEffect(()=>{const a=new ResizeObserver(o=>{const[c]=o;r(Un(c.target.clientHeight)??"0px")});s(a)},[]),p.useEffect(function(){const{current:o}=i;if(!(!e||!o))return n==null||n.observe(o),()=>{n==null||n.unobserve(o)}},[e,n]),{height:t,ref:i}}function Sa({unmountOnExit:e=!1,animationDuration:t=200,className:r,wrapperClassName:n,children:s}){const{expanded:i}=p.useContext(Wn),[a,o]=p.useState(i),c=a||!e,{height:f,ref:u}=Na(c);return p.useEffect(function(){if(i===a)return;if(i){o(!0);return}const h=setTimeout(o,t,!1);return()=>{clearTimeout(h)}},[i,a,t]),l.jsx("div",{className:N.twJoin("bbn-accordion-details",n),style:{height:i?f:"0px",visibility:a?"visible":"hidden",transitionDuration:`${t}ms`},children:c?l.jsx("div",{ref:u,className:N.twJoin("bbn-accordion-content",r),children:s}):null})}const X=p.forwardRef(({variant:e="body1",as:t="p",children:r,className:n,...s},i)=>p.createElement(t,{...s,ref:i,className:N.twJoin(`bbn-text-${e}`,n)},r));X.displayName="Text";const dn=p.forwardRef(({variant:e,as:t=e,children:r,className:n,...s},i)=>p.createElement(t,{...s,ref:i,className:N.twJoin(`bbn-${e}`,n)},r));dn.displayName="Heading";function or({className:e,style:t,size:r="large",variant:n="circular",alt:s,url:i,children:a}){return l.jsx("div",{style:t,className:N.twJoin("bbn-avatar",`bbn-avatar-${r}`,`bbn-avatar-${n}`,e),children:i?l.jsx("img",{className:"bbn-avatar-img",src:i,alt:s}):a})}const Ea=({max:e=1/0,className:t,children:r,avatarClassName:n,variant:s,...i})=>{const a=p.Children.count(r);return l.jsxs("div",{className:N.twJoin("bbn-avatar-group",t),children:[p.Children.map(r,(o,c)=>p.isValidElement(o)&&c+1<=e?p.cloneElement(o,{...i,className:N.twMerge(n,o.props.className),variant:s}):null),a>e&&l.jsxs(or,{size:i.size,variant:s,className:n,children:["+",a-e]})]})};function Aa({url:e,name:t,variant:r="rounded",size:n="large",...s}){return l.jsx(or,{...s,url:e,alt:t,variant:r,size:n,children:l.jsx(X,{as:"span",className:"inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast",children:(t==null?void 0:t.charAt(0).toUpperCase())||"?"})})}const Oi=p.forwardRef(function({label:t,checked:r,defaultChecked:n=!1,inputProps:s,orientation:i="left",disabled:a=!1,className:o,inputType:c,labelClassName:f,renderIcon:u,onChange:d,...h},v){const[g=!1,x]=zt({value:r,defaultValue:n,onStateChange:d});function b(w){var E;x(w.currentTarget.checked),(E=s==null?void 0:s.onChange)==null||E.call(s,w)}const C=l.jsxs("span",{className:N.twJoin("bbn-switcher",a&&"bbn-switcher-disabled",o),children:[u(g),l.jsx("input",{ref:v,type:c,disabled:a,className:"bbn-switcher-input",...h,...s,checked:g,onChange:b})]});return t?l.jsxs(X,{as:"label",variant:"body1",className:N.twJoin("bbn-switcher-label",i==="left"?"bbn-switcher-left":"bbn-switcher-right",f),children:[C,t]}):C}),Oa={false:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z",fill:"currentColor"})}),true:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M19 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.11 21 21 20.1 21 19V5C21 3.9 20.11 3 19 3ZM10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",fill:"currentColor"})})},ki=p.forwardRef(function(t,r){return l.jsx(Oi,{ref:r,...t,inputType:"checkbox",renderIcon:n=>Oa[n.toString()]})}),ka={true:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M12 7C9.24 7 7 9.24 7 12C7 14.76 9.24 17 12 17C14.76 17 17 14.76 17 12C17 9.24 14.76 7 12 7ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z",fill:"currentColor"})}),false:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z",fill:"currentColor"})})},Li=p.forwardRef(function(t,r){return l.jsx(Oi,{ref:r,...t,inputType:"radio",renderIcon:n=>ka[n.toString()]})});var _i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Rs=p.createContext&&p.createContext(_i),La=["attr","size","title"];function _a(e,t){if(e==null)return{};var r=Fa(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fa(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Qr(){return Qr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qr.apply(this,arguments)}function Ms(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function en(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ms(Object(r),!0).forEach(function(n){Ta(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ms(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ta(e,t,r){return t=Ra(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ra(e){var t=Ma(e,"string");return typeof t=="symbol"?t:t+""}function Ma(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fi(e){return e&&e.map((t,r)=>p.createElement(t.tag,en({key:r},t.attr),Fi(t.child)))}function Ft(e){return t=>p.createElement(Da,Qr({attr:en({},e.attr)},t),Fi(e.child))}function Da(e){var t=r=>{var{attr:n,size:s,title:i}=e,a=_a(e,La),o=s||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),p.createElement("svg",Qr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,a,{className:c,style:en(en({color:e.color||r.color},r.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),i&&p.createElement("title",null,i),e.children)};return Rs!==void 0?p.createElement(Rs.Consumer,null,r=>t(r)):t(_i)}function Va(e){return Ft({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 16L6 10H18L12 16Z"},child:[]}]})(e)}function Ia(e){return Ft({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"},child:[]}]})(e)}function Ba(e){return Ft({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 8L18 14H6L12 8Z"},child:[]}]})(e)}function Pa(e){return Ft({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"},child:[]}]})(e)}var Ds=function(t){return t.reduce(function(r,n){var s=n[0],i=n[1];return r[s]=i,r},{})},Vs=typeof window<"u"&&window.document&&window.document.createElement?Bt.useLayoutEffect:Bt.useEffect,Te="top",Qe="bottom",et="right",Re="left",qn="auto",Tr=[Te,Qe,et,Re],ar="start",kr="end",$a="clippingParents",Ti="viewport",jr="popper",Ha="reference",Is=Tr.reduce(function(e,t){return e.concat([t+"-"+ar,t+"-"+kr])},[]),Ri=[].concat(Tr,[qn]).reduce(function(e,t){return e.concat([t,t+"-"+ar,t+"-"+kr])},[]),Wa="beforeRead",za="read",Ja="afterRead",Ua="beforeMain",qa="main",Za="afterMain",Xa="beforeWrite",Ya="write",Ka="afterWrite",Ga=[Wa,za,Ja,Ua,qa,Za,Xa,Ya,Ka];function vt(e){return e?(e.nodeName||"").toLowerCase():null}function We(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Jt(e){var t=We(e).Element;return e instanceof t||e instanceof Element}function Ge(e){var t=We(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Zn(e){if(typeof ShadowRoot>"u")return!1;var t=We(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Qa(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},s=t.attributes[r]||{},i=t.elements[r];!Ge(i)||!vt(i)||(Object.assign(i.style,n),Object.keys(s).forEach(function(a){var o=s[a];o===!1?i.removeAttribute(a):i.setAttribute(a,o===!0?"":o)}))})}function el(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var s=t.elements[n],i=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),o=a.reduce(function(c,f){return c[f]="",c},{});!Ge(s)||!vt(s)||(Object.assign(s.style,o),Object.keys(i).forEach(function(c){s.removeAttribute(c)}))})}}const tl={name:"applyStyles",enabled:!0,phase:"write",fn:Qa,effect:el,requires:["computeStyles"]};function pt(e){return e.split("-")[0]}var $t=Math.max,tn=Math.min,lr=Math.round;function _n(){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 Mi(){return!/^((?!chrome|android).)*safari/i.test(_n())}function cr(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),s=1,i=1;t&&Ge(e)&&(s=e.offsetWidth>0&&lr(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&lr(n.height)/e.offsetHeight||1);var a=Jt(e)?We(e):window,o=a.visualViewport,c=!Mi()&&r,f=(n.left+(c&&o?o.offsetLeft:0))/s,u=(n.top+(c&&o?o.offsetTop:0))/i,d=n.width/s,h=n.height/i;return{width:d,height:h,top:u,right:f+d,bottom:u+h,left:f,x:f,y:u}}function Xn(e){var t=cr(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Di(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Zn(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Et(e){return We(e).getComputedStyle(e)}function rl(e){return["table","td","th"].indexOf(vt(e))>=0}function Tt(e){return((Jt(e)?e.ownerDocument:e.document)||window.document).documentElement}function mn(e){return vt(e)==="html"?e:e.assignedSlot||e.parentNode||(Zn(e)?e.host:null)||Tt(e)}function Bs(e){return!Ge(e)||Et(e).position==="fixed"?null:e.offsetParent}function nl(e){var t=/firefox/i.test(_n()),r=/Trident/i.test(_n());if(r&&Ge(e)){var n=Et(e);if(n.position==="fixed")return null}var s=mn(e);for(Zn(s)&&(s=s.host);Ge(s)&&["html","body"].indexOf(vt(s))<0;){var i=Et(s);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return s;s=s.parentNode}return null}function Rr(e){for(var t=We(e),r=Bs(e);r&&rl(r)&&Et(r).position==="static";)r=Bs(r);return r&&(vt(r)==="html"||vt(r)==="body"&&Et(r).position==="static")?t:r||nl(e)||t}function Yn(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Sr(e,t,r){return $t(e,tn(t,r))}function sl(e,t,r){var n=Sr(e,t,r);return n>r?r:n}function Vi(){return{top:0,right:0,bottom:0,left:0}}function Ii(e){return Object.assign({},Vi(),e)}function Bi(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var il=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Ii(typeof t!="number"?t:Bi(t,Tr))};function ol(e){var t,r=e.state,n=e.name,s=e.options,i=r.elements.arrow,a=r.modifiersData.popperOffsets,o=pt(r.placement),c=Yn(o),f=[Re,et].indexOf(o)>=0,u=f?"height":"width";if(!(!i||!a)){var d=il(s.padding,r),h=Xn(i),v=c==="y"?Te:Re,g=c==="y"?Qe:et,x=r.rects.reference[u]+r.rects.reference[c]-a[c]-r.rects.popper[u],b=a[c]-r.rects.reference[c],C=Rr(i),w=C?c==="y"?C.clientHeight||0:C.clientWidth||0:0,E=x/2-b/2,S=d[v],A=w-h[u]-d[g],O=w/2-h[u]/2+E,k=Sr(S,O,A),$=c;r.modifiersData[n]=(t={},t[$]=k,t.centerOffset=k-O,t)}}function al(e){var t=e.state,r=e.options,n=r.element,s=n===void 0?"[data-popper-arrow]":n;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Di(t.elements.popper,s)&&(t.elements.arrow=s))}const ll={name:"arrow",enabled:!0,phase:"main",fn:ol,effect:al,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ur(e){return e.split("-")[1]}var cl={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ul(e,t){var r=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:lr(r*s)/s||0,y:lr(n*s)/s||0}}function Ps(e){var t,r=e.popper,n=e.popperRect,s=e.placement,i=e.variation,a=e.offsets,o=e.position,c=e.gpuAcceleration,f=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=a.x,v=h===void 0?0:h,g=a.y,x=g===void 0?0:g,b=typeof u=="function"?u({x:v,y:x}):{x:v,y:x};v=b.x,x=b.y;var C=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),E=Re,S=Te,A=window;if(f){var O=Rr(r),k="clientHeight",$="clientWidth";if(O===We(r)&&(O=Tt(r),Et(O).position!=="static"&&o==="absolute"&&(k="scrollHeight",$="scrollWidth")),O=O,s===Te||(s===Re||s===et)&&i===kr){S=Qe;var I=d&&O===A&&A.visualViewport?A.visualViewport.height:O[k];x-=I-n.height,x*=c?1:-1}if(s===Re||(s===Te||s===Qe)&&i===kr){E=et;var W=d&&O===A&&A.visualViewport?A.visualViewport.width:O[$];v-=W-n.width,v*=c?1:-1}}var _=Object.assign({position:o},f&&cl),F=u===!0?ul({x:v,y:x},We(r)):{x:v,y:x};if(v=F.x,x=F.y,c){var P;return Object.assign({},_,(P={},P[S]=w?"0":"",P[E]=C?"0":"",P.transform=(A.devicePixelRatio||1)<=1?"translate("+v+"px, "+x+"px)":"translate3d("+v+"px, "+x+"px, 0)",P))}return Object.assign({},_,(t={},t[S]=w?x+"px":"",t[E]=C?v+"px":"",t.transform="",t))}function fl(e){var t=e.state,r=e.options,n=r.gpuAcceleration,s=n===void 0?!0:n,i=r.adaptive,a=i===void 0?!0:i,o=r.roundOffsets,c=o===void 0?!0:o,f={placement:pt(t.placement),variation:ur(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ps(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ps(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const dl={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:fl,data:{}};var Ur={passive:!0};function ml(e){var t=e.state,r=e.instance,n=e.options,s=n.scroll,i=s===void 0?!0:s,a=n.resize,o=a===void 0?!0:a,c=We(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach(function(u){u.addEventListener("scroll",r.update,Ur)}),o&&c.addEventListener("resize",r.update,Ur),function(){i&&f.forEach(function(u){u.removeEventListener("scroll",r.update,Ur)}),o&&c.removeEventListener("resize",r.update,Ur)}}const pl={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ml,data:{}};var hl={left:"right",right:"left",bottom:"top",top:"bottom"};function Xr(e){return e.replace(/left|right|bottom|top/g,function(t){return hl[t]})}var vl={start:"end",end:"start"};function $s(e){return e.replace(/start|end/g,function(t){return vl[t]})}function Kn(e){var t=We(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Gn(e){return cr(Tt(e)).left+Kn(e).scrollLeft}function xl(e,t){var r=We(e),n=Tt(e),s=r.visualViewport,i=n.clientWidth,a=n.clientHeight,o=0,c=0;if(s){i=s.width,a=s.height;var f=Mi();(f||!f&&t==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}return{width:i,height:a,x:o+Gn(e),y:c}}function gl(e){var t,r=Tt(e),n=Kn(e),s=(t=e.ownerDocument)==null?void 0:t.body,i=$t(r.scrollWidth,r.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=$t(r.scrollHeight,r.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),o=-n.scrollLeft+Gn(e),c=-n.scrollTop;return Et(s||r).direction==="rtl"&&(o+=$t(r.clientWidth,s?s.clientWidth:0)-i),{width:i,height:a,x:o,y:c}}function Qn(e){var t=Et(e),r=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+s+n)}function Pi(e){return["html","body","#document"].indexOf(vt(e))>=0?e.ownerDocument.body:Ge(e)&&Qn(e)?e:Pi(mn(e))}function Er(e,t){var r;t===void 0&&(t=[]);var n=Pi(e),s=n===((r=e.ownerDocument)==null?void 0:r.body),i=We(n),a=s?[i].concat(i.visualViewport||[],Qn(n)?n:[]):n,o=t.concat(a);return s?o:o.concat(Er(mn(a)))}function Fn(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function yl(e,t){var r=cr(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function Hs(e,t,r){return t===Ti?Fn(xl(e,r)):Jt(t)?yl(t,r):Fn(gl(Tt(e)))}function bl(e){var t=Er(mn(e)),r=["absolute","fixed"].indexOf(Et(e).position)>=0,n=r&&Ge(e)?Rr(e):e;return Jt(n)?t.filter(function(s){return Jt(s)&&Di(s,n)&&vt(s)!=="body"}):[]}function wl(e,t,r,n){var s=t==="clippingParents"?bl(e):[].concat(t),i=[].concat(s,[r]),a=i[0],o=i.reduce(function(c,f){var u=Hs(e,f,n);return c.top=$t(u.top,c.top),c.right=tn(u.right,c.right),c.bottom=tn(u.bottom,c.bottom),c.left=$t(u.left,c.left),c},Hs(e,a,n));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function $i(e){var t=e.reference,r=e.element,n=e.placement,s=n?pt(n):null,i=n?ur(n):null,a=t.x+t.width/2-r.width/2,o=t.y+t.height/2-r.height/2,c;switch(s){case Te:c={x:a,y:t.y-r.height};break;case Qe:c={x:a,y:t.y+t.height};break;case et:c={x:t.x+t.width,y:o};break;case Re:c={x:t.x-r.width,y:o};break;default:c={x:t.x,y:t.y}}var f=s?Yn(s):null;if(f!=null){var u=f==="y"?"height":"width";switch(i){case ar:c[f]=c[f]-(t[u]/2-r[u]/2);break;case kr:c[f]=c[f]+(t[u]/2-r[u]/2);break}}return c}function Lr(e,t){t===void 0&&(t={});var r=t,n=r.placement,s=n===void 0?e.placement:n,i=r.strategy,a=i===void 0?e.strategy:i,o=r.boundary,c=o===void 0?$a:o,f=r.rootBoundary,u=f===void 0?Ti:f,d=r.elementContext,h=d===void 0?jr:d,v=r.altBoundary,g=v===void 0?!1:v,x=r.padding,b=x===void 0?0:x,C=Ii(typeof b!="number"?b:Bi(b,Tr)),w=h===jr?Ha:jr,E=e.rects.popper,S=e.elements[g?w:h],A=wl(Jt(S)?S:S.contextElement||Tt(e.elements.popper),c,u,a),O=cr(e.elements.reference),k=$i({reference:O,element:E,placement:s}),$=Fn(Object.assign({},E,k)),I=h===jr?$:O,W={top:A.top-I.top+C.top,bottom:I.bottom-A.bottom+C.bottom,left:A.left-I.left+C.left,right:I.right-A.right+C.right},_=e.modifiersData.offset;if(h===jr&&_){var F=_[s];Object.keys(W).forEach(function(P){var H=[et,Qe].indexOf(P)>=0?1:-1,Y=[Te,Qe].indexOf(P)>=0?"y":"x";W[P]+=F[Y]*H})}return W}function jl(e,t){t===void 0&&(t={});var r=t,n=r.placement,s=r.boundary,i=r.rootBoundary,a=r.padding,o=r.flipVariations,c=r.allowedAutoPlacements,f=c===void 0?Ri:c,u=ur(n),d=u?o?Is:Is.filter(function(g){return ur(g)===u}):Tr,h=d.filter(function(g){return f.indexOf(g)>=0});h.length===0&&(h=d);var v=h.reduce(function(g,x){return g[x]=Lr(e,{placement:x,boundary:s,rootBoundary:i,padding:a})[pt(x)],g},{});return Object.keys(v).sort(function(g,x){return v[g]-v[x]})}function Cl(e){if(pt(e)===qn)return[];var t=Xr(e);return[$s(e),t,$s(t)]}function Nl(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var s=r.mainAxis,i=s===void 0?!0:s,a=r.altAxis,o=a===void 0?!0:a,c=r.fallbackPlacements,f=r.padding,u=r.boundary,d=r.rootBoundary,h=r.altBoundary,v=r.flipVariations,g=v===void 0?!0:v,x=r.allowedAutoPlacements,b=t.options.placement,C=pt(b),w=C===b,E=c||(w||!g?[Xr(b)]:Cl(b)),S=[b].concat(E).reduce(function(De,Ne){return De.concat(pt(Ne)===qn?jl(t,{placement:Ne,boundary:u,rootBoundary:d,padding:f,flipVariations:g,allowedAutoPlacements:x}):Ne)},[]),A=t.rects.reference,O=t.rects.popper,k=new Map,$=!0,I=S[0],W=0;W<S.length;W++){var _=S[W],F=pt(_),P=ur(_)===ar,H=[Te,Qe].indexOf(F)>=0,Y=H?"width":"height",J=Lr(t,{placement:_,boundary:u,rootBoundary:d,altBoundary:h,padding:f}),q=H?P?et:Re:P?Qe:Te;A[Y]>O[Y]&&(q=Xr(q));var G=Xr(q),te=[];if(i&&te.push(J[F]<=0),o&&te.push(J[q]<=0,J[G]<=0),te.every(function(De){return De})){I=_,$=!1;break}k.set(_,te)}if($)for(var ue=g?3:1,re=function(Ne){var _e=S.find(function(Je){var Se=k.get(Je);if(Se)return Se.slice(0,Ne).every(function(ce){return ce})});if(_e)return I=_e,"break"},fe=ue;fe>0;fe--){var Le=re(fe);if(Le==="break")break}t.placement!==I&&(t.modifiersData[n]._skip=!0,t.placement=I,t.reset=!0)}}const Sl={name:"flip",enabled:!0,phase:"main",fn:Nl,requiresIfExists:["offset"],data:{_skip:!1}};function Ws(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function zs(e){return[Te,et,Qe,Re].some(function(t){return e[t]>=0})}function El(e){var t=e.state,r=e.name,n=t.rects.reference,s=t.rects.popper,i=t.modifiersData.preventOverflow,a=Lr(t,{elementContext:"reference"}),o=Lr(t,{altBoundary:!0}),c=Ws(a,n),f=Ws(o,s,i),u=zs(c),d=zs(f);t.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const Al={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:El};function Ol(e,t,r){var n=pt(e),s=[Re,Te].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,a=i[0],o=i[1];return a=a||0,o=(o||0)*s,[Re,et].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}function kl(e){var t=e.state,r=e.options,n=e.name,s=r.offset,i=s===void 0?[0,0]:s,a=Ri.reduce(function(u,d){return u[d]=Ol(d,t.rects,i),u},{}),o=a[t.placement],c=o.x,f=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=f),t.modifiersData[n]=a}const Ll={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:kl};function _l(e){var t=e.state,r=e.name;t.modifiersData[r]=$i({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Fl={name:"popperOffsets",enabled:!0,phase:"read",fn:_l,data:{}};function Tl(e){return e==="x"?"y":"x"}function Rl(e){var t=e.state,r=e.options,n=e.name,s=r.mainAxis,i=s===void 0?!0:s,a=r.altAxis,o=a===void 0?!1:a,c=r.boundary,f=r.rootBoundary,u=r.altBoundary,d=r.padding,h=r.tether,v=h===void 0?!0:h,g=r.tetherOffset,x=g===void 0?0:g,b=Lr(t,{boundary:c,rootBoundary:f,padding:d,altBoundary:u}),C=pt(t.placement),w=ur(t.placement),E=!w,S=Yn(C),A=Tl(S),O=t.modifiersData.popperOffsets,k=t.rects.reference,$=t.rects.popper,I=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,W=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,F={x:0,y:0};if(O){if(i){var P,H=S==="y"?Te:Re,Y=S==="y"?Qe:et,J=S==="y"?"height":"width",q=O[S],G=q+b[H],te=q-b[Y],ue=v?-$[J]/2:0,re=w===ar?k[J]:$[J],fe=w===ar?-$[J]:-k[J],Le=t.elements.arrow,De=v&&Le?Xn(Le):{width:0,height:0},Ne=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Vi(),_e=Ne[H],Je=Ne[Y],Se=Sr(0,k[J],De[J]),ce=E?k[J]/2-ue-Se-_e-W.mainAxis:re-Se-_e-W.mainAxis,Ue=E?-k[J]/2+ue+Se+Je+W.mainAxis:fe+Se+Je+W.mainAxis,Ce=t.elements.arrow&&Rr(t.elements.arrow),Ve=Ce?S==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,lt=(P=_==null?void 0:_[S])!=null?P:0,Ie=q+ce-lt-Ve,At=q+Ue-lt,be=Sr(v?tn(G,Ie):G,q,v?$t(te,At):te);O[S]=be,F[S]=be-q}if(o){var bt,ct=S==="x"?Te:Re,qe=S==="x"?Qe:et,m=O[A],y=A==="y"?"height":"width",j=m+b[ct],R=m-b[qe],T=[Te,Re].indexOf(C)!==-1,L=(bt=_==null?void 0:_[A])!=null?bt:0,B=T?j:m-k[y]-$[y]-L+W.altAxis,K=T?m+k[y]+$[y]-L-W.altAxis:R,Q=v&&T?sl(B,m,K):Sr(v?B:j,m,v?K:R);O[A]=Q,F[A]=Q-m}t.modifiersData[n]=F}}const Ml={name:"preventOverflow",enabled:!0,phase:"main",fn:Rl,requiresIfExists:["offset"]};function Dl(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Vl(e){return e===We(e)||!Ge(e)?Kn(e):Dl(e)}function Il(e){var t=e.getBoundingClientRect(),r=lr(t.width)/e.offsetWidth||1,n=lr(t.height)/e.offsetHeight||1;return r!==1||n!==1}function Bl(e,t,r){r===void 0&&(r=!1);var n=Ge(t),s=Ge(t)&&Il(t),i=Tt(t),a=cr(e,s,r),o={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((vt(t)!=="body"||Qn(i))&&(o=Vl(t)),Ge(t)?(c=cr(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=Gn(i))),{x:a.left+o.scrollLeft-c.x,y:a.top+o.scrollTop-c.y,width:a.width,height:a.height}}function Pl(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function s(i){r.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(o){if(!r.has(o)){var c=t.get(o);c&&s(c)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||s(i)}),n}function $l(e){var t=Pl(e);return Ga.reduce(function(r,n){return r.concat(t.filter(function(s){return s.phase===n}))},[])}function Hl(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function Wl(e){var t=e.reduce(function(r,n){var s=r[n.name];return r[n.name]=s?Object.assign({},s,n,{options:Object.assign({},s.options,n.options),data:Object.assign({},s.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var Js={placement:"bottom",modifiers:[],strategy:"absolute"};function Us(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function zl(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,s=t.defaultOptions,i=s===void 0?Js:s;return function(o,c,f){f===void 0&&(f=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Js,i),modifiersData:{},elements:{reference:o,popper:c},attributes:{},styles:{}},d=[],h=!1,v={state:u,setOptions:function(C){var w=typeof C=="function"?C(u.options):C;x(),u.options=Object.assign({},i,u.options,w),u.scrollParents={reference:Jt(o)?Er(o):o.contextElement?Er(o.contextElement):[],popper:Er(c)};var E=$l(Wl([].concat(n,u.options.modifiers)));return u.orderedModifiers=E.filter(function(S){return S.enabled}),g(),v.update()},forceUpdate:function(){if(!h){var C=u.elements,w=C.reference,E=C.popper;if(Us(w,E)){u.rects={reference:Bl(w,Rr(E),u.options.strategy==="fixed"),popper:Xn(E)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(W){return u.modifiersData[W.name]=Object.assign({},W.data)});for(var S=0;S<u.orderedModifiers.length;S++){if(u.reset===!0){u.reset=!1,S=-1;continue}var A=u.orderedModifiers[S],O=A.fn,k=A.options,$=k===void 0?{}:k,I=A.name;typeof O=="function"&&(u=O({state:u,options:$,name:I,instance:v})||u)}}}},update:Hl(function(){return new Promise(function(b){v.forceUpdate(),b(u)})}),destroy:function(){x(),h=!0}};if(!Us(o,c))return v;v.setOptions(f).then(function(b){!h&&f.onFirstUpdate&&f.onFirstUpdate(b)});function g(){u.orderedModifiers.forEach(function(b){var C=b.name,w=b.options,E=w===void 0?{}:w,S=b.effect;if(typeof S=="function"){var A=S({state:u,name:C,instance:v,options:E}),O=function(){};d.push(A||O)}})}function x(){d.forEach(function(b){return b()}),d=[]}return v}}var Jl=[pl,Fl,dl,tl,Ll,Sl,Ml,ll,Al],Ul=zl({defaultModifiers:Jl}),qr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function es(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ql=typeof Element<"u",Zl=typeof Map=="function",Xl=typeof Set=="function",Yl=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Yr(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Yr(e[n],t[n]))return!1;return!0}var i;if(Zl&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;for(i=e.entries();!(n=i.next()).done;)if(!Yr(n.value[1],t.get(n.value[0])))return!1;return!0}if(Xl&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(Yl&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(ql&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!Yr(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Kl=function(t,r){try{return Yr(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const Gl=es(Kl);var Ql=[],ec=function(t,r,n){n===void 0&&(n={});var s=Bt.useRef(null),i={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||Ql},a=Bt.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],c=a[1],f=Bt.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(v){var g=v.state,x=Object.keys(g.elements);wa.flushSync(function(){c({styles:Ds(x.map(function(b){return[b,g.styles[b]||{}]})),attributes:Ds(x.map(function(b){return[b,g.attributes[b]]}))})})},requires:["computeStyles"]}},[]),u=Bt.useMemo(function(){var h={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[f,{name:"applyStyles",enabled:!1}])};return Gl(s.current,h)?s.current||h:(s.current=h,h)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,f]),d=Bt.useRef();return Vs(function(){d.current&&d.current.setOptions(u)},[u]),Vs(function(){if(!(t==null||r==null)){var h=n.createPopper||Ul,v=h(t,r,u);return d.current=v,function(){v.destroy(),d.current=null}}},[t,r,n.createPopper]),{state:d.current?d.current.state:null,styles:o.styles,attributes:o.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};const Hi=p.createContext({portalContainer:null}),Wi=()=>p.useContext(Hi);function tc({children:e,portalContainer:t=null}){return l.jsx(Hi.Provider,{value:{portalContainer:t},children:e})}function Mr({children:e,mounted:t=!1,rootClassName:r="portal-root",inheritViewport:n=!0,pointerEvents:s="auto"}){const[i,a]=p.useState(null),{portalContainer:o}=Wi(),c=s==="none";return p.useEffect(()=>{if(!t){a(null);return}const f=document.createElement("div");if(f.className=r,n)if(r.includes("popover"))f.style.zIndex="9999",f.style.pointerEvents=c?"none":"auto";else{const d={position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",zIndex:"9999",pointerEvents:c?"none":"auto"};Object.assign(f.style,d)}const u=o||document.body;return u.appendChild(f),a(f),()=>{u.contains(f)&&u.removeChild(f)}},[t,r,n,c,o]),i?Ei.createPortal(e,i):null}function rc(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function zi(e){const t=p.useRef(e);return rc(t.current,e)||(t.current=e),t.current}function Ji(e,t=()=>null,{enabled:r=!0}={}){const n=Array.isArray(e)?e:[e],s=zi(n);p.useEffect(()=>{function i(a){r&&s.every(o=>!(o!=null&&o.contains(a.target)))&&t()}return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[s,r,t])}function pn({open:e=!1,className:t,anchorEl:r,placement:n="bottom-start",offset:s=[0,0],children:i,style:a,onClickOutside:o}){const[c,f]=p.useState(null),{styles:u}=ec(r,c,{placement:n,modifiers:[{name:"offset",options:{offset:s}}]});return Ji([c,r],o,{enabled:e}),l.jsx(Mr,{mounted:e,rootClassName:"popover-portal",children:l.jsx("div",{ref:f,style:{...u.popper,...a,pointerEvents:"auto"},className:N.twJoin("bbn-popover",t),children:i})})}function Ui(e){const[t,r]=p.useState({width:0,height:0});return p.useEffect(()=>{if(!e){r({width:0,height:0});return}const n=new ResizeObserver(([s])=>{r({width:s.target.clientWidth,height:s.target.clientHeight})});return n.observe(e),()=>{n.unobserve(e)}},[e]),t}const nc=e=>e.label,ts=p.forwardRef(({disabled:e,className:t,value:r,defaultValue:n,placeholder:s="Select option",open:i,defaultOpen:a,options:o=[],optionClassName:c,popoverClassName:f,state:u="default",onOpen:d,onSelect:h,onClose:v,renderSelectedOption:g=nc,...x},b)=>{const C=p.useRef(null);p.useImperativeHandle(b,()=>C.current,[]);const{width:w}=Ui(C.current),[E,S]=zt({value:i,defaultValue:a,onStateChange:_=>void(_?d==null?void 0:d():v==null?void 0:v())}),[A,O]=zt({value:r,defaultValue:n,onStateChange:h}),k=p.useMemo(()=>o.find(_=>_.value===A),[o,A]),$=p.useCallback(_=>{O(_.value),S(!1)},[O,S]),I=p.useCallback(()=>{S(!1)},[S]),W=p.useCallback(()=>{e||S(!E)},[E,e,S]);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{ref:C,className:N.twJoin("bbn-select",e&&"bbn-select-disabled",`bbn-select-${u}`,t),onClick:W,tabIndex:e?-1:0,...x,children:[l.jsx("span",{children:k?g(k):s}),l.jsx(Ia,{className:N.twJoin("bbn-select-icon",E&&"bbn-select-icon-open"),size:20})]}),l.jsx(pn,{anchorEl:C.current,className:N.twJoin("bbn-select-menu custom-scrollbar",f),open:E&&!e,onClickOutside:I,offset:[0,4],placement:"bottom-start",style:{width:w},children:o.map(_=>l.jsx("div",{className:N.twJoin("bbn-select-option",(k==null?void 0:k.value)===_.value&&"bbn-select-option-selected",c),onClick:()=>$(_),children:_.label},_.value))})]})});ts.displayName="Select";const Dr=p.forwardRef(({className:e,prefix:t,suffix:r,disabled:n=!1,state:s="default",...i},a)=>l.jsxs("div",{className:N.twJoin("bbn-input",`bbn-input-${s}`,n&&"bbn-input-disabled",r&&"bbn-input-has-suffix"),children:[t&&l.jsx("div",{className:"bbn-input-prefix",children:t}),l.jsx("input",{ref:a,className:N.twJoin("bbn-input-field",e),disabled:n,...i}),r&&l.jsx("div",{className:"bbn-input-suffix",children:r})]}));Dr.displayName="Input";function Vr({children:e,label:t,hint:r,state:n="default",className:s}){return l.jsxs("div",{className:N.twJoin("bbn-form-control",s),children:[t?l.jsxs("label",{className:"bbn-form-control-label",children:[l.jsx("div",{className:"bbn-form-control-title",children:t}),e]}):e,r&&l.jsx("div",{className:N.twJoin("bbn-form-control-hint",`bbn-form-control-hint-${n}`),children:r})]})}const qi=p.createContext({removeDialog:()=>null,updateDialog:()=>null});function sc({children:e}){const[t,r]=p.useState({}),n=p.useMemo(()=>Object.values(t).some(o=>o),[t]);p.useEffect(function(){if(n){const c=document.body.offsetWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=document.body.offsetWidth-c>=1?Un(document.body.offsetWidth-c)??"":document.body.style.paddingRight}else document.body.style.overflow="",document.body.style.paddingRight=""},[n]);const s=p.useCallback(o=>{r(c=>Reflect.deleteProperty(c,o)?{...c}:c)},[]),i=p.useCallback((o,c)=>{r(f=>({...f,[o]:c}))},[]),a=p.useMemo(()=>({removeDialog:s,updateDialog:i}),[s,i]);return l.jsx(qi.Provider,{value:a,children:e})}function rs({open:e=!1}={}){const t=p.useId(),[r,n]=p.useState(e),{updateDialog:s,removeDialog:i}=p.useContext(qi),a=e||r;p.useEffect(()=>()=>{i(t)},[t]),p.useEffect(()=>{s(t,a)},[t,a,s]),p.useEffect(()=>{e&&n(!0)},[e]);const o=p.useCallback(()=>{e||n(!1)},[e]);return{mounted:r,unmount:o}}const Zi=({open:e=!1,...t})=>l.jsx("div",{...t,className:N.twJoin("bbn-backdrop",e?"animate-backdrop-in":"animate-backdrop-out",t.className)}),Ir=({children:e,open:t=!1,className:r,onClose:n,hasBackdrop:s=!0,backdropClassName:i,dialogClassName:a,...o})=>{const{mounted:c,unmount:f}=rs({open:t});return l.jsxs(Mr,{mounted:c,children:[l.jsx("div",{...o,className:N.twJoin("bbn-dialog-wrapper",r),children:l.jsx("div",{className:N.twJoin("bbn-dialog",t?"animate-modal-in":"animate-modal-out",a),onAnimationEnd:f,children:e})}),s&&l.jsx(Zi,{className:i,open:t,onClick:n})]})},Kr=({children:e,className:t="",size:r=40,variant:n="default",background:s=!1,rounded:i=!1})=>{const a={default:"text-accent-secondary",primary:"text-primary-light",secondary:"text-accent-secondary",error:"text-error-main",success:"text-success-main","accent-primary":"text-accent-primary","accent-secondary":"text-accent-secondary"},o={default:"bg-accent-secondary/10",primary:"bg-primary-light/10 dark:bg-[#47484A]",secondary:"bg-accent-secondary/10",error:"bg-error-main/10",success:"bg-success-main/10","accent-primary":"bg-accent-primary/10","accent-secondary":"bg-accent-secondary/10"};return l.jsx("div",{className:N.twJoin("flex items-center justify-center",s&&o[n],i&&"rounded-full",s?"[&_svg]:h-4 [&_svg]:w-auto":"[&_svg]:w-full [&_svg]:h-full","[&_svg_path]:fill-current",s&&"dark:[&_svg_path]:fill-white",a[n],t),style:{width:r,height:r},children:e})},Xi=({className:e="",size:t=24,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t*.545},viewBox:"0 0 22 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M20 4H11.65C10.83 1.67 8.61 0 6 0C2.69 0 0 2.69 0 6C0 9.31 2.69 12 6 12C8.61 12 10.83 10.33 11.65 8H12L14 10L16 8L18 10L22 5.96L20 4ZM6 9C4.35 9 3 7.65 3 6C3 4.35 4.35 3 6 3C7.65 3 9 4.35 9 6C9 7.65 7.65 9 6 9Z",fill:"currentColor"})})},Yi=({className:e="",size:t=24,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t*.5},viewBox:"0 0 20 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M15 0H11V2H15C16.65 2 18 3.35 18 5C18 6.65 16.65 8 15 8H11V10H15C17.76 10 20 7.76 20 5C20 2.24 17.76 0 15 0ZM9 8H5C3.35 8 2 6.65 2 5C2 3.35 3.35 2 5 2H9V0H5C2.24 0 0 2.24 0 5C0 7.76 2.24 10 5 10H9V8ZM6 4H14V6H6V4Z",fill:"currentColor"})})},Ki=({className:e="",size:t=24,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsxs("svg",{style:{width:t,height:t*1},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:[l.jsx("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 18C5.58 18 2 14.42 2 10C2 5.58 5.58 2 10 2C14.42 2 18 5.58 18 10C18 14.42 14.42 18 10 18Z",fill:"currentColor"}),l.jsx("path",{d:"M10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5C7.23858 5 5 7.23858 5 10C5 12.7614 7.23858 15 10 15Z",fill:"currentColor"})]})},hn=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t*1.143},viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M9.99984 0.666626H1.99984C1.2665 0.666626 0.666504 1.26663 0.666504 1.99996V11.3333H1.99984V1.99996H9.99984V0.666626ZM11.9998 3.33329H4.6665C3.93317 3.33329 3.33317 3.93329 3.33317 4.66663V14C3.33317 14.7333 3.93317 15.3333 4.6665 15.3333H11.9998C12.7332 15.3333 13.3332 14.7333 13.3332 14V4.66663C13.3332 3.93329 12.7332 3.33329 11.9998 3.33329ZM11.9998 14H4.6665V4.66663H11.9998V14Z",fill:"currentColor"})})},ns=({className:e="",size:t=14,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z",fill:"currentColor"})})},Gi=({className:e="",size:t=22,variant:r="default",color:n})=>{const s=n||ze[r],i=22/20;return l.jsx("svg",{style:{width:t,height:t*i},viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M0 19.5H22L11 0.5L0 19.5ZM12 16.5H10V14.5H12V16.5ZM12 12.5H10V8.5H12V12.5Z",fill:"currentColor"})})},Qi=({className:e="",size:t=20,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:[l.jsx("rect",{x:"0.5",y:"0.5",width:"19",height:"19",rx:"3.5",stroke:"currentColor"}),l.jsx("path",{d:"M14.0832 10.5846H5.9165V9.41797H14.0832V10.5846Z",fill:"currentColor"})]})},eo=({className:e="",size:t=20,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:[l.jsx("rect",{x:"0.5",y:"0.5",width:"19",height:"19",rx:"3.5",stroke:"currentColor"}),l.jsx("path",{d:"M14 10.5714H10.5714V14H9.42857V10.5714H6V9.42857H9.42857V6H10.5714V9.42857H14V10.5714Z",fill:"currentColor"})]})},ic=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},oc=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M12.73 0H5.27L0 5.27V12.73L5.27 18H12.73L18 12.73V5.27L12.73 0ZM9 14.3C8.28 14.3 7.7 13.72 7.7 13C7.7 12.28 8.28 11.7 9 11.7C9.72 11.7 10.3 12.28 10.3 13C10.3 13.72 9.72 14.3 9 14.3ZM10 10H8V4H10V10Z",fill:"currentColor"})})},ac=({className:e="",size:t=40,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",e),children:[l.jsx("rect",{width:"40",height:"40",rx:"20",fill:"currentColor",fillOpacity:"0.12"}),l.jsx("path",{d:"M20 30C25.52 30 30 25.52 30 20C30 14.48 25.52 10 20 10C14.48 10 10 14.48 10 20C10 25.52 14.48 30 20 30ZM21 12.07C24.94 12.56 28 15.92 28 20C28 24.08 24.95 27.44 21 27.93V12.07Z",fill:"currentColor",className:s})]})},ss=({className:e="",size:t=14,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t*1},viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M6.33325 3.66634H7.66659V4.99967H6.33325V3.66634ZM6.33325 6.33301H7.66659V10.333H6.33325V6.33301ZM6.99992 0.333008C3.31992 0.333008 0.333252 3.31967 0.333252 6.99967C0.333252 10.6797 3.31992 13.6663 6.99992 13.6663C10.6799 13.6663 13.6666 10.6797 13.6666 6.99967C13.6666 3.31967 10.6799 0.333008 6.99992 0.333008ZM6.99992 12.333C4.05992 12.333 1.66659 9.93967 1.66659 6.99967C1.66659 4.05967 4.05992 1.66634 6.99992 1.66634C9.93992 1.66634 12.3333 4.05967 12.3333 6.99967C12.3333 9.93967 9.93992 12.333 6.99992 12.333Z",fill:"currentColor"})})},ze={default:"text-accent-primary",primary:"text-primary-light",secondary:"text-accent-secondary",error:"text-error-main",success:"text-success-main","accent-primary":"text-accent-primary","accent-secondary":"text-accent-secondary"},Xt=({children:e,open:t=!1,className:r,onClose:n,...s})=>{const{mounted:i,unmount:a}=rs({open:t});return l.jsxs(Mr,{mounted:i,children:[l.jsxs("div",{...s,className:N.twJoin("bbn-dialog-mobile",t?"animate-mobile-modal-in":"animate-mobile-modal-out",r),onAnimationEnd:a,children:[n&&l.jsx("button",{onClick:n,className:"absolute top-4 left-4 z-10 p-1.5 rounded-full bg-surface-tertiary hover:bg-surface-quaternary transition-colors","aria-label":"Close",children:l.jsx(ns,{size:14,variant:"accent-primary"})}),e]}),l.jsx(Zi,{open:t,onClick:n})]})},Br=({className:e,children:t,title:r,onClose:n})=>l.jsxs("div",{className:N.twJoin("bbn-dialog-header",e),children:[l.jsxs("div",{className:"bbn-dialog-title",children:[l.jsx(dn,{variant:"h5",children:r}),!!n&&l.jsx(zn,{className:"shrink-0",onClick:n,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"currentColor"})})})]}),t]}),Pr=e=>l.jsx("div",{...e,className:N.twJoin("bbn-dialog-body",e.className)}),vn=e=>l.jsx("div",{...e,className:N.twJoin("bbn-dialog-footer",e.className)});function lc({className:e,...t}){return l.jsx("span",{...t,className:N.twJoin("bbn-chip",e)})}function to({size:e=40,className:t}){return l.jsx("span",{className:N.twMerge("bbn-loader text-current",t),style:{width:e,height:e},children:l.jsx("svg",{viewBox:"22 22 44 44",children:l.jsx("circle",{cx:"44",cy:"44",r:"20.2",fill:"none",stroke:"currentColor",strokeWidth:"3.6"})})})}var ro="Expected a function",qs=NaN,cc="[object Symbol]",uc=/^\s+|\s+$/g,fc=/^[-+]0x[0-9a-f]+$/i,dc=/^0b[01]+$/i,mc=/^0o[0-7]+$/i,pc=parseInt,hc=typeof qr=="object"&&qr&&qr.Object===Object&&qr,vc=typeof self=="object"&&self&&self.Object===Object&&self,xc=hc||vc||Function("return this")(),gc=Object.prototype,yc=gc.toString,bc=Math.max,wc=Math.min,En=function(){return xc.Date.now()};function jc(e,t,r){var n,s,i,a,o,c,f=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(ro);t=Zs(t)||0,rn(r)&&(u=!!r.leading,d="maxWait"in r,i=d?bc(Zs(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h);function v(O){var k=n,$=s;return n=s=void 0,f=O,a=e.apply($,k),a}function g(O){return f=O,o=setTimeout(C,t),u?v(O):a}function x(O){var k=O-c,$=O-f,I=t-k;return d?wc(I,i-$):I}function b(O){var k=O-c,$=O-f;return c===void 0||k>=t||k<0||d&&$>=i}function C(){var O=En();if(b(O))return w(O);o=setTimeout(C,x(O))}function w(O){return o=void 0,h&&n?v(O):(n=s=void 0,a)}function E(){o!==void 0&&clearTimeout(o),f=0,n=c=s=o=void 0}function S(){return o===void 0?a:w(En())}function A(){var O=En(),k=b(O);if(n=arguments,s=this,c=O,k){if(o===void 0)return g(c);if(d)return o=setTimeout(C,t),v(c)}return o===void 0&&(o=setTimeout(C,t)),a}return A.cancel=E,A.flush=S,A}function Cc(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(ro);return rn(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),jc(e,t,{leading:n,maxWait:t,trailing:s})}function rn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Nc(e){return!!e&&typeof e=="object"}function Sc(e){return typeof e=="symbol"||Nc(e)&&yc.call(e)==cc}function Zs(e){if(typeof e=="number")return e;if(Sc(e))return qs;if(rn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=rn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(uc,"");var r=dc.test(e);return r||mc.test(e)?pc(e.slice(2),r?2:8):fc.test(e)?qs:+e}var Ec=Cc;const no=es(Ec);function so(e,{onLoadMore:t,hasMore:r=!1,loading:n=!1}={}){const[s,i]=p.useState(!1);return p.useEffect(()=>{const a=no(c=>{const f=c.target;i(f.scrollTop>0),!n&&r&&f.scrollHeight-f.scrollTop<=f.clientHeight+100&&(t==null||t())},100),o=e.current;if(o)return o.addEventListener("scroll",a),()=>o.removeEventListener("scroll",a)},[n,r,t,e]),{isScrolledTop:s}}function io(e){const[t,r]=p.useState(!1),[n,s]=p.useState(!1);return p.useEffect(()=>{const i=e.current;if(!i)return;const a=()=>{const{scrollLeft:o,scrollWidth:c,clientWidth:f}=i;r(o>0);const u=c-f;s(u>0&&o<u)};return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)},[e]),{isLeftScrolled:t,isRightScrolled:n}}const oo=p.createContext({data:[],columns:[],sortStates:{},onColumnSort:void 0,onRowSelect:void 0});function ao({name:e,className:t,children:r,sorter:n,frozen:s,showFrozenShadow:i,...a}){const{columns:o,sortStates:c,onColumnSort:f}=p.useContext(oo),u=c[e??""],d=u==null?void 0:u.direction,h=s?`bbn-table-frozen bbn-table-frozen-${s}`:"",v=s&&i?"bbn-frozen-shadow":"";return l.jsx(X,{variant:"caption",as:"th",className:N.twJoin("bbn-cell-left",n&&"bbn-table-sortable",h,v,t),onClick:()=>{if(n&&e){const g=o.find(x=>x.key===e);f==null||f(e,g==null?void 0:g.sorter)}},"data-column":e,...a,children:l.jsxs("div",{className:"flex items-center justify-between gap-1",children:[l.jsx("span",{children:r}),n&&l.jsxs("span",{className:"bbn-table-sort-icons",children:[l.jsx(Ba,{className:N.twJoin("bbn-sort-icon bbn-sort-icon-up",d==="asc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")}),l.jsx(Va,{className:N.twJoin("bbn-sort-icon bbn-sort-icon-down",d==="desc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")})]})]})})}function lo(e,t){const[r,n]=p.useState({}),s=p.useCallback((a,o)=>{o&&n(c=>{var h;const f=((h=c[a])==null?void 0:h.direction)??null,u=f===null?"asc":f==="asc"?"desc":null;if(u===null)return Object.fromEntries(Object.entries(c).filter(([v])=>v!==a).map(([v,g])=>[v,{...g,priority:g.priority>c[a].priority?g.priority-1:g.priority}]));const d=Math.max(0,...Object.values(c).map(v=>v.priority));return{...c,[a]:{direction:u,priority:d+1}}})},[]),i=p.useMemo(()=>{const a=Object.entries(r).filter(([,o])=>o.direction!==null).toSorted((o,c)=>c[1].priority-o[1].priority).map(([o,c])=>({column:t.find(f=>f.key===o),direction:c.direction})).filter(({column:o})=>o==null?void 0:o.sorter);return a.length===0?e:e.toSorted((o,c)=>{for(const{column:f,direction:u}of a){const d=f.sorter(o,c);if(d!==0)return u==="asc"?d:-d}return 0})},[e,t,r]);return{sortStates:r,handleColumnSort:s,sortedData:i}}function co({className:e,render:t,value:r,columnName:n,frozen:s,showFrozenShadow:i,...a}){const o=s?`bbn-table-frozen bbn-table-frozen-${s}`:"",c=s&&i?"bbn-frozen-shadow":"";return l.jsx(X,{variant:"body2",as:"td",className:N.twJoin("bbn-cell-left",o,c,e),"data-column":n,...a,children:t?t(r):r})}function Ac({row:e,columns:t,isSelected:r,isSelectable:n,onSelect:s,isLeftScrolled:i,isRightScrolled:a}){return l.jsx("tr",{className:N.twJoin(r&&"selected",!!s&&n&&"cursor-pointer",!n&&"opacity-50"),onClick:()=>s(e),children:t.map(o=>l.jsx(co,{value:e[o.key],columnName:o.key,className:o.cellClassName,frozen:o.frozen,showFrozenShadow:o.frozen==="left"&&i||o.frozen==="right"&&a,render:o.render?c=>o.render(c,e):void 0},o.key))})}function Oc({data:e,columns:t,className:r,wrapperClassName:n,fluid:s=!1,hasMore:i=!1,loading:a=!1,onLoadMore:o,onRowSelect:c,isRowSelectable:f,selectedRow:u,defaultSelectedRow:d,onSelectedRowChange:h,...v},g){const x=p.useRef(null);p.useImperativeHandle(g,()=>x.current,[]);const{sortStates:b,handleColumnSort:C,sortedData:w}=lo(e,t),{isScrolledTop:E}=so(x,{onLoadMore:o,hasMore:i,loading:a}),{isLeftScrolled:S,isRightScrolled:A}=io(x),[O,k]=zt({value:u,defaultValue:d??null,onStateChange:h}),$=p.useCallback(_=>{if(!c||f&&!f(_))return;const F=O===_.id?null:_.id;k(F),c(F===null?null:_)},[c,f,O,k]),I=p.useMemo(()=>({data:w,columns:t,sortStates:b,onColumnSort:C,onRowSelect:$}),[w,t,b,C,$]),W=p.useMemo(()=>t.some(_=>_.header&&_.header!==""),[t]);return l.jsx(oo.Provider,{value:I,children:l.jsx("div",{ref:x,className:N.twJoin("bbn-table-wrapper",s&&"bbn-table-wrapper-fluid",n),children:l.jsxs("table",{className:N.twJoin("bbn-table",s&&"bbn-table-fluid",r),...v,children:[l.jsx("thead",{className:N.twJoin("bbn-table-header",E&&"scrolled-top",!W&&"hidden"),children:l.jsx("tr",{children:t.map(_=>l.jsx(ao,{className:_.headerClassName,name:_.key,sorter:_.sorter,frozen:_.frozen,showFrozenShadow:_.frozen==="left"&&S||_.frozen==="right"&&A,children:_.header},_.key))})}),l.jsx("tbody",{className:"bbn-table-body",children:w.map(_=>l.jsx(Ac,{row:_,columns:t,isSelected:O===_.id,isSelectable:f?f(_):!0,onSelect:$,isLeftScrolled:S,isRightScrolled:A},_.id))})]})})})}const uo=p.forwardRef(Oc);function fo({as:e="div",className:t,children:r}){return p.createElement(e,{className:N.twJoin("bbn-card",t)},r)}function mo(e){const[t=!1,r]=zt({value:e.value,defaultValue:e.defaultValue,onStateChange:e.onChange});return l.jsxs("div",{className:"bbn-toggle",onClick:()=>void r(!t),children:[l.jsx("span",{className:"bbn-toggle-bg",children:e.activeIcon}),l.jsx("span",{className:N.twJoin("bbn-toggle-control",t&&"bbn-toggle-control-active")}),l.jsx("span",{className:"bbn-toggle-bg",children:e.inactiveIcon})]})}const kc={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Lc({className:e,orientation:t="vertical",children:r}){return l.jsx("div",{className:N.twMerge("bbn-list",`bbn-list-${t}`,e),children:p.Children.map(r,n=>p.isValidElement(n)?p.cloneElement(n,{orientation:kc[t]}):n)})}function po({className:e,orientation:t="horizontal",title:r,value:n,suffix:s}){return l.jsxs("div",{className:N.twJoin("bbn-list-item",`bbn-list-item-${t}`,e),children:[l.jsx(X,{as:"div",className:N.twJoin("bbn-list-title",`bbn-list-title-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),l.jsxs(X,{as:"div",className:N.twJoin("bbn-list-value",`bbn-list-value-${t}`),variant:"body1",children:[n,s]})]})}function Xs(e){return Ft({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]},{tag:"path",attr:{d:"M464 336a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}function _c(e){return Ft({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z"},child:[]},{tag:"path",attr:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z"},child:[]}]})(e)}function is(e={}){const{copiedText:t="Copied ✓",timeout:r=2e3}=e,[n,s]=p.useState({}),i=p.useRef({}),a=p.useCallback(u=>{u&&s(d=>({...d,[u]:!1}))},[]),o=p.useCallback((u,d)=>{if(!u||!d)return;navigator.clipboard.writeText(d).catch(()=>{}),s(v=>({...v,[u]:!0}));const h=i.current[u];h&&clearTimeout(h),r>0&&(i.current[u]=setTimeout(()=>{i.current[u]=void 0,a(u)},r))},[r,a]),c=p.useCallback(u=>u&&n[u]||!1,[n]),f=p.useCallback(u=>u&&n[u]?t:"",[n,t]);return p.useEffect(()=>()=>{Object.values(i.current).forEach(u=>u&&clearTimeout(u)),i.current={}},[]),{isCopied:c,copiedText:f,copyToClipboard:o}}function Yt(e=768,t=100){const[r,n]=p.useState(()=>typeof window<"u"?window.innerWidth<e:!1),s=p.useRef(),i=p.useCallback(()=>{n(window.innerWidth<e)},[e]);return p.useEffect(()=>(s.current=no(i,t),i(),window.addEventListener("resize",s.current),()=>{s.current&&(window.removeEventListener("resize",s.current),s.current.cancel())}),[i,t]),r}function ho({isOpen:e}){const[t,r]=p.useState(!1),[n,s]=p.useState(!1);p.useEffect(()=>{e&&!t&&(r(!0),s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{s(!0)})}))},[e,t]),p.useEffect(()=>{!e&&t&&s(!1)},[e,t]);const i=p.useCallback(()=>{!e&&t&&r(!1)},[e,t]);return{mounted:t,shouldShowOpen:n,handleAnimationEnd:i}}const Fc=({hidden:e=!1,loading:t,title:r,value:n,tooltip:s,loadingStyle:i="spinner",...a})=>{const o=p.useId(),c=Yt(),[f,u]=p.useState(!1),[d,h]=p.useState(null);if(p.useEffect(()=>{!c&&f&&u(!1)},[c,f]),e)return null;const v=l.jsxs("div",{className:"inline-flex items-center gap-2",children:[l.jsx("span",{className:"loader size-5"}),i==="spinner-and-value"&&l.jsx("span",{className:"opacity-50",children:n})]}),g=s?c?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"block size-5 cursor-pointer text-xs",onClick:()=>u(!0),children:l.jsx(Xs,{size:20})}),l.jsxs(Xt,{open:f,onClose:()=>u(!1),children:[l.jsx("div",{className:"px-4 py-2 text-accent-primary",children:s}),l.jsx("div",{className:"p-4",children:l.jsx(Me,{variant:"contained",fluid:!0,onClick:()=>u(!1),children:"Done"})})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"block size-5 cursor-pointer text-xs",onMouseEnter:x=>h(x.currentTarget),onMouseLeave:()=>h(null),"aria-describedby":o,children:l.jsx(Xs,{size:20})}),l.jsx(pn,{open:!!d,anchorEl:d,placement:"top",offset:[0,8],children:l.jsx("div",{className:"tooltip-wrap",children:s})})]}):void 0;return l.jsx(po,{...a,title:r,value:t?v:n,suffix:g})};function Tc({children:e,count:t=0,max:r=99,position:n="bottom-right",color:s="error",className:i,badgeClassName:a,contentClassName:o}){const c=typeof t=="number"?t>0:t!=null,f=typeof t=="number"&&t>r?`${r}+`:t,u=`bbn-badge-${n}`,d=`bbn-badge-${s}`;return l.jsxs("div",{className:N.twJoin("bbn-badge",i),children:[e,c&&l.jsx("span",{className:N.twJoin("bbn-badge-indicator",u,d,a),children:l.jsx("span",{className:N.twJoin("bbn-badge-content",o),children:f})})]})}const hr=({children:e,style:t,variant:r="contained",className:n})=>l.jsx("div",{className:N.twJoin("bbn-subsection",`bbn-subsection-${r}`,n),style:t,children:e});function vo({counter:e,max:t,onAdd:r,alwaysShowCounter:n=!1}){const s=e<t,i=0<e||n&&e===0;return l.jsxs("div",{className:N.twJoin("bg-primary-highlight flex overflow-hidden rounded-md border border-accent-primary w-fit",s&&"cursor-pointer",!i&&!s&&"hidden",!i&&"w-10"),onClick:s?r:void 0,children:[s&&l.jsx("div",{className:"flex h-10 w-10 items-center justify-center",children:l.jsx(_c,{size:20})}),i&&l.jsxs("div",{className:N.twJoin("flex h-10 items-center px-2 text-sm sm:px-4 sm:text-base",s&&"border-l border-accent-primary"),children:[e,"/",t]})]})}const xo=p.createContext(void 0),os=()=>p.useContext(xo),Rc=({children:e,value:t})=>l.jsx(xo.Provider,{value:t,children:e}),as=({isOpen:e,onClose:t,title:r,children:n,className:s="",titleAlign:i="left",backIcon:a,fullHeight:o=!1,fullWidth:c=!1,showBackButton:f=!0,showDivider:u=!0,onBackdropClick:d})=>{const{mounted:h,shouldShowOpen:v,handleAnimationEnd:g}=ho({isOpen:e}),x={left:"text-left",center:"text-center",right:"text-right"},b=()=>f||r?l.jsxs("div",{className:N.twJoin("flex items-center p-4",u&&"border-b border-[#38708533] dark:border-[#404040]"),children:[f&&l.jsx("button",{onClick:t,className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded transition-colors hover:bg-accent-secondary/10","aria-label":"Go back",children:a||l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:l.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),r&&l.jsx("h3",{className:N.twJoin("flex-1 text-sm font-medium text-accent-primary",f?"ml-3":"",x[i]),children:r})]}):null,C=()=>l.jsxs(l.Fragment,{children:[b(),l.jsx("div",{className:"flex-1 overflow-y-auto",children:n})]});return o?l.jsxs(Mr,{mounted:h,rootClassName:"menu-drawer-portal",children:[d&&l.jsx("div",{className:N.twJoin("fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",v?"opacity-100":"pointer-events-none opacity-0"),onClick:d}),l.jsx("div",{className:N.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]","fixed inset-y-0 right-0 z-50",c?"w-full":"w-full max-w-sm",v?"translate-x-0":"translate-x-full",s),onTransitionEnd:g,children:C()})]}):l.jsx("div",{className:N.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]","absolute inset-0 rounded-lg",e?"translate-x-0":"translate-x-full",s),children:C()})},ls=({children:e,trigger:t,open:r,onOpenChange:n,placement:s="bottom-end",offset:i=[0,8],className:a,mobileMode:o="dialog"})=>{const[c,f]=p.useState(!1),u=p.useRef(null),d=Yt(),h=r!==void 0?r:c,v=C=>{r===void 0&&f(C),n==null||n(C)},g=()=>v(!1),x=l.jsx("div",{className:"relative w-full overflow-hidden",children:e}),b=t||l.jsx("button",{className:"rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-800",onClick:()=>v(!h),children:"Menu"});return l.jsxs(Rc,{value:{isOpen:h,setIsOpen:v,onClose:g,isMobile:d},children:[l.jsx("div",{ref:u,className:"inline-block",children:p.isValidElement(b)&&p.cloneElement(b,{onClick:()=>v(!h),"aria-haspopup":"true","aria-expanded":h})}),d?o==="dialog"?l.jsx(Xt,{open:h,onClose:g,className:N.twJoin("bg-[#FFFFFF] dark:bg-[#252525] text-primary-main",a),children:x}):l.jsx(as,{isOpen:h,onClose:g,onBackdropClick:g,fullHeight:!0,fullWidth:!0,showBackButton:!0,showDivider:!1,children:x}):l.jsx(pn,{anchorEl:u.current,open:h,offset:i,placement:s,onClickOutside:g,className:N.twJoin("rounded-lg border border-[#38708533] bg-[#FFFFFF] shadow-lg dark:border-[#404040] dark:bg-[#252525]","min-w-[294px]",a),children:x})]})},go=({icon:e,name:t,description:r,onClick:n,disabled:s=!1,className:i,children:a,suffix:o,selected:c=!1,role:f="menuitem",toggle:u})=>{const d=os(),h=u?l.jsx(mo,{value:u.value,defaultValue:u.defaultValue,onChange:u.onChange}):null,v=h||o,g=()=>{s||h||(n&&n(),d&&!v&&d.onClose())};return a?l.jsx("button",{onClick:g,disabled:s,className:N.twJoin("w-full text-left",s&&"cursor-not-allowed opacity-50",i),children:a}):l.jsxs("div",{className:N.twJoin("flex w-full items-center justify-between p-6","transition-colors",!h&&"cursor-pointer hover:bg-accent-secondary/5","text-left",c&&"bg-accent-secondary/10",s&&"cursor-not-allowed opacity-50",h&&"cursor-default",i),role:f,"aria-selected":c,onClick:g,children:[l.jsxs("div",{className:"flex items-center gap-3",children:[e&&l.jsx("div",{className:"flex-shrink-0",children:e}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:"text-sm font-medium text-accent-primary",children:t}),r&&l.jsx("div",{className:"text-xs text-accent-secondary",children:r})]})]}),v&&l.jsx("div",{className:"flex-shrink-0",children:v})]})},yo=({children:e,name:t,description:r,icon:n,backIcon:s,suffix:i,className:a,contentClassName:o,titleAlign:c="left"})=>{const[f,u]=p.useState(!1),d=os(),h=l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:l.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),v=l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:l.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:()=>u(!0),className:N.twJoin("flex w-full items-center justify-between p-6","transition-colors hover:bg-accent-secondary/5","text-left focus:outline-none",a),role:"menuitem",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[n&&l.jsx("div",{className:"flex-shrink-0",children:n}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{className:"text-sm font-medium text-accent-primary",children:t}),r&&l.jsx("span",{className:"mt-0.5 text-xs text-accent-secondary",children:r})]})]}),i||v]}),l.jsx(as,{isOpen:f,onClose:()=>u(!1),title:t||"",titleAlign:c,backIcon:s||h,fullHeight:d==null?void 0:d.isMobile,fullWidth:d==null?void 0:d.isMobile,onBackdropClick:d!=null&&d.isMobile?void 0:()=>u(!1),className:N.twJoin(d!=null&&d.isMobile?"z-60":"z-50",o),children:e})]})},Mc=({label:e,description:t,onClick:r,selected:n=!1,className:s,suffix:i,disabled:a=!1})=>{const o=l.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M16.6667 5L7.5 14.1667L3.33333 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return l.jsxs("button",{role:"menuitem",onClick:r,disabled:a,className:N.twJoin("flex w-full items-center justify-between p-4","transition-colors hover:bg-accent-secondary/5","text-left focus:outline-none",n&&"bg-accent-secondary/10",a&&"cursor-not-allowed opacity-50",s),"aria-selected":n,tabIndex:a?-1:0,children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{className:"font-medium text-accent-primary",children:e}),t&&l.jsx("span",{className:"text-sm text-accent-secondary",children:t})]}),n&&(i||o)]})},xn=({amount:e,currencyIcon:t,currencyName:r,placeholder:n="Enter Amount",subtitle:s,displayBalance:i,balanceDetails:a,min:o,step:c,autoFocus:f,onChange:u,onKeyDown:d,amountUsd:h,disabled:v=!1})=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:t,alt:r,className:"h-10 max-h-[2.5rem] w-10 max-w-[2.5rem]"}),l.jsx("div",{className:"text-lg",children:r})]}),l.jsx("input",{type:"number",value:e??"",min:o,step:c,onChange:u,onKeyDown:d,disabled:v,placeholder:n,autoFocus:f,className:"w-2/3 bg-transparent text-right text-lg outline-none appearance-none [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"})]}),a&&i?l.jsxs("div",{className:"flex w-full flex-row content-center justify-between text-sm",children:[l.jsx("span",{className:"cursor-default",children:s}),a.displayUSD&&a.price!==void 0&&l.jsxs("div",{children:[h," USD"]})]}):null]});function Dc(e,t=8){if(!e||e.length<=t*2)return e;const r=e.slice(0,t),n=e.slice(-t);return`${r}...${n}`}const cs=({value:e,symbols:t=8,size:r="body2",className:n})=>e?l.jsx(X,{variant:r,className:N.twJoin("text-accent-primary",n),children:l.jsx("span",{children:Dc(e,t)??e})}):null,bo=({children:e,value:t,className:r,onCopy:n,isCopied:s,copiedText:i,timeout:a=2e3})=>{const o=p.useId(),c={copiedText:i,timeout:a},{isCopied:f,copiedText:u,copyToClipboard:d}=is(c),h=s!==void 0,v=h?s:f(o),g=h?i||"Copied ✓":u(o),x=b=>{b.stopPropagation(),h&&n?n(t):d(o,t)};return l.jsx("div",{className:N.twMerge("inline-flex items-center cursor-pointer hover:opacity-100 transition-opacity duration-200",r),onClick:x,children:l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:N.twMerge("transition-opacity duration-300 ease-in-out",v&&"opacity-0"),children:e}),v&&l.jsx("div",{className:N.twMerge("absolute inset-0 flex items-center transition-opacity duration-300 ease-in-out text-green-600","opacity-100"),children:g})]})})};function wo({children:e,className:t,iconClassName:r,messageClassName:n}){return l.jsxs("div",{className:N.twJoin("bbn-warning",t),children:[l.jsx(Gi,{variant:"secondary",size:22,className:N.twJoin("bbn-warning-icon",r)}),l.jsx("p",{className:N.twJoin("bbn-warning-message",n),children:e})]})}const fr=Math.min,Ht=Math.max,nn=Math.round,Zr=Math.floor,ht=e=>({x:e,y:e}),Vc={left:"right",right:"left",bottom:"top",top:"bottom"},Ic={start:"end",end:"start"};function Tn(e,t,r){return Ht(e,fr(t,r))}function $r(e,t){return typeof e=="function"?e(t):e}function Ut(e){return e.split("-")[0]}function Hr(e){return e.split("-")[1]}function jo(e){return e==="x"?"y":"x"}function us(e){return e==="y"?"height":"width"}const Bc=new Set(["top","bottom"]);function Lt(e){return Bc.has(Ut(e))?"y":"x"}function fs(e){return jo(Lt(e))}function Pc(e,t,r){r===void 0&&(r=!1);const n=Hr(e),s=fs(e),i=us(s);let a=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=sn(a)),[a,sn(a)]}function $c(e){const t=sn(e);return[Rn(e),t,Rn(t)]}function Rn(e){return e.replace(/start|end/g,t=>Ic[t])}const Ys=["left","right"],Ks=["right","left"],Hc=["top","bottom"],Wc=["bottom","top"];function zc(e,t,r){switch(e){case"top":case"bottom":return r?t?Ks:Ys:t?Ys:Ks;case"left":case"right":return t?Hc:Wc;default:return[]}}function Jc(e,t,r,n){const s=Hr(e);let i=zc(Ut(e),r==="start",n);return s&&(i=i.map(a=>a+"-"+s),t&&(i=i.concat(i.map(Rn)))),i}function sn(e){return e.replace(/left|right|bottom|top/g,t=>Vc[t])}function Uc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Co(e){return typeof e!="number"?Uc(e):{top:e,right:e,bottom:e,left:e}}function on(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Gs(e,t,r){let{reference:n,floating:s}=e;const i=Lt(t),a=fs(t),o=us(a),c=Ut(t),f=i==="y",u=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,h=n[o]/2-s[o]/2;let v;switch(c){case"top":v={x:u,y:n.y-s.height};break;case"bottom":v={x:u,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:d};break;case"left":v={x:n.x-s.width,y:d};break;default:v={x:n.x,y:n.y}}switch(Hr(t)){case"start":v[a]-=h*(r&&f?-1:1);break;case"end":v[a]+=h*(r&&f?-1:1);break}return v}const qc=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:a}=r,o=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=Gs(f,n,c),h=n,v={},g=0;for(let x=0;x<o.length;x++){const{name:b,fn:C}=o[x],{x:w,y:E,data:S,reset:A}=await C({x:u,y:d,initialPlacement:n,placement:h,strategy:s,middlewareData:v,rects:f,platform:a,elements:{reference:e,floating:t}});u=w??u,d=E??d,v={...v,[b]:{...v[b],...S}},A&&g<=50&&(g++,typeof A=="object"&&(A.placement&&(h=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:u,y:d}=Gs(f,h,c)),x=-1)}return{x:u,y:d,placement:h,strategy:s,middlewareData:v}};async function No(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:i,rects:a,elements:o,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:v=0}=$r(t,e),g=Co(v),b=o[h?d==="floating"?"reference":"floating":d],C=on(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:f,rootBoundary:u,strategy:c})),w=d==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),S=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},A=on(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:w,offsetParent:E,strategy:c}):w);return{top:(C.top-A.top+g.top)/S.y,bottom:(A.bottom-C.bottom+g.bottom)/S.y,left:(C.left-A.left+g.left)/S.x,right:(A.right-C.right+g.right)/S.x}}const Zc=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:i,platform:a,elements:o,middlewareData:c}=t,{element:f,padding:u=0}=$r(e,t)||{};if(f==null)return{};const d=Co(u),h={x:r,y:n},v=fs(s),g=us(v),x=await a.getDimensions(f),b=v==="y",C=b?"top":"left",w=b?"bottom":"right",E=b?"clientHeight":"clientWidth",S=i.reference[g]+i.reference[v]-h[v]-i.floating[g],A=h[v]-i.reference[v],O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let k=O?O[E]:0;(!k||!await(a.isElement==null?void 0:a.isElement(O)))&&(k=o.floating[E]||i.floating[g]);const $=S/2-A/2,I=k/2-x[g]/2-1,W=fr(d[C],I),_=fr(d[w],I),F=W,P=k-x[g]-_,H=k/2-x[g]/2+$,Y=Tn(F,H,P),J=!c.arrow&&Hr(s)!=null&&H!==Y&&i.reference[g]/2-(H<F?W:_)-x[g]/2<0,q=J?H<F?H-F:H-P:0;return{[v]:h[v]+q,data:{[v]:Y,centerOffset:H-Y-q,...J&&{alignmentOffset:q}},reset:J}}}),Xc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:i,rects:a,initialPlacement:o,platform:c,elements:f}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:x=!0,...b}=$r(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const C=Ut(s),w=Lt(o),E=Ut(o)===o,S=await(c.isRTL==null?void 0:c.isRTL(f.floating)),A=h||(E||!x?[sn(o)]:$c(o)),O=g!=="none";!h&&O&&A.push(...Jc(o,x,g,S));const k=[o,...A],$=await No(t,b),I=[];let W=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&I.push($[C]),d){const H=Pc(s,a,S);I.push($[H[0]],$[H[1]])}if(W=[...W,{placement:s,overflows:I}],!I.every(H=>H<=0)){var _,F;const H=(((_=i.flip)==null?void 0:_.index)||0)+1,Y=k[H];if(Y&&(!(d==="alignment"?w!==Lt(Y):!1)||W.every(G=>Lt(G.placement)===w?G.overflows[0]>0:!0)))return{data:{index:H,overflows:W},reset:{placement:Y}};let J=(F=W.filter(q=>q.overflows[0]<=0).sort((q,G)=>q.overflows[1]-G.overflows[1])[0])==null?void 0:F.placement;if(!J)switch(v){case"bestFit":{var P;const q=(P=W.filter(G=>{if(O){const te=Lt(G.placement);return te===w||te==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(te=>te>0).reduce((te,ue)=>te+ue,0)]).sort((G,te)=>G[1]-te[1])[0])==null?void 0:P[0];q&&(J=q);break}case"initialPlacement":J=o;break}if(s!==J)return{reset:{placement:J}}}return{}}}},Yc=new Set(["left","top"]);async function Kc(e,t){const{placement:r,platform:n,elements:s}=e,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=Ut(r),o=Hr(r),c=Lt(r)==="y",f=Yc.has(a)?-1:1,u=i&&c?-1:1,d=$r(t,e);let{mainAxis:h,crossAxis:v,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof g=="number"&&(v=o==="end"?g*-1:g),c?{x:v*u,y:h*f}:{x:h*f,y:v*u}}const Gc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:i,placement:a,middlewareData:o}=t,c=await Kc(t,e);return a===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},Qc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:o={fn:b=>{let{x:C,y:w}=b;return{x:C,y:w}}},...c}=$r(e,t),f={x:r,y:n},u=await No(t,c),d=Lt(Ut(s)),h=jo(d);let v=f[h],g=f[d];if(i){const b=h==="y"?"top":"left",C=h==="y"?"bottom":"right",w=v+u[b],E=v-u[C];v=Tn(w,v,E)}if(a){const b=d==="y"?"top":"left",C=d==="y"?"bottom":"right",w=g+u[b],E=g-u[C];g=Tn(w,g,E)}const x=o.fn({...t,[h]:v,[d]:g});return{...x,data:{x:x.x-r,y:x.y-n,enabled:{[h]:i,[d]:a}}}}}};function gn(){return typeof window<"u"}function vr(e){return So(e)?(e.nodeName||"").toLowerCase():"#document"}function He(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yt(e){var t;return(t=(So(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function So(e){return gn()?e instanceof Node||e instanceof He(e).Node:!1}function ot(e){return gn()?e instanceof Element||e instanceof He(e).Element:!1}function xt(e){return gn()?e instanceof HTMLElement||e instanceof He(e).HTMLElement:!1}function Qs(e){return!gn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof He(e).ShadowRoot}const eu=new Set(["inline","contents"]);function Wr(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=at(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!eu.has(s)}const tu=new Set(["table","td","th"]);function ru(e){return tu.has(vr(e))}const nu=[":popover-open",":modal"];function yn(e){return nu.some(t=>{try{return e.matches(t)}catch{return!1}})}const su=["transform","translate","scale","rotate","perspective"],iu=["transform","translate","scale","rotate","perspective","filter"],ou=["paint","layout","strict","content"];function ds(e){const t=ms(),r=ot(e)?at(e):e;return su.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||iu.some(n=>(r.willChange||"").includes(n))||ou.some(n=>(r.contain||"").includes(n))}function au(e){let t=_t(e);for(;xt(t)&&!dr(t);){if(ds(t))return t;if(yn(t))return null;t=_t(t)}return null}function ms(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lu=new Set(["html","body","#document"]);function dr(e){return lu.has(vr(e))}function at(e){return He(e).getComputedStyle(e)}function bn(e){return ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _t(e){if(vr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qs(e)&&e.host||yt(e);return Qs(t)?t.host:t}function Eo(e){const t=_t(e);return dr(t)?e.ownerDocument?e.ownerDocument.body:e.body:xt(t)&&Wr(t)?t:Eo(t)}function _r(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Eo(e),i=s===((n=e.ownerDocument)==null?void 0:n.body),a=He(s);if(i){const o=Mn(a);return t.concat(a,a.visualViewport||[],Wr(s)?s:[],o&&r?_r(o):[])}return t.concat(s,_r(s,[],r))}function Mn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ao(e){const t=at(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=xt(e),i=s?e.offsetWidth:r,a=s?e.offsetHeight:n,o=nn(r)!==i||nn(n)!==a;return o&&(r=i,n=a),{width:r,height:n,$:o}}function ps(e){return ot(e)?e:e.contextElement}function ir(e){const t=ps(e);if(!xt(t))return ht(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:i}=Ao(t);let a=(i?nn(r.width):r.width)/n,o=(i?nn(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const cu=ht(0);function Oo(e){const t=He(e);return!ms()||!t.visualViewport?cu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uu(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==He(e)?!1:t}function qt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=ps(e);let a=ht(1);t&&(n?ot(n)&&(a=ir(n)):a=ir(e));const o=uu(i,r,n)?Oo(i):ht(0);let c=(s.left+o.x)/a.x,f=(s.top+o.y)/a.y,u=s.width/a.x,d=s.height/a.y;if(i){const h=He(i),v=n&&ot(n)?He(n):n;let g=h,x=Mn(g);for(;x&&n&&v!==g;){const b=ir(x),C=x.getBoundingClientRect(),w=at(x),E=C.left+(x.clientLeft+parseFloat(w.paddingLeft))*b.x,S=C.top+(x.clientTop+parseFloat(w.paddingTop))*b.y;c*=b.x,f*=b.y,u*=b.x,d*=b.y,c+=E,f+=S,g=He(x),x=Mn(g)}}return on({width:u,height:d,x:c,y:f})}function wn(e,t){const r=bn(e).scrollLeft;return t?t.left+r:qt(yt(e)).left+r}function ko(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-wn(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function fu(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const i=s==="fixed",a=yt(n),o=t?yn(t.floating):!1;if(n===a||o&&i)return r;let c={scrollLeft:0,scrollTop:0},f=ht(1);const u=ht(0),d=xt(n);if((d||!d&&!i)&&((vr(n)!=="body"||Wr(a))&&(c=bn(n)),xt(n))){const v=qt(n);f=ir(n),u.x=v.x+n.clientLeft,u.y=v.y+n.clientTop}const h=a&&!d&&!i?ko(a,c):ht(0);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-c.scrollLeft*f.x+u.x+h.x,y:r.y*f.y-c.scrollTop*f.y+u.y+h.y}}function du(e){return Array.from(e.getClientRects())}function mu(e){const t=yt(e),r=bn(e),n=e.ownerDocument.body,s=Ht(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Ht(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+wn(e);const o=-r.scrollTop;return at(n).direction==="rtl"&&(a+=Ht(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:a,y:o}}const ei=25;function pu(e,t){const r=He(e),n=yt(e),s=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,o=0,c=0;if(s){i=s.width,a=s.height;const u=ms();(!u||u&&t==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}const f=wn(n);if(f<=0){const u=n.ownerDocument,d=u.body,h=getComputedStyle(d),v=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(n.clientWidth-d.clientWidth-v);g<=ei&&(i-=g)}else f<=ei&&(i+=f);return{width:i,height:a,x:o,y:c}}const hu=new Set(["absolute","fixed"]);function vu(e,t){const r=qt(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,i=xt(e)?ir(e):ht(1),a=e.clientWidth*i.x,o=e.clientHeight*i.y,c=s*i.x,f=n*i.y;return{width:a,height:o,x:c,y:f}}function ti(e,t,r){let n;if(t==="viewport")n=pu(e,r);else if(t==="document")n=mu(yt(e));else if(ot(t))n=vu(t,r);else{const s=Oo(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return on(n)}function Lo(e,t){const r=_t(e);return r===t||!ot(r)||dr(r)?!1:at(r).position==="fixed"||Lo(r,t)}function xu(e,t){const r=t.get(e);if(r)return r;let n=_r(e,[],!1).filter(o=>ot(o)&&vr(o)!=="body"),s=null;const i=at(e).position==="fixed";let a=i?_t(e):e;for(;ot(a)&&!dr(a);){const o=at(a),c=ds(a);!c&&o.position==="fixed"&&(s=null),(i?!c&&!s:!c&&o.position==="static"&&!!s&&hu.has(s.position)||Wr(a)&&!c&&Lo(e,a))?n=n.filter(u=>u!==a):s=o,a=_t(a)}return t.set(e,n),n}function gu(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[...r==="clippingAncestors"?yn(t)?[]:xu(t,this._c):[].concat(r),n],o=a[0],c=a.reduce((f,u)=>{const d=ti(t,u,s);return f.top=Ht(d.top,f.top),f.right=fr(d.right,f.right),f.bottom=fr(d.bottom,f.bottom),f.left=Ht(d.left,f.left),f},ti(t,o,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function yu(e){const{width:t,height:r}=Ao(e);return{width:t,height:r}}function bu(e,t,r){const n=xt(t),s=yt(t),i=r==="fixed",a=qt(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const c=ht(0);function f(){c.x=wn(s)}if(n||!n&&!i)if((vr(t)!=="body"||Wr(s))&&(o=bn(t)),n){const v=qt(t,!0,i,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else s&&f();i&&!n&&s&&f();const u=s&&!n&&!i?ko(s,o):ht(0),d=a.left+o.scrollLeft-c.x-u.x,h=a.top+o.scrollTop-c.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function An(e){return at(e).position==="static"}function ri(e,t){if(!xt(e)||at(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return yt(e)===r&&(r=r.ownerDocument.body),r}function _o(e,t){const r=He(e);if(yn(e))return r;if(!xt(e)){let s=_t(e);for(;s&&!dr(s);){if(ot(s)&&!An(s))return s;s=_t(s)}return r}let n=ri(e,t);for(;n&&ru(n)&&An(n);)n=ri(n,t);return n&&dr(n)&&An(n)&&!ds(n)?r:n||au(e)||r}const wu=async function(e){const t=this.getOffsetParent||_o,r=this.getDimensions,n=await r(e.floating);return{reference:bu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ju(e){return at(e).direction==="rtl"}const Cu={convertOffsetParentRelativeRectToViewportRelativeRect:fu,getDocumentElement:yt,getClippingRect:gu,getOffsetParent:_o,getElementRects:wu,getClientRects:du,getDimensions:yu,getScale:ir,isElement:ot,isRTL:ju};function Fo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nu(e,t){let r=null,n;const s=yt(e);function i(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),i();const f=e.getBoundingClientRect(),{left:u,top:d,width:h,height:v}=f;if(o||t(),!h||!v)return;const g=Zr(d),x=Zr(s.clientWidth-(u+h)),b=Zr(s.clientHeight-(d+v)),C=Zr(u),E={rootMargin:-g+"px "+-x+"px "+-b+"px "+-C+"px",threshold:Ht(0,fr(1,c))||1};let S=!0;function A(O){const k=O[0].intersectionRatio;if(k!==c){if(!S)return a();k?a(!1,k):n=setTimeout(()=>{a(!1,1e-7)},1e3)}k===1&&!Fo(f,e.getBoundingClientRect())&&a(),S=!1}try{r=new IntersectionObserver(A,{...E,root:s.ownerDocument})}catch{r=new IntersectionObserver(A,E)}r.observe(e)}return a(!0),i}function Su(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,f=ps(e),u=s||i?[...f?_r(f):[],..._r(t)]:[];u.forEach(C=>{s&&C.addEventListener("scroll",r,{passive:!0}),i&&C.addEventListener("resize",r)});const d=f&&o?Nu(f,r):null;let h=-1,v=null;a&&(v=new ResizeObserver(C=>{let[w]=C;w&&w.target===f&&v&&(v.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var E;(E=v)==null||E.observe(t)})),r()}),f&&!c&&v.observe(f),v.observe(t));let g,x=c?qt(e):null;c&&b();function b(){const C=qt(e);x&&!Fo(x,C)&&r(),x=C,g=requestAnimationFrame(b)}return r(),()=>{var C;u.forEach(w=>{s&&w.removeEventListener("scroll",r),i&&w.removeEventListener("resize",r)}),d==null||d(),(C=v)==null||C.disconnect(),v=null,c&&cancelAnimationFrame(g)}}const Eu=Gc,Au=Qc,Ou=Xc,ku=Zc,ni=(e,t,r)=>{const n=new Map,s={platform:Cu,...r},i={...s.platform,_c:n};return qc(e,t,{...s,platform:i})};var To={exports:{}};(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var i="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(i=s(i,n(o)))}return i}function n(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return r.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var o in i)t.call(i,o)&&i[o]&&(a=s(a,o));return a}function s(i,a){return a?i?i+" "+a:i+a:i}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(To);var Lu=To.exports;const Dn=es(Lu);const _u="react-tooltip-core-styles",Fu="react-tooltip-base-styles",si={core:!1,base:!1};function ii({css:e,id:t=Fu,type:r="base",ref:n}){var s,i;if(!e||typeof document>"u"||si[r]||r==="core"&&typeof process<"u"&&(!((s=process==null?void 0:process.env)===null||s===void 0)&&s.REACT_TOOLTIP_DISABLE_CORE_STYLES)||r!=="base"&&typeof process<"u"&&(!((i=process==null?void 0:process.env)===null||i===void 0)&&i.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;r==="core"&&(t=_u),n||(n={});const{insertAt:a}=n;if(document.getElementById(t))return;const o=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.id=t,c.type="text/css",a==="top"&&o.firstChild?o.insertBefore(c,o.firstChild):o.appendChild(c),c.styleSheet?c.styleSheet.cssText=e:c.appendChild(document.createTextNode(e)),si[r]=!0}const oi=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:r=null,place:n="top",offset:s=10,strategy:i="absolute",middlewares:a=[Eu(Number(s)),Ou({fallbackAxisSideDirection:"start"}),Au({padding:5})],border:o,arrowSize:c=8})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};const f=a;return r?(f.push(ku({element:r,padding:5})),ni(e,t,{placement:n,strategy:i,middleware:f}).then(({x:u,y:d,placement:h,middlewareData:v})=>{var g,x;const b={left:`${u}px`,top:`${d}px`,border:o},{x:C,y:w}=(g=v.arrow)!==null&&g!==void 0?g:{x:0,y:0},E=(x={top:"bottom",right:"left",bottom:"top",left:"right"}[h.split("-")[0]])!==null&&x!==void 0?x:"bottom",S=o&&{borderBottom:o,borderRight:o};let A=0;if(o){const O=`${o}`.match(/(\d+)px/);A=O!=null&&O[1]?Number(O[1]):1}return{tooltipStyles:b,tooltipArrowStyles:{left:C!=null?`${C}px`:"",top:w!=null?`${w}px`:"",right:"",bottom:"",...S,[E]:`-${c/2+A}px`},place:h}})):ni(e,t,{placement:"bottom",strategy:i,middleware:f}).then(({x:u,y:d,placement:h})=>({tooltipStyles:{left:`${u}px`,top:`${d}px`},tooltipArrowStyles:{},place:h}))},ai=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),li=(e,t,r)=>{let n=null;const s=function(...i){const a=()=>{n=null};!n&&(e.apply(this,i),n=setTimeout(a,t))};return s.cancel=()=>{n&&(clearTimeout(n),n=null)},s},ci=e=>e!==null&&!Array.isArray(e)&&typeof e=="object",Vn=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((s,i)=>Vn(s,t[i]));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!ci(e)||!ci(t))return e===t;const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(s=>Vn(e[s],t[s]))},Tu=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(r=>{const n=t.getPropertyValue(r);return n==="auto"||n==="scroll"})},ui=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(Tu(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},Ru=typeof window<"u"?p.useLayoutEffect:p.useEffect,Ke=e=>{e.current&&(clearTimeout(e.current),e.current=null)},Mu="DEFAULT_TOOLTIP_ID",Du={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},Vu=p.createContext({getTooltipData:()=>Du});function Ro(e=Mu){return p.useContext(Vu).getTooltipData(e)}var nr={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},On={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const Iu=({forwardRef:e,id:t,className:r,classNameArrow:n,variant:s="dark",anchorId:i,anchorSelect:a,place:o="top",offset:c=10,events:f=["hover"],openOnClick:u=!1,positionStrategy:d="absolute",middlewares:h,wrapper:v,delayShow:g=0,delayHide:x=0,float:b=!1,hidden:C=!1,noArrow:w=!1,clickable:E=!1,closeOnEsc:S=!1,closeOnScroll:A=!1,closeOnResize:O=!1,openEvents:k,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:W,style:_,position:F,afterShow:P,afterHide:H,disableTooltip:Y,content:J,contentWrapperRef:q,isOpen:G,defaultIsOpen:te=!1,setIsOpen:ue,activeAnchor:re,setActiveAnchor:fe,border:Le,opacity:De,arrowColor:Ne,arrowSize:_e=8,role:Je="tooltip"})=>{var Se;const ce=p.useRef(null),Ue=p.useRef(null),Ce=p.useRef(null),Ve=p.useRef(null),lt=p.useRef(null),[Ie,At]=p.useState({tooltipStyles:{},tooltipArrowStyles:{},place:o}),[be,bt]=p.useState(!1),[ct,qe]=p.useState(!1),[m,y]=p.useState(null),j=p.useRef(!1),R=p.useRef(null),{anchorRefs:T,setActiveAnchor:L}=Ro(t),B=p.useRef(!1),[K,Q]=p.useState([]),he=p.useRef(!1),rt=u||f.includes("click"),Ze=rt||(k==null?void 0:k.click)||(k==null?void 0:k.dblclick)||(k==null?void 0:k.mousedown),Ot=k?{...k}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!k&&rt&&Object.assign(Ot,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const nt=$?{...$}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!$&&rt&&Object.assign(nt,{mouseleave:!1,blur:!1,mouseout:!1});const Ae=I?{...I}:{escape:S||!1,scroll:A||!1,resize:O||!1,clickOutsideAnchor:Ze||!1};W&&(Object.assign(Ot,{mouseover:!1,focus:!1,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(nt,{mouseout:!1,blur:!1,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Ae,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),Ru(()=>(he.current=!0,()=>{he.current=!1}),[]);const de=D=>{he.current&&(D&&qe(!0),setTimeout(()=>{he.current&&(ue==null||ue(D),G===void 0&&bt(D))},10))};p.useEffect(()=>{if(G===void 0)return()=>null;G&&qe(!0);const D=setTimeout(()=>{bt(G)},10);return()=>{clearTimeout(D)}},[G]),p.useEffect(()=>{if(be!==j.current)if(Ke(lt),j.current=be,be)P==null||P();else{const D=(U=>{const Z=U.match(/^([\d.]+)(ms|s)$/);if(!Z)return 0;const[,ge,Ee]=Z;return Number(ge)*(Ee==="ms"?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));lt.current=setTimeout(()=>{qe(!1),y(null),H==null||H()},D+25)}},[be]);const Mt=D=>{At(U=>Vn(U,D)?U:D)},Dt=(D=g)=>{Ke(Ce),ct?de(!0):Ce.current=setTimeout(()=>{de(!0)},D)},wt=(D=x)=>{Ke(Ve),Ve.current=setTimeout(()=>{B.current||de(!1)},D)},yr=D=>{var U;if(!D)return;const Z=(U=D.currentTarget)!==null&&U!==void 0?U:D.target;if(!(Z!=null&&Z.isConnected))return fe(null),void L({current:null});g?Dt():de(!0),fe(Z),L({current:Z}),Ke(Ve)},Qt=()=>{E?wt(x||100):x?wt():de(!1),Ke(Ce)},er=({x:D,y:U})=>{var Z;const ge={getBoundingClientRect:()=>({x:D,y:U,width:0,height:0,top:U,left:D,right:D,bottom:U})};oi({place:(Z=m==null?void 0:m.place)!==null&&Z!==void 0?Z:o,offset:c,elementReference:ge,tooltipReference:ce.current,tooltipArrowReference:Ue.current,strategy:d,middlewares:h,border:Le,arrowSize:_e}).then(Ee=>{Mt(Ee)})},tr=D=>{if(!D)return;const U=D,Z={x:U.clientX,y:U.clientY};er(Z),R.current=Z},br=D=>{var U;if(!be)return;const Z=D.target;Z.isConnected&&(!((U=ce.current)===null||U===void 0)&&U.contains(Z)||[document.querySelector(`[id='${i}']`),...K].some(ge=>ge==null?void 0:ge.contains(Z))||(de(!1),Ke(Ce)))},Jr=li(yr,50),we=li(Qt,50),Xe=D=>{we.cancel(),Jr(D)},z=()=>{Jr.cancel(),we()},ee=p.useCallback(()=>{var D,U;const Z=(D=m==null?void 0:m.position)!==null&&D!==void 0?D:F;Z?er(Z):b?R.current&&er(R.current):re!=null&&re.isConnected&&oi({place:(U=m==null?void 0:m.place)!==null&&U!==void 0?U:o,offset:c,elementReference:re,tooltipReference:ce.current,tooltipArrowReference:Ue.current,strategy:d,middlewares:h,border:Le,arrowSize:_e}).then(ge=>{he.current&&Mt(ge)})},[be,re,J,_,o,m==null?void 0:m.place,c,d,F,m==null?void 0:m.position,b,_e]);p.useEffect(()=>{var D,U;const Z=new Set(T);K.forEach(ne=>{Y!=null&&Y(ne)||Z.add({current:ne})});const ge=document.querySelector(`[id='${i}']`);ge&&!(Y!=null&&Y(ge))&&Z.add({current:ge});const Ee=()=>{de(!1)},ut=ui(re),ft=ui(ce.current);Ae.scroll&&(window.addEventListener("scroll",Ee),ut==null||ut.addEventListener("scroll",Ee),ft==null||ft.addEventListener("scroll",Ee));let Oe=null;Ae.resize?window.addEventListener("resize",Ee):re&&ce.current&&(Oe=Su(re,ce.current,ee,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const Ye=ne=>{ne.key==="Escape"&&de(!1)};Ae.escape&&window.addEventListener("keydown",Ye),Ae.clickOutsideAnchor&&window.addEventListener("click",br);const ae=[],rr=ne=>!!(ne!=null&&ne.target&&(re!=null&&re.contains(ne.target))),ga=ne=>{be&&rr(ne)||yr(ne)},ya=ne=>{be&&rr(ne)&&Qt()},ks=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],Ls=["click","dblclick","mousedown","mouseup"];Object.entries(Ot).forEach(([ne,jt])=>{jt&&(ks.includes(ne)?ae.push({event:ne,listener:Xe}):Ls.includes(ne)&&ae.push({event:ne,listener:ga}))}),Object.entries(nt).forEach(([ne,jt])=>{jt&&(ks.includes(ne)?ae.push({event:ne,listener:z}):Ls.includes(ne)&&ae.push({event:ne,listener:ya}))}),b&&ae.push({event:"pointermove",listener:tr});const _s=()=>{B.current=!0},Fs=()=>{B.current=!1,Qt()},Ts=E&&(nt.mouseout||nt.mouseleave);return Ts&&((D=ce.current)===null||D===void 0||D.addEventListener("mouseover",_s),(U=ce.current)===null||U===void 0||U.addEventListener("mouseout",Fs)),ae.forEach(({event:ne,listener:jt})=>{Z.forEach(Nn=>{var wr;(wr=Nn.current)===null||wr===void 0||wr.addEventListener(ne,jt)})}),()=>{var ne,jt;Ae.scroll&&(window.removeEventListener("scroll",Ee),ut==null||ut.removeEventListener("scroll",Ee),ft==null||ft.removeEventListener("scroll",Ee)),Ae.resize?window.removeEventListener("resize",Ee):Oe==null||Oe(),Ae.clickOutsideAnchor&&window.removeEventListener("click",br),Ae.escape&&window.removeEventListener("keydown",Ye),Ts&&((ne=ce.current)===null||ne===void 0||ne.removeEventListener("mouseover",_s),(jt=ce.current)===null||jt===void 0||jt.removeEventListener("mouseout",Fs)),ae.forEach(({event:Nn,listener:wr})=>{Z.forEach(ba=>{var Sn;(Sn=ba.current)===null||Sn===void 0||Sn.removeEventListener(Nn,wr)})})}},[re,ee,ct,T,K,k,$,I,rt,g,x]),p.useEffect(()=>{var D,U;let Z=(U=(D=m==null?void 0:m.anchorSelect)!==null&&D!==void 0?D:a)!==null&&U!==void 0?U:"";!Z&&t&&(Z=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const ge=new MutationObserver(Ee=>{const ut=[],ft=[];Ee.forEach(Oe=>{if(Oe.type==="attributes"&&Oe.attributeName==="data-tooltip-id"&&(Oe.target.getAttribute("data-tooltip-id")===t?ut.push(Oe.target):Oe.oldValue===t&&ft.push(Oe.target)),Oe.type==="childList"){if(re){const Ye=[...Oe.removedNodes].filter(ae=>ae.nodeType===1);if(Z)try{ft.push(...Ye.filter(ae=>ae.matches(Z))),ft.push(...Ye.flatMap(ae=>[...ae.querySelectorAll(Z)]))}catch{}Ye.some(ae=>{var rr;return!!(!((rr=ae==null?void 0:ae.contains)===null||rr===void 0)&&rr.call(ae,re))&&(qe(!1),de(!1),fe(null),Ke(Ce),Ke(Ve),!0)})}if(Z)try{const Ye=[...Oe.addedNodes].filter(ae=>ae.nodeType===1);ut.push(...Ye.filter(ae=>ae.matches(Z))),ut.push(...Ye.flatMap(ae=>[...ae.querySelectorAll(Z)]))}catch{}}}),(ut.length||ft.length)&&Q(Oe=>[...Oe.filter(Ye=>!ft.includes(Ye)),...ut])});return ge.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{ge.disconnect()}},[t,a,m==null?void 0:m.anchorSelect,re]),p.useEffect(()=>{ee()},[ee]),p.useEffect(()=>{if(!(q!=null&&q.current))return()=>null;const D=new ResizeObserver(()=>{setTimeout(()=>ee())});return D.observe(q.current),()=>{D.disconnect()}},[J,q==null?void 0:q.current]),p.useEffect(()=>{var D;const U=document.querySelector(`[id='${i}']`),Z=[...K,U];re&&Z.includes(re)||fe((D=K[0])!==null&&D!==void 0?D:U)},[i,K,re]),p.useEffect(()=>(te&&de(!0),()=>{Ke(Ce),Ke(Ve)}),[]),p.useEffect(()=>{var D;let U=(D=m==null?void 0:m.anchorSelect)!==null&&D!==void 0?D:a;if(!U&&t&&(U=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),U)try{const Z=Array.from(document.querySelectorAll(U));Q(Z)}catch{Q([])}},[t,a,m==null?void 0:m.anchorSelect]),p.useEffect(()=>{Ce.current&&(Ke(Ce),Dt(g))},[g]);const Be=(Se=m==null?void 0:m.content)!==null&&Se!==void 0?Se:J,Vt=be&&Object.keys(Ie.tooltipStyles).length>0;return p.useImperativeHandle(e,()=>({open:D=>{if(D!=null&&D.anchorSelect)try{document.querySelector(D.anchorSelect)}catch{return void console.warn(`[react-tooltip] "${D.anchorSelect}" is not a valid CSS selector`)}y(D??null),D!=null&&D.delay?Dt(D.delay):de(!0)},close:D=>{D!=null&&D.delay?wt(D.delay):de(!1)},activeAnchor:re,place:Ie.place,isOpen:!!(ct&&!C&&Be&&Vt)})),ct&&!C&&Be?p.createElement(v,{id:t,role:Je,className:Dn("react-tooltip",nr.tooltip,On.tooltip,On[s],r,`react-tooltip__place-${Ie.place}`,nr[Vt?"show":"closing"],Vt?"react-tooltip__show":"react-tooltip__closing",d==="fixed"&&nr.fixed,E&&nr.clickable),onTransitionEnd:D=>{Ke(lt),be||D.propertyName!=="opacity"||(qe(!1),y(null),H==null||H())},style:{..._,...Ie.tooltipStyles,opacity:De!==void 0&&Vt?De:void 0},ref:ce},Be,p.createElement(v,{className:Dn("react-tooltip-arrow",nr.arrow,On.arrow,n,w&&nr.noArrow),style:{...Ie.tooltipArrowStyles,background:Ne?`linear-gradient(to right bottom, transparent 50%, ${Ne} 50%)`:void 0,"--rt-arrow-size":`${_e}px`},ref:Ue})):null},Bu=({content:e})=>p.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),fi=p.forwardRef(({id:e,anchorId:t,anchorSelect:r,content:n,html:s,render:i,className:a,classNameArrow:o,variant:c="dark",place:f="top",offset:u=10,wrapper:d="div",children:h=null,events:v=["hover"],openOnClick:g=!1,positionStrategy:x="absolute",middlewares:b,delayShow:C=0,delayHide:w=0,float:E=!1,hidden:S=!1,noArrow:A=!1,clickable:O=!1,closeOnEsc:k=!1,closeOnScroll:$=!1,closeOnResize:I=!1,openEvents:W,closeEvents:_,globalCloseEvents:F,imperativeModeOnly:P=!1,style:H,position:Y,isOpen:J,defaultIsOpen:q=!1,disableStyleInjection:G=!1,border:te,opacity:ue,arrowColor:re,arrowSize:fe,setIsOpen:Le,afterShow:De,afterHide:Ne,disableTooltip:_e,role:Je="tooltip"},Se)=>{const[ce,Ue]=p.useState(n),[Ce,Ve]=p.useState(s),[lt,Ie]=p.useState(f),[At,be]=p.useState(c),[bt,ct]=p.useState(u),[qe,m]=p.useState(C),[y,j]=p.useState(w),[R,T]=p.useState(E),[L,B]=p.useState(S),[K,Q]=p.useState(d),[he,rt]=p.useState(v),[Ze,Ot]=p.useState(x),[nt,Ae]=p.useState(null),[de,Mt]=p.useState(null),Dt=p.useRef(G),{anchorRefs:wt,activeAnchor:yr}=Ro(e),Qt=we=>we==null?void 0:we.getAttributeNames().reduce((Xe,z)=>{var ee;return z.startsWith("data-tooltip-")&&(Xe[z.replace(/^data-tooltip-/,"")]=(ee=we==null?void 0:we.getAttribute(z))!==null&&ee!==void 0?ee:null),Xe},{}),er=we=>{const Xe={place:z=>{var ee;Ie((ee=z)!==null&&ee!==void 0?ee:f)},content:z=>{Ue(z??n)},html:z=>{Ve(z??s)},variant:z=>{var ee;be((ee=z)!==null&&ee!==void 0?ee:c)},offset:z=>{ct(z===null?u:Number(z))},wrapper:z=>{var ee;Q((ee=z)!==null&&ee!==void 0?ee:d)},events:z=>{const ee=z==null?void 0:z.split(" ");rt(ee??v)},"position-strategy":z=>{var ee;Ot((ee=z)!==null&&ee!==void 0?ee:x)},"delay-show":z=>{m(z===null?C:Number(z))},"delay-hide":z=>{j(z===null?w:Number(z))},float:z=>{T(z===null?E:z==="true")},hidden:z=>{B(z===null?S:z==="true")},"class-name":z=>{Ae(z)}};Object.values(Xe).forEach(z=>z(null)),Object.entries(we).forEach(([z,ee])=>{var Be;(Be=Xe[z])===null||Be===void 0||Be.call(Xe,ee)})};p.useEffect(()=>{Ue(n)},[n]),p.useEffect(()=>{Ve(s)},[s]),p.useEffect(()=>{Ie(f)},[f]),p.useEffect(()=>{be(c)},[c]),p.useEffect(()=>{ct(u)},[u]),p.useEffect(()=>{m(C)},[C]),p.useEffect(()=>{j(w)},[w]),p.useEffect(()=>{T(E)},[E]),p.useEffect(()=>{B(S)},[S]),p.useEffect(()=>{Ot(x)},[x]),p.useEffect(()=>{Dt.current!==G&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[G]),p.useEffect(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:G==="core",disableBase:G}}))},[]),p.useEffect(()=>{var we;const Xe=new Set(wt);let z=r;if(!z&&e&&(z=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),z)try{document.querySelectorAll(z).forEach(U=>{Xe.add({current:U})})}catch{console.warn(`[react-tooltip] "${z}" is not a valid CSS selector`)}const ee=document.querySelector(`[id='${t}']`);if(ee&&Xe.add({current:ee}),!Xe.size)return()=>null;const Be=(we=de??ee)!==null&&we!==void 0?we:yr.current,Vt=new MutationObserver(U=>{U.forEach(Z=>{var ge;if(!Be||Z.type!=="attributes"||!(!((ge=Z.attributeName)===null||ge===void 0)&&ge.startsWith("data-tooltip-")))return;const Ee=Qt(Be);er(Ee)})}),D={attributes:!0,childList:!1,subtree:!1};if(Be){const U=Qt(Be);er(U),Vt.observe(Be,D)}return()=>{Vt.disconnect()}},[wt,yr,de,t,r]),p.useEffect(()=>{H!=null&&H.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),te&&!ai("border",`${te}`)&&console.warn(`[react-tooltip] "${te}" is not a valid \`border\`.`),H!=null&&H.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),ue&&!ai("opacity",`${ue}`)&&console.warn(`[react-tooltip] "${ue}" is not a valid \`opacity\`.`)},[]);let tr=h;const br=p.useRef(null);if(i){const we=i({content:(de==null?void 0:de.getAttribute("data-tooltip-content"))||ce||null,activeAnchor:de});tr=we?p.createElement("div",{ref:br,className:"react-tooltip-content-wrapper"},we):null}else ce&&(tr=ce);Ce&&(tr=p.createElement(Bu,{content:Ce}));const Jr={forwardRef:Se,id:e,anchorId:t,anchorSelect:r,className:Dn(a,nt),classNameArrow:o,content:tr,contentWrapperRef:br,place:lt,variant:At,offset:bt,wrapper:K,events:he,openOnClick:g,positionStrategy:Ze,middlewares:b,delayShow:qe,delayHide:y,float:R,hidden:L,noArrow:A,clickable:O,closeOnEsc:k,closeOnScroll:$,closeOnResize:I,openEvents:W,closeEvents:_,globalCloseEvents:F,imperativeModeOnly:P,style:H,position:Y,isOpen:J,defaultIsOpen:q,border:te,opacity:ue,arrowColor:re,arrowSize:fe,setIsOpen:Le,afterShow:De,afterHide:Ne,disableTooltip:_e,activeAnchor:de,setActiveAnchor:we=>Mt(we),role:Je};return p.createElement(Iu,{...Jr})});typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||ii({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||ii({css:`
2
- .styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:var(--rt-arrow-size);height:var(--rt-arrow-size)}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})});const Pu={default:"text-accent-primary",warning:"text-warning-main",error:"text-error-main"},$u={default:"text-secondary-strokeDark",warning:"text-warning-main",error:"text-error-main"};function In({children:e,tooltip:t,status:r="default",attachToChildren:n=!1,icon:s,className:i,placement:a="top",tooltipVariant:o="primary",offset:c=[0,8]}){const f=p.useId(),u=Pu[r],d={name:"customOffset",fn:({x:g,y:x})=>({x:g+c[0],y:x+c[1]})};if(!t)return n?l.jsx("span",{className:N.twJoin("inline-flex items-center gap-1",u,i),children:e}):l.jsx("div",{className:N.twJoin("inline-flex items-center gap-1",u,i),children:e});const h=l.jsx(ss,{size:16,className:$u[r]}),v=s||h;return n?l.jsxs("span",{className:N.twJoin("inline-flex items-center gap-1",u,i),children:[l.jsx("span",{className:"cursor-pointer","data-tooltip-id":f,"data-tooltip-content":typeof t=="string"?t:void 0,"data-tooltip-place":a,"data-tooltip-position-strategy":"fixed","data-tooltip-offset":0,"data-tooltip-wrapper":"span",children:e}),l.jsx(fi,{id:f,className:N.twJoin("react-tooltip",o==="secondary"&&"react-tooltip--secondary"),openOnClick:!1,clickable:!0,place:a,style:{zIndex:99999},positionStrategy:"fixed",middlewares:[d],offset:0,children:typeof t!="string"&&t})]}):l.jsxs("div",{className:N.twJoin("inline-flex items-center gap-1",u,i),children:[e,l.jsx("span",{className:N.twJoin("cursor-pointer inline-flex items-center",u),"data-tooltip-id":f,"data-tooltip-content":typeof t=="string"?t:void 0,"data-tooltip-place":a,"data-tooltip-position-strategy":"fixed","data-tooltip-offset":0,"data-tooltip-wrapper":"span",children:v}),l.jsx(fi,{id:f,className:N.twJoin("react-tooltip",o==="secondary"&&"react-tooltip--secondary"),openOnClick:!1,clickable:!0,place:a,style:{zIndex:99999},positionStrategy:"fixed",middlewares:[d],offset:0,children:typeof t!="string"&&t})]})}var zr=e=>e.type==="checkbox",Pt=e=>e instanceof Date,ke=e=>e==null;const Mo=e=>typeof e=="object";var pe=e=>!ke(e)&&!Array.isArray(e)&&Mo(e)&&!Pt(e),Do=e=>pe(e)&&e.target?zr(e.target)?e.target.checked:e.target.value:e,Hu=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Vo=(e,t)=>e.has(Hu(t)),Wu=e=>{const t=e.constructor&&e.constructor.prototype;return pe(t)&&t.hasOwnProperty("isPrototypeOf")},hs=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ye(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(hs&&(e instanceof Blob||n))&&(r||pe(e)))if(t=r?[]:{},!r&&!Wu(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=ye(e[s]));else return e;return t}var jn=e=>/^\w*$/.test(e),me=e=>e===void 0,vs=e=>Array.isArray(e)?e.filter(Boolean):[],xs=e=>vs(e.replace(/["|']|\]/g,"").split(/\.|\[/)),M=(e,t,r)=>{if(!t||!pe(e))return r;const n=(jn(t)?[t]:xs(t)).reduce((s,i)=>ke(s)?s:s[i],e);return me(n)||n===e?me(e[t])?r:e[t]:n},Pe=e=>typeof e=="boolean",se=(e,t,r)=>{let n=-1;const s=jn(t)?[t]:xs(t),i=s.length,a=i-1;for(;++n<i;){const o=s[n];let c=r;if(n!==a){const f=e[o];c=pe(f)||Array.isArray(f)?f:isNaN(+s[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;e[o]=c,e=e[o]}};const an={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},st={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ct={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},gs=p.createContext(null);gs.displayName="HookFormContext";const Kt=()=>p.useContext(gs),zu=e=>{const{children:t,...r}=e;return p.createElement(gs.Provider,{value:r},t)};var Io=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const a=i;return t._proxyFormState[a]!==st.all&&(t._proxyFormState[a]=!n||st.all),r&&(r[a]=!0),e[a]}});return s};const ys=typeof window<"u"?p.useLayoutEffect:p.useEffect;function bs(e){const t=Kt(),{control:r=t.control,disabled:n,name:s,exact:i}=e||{},[a,o]=p.useState(r._formState),c=p.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ys(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:f=>{!n&&o({...r._formState,...f})}}),[s,n,i]),p.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),p.useMemo(()=>Io(a,r,c.current,!1),[a,r])}var dt=e=>typeof e=="string",Bo=(e,t,r,n,s)=>dt(e)?(n&&t.watch.add(e),M(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),M(r,i))):(n&&(t.watchAll=!0),r),Bn=e=>ke(e)||!Mo(e);function Nt(e,t,r=new WeakSet){if(Bn(e)||Bn(t))return e===t;if(Pt(e)&&Pt(t))return e.getTime()===t.getTime();const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const a=e[i];if(!s.includes(i))return!1;if(i!=="ref"){const o=t[i];if(Pt(a)&&Pt(o)||pe(a)&&pe(o)||Array.isArray(a)&&Array.isArray(o)?!Nt(a,o,r):a!==o)return!1}}return!0}function ws(e){const t=Kt(),{control:r=t.control,name:n,defaultValue:s,disabled:i,exact:a,compute:o}=e||{},c=p.useRef(s),f=p.useRef(o),u=p.useRef(void 0);f.current=o;const d=p.useMemo(()=>r._getWatch(n,c.current),[r,n]),[h,v]=p.useState(f.current?f.current(d):d);return ys(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:g=>{if(!i){const x=Bo(n,r._names,g.values||r._formValues,!1,c.current);if(f.current){const b=f.current(x);Nt(b,u.current)||(v(b),u.current=b)}else v(x)}}}),[r,i,n,a]),p.useEffect(()=>r._removeUnmounted()),h}function Ju(e){const t=Kt(),{name:r,disabled:n,control:s=t.control,shouldUnregister:i,defaultValue:a}=e,o=Vo(s._names.array,r),c=p.useMemo(()=>M(s._formValues,r,M(s._defaultValues,r,a)),[s,r,a]),f=ws({control:s,name:r,defaultValue:c,exact:!0}),u=bs({control:s,name:r,exact:!0}),d=p.useRef(e),h=p.useRef(s.register(r,{...e.rules,value:f,...Pe(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;const v=p.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!M(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!M(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!M(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!M(u.validatingFields,r)},error:{enumerable:!0,get:()=>M(u.errors,r)}}),[u,r]),g=p.useCallback(w=>h.current.onChange({target:{value:Do(w),name:r},type:an.CHANGE}),[r]),x=p.useCallback(()=>h.current.onBlur({target:{value:M(s._formValues,r),name:r},type:an.BLUR}),[r,s._formValues]),b=p.useCallback(w=>{const E=M(s._fields,r);E&&w&&(E._f.ref={focus:()=>w.focus&&w.focus(),select:()=>w.select&&w.select(),setCustomValidity:S=>w.setCustomValidity(S),reportValidity:()=>w.reportValidity()})},[s._fields,r]),C=p.useMemo(()=>({name:r,value:f,...Pe(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:g,onBlur:x,ref:b}),[r,n,u.disabled,g,x,b,f]);return p.useEffect(()=>{const w=s._options.shouldUnregister||i;s.register(r,{...d.current.rules,...Pe(d.current.disabled)?{disabled:d.current.disabled}:{}});const E=(S,A)=>{const O=M(s._fields,S);O&&O._f&&(O._f.mount=A)};if(E(r,!0),w){const S=ye(M(s._options.defaultValues,r));se(s._defaultValues,r,S),me(M(s._formValues,r))&&se(s._formValues,r,S)}return!o&&s.register(r),()=>{(o?w&&!s._state.action:w)?s.unregister(r):E(r,!1)}},[r,s,o,i]),p.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),p.useMemo(()=>({field:C,formState:u,fieldState:v}),[C,u,v])}var Po=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Ar=e=>Array.isArray(e)?e:[e],di=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}},Fe=e=>pe(e)&&!Object.keys(e).length,js=e=>e.type==="file",it=e=>typeof e=="function",ln=e=>{if(!hs)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},$o=e=>e.type==="select-multiple",Cs=e=>e.type==="radio",Uu=e=>Cs(e)||zr(e),kn=e=>ln(e)&&e.isConnected;function qu(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=me(e)?n++:e[t[n++]];return e}function Zu(e){for(const t in e)if(e.hasOwnProperty(t)&&!me(e[t]))return!1;return!0}function ve(e,t){const r=Array.isArray(t)?t:jn(t)?[t]:xs(t),n=r.length===1?e:qu(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(pe(n)&&Fe(n)||Array.isArray(n)&&Zu(n))&&ve(e,r.slice(0,-1)),e}var Ho=e=>{for(const t in e)if(it(e[t]))return!0;return!1};function cn(e,t={}){const r=Array.isArray(e);if(pe(e)||r)for(const n in e)Array.isArray(e[n])||pe(e[n])&&!Ho(e[n])?(t[n]=Array.isArray(e[n])?[]:{},cn(e[n],t[n])):ke(e[n])||(t[n]=!0);return t}function Wo(e,t,r){const n=Array.isArray(e);if(pe(e)||n)for(const s in e)Array.isArray(e[s])||pe(e[s])&&!Ho(e[s])?me(t)||Bn(r[s])?r[s]=Array.isArray(e[s])?cn(e[s],[]):{...cn(e[s])}:Wo(e[s],ke(t)?{}:t[s],r[s]):r[s]=!Nt(e[s],t[s]);return r}var Cr=(e,t)=>Wo(e,t,cn(t));const mi={value:!1,isValid:!1},pi={value:!0,isValid:!0};var zo=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!me(e[0].attributes.value)?me(e[0].value)||e[0].value===""?pi:{value:e[0].value,isValid:!0}:pi:mi}return mi},Jo=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>me(e)?e:t?e===""?NaN:e&&+e:r&&dt(e)?new Date(e):n?n(e):e;const hi={isValid:!1,value:null};var Uo=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,hi):hi;function vi(e){const t=e.ref;return js(t)?t.files:Cs(t)?Uo(e.refs).value:$o(t)?[...t.selectedOptions].map(({value:r})=>r):zr(t)?zo(e.refs).value:Jo(me(t.value)?e.ref.value:t.value,e)}var Xu=(e,t,r,n)=>{const s={};for(const i of e){const a=M(t,i);a&&se(s,i,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},un=e=>e instanceof RegExp,Nr=e=>me(e)?e:un(e)?e.source:pe(e)?un(e.value)?e.value.source:e.value:e,xi=e=>({isOnSubmit:!e||e===st.onSubmit,isOnBlur:e===st.onBlur,isOnChange:e===st.onChange,isOnAll:e===st.all,isOnTouch:e===st.onTouched});const gi="AsyncFunction";var Yu=e=>!!e&&!!e.validate&&!!(it(e.validate)&&e.validate.constructor.name===gi||pe(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===gi)),Ku=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),yi=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Or=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=M(e,s);if(i){const{_f:a,...o}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(Or(o,t))break}else if(pe(o)&&Or(o,t))break}}};function bi(e,t,r){const n=M(e,r);if(n||jn(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),a=M(t,i),o=M(e,i);if(a&&!Array.isArray(a)&&r!==i)return{name:r};if(o&&o.type)return{name:i,error:o};if(o&&o.root&&o.root.type)return{name:`${i}.root`,error:o.root};s.pop()}return{name:r}}var Gu=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return Fe(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!n||st.all))},Qu=(e,t,r)=>!e||!t||e===t||Ar(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),ef=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,tf=(e,t)=>!vs(M(e,t)).length&&ve(e,t),rf=(e,t,r)=>{const n=Ar(M(e,r));return se(n,"root",t[r]),se(e,r,n),e},Gr=e=>dt(e);function wi(e,t,r="validate"){if(Gr(e)||Array.isArray(e)&&e.every(Gr)||Pe(e)&&!e)return{type:r,message:Gr(e)?e:"",ref:t}}var sr=e=>pe(e)&&!un(e)?e:{value:e,message:""},ji=async(e,t,r,n,s,i)=>{const{ref:a,refs:o,required:c,maxLength:f,minLength:u,min:d,max:h,pattern:v,validate:g,name:x,valueAsNumber:b,mount:C}=e._f,w=M(r,x);if(!C||t.has(x))return{};const E=o?o[0]:a,S=F=>{s&&E.reportValidity&&(E.setCustomValidity(Pe(F)?"":F||""),E.reportValidity())},A={},O=Cs(a),k=zr(a),$=O||k,I=(b||js(a))&&me(a.value)&&me(w)||ln(a)&&a.value===""||w===""||Array.isArray(w)&&!w.length,W=Po.bind(null,x,n,A),_=(F,P,H,Y=Ct.maxLength,J=Ct.minLength)=>{const q=F?P:H;A[x]={type:F?Y:J,message:q,ref:a,...W(F?Y:J,q)}};if(i?!Array.isArray(w)||!w.length:c&&(!$&&(I||ke(w))||Pe(w)&&!w||k&&!zo(o).isValid||O&&!Uo(o).isValid)){const{value:F,message:P}=Gr(c)?{value:!!c,message:c}:sr(c);if(F&&(A[x]={type:Ct.required,message:P,ref:E,...W(Ct.required,P)},!n))return S(P),A}if(!I&&(!ke(d)||!ke(h))){let F,P;const H=sr(h),Y=sr(d);if(!ke(w)&&!isNaN(w)){const J=a.valueAsNumber||w&&+w;ke(H.value)||(F=J>H.value),ke(Y.value)||(P=J<Y.value)}else{const J=a.valueAsDate||new Date(w),q=ue=>new Date(new Date().toDateString()+" "+ue),G=a.type=="time",te=a.type=="week";dt(H.value)&&w&&(F=G?q(w)>q(H.value):te?w>H.value:J>new Date(H.value)),dt(Y.value)&&w&&(P=G?q(w)<q(Y.value):te?w<Y.value:J<new Date(Y.value))}if((F||P)&&(_(!!F,H.message,Y.message,Ct.max,Ct.min),!n))return S(A[x].message),A}if((f||u)&&!I&&(dt(w)||i&&Array.isArray(w))){const F=sr(f),P=sr(u),H=!ke(F.value)&&w.length>+F.value,Y=!ke(P.value)&&w.length<+P.value;if((H||Y)&&(_(H,F.message,P.message),!n))return S(A[x].message),A}if(v&&!I&&dt(w)){const{value:F,message:P}=sr(v);if(un(F)&&!w.match(F)&&(A[x]={type:Ct.pattern,message:P,ref:a,...W(Ct.pattern,P)},!n))return S(P),A}if(g){if(it(g)){const F=await g(w,r),P=wi(F,E);if(P&&(A[x]={...P,...W(Ct.validate,P.message)},!n))return S(P.message),A}else if(pe(g)){let F={};for(const P in g){if(!Fe(F)&&!n)break;const H=wi(await g[P](w,r),E,P);H&&(F={...H,...W(P,H.message)},S(H.message),n&&(A[x]=F))}if(!Fe(F)&&(A[x]={ref:E,...F},!n))return A}}return S(!0),A};const nf={mode:st.onSubmit,reValidateMode:st.onChange,shouldFocusError:!0};function sf(e={}){let t={...nf,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:it(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=pe(t.defaultValues)||pe(t.values)?ye(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:ye(s),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,f=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const h={array:di(),state:di()},v=t.criteriaMode===st.all,g=m=>y=>{clearTimeout(f),f=setTimeout(m,y)},x=async m=>{if(!t.disabled&&(u.isValid||d.isValid||m)){const y=t.resolver?Fe((await k()).errors):await I(n,!0);y!==r.isValid&&h.state.next({isValid:y})}},b=(m,y)=>{!t.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((m||Array.from(o.mount)).forEach(j=>{j&&(y?se(r.validatingFields,j,y):ve(r.validatingFields,j))}),h.state.next({validatingFields:r.validatingFields,isValidating:!Fe(r.validatingFields)}))},C=(m,y=[],j,R,T=!0,L=!0)=>{if(R&&j&&!t.disabled){if(a.action=!0,L&&Array.isArray(M(n,m))){const B=j(M(n,m),R.argA,R.argB);T&&se(n,m,B)}if(L&&Array.isArray(M(r.errors,m))){const B=j(M(r.errors,m),R.argA,R.argB);T&&se(r.errors,m,B),tf(r.errors,m)}if((u.touchedFields||d.touchedFields)&&L&&Array.isArray(M(r.touchedFields,m))){const B=j(M(r.touchedFields,m),R.argA,R.argB);T&&se(r.touchedFields,m,B)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=Cr(s,i)),h.state.next({name:m,isDirty:_(m,y),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else se(i,m,y)},w=(m,y)=>{se(r.errors,m,y),h.state.next({errors:r.errors})},E=m=>{r.errors=m,h.state.next({errors:r.errors,isValid:!1})},S=(m,y,j,R)=>{const T=M(n,m);if(T){const L=M(i,m,me(j)?M(s,m):j);me(L)||R&&R.defaultChecked||y?se(i,m,y?L:vi(T._f)):H(m,L),a.mount&&x()}},A=(m,y,j,R,T)=>{let L=!1,B=!1;const K={name:m};if(!t.disabled){if(!j||R){(u.isDirty||d.isDirty)&&(B=r.isDirty,r.isDirty=K.isDirty=_(),L=B!==K.isDirty);const Q=Nt(M(s,m),y);B=!!M(r.dirtyFields,m),Q?ve(r.dirtyFields,m):se(r.dirtyFields,m,!0),K.dirtyFields=r.dirtyFields,L=L||(u.dirtyFields||d.dirtyFields)&&B!==!Q}if(j){const Q=M(r.touchedFields,m);Q||(se(r.touchedFields,m,j),K.touchedFields=r.touchedFields,L=L||(u.touchedFields||d.touchedFields)&&Q!==j)}L&&T&&h.state.next(K)}return L?K:{}},O=(m,y,j,R)=>{const T=M(r.errors,m),L=(u.isValid||d.isValid)&&Pe(y)&&r.isValid!==y;if(t.delayError&&j?(c=g(()=>w(m,j)),c(t.delayError)):(clearTimeout(f),c=null,j?se(r.errors,m,j):ve(r.errors,m)),(j?!Nt(T,j):T)||!Fe(R)||L){const B={...R,...L&&Pe(y)?{isValid:y}:{},errors:r.errors,name:m};r={...r,...B},h.state.next(B)}},k=async m=>{b(m,!0);const y=await t.resolver(i,t.context,Xu(m||o.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return b(m),y},$=async m=>{const{errors:y}=await k(m);if(m)for(const j of m){const R=M(y,j);R?se(r.errors,j,R):ve(r.errors,j)}else r.errors=y;return y},I=async(m,y,j={valid:!0})=>{for(const R in m){const T=m[R];if(T){const{_f:L,...B}=T;if(L){const K=o.array.has(L.name),Q=T._f&&Yu(T._f);Q&&u.validatingFields&&b([R],!0);const he=await ji(T,o.disabled,i,v,t.shouldUseNativeValidation&&!y,K);if(Q&&u.validatingFields&&b([R]),he[L.name]&&(j.valid=!1,y))break;!y&&(M(he,L.name)?K?rf(r.errors,he,L.name):se(r.errors,L.name,he[L.name]):ve(r.errors,L.name))}!Fe(B)&&await I(B,y,j)}}return j.valid},W=()=>{for(const m of o.unMount){const y=M(n,m);y&&(y._f.refs?y._f.refs.every(j=>!kn(j)):!kn(y._f.ref))&&Je(m)}o.unMount=new Set},_=(m,y)=>!t.disabled&&(m&&y&&se(i,m,y),!Nt(ue(),s)),F=(m,y,j)=>Bo(m,o,{...a.mount?i:me(y)?s:dt(m)?{[m]:y}:y},j,y),P=m=>vs(M(a.mount?i:s,m,t.shouldUnregister?M(s,m,[]):[])),H=(m,y,j={})=>{const R=M(n,m);let T=y;if(R){const L=R._f;L&&(!L.disabled&&se(i,m,Jo(y,L)),T=ln(L.ref)&&ke(y)?"":y,$o(L.ref)?[...L.ref.options].forEach(B=>B.selected=T.includes(B.value)):L.refs?zr(L.ref)?L.refs.forEach(B=>{(!B.defaultChecked||!B.disabled)&&(Array.isArray(T)?B.checked=!!T.find(K=>K===B.value):B.checked=T===B.value||!!T)}):L.refs.forEach(B=>B.checked=B.value===T):js(L.ref)?L.ref.value="":(L.ref.value=T,L.ref.type||h.state.next({name:m,values:ye(i)})))}(j.shouldDirty||j.shouldTouch)&&A(m,T,j.shouldTouch,j.shouldDirty,!0),j.shouldValidate&&te(m)},Y=(m,y,j)=>{for(const R in y){if(!y.hasOwnProperty(R))return;const T=y[R],L=m+"."+R,B=M(n,L);(o.array.has(m)||pe(T)||B&&!B._f)&&!Pt(T)?Y(L,T,j):H(L,T,j)}},J=(m,y,j={})=>{const R=M(n,m),T=o.array.has(m),L=ye(y);se(i,m,L),T?(h.array.next({name:m,values:ye(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&j.shouldDirty&&h.state.next({name:m,dirtyFields:Cr(s,i),isDirty:_(m,L)})):R&&!R._f&&!ke(L)?Y(m,L,j):H(m,L,j),yi(m,o)&&h.state.next({...r,name:m}),h.state.next({name:a.mount?m:void 0,values:ye(i)})},q=async m=>{a.mount=!0;const y=m.target;let j=y.name,R=!0;const T=M(n,j),L=Q=>{R=Number.isNaN(Q)||Pt(Q)&&isNaN(Q.getTime())||Nt(Q,M(i,j,Q))},B=xi(t.mode),K=xi(t.reValidateMode);if(T){let Q,he;const rt=y.type?vi(T._f):Do(m),Ze=m.type===an.BLUR||m.type===an.FOCUS_OUT,Ot=!Ku(T._f)&&!t.resolver&&!M(r.errors,j)&&!T._f.deps||ef(Ze,M(r.touchedFields,j),r.isSubmitted,K,B),nt=yi(j,o,Ze);se(i,j,rt),Ze?(T._f.onBlur&&T._f.onBlur(m),c&&c(0)):T._f.onChange&&T._f.onChange(m);const Ae=A(j,rt,Ze),de=!Fe(Ae)||nt;if(!Ze&&h.state.next({name:j,type:m.type,values:ye(i)}),Ot)return(u.isValid||d.isValid)&&(t.mode==="onBlur"?Ze&&x():Ze||x()),de&&h.state.next({name:j,...nt?{}:Ae});if(!Ze&&nt&&h.state.next({...r}),t.resolver){const{errors:Mt}=await k([j]);if(L(rt),R){const Dt=bi(r.errors,n,j),wt=bi(Mt,n,Dt.name||j);Q=wt.error,j=wt.name,he=Fe(Mt)}}else b([j],!0),Q=(await ji(T,o.disabled,i,v,t.shouldUseNativeValidation))[j],b([j]),L(rt),R&&(Q?he=!1:(u.isValid||d.isValid)&&(he=await I(n,!0)));R&&(T._f.deps&&te(T._f.deps),O(j,he,Q,Ae))}},G=(m,y)=>{if(M(r.errors,y)&&m.focus)return m.focus(),1},te=async(m,y={})=>{let j,R;const T=Ar(m);if(t.resolver){const L=await $(me(m)?m:T);j=Fe(L),R=m?!T.some(B=>M(L,B)):j}else m?(R=(await Promise.all(T.map(async L=>{const B=M(n,L);return await I(B&&B._f?{[L]:B}:B)}))).every(Boolean),!(!R&&!r.isValid)&&x()):R=j=await I(n);return h.state.next({...!dt(m)||(u.isValid||d.isValid)&&j!==r.isValid?{}:{name:m},...t.resolver||!m?{isValid:j}:{},errors:r.errors}),y.shouldFocus&&!R&&Or(n,G,m?T:o.mount),R},ue=m=>{const y={...a.mount?i:s};return me(m)?y:dt(m)?M(y,m):m.map(j=>M(y,j))},re=(m,y)=>({invalid:!!M((y||r).errors,m),isDirty:!!M((y||r).dirtyFields,m),error:M((y||r).errors,m),isValidating:!!M(r.validatingFields,m),isTouched:!!M((y||r).touchedFields,m)}),fe=m=>{m&&Ar(m).forEach(y=>ve(r.errors,y)),h.state.next({errors:m?r.errors:{}})},Le=(m,y,j)=>{const R=(M(n,m,{_f:{}})._f||{}).ref,T=M(r.errors,m)||{},{ref:L,message:B,type:K,...Q}=T;se(r.errors,m,{...Q,...y,ref:R}),h.state.next({name:m,errors:r.errors,isValid:!1}),j&&j.shouldFocus&&R&&R.focus&&R.focus()},De=(m,y)=>it(m)?h.state.subscribe({next:j=>"values"in j&&m(F(void 0,y),j)}):F(m,y,!0),Ne=m=>h.state.subscribe({next:y=>{Qu(m.name,y.name,m.exact)&&Gu(y,m.formState||u,bt,m.reRenderRoot)&&m.callback({values:{...i},...r,...y,defaultValues:s})}}).unsubscribe,_e=m=>(a.mount=!0,d={...d,...m.formState},Ne({...m,formState:d})),Je=(m,y={})=>{for(const j of m?Ar(m):o.mount)o.mount.delete(j),o.array.delete(j),y.keepValue||(ve(n,j),ve(i,j)),!y.keepError&&ve(r.errors,j),!y.keepDirty&&ve(r.dirtyFields,j),!y.keepTouched&&ve(r.touchedFields,j),!y.keepIsValidating&&ve(r.validatingFields,j),!t.shouldUnregister&&!y.keepDefaultValue&&ve(s,j);h.state.next({values:ye(i)}),h.state.next({...r,...y.keepDirty?{isDirty:_()}:{}}),!y.keepIsValid&&x()},Se=({disabled:m,name:y})=>{(Pe(m)&&a.mount||m||o.disabled.has(y))&&(m?o.disabled.add(y):o.disabled.delete(y))},ce=(m,y={})=>{let j=M(n,m);const R=Pe(y.disabled)||Pe(t.disabled);return se(n,m,{...j||{},_f:{...j&&j._f?j._f:{ref:{name:m}},name:m,mount:!0,...y}}),o.mount.add(m),j?Se({disabled:Pe(y.disabled)?y.disabled:t.disabled,name:m}):S(m,!0,y.value),{...R?{disabled:y.disabled||t.disabled}:{},...t.progressive?{required:!!y.required,min:Nr(y.min),max:Nr(y.max),minLength:Nr(y.minLength),maxLength:Nr(y.maxLength),pattern:Nr(y.pattern)}:{},name:m,onChange:q,onBlur:q,ref:T=>{if(T){ce(m,y),j=M(n,m);const L=me(T.value)&&T.querySelectorAll&&T.querySelectorAll("input,select,textarea")[0]||T,B=Uu(L),K=j._f.refs||[];if(B?K.find(Q=>Q===L):L===j._f.ref)return;se(n,m,{_f:{...j._f,...B?{refs:[...K.filter(kn),L,...Array.isArray(M(s,m))?[{}]:[]],ref:{type:L.type,name:m}}:{ref:L}}}),S(m,!1,void 0,L)}else j=M(n,m,{}),j._f&&(j._f.mount=!1),(t.shouldUnregister||y.shouldUnregister)&&!(Vo(o.array,m)&&a.action)&&o.unMount.add(m)}}},Ue=()=>t.shouldFocusError&&Or(n,G,o.mount),Ce=m=>{Pe(m)&&(h.state.next({disabled:m}),Or(n,(y,j)=>{const R=M(n,j);R&&(y.disabled=R._f.disabled||m,Array.isArray(R._f.refs)&&R._f.refs.forEach(T=>{T.disabled=R._f.disabled||m}))},0,!1))},Ve=(m,y)=>async j=>{let R;j&&(j.preventDefault&&j.preventDefault(),j.persist&&j.persist());let T=ye(i);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:B}=await k();r.errors=L,T=ye(B)}else await I(n);if(o.disabled.size)for(const L of o.disabled)ve(T,L);if(ve(r.errors,"root"),Fe(r.errors)){h.state.next({errors:{}});try{await m(T,j)}catch(L){R=L}}else y&&await y({...r.errors},j),Ue(),setTimeout(Ue);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Fe(r.errors)&&!R,submitCount:r.submitCount+1,errors:r.errors}),R)throw R},lt=(m,y={})=>{M(n,m)&&(me(y.defaultValue)?J(m,ye(M(s,m))):(J(m,y.defaultValue),se(s,m,ye(y.defaultValue))),y.keepTouched||ve(r.touchedFields,m),y.keepDirty||(ve(r.dirtyFields,m),r.isDirty=y.defaultValue?_(m,ye(M(s,m))):_()),y.keepError||(ve(r.errors,m),u.isValid&&x()),h.state.next({...r}))},Ie=(m,y={})=>{const j=m?ye(m):s,R=ye(j),T=Fe(m),L=T?s:R;if(y.keepDefaultValues||(s=j),!y.keepValues){if(y.keepDirtyValues){const B=new Set([...o.mount,...Object.keys(Cr(s,i))]);for(const K of Array.from(B))M(r.dirtyFields,K)?se(L,K,M(i,K)):J(K,M(L,K))}else{if(hs&&me(m))for(const B of o.mount){const K=M(n,B);if(K&&K._f){const Q=Array.isArray(K._f.refs)?K._f.refs[0]:K._f.ref;if(ln(Q)){const he=Q.closest("form");if(he){he.reset();break}}}}if(y.keepFieldsRef)for(const B of o.mount)J(B,M(L,B));else n={}}i=t.shouldUnregister?y.keepDefaultValues?ye(s):{}:ye(L),h.array.next({values:{...L}}),h.state.next({values:{...L}})}o={mount:y.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!y.keepIsValid||!!y.keepDirtyValues,a.watch=!!t.shouldUnregister,h.state.next({submitCount:y.keepSubmitCount?r.submitCount:0,isDirty:T?!1:y.keepDirty?r.isDirty:!!(y.keepDefaultValues&&!Nt(m,s)),isSubmitted:y.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:T?{}:y.keepDirtyValues?y.keepDefaultValues&&i?Cr(s,i):r.dirtyFields:y.keepDefaultValues&&m?Cr(s,m):y.keepDirty?r.dirtyFields:{},touchedFields:y.keepTouched?r.touchedFields:{},errors:y.keepErrors?r.errors:{},isSubmitSuccessful:y.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},At=(m,y)=>Ie(it(m)?m(i):m,y),be=(m,y={})=>{const j=M(n,m),R=j&&j._f;if(R){const T=R.refs?R.refs[0]:R.ref;T.focus&&(T.focus(),y.shouldSelect&&it(T.select)&&T.select())}},bt=m=>{r={...r,...m}},qe={control:{register:ce,unregister:Je,getFieldState:re,handleSubmit:Ve,setError:Le,_subscribe:Ne,_runSchema:k,_focusError:Ue,_getWatch:F,_getDirty:_,_setValid:x,_setFieldArray:C,_setDisabledField:Se,_setErrors:E,_getFieldArray:P,_reset:Ie,_resetDefaultValues:()=>it(t.defaultValues)&&t.defaultValues().then(m=>{At(m,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:W,_disableForm:Ce,_subjects:h,_proxyFormState:u,get _fields(){return n},get _formValues(){return i},get _state(){return a},set _state(m){a=m},get _defaultValues(){return s},get _names(){return o},set _names(m){o=m},get _formState(){return r},get _options(){return t},set _options(m){t={...t,...m}}},subscribe:_e,trigger:te,register:ce,handleSubmit:Ve,watch:De,setValue:J,getValues:ue,reset:At,resetField:lt,clearErrors:fe,unregister:Je,setError:Le,setFocus:be,getFieldState:re};return{...qe,formControl:qe}}function of(e={}){const t=p.useRef(void 0),r=p.useRef(void 0),[n,s]=p.useState({isDirty:!1,isValidating:!1,isLoading:it(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:it(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!it(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...o}=sf(e);t.current={...o,formState:n}}const i=t.current.control;return i._options=e,ys(()=>{const a=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(o=>({...o,isReady:!0})),i._formState.isReady=!0,a},[i]),p.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),p.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),p.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),p.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),p.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==n.isDirty&&i._subjects.state.next({isDirty:a})}},[i,n.isDirty]),p.useEffect(()=>{e.values&&!Nt(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),r.current=e.values,s(a=>({...a}))):i._resetDefaultValues()},[i,e.values]),p.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Io(n,i),t.current}const Ci=(e,t,r)=>{if(e&&"reportValidity"in e){const n=M(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},qo=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Ci(n.ref,r,e):n.refs&&n.refs.forEach(s=>Ci(s,r,e))}},af=(e,t)=>{t.shouldUseNativeValidation&&qo(e,t);const r={};for(const n in e){const s=M(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(lf(t.names||Object.keys(e),n)){const a=Object.assign({},M(r,n));se(a,"root",i),se(r,n,a)}else se(r,n,i)}return r},lf=(e,t)=>e.some(r=>r.startsWith(t+"."));function cf(e,t,r){return t===void 0&&(t={}),r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(a,o){try{var c=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[r.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:s}))).then(function(f){return i.shouldUseNativeValidation&&qo({},i),{values:r.raw?n:f,errors:{}}}))}catch(f){return o(f)}return c&&c.then?c.then(void 0,o):c}(0,function(a){if(!a.inner)throw a;return{values:{},errors:af((o=a,c=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(o.inner||[]).reduce(function(f,u){if(f[u.path]||(f[u.path]={message:u.message,type:u.type}),c){var d=f[u.path].types,h=d&&d[u.type];f[u.path]=Po(u.path,c,f,u.type,h?[].concat(h,u.message):u.message)}return f},{})),i)};var o,c}))}catch(a){return Promise.reject(a)}}}function uf({className:e,name:t,children:r,mode:n="onBlur",reValidateMode:s="onBlur",defaultValues:i,schema:a,formProps:o,onSubmit:c=()=>null,onChange:f}){const u=of({mode:n,reValidateMode:s,defaultValues:i,resolver:a?cf(a):void 0});return p.useEffect(()=>{if(!f)return;const{unsubscribe:d}=u.watch(f);return d},[f,u.watch]),l.jsx(zu,{...u,children:l.jsx("form",{className:N.twJoin("bbn-form",e),name:t,onSubmit:u.handleSubmit(c),...o,children:r})})}function Gt({name:e,defaultValue:t,disabled:r=!1,autoFocus:n=!1,shouldUnregister:s=!1,validateOnMount:i=!0}){const{setFocus:a,trigger:o}=Kt(),{field:c,fieldState:f}=Ju({name:e,defaultValue:t,disabled:r,shouldUnregister:s}),{invalid:u,isTouched:d,error:h}=f;return p.useEffect(()=>{i?o(e,{shouldFocus:n}):n&&a(e)},[e,i]),{...c,value:c.value,invalid:u&&d,error:(h==null?void 0:h.message)??""}}function ff(e){const{getFieldState:t}=Kt(),r=bs({name:e});return Array.isArray(e)?e.map(s=>t(s,r)):t(e,r)}const df=/^-?\d*\.?\d*$/;function mf({name:e,id:t=e,label:r,hint:n,className:s,controlClassName:i,disabled:a,autoFocus:o,defaultValue:c,placeholder:f,type:u,suffix:d,prefix:h,shouldUnregister:v,state:g,validateOnMount:x}){const{ref:b,value:C="",error:w,invalid:E,onChange:S,onBlur:A}=Gt({name:e,defaultValue:c,autoFocus:o,shouldUnregister:v,validateOnMount:x}),O=E?"error":g,k=E?w:n,$=I=>{df.test(I.target.value)&&S(I.target.value)};return l.jsx(Vr,{label:r,className:i,state:O,hint:k,children:l.jsx(Dr,{inputMode:"decimal",pattern:"^-?\\d*\\.?\\d*$",ref:b,value:C,id:t,name:e,type:u,className:s,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:h,state:O,onChange:$,onBlur:A})})}function pf({name:e,id:t=e,label:r,hint:n,className:s,controlClassName:i,disabled:a,autoFocus:o,defaultValue:c,placeholder:f,type:u,suffix:d,prefix:h,shouldUnregister:v,state:g,validateOnMount:x}){const{ref:b,value:C="",error:w,invalid:E,onChange:S,onBlur:A}=Gt({name:e,defaultValue:c,autoFocus:o,shouldUnregister:v,validateOnMount:x}),O=E?"error":g,k=E?w:n;return l.jsx(Vr,{label:r,className:i,state:O,hint:k,children:l.jsx(Dr,{ref:b,value:C,id:t,name:e,type:u,className:s,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:h,state:O,onChange:S,onBlur:A})})}function hf({name:e,id:t=e,label:r,className:n,disabled:s,value:i,defaultChecked:a,labelClassName:o,orientation:c}){const{ref:f,value:u=!1,onChange:d,onBlur:h}=Gt({name:e});return l.jsx(ki,{ref:f,name:e,checked:u,id:t,label:r,className:n,disabled:s,value:i,defaultChecked:a,labelClassName:o,orientation:c,inputProps:{onChange:d,onBlur:h}})}function vf({name:e,id:t=e,label:r,className:n,disabled:s,value:i,defaultChecked:a,labelClassName:o,orientation:c}){const{ref:f,value:u,onChange:d,onBlur:h}=Gt({name:e,disabled:s,defaultValue:a?i:void 0});return l.jsx(Li,{ref:f,name:e,id:t,label:r,className:n,disabled:s,checked:u===i,value:i,labelClassName:o,orientation:c,inputProps:{onChange:d,onBlur:h}})}function xf({open:e,defaultOpen:t,options:r,optionClassName:n,popoverClassName:s,name:i,id:a=i,label:o,hint:c,className:f,controlClassName:u,disabled:d,autoFocus:h,defaultValue:v,placeholder:g,shouldUnregister:x,state:b,validateOnMount:C,onOpen:w,onClose:E,renderSelectedOption:S}){const{ref:A,value:O="",error:k,invalid:$,onChange:I,onBlur:W}=Gt({name:i,defaultValue:v,autoFocus:h,shouldUnregister:x,validateOnMount:C}),_=$?"error":b,F=$?k:c,P=()=>{W==null||W(),E==null||E()};return l.jsx(Vr,{label:o,className:u,state:_,hint:F,children:l.jsx(ts,{open:e,defaultOpen:t,options:r,ref:A,value:O,id:a,name:i,className:f,disabled:d,placeholder:g,state:_,optionClassName:n,popoverClassName:s,onSelect:I,onBlur:W,onOpen:w,onClose:P,renderSelectedOption:S})})}function Zo({displayError:e=!1,...t}){const{error:r,value:n,onChange:s,onBlur:i,disabled:a,name:o,ref:c}=Gt(t),f=l.jsx("input",{ref:c,type:"hidden",name:o,disabled:a,value:n,onChange:s,onBlur:i});if(e){const u=e?"error":"default",d=e?r:"";return l.jsx(Vr,{hint:d,state:u,children:f})}return f}const gf={lg:{logo:"size-10",subLogo:"text-[0.8rem]"},md:{logo:"size-6",subLogo:"text-[0.5rem]"},sm:{logo:"size-5",subLogo:"text-[0.4rem]"}},Xo=({logoUrl:e,rank:t,moniker:r,size:n="md",className:s})=>{const[i,a]=p.useState(!1),o=gf[n],c=(r==null?void 0:r.charAt(0).toUpperCase())??String(t);return l.jsx("span",{className:N.twMerge("relative inline-block",o.logo,s),children:e&&!i?l.jsx("img",{src:e,alt:r||`Finality Provider ${t}`,className:"h-full w-full rounded-full object-cover",onError:()=>a(!0)}):l.jsx(X,{as:"span",className:"inline-flex h-full w-full items-center justify-center rounded-full bg-secondary-main text-[1rem] text-accent-contrast",children:c})})};function Ns({bsnId:e,bsnName:t,bsnLogoUrl:r,address:n,provider:s,onRemove:i,showChain:a=!0}){var u,d;if(!s)return null;const o=()=>{if(r)return l.jsx(or,{url:r,alt:t,variant:"rounded",size:"tiny",className:"mr-1"});const h=(t==null?void 0:t.charAt(0).toUpperCase())||"?";return l.jsx(or,{variant:"rounded",size:"tiny",className:"mr-1",children:l.jsx(X,{as:"span",className:"inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast",children:h})})},c=h=>!h||h.length<=12?h:`${h.slice(0,6)}...${h.slice(-6)}`,f=()=>a?n?l.jsxs("div",{className:"flex items-center gap-1 text-xs text-accent-secondary",children:[c(n),l.jsx(bo,{value:n,className:"cursor-pointer",copiedText:"✓",children:l.jsx(hn,{size:12})})]}):l.jsxs("div",{className:"flex items-center text-xs text-accent-secondary",children:[o(),t]}):null;return l.jsxs("div",{className:"flex flex-row items-center justify-between",children:[l.jsxs("div",{className:"flex h-10 flex-row gap-2",children:[l.jsx("div",{className:"shrink-0",children:l.jsx(Xo,{logoUrl:s.logo_url,rank:s.rank,moniker:(u=s.description)==null?void 0:u.moniker,size:"lg"})}),l.jsxs("div",{className:"flex flex-col justify-center text-accent-primary",children:[f(),l.jsx(X,{as:"div",className:"text-base font-medium text-accent-primary",children:(d=s.description)==null?void 0:d.moniker})]})]}),i?l.jsx("button",{onClick:()=>i(e),className:"ml-[10px] flex items-center justify-center cursor-pointer p-1",children:l.jsx(ns,{size:12})}):null]})}const yf=({attributes:e,providerItemProps:t,isSelected:r=!1,isSelectable:n=!0,onSelect:s})=>l.jsxs("div",{className:"bg-secondary-highlight h-[316px] overflow-hidden p-4 flex flex-col rounded justify-between",children:[l.jsx(Ns,{...t}),l.jsx("div",{className:"w-full h-px bg-secondary-strokeLight"}),Object.entries(e).map(([i,a])=>l.jsxs("div",{className:"text-sm flex flex-row justify-between first:mt-0 mt-1",children:[l.jsx("div",{className:"text-accent-secondary",children:i}),l.jsx("div",{className:"text-accent-primary font-medium",children:a})]},i)),s&&l.jsx(Me,{className:"mt-4",onClick:s,disabled:!n,variant:r?"contained":"outlined",children:r?"Selected":"Select"})]}),Ss=8,bf=5,Cn=640,Yo=500;function wf(e){return Ft({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"},child:[]}]})(e)}function jf({className:e,...t}){const n=Yt(Cn)?Xt:Ir;return l.jsx(n,{...t,className:N.twMerge("w-[41.25rem] max-w-full",e)})}const Cf=({open:e,validators:t,columns:r,onClose:n,onSelect:s,title:i="",description:a})=>{const[o,c]=p.useState(""),f=()=>{c("")},u=o?l.jsx("button",{onClick:f,className:"opacity-60 hover:opacity-100 transition-opacity",children:l.jsx(wf,{size:18,className:"text-secondary-strokeDark"})}):l.jsx("span",{className:"text-secondary-strokeDark",children:l.jsx(Pa,{size:20})}),d=p.useMemo(()=>o.trim()?t.filter(h=>h.name.toLowerCase().includes(o.toLowerCase())):t,[t,o]);return l.jsxs(jf,{open:e,onClose:n,children:[l.jsx(Br,{title:i,onClose:n,className:"text-accent-primary"}),l.jsxs(Pr,{style:{maxHeight:Yo},className:"no-scrollbar mt-4 flex flex-col gap-6 overflow-y-auto text-accent-primary",children:[a&&l.jsx("div",{children:l.jsx(X,{variant:"body2",className:"text-accent-secondary",children:a})}),l.jsx("div",{children:l.jsx(Dr,{placeholder:"Search",value:o,onChange:h=>c(h.target.value),prefix:u,className:"w-full"})}),l.jsx(uo,{data:d,columns:r,className:"w-full",wrapperClassName:"w-full",onRowSelect:h=>{h&&(s(h),n())}})]})]})};var xr=1e9,Nf={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},As,le=!0,tt="[DecimalError] ",Wt=tt+"Invalid argument: ",Es=tt+"Exponent out of range: ",gr=Math.floor,It=Math.pow,Sf=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$e,je=1e7,oe=7,Ko=9007199254740991,fn=gr(Ko/oe),V={};V.absoluteValue=V.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};V.comparedTo=V.cmp=function(e){var t,r,n,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===s?0:n>s^i.s<0?1:-1};V.decimalPlaces=V.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*oe;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};V.dividedBy=V.div=function(e){return St(this,new this.constructor(e))};V.dividedToIntegerBy=V.idiv=function(e){var t=this,r=t.constructor;return ie(St(t,new r(e),0,1),r.precision)};V.equals=V.eq=function(e){return!this.cmp(e)};V.exponent=function(){return xe(this)};V.greaterThan=V.gt=function(e){return this.cmp(e)>0};V.greaterThanOrEqualTo=V.gte=function(e){return this.cmp(e)>=0};V.isInteger=V.isint=function(){return this.e>this.d.length-2};V.isNegative=V.isneg=function(){return this.s<0};V.isPositive=V.ispos=function(){return this.s>0};V.isZero=function(){return this.s===0};V.lessThan=V.lt=function(e){return this.cmp(e)<0};V.lessThanOrEqualTo=V.lte=function(e){return this.cmp(e)<1};V.logarithm=V.log=function(e){var t,r=this,n=r.constructor,s=n.precision,i=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq($e))throw Error(tt+"NaN");if(r.s<1)throw Error(tt+(r.s?"NaN":"-Infinity"));return r.eq($e)?new n(0):(le=!1,t=St(Fr(r,i),Fr(e,i),i),le=!0,ie(t,s))};V.minus=V.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ea(t,e):Go(t,(e.s=-e.s,e))};V.modulo=V.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(tt+"NaN");return r.s?(le=!1,t=St(r,e,0,1).times(e),le=!0,r.minus(t)):ie(new n(r),s)};V.naturalExponential=V.exp=function(){return Qo(this)};V.naturalLogarithm=V.ln=function(){return Fr(this)};V.negated=V.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};V.plus=V.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Go(t,e):ea(t,(e.s=-e.s,e))};V.precision=V.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Wt+e);if(t=xe(s)+1,n=s.d.length-1,r=n*oe+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};V.squareRoot=V.sqrt=function(){var e,t,r,n,s,i,a,o=this,c=o.constructor;if(o.s<1){if(!o.s)return new c(0);throw Error(tt+"NaN")}for(e=xe(o),le=!1,s=Math.sqrt(+o),s==0||s==1/0?(t=mt(o.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=gr((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(s.toString()),r=c.precision,s=a=r+3;;)if(i=n,n=i.plus(St(o,i,a+2)).times(.5),mt(i.d).slice(0,a)===(t=mt(n.d)).slice(0,a)){if(t=t.slice(a-3,a+1),s==a&&t=="4999"){if(ie(i,r+1,0),i.times(i).eq(o)){n=i;break}}else if(t!="9999")break;a+=4}return le=!0,ie(n,r)};V.times=V.mul=function(e){var t,r,n,s,i,a,o,c,f,u=this,d=u.constructor,h=u.d,v=(e=new d(e)).d;if(!u.s||!e.s)return new d(0);for(e.s*=u.s,r=u.e+e.e,c=h.length,f=v.length,c<f&&(i=h,h=v,v=i,a=c,c=f,f=a),i=[],a=c+f,n=a;n--;)i.push(0);for(n=f;--n>=0;){for(t=0,s=c+n;s>n;)o=i[s]+v[n]*h[s-n-1]+t,i[s--]=o%je|0,t=o/je|0;i[s]=(i[s]+t)%je|0}for(;!i[--a];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,le?ie(e,d.precision):e};V.toDecimalPlaces=V.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(gt(e,0,xr),t===void 0?t=n.rounding:gt(t,0,8),ie(r,e+xe(r)+1,t))};V.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=Zt(n,!0):(gt(e,0,xr),t===void 0?t=s.rounding:gt(t,0,8),n=ie(new s(n),e+1,t),r=Zt(n,!0,e+1)),r};V.toFixed=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?Zt(s):(gt(e,0,xr),t===void 0?t=i.rounding:gt(t,0,8),n=ie(new i(s),e+xe(s)+1,t),r=Zt(n.abs(),!1,e+xe(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};V.toInteger=V.toint=function(){var e=this,t=e.constructor;return ie(new t(e),xe(e)+1,t.rounding)};V.toNumber=function(){return+this};V.toPower=V.pow=function(e){var t,r,n,s,i,a,o=this,c=o.constructor,f=12,u=+(e=new c(e));if(!e.s)return new c($e);if(o=new c(o),!o.s){if(e.s<1)throw Error(tt+"Infinity");return o}if(o.eq($e))return o;if(n=c.precision,e.eq($e))return ie(o,n);if(t=e.e,r=e.d.length-1,a=t>=r,i=o.s,a){if((r=u<0?-u:u)<=Ko){for(s=new c($e),t=Math.ceil(n/oe+4),le=!1;r%2&&(s=s.times(o),Si(s.d,t)),r=gr(r/2),r!==0;)o=o.times(o),Si(o.d,t);return le=!0,e.s<0?new c($e).div(s):ie(s,n)}}else if(i<0)throw Error(tt+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,o.s=1,le=!1,s=e.times(Fr(o,n+f)),le=!0,s=Qo(s),s.s=i,s};V.toPrecision=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?(r=xe(s),n=Zt(s,r<=i.toExpNeg||r>=i.toExpPos)):(gt(e,1,xr),t===void 0?t=i.rounding:gt(t,0,8),s=ie(new i(s),e,t),r=xe(s),n=Zt(s,e<=r||r<=i.toExpNeg,e)),n};V.toSignificantDigits=V.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(gt(e,1,xr),t===void 0?t=n.rounding:gt(t,0,8)),ie(new n(r),e,t)};V.toString=V.valueOf=V.val=V.toJSON=V[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=xe(e),r=e.constructor;return Zt(e,t<=r.toExpNeg||t>=r.toExpPos)};function Go(e,t){var r,n,s,i,a,o,c,f,u=e.constructor,d=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),le?ie(t,d):t;if(c=e.d,f=t.d,a=e.e,s=t.e,c=c.slice(),i=a-s,i){for(i<0?(n=c,i=-i,o=f.length):(n=f,s=a,o=c.length),a=Math.ceil(d/oe),o=a>o?a+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=c.length,i=f.length,o-i<0&&(i=o,n=f,f=c,c=n),r=0;i;)r=(c[--i]=c[i]+f[i]+r)/je|0,c[i]%=je;for(r&&(c.unshift(r),++s),o=c.length;c[--o]==0;)c.pop();return t.d=c,t.e=s,le?ie(t,d):t}function gt(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Wt+e)}function mt(e){var t,r,n,s=e.length-1,i="",a=e[0];if(s>0){for(i+=a,t=1;t<s;t++)n=e[t]+"",r=oe-n.length,r&&(i+=kt(r)),i+=n;a=e[t],n=a+"",r=oe-n.length,r&&(i+=kt(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}var St=function(){function e(n,s){var i,a=0,o=n.length;for(n=n.slice();o--;)i=n[o]*s+a,n[o]=i%je|0,a=i/je|0;return a&&n.unshift(a),n}function t(n,s,i,a){var o,c;if(i!=a)c=i>a?1:-1;else for(o=c=0;o<i;o++)if(n[o]!=s[o]){c=n[o]>s[o]?1:-1;break}return c}function r(n,s,i){for(var a=0;i--;)n[i]-=a,a=n[i]<s[i]?1:0,n[i]=a*je+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,a){var o,c,f,u,d,h,v,g,x,b,C,w,E,S,A,O,k,$,I=n.constructor,W=n.s==s.s?1:-1,_=n.d,F=s.d;if(!n.s)return new I(n);if(!s.s)throw Error(tt+"Division by zero");for(c=n.e-s.e,k=F.length,A=_.length,v=new I(W),g=v.d=[],f=0;F[f]==(_[f]||0);)++f;if(F[f]>(_[f]||0)&&--c,i==null?w=i=I.precision:a?w=i+(xe(n)-xe(s))+1:w=i,w<0)return new I(0);if(w=w/oe+2|0,f=0,k==1)for(u=0,F=F[0],w++;(f<A||u)&&w--;f++)E=u*je+(_[f]||0),g[f]=E/F|0,u=E%F|0;else{for(u=je/(F[0]+1)|0,u>1&&(F=e(F,u),_=e(_,u),k=F.length,A=_.length),S=k,x=_.slice(0,k),b=x.length;b<k;)x[b++]=0;$=F.slice(),$.unshift(0),O=F[0],F[1]>=je/2&&++O;do u=0,o=t(F,x,k,b),o<0?(C=x[0],k!=b&&(C=C*je+(x[1]||0)),u=C/O|0,u>1?(u>=je&&(u=je-1),d=e(F,u),h=d.length,b=x.length,o=t(d,x,h,b),o==1&&(u--,r(d,k<h?$:F,h))):(u==0&&(o=u=1),d=F.slice()),h=d.length,h<b&&d.unshift(0),r(x,d,b),o==-1&&(b=x.length,o=t(F,x,k,b),o<1&&(u++,r(x,k<b?$:F,b))),b=x.length):o===0&&(u++,x=[0]),g[f++]=u,o&&x[0]?x[b++]=_[S]||0:(x=[_[S]],b=1);while((S++<A||x[0]!==void 0)&&w--)}return g[0]||g.shift(),v.e=c,ie(v,a?i+xe(v)+1:i)}}();function Qo(e,t){var r,n,s,i,a,o,c=0,f=0,u=e.constructor,d=u.precision;if(xe(e)>16)throw Error(Es+xe(e));if(!e.s)return new u($e);for(le=!1,o=d,a=new u(.03125);e.abs().gte(.1);)e=e.times(a),f+=5;for(n=Math.log(It(2,f))/Math.LN10*2+5|0,o+=n,r=s=i=new u($e),u.precision=o;;){if(s=ie(s.times(e),o),r=r.times(++c),a=i.plus(St(s,r,o)),mt(a.d).slice(0,o)===mt(i.d).slice(0,o)){for(;f--;)i=ie(i.times(i),o);return u.precision=d,t==null?(le=!0,ie(i,d)):i}i=a}}function xe(e){for(var t=e.e*oe,r=e.d[0];r>=10;r/=10)t++;return t}function Ln(e,t,r){if(t>e.LN10.sd())throw le=!0,r&&(e.precision=r),Error(tt+"LN10 precision limit exceeded");return ie(new e(e.LN10),t)}function kt(e){for(var t="";e--;)t+="0";return t}function Fr(e,t){var r,n,s,i,a,o,c,f,u,d=1,h=10,v=e,g=v.d,x=v.constructor,b=x.precision;if(v.s<1)throw Error(tt+(v.s?"NaN":"-Infinity"));if(v.eq($e))return new x(0);if(t==null?(le=!1,f=b):f=t,v.eq(10))return t==null&&(le=!0),Ln(x,f);if(f+=h,x.precision=f,r=mt(g),n=r.charAt(0),i=xe(v),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=mt(v.d),n=r.charAt(0),d++;i=xe(v),n>1?(v=new x("0."+r),i++):v=new x(n+"."+r.slice(1))}else return c=Ln(x,f+2,b).times(i+""),v=Fr(new x(n+"."+r.slice(1)),f-h).plus(c),x.precision=b,t==null?(le=!0,ie(v,b)):v;for(o=a=v=St(v.minus($e),v.plus($e),f),u=ie(v.times(v),f),s=3;;){if(a=ie(a.times(u),f),c=o.plus(St(a,new x(s),f)),mt(c.d).slice(0,f)===mt(o.d).slice(0,f))return o=o.times(2),i!==0&&(o=o.plus(Ln(x,f+2,b).times(i+""))),o=St(o,new x(d),f),x.precision=b,t==null?(le=!0,ie(o,b)):o;o=c,s+=2}}function Ni(e,t){var r,n,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(n,s),t){if(s-=n,r=r-n-1,e.e=gr(r/oe),e.d=[],n=(r+1)%oe,r<0&&(n+=oe),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=oe;n<s;)e.d.push(+t.slice(n,n+=oe));t=t.slice(n),n=oe-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),le&&(e.e>fn||e.e<-fn))throw Error(Es+r)}else e.s=0,e.e=0,e.d=[0];return e}function ie(e,t,r){var n,s,i,a,o,c,f,u,d=e.d;for(a=1,i=d[0];i>=10;i/=10)a++;if(n=t-a,n<0)n+=oe,s=t,f=d[u=0];else{if(u=Math.ceil((n+1)/oe),i=d.length,u>=i)return e;for(f=i=d[u],a=1;i>=10;i/=10)a++;n%=oe,s=n-oe+a}if(r!==void 0&&(i=It(10,a-s-1),o=f/i%10|0,c=t<0||d[u+1]!==void 0||f%i,c=r<4?(o||c)&&(r==0||r==(e.s<0?3:2)):o>5||o==5&&(r==4||c||r==6&&(n>0?s>0?f/It(10,a-s):0:d[u-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return c?(i=xe(e),d.length=1,t=t-i-1,d[0]=It(10,(oe-t%oe)%oe),e.e=gr(-t/oe)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=u,i=1,u--):(d.length=u+1,i=It(10,oe-n),d[u]=s>0?(f/It(10,a-s)%It(10,s)|0)*i:0),c)for(;;)if(u==0){(d[0]+=i)==je&&(d[0]=1,++e.e);break}else{if(d[u]+=i,d[u]!=je)break;d[u--]=0,i=1}for(n=d.length;d[--n]===0;)d.pop();if(le&&(e.e>fn||e.e<-fn))throw Error(Es+xe(e));return e}function ea(e,t){var r,n,s,i,a,o,c,f,u,d,h=e.constructor,v=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),le?ie(t,v):t;if(c=e.d,d=t.d,n=t.e,f=e.e,c=c.slice(),a=f-n,a){for(u=a<0,u?(r=c,a=-a,o=d.length):(r=d,n=f,o=c.length),s=Math.max(Math.ceil(v/oe),o)+2,a>s&&(a=s,r.length=1),r.reverse(),s=a;s--;)r.push(0);r.reverse()}else{for(s=c.length,o=d.length,u=s<o,u&&(o=s),s=0;s<o;s++)if(c[s]!=d[s]){u=c[s]<d[s];break}a=0}for(u&&(r=c,c=d,d=r,t.s=-t.s),o=c.length,s=d.length-o;s>0;--s)c[o++]=0;for(s=d.length;s>a;){if(c[--s]<d[s]){for(i=s;i&&c[--i]===0;)c[i]=je-1;--c[i],c[s]+=je}c[s]-=d[s]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,le?ie(t,v):t):new h(0)}function Zt(e,t,r){var n,s=xe(e),i=mt(e.d),a=i.length;return t?(r&&(n=r-a)>0?i=i.charAt(0)+"."+i.slice(1)+kt(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+kt(-s-1)+i,r&&(n=r-a)>0&&(i+=kt(n))):s>=a?(i+=kt(s+1-a),r&&(n=r-s-1)>0&&(i=i+"."+kt(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-a)>0&&(s+1===a&&(i+="."),i+=kt(n))),e.s<0?"-"+i:i}function Si(e,t){if(e.length>t)return e.length=t,!0}function ta(e){var t,r,n;function s(i){var a=this;if(!(a instanceof s))return new s(i);if(a.constructor=s,i instanceof s){a.s=i.s,a.e=i.e,a.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Wt+i);if(i>0)a.s=1;else if(i<0)i=-i,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(i===~~i&&i<1e7){a.e=0,a.d=[i];return}return Ni(a,i.toString())}else if(typeof i!="string")throw Error(Wt+i);if(i.charCodeAt(0)===45?(i=i.slice(1),a.s=-1):a.s=1,Sf.test(i))Ni(a,i);else throw Error(Wt+i)}if(s.prototype=V,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=ta,s.config=s.set=Ef,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return s.config(e),s}function Ef(e){if(!e||typeof e!="object")throw Error(tt+"Object expected");var t,r,n,s=["precision",1,xr,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((n=e[r=s[t]])!==void 0)if(gr(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Wt+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Wt+r+": "+n);return this}var As=ta(Nf);$e=new As(1);const Af={prefix:"$",precision:2,zeroDisplay:"-",format:{minimumFractionDigits:2,maximumFractionDigits:2}};function Of(e,t={}){const{prefix:r,precision:n,zeroDisplay:s,format:i}={...Af,...t};if(e===0)return s;const a=e.toLocaleString("en",i??{maximumFractionDigits:n});return`${r}${a}`}function ra(e,t,r){const n=e*t;return Of(n,r)}const kf=(e,t,r)=>new As(e).toDecimalPlaces(t,r).toNumber();function Lf(e,t){return e===0?`0 ${t}`:e>=1?`${e.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4})} ${t}`:`${e.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:8}).replace(/\.?0+$/,"")} ${t}`}const _f=({fieldName:e,currencyIcon:t,currencyName:r,displayBalance:n,placeholder:s="Enter Amount",balanceDetails:i,prefix:a,min:o="0",step:c="any",autoFocus:f=!0,decimals:u})=>{const d=ws({name:e,defaultValue:""}),{setValue:h}=Kt(),v=parseFloat(d||"0"),g=ra(v,(i==null?void 0:i.price)??0,{zeroDisplay:"$0.00"}),x=w=>{let E=w.target.value;if(u!==void 0&&u>=0){const[S,A]=E.split(".",2);A!==void 0&&A.length>u?E=S+"."+A.slice(0,u):A!==void 0?E=S+"."+A:E.includes(".")&&(E=S)}h(e,E,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},b=w=>{(w.key==="ArrowUp"||w.key==="ArrowDown")&&w.preventDefault()};let C;return i&&(C=`${kf(Number(i.balance),i.decimals??Ss)} ${i.symbol}`,a&&(C=`${a}: ${C}`)),l.jsxs(l.Fragment,{children:[l.jsx(Zo,{name:e,defaultValue:""}),l.jsx(hr,{className:"flex w-full flex-col content-center justify-between gap-4",children:l.jsx(xn,{amount:d,currencyIcon:t,currencyName:r,placeholder:s,displayBalance:n,balanceDetails:i,min:o,step:c,autoFocus:f,onChange:x,onKeyDown:b,amountUsd:g,subtitle:C})})]})};function Ff({items:e,onRemove:t,showChain:r=!0}){const n=p.useMemo(()=>e,[e]);return n.length===0?null:l.jsx("div",{className:"flex flex-col gap-8",children:n.map(({bsnId:s,bsnName:i,bsnLogoUrl:a,provider:o})=>l.jsx(Ns,{bsnId:s,bsnName:i,bsnLogoUrl:a,provider:o,onRemove:t,showChain:r},`${s}-${o.rank}`))})}function Tf({max:e,items:t=[],actionText:r,onAdd:n,onRemove:s,showChain:i=!0}){const a=p.useMemo(()=>t.length,[t]);return l.jsx(hr,{children:l.jsxs("div",{className:"flex w-full flex-col gap-4",children:[l.jsx("div",{className:"flex flex-row",children:l.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[l.jsx("span",{className:"text-sm sm:text-base",children:r}),l.jsx(vo,{counter:a,max:e,onAdd:n})]})}),a>0&&l.jsx(Ff,{items:t,onRemove:s,showChain:i})]})})}function mr({title:e,children:t,className:r,hint:n}){return l.jsxs("div",{className:N.twMerge("flex flex-row items-center justify-between text-accent-primary",n&&"items-start",r),children:[l.jsx(X,{as:"div",variant:"body1",children:e}),n?l.jsxs("div",{className:"flex flex-col items-end",children:[l.jsx(X,{as:"div",className:"flex items-center gap-2",children:t}),l.jsx(X,{as:"div",variant:"body2",className:"text-accent-secondary",children:n})]}):l.jsx(X,{as:"div",className:"flex items-center gap-2",children:t})]})}function Rf(e){return Ft({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"},child:[]}]})(e)}function na({value:e,onEdit:t,title:r="Network Fee Rate",className:n}){return l.jsxs(mr,{title:r,className:n,children:[l.jsxs("span",{children:[e," sats/vB"]}),t&&l.jsx(Me,{size:"small",variant:"outlined",className:"h-6 w-6 pl-1 text-secondary-strokeDark",onClick:t,children:l.jsx(Rf,{size:16,className:"text-secondary-strokeDark"})})]})}function sa({amount:e,coinSymbol:t,hint:r,title:n,className:s,decimals:i=Ss}){let a;return typeof e=="number"?e===0?a="0":a=e.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):a=e,l.jsxs(mr,{title:n??`${t} Network Fee`,hint:r,className:s,children:[a," ",t]})}function ia({amount:e,coinSymbol:t,hint:r,title:n,className:s,decimals:i=bf}){const a=typeof e=="number"?e.toFixed(i):e;return l.jsxs(mr,{title:n??`${t} Network Fee`,hint:r,className:s,children:[a," ",t]})}function oa({total:e,coinSymbol:t,hint:r,title:n="Total",className:s,decimals:i=Ss}){let a;return typeof e=="number"?e===0?a="0":a=e.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):a=e,l.jsxs("div",{className:N.twMerge("flex flex-row items-start justify-between text-accent-primary",s),children:[l.jsx(X,{variant:"body1",className:"font-bold",children:n}),l.jsxs("div",{className:"flex flex-col items-end justify-center",children:[l.jsxs(X,{variant:"body1",className:"font-bold",children:[a," ",t]}),r&&l.jsx(X,{variant:"body1",className:"text-sm text-accent-secondary",children:r})]})]})}function Mf({className:e,feeRate:t,onFeeRateEdit:r,feeAmount:n,coinSymbol:s,feeAmountHint:i,total:a,totalHint:o,bbnFeeAmount:c,bbnCoinSymbol:f,bbnFeeAmountHint:u,bbnFeeDecimals:d}){return l.jsx(hr,{className:N.twMerge("flex w-full flex-col content-center justify-between gap-4",e),children:l.jsxs("div",{className:"flex flex-col gap-6 p-4",children:[t!==void 0&&l.jsx(na,{value:t,onEdit:r}),n!==void 0&&s!==void 0&&l.jsx(sa,{amount:n,coinSymbol:s,hint:i}),c!==void 0&&f?l.jsx(ia,{amount:c,coinSymbol:f,hint:u,decimals:d}):null,a!==void 0&&s!==void 0&&l.jsx("div",{className:"divider my-4"}),a!==void 0&&s!==void 0&&l.jsx(oa,{total:a,coinSymbol:s,hint:o})]})})}const Df=({data:e})=>{if(!e||e.length===0)return null;const t=e[0],r=e.slice(1),s={gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`};return l.jsx(fo,{className:"p-6 pt-4",children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:"items-center gap-4 pb-4 grid",style:s,children:t.map((i,a)=>l.jsx(X,{variant:"caption",className:"text-secondary px-2.5",children:i},`header-${a}`))}),r.map((i,a)=>l.jsx("div",{className:"items-center gap-4 rounded bg-primary-contrast p-1 grid",style:s,children:i.map((o,c)=>l.jsx("div",{className:"flex w-full items-center gap-2 py-1 px-2.5",children:o},`cell-${a}-${c}`))},`row-${a}`))]})})};function Vf({className:e,...t}){const n=Yt(Cn)?Xt:Ir;return l.jsx(n,{...t,className:N.twMerge("w-[41.25rem] max-w-full",e)})}const If=({open:e,processing:t=!1,onClose:r,onProceed:n,bsns:s,finalityProviders:i,details:a,visibleFields:o,warnings:c,proceedLabel:f="Proceed to Signing"})=>{const u=[{label:"Stake Amount",value:a.stakeAmount},{label:"Fee Rate",value:a.feeRate},{label:"Transaction Fees",value:a.transactionFees},{label:"Term",value:l.jsxs(l.Fragment,{children:[a.term.blocks,l.jsx("br",{}),l.jsx("span",{className:"text-md text-secondary",children:a.term.duration})]})},{label:"Unbonding",value:a.unbonding},{label:"Unbonding Fee",value:a.unbondingFee}],d=o&&o.length>0?u.filter(g=>o.includes(g.label)):u,v=!i||i.length===0?[["Validator"],...s.map((g,x)=>[l.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[g.icon,l.jsx(X,{variant:"body2",className:"font-medium",children:g.name})]},`validator-${x}`)])]:[["BSNs","Finality Provider"],...s.map((g,x)=>{const b=i[x];return[l.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[g.icon,l.jsx(X,{variant:"body2",className:"font-medium",children:g.name})]},`bsn-${x}`),b?l.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[b.icon,l.jsx(X,{variant:"body2",className:"font-medium",children:b.name})]},`fp-${x}`):l.jsx("div",{},`fp-${x}`)]})];return l.jsxs(Vf,{open:e,onClose:r,children:[l.jsx(Br,{title:"Preview",onClose:r,className:"text-accent-primary"}),l.jsxs(Pr,{className:"no-scrollbar mb-8 mt-4 flex max-h-[calc(100vh-12rem)] flex-col gap-4 overflow-y-auto text-accent-primary",children:[l.jsx(Df,{data:v}),l.jsx("div",{className:"flex flex-col",children:d.map((g,x)=>l.jsxs("div",{className:"flex flex-row items-center justify-between py-3",children:[l.jsx(X,{variant:"body1",className:"text-secondary font-normal",children:g.label}),l.jsx(X,{variant:"body1",className:"text-right font-normal",children:g.value})]},x))}),l.jsx("div",{className:"border-divider w-full border-t"}),l.jsxs("div",{className:"pt-2",children:[l.jsx(dn,{variant:"h6",className:"text-primary mb-2",children:"Attention!"}),c.map((g,x)=>l.jsx(X,{variant:"body2",className:"text-secondary",children:g},x))]})]}),l.jsxs(vn,{className:"flex flex-col gap-4 pb-8 pt-0 sm:flex-row",children:[l.jsx(Me,{variant:"contained",color:"primary",onClick:n,className:"w-full sm:flex-1 sm:order-2",disabled:t,children:t?"Processing...":f}),l.jsx(Me,{variant:"outlined",color:"primary",onClick:r,className:"w-full sm:flex-1 sm:order-1",children:"Cancel"})]})]})};function aa({actions:e}){return l.jsx("div",{className:"mt-4 sm:mt-6 flex gap-2",children:e.map((t,r)=>l.jsx(Me,{variant:t.variant||"outlined",className:`sm:bbn-btn-medium flex-1 ${t.className||""}`,onClick:t.onClick,fluid:!0,children:t.label},`${t.label}-${r}`))})}function la({formattedAmount:e,icon:t,iconAlt:r,chainName:n,chainIcon:s,chainIconAlt:i}){return l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[t&&(typeof t=="string"?l.jsx("img",{src:t,alt:r||"icon",className:"w-6 h-6 sm:w-8 sm:h-8"}):t),l.jsx("span",{className:"text-base sm:text-lg font-medium text-accent-primary",children:e})]}),n&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-base sm:text-lg font-medium text-accent-primary",children:n}),s&&(typeof s=="string"?l.jsx("img",{src:s,alt:i||"chain icon",className:"w-6 h-6 sm:w-8 sm:h-8"}):s)]})]})}function ca({item:e,className:t}){return l.jsxs("div",{className:N.twMerge("flex items-center gap-2 min-w-0",t),children:[l.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium truncate flex items-center",children:e.name}),e.icon&&l.jsx("div",{className:"flex items-center w-4 h-4 flex-shrink-0 justify-center text-xs sm:text-sm",children:typeof e.icon=="string"?l.jsx("img",{src:e.icon,alt:e.iconAlt||e.name,className:"w-full h-full rounded-full object-cover"}):e.icon})]})}function Pn({label:e,value:t,collapsible:r=!1,nestedDetails:n}){const[s,i]=p.useState(!1),a=()=>{i(!s)};return r?l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0 overflow-x-auto",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[l.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary",children:e}),l.jsx("button",{onClick:a,className:"w-5 h-5 flex-shrink-0 hover:opacity-70 transition-opacity","aria-label":s?"Collapse":"Expand",children:s?l.jsx(Qi,{size:20,variant:"secondary"}):l.jsx(eo,{size:20,variant:"secondary"})})]}),l.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium text-right min-w-0 overflow-x-auto whitespace-nowrap",children:t})]}),s&&n&&l.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:n.map((o,c)=>l.jsx(Pn,{label:o.label,value:o.value,collapsible:o.collapsible,nestedDetails:o.nestedDetails},c))})]}):l.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0 overflow-x-auto",children:[l.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary flex-shrink-0",children:e}),l.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium text-right min-w-0 overflow-x-auto whitespace-nowrap",children:t})]})}function ua({details:e,optionalDetails:t,listItems:r}){const n=t&&t.length>0,s=r&&r.length>0;return l.jsxs("div",{className:"space-y-3 sm:space-y-4 overflow-x-auto",children:[l.jsx("div",{className:"space-y-4 sm:space-y-6",children:e.map((i,a)=>l.jsx(Pn,{label:i.label,value:i.value,collapsible:i.collapsible,nestedDetails:i.nestedDetails},a))}),s&&l.jsx("div",{className:"space-y-3 sm:space-y-4",children:r.map((i,a)=>l.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:l.jsxs("div",{className:"flex justify-between items-start gap-2",children:[l.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary",children:i.label}),l.jsx("div",{className:"flex flex-wrap gap-2",children:i.items.map((o,c)=>l.jsx(ca,{item:o},o.id||c))})]})},a))}),n&&l.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:t.map((i,a)=>l.jsx(Pn,{label:i.label,value:i.value,collapsible:i.collapsible,nestedDetails:i.nestedDetails},a))})]})}function Bf({data:e,className:t}){return l.jsxs("div",{className:`w-full bg-secondary-highlight p-3 sm:p-4 rounded flex flex-col justify-between ${t||""}`,children:[l.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[l.jsx(la,{formattedAmount:e.formattedAmount,icon:e.icon,iconAlt:e.iconAlt,chainName:e.chainName,chainIcon:e.chainIcon,chainIconAlt:e.chainIconAlt}),l.jsx(ua,{details:e.details,optionalDetails:e.optionalDetails,listItems:e.listItems}),e.secondaryActions&&e.secondaryActions.length>0&&l.jsx(aa,{actions:e.secondaryActions})]}),e.primaryAction&&l.jsx(Me,{variant:"outlined",className:`mt-4 ${e.primaryAction.className||""}`,onClick:e.primaryAction.onClick,fluid:e.primaryAction.fullWidth!==!1,children:e.primaryAction.label})]})}function Pf({className:e,...t}){const n=Yt(Cn)?Xt:Ir;return l.jsx(n,{...t,className:N.twMerge("w-[41.25rem] max-w-full",e)})}const $f=({open:e,processing:t=!1,title:r,onClose:n,onProceed:s,tokens:i,transactionFees:a})=>l.jsxs(Pf,{open:e,onClose:n,children:[l.jsx(Br,{title:r,className:"text-accent-primary"}),l.jsx(Pr,{className:"no-scrollbar mb-[40px] mt-8 flex max-h-[calc(100vh-12rem)] flex-col overflow-y-auto text-accent-primary",children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:i.map((o,c)=>{var f,u;return l.jsxs("div",{children:[l.jsx(mr,{title:o.name,hint:(f=o.amount)==null?void 0:f.usd,children:l.jsxs("div",{className:"flex items-center gap-2",children:[o.icon,(u=o.amount)==null?void 0:u.token]})}),c<i.length-1&&l.jsx("div",{className:"h-4"})]},`token-${c}`)})}),l.jsx("div",{className:"pt-6 pb-6",children:l.jsx("div",{className:"border-divider w-full border-t"})}),l.jsx(mr,{title:"Transaction Fees",hint:a.usd,children:a.token})]})}),l.jsxs(vn,{className:"flex flex-col gap-4 pt-0 sm:flex-row",children:[l.jsx(Me,{variant:"contained",color:"primary",onClick:s,className:"w-full sm:flex-1 sm:order-2",disabled:t,children:t?"Processing...":"Proceed"}),l.jsx(Me,{variant:"outlined",color:"primary",onClick:n,className:"w-full sm:flex-1 sm:order-1",children:"Cancel"})]})]}),Hf=({rewards:e,onClick:t,disabled:r})=>l.jsxs(hr,{className:"flex w-full flex-col content-center justify-between gap-4",children:[e.map((n,s)=>{var o;const i=parseFloat(String(n.amount)),a=ra(i,((o=n.balanceDetails)==null?void 0:o.price)??0,{zeroDisplay:"$0.00"});return l.jsx(xn,{amount:n.amount,currencyIcon:n.currencyIcon,currencyName:n.currencyName,placeholder:n.placeholder??"Enter Amount",displayBalance:n.displayBalance,balanceDetails:n.balanceDetails,min:n.min??"0",step:n.step??"any",autoFocus:!1,onChange:()=>{},onKeyDown:()=>{},amountUsd:a,disabled:!0,subtitle:n.chainName},s)}),l.jsx(Me,{onClick:t,disabled:r,children:"Claim"})]}),Wf=({size:e="md"})=>{const t={sm:"mt-2",md:"mt-4",lg:"mt-6"};return l.jsx("div",{className:t[e]})},zf=()=>l.jsx("svg",{width:"29",height:"28",viewBox:"0 0 29 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M24.9127 15.3708C24.9711 14.9333 25.0002 14.4812 25.0002 14C25.0002 13.5333 24.9711 13.0667 24.8982 12.6292L27.8586 10.325C28.1211 10.1208 28.194 9.72708 28.0336 9.43542L25.2336 4.59375C25.0586 4.27292 24.694 4.17083 24.3732 4.27292L20.8877 5.67292C20.1586 5.11875 19.3857 4.65208 18.5252 4.30208L18.0002 0.597916C17.9419 0.247916 17.6502 0 17.3002 0H11.7002C11.3502 0 11.0732 0.247916 11.0148 0.597916L10.4898 4.30208C9.62941 4.65208 8.84191 5.13333 8.12732 5.67292L4.64191 4.27292C4.32107 4.15625 3.95649 4.27292 3.78149 4.59375L0.996075 9.43542C0.821075 9.74167 0.879408 10.1208 1.17107 10.325L4.13149 12.6292C4.05857 13.0667 4.00024 13.5479 4.00024 14C4.00024 14.4521 4.02941 14.9333 4.10232 15.3708L1.14191 17.675C0.879408 17.8792 0.806491 18.2729 0.966908 18.5646L3.76691 23.4062C3.94191 23.7271 4.30649 23.8292 4.62732 23.7271L8.11274 22.3271C8.84191 22.8812 9.61482 23.3479 10.4752 23.6979L11.0002 27.4021C11.0732 27.7521 11.3502 28 11.7002 28H17.3002C17.6502 28 17.9419 27.7521 17.9857 27.4021L18.5107 23.6979C19.3711 23.3479 20.1586 22.8812 20.8732 22.3271L24.3586 23.7271C24.6794 23.8438 25.044 23.7271 25.219 23.4062L28.019 18.5646C28.194 18.2437 28.1211 17.8792 27.844 17.675L24.9127 15.3708ZM14.5002 19.25C11.6127 19.25 9.25024 16.8875 9.25024 14C9.25024 11.1125 11.6127 8.75 14.5002 8.75C17.3877 8.75 19.7502 11.1125 19.7502 14C19.7502 16.8875 17.3877 19.25 14.5002 19.25Z",fill:"#9E9E9E"})}),fa=()=>l.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),da=({children:e,className:t=""})=>l.jsx(X,{variant:"body1",className:N.twJoin("px-7 pb-6 text-accent-primary md:hidden",t),children:e}),ma=({background:e="none",backgroundClassName:t="",className:r="",children:n})=>{const s=()=>{switch(e){case"secondary":return"mx-[21px] rounded-lg bg-secondary-highlight md:mx-0 md:bg-transparent";case"custom":return t;default:return""}};return l.jsx("div",{className:N.twJoin(s(),r),children:n})},pr=({children:e})=>l.jsx(l.Fragment,{children:e}),Os=({icon:e,suffix:t,onClick:r,disabled:n=!1,selected:s=!1,className:i="",toggle:a,children:o})=>{const c=p.Children.toArray(o),f=c.find(v=>typeof v=="string"||p.isValidElement(v)&&v.type!==pr),u=c.find(v=>p.isValidElement(v)&&v.type===pr),d=typeof f=="string"?f:"",h=r&&!a?l.jsx(fa,{}):void 0;return l.jsx(go,{icon:e,name:d,description:u?u.props.children:void 0,onClick:r,disabled:n,selected:s,className:i,suffix:t||h,toggle:a})},pa=({icon:e,className:t="",children:r})=>{const n=p.Children.toArray(r),s=n.find(c=>typeof c=="string"||p.isValidElement(c)&&c.type!==pr),i=n.find(c=>p.isValidElement(c)&&c.type===pr),a=n.filter(c=>p.isValidElement(c)&&c.type===Os),o=typeof s=="string"?s:"";return l.jsx(yo,{icon:e,name:o,description:i?i.props.children:void 0,className:t,suffix:l.jsx(fa,{}),children:a})},ha=({children:e,className:t=""})=>l.jsx("div",{className:t,children:e}),Jf=({trigger:e,open:t,onOpenChange:r,placement:n="bottom-end",className:s,offset:i=[0,8],children:a})=>{const o=l.jsx("button",{className:"flex h-10 w-10 items-center justify-center rounded-lg transition-colors hover:bg-accent-primary/10","aria-label":"Settings menu",children:l.jsx(zf,{})});return l.jsx(ls,{trigger:e||o,open:t,onOpenChange:r,placement:n,className:N.twJoin("relative",s),offset:i,mobileMode:"drawer",children:a})},Rt=Jf;Rt.Title=da;Rt.Group=ma;Rt.Item=Os;Rt.SubMenu=pa;Rt.Description=pr;Rt.CustomContent=ha;Rt.Spacer=Wf;const $n=({walletType:e,walletName:t,walletIcon:r,address:n,isCopied:s,onCopy:i,className:a,balances:o,coinSymbol:c,isBalanceLoading:f=!1,hasUnconfirmedTransactions:u=!1,formatBalance:d})=>{const v=d||(C=>c?Lf(C,c):C.toString()),g=(C,w=!1)=>f||w?l.jsx(to,{size:20,className:"text-accent-primary"}):C===void 0?l.jsx(X,{className:"text-accent-secondary text-sm",children:"N/A"}):l.jsx(X,{variant:"body1",className:"text-accent-primary !text-sm",children:v(C)}),x=()=>l.jsxs(l.Fragment,{children:[(o==null?void 0:o.staked)!==void 0&&l.jsxs("div",{className:"flex flex-col mb-1",children:[l.jsx(X,{variant:"body1",className:"text-accent-secondary font-medium !text-xs",children:"Staked Balance"}),g(o.staked)]}),(o==null?void 0:o.stakable)!==void 0&&l.jsxs("div",{className:"flex flex-col",children:[l.jsx(X,{variant:"body1",className:"text-accent-secondary font-medium !text-xs",children:"Stakable Balance"}),l.jsx("div",{className:"flex items-center gap-2",children:g(o.stakable,f||u)})]})]}),b=()=>l.jsx(l.Fragment,{children:(o==null?void 0:o.available)!==void 0&&l.jsxs("div",{className:"flex flex-col",children:[l.jsx(X,{variant:"body1",className:"text-accent-secondary font-medium !text-xs",children:"Balance"}),g(o.available)]})});return l.jsx("div",{className:N.twJoin("bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-[4px] p-3 flex-1 md:p-4",a),children:l.jsxs("div",{className:"flex flex-col w-full",children:[l.jsxs("div",{className:"flex items-center gap-2.5 mb-2 md:mb-3",children:[l.jsx(or,{alt:t||e,url:r||"",size:"large",className:"w-8 h-8 md:w-10 md:h-10 flex-shrink-0"}),l.jsxs("div",{className:"flex flex-1 flex-col items-start min-w-0",children:[l.jsxs(X,{variant:"body1",className:"text-accent-primary font-medium text-xs",children:[e," Wallet"]}),l.jsxs("div",{className:"flex items-center gap-1",children:[s?l.jsx(X,{className:"text-accent-secondary text-xs",children:"Copied ✓"}):l.jsx(cs,{className:"text-accent-secondary text-xs",value:n,symbols:6}),l.jsx("button",{onClick:i,className:"flex-shrink-0 p-1 rounded hover:bg-[#d7e1e7] dark:hover:bg-[#252525] transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80",children:l.jsx(hn,{size:14,className:"md:w-4 md:h-4"})})]})]})]}),o&&c&&l.jsx("div",{className:"space-y-2",children:e==="Bitcoin"?x():b()})]})})},va=({value:e,onChange:t,className:r="",disabled:n=!1})=>{const s=()=>{n||t(!e)};return l.jsx("button",{type:"button",onClick:s,disabled:n,className:N.twJoin("relative inline-flex h-[31px] w-[55px] items-center rounded-full transition-colors duration-300 ease-in-out","focus:outline-none focus:ring-2 focus:ring-primary-main focus:ring-offset-2",e?"bg-primary-main dark:bg-primary-light":"bg-[#78788029]",n&&"opacity-50 cursor-not-allowed",r),style:{border:"none"},"aria-pressed":e,"aria-label":"Toggle",children:l.jsx("span",{className:N.twJoin("inline-block w-[27px] h-[27px] transform rounded-full bg-white transition-transform duration-300 ease-in-out","flex items-center justify-center shadow-sm",e?"translate-x-[26px]":"translate-x-[2px]")})})},Hn=({icon:e,title:t,status:r,value:n,onChange:s,className:i,tooltip:a,infoIcon:o})=>l.jsxs("div",{className:N.twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0",i),children:[l.jsxs("div",{className:"flex items-center gap-4",children:[e,l.jsxs("div",{className:"flex flex-col",children:[o&&a?l.jsxs(X,{as:"span",variant:"body2",className:"text-accent-primary font-medium",children:[t,l.jsx(In,{tooltip:a,placement:"bottom",attachToChildren:!0,offset:[20,8],children:l.jsx("span",{className:"inline-block align-middle text-secondary-strokeDark cursor-pointer ml-1",children:o})})]}):l.jsx(In,{tooltip:a,attachToChildren:!!a,placement:"bottom",children:l.jsx(X,{as:"span",variant:"body2",className:"text-accent-primary font-medium",children:t})}),l.jsx(X,{className:"text-accent-secondary !text-xs",children:r})]})]}),l.jsx(va,{value:n,onChange:s})]}),xa=({title:e,value:t,isCopied:r,onCopy:n,className:s,icon:i})=>l.jsx("div",{className:N.twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0",s),children:l.jsx("div",{className:"flex flex-col w-full",children:l.jsxs("div",{className:"flex items-center gap-4",children:[i&&l.jsx("div",{className:"flex-shrink-0",children:i}),l.jsxs("div",{className:"flex w-full",children:[l.jsxs("div",{className:"flex flex-col w-full",children:[l.jsx(X,{variant:"body2",className:"text-accent-primary font-medium text-sm",children:e}),l.jsx("div",{className:"flex items-center justify-between w-full",children:l.jsx("div",{className:"flex-1 min-w-0",children:r?l.jsx(X,{className:"text-accent-secondary !text-xs truncate whitespace-nowrap",children:"Copied ✓"}):l.jsx(cs,{className:"text-accent-secondary !text-xs",value:t,symbols:6})})})]}),l.jsx("button",{onClick:n,className:"flex-shrink-0 ml-3 p-1 rounded hover:bg-surface-tertiary transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80 self-center",children:l.jsx(hn,{size:16})})]})]})})}),Uf=({trigger:e,btcAddress:t,bbnAddress:r,selectedWallets:n,ordinalsExcluded:s,linkedDelegationsVisibility:i,onIncludeOrdinals:a,onExcludeOrdinals:o,onDisplayLinkedDelegations:c,publicKeyNoCoord:f,onDisconnect:u,forceOpen:d=!1,onOpenChange:h,btcBalances:v,bbnBalances:g,btcCoinSymbol:x,bbnCoinSymbol:b,balancesLoading:C=!1,hasUnconfirmedTransactions:w=!1,formatBalance:E,className:S,mobileMode:A="dialog",copy:O})=>{var G,te,ue,re;const{copyToClipboard:k,isCopied:$}=is({timeout:O==null?void 0:O.timeout}),I=(O==null?void 0:O.isCopied)??$,W=(O==null?void 0:O.copyToClipboard)??k,[_,F]=p.useState(d),P=p.useCallback(fe=>{F(fe),h==null||h(fe)},[h]),H=p.useCallback(()=>{F(!1),u()},[u]),Y=fe=>{if(!(!E||!fe))return Le=>E(Le,fe)},J=x||"BTC",q=b||"BABY";return l.jsx(ls,{trigger:e,open:_,onOpenChange:P,mobileMode:A,className:N.twJoin("shadow-lg border border-[#38708533] bg-[#FFFFFF] dark:bg-[#252525] dark:border-[#404040] rounded-lg",S),children:l.jsxs("div",{className:"p-4 space-y-6 w-full text-primary-main",children:[l.jsxs("div",{className:"flex flex-row gap-2 w-full md:flex-col",children:[l.jsx($n,{walletType:"Bitcoin",walletName:(G=n.BTC)==null?void 0:G.name,walletIcon:(te=n.BTC)==null?void 0:te.icon,address:t,isCopied:I("btc"),onCopy:()=>W("btc",t),balances:v,coinSymbol:J,isBalanceLoading:C,hasUnconfirmedTransactions:w,formatBalance:Y(J)}),l.jsx($n,{walletType:"Babylon",walletName:(ue=n.BBN)==null?void 0:ue.name,walletIcon:(re=n.BBN)==null?void 0:re.icon,address:r,isCopied:I("bbn"),onCopy:()=>W("bbn",r),balances:g,coinSymbol:q,isBalanceLoading:C,formatBalance:Y(q)})]}),l.jsxs("div",{className:"flex flex-col w-full bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-lg md:bg-transparent md:dark:bg-transparent md:border-none md:gap-8",children:[l.jsx(Hn,{icon:l.jsx(Kr,{variant:"primary",background:!0,rounded:!0,children:l.jsx(Ki,{})}),title:"Using Inscriptions",status:s?"Off":"On",value:!s,onChange:fe=>fe?a():o()}),l.jsx(Hn,{icon:l.jsx(Kr,{variant:"primary",background:!0,rounded:!0,children:l.jsx(Yi,{})}),title:l.jsxs(l.Fragment,{children:["Linked Wallet",l.jsx("br",{className:"hidden md:block"}),l.jsx("span",{className:"md:hidden",children:" "}),"Stakes"]}),status:i?"On":"Off",value:i,onChange:c,tooltip:"Linked Wallet Stakes show all stakes created with the same Bitcoin wallet, even if different BABY wallets were used. It helps you track and manage them in one place.",infoIcon:l.jsx(ss,{size:14,variant:"secondary"})}),l.jsx(xa,{title:"Bitcoin Public Key",value:f,isCopied:I("publicKey"),onCopy:()=>W("publicKey",f),icon:l.jsx(Kr,{variant:"primary",background:!0,rounded:!0,children:l.jsx(Xi,{})}),className:"rounded-b-lg rounded-t-none md:rounded-none"})]}),l.jsx("div",{className:"pt-2",children:l.jsx(Jn,{onClick:H,fluid:!0,children:"Disconnect Wallets"})})]})})};function qf({className:e,...t}){const n=Yt(Cn)?Xt:Ir;return l.jsx(n,{...t,className:N.twMerge("w-[41.25rem] max-w-full",e)})}const Zf=({open:e,onClose:t,title:r="Unbonding",description:n,reward:s,amountUsd:i="",onChange:a=()=>{},onKeyDown:o=()=>{},disabled:c=!1,warningText:f,actionButtonText:u="Unbond",onActionClick:d})=>l.jsxs(qf,{open:e,onClose:t,children:[l.jsx(Br,{title:r,onClose:t,className:"text-accent-primary"}),l.jsxs(Pr,{style:{maxHeight:Yo},className:"no-scrollbar mt-4 flex flex-col gap-6 overflow-y-auto text-accent-primary",children:[n&&l.jsx("div",{children:l.jsx(X,{variant:"body2",className:"text-accent-secondary whitespace-pre-line",children:n})}),l.jsx(hr,{className:"flex w-full flex-col content-center justify-between gap-4",children:l.jsx(xn,{amount:s.amount,currencyIcon:s.currencyIcon,currencyName:s.currencyName,placeholder:s.placeholder??"Enter Amount",displayBalance:s.displayBalance,balanceDetails:s.balanceDetails,min:s.min??"0",step:s.step??"any",autoFocus:!1,onChange:a,onKeyDown:o,amountUsd:i,disabled:c,subtitle:`Staked: ${s.stakedAmount||0} ${s.stakedTokenName||s.currencyName}`})}),f&&l.jsx(wo,{children:f})]}),u&&l.jsx(vn,{className:"flex justify-end mt-[80px]",children:l.jsx(Me,{onClick:d,children:u})})]}),Xf={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Yf({className:e,orientation:t="vertical",children:r}){return l.jsx("div",{className:N.twMerge("bbn-list-legacy",`bbn-list-legacy-${t}`,e),children:p.Children.map(r,n=>p.isValidElement(n)?p.cloneElement(n,{orientation:Xf[t]}):n)})}function Kf({className:e,orientation:t="horizontal",title:r,value:n,suffix:s}){return l.jsxs("div",{className:N.twJoin("bbn-list-item-legacy",`bbn-list-item-legacy-${t}`,e),children:[l.jsx(X,{as:"div",className:N.twJoin("bbn-list-title-legacy",`bbn-list-title-legacy-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),l.jsxs(X,{as:"div",className:N.twJoin("bbn-list-value-legacy",`bbn-list-value-legacy-${t}`),variant:"body1",children:[n,s]})]})}exports.Accordion=ja;exports.AccordionDetails=Sa;exports.AccordionSummary=Ca;exports.ActivityCard=Bf;exports.ActivityCardActionSection=aa;exports.ActivityCardAmountSection=la;exports.ActivityCardDetailsSection=ua;exports.ActivityListItem=ca;exports.AmountItem=xn;exports.AmountSubsection=_f;exports.Avatar=or;exports.AvatarGroup=Ea;exports.BBNFeeAmount=ia;exports.BTCFeeAmount=sa;exports.BTCFeeRate=na;exports.Badge=Tc;exports.BitcoinPublicKeyIcon=Xi;exports.BugReportIcon=oc;exports.Button=Me;exports.Card=fo;exports.Cell=co;exports.Checkbox=ki;exports.CheckboxField=hf;exports.ChevronLeftIcon=ic;exports.Chip=lc;exports.CloseIcon=ns;exports.CollapseIcon=Qi;exports.Column=ao;exports.Copy=bo;exports.CopyIcon=hn;exports.CoreUIProvider=tc;exports.CounterButton=vo;exports.Dialog=Ir;exports.DialogBody=Pr;exports.DialogFooter=vn;exports.DialogHeader=Br;exports.DisplayHash=cs;exports.FeeItem=mr;exports.FeesSection=Mf;exports.FinalityProviderItem=Ns;exports.FinalityProviderLogo=Xo;exports.FinalityProviderSubsection=Tf;exports.Form=uf;exports.FormControl=Vr;exports.Heading=dn;exports.HiddenField=Zo;exports.Hint=In;exports.IconButton=zn;exports.InfoIcon=ss;exports.Input=Dr;exports.LinkWalletIcon=Yi;exports.List=Lc;exports.ListItem=po;exports.ListItemLegacy=Kf;exports.ListLegacy=Yf;exports.Loader=to;exports.Menu=ls;exports.MenuDrawer=as;exports.MenuItem=go;exports.MobileDialog=Xt;exports.NumberField=mf;exports.OpenIcon=eo;exports.Popover=pn;exports.Portal=Mr;exports.PreviewModal=If;exports.Radio=Li;exports.RadioField=vf;exports.RewardsPreviewModal=$f;exports.RewardsSubsection=Hf;exports.ScrollLocker=sc;exports.Select=ts;exports.SelectField=xf;exports.SettingMenu=Rt;exports.SettingMenuCustomContent=ha;exports.SettingMenuDescription=pr;exports.SettingMenuGroup=ma;exports.SettingMenuItem=Os;exports.SettingMenuSubMenu=pa;exports.SettingMenuTitle=da;exports.StatItem=Fc;exports.SubMenu=yo;exports.SubMenuItem=Mc;exports.SubSection=hr;exports.Table=uo;exports.TableElement=yf;exports.Text=X;exports.TextField=pf;exports.ThemeIcon=ac;exports.ThemedIcon=Kr;exports.Toggle=mo;exports.Total=oa;exports.UnbondingModal=Zf;exports.UsingInscriptionIcon=Ki;exports.ValidatorAvatar=Aa;exports.ValidatorSelector=Cf;exports.WalletDisconnectButton=Jn;exports.WalletMenu=Uf;exports.WalletMenuCard=$n;exports.WalletMenuInfoItem=xa;exports.WalletMenuSettingItem=Hn;exports.WalletToggle=va;exports.Warning=wo;exports.WarningIcon=Gi;exports.iconColorVariants=ze;exports.useClickOutside=Ji;exports.useControlledState=zt;exports.useCopy=is;exports.useCoreUI=Wi;exports.useDrawerAnimation=ho;exports.useField=Gt;exports.useFieldState=ff;exports.useFormContext=Kt;exports.useFormState=bs;exports.useFrozenColumns=io;exports.useIsMobile=Yt;exports.useMemoizedArray=zi;exports.useMenuContext=os;exports.useModalManager=rs;exports.useResizeObserver=Ui;exports.useTableScroll=so;exports.useTableSort=lo;exports.useWatch=ws;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),p=require("react"),N=require("tailwind-merge"),Ei=require("react-dom");function Ai(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Bt=Ai(p),wa=Ai(Ei);function zt({value:e,defaultValue:t,onStateChange:r}={}){const[n,s]=p.useState(t),{current:i}=p.useRef(e!=null),a=i?e:n,o=p.useCallback(c=>{i||s(c),r==null||r(c)},[i,r,s]);return[a,o]}const Wn=p.createContext({disabled:!1,expanded:!1});function ja({expanded:e,defaultExpanded:t,onChange:r,className:n,disabled:s=!1,fluid:i=!1,children:a}){const[o=!1,c]=zt({value:e,defaultValue:t,onStateChange:r}),f=p.useCallback(()=>{c(!o)},[c,o]),u=p.useMemo(()=>({defaultExpanded:t,disabled:s,expanded:o&&!s,toggle:s?void 0:f}),[t,o,s,f]);return l.jsx(Wn.Provider,{value:u,children:l.jsx("div",{className:N.twJoin("bbn-accordion",s&&"bbn-accordion-disabled",i&&"bbn-accordion-fluid",n),children:a})})}const Me=p.forwardRef(({variant:e="contained",size:t="large",color:r="primary",fluid:n=!1,className:s,disabled:i,...a},o)=>l.jsx("button",{...a,disabled:i,ref:o,className:N.twJoin("bbn-btn",`bbn-btn-${e}`,`bbn-btn-${r}`,`bbn-btn-${t}`,n&&"bbn-btn-fluid",s)}));Me.displayName="Button";const zn=p.forwardRef(({variant:e="outlined",size:t="large",className:r,...n},s)=>l.jsx("button",{...n,ref:s,className:N.twJoin("bbn-btn-icon",`bbn-btn-icon-${e}`,`bbn-btn-icon-${t}`,r)})),Jn=p.forwardRef(({className:e,...t},r)=>l.jsx(Me,{...t,ref:r,variant:"contained",className:N.twJoin("!bg-error-main text-white font-medium !text-sm hover:!bg-error-main/90 transition-colors",e)}));Jn.displayName="WalletDisconnectButton";function Ca({className:e,iconClassName:t,iconProps:r,children:n,renderIcon:s=()=>null}){const{expanded:i,toggle:a}=p.useContext(Wn),o=s(i);return l.jsxs("div",{className:N.twJoin("bbn-accordion-summary",e),onClick:a,children:[n,o&&l.jsx(zn,{className:N.twJoin("bbn-accordion-icon",t),...r,children:o})]})}function Un(e,t){return typeof e!="number"?typeof t=="number"?Un(t):t:`${e}px`}function Na(e=!0){const[t,r]=p.useState("0px"),[n,s]=p.useState(),i=p.useRef(null);return p.useEffect(()=>{const a=new ResizeObserver(o=>{const[c]=o;r(Un(c.target.clientHeight)??"0px")});s(a)},[]),p.useEffect(function(){const{current:o}=i;if(!(!e||!o))return n==null||n.observe(o),()=>{n==null||n.unobserve(o)}},[e,n]),{height:t,ref:i}}function Sa({unmountOnExit:e=!1,animationDuration:t=200,className:r,wrapperClassName:n,children:s}){const{expanded:i}=p.useContext(Wn),[a,o]=p.useState(i),c=a||!e,{height:f,ref:u}=Na(c);return p.useEffect(function(){if(i===a)return;if(i){o(!0);return}const h=setTimeout(o,t,!1);return()=>{clearTimeout(h)}},[i,a,t]),l.jsx("div",{className:N.twJoin("bbn-accordion-details",n),style:{height:i?f:"0px",visibility:a?"visible":"hidden",transitionDuration:`${t}ms`},children:c?l.jsx("div",{ref:u,className:N.twJoin("bbn-accordion-content",r),children:s}):null})}const X=p.forwardRef(({variant:e="body1",as:t="p",children:r,className:n,...s},i)=>p.createElement(t,{...s,ref:i,className:N.twJoin(`bbn-text-${e}`,n)},r));X.displayName="Text";const dn=p.forwardRef(({variant:e,as:t=e,children:r,className:n,...s},i)=>p.createElement(t,{...s,ref:i,className:N.twJoin(`bbn-${e}`,n)},r));dn.displayName="Heading";function or({className:e,style:t,size:r="large",variant:n="circular",alt:s,url:i,children:a}){return l.jsx("div",{style:t,className:N.twJoin("bbn-avatar",`bbn-avatar-${r}`,`bbn-avatar-${n}`,e),children:i?l.jsx("img",{className:"bbn-avatar-img",src:i,alt:s}):a})}const Ea=({max:e=1/0,className:t,children:r,avatarClassName:n,variant:s,...i})=>{const a=p.Children.count(r);return l.jsxs("div",{className:N.twJoin("bbn-avatar-group",t),children:[p.Children.map(r,(o,c)=>p.isValidElement(o)&&c+1<=e?p.cloneElement(o,{...i,className:N.twMerge(n,o.props.className),variant:s}):null),a>e&&l.jsxs(or,{size:i.size,variant:s,className:n,children:["+",a-e]})]})};function Aa({url:e,name:t,variant:r="rounded",size:n="large",...s}){return l.jsx(or,{...s,url:e,alt:t,variant:r,size:n,children:l.jsx(X,{as:"span",className:"inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast",children:(t==null?void 0:t.charAt(0).toUpperCase())||"?"})})}const Oi=p.forwardRef(function({label:t,checked:r,defaultChecked:n=!1,inputProps:s,orientation:i="left",disabled:a=!1,className:o,inputType:c,labelClassName:f,renderIcon:u,onChange:d,...h},v){const[x=!1,g]=zt({value:r,defaultValue:n,onStateChange:d});function b(w){var E;g(w.currentTarget.checked),(E=s==null?void 0:s.onChange)==null||E.call(s,w)}const C=l.jsxs("span",{className:N.twJoin("bbn-switcher",a&&"bbn-switcher-disabled",o),children:[u(x),l.jsx("input",{ref:v,type:c,disabled:a,className:"bbn-switcher-input",...h,...s,checked:x,onChange:b})]});return t?l.jsxs(X,{as:"label",variant:"body1",className:N.twJoin("bbn-switcher-label",i==="left"?"bbn-switcher-left":"bbn-switcher-right",f),children:[C,t]}):C}),Oa={false:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z",fill:"currentColor"})}),true:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M19 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.11 21 21 20.1 21 19V5C21 3.9 20.11 3 19 3ZM10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",fill:"currentColor"})})},ki=p.forwardRef(function(t,r){return l.jsx(Oi,{ref:r,...t,inputType:"checkbox",renderIcon:n=>Oa[n.toString()]})}),ka={true:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M12 7C9.24 7 7 9.24 7 12C7 14.76 9.24 17 12 17C14.76 17 17 14.76 17 12C17 9.24 14.76 7 12 7ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z",fill:"currentColor"})}),false:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z",fill:"currentColor"})})},Li=p.forwardRef(function(t,r){return l.jsx(Oi,{ref:r,...t,inputType:"radio",renderIcon:n=>ka[n.toString()]})});var _i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Rs=p.createContext&&p.createContext(_i),La=["attr","size","title"];function _a(e,t){if(e==null)return{};var r=Fa(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fa(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Qr(){return Qr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qr.apply(this,arguments)}function Ms(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function en(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ms(Object(r),!0).forEach(function(n){Ta(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ms(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ta(e,t,r){return t=Ra(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ra(e){var t=Ma(e,"string");return typeof t=="symbol"?t:t+""}function Ma(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fi(e){return e&&e.map((t,r)=>p.createElement(t.tag,en({key:r},t.attr),Fi(t.child)))}function Ft(e){return t=>p.createElement(Da,Qr({attr:en({},e.attr)},t),Fi(e.child))}function Da(e){var t=r=>{var{attr:n,size:s,title:i}=e,a=_a(e,La),o=s||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),p.createElement("svg",Qr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,a,{className:c,style:en(en({color:e.color||r.color},r.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),i&&p.createElement("title",null,i),e.children)};return Rs!==void 0?p.createElement(Rs.Consumer,null,r=>t(r)):t(_i)}function Va(e){return Ft({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 16L6 10H18L12 16Z"},child:[]}]})(e)}function Ia(e){return Ft({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"},child:[]}]})(e)}function Ba(e){return Ft({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 8L18 14H6L12 8Z"},child:[]}]})(e)}function Pa(e){return Ft({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"},child:[]}]})(e)}var Ds=function(t){return t.reduce(function(r,n){var s=n[0],i=n[1];return r[s]=i,r},{})},Vs=typeof window<"u"&&window.document&&window.document.createElement?Bt.useLayoutEffect:Bt.useEffect,Te="top",Qe="bottom",et="right",Re="left",qn="auto",Tr=[Te,Qe,et,Re],ar="start",kr="end",$a="clippingParents",Ti="viewport",jr="popper",Ha="reference",Is=Tr.reduce(function(e,t){return e.concat([t+"-"+ar,t+"-"+kr])},[]),Ri=[].concat(Tr,[qn]).reduce(function(e,t){return e.concat([t,t+"-"+ar,t+"-"+kr])},[]),Wa="beforeRead",za="read",Ja="afterRead",Ua="beforeMain",qa="main",Za="afterMain",Xa="beforeWrite",Ya="write",Ka="afterWrite",Ga=[Wa,za,Ja,Ua,qa,Za,Xa,Ya,Ka];function vt(e){return e?(e.nodeName||"").toLowerCase():null}function We(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Jt(e){var t=We(e).Element;return e instanceof t||e instanceof Element}function Ge(e){var t=We(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Zn(e){if(typeof ShadowRoot>"u")return!1;var t=We(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Qa(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},s=t.attributes[r]||{},i=t.elements[r];!Ge(i)||!vt(i)||(Object.assign(i.style,n),Object.keys(s).forEach(function(a){var o=s[a];o===!1?i.removeAttribute(a):i.setAttribute(a,o===!0?"":o)}))})}function el(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var s=t.elements[n],i=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),o=a.reduce(function(c,f){return c[f]="",c},{});!Ge(s)||!vt(s)||(Object.assign(s.style,o),Object.keys(i).forEach(function(c){s.removeAttribute(c)}))})}}const tl={name:"applyStyles",enabled:!0,phase:"write",fn:Qa,effect:el,requires:["computeStyles"]};function pt(e){return e.split("-")[0]}var $t=Math.max,tn=Math.min,lr=Math.round;function _n(){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 Mi(){return!/^((?!chrome|android).)*safari/i.test(_n())}function cr(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),s=1,i=1;t&&Ge(e)&&(s=e.offsetWidth>0&&lr(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&lr(n.height)/e.offsetHeight||1);var a=Jt(e)?We(e):window,o=a.visualViewport,c=!Mi()&&r,f=(n.left+(c&&o?o.offsetLeft:0))/s,u=(n.top+(c&&o?o.offsetTop:0))/i,d=n.width/s,h=n.height/i;return{width:d,height:h,top:u,right:f+d,bottom:u+h,left:f,x:f,y:u}}function Xn(e){var t=cr(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Di(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Zn(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Et(e){return We(e).getComputedStyle(e)}function rl(e){return["table","td","th"].indexOf(vt(e))>=0}function Tt(e){return((Jt(e)?e.ownerDocument:e.document)||window.document).documentElement}function mn(e){return vt(e)==="html"?e:e.assignedSlot||e.parentNode||(Zn(e)?e.host:null)||Tt(e)}function Bs(e){return!Ge(e)||Et(e).position==="fixed"?null:e.offsetParent}function nl(e){var t=/firefox/i.test(_n()),r=/Trident/i.test(_n());if(r&&Ge(e)){var n=Et(e);if(n.position==="fixed")return null}var s=mn(e);for(Zn(s)&&(s=s.host);Ge(s)&&["html","body"].indexOf(vt(s))<0;){var i=Et(s);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return s;s=s.parentNode}return null}function Rr(e){for(var t=We(e),r=Bs(e);r&&rl(r)&&Et(r).position==="static";)r=Bs(r);return r&&(vt(r)==="html"||vt(r)==="body"&&Et(r).position==="static")?t:r||nl(e)||t}function Yn(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Sr(e,t,r){return $t(e,tn(t,r))}function sl(e,t,r){var n=Sr(e,t,r);return n>r?r:n}function Vi(){return{top:0,right:0,bottom:0,left:0}}function Ii(e){return Object.assign({},Vi(),e)}function Bi(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var il=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Ii(typeof t!="number"?t:Bi(t,Tr))};function ol(e){var t,r=e.state,n=e.name,s=e.options,i=r.elements.arrow,a=r.modifiersData.popperOffsets,o=pt(r.placement),c=Yn(o),f=[Re,et].indexOf(o)>=0,u=f?"height":"width";if(!(!i||!a)){var d=il(s.padding,r),h=Xn(i),v=c==="y"?Te:Re,x=c==="y"?Qe:et,g=r.rects.reference[u]+r.rects.reference[c]-a[c]-r.rects.popper[u],b=a[c]-r.rects.reference[c],C=Rr(i),w=C?c==="y"?C.clientHeight||0:C.clientWidth||0:0,E=g/2-b/2,S=d[v],A=w-h[u]-d[x],O=w/2-h[u]/2+E,k=Sr(S,O,A),$=c;r.modifiersData[n]=(t={},t[$]=k,t.centerOffset=k-O,t)}}function al(e){var t=e.state,r=e.options,n=r.element,s=n===void 0?"[data-popper-arrow]":n;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Di(t.elements.popper,s)&&(t.elements.arrow=s))}const ll={name:"arrow",enabled:!0,phase:"main",fn:ol,effect:al,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ur(e){return e.split("-")[1]}var cl={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ul(e,t){var r=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:lr(r*s)/s||0,y:lr(n*s)/s||0}}function Ps(e){var t,r=e.popper,n=e.popperRect,s=e.placement,i=e.variation,a=e.offsets,o=e.position,c=e.gpuAcceleration,f=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=a.x,v=h===void 0?0:h,x=a.y,g=x===void 0?0:x,b=typeof u=="function"?u({x:v,y:g}):{x:v,y:g};v=b.x,g=b.y;var C=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),E=Re,S=Te,A=window;if(f){var O=Rr(r),k="clientHeight",$="clientWidth";if(O===We(r)&&(O=Tt(r),Et(O).position!=="static"&&o==="absolute"&&(k="scrollHeight",$="scrollWidth")),O=O,s===Te||(s===Re||s===et)&&i===kr){S=Qe;var I=d&&O===A&&A.visualViewport?A.visualViewport.height:O[k];g-=I-n.height,g*=c?1:-1}if(s===Re||(s===Te||s===Qe)&&i===kr){E=et;var W=d&&O===A&&A.visualViewport?A.visualViewport.width:O[$];v-=W-n.width,v*=c?1:-1}}var _=Object.assign({position:o},f&&cl),F=u===!0?ul({x:v,y:g},We(r)):{x:v,y:g};if(v=F.x,g=F.y,c){var P;return Object.assign({},_,(P={},P[S]=w?"0":"",P[E]=C?"0":"",P.transform=(A.devicePixelRatio||1)<=1?"translate("+v+"px, "+g+"px)":"translate3d("+v+"px, "+g+"px, 0)",P))}return Object.assign({},_,(t={},t[S]=w?g+"px":"",t[E]=C?v+"px":"",t.transform="",t))}function fl(e){var t=e.state,r=e.options,n=r.gpuAcceleration,s=n===void 0?!0:n,i=r.adaptive,a=i===void 0?!0:i,o=r.roundOffsets,c=o===void 0?!0:o,f={placement:pt(t.placement),variation:ur(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ps(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ps(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const dl={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:fl,data:{}};var Ur={passive:!0};function ml(e){var t=e.state,r=e.instance,n=e.options,s=n.scroll,i=s===void 0?!0:s,a=n.resize,o=a===void 0?!0:a,c=We(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach(function(u){u.addEventListener("scroll",r.update,Ur)}),o&&c.addEventListener("resize",r.update,Ur),function(){i&&f.forEach(function(u){u.removeEventListener("scroll",r.update,Ur)}),o&&c.removeEventListener("resize",r.update,Ur)}}const pl={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ml,data:{}};var hl={left:"right",right:"left",bottom:"top",top:"bottom"};function Xr(e){return e.replace(/left|right|bottom|top/g,function(t){return hl[t]})}var vl={start:"end",end:"start"};function $s(e){return e.replace(/start|end/g,function(t){return vl[t]})}function Kn(e){var t=We(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Gn(e){return cr(Tt(e)).left+Kn(e).scrollLeft}function gl(e,t){var r=We(e),n=Tt(e),s=r.visualViewport,i=n.clientWidth,a=n.clientHeight,o=0,c=0;if(s){i=s.width,a=s.height;var f=Mi();(f||!f&&t==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}return{width:i,height:a,x:o+Gn(e),y:c}}function xl(e){var t,r=Tt(e),n=Kn(e),s=(t=e.ownerDocument)==null?void 0:t.body,i=$t(r.scrollWidth,r.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=$t(r.scrollHeight,r.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),o=-n.scrollLeft+Gn(e),c=-n.scrollTop;return Et(s||r).direction==="rtl"&&(o+=$t(r.clientWidth,s?s.clientWidth:0)-i),{width:i,height:a,x:o,y:c}}function Qn(e){var t=Et(e),r=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+s+n)}function Pi(e){return["html","body","#document"].indexOf(vt(e))>=0?e.ownerDocument.body:Ge(e)&&Qn(e)?e:Pi(mn(e))}function Er(e,t){var r;t===void 0&&(t=[]);var n=Pi(e),s=n===((r=e.ownerDocument)==null?void 0:r.body),i=We(n),a=s?[i].concat(i.visualViewport||[],Qn(n)?n:[]):n,o=t.concat(a);return s?o:o.concat(Er(mn(a)))}function Fn(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function yl(e,t){var r=cr(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function Hs(e,t,r){return t===Ti?Fn(gl(e,r)):Jt(t)?yl(t,r):Fn(xl(Tt(e)))}function bl(e){var t=Er(mn(e)),r=["absolute","fixed"].indexOf(Et(e).position)>=0,n=r&&Ge(e)?Rr(e):e;return Jt(n)?t.filter(function(s){return Jt(s)&&Di(s,n)&&vt(s)!=="body"}):[]}function wl(e,t,r,n){var s=t==="clippingParents"?bl(e):[].concat(t),i=[].concat(s,[r]),a=i[0],o=i.reduce(function(c,f){var u=Hs(e,f,n);return c.top=$t(u.top,c.top),c.right=tn(u.right,c.right),c.bottom=tn(u.bottom,c.bottom),c.left=$t(u.left,c.left),c},Hs(e,a,n));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function $i(e){var t=e.reference,r=e.element,n=e.placement,s=n?pt(n):null,i=n?ur(n):null,a=t.x+t.width/2-r.width/2,o=t.y+t.height/2-r.height/2,c;switch(s){case Te:c={x:a,y:t.y-r.height};break;case Qe:c={x:a,y:t.y+t.height};break;case et:c={x:t.x+t.width,y:o};break;case Re:c={x:t.x-r.width,y:o};break;default:c={x:t.x,y:t.y}}var f=s?Yn(s):null;if(f!=null){var u=f==="y"?"height":"width";switch(i){case ar:c[f]=c[f]-(t[u]/2-r[u]/2);break;case kr:c[f]=c[f]+(t[u]/2-r[u]/2);break}}return c}function Lr(e,t){t===void 0&&(t={});var r=t,n=r.placement,s=n===void 0?e.placement:n,i=r.strategy,a=i===void 0?e.strategy:i,o=r.boundary,c=o===void 0?$a:o,f=r.rootBoundary,u=f===void 0?Ti:f,d=r.elementContext,h=d===void 0?jr:d,v=r.altBoundary,x=v===void 0?!1:v,g=r.padding,b=g===void 0?0:g,C=Ii(typeof b!="number"?b:Bi(b,Tr)),w=h===jr?Ha:jr,E=e.rects.popper,S=e.elements[x?w:h],A=wl(Jt(S)?S:S.contextElement||Tt(e.elements.popper),c,u,a),O=cr(e.elements.reference),k=$i({reference:O,element:E,placement:s}),$=Fn(Object.assign({},E,k)),I=h===jr?$:O,W={top:A.top-I.top+C.top,bottom:I.bottom-A.bottom+C.bottom,left:A.left-I.left+C.left,right:I.right-A.right+C.right},_=e.modifiersData.offset;if(h===jr&&_){var F=_[s];Object.keys(W).forEach(function(P){var H=[et,Qe].indexOf(P)>=0?1:-1,Y=[Te,Qe].indexOf(P)>=0?"y":"x";W[P]+=F[Y]*H})}return W}function jl(e,t){t===void 0&&(t={});var r=t,n=r.placement,s=r.boundary,i=r.rootBoundary,a=r.padding,o=r.flipVariations,c=r.allowedAutoPlacements,f=c===void 0?Ri:c,u=ur(n),d=u?o?Is:Is.filter(function(x){return ur(x)===u}):Tr,h=d.filter(function(x){return f.indexOf(x)>=0});h.length===0&&(h=d);var v=h.reduce(function(x,g){return x[g]=Lr(e,{placement:g,boundary:s,rootBoundary:i,padding:a})[pt(g)],x},{});return Object.keys(v).sort(function(x,g){return v[x]-v[g]})}function Cl(e){if(pt(e)===qn)return[];var t=Xr(e);return[$s(e),t,$s(t)]}function Nl(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var s=r.mainAxis,i=s===void 0?!0:s,a=r.altAxis,o=a===void 0?!0:a,c=r.fallbackPlacements,f=r.padding,u=r.boundary,d=r.rootBoundary,h=r.altBoundary,v=r.flipVariations,x=v===void 0?!0:v,g=r.allowedAutoPlacements,b=t.options.placement,C=pt(b),w=C===b,E=c||(w||!x?[Xr(b)]:Cl(b)),S=[b].concat(E).reduce(function(De,Ne){return De.concat(pt(Ne)===qn?jl(t,{placement:Ne,boundary:u,rootBoundary:d,padding:f,flipVariations:x,allowedAutoPlacements:g}):Ne)},[]),A=t.rects.reference,O=t.rects.popper,k=new Map,$=!0,I=S[0],W=0;W<S.length;W++){var _=S[W],F=pt(_),P=ur(_)===ar,H=[Te,Qe].indexOf(F)>=0,Y=H?"width":"height",J=Lr(t,{placement:_,boundary:u,rootBoundary:d,altBoundary:h,padding:f}),q=H?P?et:Re:P?Qe:Te;A[Y]>O[Y]&&(q=Xr(q));var G=Xr(q),te=[];if(i&&te.push(J[F]<=0),o&&te.push(J[q]<=0,J[G]<=0),te.every(function(De){return De})){I=_,$=!1;break}k.set(_,te)}if($)for(var ue=x?3:1,re=function(Ne){var _e=S.find(function(Je){var Se=k.get(Je);if(Se)return Se.slice(0,Ne).every(function(ce){return ce})});if(_e)return I=_e,"break"},fe=ue;fe>0;fe--){var Le=re(fe);if(Le==="break")break}t.placement!==I&&(t.modifiersData[n]._skip=!0,t.placement=I,t.reset=!0)}}const Sl={name:"flip",enabled:!0,phase:"main",fn:Nl,requiresIfExists:["offset"],data:{_skip:!1}};function Ws(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function zs(e){return[Te,et,Qe,Re].some(function(t){return e[t]>=0})}function El(e){var t=e.state,r=e.name,n=t.rects.reference,s=t.rects.popper,i=t.modifiersData.preventOverflow,a=Lr(t,{elementContext:"reference"}),o=Lr(t,{altBoundary:!0}),c=Ws(a,n),f=Ws(o,s,i),u=zs(c),d=zs(f);t.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const Al={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:El};function Ol(e,t,r){var n=pt(e),s=[Re,Te].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,a=i[0],o=i[1];return a=a||0,o=(o||0)*s,[Re,et].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}function kl(e){var t=e.state,r=e.options,n=e.name,s=r.offset,i=s===void 0?[0,0]:s,a=Ri.reduce(function(u,d){return u[d]=Ol(d,t.rects,i),u},{}),o=a[t.placement],c=o.x,f=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=f),t.modifiersData[n]=a}const Ll={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:kl};function _l(e){var t=e.state,r=e.name;t.modifiersData[r]=$i({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Fl={name:"popperOffsets",enabled:!0,phase:"read",fn:_l,data:{}};function Tl(e){return e==="x"?"y":"x"}function Rl(e){var t=e.state,r=e.options,n=e.name,s=r.mainAxis,i=s===void 0?!0:s,a=r.altAxis,o=a===void 0?!1:a,c=r.boundary,f=r.rootBoundary,u=r.altBoundary,d=r.padding,h=r.tether,v=h===void 0?!0:h,x=r.tetherOffset,g=x===void 0?0:x,b=Lr(t,{boundary:c,rootBoundary:f,padding:d,altBoundary:u}),C=pt(t.placement),w=ur(t.placement),E=!w,S=Yn(C),A=Tl(S),O=t.modifiersData.popperOffsets,k=t.rects.reference,$=t.rects.popper,I=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,W=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,F={x:0,y:0};if(O){if(i){var P,H=S==="y"?Te:Re,Y=S==="y"?Qe:et,J=S==="y"?"height":"width",q=O[S],G=q+b[H],te=q-b[Y],ue=v?-$[J]/2:0,re=w===ar?k[J]:$[J],fe=w===ar?-$[J]:-k[J],Le=t.elements.arrow,De=v&&Le?Xn(Le):{width:0,height:0},Ne=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Vi(),_e=Ne[H],Je=Ne[Y],Se=Sr(0,k[J],De[J]),ce=E?k[J]/2-ue-Se-_e-W.mainAxis:re-Se-_e-W.mainAxis,Ue=E?-k[J]/2+ue+Se+Je+W.mainAxis:fe+Se+Je+W.mainAxis,Ce=t.elements.arrow&&Rr(t.elements.arrow),Ve=Ce?S==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,lt=(P=_==null?void 0:_[S])!=null?P:0,Ie=q+ce-lt-Ve,At=q+Ue-lt,be=Sr(v?tn(G,Ie):G,q,v?$t(te,At):te);O[S]=be,F[S]=be-q}if(o){var bt,ct=S==="x"?Te:Re,qe=S==="x"?Qe:et,m=O[A],y=A==="y"?"height":"width",j=m+b[ct],R=m-b[qe],T=[Te,Re].indexOf(C)!==-1,L=(bt=_==null?void 0:_[A])!=null?bt:0,B=T?j:m-k[y]-$[y]-L+W.altAxis,K=T?m+k[y]+$[y]-L-W.altAxis:R,Q=v&&T?sl(B,m,K):Sr(v?B:j,m,v?K:R);O[A]=Q,F[A]=Q-m}t.modifiersData[n]=F}}const Ml={name:"preventOverflow",enabled:!0,phase:"main",fn:Rl,requiresIfExists:["offset"]};function Dl(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Vl(e){return e===We(e)||!Ge(e)?Kn(e):Dl(e)}function Il(e){var t=e.getBoundingClientRect(),r=lr(t.width)/e.offsetWidth||1,n=lr(t.height)/e.offsetHeight||1;return r!==1||n!==1}function Bl(e,t,r){r===void 0&&(r=!1);var n=Ge(t),s=Ge(t)&&Il(t),i=Tt(t),a=cr(e,s,r),o={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((vt(t)!=="body"||Qn(i))&&(o=Vl(t)),Ge(t)?(c=cr(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=Gn(i))),{x:a.left+o.scrollLeft-c.x,y:a.top+o.scrollTop-c.y,width:a.width,height:a.height}}function Pl(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function s(i){r.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(o){if(!r.has(o)){var c=t.get(o);c&&s(c)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||s(i)}),n}function $l(e){var t=Pl(e);return Ga.reduce(function(r,n){return r.concat(t.filter(function(s){return s.phase===n}))},[])}function Hl(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function Wl(e){var t=e.reduce(function(r,n){var s=r[n.name];return r[n.name]=s?Object.assign({},s,n,{options:Object.assign({},s.options,n.options),data:Object.assign({},s.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var Js={placement:"bottom",modifiers:[],strategy:"absolute"};function Us(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function zl(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,s=t.defaultOptions,i=s===void 0?Js:s;return function(o,c,f){f===void 0&&(f=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Js,i),modifiersData:{},elements:{reference:o,popper:c},attributes:{},styles:{}},d=[],h=!1,v={state:u,setOptions:function(C){var w=typeof C=="function"?C(u.options):C;g(),u.options=Object.assign({},i,u.options,w),u.scrollParents={reference:Jt(o)?Er(o):o.contextElement?Er(o.contextElement):[],popper:Er(c)};var E=$l(Wl([].concat(n,u.options.modifiers)));return u.orderedModifiers=E.filter(function(S){return S.enabled}),x(),v.update()},forceUpdate:function(){if(!h){var C=u.elements,w=C.reference,E=C.popper;if(Us(w,E)){u.rects={reference:Bl(w,Rr(E),u.options.strategy==="fixed"),popper:Xn(E)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(W){return u.modifiersData[W.name]=Object.assign({},W.data)});for(var S=0;S<u.orderedModifiers.length;S++){if(u.reset===!0){u.reset=!1,S=-1;continue}var A=u.orderedModifiers[S],O=A.fn,k=A.options,$=k===void 0?{}:k,I=A.name;typeof O=="function"&&(u=O({state:u,options:$,name:I,instance:v})||u)}}}},update:Hl(function(){return new Promise(function(b){v.forceUpdate(),b(u)})}),destroy:function(){g(),h=!0}};if(!Us(o,c))return v;v.setOptions(f).then(function(b){!h&&f.onFirstUpdate&&f.onFirstUpdate(b)});function x(){u.orderedModifiers.forEach(function(b){var C=b.name,w=b.options,E=w===void 0?{}:w,S=b.effect;if(typeof S=="function"){var A=S({state:u,name:C,instance:v,options:E}),O=function(){};d.push(A||O)}})}function g(){d.forEach(function(b){return b()}),d=[]}return v}}var Jl=[pl,Fl,dl,tl,Ll,Sl,Ml,ll,Al],Ul=zl({defaultModifiers:Jl}),qr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function es(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ql=typeof Element<"u",Zl=typeof Map=="function",Xl=typeof Set=="function",Yl=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Yr(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Yr(e[n],t[n]))return!1;return!0}var i;if(Zl&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;for(i=e.entries();!(n=i.next()).done;)if(!Yr(n.value[1],t.get(n.value[0])))return!1;return!0}if(Xl&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(Yl&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(ql&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!Yr(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Kl=function(t,r){try{return Yr(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const Gl=es(Kl);var Ql=[],ec=function(t,r,n){n===void 0&&(n={});var s=Bt.useRef(null),i={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||Ql},a=Bt.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],c=a[1],f=Bt.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(v){var x=v.state,g=Object.keys(x.elements);wa.flushSync(function(){c({styles:Ds(g.map(function(b){return[b,x.styles[b]||{}]})),attributes:Ds(g.map(function(b){return[b,x.attributes[b]]}))})})},requires:["computeStyles"]}},[]),u=Bt.useMemo(function(){var h={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[f,{name:"applyStyles",enabled:!1}])};return Gl(s.current,h)?s.current||h:(s.current=h,h)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,f]),d=Bt.useRef();return Vs(function(){d.current&&d.current.setOptions(u)},[u]),Vs(function(){if(!(t==null||r==null)){var h=n.createPopper||Ul,v=h(t,r,u);return d.current=v,function(){v.destroy(),d.current=null}}},[t,r,n.createPopper]),{state:d.current?d.current.state:null,styles:o.styles,attributes:o.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};const Hi=p.createContext({portalContainer:null}),Wi=()=>p.useContext(Hi);function tc({children:e,portalContainer:t=null}){return l.jsx(Hi.Provider,{value:{portalContainer:t},children:e})}function Mr({children:e,mounted:t=!1,rootClassName:r="portal-root",inheritViewport:n=!0,pointerEvents:s="auto"}){const[i,a]=p.useState(null),{portalContainer:o}=Wi(),c=s==="none";return p.useEffect(()=>{if(!t){a(null);return}const f=document.createElement("div");if(f.className=r,n)if(r.includes("popover"))f.style.zIndex="9999",f.style.pointerEvents=c?"none":"auto";else{const d={position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",zIndex:"9999",pointerEvents:c?"none":"auto"};Object.assign(f.style,d)}const u=o||document.body;return u.appendChild(f),a(f),()=>{u.contains(f)&&u.removeChild(f)}},[t,r,n,c,o]),i?Ei.createPortal(e,i):null}function rc(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function zi(e){const t=p.useRef(e);return rc(t.current,e)||(t.current=e),t.current}function Ji(e,t=()=>null,{enabled:r=!0}={}){const n=Array.isArray(e)?e:[e],s=zi(n);p.useEffect(()=>{function i(a){r&&s.every(o=>!(o!=null&&o.contains(a.target)))&&t()}return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[s,r,t])}function pn({open:e=!1,className:t,anchorEl:r,placement:n="bottom-start",offset:s=[0,0],children:i,style:a,onClickOutside:o}){const[c,f]=p.useState(null),{styles:u}=ec(r,c,{placement:n,modifiers:[{name:"offset",options:{offset:s}}]});return Ji([c,r],o,{enabled:e}),l.jsx(Mr,{mounted:e,rootClassName:"popover-portal",children:l.jsx("div",{ref:f,style:{...u.popper,...a,pointerEvents:"auto"},className:N.twJoin("bbn-popover",t),children:i})})}function Ui(e){const[t,r]=p.useState({width:0,height:0});return p.useEffect(()=>{if(!e){r({width:0,height:0});return}const n=new ResizeObserver(([s])=>{r({width:s.target.clientWidth,height:s.target.clientHeight})});return n.observe(e),()=>{n.unobserve(e)}},[e]),t}const nc=e=>e.label,ts=p.forwardRef(({disabled:e,className:t,value:r,defaultValue:n,placeholder:s="Select option",open:i,defaultOpen:a,options:o=[],optionClassName:c,popoverClassName:f,state:u="default",onOpen:d,onSelect:h,onClose:v,renderSelectedOption:x=nc,...g},b)=>{const C=p.useRef(null);p.useImperativeHandle(b,()=>C.current,[]);const{width:w}=Ui(C.current),[E,S]=zt({value:i,defaultValue:a,onStateChange:_=>void(_?d==null?void 0:d():v==null?void 0:v())}),[A,O]=zt({value:r,defaultValue:n,onStateChange:h}),k=p.useMemo(()=>o.find(_=>_.value===A),[o,A]),$=p.useCallback(_=>{O(_.value),S(!1)},[O,S]),I=p.useCallback(()=>{S(!1)},[S]),W=p.useCallback(()=>{e||S(!E)},[E,e,S]);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{ref:C,className:N.twJoin("bbn-select",e&&"bbn-select-disabled",`bbn-select-${u}`,t),onClick:W,tabIndex:e?-1:0,...g,children:[l.jsx("span",{children:k?x(k):s}),l.jsx(Ia,{className:N.twJoin("bbn-select-icon",E&&"bbn-select-icon-open"),size:20})]}),l.jsx(pn,{anchorEl:C.current,className:N.twJoin("bbn-select-menu custom-scrollbar",f),open:E&&!e,onClickOutside:I,offset:[0,4],placement:"bottom-start",style:{width:w},children:o.map(_=>l.jsx("div",{className:N.twJoin("bbn-select-option",(k==null?void 0:k.value)===_.value&&"bbn-select-option-selected",c),onClick:()=>$(_),children:_.label},_.value))})]})});ts.displayName="Select";const Dr=p.forwardRef(({className:e,prefix:t,suffix:r,disabled:n=!1,state:s="default",...i},a)=>l.jsxs("div",{className:N.twJoin("bbn-input",`bbn-input-${s}`,n&&"bbn-input-disabled",r&&"bbn-input-has-suffix"),children:[t&&l.jsx("div",{className:"bbn-input-prefix",children:t}),l.jsx("input",{ref:a,className:N.twJoin("bbn-input-field",e),disabled:n,...i}),r&&l.jsx("div",{className:"bbn-input-suffix",children:r})]}));Dr.displayName="Input";function Vr({children:e,label:t,hint:r,state:n="default",className:s}){return l.jsxs("div",{className:N.twJoin("bbn-form-control",s),children:[t?l.jsxs("label",{className:"bbn-form-control-label",children:[l.jsx("div",{className:"bbn-form-control-title",children:t}),e]}):e,r&&l.jsx("div",{className:N.twJoin("bbn-form-control-hint",`bbn-form-control-hint-${n}`),children:r})]})}const qi=p.createContext({removeDialog:()=>null,updateDialog:()=>null});function sc({children:e}){const[t,r]=p.useState({}),n=p.useMemo(()=>Object.values(t).some(o=>o),[t]);p.useEffect(function(){if(n){const c=document.body.offsetWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=document.body.offsetWidth-c>=1?Un(document.body.offsetWidth-c)??"":document.body.style.paddingRight}else document.body.style.overflow="",document.body.style.paddingRight=""},[n]);const s=p.useCallback(o=>{r(c=>Reflect.deleteProperty(c,o)?{...c}:c)},[]),i=p.useCallback((o,c)=>{r(f=>({...f,[o]:c}))},[]),a=p.useMemo(()=>({removeDialog:s,updateDialog:i}),[s,i]);return l.jsx(qi.Provider,{value:a,children:e})}function rs({open:e=!1}={}){const t=p.useId(),[r,n]=p.useState(e),{updateDialog:s,removeDialog:i}=p.useContext(qi),a=e||r;p.useEffect(()=>()=>{i(t)},[t]),p.useEffect(()=>{s(t,a)},[t,a,s]),p.useEffect(()=>{e&&n(!0)},[e]);const o=p.useCallback(()=>{e||n(!1)},[e]);return{mounted:r,unmount:o}}const Zi=({open:e=!1,...t})=>l.jsx("div",{...t,className:N.twJoin("bbn-backdrop",e?"animate-backdrop-in":"animate-backdrop-out",t.className)}),Ir=({children:e,open:t=!1,className:r,onClose:n,hasBackdrop:s=!0,backdropClassName:i,dialogClassName:a,...o})=>{const{mounted:c,unmount:f}=rs({open:t});return l.jsxs(Mr,{mounted:c,children:[l.jsx("div",{...o,className:N.twJoin("bbn-dialog-wrapper",r),children:l.jsx("div",{className:N.twJoin("bbn-dialog",t?"animate-modal-in":"animate-modal-out",a),onAnimationEnd:f,children:e})}),s&&l.jsx(Zi,{className:i,open:t,onClick:n})]})},Kr=({children:e,className:t="",size:r=40,variant:n="default",background:s=!1,rounded:i=!1})=>{const a={default:"text-accent-secondary",primary:"text-primary-light",secondary:"text-accent-secondary",error:"text-error-main",success:"text-success-main","accent-primary":"text-accent-primary","accent-secondary":"text-accent-secondary"},o={default:"bg-accent-secondary/10",primary:"bg-primary-light/10 dark:bg-[#47484A]",secondary:"bg-accent-secondary/10",error:"bg-error-main/10",success:"bg-success-main/10","accent-primary":"bg-accent-primary/10","accent-secondary":"bg-accent-secondary/10"};return l.jsx("div",{className:N.twJoin("flex items-center justify-center",s&&o[n],i&&"rounded-full",s?"[&_svg]:h-4 [&_svg]:w-auto":"[&_svg]:w-full [&_svg]:h-full","[&_svg_path]:fill-current",s&&"dark:[&_svg_path]:fill-white",a[n],t),style:{width:r,height:r},children:e})},Xi=({className:e="",size:t=24,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t*.545},viewBox:"0 0 22 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M20 4H11.65C10.83 1.67 8.61 0 6 0C2.69 0 0 2.69 0 6C0 9.31 2.69 12 6 12C8.61 12 10.83 10.33 11.65 8H12L14 10L16 8L18 10L22 5.96L20 4ZM6 9C4.35 9 3 7.65 3 6C3 4.35 4.35 3 6 3C7.65 3 9 4.35 9 6C9 7.65 7.65 9 6 9Z",fill:"currentColor"})})},Yi=({className:e="",size:t=24,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t*.5},viewBox:"0 0 20 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M15 0H11V2H15C16.65 2 18 3.35 18 5C18 6.65 16.65 8 15 8H11V10H15C17.76 10 20 7.76 20 5C20 2.24 17.76 0 15 0ZM9 8H5C3.35 8 2 6.65 2 5C2 3.35 3.35 2 5 2H9V0H5C2.24 0 0 2.24 0 5C0 7.76 2.24 10 5 10H9V8ZM6 4H14V6H6V4Z",fill:"currentColor"})})},Ki=({className:e="",size:t=24,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsxs("svg",{style:{width:t,height:t*1},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:[l.jsx("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 18C5.58 18 2 14.42 2 10C2 5.58 5.58 2 10 2C14.42 2 18 5.58 18 10C18 14.42 14.42 18 10 18Z",fill:"currentColor"}),l.jsx("path",{d:"M10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5C7.23858 5 5 7.23858 5 10C5 12.7614 7.23858 15 10 15Z",fill:"currentColor"})]})},hn=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t*1.143},viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M9.99984 0.666626H1.99984C1.2665 0.666626 0.666504 1.26663 0.666504 1.99996V11.3333H1.99984V1.99996H9.99984V0.666626ZM11.9998 3.33329H4.6665C3.93317 3.33329 3.33317 3.93329 3.33317 4.66663V14C3.33317 14.7333 3.93317 15.3333 4.6665 15.3333H11.9998C12.7332 15.3333 13.3332 14.7333 13.3332 14V4.66663C13.3332 3.93329 12.7332 3.33329 11.9998 3.33329ZM11.9998 14H4.6665V4.66663H11.9998V14Z",fill:"currentColor"})})},ns=({className:e="",size:t=14,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z",fill:"currentColor"})})},Gi=({className:e="",size:t=22,variant:r="default",color:n})=>{const s=n||ze[r],i=22/20;return l.jsx("svg",{style:{width:t,height:t*i},viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M0 19.5H22L11 0.5L0 19.5ZM12 16.5H10V14.5H12V16.5ZM12 12.5H10V8.5H12V12.5Z",fill:"currentColor"})})},Qi=({className:e="",size:t=20,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:[l.jsx("rect",{x:"0.5",y:"0.5",width:"19",height:"19",rx:"3.5",stroke:"currentColor"}),l.jsx("path",{d:"M14.0832 10.5846H5.9165V9.41797H14.0832V10.5846Z",fill:"currentColor"})]})},eo=({className:e="",size:t=20,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:[l.jsx("rect",{x:"0.5",y:"0.5",width:"19",height:"19",rx:"3.5",stroke:"currentColor"}),l.jsx("path",{d:"M14 10.5714H10.5714V14H9.42857V10.5714H6V9.42857H9.42857V6H10.5714V9.42857H14V10.5714Z",fill:"currentColor"})]})},ic=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},oc=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M12.73 0H5.27L0 5.27V12.73L5.27 18H12.73L18 12.73V5.27L12.73 0ZM9 14.3C8.28 14.3 7.7 13.72 7.7 13C7.7 12.28 8.28 11.7 9 11.7C9.72 11.7 10.3 12.28 10.3 13C10.3 13.72 9.72 14.3 9 14.3ZM10 10H8V4H10V10Z",fill:"currentColor"})})},ac=({className:e="",size:t=40,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",e),children:[l.jsx("rect",{width:"40",height:"40",rx:"20",fill:"currentColor",fillOpacity:"0.12"}),l.jsx("path",{d:"M20 30C25.52 30 30 25.52 30 20C30 14.48 25.52 10 20 10C14.48 10 10 14.48 10 20C10 25.52 14.48 30 20 30ZM21 12.07C24.94 12.56 28 15.92 28 20C28 24.08 24.95 27.44 21 27.93V12.07Z",fill:"currentColor",className:s})]})},ss=({className:e="",size:t=14,variant:r="default",color:n})=>{const s=n||ze[r];return l.jsx("svg",{style:{width:t,height:t*1},viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:N.twJoin("transition-opacity duration-200",s,e),children:l.jsx("path",{d:"M6.33325 3.66634H7.66659V4.99967H6.33325V3.66634ZM6.33325 6.33301H7.66659V10.333H6.33325V6.33301ZM6.99992 0.333008C3.31992 0.333008 0.333252 3.31967 0.333252 6.99967C0.333252 10.6797 3.31992 13.6663 6.99992 13.6663C10.6799 13.6663 13.6666 10.6797 13.6666 6.99967C13.6666 3.31967 10.6799 0.333008 6.99992 0.333008ZM6.99992 12.333C4.05992 12.333 1.66659 9.93967 1.66659 6.99967C1.66659 4.05967 4.05992 1.66634 6.99992 1.66634C9.93992 1.66634 12.3333 4.05967 12.3333 6.99967C12.3333 9.93967 9.93992 12.333 6.99992 12.333Z",fill:"currentColor"})})},ze={default:"text-accent-primary",primary:"text-primary-light",secondary:"text-accent-secondary",error:"text-error-main",success:"text-success-main","accent-primary":"text-accent-primary","accent-secondary":"text-accent-secondary"},Xt=({children:e,open:t=!1,className:r,onClose:n,...s})=>{const{mounted:i,unmount:a}=rs({open:t});return l.jsxs(Mr,{mounted:i,children:[l.jsxs("div",{...s,className:N.twJoin("bbn-dialog-mobile",t?"animate-mobile-modal-in":"animate-mobile-modal-out",r),onAnimationEnd:a,children:[n&&l.jsx("button",{onClick:n,className:"absolute top-4 left-4 z-10 p-1.5 rounded-full bg-surface-tertiary hover:bg-surface-quaternary transition-colors","aria-label":"Close",children:l.jsx(ns,{size:14,variant:"accent-primary"})}),e]}),l.jsx(Zi,{open:t,onClick:n})]})},Br=({className:e,children:t,title:r,onClose:n})=>l.jsxs("div",{className:N.twJoin("bbn-dialog-header",e),children:[l.jsxs("div",{className:"bbn-dialog-title",children:[l.jsx(dn,{variant:"h5",children:r}),!!n&&l.jsx(zn,{className:"shrink-0",onClick:n,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:l.jsx("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"currentColor"})})})]}),t]}),Pr=e=>l.jsx("div",{...e,className:N.twJoin("bbn-dialog-body",e.className)}),vn=e=>l.jsx("div",{...e,className:N.twJoin("bbn-dialog-footer",e.className)});function lc({className:e,...t}){return l.jsx("span",{...t,className:N.twJoin("bbn-chip",e)})}function to({size:e=40,className:t}){return l.jsx("span",{className:N.twMerge("bbn-loader text-current",t),style:{width:e,height:e},children:l.jsx("svg",{viewBox:"22 22 44 44",children:l.jsx("circle",{cx:"44",cy:"44",r:"20.2",fill:"none",stroke:"currentColor",strokeWidth:"3.6"})})})}var ro="Expected a function",qs=NaN,cc="[object Symbol]",uc=/^\s+|\s+$/g,fc=/^[-+]0x[0-9a-f]+$/i,dc=/^0b[01]+$/i,mc=/^0o[0-7]+$/i,pc=parseInt,hc=typeof qr=="object"&&qr&&qr.Object===Object&&qr,vc=typeof self=="object"&&self&&self.Object===Object&&self,gc=hc||vc||Function("return this")(),xc=Object.prototype,yc=xc.toString,bc=Math.max,wc=Math.min,En=function(){return gc.Date.now()};function jc(e,t,r){var n,s,i,a,o,c,f=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(ro);t=Zs(t)||0,rn(r)&&(u=!!r.leading,d="maxWait"in r,i=d?bc(Zs(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h);function v(O){var k=n,$=s;return n=s=void 0,f=O,a=e.apply($,k),a}function x(O){return f=O,o=setTimeout(C,t),u?v(O):a}function g(O){var k=O-c,$=O-f,I=t-k;return d?wc(I,i-$):I}function b(O){var k=O-c,$=O-f;return c===void 0||k>=t||k<0||d&&$>=i}function C(){var O=En();if(b(O))return w(O);o=setTimeout(C,g(O))}function w(O){return o=void 0,h&&n?v(O):(n=s=void 0,a)}function E(){o!==void 0&&clearTimeout(o),f=0,n=c=s=o=void 0}function S(){return o===void 0?a:w(En())}function A(){var O=En(),k=b(O);if(n=arguments,s=this,c=O,k){if(o===void 0)return x(c);if(d)return o=setTimeout(C,t),v(c)}return o===void 0&&(o=setTimeout(C,t)),a}return A.cancel=E,A.flush=S,A}function Cc(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(ro);return rn(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),jc(e,t,{leading:n,maxWait:t,trailing:s})}function rn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Nc(e){return!!e&&typeof e=="object"}function Sc(e){return typeof e=="symbol"||Nc(e)&&yc.call(e)==cc}function Zs(e){if(typeof e=="number")return e;if(Sc(e))return qs;if(rn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=rn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(uc,"");var r=dc.test(e);return r||mc.test(e)?pc(e.slice(2),r?2:8):fc.test(e)?qs:+e}var Ec=Cc;const no=es(Ec);function so(e,{onLoadMore:t,hasMore:r=!1,loading:n=!1}={}){const[s,i]=p.useState(!1);return p.useEffect(()=>{const a=no(c=>{const f=c.target;i(f.scrollTop>0),!n&&r&&f.scrollHeight-f.scrollTop<=f.clientHeight+100&&(t==null||t())},100),o=e.current;if(o)return o.addEventListener("scroll",a),()=>o.removeEventListener("scroll",a)},[n,r,t,e]),{isScrolledTop:s}}function io(e){const[t,r]=p.useState(!1),[n,s]=p.useState(!1);return p.useEffect(()=>{const i=e.current;if(!i)return;const a=()=>{const{scrollLeft:o,scrollWidth:c,clientWidth:f}=i;r(o>0);const u=c-f;s(u>0&&o<u)};return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)},[e]),{isLeftScrolled:t,isRightScrolled:n}}const oo=p.createContext({data:[],columns:[],sortStates:{},onColumnSort:void 0,onRowSelect:void 0});function ao({name:e,className:t,children:r,sorter:n,frozen:s,showFrozenShadow:i,...a}){const{columns:o,sortStates:c,onColumnSort:f}=p.useContext(oo),u=c[e??""],d=u==null?void 0:u.direction,h=s?`bbn-table-frozen bbn-table-frozen-${s}`:"",v=s&&i?"bbn-frozen-shadow":"";return l.jsx(X,{variant:"caption",as:"th",className:N.twJoin("bbn-cell-left",n&&"bbn-table-sortable",h,v,t),onClick:()=>{if(n&&e){const x=o.find(g=>g.key===e);f==null||f(e,x==null?void 0:x.sorter)}},"data-column":e,...a,children:l.jsxs("div",{className:"flex items-center justify-between gap-1",children:[l.jsx("span",{children:r}),n&&l.jsxs("span",{className:"bbn-table-sort-icons",children:[l.jsx(Ba,{className:N.twJoin("bbn-sort-icon bbn-sort-icon-up",d==="asc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")}),l.jsx(Va,{className:N.twJoin("bbn-sort-icon bbn-sort-icon-down",d==="desc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")})]})]})})}function lo(e,t){const[r,n]=p.useState({}),s=p.useCallback((a,o)=>{o&&n(c=>{var h;const f=((h=c[a])==null?void 0:h.direction)??null,u=f===null?"asc":f==="asc"?"desc":null;if(u===null)return Object.fromEntries(Object.entries(c).filter(([v])=>v!==a).map(([v,x])=>[v,{...x,priority:x.priority>c[a].priority?x.priority-1:x.priority}]));const d=Math.max(0,...Object.values(c).map(v=>v.priority));return{...c,[a]:{direction:u,priority:d+1}}})},[]),i=p.useMemo(()=>{const a=Object.entries(r).filter(([,o])=>o.direction!==null).toSorted((o,c)=>c[1].priority-o[1].priority).map(([o,c])=>({column:t.find(f=>f.key===o),direction:c.direction})).filter(({column:o})=>o==null?void 0:o.sorter);return a.length===0?e:e.toSorted((o,c)=>{for(const{column:f,direction:u}of a){const d=f.sorter(o,c);if(d!==0)return u==="asc"?d:-d}return 0})},[e,t,r]);return{sortStates:r,handleColumnSort:s,sortedData:i}}function co({className:e,render:t,value:r,columnName:n,frozen:s,showFrozenShadow:i,...a}){const o=s?`bbn-table-frozen bbn-table-frozen-${s}`:"",c=s&&i?"bbn-frozen-shadow":"";return l.jsx(X,{variant:"body2",as:"td",className:N.twJoin("bbn-cell-left",o,c,e),"data-column":n,...a,children:t?t(r):r})}function Ac({row:e,columns:t,isSelected:r,isSelectable:n,onSelect:s,isLeftScrolled:i,isRightScrolled:a}){return l.jsx("tr",{className:N.twJoin(r&&"selected",!!s&&n&&"cursor-pointer",!n&&"opacity-50"),onClick:()=>s(e),children:t.map(o=>l.jsx(co,{value:e[o.key],columnName:o.key,className:o.cellClassName,frozen:o.frozen,showFrozenShadow:o.frozen==="left"&&i||o.frozen==="right"&&a,render:o.render?c=>o.render(c,e):void 0},o.key))})}function Oc({data:e,columns:t,className:r,wrapperClassName:n,fluid:s=!1,hasMore:i=!1,loading:a=!1,onLoadMore:o,onRowSelect:c,isRowSelectable:f,selectedRow:u,defaultSelectedRow:d,onSelectedRowChange:h,...v},x){const g=p.useRef(null);p.useImperativeHandle(x,()=>g.current,[]);const{sortStates:b,handleColumnSort:C,sortedData:w}=lo(e,t),{isScrolledTop:E}=so(g,{onLoadMore:o,hasMore:i,loading:a}),{isLeftScrolled:S,isRightScrolled:A}=io(g),[O,k]=zt({value:u,defaultValue:d??null,onStateChange:h}),$=p.useCallback(_=>{if(!c||f&&!f(_))return;const F=O===_.id?null:_.id;k(F),c(F===null?null:_)},[c,f,O,k]),I=p.useMemo(()=>({data:w,columns:t,sortStates:b,onColumnSort:C,onRowSelect:$}),[w,t,b,C,$]),W=p.useMemo(()=>t.some(_=>_.header&&_.header!==""),[t]);return l.jsx(oo.Provider,{value:I,children:l.jsx("div",{ref:g,className:N.twJoin("bbn-table-wrapper",s&&"bbn-table-wrapper-fluid",n),children:l.jsxs("table",{className:N.twJoin("bbn-table",s&&"bbn-table-fluid",r),...v,children:[l.jsx("thead",{className:N.twJoin("bbn-table-header",E&&"scrolled-top",!W&&"hidden"),children:l.jsx("tr",{children:t.map(_=>l.jsx(ao,{className:_.headerClassName,name:_.key,sorter:_.sorter,frozen:_.frozen,showFrozenShadow:_.frozen==="left"&&S||_.frozen==="right"&&A,children:_.header},_.key))})}),l.jsx("tbody",{className:"bbn-table-body",children:w.map(_=>l.jsx(Ac,{row:_,columns:t,isSelected:O===_.id,isSelectable:f?f(_):!0,onSelect:$,isLeftScrolled:S,isRightScrolled:A},_.id))})]})})})}const uo=p.forwardRef(Oc);function fo({as:e="div",className:t,children:r}){return p.createElement(e,{className:N.twJoin("bbn-card",t)},r)}function mo(e){const[t=!1,r]=zt({value:e.value,defaultValue:e.defaultValue,onStateChange:e.onChange});return l.jsxs("div",{className:"bbn-toggle",onClick:()=>void r(!t),children:[l.jsx("span",{className:"bbn-toggle-bg",children:e.activeIcon}),l.jsx("span",{className:N.twJoin("bbn-toggle-control",t&&"bbn-toggle-control-active")}),l.jsx("span",{className:"bbn-toggle-bg",children:e.inactiveIcon})]})}const kc={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Lc({className:e,orientation:t="vertical",children:r}){return l.jsx("div",{className:N.twMerge("bbn-list",`bbn-list-${t}`,e),children:p.Children.map(r,n=>p.isValidElement(n)?p.cloneElement(n,{orientation:kc[t]}):n)})}function po({className:e,orientation:t="horizontal",title:r,value:n,suffix:s}){return l.jsxs("div",{className:N.twJoin("bbn-list-item",`bbn-list-item-${t}`,e),children:[l.jsx(X,{as:"div",className:N.twJoin("bbn-list-title",`bbn-list-title-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),l.jsxs(X,{as:"div",className:N.twJoin("bbn-list-value",`bbn-list-value-${t}`),variant:"body1",children:[n,s]})]})}function Xs(e){return Ft({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]},{tag:"path",attr:{d:"M464 336a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}function _c(e){return Ft({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z"},child:[]},{tag:"path",attr:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z"},child:[]}]})(e)}function is(e={}){const{copiedText:t="Copied ✓",timeout:r=2e3}=e,[n,s]=p.useState({}),i=p.useRef({}),a=p.useCallback(u=>{u&&s(d=>({...d,[u]:!1}))},[]),o=p.useCallback((u,d)=>{if(!u||!d)return;navigator.clipboard.writeText(d).catch(()=>{}),s(v=>({...v,[u]:!0}));const h=i.current[u];h&&clearTimeout(h),r>0&&(i.current[u]=setTimeout(()=>{i.current[u]=void 0,a(u)},r))},[r,a]),c=p.useCallback(u=>u&&n[u]||!1,[n]),f=p.useCallback(u=>u&&n[u]?t:"",[n,t]);return p.useEffect(()=>()=>{Object.values(i.current).forEach(u=>u&&clearTimeout(u)),i.current={}},[]),{isCopied:c,copiedText:f,copyToClipboard:o}}function Yt(e=768,t=100){const[r,n]=p.useState(()=>typeof window<"u"?window.innerWidth<e:!1),s=p.useRef(),i=p.useCallback(()=>{n(window.innerWidth<e)},[e]);return p.useEffect(()=>(s.current=no(i,t),i(),window.addEventListener("resize",s.current),()=>{s.current&&(window.removeEventListener("resize",s.current),s.current.cancel())}),[i,t]),r}function ho({isOpen:e}){const[t,r]=p.useState(!1),[n,s]=p.useState(!1);p.useEffect(()=>{e&&!t&&(r(!0),s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{s(!0)})}))},[e,t]),p.useEffect(()=>{!e&&t&&s(!1)},[e,t]);const i=p.useCallback(()=>{!e&&t&&r(!1)},[e,t]);return{mounted:t,shouldShowOpen:n,handleAnimationEnd:i}}const Fc=({hidden:e=!1,loading:t,title:r,value:n,tooltip:s,loadingStyle:i="spinner",...a})=>{const o=p.useId(),c=Yt(),[f,u]=p.useState(!1),[d,h]=p.useState(null);if(p.useEffect(()=>{!c&&f&&u(!1)},[c,f]),e)return null;const v=l.jsxs("div",{className:"inline-flex items-center gap-2",children:[l.jsx("span",{className:"loader size-5"}),i==="spinner-and-value"&&l.jsx("span",{className:"opacity-50",children:n})]}),x=s?c?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"block size-5 cursor-pointer text-xs",onClick:()=>u(!0),children:l.jsx(Xs,{size:20})}),l.jsxs(Xt,{open:f,onClose:()=>u(!1),children:[l.jsx("div",{className:"px-4 py-2 text-accent-primary",children:s}),l.jsx("div",{className:"p-4",children:l.jsx(Me,{variant:"contained",fluid:!0,onClick:()=>u(!1),children:"Done"})})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"block size-5 cursor-pointer text-xs",onMouseEnter:g=>h(g.currentTarget),onMouseLeave:()=>h(null),"aria-describedby":o,children:l.jsx(Xs,{size:20})}),l.jsx(pn,{open:!!d,anchorEl:d,placement:"top",offset:[0,8],children:l.jsx("div",{className:"tooltip-wrap",children:s})})]}):void 0;return l.jsx(po,{...a,title:r,value:t?v:n,suffix:x})};function Tc({children:e,count:t=0,max:r=99,position:n="bottom-right",color:s="error",className:i,badgeClassName:a,contentClassName:o}){const c=typeof t=="number"?t>0:t!=null,f=typeof t=="number"&&t>r?`${r}+`:t,u=`bbn-badge-${n}`,d=`bbn-badge-${s}`;return l.jsxs("div",{className:N.twJoin("bbn-badge",i),children:[e,c&&l.jsx("span",{className:N.twJoin("bbn-badge-indicator",u,d,a),children:l.jsx("span",{className:N.twJoin("bbn-badge-content",o),children:f})})]})}const hr=({children:e,style:t,variant:r="contained",className:n})=>l.jsx("div",{className:N.twJoin("bbn-subsection",`bbn-subsection-${r}`,n),style:t,children:e});function vo({counter:e,max:t,onAdd:r,alwaysShowCounter:n=!1}){const s=e<t,i=0<e||n&&e===0;return l.jsxs("div",{className:N.twJoin("bg-primary-highlight flex overflow-hidden rounded-md border border-accent-primary w-fit",s&&"cursor-pointer",!i&&!s&&"hidden",!i&&"w-10"),onClick:s?r:void 0,children:[s&&l.jsx("div",{className:"flex h-10 w-10 items-center justify-center",children:l.jsx(_c,{size:20})}),i&&l.jsxs("div",{className:N.twJoin("flex h-10 items-center px-2 text-sm sm:px-4 sm:text-base",s&&"border-l border-accent-primary"),children:[e,"/",t]})]})}const go=p.createContext(void 0),os=()=>p.useContext(go),Rc=({children:e,value:t})=>l.jsx(go.Provider,{value:t,children:e}),as=({isOpen:e,onClose:t,title:r,children:n,className:s="",titleAlign:i="left",backIcon:a,fullHeight:o=!1,fullWidth:c=!1,showBackButton:f=!0,showDivider:u=!0,onBackdropClick:d})=>{const{mounted:h,shouldShowOpen:v,handleAnimationEnd:x}=ho({isOpen:e}),g={left:"text-left",center:"text-center",right:"text-right"},b=()=>f||r?l.jsxs("div",{className:N.twJoin("flex items-center p-4",u&&"border-b border-[#38708533] dark:border-[#404040]"),children:[f&&l.jsx("button",{onClick:t,className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded transition-colors hover:bg-accent-secondary/10","aria-label":"Go back",children:a||l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:l.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),r&&l.jsx("h3",{className:N.twJoin("flex-1 text-sm font-medium text-accent-primary",f?"ml-3":"",g[i]),children:r})]}):null,C=()=>l.jsxs(l.Fragment,{children:[b(),l.jsx("div",{className:"flex-1 overflow-y-auto",children:n})]});return o?l.jsxs(Mr,{mounted:h,rootClassName:"menu-drawer-portal",children:[d&&l.jsx("div",{className:N.twJoin("fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",v?"opacity-100":"pointer-events-none opacity-0"),onClick:d}),l.jsx("div",{className:N.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]","fixed inset-y-0 right-0 z-50",c?"w-full":"w-full max-w-sm",v?"translate-x-0":"translate-x-full",s),onTransitionEnd:x,children:C()})]}):l.jsx("div",{className:N.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]","absolute inset-0 rounded-lg",e?"translate-x-0":"translate-x-full",s),children:C()})},ls=({children:e,trigger:t,open:r,onOpenChange:n,placement:s="bottom-end",offset:i=[0,8],className:a,mobileMode:o="dialog"})=>{const[c,f]=p.useState(!1),u=p.useRef(null),d=Yt(),h=r!==void 0?r:c,v=C=>{r===void 0&&f(C),n==null||n(C)},x=()=>v(!1),g=l.jsx("div",{className:"relative w-full overflow-hidden",children:e}),b=t||l.jsx("button",{className:"rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-800",onClick:()=>v(!h),children:"Menu"});return l.jsxs(Rc,{value:{isOpen:h,setIsOpen:v,onClose:x,isMobile:d},children:[l.jsx("div",{ref:u,className:"inline-block",children:p.isValidElement(b)&&p.cloneElement(b,{onClick:()=>v(!h),"aria-haspopup":"true","aria-expanded":h})}),d?o==="dialog"?l.jsx(Xt,{open:h,onClose:x,className:N.twJoin("bg-[#FFFFFF] dark:bg-[#252525] text-primary-main",a),children:g}):l.jsx(as,{isOpen:h,onClose:x,onBackdropClick:x,fullHeight:!0,fullWidth:!0,showBackButton:!0,showDivider:!1,children:g}):l.jsx(pn,{anchorEl:u.current,open:h,offset:i,placement:s,onClickOutside:x,className:N.twJoin("rounded-lg border border-[#38708533] bg-[#FFFFFF] shadow-lg dark:border-[#404040] dark:bg-[#252525]","min-w-[294px]",a),children:g})]})},xo=({icon:e,name:t,description:r,onClick:n,disabled:s=!1,className:i,children:a,suffix:o,selected:c=!1,role:f="menuitem",toggle:u})=>{const d=os(),h=u?l.jsx(mo,{value:u.value,defaultValue:u.defaultValue,onChange:u.onChange}):null,v=h||o,x=()=>{s||h||(n&&n(),d&&!v&&d.onClose())};return a?l.jsx("button",{onClick:x,disabled:s,className:N.twJoin("w-full text-left",s&&"cursor-not-allowed opacity-50",i),children:a}):l.jsxs("div",{className:N.twJoin("flex w-full items-center justify-between p-6","transition-colors",!h&&"cursor-pointer hover:bg-accent-secondary/5","text-left",c&&"bg-accent-secondary/10",s&&"cursor-not-allowed opacity-50",h&&"cursor-default",i),role:f,"aria-selected":c,onClick:x,children:[l.jsxs("div",{className:"flex items-center gap-3",children:[e&&l.jsx("div",{className:"flex-shrink-0",children:e}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:"text-sm font-medium text-accent-primary",children:t}),r&&l.jsx("div",{className:"text-xs text-accent-secondary",children:r})]})]}),v&&l.jsx("div",{className:"flex-shrink-0",children:v})]})},yo=({children:e,name:t,description:r,icon:n,backIcon:s,suffix:i,className:a,contentClassName:o,titleAlign:c="left"})=>{const[f,u]=p.useState(!1),d=os(),h=l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:l.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),v=l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:l.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:()=>u(!0),className:N.twJoin("flex w-full items-center justify-between p-6","transition-colors hover:bg-accent-secondary/5","text-left focus:outline-none",a),role:"menuitem",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[n&&l.jsx("div",{className:"flex-shrink-0",children:n}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{className:"text-sm font-medium text-accent-primary",children:t}),r&&l.jsx("span",{className:"mt-0.5 text-xs text-accent-secondary",children:r})]})]}),i||v]}),l.jsx(as,{isOpen:f,onClose:()=>u(!1),title:t||"",titleAlign:c,backIcon:s||h,fullHeight:d==null?void 0:d.isMobile,fullWidth:d==null?void 0:d.isMobile,onBackdropClick:d!=null&&d.isMobile?void 0:()=>u(!1),className:N.twJoin(d!=null&&d.isMobile?"z-60":"z-50",o),children:e})]})},Mc=({label:e,description:t,onClick:r,selected:n=!1,className:s,suffix:i,disabled:a=!1})=>{const o=l.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M16.6667 5L7.5 14.1667L3.33333 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return l.jsxs("button",{role:"menuitem",onClick:r,disabled:a,className:N.twJoin("flex w-full items-center justify-between p-4","transition-colors hover:bg-accent-secondary/5","text-left focus:outline-none",n&&"bg-accent-secondary/10",a&&"cursor-not-allowed opacity-50",s),"aria-selected":n,tabIndex:a?-1:0,children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{className:"font-medium text-accent-primary",children:e}),t&&l.jsx("span",{className:"text-sm text-accent-secondary",children:t})]}),n&&(i||o)]})},gn=({amount:e,currencyIcon:t,currencyName:r,placeholder:n="Enter Amount",subtitle:s,displayBalance:i,balanceDetails:a,min:o,step:c,autoFocus:f,onChange:u,onKeyDown:d,amountUsd:h,disabled:v=!1})=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:t,alt:r,className:"h-10 max-h-[2.5rem] w-10 max-w-[2.5rem]"}),l.jsx("div",{className:"text-lg",children:r})]}),l.jsx("input",{type:"number",value:e??"",min:o,step:c,onChange:u,onKeyDown:d,disabled:v,placeholder:n,autoFocus:f,className:"w-2/3 bg-transparent text-right text-lg outline-none appearance-none [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"})]}),a&&i?l.jsxs("div",{className:"flex w-full flex-row content-center justify-between text-sm",children:[l.jsx("span",{className:"cursor-default",children:s}),a.displayUSD&&a.price!==void 0&&l.jsxs("div",{children:[h," USD"]})]}):null]});function Dc(e,t=8){if(!e||e.length<=t*2)return e;const r=e.slice(0,t),n=e.slice(-t);return`${r}...${n}`}const cs=({value:e,symbols:t=8,size:r="body2",className:n})=>e?l.jsx(X,{variant:r,className:N.twJoin("text-accent-primary",n),children:l.jsx("span",{children:Dc(e,t)??e})}):null,bo=({children:e,value:t,className:r,onCopy:n,isCopied:s,copiedText:i,timeout:a=2e3})=>{const o=p.useId(),c={copiedText:i,timeout:a},{isCopied:f,copiedText:u,copyToClipboard:d}=is(c),h=s!==void 0,v=h?s:f(o),x=h?i||"Copied ✓":u(o),g=b=>{b.stopPropagation(),h&&n?n(t):d(o,t)};return l.jsx("div",{className:N.twMerge("inline-flex items-center cursor-pointer hover:opacity-100 transition-opacity duration-200",r),onClick:g,children:l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:N.twMerge("transition-opacity duration-300 ease-in-out",v&&"opacity-0"),children:e}),v&&l.jsx("div",{className:N.twMerge("absolute inset-0 flex items-center transition-opacity duration-300 ease-in-out text-green-600","opacity-100"),children:x})]})})};function wo({children:e,className:t,iconClassName:r,messageClassName:n}){return l.jsxs("div",{className:N.twJoin("bbn-warning",t),children:[l.jsx(Gi,{variant:"secondary",size:22,className:N.twJoin("bbn-warning-icon",r)}),l.jsx("p",{className:N.twJoin("bbn-warning-message",n),children:e})]})}const fr=Math.min,Ht=Math.max,nn=Math.round,Zr=Math.floor,ht=e=>({x:e,y:e}),Vc={left:"right",right:"left",bottom:"top",top:"bottom"},Ic={start:"end",end:"start"};function Tn(e,t,r){return Ht(e,fr(t,r))}function $r(e,t){return typeof e=="function"?e(t):e}function Ut(e){return e.split("-")[0]}function Hr(e){return e.split("-")[1]}function jo(e){return e==="x"?"y":"x"}function us(e){return e==="y"?"height":"width"}const Bc=new Set(["top","bottom"]);function Lt(e){return Bc.has(Ut(e))?"y":"x"}function fs(e){return jo(Lt(e))}function Pc(e,t,r){r===void 0&&(r=!1);const n=Hr(e),s=fs(e),i=us(s);let a=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=sn(a)),[a,sn(a)]}function $c(e){const t=sn(e);return[Rn(e),t,Rn(t)]}function Rn(e){return e.replace(/start|end/g,t=>Ic[t])}const Ys=["left","right"],Ks=["right","left"],Hc=["top","bottom"],Wc=["bottom","top"];function zc(e,t,r){switch(e){case"top":case"bottom":return r?t?Ks:Ys:t?Ys:Ks;case"left":case"right":return t?Hc:Wc;default:return[]}}function Jc(e,t,r,n){const s=Hr(e);let i=zc(Ut(e),r==="start",n);return s&&(i=i.map(a=>a+"-"+s),t&&(i=i.concat(i.map(Rn)))),i}function sn(e){return e.replace(/left|right|bottom|top/g,t=>Vc[t])}function Uc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Co(e){return typeof e!="number"?Uc(e):{top:e,right:e,bottom:e,left:e}}function on(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Gs(e,t,r){let{reference:n,floating:s}=e;const i=Lt(t),a=fs(t),o=us(a),c=Ut(t),f=i==="y",u=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,h=n[o]/2-s[o]/2;let v;switch(c){case"top":v={x:u,y:n.y-s.height};break;case"bottom":v={x:u,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:d};break;case"left":v={x:n.x-s.width,y:d};break;default:v={x:n.x,y:n.y}}switch(Hr(t)){case"start":v[a]-=h*(r&&f?-1:1);break;case"end":v[a]+=h*(r&&f?-1:1);break}return v}const qc=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:a}=r,o=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=Gs(f,n,c),h=n,v={},x=0;for(let g=0;g<o.length;g++){const{name:b,fn:C}=o[g],{x:w,y:E,data:S,reset:A}=await C({x:u,y:d,initialPlacement:n,placement:h,strategy:s,middlewareData:v,rects:f,platform:a,elements:{reference:e,floating:t}});u=w??u,d=E??d,v={...v,[b]:{...v[b],...S}},A&&x<=50&&(x++,typeof A=="object"&&(A.placement&&(h=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:u,y:d}=Gs(f,h,c)),g=-1)}return{x:u,y:d,placement:h,strategy:s,middlewareData:v}};async function No(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:i,rects:a,elements:o,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:v=0}=$r(t,e),x=Co(v),b=o[h?d==="floating"?"reference":"floating":d],C=on(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:f,rootBoundary:u,strategy:c})),w=d==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),S=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},A=on(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:w,offsetParent:E,strategy:c}):w);return{top:(C.top-A.top+x.top)/S.y,bottom:(A.bottom-C.bottom+x.bottom)/S.y,left:(C.left-A.left+x.left)/S.x,right:(A.right-C.right+x.right)/S.x}}const Zc=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:i,platform:a,elements:o,middlewareData:c}=t,{element:f,padding:u=0}=$r(e,t)||{};if(f==null)return{};const d=Co(u),h={x:r,y:n},v=fs(s),x=us(v),g=await a.getDimensions(f),b=v==="y",C=b?"top":"left",w=b?"bottom":"right",E=b?"clientHeight":"clientWidth",S=i.reference[x]+i.reference[v]-h[v]-i.floating[x],A=h[v]-i.reference[v],O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let k=O?O[E]:0;(!k||!await(a.isElement==null?void 0:a.isElement(O)))&&(k=o.floating[E]||i.floating[x]);const $=S/2-A/2,I=k/2-g[x]/2-1,W=fr(d[C],I),_=fr(d[w],I),F=W,P=k-g[x]-_,H=k/2-g[x]/2+$,Y=Tn(F,H,P),J=!c.arrow&&Hr(s)!=null&&H!==Y&&i.reference[x]/2-(H<F?W:_)-g[x]/2<0,q=J?H<F?H-F:H-P:0;return{[v]:h[v]+q,data:{[v]:Y,centerOffset:H-Y-q,...J&&{alignmentOffset:q}},reset:J}}}),Xc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:i,rects:a,initialPlacement:o,platform:c,elements:f}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:g=!0,...b}=$r(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const C=Ut(s),w=Lt(o),E=Ut(o)===o,S=await(c.isRTL==null?void 0:c.isRTL(f.floating)),A=h||(E||!g?[sn(o)]:$c(o)),O=x!=="none";!h&&O&&A.push(...Jc(o,g,x,S));const k=[o,...A],$=await No(t,b),I=[];let W=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&I.push($[C]),d){const H=Pc(s,a,S);I.push($[H[0]],$[H[1]])}if(W=[...W,{placement:s,overflows:I}],!I.every(H=>H<=0)){var _,F;const H=(((_=i.flip)==null?void 0:_.index)||0)+1,Y=k[H];if(Y&&(!(d==="alignment"?w!==Lt(Y):!1)||W.every(G=>Lt(G.placement)===w?G.overflows[0]>0:!0)))return{data:{index:H,overflows:W},reset:{placement:Y}};let J=(F=W.filter(q=>q.overflows[0]<=0).sort((q,G)=>q.overflows[1]-G.overflows[1])[0])==null?void 0:F.placement;if(!J)switch(v){case"bestFit":{var P;const q=(P=W.filter(G=>{if(O){const te=Lt(G.placement);return te===w||te==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(te=>te>0).reduce((te,ue)=>te+ue,0)]).sort((G,te)=>G[1]-te[1])[0])==null?void 0:P[0];q&&(J=q);break}case"initialPlacement":J=o;break}if(s!==J)return{reset:{placement:J}}}return{}}}},Yc=new Set(["left","top"]);async function Kc(e,t){const{placement:r,platform:n,elements:s}=e,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=Ut(r),o=Hr(r),c=Lt(r)==="y",f=Yc.has(a)?-1:1,u=i&&c?-1:1,d=$r(t,e);let{mainAxis:h,crossAxis:v,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof x=="number"&&(v=o==="end"?x*-1:x),c?{x:v*u,y:h*f}:{x:h*f,y:v*u}}const Gc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:i,placement:a,middlewareData:o}=t,c=await Kc(t,e);return a===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},Qc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:o={fn:b=>{let{x:C,y:w}=b;return{x:C,y:w}}},...c}=$r(e,t),f={x:r,y:n},u=await No(t,c),d=Lt(Ut(s)),h=jo(d);let v=f[h],x=f[d];if(i){const b=h==="y"?"top":"left",C=h==="y"?"bottom":"right",w=v+u[b],E=v-u[C];v=Tn(w,v,E)}if(a){const b=d==="y"?"top":"left",C=d==="y"?"bottom":"right",w=x+u[b],E=x-u[C];x=Tn(w,x,E)}const g=o.fn({...t,[h]:v,[d]:x});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[h]:i,[d]:a}}}}}};function xn(){return typeof window<"u"}function vr(e){return So(e)?(e.nodeName||"").toLowerCase():"#document"}function He(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yt(e){var t;return(t=(So(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function So(e){return xn()?e instanceof Node||e instanceof He(e).Node:!1}function ot(e){return xn()?e instanceof Element||e instanceof He(e).Element:!1}function gt(e){return xn()?e instanceof HTMLElement||e instanceof He(e).HTMLElement:!1}function Qs(e){return!xn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof He(e).ShadowRoot}const eu=new Set(["inline","contents"]);function Wr(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=at(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!eu.has(s)}const tu=new Set(["table","td","th"]);function ru(e){return tu.has(vr(e))}const nu=[":popover-open",":modal"];function yn(e){return nu.some(t=>{try{return e.matches(t)}catch{return!1}})}const su=["transform","translate","scale","rotate","perspective"],iu=["transform","translate","scale","rotate","perspective","filter"],ou=["paint","layout","strict","content"];function ds(e){const t=ms(),r=ot(e)?at(e):e;return su.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||iu.some(n=>(r.willChange||"").includes(n))||ou.some(n=>(r.contain||"").includes(n))}function au(e){let t=_t(e);for(;gt(t)&&!dr(t);){if(ds(t))return t;if(yn(t))return null;t=_t(t)}return null}function ms(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lu=new Set(["html","body","#document"]);function dr(e){return lu.has(vr(e))}function at(e){return He(e).getComputedStyle(e)}function bn(e){return ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _t(e){if(vr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qs(e)&&e.host||yt(e);return Qs(t)?t.host:t}function Eo(e){const t=_t(e);return dr(t)?e.ownerDocument?e.ownerDocument.body:e.body:gt(t)&&Wr(t)?t:Eo(t)}function _r(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Eo(e),i=s===((n=e.ownerDocument)==null?void 0:n.body),a=He(s);if(i){const o=Mn(a);return t.concat(a,a.visualViewport||[],Wr(s)?s:[],o&&r?_r(o):[])}return t.concat(s,_r(s,[],r))}function Mn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ao(e){const t=at(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=gt(e),i=s?e.offsetWidth:r,a=s?e.offsetHeight:n,o=nn(r)!==i||nn(n)!==a;return o&&(r=i,n=a),{width:r,height:n,$:o}}function ps(e){return ot(e)?e:e.contextElement}function ir(e){const t=ps(e);if(!gt(t))return ht(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:i}=Ao(t);let a=(i?nn(r.width):r.width)/n,o=(i?nn(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const cu=ht(0);function Oo(e){const t=He(e);return!ms()||!t.visualViewport?cu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uu(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==He(e)?!1:t}function qt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=ps(e);let a=ht(1);t&&(n?ot(n)&&(a=ir(n)):a=ir(e));const o=uu(i,r,n)?Oo(i):ht(0);let c=(s.left+o.x)/a.x,f=(s.top+o.y)/a.y,u=s.width/a.x,d=s.height/a.y;if(i){const h=He(i),v=n&&ot(n)?He(n):n;let x=h,g=Mn(x);for(;g&&n&&v!==x;){const b=ir(g),C=g.getBoundingClientRect(),w=at(g),E=C.left+(g.clientLeft+parseFloat(w.paddingLeft))*b.x,S=C.top+(g.clientTop+parseFloat(w.paddingTop))*b.y;c*=b.x,f*=b.y,u*=b.x,d*=b.y,c+=E,f+=S,x=He(g),g=Mn(x)}}return on({width:u,height:d,x:c,y:f})}function wn(e,t){const r=bn(e).scrollLeft;return t?t.left+r:qt(yt(e)).left+r}function ko(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-wn(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function fu(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const i=s==="fixed",a=yt(n),o=t?yn(t.floating):!1;if(n===a||o&&i)return r;let c={scrollLeft:0,scrollTop:0},f=ht(1);const u=ht(0),d=gt(n);if((d||!d&&!i)&&((vr(n)!=="body"||Wr(a))&&(c=bn(n)),gt(n))){const v=qt(n);f=ir(n),u.x=v.x+n.clientLeft,u.y=v.y+n.clientTop}const h=a&&!d&&!i?ko(a,c):ht(0);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-c.scrollLeft*f.x+u.x+h.x,y:r.y*f.y-c.scrollTop*f.y+u.y+h.y}}function du(e){return Array.from(e.getClientRects())}function mu(e){const t=yt(e),r=bn(e),n=e.ownerDocument.body,s=Ht(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Ht(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+wn(e);const o=-r.scrollTop;return at(n).direction==="rtl"&&(a+=Ht(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:a,y:o}}const ei=25;function pu(e,t){const r=He(e),n=yt(e),s=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,o=0,c=0;if(s){i=s.width,a=s.height;const u=ms();(!u||u&&t==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}const f=wn(n);if(f<=0){const u=n.ownerDocument,d=u.body,h=getComputedStyle(d),v=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,x=Math.abs(n.clientWidth-d.clientWidth-v);x<=ei&&(i-=x)}else f<=ei&&(i+=f);return{width:i,height:a,x:o,y:c}}const hu=new Set(["absolute","fixed"]);function vu(e,t){const r=qt(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,i=gt(e)?ir(e):ht(1),a=e.clientWidth*i.x,o=e.clientHeight*i.y,c=s*i.x,f=n*i.y;return{width:a,height:o,x:c,y:f}}function ti(e,t,r){let n;if(t==="viewport")n=pu(e,r);else if(t==="document")n=mu(yt(e));else if(ot(t))n=vu(t,r);else{const s=Oo(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return on(n)}function Lo(e,t){const r=_t(e);return r===t||!ot(r)||dr(r)?!1:at(r).position==="fixed"||Lo(r,t)}function gu(e,t){const r=t.get(e);if(r)return r;let n=_r(e,[],!1).filter(o=>ot(o)&&vr(o)!=="body"),s=null;const i=at(e).position==="fixed";let a=i?_t(e):e;for(;ot(a)&&!dr(a);){const o=at(a),c=ds(a);!c&&o.position==="fixed"&&(s=null),(i?!c&&!s:!c&&o.position==="static"&&!!s&&hu.has(s.position)||Wr(a)&&!c&&Lo(e,a))?n=n.filter(u=>u!==a):s=o,a=_t(a)}return t.set(e,n),n}function xu(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[...r==="clippingAncestors"?yn(t)?[]:gu(t,this._c):[].concat(r),n],o=a[0],c=a.reduce((f,u)=>{const d=ti(t,u,s);return f.top=Ht(d.top,f.top),f.right=fr(d.right,f.right),f.bottom=fr(d.bottom,f.bottom),f.left=Ht(d.left,f.left),f},ti(t,o,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function yu(e){const{width:t,height:r}=Ao(e);return{width:t,height:r}}function bu(e,t,r){const n=gt(t),s=yt(t),i=r==="fixed",a=qt(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const c=ht(0);function f(){c.x=wn(s)}if(n||!n&&!i)if((vr(t)!=="body"||Wr(s))&&(o=bn(t)),n){const v=qt(t,!0,i,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else s&&f();i&&!n&&s&&f();const u=s&&!n&&!i?ko(s,o):ht(0),d=a.left+o.scrollLeft-c.x-u.x,h=a.top+o.scrollTop-c.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function An(e){return at(e).position==="static"}function ri(e,t){if(!gt(e)||at(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return yt(e)===r&&(r=r.ownerDocument.body),r}function _o(e,t){const r=He(e);if(yn(e))return r;if(!gt(e)){let s=_t(e);for(;s&&!dr(s);){if(ot(s)&&!An(s))return s;s=_t(s)}return r}let n=ri(e,t);for(;n&&ru(n)&&An(n);)n=ri(n,t);return n&&dr(n)&&An(n)&&!ds(n)?r:n||au(e)||r}const wu=async function(e){const t=this.getOffsetParent||_o,r=this.getDimensions,n=await r(e.floating);return{reference:bu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ju(e){return at(e).direction==="rtl"}const Cu={convertOffsetParentRelativeRectToViewportRelativeRect:fu,getDocumentElement:yt,getClippingRect:xu,getOffsetParent:_o,getElementRects:wu,getClientRects:du,getDimensions:yu,getScale:ir,isElement:ot,isRTL:ju};function Fo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nu(e,t){let r=null,n;const s=yt(e);function i(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),i();const f=e.getBoundingClientRect(),{left:u,top:d,width:h,height:v}=f;if(o||t(),!h||!v)return;const x=Zr(d),g=Zr(s.clientWidth-(u+h)),b=Zr(s.clientHeight-(d+v)),C=Zr(u),E={rootMargin:-x+"px "+-g+"px "+-b+"px "+-C+"px",threshold:Ht(0,fr(1,c))||1};let S=!0;function A(O){const k=O[0].intersectionRatio;if(k!==c){if(!S)return a();k?a(!1,k):n=setTimeout(()=>{a(!1,1e-7)},1e3)}k===1&&!Fo(f,e.getBoundingClientRect())&&a(),S=!1}try{r=new IntersectionObserver(A,{...E,root:s.ownerDocument})}catch{r=new IntersectionObserver(A,E)}r.observe(e)}return a(!0),i}function Su(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,f=ps(e),u=s||i?[...f?_r(f):[],..._r(t)]:[];u.forEach(C=>{s&&C.addEventListener("scroll",r,{passive:!0}),i&&C.addEventListener("resize",r)});const d=f&&o?Nu(f,r):null;let h=-1,v=null;a&&(v=new ResizeObserver(C=>{let[w]=C;w&&w.target===f&&v&&(v.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var E;(E=v)==null||E.observe(t)})),r()}),f&&!c&&v.observe(f),v.observe(t));let x,g=c?qt(e):null;c&&b();function b(){const C=qt(e);g&&!Fo(g,C)&&r(),g=C,x=requestAnimationFrame(b)}return r(),()=>{var C;u.forEach(w=>{s&&w.removeEventListener("scroll",r),i&&w.removeEventListener("resize",r)}),d==null||d(),(C=v)==null||C.disconnect(),v=null,c&&cancelAnimationFrame(x)}}const Eu=Gc,Au=Qc,Ou=Xc,ku=Zc,ni=(e,t,r)=>{const n=new Map,s={platform:Cu,...r},i={...s.platform,_c:n};return qc(e,t,{...s,platform:i})};var To={exports:{}};(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var i="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(i=s(i,n(o)))}return i}function n(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return r.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var o in i)t.call(i,o)&&i[o]&&(a=s(a,o));return a}function s(i,a){return a?i?i+" "+a:i+a:i}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(To);var Lu=To.exports;const Dn=es(Lu);const _u="react-tooltip-core-styles",Fu="react-tooltip-base-styles",si={core:!1,base:!1};function ii({css:e,id:t=Fu,type:r="base",ref:n}){var s,i;if(!e||typeof document>"u"||si[r]||r==="core"&&typeof process<"u"&&(!((s=process==null?void 0:process.env)===null||s===void 0)&&s.REACT_TOOLTIP_DISABLE_CORE_STYLES)||r!=="base"&&typeof process<"u"&&(!((i=process==null?void 0:process.env)===null||i===void 0)&&i.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;r==="core"&&(t=_u),n||(n={});const{insertAt:a}=n;if(document.getElementById(t))return;const o=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.id=t,c.type="text/css",a==="top"&&o.firstChild?o.insertBefore(c,o.firstChild):o.appendChild(c),c.styleSheet?c.styleSheet.cssText=e:c.appendChild(document.createTextNode(e)),si[r]=!0}const oi=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:r=null,place:n="top",offset:s=10,strategy:i="absolute",middlewares:a=[Eu(Number(s)),Ou({fallbackAxisSideDirection:"start"}),Au({padding:5})],border:o,arrowSize:c=8})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};const f=a;return r?(f.push(ku({element:r,padding:5})),ni(e,t,{placement:n,strategy:i,middleware:f}).then(({x:u,y:d,placement:h,middlewareData:v})=>{var x,g;const b={left:`${u}px`,top:`${d}px`,border:o},{x:C,y:w}=(x=v.arrow)!==null&&x!==void 0?x:{x:0,y:0},E=(g={top:"bottom",right:"left",bottom:"top",left:"right"}[h.split("-")[0]])!==null&&g!==void 0?g:"bottom",S=o&&{borderBottom:o,borderRight:o};let A=0;if(o){const O=`${o}`.match(/(\d+)px/);A=O!=null&&O[1]?Number(O[1]):1}return{tooltipStyles:b,tooltipArrowStyles:{left:C!=null?`${C}px`:"",top:w!=null?`${w}px`:"",right:"",bottom:"",...S,[E]:`-${c/2+A}px`},place:h}})):ni(e,t,{placement:"bottom",strategy:i,middleware:f}).then(({x:u,y:d,placement:h})=>({tooltipStyles:{left:`${u}px`,top:`${d}px`},tooltipArrowStyles:{},place:h}))},ai=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),li=(e,t,r)=>{let n=null;const s=function(...i){const a=()=>{n=null};!n&&(e.apply(this,i),n=setTimeout(a,t))};return s.cancel=()=>{n&&(clearTimeout(n),n=null)},s},ci=e=>e!==null&&!Array.isArray(e)&&typeof e=="object",Vn=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((s,i)=>Vn(s,t[i]));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!ci(e)||!ci(t))return e===t;const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(s=>Vn(e[s],t[s]))},Tu=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(r=>{const n=t.getPropertyValue(r);return n==="auto"||n==="scroll"})},ui=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(Tu(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},Ru=typeof window<"u"?p.useLayoutEffect:p.useEffect,Ke=e=>{e.current&&(clearTimeout(e.current),e.current=null)},Mu="DEFAULT_TOOLTIP_ID",Du={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},Vu=p.createContext({getTooltipData:()=>Du});function Ro(e=Mu){return p.useContext(Vu).getTooltipData(e)}var nr={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},On={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const Iu=({forwardRef:e,id:t,className:r,classNameArrow:n,variant:s="dark",anchorId:i,anchorSelect:a,place:o="top",offset:c=10,events:f=["hover"],openOnClick:u=!1,positionStrategy:d="absolute",middlewares:h,wrapper:v,delayShow:x=0,delayHide:g=0,float:b=!1,hidden:C=!1,noArrow:w=!1,clickable:E=!1,closeOnEsc:S=!1,closeOnScroll:A=!1,closeOnResize:O=!1,openEvents:k,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:W,style:_,position:F,afterShow:P,afterHide:H,disableTooltip:Y,content:J,contentWrapperRef:q,isOpen:G,defaultIsOpen:te=!1,setIsOpen:ue,activeAnchor:re,setActiveAnchor:fe,border:Le,opacity:De,arrowColor:Ne,arrowSize:_e=8,role:Je="tooltip"})=>{var Se;const ce=p.useRef(null),Ue=p.useRef(null),Ce=p.useRef(null),Ve=p.useRef(null),lt=p.useRef(null),[Ie,At]=p.useState({tooltipStyles:{},tooltipArrowStyles:{},place:o}),[be,bt]=p.useState(!1),[ct,qe]=p.useState(!1),[m,y]=p.useState(null),j=p.useRef(!1),R=p.useRef(null),{anchorRefs:T,setActiveAnchor:L}=Ro(t),B=p.useRef(!1),[K,Q]=p.useState([]),he=p.useRef(!1),rt=u||f.includes("click"),Ze=rt||(k==null?void 0:k.click)||(k==null?void 0:k.dblclick)||(k==null?void 0:k.mousedown),Ot=k?{...k}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!k&&rt&&Object.assign(Ot,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const nt=$?{...$}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!$&&rt&&Object.assign(nt,{mouseleave:!1,blur:!1,mouseout:!1});const Ae=I?{...I}:{escape:S||!1,scroll:A||!1,resize:O||!1,clickOutsideAnchor:Ze||!1};W&&(Object.assign(Ot,{mouseover:!1,focus:!1,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(nt,{mouseout:!1,blur:!1,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Ae,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),Ru(()=>(he.current=!0,()=>{he.current=!1}),[]);const de=D=>{he.current&&(D&&qe(!0),setTimeout(()=>{he.current&&(ue==null||ue(D),G===void 0&&bt(D))},10))};p.useEffect(()=>{if(G===void 0)return()=>null;G&&qe(!0);const D=setTimeout(()=>{bt(G)},10);return()=>{clearTimeout(D)}},[G]),p.useEffect(()=>{if(be!==j.current)if(Ke(lt),j.current=be,be)P==null||P();else{const D=(U=>{const Z=U.match(/^([\d.]+)(ms|s)$/);if(!Z)return 0;const[,xe,Ee]=Z;return Number(xe)*(Ee==="ms"?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));lt.current=setTimeout(()=>{qe(!1),y(null),H==null||H()},D+25)}},[be]);const Mt=D=>{At(U=>Vn(U,D)?U:D)},Dt=(D=x)=>{Ke(Ce),ct?de(!0):Ce.current=setTimeout(()=>{de(!0)},D)},wt=(D=g)=>{Ke(Ve),Ve.current=setTimeout(()=>{B.current||de(!1)},D)},yr=D=>{var U;if(!D)return;const Z=(U=D.currentTarget)!==null&&U!==void 0?U:D.target;if(!(Z!=null&&Z.isConnected))return fe(null),void L({current:null});x?Dt():de(!0),fe(Z),L({current:Z}),Ke(Ve)},Qt=()=>{E?wt(g||100):g?wt():de(!1),Ke(Ce)},er=({x:D,y:U})=>{var Z;const xe={getBoundingClientRect:()=>({x:D,y:U,width:0,height:0,top:U,left:D,right:D,bottom:U})};oi({place:(Z=m==null?void 0:m.place)!==null&&Z!==void 0?Z:o,offset:c,elementReference:xe,tooltipReference:ce.current,tooltipArrowReference:Ue.current,strategy:d,middlewares:h,border:Le,arrowSize:_e}).then(Ee=>{Mt(Ee)})},tr=D=>{if(!D)return;const U=D,Z={x:U.clientX,y:U.clientY};er(Z),R.current=Z},br=D=>{var U;if(!be)return;const Z=D.target;Z.isConnected&&(!((U=ce.current)===null||U===void 0)&&U.contains(Z)||[document.querySelector(`[id='${i}']`),...K].some(xe=>xe==null?void 0:xe.contains(Z))||(de(!1),Ke(Ce)))},Jr=li(yr,50),we=li(Qt,50),Xe=D=>{we.cancel(),Jr(D)},z=()=>{Jr.cancel(),we()},ee=p.useCallback(()=>{var D,U;const Z=(D=m==null?void 0:m.position)!==null&&D!==void 0?D:F;Z?er(Z):b?R.current&&er(R.current):re!=null&&re.isConnected&&oi({place:(U=m==null?void 0:m.place)!==null&&U!==void 0?U:o,offset:c,elementReference:re,tooltipReference:ce.current,tooltipArrowReference:Ue.current,strategy:d,middlewares:h,border:Le,arrowSize:_e}).then(xe=>{he.current&&Mt(xe)})},[be,re,J,_,o,m==null?void 0:m.place,c,d,F,m==null?void 0:m.position,b,_e]);p.useEffect(()=>{var D,U;const Z=new Set(T);K.forEach(ne=>{Y!=null&&Y(ne)||Z.add({current:ne})});const xe=document.querySelector(`[id='${i}']`);xe&&!(Y!=null&&Y(xe))&&Z.add({current:xe});const Ee=()=>{de(!1)},ut=ui(re),ft=ui(ce.current);Ae.scroll&&(window.addEventListener("scroll",Ee),ut==null||ut.addEventListener("scroll",Ee),ft==null||ft.addEventListener("scroll",Ee));let Oe=null;Ae.resize?window.addEventListener("resize",Ee):re&&ce.current&&(Oe=Su(re,ce.current,ee,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const Ye=ne=>{ne.key==="Escape"&&de(!1)};Ae.escape&&window.addEventListener("keydown",Ye),Ae.clickOutsideAnchor&&window.addEventListener("click",br);const ae=[],rr=ne=>!!(ne!=null&&ne.target&&(re!=null&&re.contains(ne.target))),xa=ne=>{be&&rr(ne)||yr(ne)},ya=ne=>{be&&rr(ne)&&Qt()},ks=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],Ls=["click","dblclick","mousedown","mouseup"];Object.entries(Ot).forEach(([ne,jt])=>{jt&&(ks.includes(ne)?ae.push({event:ne,listener:Xe}):Ls.includes(ne)&&ae.push({event:ne,listener:xa}))}),Object.entries(nt).forEach(([ne,jt])=>{jt&&(ks.includes(ne)?ae.push({event:ne,listener:z}):Ls.includes(ne)&&ae.push({event:ne,listener:ya}))}),b&&ae.push({event:"pointermove",listener:tr});const _s=()=>{B.current=!0},Fs=()=>{B.current=!1,Qt()},Ts=E&&(nt.mouseout||nt.mouseleave);return Ts&&((D=ce.current)===null||D===void 0||D.addEventListener("mouseover",_s),(U=ce.current)===null||U===void 0||U.addEventListener("mouseout",Fs)),ae.forEach(({event:ne,listener:jt})=>{Z.forEach(Nn=>{var wr;(wr=Nn.current)===null||wr===void 0||wr.addEventListener(ne,jt)})}),()=>{var ne,jt;Ae.scroll&&(window.removeEventListener("scroll",Ee),ut==null||ut.removeEventListener("scroll",Ee),ft==null||ft.removeEventListener("scroll",Ee)),Ae.resize?window.removeEventListener("resize",Ee):Oe==null||Oe(),Ae.clickOutsideAnchor&&window.removeEventListener("click",br),Ae.escape&&window.removeEventListener("keydown",Ye),Ts&&((ne=ce.current)===null||ne===void 0||ne.removeEventListener("mouseover",_s),(jt=ce.current)===null||jt===void 0||jt.removeEventListener("mouseout",Fs)),ae.forEach(({event:Nn,listener:wr})=>{Z.forEach(ba=>{var Sn;(Sn=ba.current)===null||Sn===void 0||Sn.removeEventListener(Nn,wr)})})}},[re,ee,ct,T,K,k,$,I,rt,x,g]),p.useEffect(()=>{var D,U;let Z=(U=(D=m==null?void 0:m.anchorSelect)!==null&&D!==void 0?D:a)!==null&&U!==void 0?U:"";!Z&&t&&(Z=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const xe=new MutationObserver(Ee=>{const ut=[],ft=[];Ee.forEach(Oe=>{if(Oe.type==="attributes"&&Oe.attributeName==="data-tooltip-id"&&(Oe.target.getAttribute("data-tooltip-id")===t?ut.push(Oe.target):Oe.oldValue===t&&ft.push(Oe.target)),Oe.type==="childList"){if(re){const Ye=[...Oe.removedNodes].filter(ae=>ae.nodeType===1);if(Z)try{ft.push(...Ye.filter(ae=>ae.matches(Z))),ft.push(...Ye.flatMap(ae=>[...ae.querySelectorAll(Z)]))}catch{}Ye.some(ae=>{var rr;return!!(!((rr=ae==null?void 0:ae.contains)===null||rr===void 0)&&rr.call(ae,re))&&(qe(!1),de(!1),fe(null),Ke(Ce),Ke(Ve),!0)})}if(Z)try{const Ye=[...Oe.addedNodes].filter(ae=>ae.nodeType===1);ut.push(...Ye.filter(ae=>ae.matches(Z))),ut.push(...Ye.flatMap(ae=>[...ae.querySelectorAll(Z)]))}catch{}}}),(ut.length||ft.length)&&Q(Oe=>[...Oe.filter(Ye=>!ft.includes(Ye)),...ut])});return xe.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{xe.disconnect()}},[t,a,m==null?void 0:m.anchorSelect,re]),p.useEffect(()=>{ee()},[ee]),p.useEffect(()=>{if(!(q!=null&&q.current))return()=>null;const D=new ResizeObserver(()=>{setTimeout(()=>ee())});return D.observe(q.current),()=>{D.disconnect()}},[J,q==null?void 0:q.current]),p.useEffect(()=>{var D;const U=document.querySelector(`[id='${i}']`),Z=[...K,U];re&&Z.includes(re)||fe((D=K[0])!==null&&D!==void 0?D:U)},[i,K,re]),p.useEffect(()=>(te&&de(!0),()=>{Ke(Ce),Ke(Ve)}),[]),p.useEffect(()=>{var D;let U=(D=m==null?void 0:m.anchorSelect)!==null&&D!==void 0?D:a;if(!U&&t&&(U=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),U)try{const Z=Array.from(document.querySelectorAll(U));Q(Z)}catch{Q([])}},[t,a,m==null?void 0:m.anchorSelect]),p.useEffect(()=>{Ce.current&&(Ke(Ce),Dt(x))},[x]);const Be=(Se=m==null?void 0:m.content)!==null&&Se!==void 0?Se:J,Vt=be&&Object.keys(Ie.tooltipStyles).length>0;return p.useImperativeHandle(e,()=>({open:D=>{if(D!=null&&D.anchorSelect)try{document.querySelector(D.anchorSelect)}catch{return void console.warn(`[react-tooltip] "${D.anchorSelect}" is not a valid CSS selector`)}y(D??null),D!=null&&D.delay?Dt(D.delay):de(!0)},close:D=>{D!=null&&D.delay?wt(D.delay):de(!1)},activeAnchor:re,place:Ie.place,isOpen:!!(ct&&!C&&Be&&Vt)})),ct&&!C&&Be?p.createElement(v,{id:t,role:Je,className:Dn("react-tooltip",nr.tooltip,On.tooltip,On[s],r,`react-tooltip__place-${Ie.place}`,nr[Vt?"show":"closing"],Vt?"react-tooltip__show":"react-tooltip__closing",d==="fixed"&&nr.fixed,E&&nr.clickable),onTransitionEnd:D=>{Ke(lt),be||D.propertyName!=="opacity"||(qe(!1),y(null),H==null||H())},style:{..._,...Ie.tooltipStyles,opacity:De!==void 0&&Vt?De:void 0},ref:ce},Be,p.createElement(v,{className:Dn("react-tooltip-arrow",nr.arrow,On.arrow,n,w&&nr.noArrow),style:{...Ie.tooltipArrowStyles,background:Ne?`linear-gradient(to right bottom, transparent 50%, ${Ne} 50%)`:void 0,"--rt-arrow-size":`${_e}px`},ref:Ue})):null},Bu=({content:e})=>p.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),fi=p.forwardRef(({id:e,anchorId:t,anchorSelect:r,content:n,html:s,render:i,className:a,classNameArrow:o,variant:c="dark",place:f="top",offset:u=10,wrapper:d="div",children:h=null,events:v=["hover"],openOnClick:x=!1,positionStrategy:g="absolute",middlewares:b,delayShow:C=0,delayHide:w=0,float:E=!1,hidden:S=!1,noArrow:A=!1,clickable:O=!1,closeOnEsc:k=!1,closeOnScroll:$=!1,closeOnResize:I=!1,openEvents:W,closeEvents:_,globalCloseEvents:F,imperativeModeOnly:P=!1,style:H,position:Y,isOpen:J,defaultIsOpen:q=!1,disableStyleInjection:G=!1,border:te,opacity:ue,arrowColor:re,arrowSize:fe,setIsOpen:Le,afterShow:De,afterHide:Ne,disableTooltip:_e,role:Je="tooltip"},Se)=>{const[ce,Ue]=p.useState(n),[Ce,Ve]=p.useState(s),[lt,Ie]=p.useState(f),[At,be]=p.useState(c),[bt,ct]=p.useState(u),[qe,m]=p.useState(C),[y,j]=p.useState(w),[R,T]=p.useState(E),[L,B]=p.useState(S),[K,Q]=p.useState(d),[he,rt]=p.useState(v),[Ze,Ot]=p.useState(g),[nt,Ae]=p.useState(null),[de,Mt]=p.useState(null),Dt=p.useRef(G),{anchorRefs:wt,activeAnchor:yr}=Ro(e),Qt=we=>we==null?void 0:we.getAttributeNames().reduce((Xe,z)=>{var ee;return z.startsWith("data-tooltip-")&&(Xe[z.replace(/^data-tooltip-/,"")]=(ee=we==null?void 0:we.getAttribute(z))!==null&&ee!==void 0?ee:null),Xe},{}),er=we=>{const Xe={place:z=>{var ee;Ie((ee=z)!==null&&ee!==void 0?ee:f)},content:z=>{Ue(z??n)},html:z=>{Ve(z??s)},variant:z=>{var ee;be((ee=z)!==null&&ee!==void 0?ee:c)},offset:z=>{ct(z===null?u:Number(z))},wrapper:z=>{var ee;Q((ee=z)!==null&&ee!==void 0?ee:d)},events:z=>{const ee=z==null?void 0:z.split(" ");rt(ee??v)},"position-strategy":z=>{var ee;Ot((ee=z)!==null&&ee!==void 0?ee:g)},"delay-show":z=>{m(z===null?C:Number(z))},"delay-hide":z=>{j(z===null?w:Number(z))},float:z=>{T(z===null?E:z==="true")},hidden:z=>{B(z===null?S:z==="true")},"class-name":z=>{Ae(z)}};Object.values(Xe).forEach(z=>z(null)),Object.entries(we).forEach(([z,ee])=>{var Be;(Be=Xe[z])===null||Be===void 0||Be.call(Xe,ee)})};p.useEffect(()=>{Ue(n)},[n]),p.useEffect(()=>{Ve(s)},[s]),p.useEffect(()=>{Ie(f)},[f]),p.useEffect(()=>{be(c)},[c]),p.useEffect(()=>{ct(u)},[u]),p.useEffect(()=>{m(C)},[C]),p.useEffect(()=>{j(w)},[w]),p.useEffect(()=>{T(E)},[E]),p.useEffect(()=>{B(S)},[S]),p.useEffect(()=>{Ot(g)},[g]),p.useEffect(()=>{Dt.current!==G&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[G]),p.useEffect(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:G==="core",disableBase:G}}))},[]),p.useEffect(()=>{var we;const Xe=new Set(wt);let z=r;if(!z&&e&&(z=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),z)try{document.querySelectorAll(z).forEach(U=>{Xe.add({current:U})})}catch{console.warn(`[react-tooltip] "${z}" is not a valid CSS selector`)}const ee=document.querySelector(`[id='${t}']`);if(ee&&Xe.add({current:ee}),!Xe.size)return()=>null;const Be=(we=de??ee)!==null&&we!==void 0?we:yr.current,Vt=new MutationObserver(U=>{U.forEach(Z=>{var xe;if(!Be||Z.type!=="attributes"||!(!((xe=Z.attributeName)===null||xe===void 0)&&xe.startsWith("data-tooltip-")))return;const Ee=Qt(Be);er(Ee)})}),D={attributes:!0,childList:!1,subtree:!1};if(Be){const U=Qt(Be);er(U),Vt.observe(Be,D)}return()=>{Vt.disconnect()}},[wt,yr,de,t,r]),p.useEffect(()=>{H!=null&&H.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),te&&!ai("border",`${te}`)&&console.warn(`[react-tooltip] "${te}" is not a valid \`border\`.`),H!=null&&H.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),ue&&!ai("opacity",`${ue}`)&&console.warn(`[react-tooltip] "${ue}" is not a valid \`opacity\`.`)},[]);let tr=h;const br=p.useRef(null);if(i){const we=i({content:(de==null?void 0:de.getAttribute("data-tooltip-content"))||ce||null,activeAnchor:de});tr=we?p.createElement("div",{ref:br,className:"react-tooltip-content-wrapper"},we):null}else ce&&(tr=ce);Ce&&(tr=p.createElement(Bu,{content:Ce}));const Jr={forwardRef:Se,id:e,anchorId:t,anchorSelect:r,className:Dn(a,nt),classNameArrow:o,content:tr,contentWrapperRef:br,place:lt,variant:At,offset:bt,wrapper:K,events:he,openOnClick:x,positionStrategy:Ze,middlewares:b,delayShow:qe,delayHide:y,float:R,hidden:L,noArrow:A,clickable:O,closeOnEsc:k,closeOnScroll:$,closeOnResize:I,openEvents:W,closeEvents:_,globalCloseEvents:F,imperativeModeOnly:P,style:H,position:Y,isOpen:J,defaultIsOpen:q,border:te,opacity:ue,arrowColor:re,arrowSize:fe,setIsOpen:Le,afterShow:De,afterHide:Ne,disableTooltip:_e,activeAnchor:de,setActiveAnchor:we=>Mt(we),role:Je};return p.createElement(Iu,{...Jr})});typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||ii({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||ii({css:`
2
+ .styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:var(--rt-arrow-size);height:var(--rt-arrow-size)}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})});const Pu={default:"text-accent-primary",warning:"text-warning-main",error:"text-error-main"},$u={default:"text-secondary-strokeDark",warning:"text-warning-main",error:"text-error-main"};function In({children:e,tooltip:t,status:r="default",attachToChildren:n=!1,icon:s,className:i,placement:a="top",tooltipVariant:o="primary",offset:c=[8,8]}){const f=p.useId(),u=Pu[r],d={name:"customOffset",fn:({x,y:g,placement:b})=>{let C=x,w=g;return b==="top"?w=g-c[1]:b==="bottom"?w=g+c[1]:b==="left"?C=x-c[0]:b==="right"&&(C=x+c[0]),{x:C,y:w}}};if(!t)return n?l.jsx("span",{className:N.twJoin("inline-flex items-center gap-1",u,i),children:e}):l.jsx("div",{className:N.twJoin("inline-flex items-center gap-1",u,i),children:e});const h=l.jsx(ss,{size:16,className:$u[r]}),v=s||h;return n?l.jsxs("span",{className:N.twJoin("inline-flex items-center gap-1",u,i),children:[l.jsx("span",{className:"cursor-pointer","data-tooltip-id":f,"data-tooltip-content":typeof t=="string"?t:void 0,"data-tooltip-place":a,"data-tooltip-position-strategy":"fixed","data-tooltip-wrapper":"span",children:e}),l.jsx(fi,{id:f,className:N.twJoin("react-tooltip",o==="secondary"&&"react-tooltip--secondary"),openOnClick:!1,clickable:!0,place:a,style:{zIndex:99999},positionStrategy:"fixed",middlewares:[d],offset:0,children:typeof t!="string"&&t})]}):l.jsxs("div",{className:N.twJoin("inline-flex items-center gap-1",u,i),children:[e,l.jsx("span",{className:N.twJoin("cursor-pointer inline-flex items-center",u),"data-tooltip-id":f,"data-tooltip-content":typeof t=="string"?t:void 0,"data-tooltip-place":a,"data-tooltip-position-strategy":"fixed","data-tooltip-wrapper":"span",children:v}),l.jsx(fi,{id:f,className:N.twJoin("react-tooltip",o==="secondary"&&"react-tooltip--secondary"),openOnClick:!1,clickable:!0,place:a,style:{zIndex:99999},positionStrategy:"fixed",middlewares:[d],offset:0,children:typeof t!="string"&&t})]})}var zr=e=>e.type==="checkbox",Pt=e=>e instanceof Date,ke=e=>e==null;const Mo=e=>typeof e=="object";var pe=e=>!ke(e)&&!Array.isArray(e)&&Mo(e)&&!Pt(e),Do=e=>pe(e)&&e.target?zr(e.target)?e.target.checked:e.target.value:e,Hu=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Vo=(e,t)=>e.has(Hu(t)),Wu=e=>{const t=e.constructor&&e.constructor.prototype;return pe(t)&&t.hasOwnProperty("isPrototypeOf")},hs=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ye(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(hs&&(e instanceof Blob||n))&&(r||pe(e)))if(t=r?[]:{},!r&&!Wu(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=ye(e[s]));else return e;return t}var jn=e=>/^\w*$/.test(e),me=e=>e===void 0,vs=e=>Array.isArray(e)?e.filter(Boolean):[],gs=e=>vs(e.replace(/["|']|\]/g,"").split(/\.|\[/)),M=(e,t,r)=>{if(!t||!pe(e))return r;const n=(jn(t)?[t]:gs(t)).reduce((s,i)=>ke(s)?s:s[i],e);return me(n)||n===e?me(e[t])?r:e[t]:n},Pe=e=>typeof e=="boolean",se=(e,t,r)=>{let n=-1;const s=jn(t)?[t]:gs(t),i=s.length,a=i-1;for(;++n<i;){const o=s[n];let c=r;if(n!==a){const f=e[o];c=pe(f)||Array.isArray(f)?f:isNaN(+s[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;e[o]=c,e=e[o]}};const an={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},st={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ct={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},xs=p.createContext(null);xs.displayName="HookFormContext";const Kt=()=>p.useContext(xs),zu=e=>{const{children:t,...r}=e;return p.createElement(xs.Provider,{value:r},t)};var Io=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const a=i;return t._proxyFormState[a]!==st.all&&(t._proxyFormState[a]=!n||st.all),r&&(r[a]=!0),e[a]}});return s};const ys=typeof window<"u"?p.useLayoutEffect:p.useEffect;function bs(e){const t=Kt(),{control:r=t.control,disabled:n,name:s,exact:i}=e||{},[a,o]=p.useState(r._formState),c=p.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ys(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:f=>{!n&&o({...r._formState,...f})}}),[s,n,i]),p.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),p.useMemo(()=>Io(a,r,c.current,!1),[a,r])}var dt=e=>typeof e=="string",Bo=(e,t,r,n,s)=>dt(e)?(n&&t.watch.add(e),M(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),M(r,i))):(n&&(t.watchAll=!0),r),Bn=e=>ke(e)||!Mo(e);function Nt(e,t,r=new WeakSet){if(Bn(e)||Bn(t))return e===t;if(Pt(e)&&Pt(t))return e.getTime()===t.getTime();const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const a=e[i];if(!s.includes(i))return!1;if(i!=="ref"){const o=t[i];if(Pt(a)&&Pt(o)||pe(a)&&pe(o)||Array.isArray(a)&&Array.isArray(o)?!Nt(a,o,r):a!==o)return!1}}return!0}function ws(e){const t=Kt(),{control:r=t.control,name:n,defaultValue:s,disabled:i,exact:a,compute:o}=e||{},c=p.useRef(s),f=p.useRef(o),u=p.useRef(void 0);f.current=o;const d=p.useMemo(()=>r._getWatch(n,c.current),[r,n]),[h,v]=p.useState(f.current?f.current(d):d);return ys(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:x=>{if(!i){const g=Bo(n,r._names,x.values||r._formValues,!1,c.current);if(f.current){const b=f.current(g);Nt(b,u.current)||(v(b),u.current=b)}else v(g)}}}),[r,i,n,a]),p.useEffect(()=>r._removeUnmounted()),h}function Ju(e){const t=Kt(),{name:r,disabled:n,control:s=t.control,shouldUnregister:i,defaultValue:a}=e,o=Vo(s._names.array,r),c=p.useMemo(()=>M(s._formValues,r,M(s._defaultValues,r,a)),[s,r,a]),f=ws({control:s,name:r,defaultValue:c,exact:!0}),u=bs({control:s,name:r,exact:!0}),d=p.useRef(e),h=p.useRef(s.register(r,{...e.rules,value:f,...Pe(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;const v=p.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!M(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!M(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!M(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!M(u.validatingFields,r)},error:{enumerable:!0,get:()=>M(u.errors,r)}}),[u,r]),x=p.useCallback(w=>h.current.onChange({target:{value:Do(w),name:r},type:an.CHANGE}),[r]),g=p.useCallback(()=>h.current.onBlur({target:{value:M(s._formValues,r),name:r},type:an.BLUR}),[r,s._formValues]),b=p.useCallback(w=>{const E=M(s._fields,r);E&&w&&(E._f.ref={focus:()=>w.focus&&w.focus(),select:()=>w.select&&w.select(),setCustomValidity:S=>w.setCustomValidity(S),reportValidity:()=>w.reportValidity()})},[s._fields,r]),C=p.useMemo(()=>({name:r,value:f,...Pe(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:x,onBlur:g,ref:b}),[r,n,u.disabled,x,g,b,f]);return p.useEffect(()=>{const w=s._options.shouldUnregister||i;s.register(r,{...d.current.rules,...Pe(d.current.disabled)?{disabled:d.current.disabled}:{}});const E=(S,A)=>{const O=M(s._fields,S);O&&O._f&&(O._f.mount=A)};if(E(r,!0),w){const S=ye(M(s._options.defaultValues,r));se(s._defaultValues,r,S),me(M(s._formValues,r))&&se(s._formValues,r,S)}return!o&&s.register(r),()=>{(o?w&&!s._state.action:w)?s.unregister(r):E(r,!1)}},[r,s,o,i]),p.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),p.useMemo(()=>({field:C,formState:u,fieldState:v}),[C,u,v])}var Po=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Ar=e=>Array.isArray(e)?e:[e],di=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}},Fe=e=>pe(e)&&!Object.keys(e).length,js=e=>e.type==="file",it=e=>typeof e=="function",ln=e=>{if(!hs)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},$o=e=>e.type==="select-multiple",Cs=e=>e.type==="radio",Uu=e=>Cs(e)||zr(e),kn=e=>ln(e)&&e.isConnected;function qu(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=me(e)?n++:e[t[n++]];return e}function Zu(e){for(const t in e)if(e.hasOwnProperty(t)&&!me(e[t]))return!1;return!0}function ve(e,t){const r=Array.isArray(t)?t:jn(t)?[t]:gs(t),n=r.length===1?e:qu(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(pe(n)&&Fe(n)||Array.isArray(n)&&Zu(n))&&ve(e,r.slice(0,-1)),e}var Ho=e=>{for(const t in e)if(it(e[t]))return!0;return!1};function cn(e,t={}){const r=Array.isArray(e);if(pe(e)||r)for(const n in e)Array.isArray(e[n])||pe(e[n])&&!Ho(e[n])?(t[n]=Array.isArray(e[n])?[]:{},cn(e[n],t[n])):ke(e[n])||(t[n]=!0);return t}function Wo(e,t,r){const n=Array.isArray(e);if(pe(e)||n)for(const s in e)Array.isArray(e[s])||pe(e[s])&&!Ho(e[s])?me(t)||Bn(r[s])?r[s]=Array.isArray(e[s])?cn(e[s],[]):{...cn(e[s])}:Wo(e[s],ke(t)?{}:t[s],r[s]):r[s]=!Nt(e[s],t[s]);return r}var Cr=(e,t)=>Wo(e,t,cn(t));const mi={value:!1,isValid:!1},pi={value:!0,isValid:!0};var zo=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!me(e[0].attributes.value)?me(e[0].value)||e[0].value===""?pi:{value:e[0].value,isValid:!0}:pi:mi}return mi},Jo=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>me(e)?e:t?e===""?NaN:e&&+e:r&&dt(e)?new Date(e):n?n(e):e;const hi={isValid:!1,value:null};var Uo=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,hi):hi;function vi(e){const t=e.ref;return js(t)?t.files:Cs(t)?Uo(e.refs).value:$o(t)?[...t.selectedOptions].map(({value:r})=>r):zr(t)?zo(e.refs).value:Jo(me(t.value)?e.ref.value:t.value,e)}var Xu=(e,t,r,n)=>{const s={};for(const i of e){const a=M(t,i);a&&se(s,i,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},un=e=>e instanceof RegExp,Nr=e=>me(e)?e:un(e)?e.source:pe(e)?un(e.value)?e.value.source:e.value:e,gi=e=>({isOnSubmit:!e||e===st.onSubmit,isOnBlur:e===st.onBlur,isOnChange:e===st.onChange,isOnAll:e===st.all,isOnTouch:e===st.onTouched});const xi="AsyncFunction";var Yu=e=>!!e&&!!e.validate&&!!(it(e.validate)&&e.validate.constructor.name===xi||pe(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===xi)),Ku=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),yi=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Or=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=M(e,s);if(i){const{_f:a,...o}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(Or(o,t))break}else if(pe(o)&&Or(o,t))break}}};function bi(e,t,r){const n=M(e,r);if(n||jn(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),a=M(t,i),o=M(e,i);if(a&&!Array.isArray(a)&&r!==i)return{name:r};if(o&&o.type)return{name:i,error:o};if(o&&o.root&&o.root.type)return{name:`${i}.root`,error:o.root};s.pop()}return{name:r}}var Gu=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return Fe(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!n||st.all))},Qu=(e,t,r)=>!e||!t||e===t||Ar(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),ef=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,tf=(e,t)=>!vs(M(e,t)).length&&ve(e,t),rf=(e,t,r)=>{const n=Ar(M(e,r));return se(n,"root",t[r]),se(e,r,n),e},Gr=e=>dt(e);function wi(e,t,r="validate"){if(Gr(e)||Array.isArray(e)&&e.every(Gr)||Pe(e)&&!e)return{type:r,message:Gr(e)?e:"",ref:t}}var sr=e=>pe(e)&&!un(e)?e:{value:e,message:""},ji=async(e,t,r,n,s,i)=>{const{ref:a,refs:o,required:c,maxLength:f,minLength:u,min:d,max:h,pattern:v,validate:x,name:g,valueAsNumber:b,mount:C}=e._f,w=M(r,g);if(!C||t.has(g))return{};const E=o?o[0]:a,S=F=>{s&&E.reportValidity&&(E.setCustomValidity(Pe(F)?"":F||""),E.reportValidity())},A={},O=Cs(a),k=zr(a),$=O||k,I=(b||js(a))&&me(a.value)&&me(w)||ln(a)&&a.value===""||w===""||Array.isArray(w)&&!w.length,W=Po.bind(null,g,n,A),_=(F,P,H,Y=Ct.maxLength,J=Ct.minLength)=>{const q=F?P:H;A[g]={type:F?Y:J,message:q,ref:a,...W(F?Y:J,q)}};if(i?!Array.isArray(w)||!w.length:c&&(!$&&(I||ke(w))||Pe(w)&&!w||k&&!zo(o).isValid||O&&!Uo(o).isValid)){const{value:F,message:P}=Gr(c)?{value:!!c,message:c}:sr(c);if(F&&(A[g]={type:Ct.required,message:P,ref:E,...W(Ct.required,P)},!n))return S(P),A}if(!I&&(!ke(d)||!ke(h))){let F,P;const H=sr(h),Y=sr(d);if(!ke(w)&&!isNaN(w)){const J=a.valueAsNumber||w&&+w;ke(H.value)||(F=J>H.value),ke(Y.value)||(P=J<Y.value)}else{const J=a.valueAsDate||new Date(w),q=ue=>new Date(new Date().toDateString()+" "+ue),G=a.type=="time",te=a.type=="week";dt(H.value)&&w&&(F=G?q(w)>q(H.value):te?w>H.value:J>new Date(H.value)),dt(Y.value)&&w&&(P=G?q(w)<q(Y.value):te?w<Y.value:J<new Date(Y.value))}if((F||P)&&(_(!!F,H.message,Y.message,Ct.max,Ct.min),!n))return S(A[g].message),A}if((f||u)&&!I&&(dt(w)||i&&Array.isArray(w))){const F=sr(f),P=sr(u),H=!ke(F.value)&&w.length>+F.value,Y=!ke(P.value)&&w.length<+P.value;if((H||Y)&&(_(H,F.message,P.message),!n))return S(A[g].message),A}if(v&&!I&&dt(w)){const{value:F,message:P}=sr(v);if(un(F)&&!w.match(F)&&(A[g]={type:Ct.pattern,message:P,ref:a,...W(Ct.pattern,P)},!n))return S(P),A}if(x){if(it(x)){const F=await x(w,r),P=wi(F,E);if(P&&(A[g]={...P,...W(Ct.validate,P.message)},!n))return S(P.message),A}else if(pe(x)){let F={};for(const P in x){if(!Fe(F)&&!n)break;const H=wi(await x[P](w,r),E,P);H&&(F={...H,...W(P,H.message)},S(H.message),n&&(A[g]=F))}if(!Fe(F)&&(A[g]={ref:E,...F},!n))return A}}return S(!0),A};const nf={mode:st.onSubmit,reValidateMode:st.onChange,shouldFocusError:!0};function sf(e={}){let t={...nf,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:it(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=pe(t.defaultValues)||pe(t.values)?ye(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:ye(s),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,f=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const h={array:di(),state:di()},v=t.criteriaMode===st.all,x=m=>y=>{clearTimeout(f),f=setTimeout(m,y)},g=async m=>{if(!t.disabled&&(u.isValid||d.isValid||m)){const y=t.resolver?Fe((await k()).errors):await I(n,!0);y!==r.isValid&&h.state.next({isValid:y})}},b=(m,y)=>{!t.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((m||Array.from(o.mount)).forEach(j=>{j&&(y?se(r.validatingFields,j,y):ve(r.validatingFields,j))}),h.state.next({validatingFields:r.validatingFields,isValidating:!Fe(r.validatingFields)}))},C=(m,y=[],j,R,T=!0,L=!0)=>{if(R&&j&&!t.disabled){if(a.action=!0,L&&Array.isArray(M(n,m))){const B=j(M(n,m),R.argA,R.argB);T&&se(n,m,B)}if(L&&Array.isArray(M(r.errors,m))){const B=j(M(r.errors,m),R.argA,R.argB);T&&se(r.errors,m,B),tf(r.errors,m)}if((u.touchedFields||d.touchedFields)&&L&&Array.isArray(M(r.touchedFields,m))){const B=j(M(r.touchedFields,m),R.argA,R.argB);T&&se(r.touchedFields,m,B)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=Cr(s,i)),h.state.next({name:m,isDirty:_(m,y),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else se(i,m,y)},w=(m,y)=>{se(r.errors,m,y),h.state.next({errors:r.errors})},E=m=>{r.errors=m,h.state.next({errors:r.errors,isValid:!1})},S=(m,y,j,R)=>{const T=M(n,m);if(T){const L=M(i,m,me(j)?M(s,m):j);me(L)||R&&R.defaultChecked||y?se(i,m,y?L:vi(T._f)):H(m,L),a.mount&&g()}},A=(m,y,j,R,T)=>{let L=!1,B=!1;const K={name:m};if(!t.disabled){if(!j||R){(u.isDirty||d.isDirty)&&(B=r.isDirty,r.isDirty=K.isDirty=_(),L=B!==K.isDirty);const Q=Nt(M(s,m),y);B=!!M(r.dirtyFields,m),Q?ve(r.dirtyFields,m):se(r.dirtyFields,m,!0),K.dirtyFields=r.dirtyFields,L=L||(u.dirtyFields||d.dirtyFields)&&B!==!Q}if(j){const Q=M(r.touchedFields,m);Q||(se(r.touchedFields,m,j),K.touchedFields=r.touchedFields,L=L||(u.touchedFields||d.touchedFields)&&Q!==j)}L&&T&&h.state.next(K)}return L?K:{}},O=(m,y,j,R)=>{const T=M(r.errors,m),L=(u.isValid||d.isValid)&&Pe(y)&&r.isValid!==y;if(t.delayError&&j?(c=x(()=>w(m,j)),c(t.delayError)):(clearTimeout(f),c=null,j?se(r.errors,m,j):ve(r.errors,m)),(j?!Nt(T,j):T)||!Fe(R)||L){const B={...R,...L&&Pe(y)?{isValid:y}:{},errors:r.errors,name:m};r={...r,...B},h.state.next(B)}},k=async m=>{b(m,!0);const y=await t.resolver(i,t.context,Xu(m||o.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return b(m),y},$=async m=>{const{errors:y}=await k(m);if(m)for(const j of m){const R=M(y,j);R?se(r.errors,j,R):ve(r.errors,j)}else r.errors=y;return y},I=async(m,y,j={valid:!0})=>{for(const R in m){const T=m[R];if(T){const{_f:L,...B}=T;if(L){const K=o.array.has(L.name),Q=T._f&&Yu(T._f);Q&&u.validatingFields&&b([R],!0);const he=await ji(T,o.disabled,i,v,t.shouldUseNativeValidation&&!y,K);if(Q&&u.validatingFields&&b([R]),he[L.name]&&(j.valid=!1,y))break;!y&&(M(he,L.name)?K?rf(r.errors,he,L.name):se(r.errors,L.name,he[L.name]):ve(r.errors,L.name))}!Fe(B)&&await I(B,y,j)}}return j.valid},W=()=>{for(const m of o.unMount){const y=M(n,m);y&&(y._f.refs?y._f.refs.every(j=>!kn(j)):!kn(y._f.ref))&&Je(m)}o.unMount=new Set},_=(m,y)=>!t.disabled&&(m&&y&&se(i,m,y),!Nt(ue(),s)),F=(m,y,j)=>Bo(m,o,{...a.mount?i:me(y)?s:dt(m)?{[m]:y}:y},j,y),P=m=>vs(M(a.mount?i:s,m,t.shouldUnregister?M(s,m,[]):[])),H=(m,y,j={})=>{const R=M(n,m);let T=y;if(R){const L=R._f;L&&(!L.disabled&&se(i,m,Jo(y,L)),T=ln(L.ref)&&ke(y)?"":y,$o(L.ref)?[...L.ref.options].forEach(B=>B.selected=T.includes(B.value)):L.refs?zr(L.ref)?L.refs.forEach(B=>{(!B.defaultChecked||!B.disabled)&&(Array.isArray(T)?B.checked=!!T.find(K=>K===B.value):B.checked=T===B.value||!!T)}):L.refs.forEach(B=>B.checked=B.value===T):js(L.ref)?L.ref.value="":(L.ref.value=T,L.ref.type||h.state.next({name:m,values:ye(i)})))}(j.shouldDirty||j.shouldTouch)&&A(m,T,j.shouldTouch,j.shouldDirty,!0),j.shouldValidate&&te(m)},Y=(m,y,j)=>{for(const R in y){if(!y.hasOwnProperty(R))return;const T=y[R],L=m+"."+R,B=M(n,L);(o.array.has(m)||pe(T)||B&&!B._f)&&!Pt(T)?Y(L,T,j):H(L,T,j)}},J=(m,y,j={})=>{const R=M(n,m),T=o.array.has(m),L=ye(y);se(i,m,L),T?(h.array.next({name:m,values:ye(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&j.shouldDirty&&h.state.next({name:m,dirtyFields:Cr(s,i),isDirty:_(m,L)})):R&&!R._f&&!ke(L)?Y(m,L,j):H(m,L,j),yi(m,o)&&h.state.next({...r,name:m}),h.state.next({name:a.mount?m:void 0,values:ye(i)})},q=async m=>{a.mount=!0;const y=m.target;let j=y.name,R=!0;const T=M(n,j),L=Q=>{R=Number.isNaN(Q)||Pt(Q)&&isNaN(Q.getTime())||Nt(Q,M(i,j,Q))},B=gi(t.mode),K=gi(t.reValidateMode);if(T){let Q,he;const rt=y.type?vi(T._f):Do(m),Ze=m.type===an.BLUR||m.type===an.FOCUS_OUT,Ot=!Ku(T._f)&&!t.resolver&&!M(r.errors,j)&&!T._f.deps||ef(Ze,M(r.touchedFields,j),r.isSubmitted,K,B),nt=yi(j,o,Ze);se(i,j,rt),Ze?(T._f.onBlur&&T._f.onBlur(m),c&&c(0)):T._f.onChange&&T._f.onChange(m);const Ae=A(j,rt,Ze),de=!Fe(Ae)||nt;if(!Ze&&h.state.next({name:j,type:m.type,values:ye(i)}),Ot)return(u.isValid||d.isValid)&&(t.mode==="onBlur"?Ze&&g():Ze||g()),de&&h.state.next({name:j,...nt?{}:Ae});if(!Ze&&nt&&h.state.next({...r}),t.resolver){const{errors:Mt}=await k([j]);if(L(rt),R){const Dt=bi(r.errors,n,j),wt=bi(Mt,n,Dt.name||j);Q=wt.error,j=wt.name,he=Fe(Mt)}}else b([j],!0),Q=(await ji(T,o.disabled,i,v,t.shouldUseNativeValidation))[j],b([j]),L(rt),R&&(Q?he=!1:(u.isValid||d.isValid)&&(he=await I(n,!0)));R&&(T._f.deps&&te(T._f.deps),O(j,he,Q,Ae))}},G=(m,y)=>{if(M(r.errors,y)&&m.focus)return m.focus(),1},te=async(m,y={})=>{let j,R;const T=Ar(m);if(t.resolver){const L=await $(me(m)?m:T);j=Fe(L),R=m?!T.some(B=>M(L,B)):j}else m?(R=(await Promise.all(T.map(async L=>{const B=M(n,L);return await I(B&&B._f?{[L]:B}:B)}))).every(Boolean),!(!R&&!r.isValid)&&g()):R=j=await I(n);return h.state.next({...!dt(m)||(u.isValid||d.isValid)&&j!==r.isValid?{}:{name:m},...t.resolver||!m?{isValid:j}:{},errors:r.errors}),y.shouldFocus&&!R&&Or(n,G,m?T:o.mount),R},ue=m=>{const y={...a.mount?i:s};return me(m)?y:dt(m)?M(y,m):m.map(j=>M(y,j))},re=(m,y)=>({invalid:!!M((y||r).errors,m),isDirty:!!M((y||r).dirtyFields,m),error:M((y||r).errors,m),isValidating:!!M(r.validatingFields,m),isTouched:!!M((y||r).touchedFields,m)}),fe=m=>{m&&Ar(m).forEach(y=>ve(r.errors,y)),h.state.next({errors:m?r.errors:{}})},Le=(m,y,j)=>{const R=(M(n,m,{_f:{}})._f||{}).ref,T=M(r.errors,m)||{},{ref:L,message:B,type:K,...Q}=T;se(r.errors,m,{...Q,...y,ref:R}),h.state.next({name:m,errors:r.errors,isValid:!1}),j&&j.shouldFocus&&R&&R.focus&&R.focus()},De=(m,y)=>it(m)?h.state.subscribe({next:j=>"values"in j&&m(F(void 0,y),j)}):F(m,y,!0),Ne=m=>h.state.subscribe({next:y=>{Qu(m.name,y.name,m.exact)&&Gu(y,m.formState||u,bt,m.reRenderRoot)&&m.callback({values:{...i},...r,...y,defaultValues:s})}}).unsubscribe,_e=m=>(a.mount=!0,d={...d,...m.formState},Ne({...m,formState:d})),Je=(m,y={})=>{for(const j of m?Ar(m):o.mount)o.mount.delete(j),o.array.delete(j),y.keepValue||(ve(n,j),ve(i,j)),!y.keepError&&ve(r.errors,j),!y.keepDirty&&ve(r.dirtyFields,j),!y.keepTouched&&ve(r.touchedFields,j),!y.keepIsValidating&&ve(r.validatingFields,j),!t.shouldUnregister&&!y.keepDefaultValue&&ve(s,j);h.state.next({values:ye(i)}),h.state.next({...r,...y.keepDirty?{isDirty:_()}:{}}),!y.keepIsValid&&g()},Se=({disabled:m,name:y})=>{(Pe(m)&&a.mount||m||o.disabled.has(y))&&(m?o.disabled.add(y):o.disabled.delete(y))},ce=(m,y={})=>{let j=M(n,m);const R=Pe(y.disabled)||Pe(t.disabled);return se(n,m,{...j||{},_f:{...j&&j._f?j._f:{ref:{name:m}},name:m,mount:!0,...y}}),o.mount.add(m),j?Se({disabled:Pe(y.disabled)?y.disabled:t.disabled,name:m}):S(m,!0,y.value),{...R?{disabled:y.disabled||t.disabled}:{},...t.progressive?{required:!!y.required,min:Nr(y.min),max:Nr(y.max),minLength:Nr(y.minLength),maxLength:Nr(y.maxLength),pattern:Nr(y.pattern)}:{},name:m,onChange:q,onBlur:q,ref:T=>{if(T){ce(m,y),j=M(n,m);const L=me(T.value)&&T.querySelectorAll&&T.querySelectorAll("input,select,textarea")[0]||T,B=Uu(L),K=j._f.refs||[];if(B?K.find(Q=>Q===L):L===j._f.ref)return;se(n,m,{_f:{...j._f,...B?{refs:[...K.filter(kn),L,...Array.isArray(M(s,m))?[{}]:[]],ref:{type:L.type,name:m}}:{ref:L}}}),S(m,!1,void 0,L)}else j=M(n,m,{}),j._f&&(j._f.mount=!1),(t.shouldUnregister||y.shouldUnregister)&&!(Vo(o.array,m)&&a.action)&&o.unMount.add(m)}}},Ue=()=>t.shouldFocusError&&Or(n,G,o.mount),Ce=m=>{Pe(m)&&(h.state.next({disabled:m}),Or(n,(y,j)=>{const R=M(n,j);R&&(y.disabled=R._f.disabled||m,Array.isArray(R._f.refs)&&R._f.refs.forEach(T=>{T.disabled=R._f.disabled||m}))},0,!1))},Ve=(m,y)=>async j=>{let R;j&&(j.preventDefault&&j.preventDefault(),j.persist&&j.persist());let T=ye(i);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:B}=await k();r.errors=L,T=ye(B)}else await I(n);if(o.disabled.size)for(const L of o.disabled)ve(T,L);if(ve(r.errors,"root"),Fe(r.errors)){h.state.next({errors:{}});try{await m(T,j)}catch(L){R=L}}else y&&await y({...r.errors},j),Ue(),setTimeout(Ue);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Fe(r.errors)&&!R,submitCount:r.submitCount+1,errors:r.errors}),R)throw R},lt=(m,y={})=>{M(n,m)&&(me(y.defaultValue)?J(m,ye(M(s,m))):(J(m,y.defaultValue),se(s,m,ye(y.defaultValue))),y.keepTouched||ve(r.touchedFields,m),y.keepDirty||(ve(r.dirtyFields,m),r.isDirty=y.defaultValue?_(m,ye(M(s,m))):_()),y.keepError||(ve(r.errors,m),u.isValid&&g()),h.state.next({...r}))},Ie=(m,y={})=>{const j=m?ye(m):s,R=ye(j),T=Fe(m),L=T?s:R;if(y.keepDefaultValues||(s=j),!y.keepValues){if(y.keepDirtyValues){const B=new Set([...o.mount,...Object.keys(Cr(s,i))]);for(const K of Array.from(B))M(r.dirtyFields,K)?se(L,K,M(i,K)):J(K,M(L,K))}else{if(hs&&me(m))for(const B of o.mount){const K=M(n,B);if(K&&K._f){const Q=Array.isArray(K._f.refs)?K._f.refs[0]:K._f.ref;if(ln(Q)){const he=Q.closest("form");if(he){he.reset();break}}}}if(y.keepFieldsRef)for(const B of o.mount)J(B,M(L,B));else n={}}i=t.shouldUnregister?y.keepDefaultValues?ye(s):{}:ye(L),h.array.next({values:{...L}}),h.state.next({values:{...L}})}o={mount:y.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!y.keepIsValid||!!y.keepDirtyValues,a.watch=!!t.shouldUnregister,h.state.next({submitCount:y.keepSubmitCount?r.submitCount:0,isDirty:T?!1:y.keepDirty?r.isDirty:!!(y.keepDefaultValues&&!Nt(m,s)),isSubmitted:y.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:T?{}:y.keepDirtyValues?y.keepDefaultValues&&i?Cr(s,i):r.dirtyFields:y.keepDefaultValues&&m?Cr(s,m):y.keepDirty?r.dirtyFields:{},touchedFields:y.keepTouched?r.touchedFields:{},errors:y.keepErrors?r.errors:{},isSubmitSuccessful:y.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},At=(m,y)=>Ie(it(m)?m(i):m,y),be=(m,y={})=>{const j=M(n,m),R=j&&j._f;if(R){const T=R.refs?R.refs[0]:R.ref;T.focus&&(T.focus(),y.shouldSelect&&it(T.select)&&T.select())}},bt=m=>{r={...r,...m}},qe={control:{register:ce,unregister:Je,getFieldState:re,handleSubmit:Ve,setError:Le,_subscribe:Ne,_runSchema:k,_focusError:Ue,_getWatch:F,_getDirty:_,_setValid:g,_setFieldArray:C,_setDisabledField:Se,_setErrors:E,_getFieldArray:P,_reset:Ie,_resetDefaultValues:()=>it(t.defaultValues)&&t.defaultValues().then(m=>{At(m,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:W,_disableForm:Ce,_subjects:h,_proxyFormState:u,get _fields(){return n},get _formValues(){return i},get _state(){return a},set _state(m){a=m},get _defaultValues(){return s},get _names(){return o},set _names(m){o=m},get _formState(){return r},get _options(){return t},set _options(m){t={...t,...m}}},subscribe:_e,trigger:te,register:ce,handleSubmit:Ve,watch:De,setValue:J,getValues:ue,reset:At,resetField:lt,clearErrors:fe,unregister:Je,setError:Le,setFocus:be,getFieldState:re};return{...qe,formControl:qe}}function of(e={}){const t=p.useRef(void 0),r=p.useRef(void 0),[n,s]=p.useState({isDirty:!1,isValidating:!1,isLoading:it(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:it(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!it(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...o}=sf(e);t.current={...o,formState:n}}const i=t.current.control;return i._options=e,ys(()=>{const a=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(o=>({...o,isReady:!0})),i._formState.isReady=!0,a},[i]),p.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),p.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),p.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),p.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),p.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==n.isDirty&&i._subjects.state.next({isDirty:a})}},[i,n.isDirty]),p.useEffect(()=>{e.values&&!Nt(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),r.current=e.values,s(a=>({...a}))):i._resetDefaultValues()},[i,e.values]),p.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Io(n,i),t.current}const Ci=(e,t,r)=>{if(e&&"reportValidity"in e){const n=M(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},qo=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Ci(n.ref,r,e):n.refs&&n.refs.forEach(s=>Ci(s,r,e))}},af=(e,t)=>{t.shouldUseNativeValidation&&qo(e,t);const r={};for(const n in e){const s=M(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(lf(t.names||Object.keys(e),n)){const a=Object.assign({},M(r,n));se(a,"root",i),se(r,n,a)}else se(r,n,i)}return r},lf=(e,t)=>e.some(r=>r.startsWith(t+"."));function cf(e,t,r){return t===void 0&&(t={}),r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(a,o){try{var c=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[r.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:s}))).then(function(f){return i.shouldUseNativeValidation&&qo({},i),{values:r.raw?n:f,errors:{}}}))}catch(f){return o(f)}return c&&c.then?c.then(void 0,o):c}(0,function(a){if(!a.inner)throw a;return{values:{},errors:af((o=a,c=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(o.inner||[]).reduce(function(f,u){if(f[u.path]||(f[u.path]={message:u.message,type:u.type}),c){var d=f[u.path].types,h=d&&d[u.type];f[u.path]=Po(u.path,c,f,u.type,h?[].concat(h,u.message):u.message)}return f},{})),i)};var o,c}))}catch(a){return Promise.reject(a)}}}function uf({className:e,name:t,children:r,mode:n="onBlur",reValidateMode:s="onBlur",defaultValues:i,schema:a,formProps:o,onSubmit:c=()=>null,onChange:f}){const u=of({mode:n,reValidateMode:s,defaultValues:i,resolver:a?cf(a):void 0});return p.useEffect(()=>{if(!f)return;const{unsubscribe:d}=u.watch(f);return d},[f,u.watch]),l.jsx(zu,{...u,children:l.jsx("form",{className:N.twJoin("bbn-form",e),name:t,onSubmit:u.handleSubmit(c),...o,children:r})})}function Gt({name:e,defaultValue:t,disabled:r=!1,autoFocus:n=!1,shouldUnregister:s=!1,validateOnMount:i=!0}){const{setFocus:a,trigger:o}=Kt(),{field:c,fieldState:f}=Ju({name:e,defaultValue:t,disabled:r,shouldUnregister:s}),{invalid:u,isTouched:d,error:h}=f;return p.useEffect(()=>{i?o(e,{shouldFocus:n}):n&&a(e)},[e,i]),{...c,value:c.value,invalid:u&&d,error:(h==null?void 0:h.message)??""}}function ff(e){const{getFieldState:t}=Kt(),r=bs({name:e});return Array.isArray(e)?e.map(s=>t(s,r)):t(e,r)}const df=/^-?\d*\.?\d*$/;function mf({name:e,id:t=e,label:r,hint:n,className:s,controlClassName:i,disabled:a,autoFocus:o,defaultValue:c,placeholder:f,type:u,suffix:d,prefix:h,shouldUnregister:v,state:x,validateOnMount:g}){const{ref:b,value:C="",error:w,invalid:E,onChange:S,onBlur:A}=Gt({name:e,defaultValue:c,autoFocus:o,shouldUnregister:v,validateOnMount:g}),O=E?"error":x,k=E?w:n,$=I=>{df.test(I.target.value)&&S(I.target.value)};return l.jsx(Vr,{label:r,className:i,state:O,hint:k,children:l.jsx(Dr,{inputMode:"decimal",pattern:"^-?\\d*\\.?\\d*$",ref:b,value:C,id:t,name:e,type:u,className:s,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:h,state:O,onChange:$,onBlur:A})})}function pf({name:e,id:t=e,label:r,hint:n,className:s,controlClassName:i,disabled:a,autoFocus:o,defaultValue:c,placeholder:f,type:u,suffix:d,prefix:h,shouldUnregister:v,state:x,validateOnMount:g}){const{ref:b,value:C="",error:w,invalid:E,onChange:S,onBlur:A}=Gt({name:e,defaultValue:c,autoFocus:o,shouldUnregister:v,validateOnMount:g}),O=E?"error":x,k=E?w:n;return l.jsx(Vr,{label:r,className:i,state:O,hint:k,children:l.jsx(Dr,{ref:b,value:C,id:t,name:e,type:u,className:s,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:h,state:O,onChange:S,onBlur:A})})}function hf({name:e,id:t=e,label:r,className:n,disabled:s,value:i,defaultChecked:a,labelClassName:o,orientation:c}){const{ref:f,value:u=!1,onChange:d,onBlur:h}=Gt({name:e});return l.jsx(ki,{ref:f,name:e,checked:u,id:t,label:r,className:n,disabled:s,value:i,defaultChecked:a,labelClassName:o,orientation:c,inputProps:{onChange:d,onBlur:h}})}function vf({name:e,id:t=e,label:r,className:n,disabled:s,value:i,defaultChecked:a,labelClassName:o,orientation:c}){const{ref:f,value:u,onChange:d,onBlur:h}=Gt({name:e,disabled:s,defaultValue:a?i:void 0});return l.jsx(Li,{ref:f,name:e,id:t,label:r,className:n,disabled:s,checked:u===i,value:i,labelClassName:o,orientation:c,inputProps:{onChange:d,onBlur:h}})}function gf({open:e,defaultOpen:t,options:r,optionClassName:n,popoverClassName:s,name:i,id:a=i,label:o,hint:c,className:f,controlClassName:u,disabled:d,autoFocus:h,defaultValue:v,placeholder:x,shouldUnregister:g,state:b,validateOnMount:C,onOpen:w,onClose:E,renderSelectedOption:S}){const{ref:A,value:O="",error:k,invalid:$,onChange:I,onBlur:W}=Gt({name:i,defaultValue:v,autoFocus:h,shouldUnregister:g,validateOnMount:C}),_=$?"error":b,F=$?k:c,P=()=>{W==null||W(),E==null||E()};return l.jsx(Vr,{label:o,className:u,state:_,hint:F,children:l.jsx(ts,{open:e,defaultOpen:t,options:r,ref:A,value:O,id:a,name:i,className:f,disabled:d,placeholder:x,state:_,optionClassName:n,popoverClassName:s,onSelect:I,onBlur:W,onOpen:w,onClose:P,renderSelectedOption:S})})}function Zo({displayError:e=!1,...t}){const{error:r,value:n,onChange:s,onBlur:i,disabled:a,name:o,ref:c}=Gt(t),f=l.jsx("input",{ref:c,type:"hidden",name:o,disabled:a,value:n,onChange:s,onBlur:i});if(e){const u=e?"error":"default",d=e?r:"";return l.jsx(Vr,{hint:d,state:u,children:f})}return f}const xf={lg:{logo:"size-10",subLogo:"text-[0.8rem]"},md:{logo:"size-6",subLogo:"text-[0.5rem]"},sm:{logo:"size-5",subLogo:"text-[0.4rem]"}},Xo=({logoUrl:e,rank:t,moniker:r,size:n="md",className:s})=>{const[i,a]=p.useState(!1),o=xf[n],c=(r==null?void 0:r.charAt(0).toUpperCase())??String(t);return l.jsx("span",{className:N.twMerge("relative inline-block",o.logo,s),children:e&&!i?l.jsx("img",{src:e,alt:r||`Finality Provider ${t}`,className:"h-full w-full rounded-full object-cover",onError:()=>a(!0)}):l.jsx(X,{as:"span",className:"inline-flex h-full w-full items-center justify-center rounded-full bg-secondary-main text-[1rem] text-accent-contrast",children:c})})};function Ns({bsnId:e,bsnName:t,bsnLogoUrl:r,address:n,provider:s,onRemove:i,showChain:a=!0}){var u,d;if(!s)return null;const o=()=>{if(r)return l.jsx(or,{url:r,alt:t,variant:"rounded",size:"tiny",className:"mr-1"});const h=(t==null?void 0:t.charAt(0).toUpperCase())||"?";return l.jsx(or,{variant:"rounded",size:"tiny",className:"mr-1",children:l.jsx(X,{as:"span",className:"inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast",children:h})})},c=h=>!h||h.length<=12?h:`${h.slice(0,6)}...${h.slice(-6)}`,f=()=>a?n?l.jsxs("div",{className:"flex items-center gap-1 text-xs text-accent-secondary",children:[c(n),l.jsx(bo,{value:n,className:"cursor-pointer",copiedText:"✓",children:l.jsx(hn,{size:12})})]}):l.jsxs("div",{className:"flex items-center text-xs text-accent-secondary",children:[o(),t]}):null;return l.jsxs("div",{className:"flex flex-row items-center justify-between",children:[l.jsxs("div",{className:"flex h-10 flex-row gap-2",children:[l.jsx("div",{className:"shrink-0",children:l.jsx(Xo,{logoUrl:s.logo_url,rank:s.rank,moniker:(u=s.description)==null?void 0:u.moniker,size:"lg"})}),l.jsxs("div",{className:"flex flex-col justify-center text-accent-primary",children:[f(),l.jsx(X,{as:"div",className:"text-base font-medium text-accent-primary",children:(d=s.description)==null?void 0:d.moniker})]})]}),i?l.jsx("button",{onClick:()=>i(e),className:"ml-[10px] flex items-center justify-center cursor-pointer p-1",children:l.jsx(ns,{size:12})}):null]})}const yf=({attributes:e,providerItemProps:t,isSelected:r=!1,isSelectable:n=!0,onSelect:s})=>l.jsxs("div",{className:"bg-secondary-highlight h-[316px] overflow-hidden p-4 flex flex-col rounded justify-between",children:[l.jsx(Ns,{...t}),l.jsx("div",{className:"w-full h-px bg-secondary-strokeLight"}),Object.entries(e).map(([i,a])=>l.jsxs("div",{className:"text-sm flex flex-row justify-between first:mt-0 mt-1",children:[l.jsx("div",{className:"text-accent-secondary",children:i}),l.jsx("div",{className:"text-accent-primary font-medium",children:a})]},i)),s&&l.jsx(Me,{className:"mt-4",onClick:s,disabled:!n,variant:r?"contained":"outlined",children:r?"Selected":"Select"})]}),Ss=8,bf=5,Cn=640,Yo=500;function wf(e){return Ft({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"},child:[]}]})(e)}function jf({className:e,...t}){const n=Yt(Cn)?Xt:Ir;return l.jsx(n,{...t,className:N.twMerge("w-[41.25rem] max-w-full",e)})}const Cf=({open:e,validators:t,columns:r,onClose:n,onSelect:s,title:i="",description:a})=>{const[o,c]=p.useState(""),f=()=>{c("")},u=o?l.jsx("button",{onClick:f,className:"opacity-60 hover:opacity-100 transition-opacity",children:l.jsx(wf,{size:18,className:"text-secondary-strokeDark"})}):l.jsx("span",{className:"text-secondary-strokeDark",children:l.jsx(Pa,{size:20})}),d=p.useMemo(()=>o.trim()?t.filter(h=>h.name.toLowerCase().includes(o.toLowerCase())):t,[t,o]);return l.jsxs(jf,{open:e,onClose:n,children:[l.jsx(Br,{title:i,onClose:n,className:"text-accent-primary"}),l.jsxs(Pr,{style:{maxHeight:Yo},className:"no-scrollbar mt-4 flex flex-col gap-6 overflow-y-auto text-accent-primary",children:[a&&l.jsx("div",{children:l.jsx(X,{variant:"body2",className:"text-accent-secondary",children:a})}),l.jsx("div",{children:l.jsx(Dr,{placeholder:"Search",value:o,onChange:h=>c(h.target.value),prefix:u,className:"w-full"})}),l.jsx(uo,{data:d,columns:r,className:"w-full",wrapperClassName:"w-full",onRowSelect:h=>{h&&(s(h),n())}})]})]})};var gr=1e9,Nf={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},As,le=!0,tt="[DecimalError] ",Wt=tt+"Invalid argument: ",Es=tt+"Exponent out of range: ",xr=Math.floor,It=Math.pow,Sf=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$e,je=1e7,oe=7,Ko=9007199254740991,fn=xr(Ko/oe),V={};V.absoluteValue=V.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};V.comparedTo=V.cmp=function(e){var t,r,n,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===s?0:n>s^i.s<0?1:-1};V.decimalPlaces=V.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*oe;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};V.dividedBy=V.div=function(e){return St(this,new this.constructor(e))};V.dividedToIntegerBy=V.idiv=function(e){var t=this,r=t.constructor;return ie(St(t,new r(e),0,1),r.precision)};V.equals=V.eq=function(e){return!this.cmp(e)};V.exponent=function(){return ge(this)};V.greaterThan=V.gt=function(e){return this.cmp(e)>0};V.greaterThanOrEqualTo=V.gte=function(e){return this.cmp(e)>=0};V.isInteger=V.isint=function(){return this.e>this.d.length-2};V.isNegative=V.isneg=function(){return this.s<0};V.isPositive=V.ispos=function(){return this.s>0};V.isZero=function(){return this.s===0};V.lessThan=V.lt=function(e){return this.cmp(e)<0};V.lessThanOrEqualTo=V.lte=function(e){return this.cmp(e)<1};V.logarithm=V.log=function(e){var t,r=this,n=r.constructor,s=n.precision,i=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq($e))throw Error(tt+"NaN");if(r.s<1)throw Error(tt+(r.s?"NaN":"-Infinity"));return r.eq($e)?new n(0):(le=!1,t=St(Fr(r,i),Fr(e,i),i),le=!0,ie(t,s))};V.minus=V.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ea(t,e):Go(t,(e.s=-e.s,e))};V.modulo=V.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(tt+"NaN");return r.s?(le=!1,t=St(r,e,0,1).times(e),le=!0,r.minus(t)):ie(new n(r),s)};V.naturalExponential=V.exp=function(){return Qo(this)};V.naturalLogarithm=V.ln=function(){return Fr(this)};V.negated=V.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};V.plus=V.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Go(t,e):ea(t,(e.s=-e.s,e))};V.precision=V.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Wt+e);if(t=ge(s)+1,n=s.d.length-1,r=n*oe+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};V.squareRoot=V.sqrt=function(){var e,t,r,n,s,i,a,o=this,c=o.constructor;if(o.s<1){if(!o.s)return new c(0);throw Error(tt+"NaN")}for(e=ge(o),le=!1,s=Math.sqrt(+o),s==0||s==1/0?(t=mt(o.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=xr((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(s.toString()),r=c.precision,s=a=r+3;;)if(i=n,n=i.plus(St(o,i,a+2)).times(.5),mt(i.d).slice(0,a)===(t=mt(n.d)).slice(0,a)){if(t=t.slice(a-3,a+1),s==a&&t=="4999"){if(ie(i,r+1,0),i.times(i).eq(o)){n=i;break}}else if(t!="9999")break;a+=4}return le=!0,ie(n,r)};V.times=V.mul=function(e){var t,r,n,s,i,a,o,c,f,u=this,d=u.constructor,h=u.d,v=(e=new d(e)).d;if(!u.s||!e.s)return new d(0);for(e.s*=u.s,r=u.e+e.e,c=h.length,f=v.length,c<f&&(i=h,h=v,v=i,a=c,c=f,f=a),i=[],a=c+f,n=a;n--;)i.push(0);for(n=f;--n>=0;){for(t=0,s=c+n;s>n;)o=i[s]+v[n]*h[s-n-1]+t,i[s--]=o%je|0,t=o/je|0;i[s]=(i[s]+t)%je|0}for(;!i[--a];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,le?ie(e,d.precision):e};V.toDecimalPlaces=V.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(xt(e,0,gr),t===void 0?t=n.rounding:xt(t,0,8),ie(r,e+ge(r)+1,t))};V.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=Zt(n,!0):(xt(e,0,gr),t===void 0?t=s.rounding:xt(t,0,8),n=ie(new s(n),e+1,t),r=Zt(n,!0,e+1)),r};V.toFixed=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?Zt(s):(xt(e,0,gr),t===void 0?t=i.rounding:xt(t,0,8),n=ie(new i(s),e+ge(s)+1,t),r=Zt(n.abs(),!1,e+ge(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};V.toInteger=V.toint=function(){var e=this,t=e.constructor;return ie(new t(e),ge(e)+1,t.rounding)};V.toNumber=function(){return+this};V.toPower=V.pow=function(e){var t,r,n,s,i,a,o=this,c=o.constructor,f=12,u=+(e=new c(e));if(!e.s)return new c($e);if(o=new c(o),!o.s){if(e.s<1)throw Error(tt+"Infinity");return o}if(o.eq($e))return o;if(n=c.precision,e.eq($e))return ie(o,n);if(t=e.e,r=e.d.length-1,a=t>=r,i=o.s,a){if((r=u<0?-u:u)<=Ko){for(s=new c($e),t=Math.ceil(n/oe+4),le=!1;r%2&&(s=s.times(o),Si(s.d,t)),r=xr(r/2),r!==0;)o=o.times(o),Si(o.d,t);return le=!0,e.s<0?new c($e).div(s):ie(s,n)}}else if(i<0)throw Error(tt+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,o.s=1,le=!1,s=e.times(Fr(o,n+f)),le=!0,s=Qo(s),s.s=i,s};V.toPrecision=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?(r=ge(s),n=Zt(s,r<=i.toExpNeg||r>=i.toExpPos)):(xt(e,1,gr),t===void 0?t=i.rounding:xt(t,0,8),s=ie(new i(s),e,t),r=ge(s),n=Zt(s,e<=r||r<=i.toExpNeg,e)),n};V.toSignificantDigits=V.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(xt(e,1,gr),t===void 0?t=n.rounding:xt(t,0,8)),ie(new n(r),e,t)};V.toString=V.valueOf=V.val=V.toJSON=V[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ge(e),r=e.constructor;return Zt(e,t<=r.toExpNeg||t>=r.toExpPos)};function Go(e,t){var r,n,s,i,a,o,c,f,u=e.constructor,d=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),le?ie(t,d):t;if(c=e.d,f=t.d,a=e.e,s=t.e,c=c.slice(),i=a-s,i){for(i<0?(n=c,i=-i,o=f.length):(n=f,s=a,o=c.length),a=Math.ceil(d/oe),o=a>o?a+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=c.length,i=f.length,o-i<0&&(i=o,n=f,f=c,c=n),r=0;i;)r=(c[--i]=c[i]+f[i]+r)/je|0,c[i]%=je;for(r&&(c.unshift(r),++s),o=c.length;c[--o]==0;)c.pop();return t.d=c,t.e=s,le?ie(t,d):t}function xt(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Wt+e)}function mt(e){var t,r,n,s=e.length-1,i="",a=e[0];if(s>0){for(i+=a,t=1;t<s;t++)n=e[t]+"",r=oe-n.length,r&&(i+=kt(r)),i+=n;a=e[t],n=a+"",r=oe-n.length,r&&(i+=kt(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}var St=function(){function e(n,s){var i,a=0,o=n.length;for(n=n.slice();o--;)i=n[o]*s+a,n[o]=i%je|0,a=i/je|0;return a&&n.unshift(a),n}function t(n,s,i,a){var o,c;if(i!=a)c=i>a?1:-1;else for(o=c=0;o<i;o++)if(n[o]!=s[o]){c=n[o]>s[o]?1:-1;break}return c}function r(n,s,i){for(var a=0;i--;)n[i]-=a,a=n[i]<s[i]?1:0,n[i]=a*je+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,a){var o,c,f,u,d,h,v,x,g,b,C,w,E,S,A,O,k,$,I=n.constructor,W=n.s==s.s?1:-1,_=n.d,F=s.d;if(!n.s)return new I(n);if(!s.s)throw Error(tt+"Division by zero");for(c=n.e-s.e,k=F.length,A=_.length,v=new I(W),x=v.d=[],f=0;F[f]==(_[f]||0);)++f;if(F[f]>(_[f]||0)&&--c,i==null?w=i=I.precision:a?w=i+(ge(n)-ge(s))+1:w=i,w<0)return new I(0);if(w=w/oe+2|0,f=0,k==1)for(u=0,F=F[0],w++;(f<A||u)&&w--;f++)E=u*je+(_[f]||0),x[f]=E/F|0,u=E%F|0;else{for(u=je/(F[0]+1)|0,u>1&&(F=e(F,u),_=e(_,u),k=F.length,A=_.length),S=k,g=_.slice(0,k),b=g.length;b<k;)g[b++]=0;$=F.slice(),$.unshift(0),O=F[0],F[1]>=je/2&&++O;do u=0,o=t(F,g,k,b),o<0?(C=g[0],k!=b&&(C=C*je+(g[1]||0)),u=C/O|0,u>1?(u>=je&&(u=je-1),d=e(F,u),h=d.length,b=g.length,o=t(d,g,h,b),o==1&&(u--,r(d,k<h?$:F,h))):(u==0&&(o=u=1),d=F.slice()),h=d.length,h<b&&d.unshift(0),r(g,d,b),o==-1&&(b=g.length,o=t(F,g,k,b),o<1&&(u++,r(g,k<b?$:F,b))),b=g.length):o===0&&(u++,g=[0]),x[f++]=u,o&&g[0]?g[b++]=_[S]||0:(g=[_[S]],b=1);while((S++<A||g[0]!==void 0)&&w--)}return x[0]||x.shift(),v.e=c,ie(v,a?i+ge(v)+1:i)}}();function Qo(e,t){var r,n,s,i,a,o,c=0,f=0,u=e.constructor,d=u.precision;if(ge(e)>16)throw Error(Es+ge(e));if(!e.s)return new u($e);for(le=!1,o=d,a=new u(.03125);e.abs().gte(.1);)e=e.times(a),f+=5;for(n=Math.log(It(2,f))/Math.LN10*2+5|0,o+=n,r=s=i=new u($e),u.precision=o;;){if(s=ie(s.times(e),o),r=r.times(++c),a=i.plus(St(s,r,o)),mt(a.d).slice(0,o)===mt(i.d).slice(0,o)){for(;f--;)i=ie(i.times(i),o);return u.precision=d,t==null?(le=!0,ie(i,d)):i}i=a}}function ge(e){for(var t=e.e*oe,r=e.d[0];r>=10;r/=10)t++;return t}function Ln(e,t,r){if(t>e.LN10.sd())throw le=!0,r&&(e.precision=r),Error(tt+"LN10 precision limit exceeded");return ie(new e(e.LN10),t)}function kt(e){for(var t="";e--;)t+="0";return t}function Fr(e,t){var r,n,s,i,a,o,c,f,u,d=1,h=10,v=e,x=v.d,g=v.constructor,b=g.precision;if(v.s<1)throw Error(tt+(v.s?"NaN":"-Infinity"));if(v.eq($e))return new g(0);if(t==null?(le=!1,f=b):f=t,v.eq(10))return t==null&&(le=!0),Ln(g,f);if(f+=h,g.precision=f,r=mt(x),n=r.charAt(0),i=ge(v),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=mt(v.d),n=r.charAt(0),d++;i=ge(v),n>1?(v=new g("0."+r),i++):v=new g(n+"."+r.slice(1))}else return c=Ln(g,f+2,b).times(i+""),v=Fr(new g(n+"."+r.slice(1)),f-h).plus(c),g.precision=b,t==null?(le=!0,ie(v,b)):v;for(o=a=v=St(v.minus($e),v.plus($e),f),u=ie(v.times(v),f),s=3;;){if(a=ie(a.times(u),f),c=o.plus(St(a,new g(s),f)),mt(c.d).slice(0,f)===mt(o.d).slice(0,f))return o=o.times(2),i!==0&&(o=o.plus(Ln(g,f+2,b).times(i+""))),o=St(o,new g(d),f),g.precision=b,t==null?(le=!0,ie(o,b)):o;o=c,s+=2}}function Ni(e,t){var r,n,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(n,s),t){if(s-=n,r=r-n-1,e.e=xr(r/oe),e.d=[],n=(r+1)%oe,r<0&&(n+=oe),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=oe;n<s;)e.d.push(+t.slice(n,n+=oe));t=t.slice(n),n=oe-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),le&&(e.e>fn||e.e<-fn))throw Error(Es+r)}else e.s=0,e.e=0,e.d=[0];return e}function ie(e,t,r){var n,s,i,a,o,c,f,u,d=e.d;for(a=1,i=d[0];i>=10;i/=10)a++;if(n=t-a,n<0)n+=oe,s=t,f=d[u=0];else{if(u=Math.ceil((n+1)/oe),i=d.length,u>=i)return e;for(f=i=d[u],a=1;i>=10;i/=10)a++;n%=oe,s=n-oe+a}if(r!==void 0&&(i=It(10,a-s-1),o=f/i%10|0,c=t<0||d[u+1]!==void 0||f%i,c=r<4?(o||c)&&(r==0||r==(e.s<0?3:2)):o>5||o==5&&(r==4||c||r==6&&(n>0?s>0?f/It(10,a-s):0:d[u-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return c?(i=ge(e),d.length=1,t=t-i-1,d[0]=It(10,(oe-t%oe)%oe),e.e=xr(-t/oe)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=u,i=1,u--):(d.length=u+1,i=It(10,oe-n),d[u]=s>0?(f/It(10,a-s)%It(10,s)|0)*i:0),c)for(;;)if(u==0){(d[0]+=i)==je&&(d[0]=1,++e.e);break}else{if(d[u]+=i,d[u]!=je)break;d[u--]=0,i=1}for(n=d.length;d[--n]===0;)d.pop();if(le&&(e.e>fn||e.e<-fn))throw Error(Es+ge(e));return e}function ea(e,t){var r,n,s,i,a,o,c,f,u,d,h=e.constructor,v=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),le?ie(t,v):t;if(c=e.d,d=t.d,n=t.e,f=e.e,c=c.slice(),a=f-n,a){for(u=a<0,u?(r=c,a=-a,o=d.length):(r=d,n=f,o=c.length),s=Math.max(Math.ceil(v/oe),o)+2,a>s&&(a=s,r.length=1),r.reverse(),s=a;s--;)r.push(0);r.reverse()}else{for(s=c.length,o=d.length,u=s<o,u&&(o=s),s=0;s<o;s++)if(c[s]!=d[s]){u=c[s]<d[s];break}a=0}for(u&&(r=c,c=d,d=r,t.s=-t.s),o=c.length,s=d.length-o;s>0;--s)c[o++]=0;for(s=d.length;s>a;){if(c[--s]<d[s]){for(i=s;i&&c[--i]===0;)c[i]=je-1;--c[i],c[s]+=je}c[s]-=d[s]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,le?ie(t,v):t):new h(0)}function Zt(e,t,r){var n,s=ge(e),i=mt(e.d),a=i.length;return t?(r&&(n=r-a)>0?i=i.charAt(0)+"."+i.slice(1)+kt(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+kt(-s-1)+i,r&&(n=r-a)>0&&(i+=kt(n))):s>=a?(i+=kt(s+1-a),r&&(n=r-s-1)>0&&(i=i+"."+kt(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-a)>0&&(s+1===a&&(i+="."),i+=kt(n))),e.s<0?"-"+i:i}function Si(e,t){if(e.length>t)return e.length=t,!0}function ta(e){var t,r,n;function s(i){var a=this;if(!(a instanceof s))return new s(i);if(a.constructor=s,i instanceof s){a.s=i.s,a.e=i.e,a.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Wt+i);if(i>0)a.s=1;else if(i<0)i=-i,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(i===~~i&&i<1e7){a.e=0,a.d=[i];return}return Ni(a,i.toString())}else if(typeof i!="string")throw Error(Wt+i);if(i.charCodeAt(0)===45?(i=i.slice(1),a.s=-1):a.s=1,Sf.test(i))Ni(a,i);else throw Error(Wt+i)}if(s.prototype=V,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=ta,s.config=s.set=Ef,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return s.config(e),s}function Ef(e){if(!e||typeof e!="object")throw Error(tt+"Object expected");var t,r,n,s=["precision",1,gr,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((n=e[r=s[t]])!==void 0)if(xr(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Wt+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Wt+r+": "+n);return this}var As=ta(Nf);$e=new As(1);const Af={prefix:"$",precision:2,zeroDisplay:"-",format:{minimumFractionDigits:2,maximumFractionDigits:2}};function Of(e,t={}){const{prefix:r,precision:n,zeroDisplay:s,format:i}={...Af,...t};if(e===0)return s;const a=e.toLocaleString("en",i??{maximumFractionDigits:n});return`${r}${a}`}function ra(e,t,r){const n=e*t;return Of(n,r)}const kf=(e,t,r)=>new As(e).toDecimalPlaces(t,r).toNumber();function Lf(e,t){return e===0?`0 ${t}`:e>=1?`${e.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4})} ${t}`:`${e.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:8}).replace(/\.?0+$/,"")} ${t}`}const _f=({fieldName:e,currencyIcon:t,currencyName:r,displayBalance:n,placeholder:s="Enter Amount",balanceDetails:i,prefix:a,min:o="0",step:c="any",autoFocus:f=!0,decimals:u})=>{const d=ws({name:e,defaultValue:""}),{setValue:h}=Kt(),v=parseFloat(d||"0"),x=ra(v,(i==null?void 0:i.price)??0,{zeroDisplay:"$0.00"}),g=w=>{let E=w.target.value;if(u!==void 0&&u>=0){const[S,A]=E.split(".",2);A!==void 0&&A.length>u?E=S+"."+A.slice(0,u):A!==void 0?E=S+"."+A:E.includes(".")&&(E=S)}h(e,E,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},b=w=>{(w.key==="ArrowUp"||w.key==="ArrowDown")&&w.preventDefault()};let C;return i&&(C=`${kf(Number(i.balance),i.decimals??Ss)} ${i.symbol}`,a&&(C=`${a}: ${C}`)),l.jsxs(l.Fragment,{children:[l.jsx(Zo,{name:e,defaultValue:""}),l.jsx(hr,{className:"flex w-full flex-col content-center justify-between gap-4",children:l.jsx(gn,{amount:d,currencyIcon:t,currencyName:r,placeholder:s,displayBalance:n,balanceDetails:i,min:o,step:c,autoFocus:f,onChange:g,onKeyDown:b,amountUsd:x,subtitle:C})})]})};function Ff({items:e,onRemove:t,showChain:r=!0}){const n=p.useMemo(()=>e,[e]);return n.length===0?null:l.jsx("div",{className:"flex flex-col gap-8",children:n.map(({bsnId:s,bsnName:i,bsnLogoUrl:a,provider:o})=>l.jsx(Ns,{bsnId:s,bsnName:i,bsnLogoUrl:a,provider:o,onRemove:t,showChain:r},`${s}-${o.rank}`))})}function Tf({max:e,items:t=[],actionText:r,onAdd:n,onRemove:s,showChain:i=!0}){const a=p.useMemo(()=>t.length,[t]);return l.jsx(hr,{children:l.jsxs("div",{className:"flex w-full flex-col gap-4",children:[l.jsx("div",{className:"flex flex-row",children:l.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[l.jsx("span",{className:"text-sm sm:text-base",children:r}),l.jsx(vo,{counter:a,max:e,onAdd:n})]})}),a>0&&l.jsx(Ff,{items:t,onRemove:s,showChain:i})]})})}function mr({title:e,children:t,className:r,hint:n}){return l.jsxs("div",{className:N.twMerge("flex flex-row items-center justify-between text-accent-primary",n&&"items-start",r),children:[l.jsx(X,{as:"div",variant:"body1",children:e}),n?l.jsxs("div",{className:"flex flex-col items-end",children:[l.jsx(X,{as:"div",className:"flex items-center gap-2",children:t}),l.jsx(X,{as:"div",variant:"body2",className:"text-accent-secondary",children:n})]}):l.jsx(X,{as:"div",className:"flex items-center gap-2",children:t})]})}function Rf(e){return Ft({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"},child:[]}]})(e)}function na({value:e,onEdit:t,title:r="Network Fee Rate",className:n}){return l.jsxs(mr,{title:r,className:n,children:[l.jsxs("span",{children:[e," sats/vB"]}),t&&l.jsx(Me,{size:"small",variant:"outlined",className:"h-6 w-6 pl-1 text-secondary-strokeDark",onClick:t,children:l.jsx(Rf,{size:16,className:"text-secondary-strokeDark"})})]})}function sa({amount:e,coinSymbol:t,hint:r,title:n,className:s,decimals:i=Ss}){let a;return typeof e=="number"?e===0?a="0":a=e.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):a=e,l.jsxs(mr,{title:n??`${t} Network Fee`,hint:r,className:s,children:[a," ",t]})}function ia({amount:e,coinSymbol:t,hint:r,title:n,className:s,decimals:i=bf}){const a=typeof e=="number"?e.toFixed(i):e;return l.jsxs(mr,{title:n??`${t} Network Fee`,hint:r,className:s,children:[a," ",t]})}function oa({total:e,coinSymbol:t,hint:r,title:n="Total",className:s,decimals:i=Ss}){let a;return typeof e=="number"?e===0?a="0":a=e.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):a=e,l.jsxs("div",{className:N.twMerge("flex flex-row items-start justify-between text-accent-primary",s),children:[l.jsx(X,{variant:"body1",className:"font-bold",children:n}),l.jsxs("div",{className:"flex flex-col items-end justify-center",children:[l.jsxs(X,{variant:"body1",className:"font-bold",children:[a," ",t]}),r&&l.jsx(X,{variant:"body1",className:"text-sm text-accent-secondary",children:r})]})]})}function Mf({className:e,feeRate:t,onFeeRateEdit:r,feeAmount:n,coinSymbol:s,feeAmountHint:i,total:a,totalHint:o,bbnFeeAmount:c,bbnCoinSymbol:f,bbnFeeAmountHint:u,bbnFeeDecimals:d}){return l.jsx(hr,{className:N.twMerge("flex w-full flex-col content-center justify-between gap-4",e),children:l.jsxs("div",{className:"flex flex-col gap-6 p-4",children:[t!==void 0&&l.jsx(na,{value:t,onEdit:r}),n!==void 0&&s!==void 0&&l.jsx(sa,{amount:n,coinSymbol:s,hint:i}),c!==void 0&&f?l.jsx(ia,{amount:c,coinSymbol:f,hint:u,decimals:d}):null,a!==void 0&&s!==void 0&&l.jsx("div",{className:"divider my-4"}),a!==void 0&&s!==void 0&&l.jsx(oa,{total:a,coinSymbol:s,hint:o})]})})}const Df=({data:e})=>{if(!e||e.length===0)return null;const t=e[0],r=e.slice(1),s={gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`};return l.jsx(fo,{className:"p-6 pt-4",children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:"items-center gap-4 pb-4 grid",style:s,children:t.map((i,a)=>l.jsx(X,{variant:"caption",className:"text-secondary px-2.5",children:i},`header-${a}`))}),r.map((i,a)=>l.jsx("div",{className:"items-center gap-4 rounded bg-primary-contrast p-1 grid",style:s,children:i.map((o,c)=>l.jsx("div",{className:"flex w-full items-center gap-2 py-1 px-2.5",children:o},`cell-${a}-${c}`))},`row-${a}`))]})})};function Vf({className:e,...t}){const n=Yt(Cn)?Xt:Ir;return l.jsx(n,{...t,className:N.twMerge("w-[41.25rem] max-w-full",e)})}const If=({open:e,processing:t=!1,onClose:r,onProceed:n,bsns:s,finalityProviders:i,details:a,visibleFields:o,warnings:c,proceedLabel:f="Proceed to Signing"})=>{const u=[{label:"Stake Amount",value:a.stakeAmount},{label:"Fee Rate",value:a.feeRate},{label:"Transaction Fees",value:a.transactionFees},{label:"Term",value:l.jsxs(l.Fragment,{children:[a.term.blocks,l.jsx("br",{}),l.jsx("span",{className:"text-md text-secondary",children:a.term.duration})]})},{label:"Unbonding",value:a.unbonding},{label:"Unbonding Fee",value:a.unbondingFee}],d=o&&o.length>0?u.filter(x=>o.includes(x.label)):u,v=!i||i.length===0?[["Validator"],...s.map((x,g)=>[l.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[x.icon,l.jsx(X,{variant:"body2",className:"font-medium",children:x.name})]},`validator-${g}`)])]:[["BSNs","Finality Provider"],...s.map((x,g)=>{const b=i[g];return[l.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[x.icon,l.jsx(X,{variant:"body2",className:"font-medium",children:x.name})]},`bsn-${g}`),b?l.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[b.icon,l.jsx(X,{variant:"body2",className:"font-medium",children:b.name})]},`fp-${g}`):l.jsx("div",{},`fp-${g}`)]})];return l.jsxs(Vf,{open:e,onClose:r,children:[l.jsx(Br,{title:"Preview",onClose:r,className:"text-accent-primary"}),l.jsxs(Pr,{className:"no-scrollbar mb-8 mt-4 flex max-h-[calc(100vh-12rem)] flex-col gap-4 overflow-y-auto text-accent-primary",children:[l.jsx(Df,{data:v}),l.jsx("div",{className:"flex flex-col",children:d.map((x,g)=>l.jsxs("div",{className:"flex flex-row items-center justify-between py-3",children:[l.jsx(X,{variant:"body1",className:"text-secondary font-normal",children:x.label}),l.jsx(X,{variant:"body1",className:"text-right font-normal",children:x.value})]},g))}),l.jsx("div",{className:"border-divider w-full border-t"}),l.jsxs("div",{className:"pt-2",children:[l.jsx(dn,{variant:"h6",className:"text-primary mb-2",children:"Attention!"}),c.map((x,g)=>l.jsx(X,{variant:"body2",className:"text-secondary",children:x},g))]})]}),l.jsxs(vn,{className:"flex flex-col gap-4 pb-8 pt-0 sm:flex-row",children:[l.jsx(Me,{variant:"contained",color:"primary",onClick:n,className:"w-full sm:flex-1 sm:order-2",disabled:t,children:t?"Processing...":f}),l.jsx(Me,{variant:"outlined",color:"primary",onClick:r,className:"w-full sm:flex-1 sm:order-1",children:"Cancel"})]})]})};function aa({actions:e}){return l.jsx("div",{className:"mt-4 sm:mt-6 flex gap-2",children:e.map((t,r)=>l.jsx(Me,{variant:t.variant||"outlined",className:`sm:bbn-btn-medium flex-1 ${t.className||""}`,onClick:t.onClick,fluid:!0,children:t.label},`${t.label}-${r}`))})}function la({formattedAmount:e,icon:t,iconAlt:r,chainName:n,chainIcon:s,chainIconAlt:i}){return l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[t&&(typeof t=="string"?l.jsx("img",{src:t,alt:r||"icon",className:"w-6 h-6 sm:w-8 sm:h-8"}):t),l.jsx("span",{className:"text-base sm:text-lg font-medium text-accent-primary",children:e})]}),n&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-base sm:text-lg font-medium text-accent-primary",children:n}),s&&(typeof s=="string"?l.jsx("img",{src:s,alt:i||"chain icon",className:"w-6 h-6 sm:w-8 sm:h-8"}):s)]})]})}function ca({item:e,className:t}){return l.jsxs("div",{className:N.twMerge("flex items-center gap-2 min-w-0",t),children:[l.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium truncate flex items-center",children:e.name}),e.icon&&l.jsx("div",{className:"flex items-center w-4 h-4 flex-shrink-0 justify-center text-xs sm:text-sm",children:typeof e.icon=="string"?l.jsx("img",{src:e.icon,alt:e.iconAlt||e.name,className:"w-full h-full rounded-full object-cover"}):e.icon})]})}function Pn({label:e,value:t,collapsible:r=!1,nestedDetails:n}){const[s,i]=p.useState(!1),a=()=>{i(!s)};return r?l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0 overflow-x-auto",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[l.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary",children:e}),l.jsx("button",{onClick:a,className:"w-5 h-5 flex-shrink-0 hover:opacity-70 transition-opacity","aria-label":s?"Collapse":"Expand",children:s?l.jsx(Qi,{size:20,variant:"secondary"}):l.jsx(eo,{size:20,variant:"secondary"})})]}),l.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium text-right min-w-0 overflow-x-auto whitespace-nowrap",children:t})]}),s&&n&&l.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:n.map((o,c)=>l.jsx(Pn,{label:o.label,value:o.value,collapsible:o.collapsible,nestedDetails:o.nestedDetails},c))})]}):l.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0 overflow-x-auto",children:[l.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary flex-shrink-0",children:e}),l.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium text-right min-w-0 overflow-x-auto whitespace-nowrap",children:t})]})}function ua({details:e,optionalDetails:t,listItems:r}){const n=t&&t.length>0,s=r&&r.length>0;return l.jsxs("div",{className:"space-y-3 sm:space-y-4 overflow-x-auto",children:[l.jsx("div",{className:"space-y-4 sm:space-y-6",children:e.map((i,a)=>l.jsx(Pn,{label:i.label,value:i.value,collapsible:i.collapsible,nestedDetails:i.nestedDetails},a))}),s&&l.jsx("div",{className:"space-y-3 sm:space-y-4",children:r.map((i,a)=>l.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:l.jsxs("div",{className:"flex justify-between items-start gap-2",children:[l.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary",children:i.label}),l.jsx("div",{className:"flex flex-wrap gap-2",children:i.items.map((o,c)=>l.jsx(ca,{item:o},o.id||c))})]})},a))}),n&&l.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:t.map((i,a)=>l.jsx(Pn,{label:i.label,value:i.value,collapsible:i.collapsible,nestedDetails:i.nestedDetails},a))})]})}function Bf({data:e,className:t}){return l.jsxs("div",{className:`w-full bg-secondary-highlight p-3 sm:p-4 rounded flex flex-col justify-between ${t||""}`,children:[l.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[l.jsx(la,{formattedAmount:e.formattedAmount,icon:e.icon,iconAlt:e.iconAlt,chainName:e.chainName,chainIcon:e.chainIcon,chainIconAlt:e.chainIconAlt}),l.jsx(ua,{details:e.details,optionalDetails:e.optionalDetails,listItems:e.listItems}),e.secondaryActions&&e.secondaryActions.length>0&&l.jsx(aa,{actions:e.secondaryActions})]}),e.primaryAction&&l.jsx(Me,{variant:"outlined",className:`mt-4 ${e.primaryAction.className||""}`,onClick:e.primaryAction.onClick,fluid:e.primaryAction.fullWidth!==!1,children:e.primaryAction.label})]})}function Pf({className:e,...t}){const n=Yt(Cn)?Xt:Ir;return l.jsx(n,{...t,className:N.twMerge("w-[41.25rem] max-w-full",e)})}const $f=({open:e,processing:t=!1,title:r,onClose:n,onProceed:s,tokens:i,transactionFees:a})=>l.jsxs(Pf,{open:e,onClose:n,children:[l.jsx(Br,{title:r,className:"text-accent-primary"}),l.jsx(Pr,{className:"no-scrollbar mb-[40px] mt-8 flex max-h-[calc(100vh-12rem)] flex-col overflow-y-auto text-accent-primary",children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:i.map((o,c)=>{var f,u;return l.jsxs("div",{children:[l.jsx(mr,{title:o.name,hint:(f=o.amount)==null?void 0:f.usd,children:l.jsxs("div",{className:"flex items-center gap-2",children:[o.icon,(u=o.amount)==null?void 0:u.token]})}),c<i.length-1&&l.jsx("div",{className:"h-4"})]},`token-${c}`)})}),l.jsx("div",{className:"pt-6 pb-6",children:l.jsx("div",{className:"border-divider w-full border-t"})}),l.jsx(mr,{title:"Transaction Fees",hint:a.usd,children:a.token})]})}),l.jsxs(vn,{className:"flex flex-col gap-4 pt-0 sm:flex-row",children:[l.jsx(Me,{variant:"contained",color:"primary",onClick:s,className:"w-full sm:flex-1 sm:order-2",disabled:t,children:t?"Processing...":"Proceed"}),l.jsx(Me,{variant:"outlined",color:"primary",onClick:n,className:"w-full sm:flex-1 sm:order-1",children:"Cancel"})]})]}),Hf=({rewards:e,onClick:t,disabled:r})=>l.jsxs(hr,{className:"flex w-full flex-col content-center justify-between gap-4",children:[e.map((n,s)=>{var o;const i=parseFloat(String(n.amount)),a=ra(i,((o=n.balanceDetails)==null?void 0:o.price)??0,{zeroDisplay:"$0.00"});return l.jsx(gn,{amount:n.amount,currencyIcon:n.currencyIcon,currencyName:n.currencyName,placeholder:n.placeholder??"Enter Amount",displayBalance:n.displayBalance,balanceDetails:n.balanceDetails,min:n.min??"0",step:n.step??"any",autoFocus:!1,onChange:()=>{},onKeyDown:()=>{},amountUsd:a,disabled:!0,subtitle:n.chainName},s)}),l.jsx(Me,{onClick:t,disabled:r,children:"Claim"})]}),Wf=({size:e="md"})=>{const t={sm:"mt-2",md:"mt-4",lg:"mt-6"};return l.jsx("div",{className:t[e]})},zf=()=>l.jsx("svg",{width:"29",height:"28",viewBox:"0 0 29 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M24.9127 15.3708C24.9711 14.9333 25.0002 14.4812 25.0002 14C25.0002 13.5333 24.9711 13.0667 24.8982 12.6292L27.8586 10.325C28.1211 10.1208 28.194 9.72708 28.0336 9.43542L25.2336 4.59375C25.0586 4.27292 24.694 4.17083 24.3732 4.27292L20.8877 5.67292C20.1586 5.11875 19.3857 4.65208 18.5252 4.30208L18.0002 0.597916C17.9419 0.247916 17.6502 0 17.3002 0H11.7002C11.3502 0 11.0732 0.247916 11.0148 0.597916L10.4898 4.30208C9.62941 4.65208 8.84191 5.13333 8.12732 5.67292L4.64191 4.27292C4.32107 4.15625 3.95649 4.27292 3.78149 4.59375L0.996075 9.43542C0.821075 9.74167 0.879408 10.1208 1.17107 10.325L4.13149 12.6292C4.05857 13.0667 4.00024 13.5479 4.00024 14C4.00024 14.4521 4.02941 14.9333 4.10232 15.3708L1.14191 17.675C0.879408 17.8792 0.806491 18.2729 0.966908 18.5646L3.76691 23.4062C3.94191 23.7271 4.30649 23.8292 4.62732 23.7271L8.11274 22.3271C8.84191 22.8812 9.61482 23.3479 10.4752 23.6979L11.0002 27.4021C11.0732 27.7521 11.3502 28 11.7002 28H17.3002C17.6502 28 17.9419 27.7521 17.9857 27.4021L18.5107 23.6979C19.3711 23.3479 20.1586 22.8812 20.8732 22.3271L24.3586 23.7271C24.6794 23.8438 25.044 23.7271 25.219 23.4062L28.019 18.5646C28.194 18.2437 28.1211 17.8792 27.844 17.675L24.9127 15.3708ZM14.5002 19.25C11.6127 19.25 9.25024 16.8875 9.25024 14C9.25024 11.1125 11.6127 8.75 14.5002 8.75C17.3877 8.75 19.7502 11.1125 19.7502 14C19.7502 16.8875 17.3877 19.25 14.5002 19.25Z",fill:"#9E9E9E"})}),fa=()=>l.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),da=({children:e,className:t=""})=>l.jsx(X,{variant:"body1",className:N.twJoin("px-7 pb-6 text-accent-primary md:hidden",t),children:e}),ma=({background:e="none",backgroundClassName:t="",className:r="",children:n})=>{const s=()=>{switch(e){case"secondary":return"mx-[21px] rounded-lg bg-secondary-highlight md:mx-0 md:bg-transparent";case"custom":return t;default:return""}};return l.jsx("div",{className:N.twJoin(s(),r),children:n})},pr=({children:e})=>l.jsx(l.Fragment,{children:e}),Os=({icon:e,suffix:t,onClick:r,disabled:n=!1,selected:s=!1,className:i="",toggle:a,children:o})=>{const c=p.Children.toArray(o),f=c.find(v=>typeof v=="string"||p.isValidElement(v)&&v.type!==pr),u=c.find(v=>p.isValidElement(v)&&v.type===pr),d=typeof f=="string"?f:"",h=r&&!a?l.jsx(fa,{}):void 0;return l.jsx(xo,{icon:e,name:d,description:u?u.props.children:void 0,onClick:r,disabled:n,selected:s,className:i,suffix:t||h,toggle:a})},pa=({icon:e,className:t="",children:r})=>{const n=p.Children.toArray(r),s=n.find(c=>typeof c=="string"||p.isValidElement(c)&&c.type!==pr),i=n.find(c=>p.isValidElement(c)&&c.type===pr),a=n.filter(c=>p.isValidElement(c)&&c.type===Os),o=typeof s=="string"?s:"";return l.jsx(yo,{icon:e,name:o,description:i?i.props.children:void 0,className:t,suffix:l.jsx(fa,{}),children:a})},ha=({children:e,className:t=""})=>l.jsx("div",{className:t,children:e}),Jf=({trigger:e,open:t,onOpenChange:r,placement:n="bottom-end",className:s,offset:i=[0,8],children:a})=>{const o=l.jsx("button",{className:"flex h-10 w-10 items-center justify-center rounded-lg transition-colors hover:bg-accent-primary/10","aria-label":"Settings menu",children:l.jsx(zf,{})});return l.jsx(ls,{trigger:e||o,open:t,onOpenChange:r,placement:n,className:N.twJoin("relative",s),offset:i,mobileMode:"drawer",children:a})},Rt=Jf;Rt.Title=da;Rt.Group=ma;Rt.Item=Os;Rt.SubMenu=pa;Rt.Description=pr;Rt.CustomContent=ha;Rt.Spacer=Wf;const $n=({walletType:e,walletName:t,walletIcon:r,address:n,isCopied:s,onCopy:i,className:a,balances:o,coinSymbol:c,isBalanceLoading:f=!1,hasUnconfirmedTransactions:u=!1,formatBalance:d})=>{const v=d||(C=>c?Lf(C,c):C.toString()),x=(C,w=!1)=>f||w?l.jsx(to,{size:20,className:"text-accent-primary"}):C===void 0?l.jsx(X,{className:"text-accent-secondary text-sm",children:"N/A"}):l.jsx(X,{variant:"body1",className:"text-accent-primary !text-sm",children:v(C)}),g=()=>l.jsxs(l.Fragment,{children:[(o==null?void 0:o.staked)!==void 0&&l.jsxs("div",{className:"flex flex-col mb-1",children:[l.jsx(X,{variant:"body1",className:"text-accent-secondary font-medium !text-xs",children:"Staked Balance"}),x(o.staked)]}),(o==null?void 0:o.stakable)!==void 0&&l.jsxs("div",{className:"flex flex-col",children:[l.jsx(X,{variant:"body1",className:"text-accent-secondary font-medium !text-xs",children:"Stakable Balance"}),l.jsx("div",{className:"flex items-center gap-2",children:x(o.stakable,f||u)})]})]}),b=()=>l.jsx(l.Fragment,{children:(o==null?void 0:o.available)!==void 0&&l.jsxs("div",{className:"flex flex-col",children:[l.jsx(X,{variant:"body1",className:"text-accent-secondary font-medium !text-xs",children:"Balance"}),x(o.available)]})});return l.jsx("div",{className:N.twJoin("bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-[4px] p-3 flex-1 md:p-4",a),children:l.jsxs("div",{className:"flex flex-col w-full",children:[l.jsxs("div",{className:"flex items-center gap-2.5 mb-2 md:mb-3",children:[l.jsx(or,{alt:t||e,url:r||"",size:"large",className:"w-8 h-8 md:w-10 md:h-10 flex-shrink-0"}),l.jsxs("div",{className:"flex flex-1 flex-col items-start min-w-0",children:[l.jsxs(X,{variant:"body1",className:"text-accent-primary font-medium text-xs",children:[e," Wallet"]}),l.jsxs("div",{className:"flex items-center gap-1",children:[s?l.jsx(X,{className:"text-accent-secondary text-xs",children:"Copied ✓"}):l.jsx(cs,{className:"text-accent-secondary text-xs",value:n,symbols:6}),l.jsx("button",{onClick:i,className:"flex-shrink-0 p-1 rounded hover:bg-[#d7e1e7] dark:hover:bg-[#252525] transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80",children:l.jsx(hn,{size:14,className:"md:w-4 md:h-4"})})]})]})]}),o&&c&&l.jsx("div",{className:"space-y-2",children:e==="Bitcoin"?g():b()})]})})},va=({value:e,onChange:t,className:r="",disabled:n=!1})=>{const s=()=>{n||t(!e)};return l.jsx("button",{type:"button",onClick:s,disabled:n,className:N.twJoin("relative inline-flex h-[31px] w-[55px] items-center rounded-full transition-colors duration-300 ease-in-out","focus:outline-none focus:ring-2 focus:ring-primary-main focus:ring-offset-2",e?"bg-primary-main dark:bg-primary-light":"bg-[#78788029]",n&&"opacity-50 cursor-not-allowed",r),style:{border:"none"},"aria-pressed":e,"aria-label":"Toggle",children:l.jsx("span",{className:N.twJoin("inline-block w-[27px] h-[27px] transform rounded-full bg-white transition-transform duration-300 ease-in-out","flex items-center justify-center shadow-sm",e?"translate-x-[26px]":"translate-x-[2px]")})})},Hn=({icon:e,title:t,status:r,value:n,onChange:s,className:i,tooltip:a,infoIcon:o})=>l.jsxs("div",{className:N.twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0",i),children:[l.jsxs("div",{className:"flex items-center gap-4",children:[e,l.jsxs("div",{className:"flex flex-col",children:[o&&a?l.jsxs(X,{as:"span",variant:"body2",className:"text-accent-primary font-medium",children:[t,l.jsx(In,{tooltip:a,placement:"bottom",attachToChildren:!0,offset:[20,8],children:l.jsx("span",{className:"inline-block align-middle text-secondary-strokeDark cursor-pointer ml-1",children:o})})]}):l.jsx(In,{tooltip:a,attachToChildren:!!a,placement:"bottom",children:l.jsx(X,{as:"span",variant:"body2",className:"text-accent-primary font-medium",children:t})}),l.jsx(X,{className:"text-accent-secondary !text-xs",children:r})]})]}),l.jsx(va,{value:n,onChange:s})]}),ga=({title:e,value:t,isCopied:r,onCopy:n,className:s,icon:i})=>l.jsx("div",{className:N.twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0",s),children:l.jsx("div",{className:"flex flex-col w-full",children:l.jsxs("div",{className:"flex items-center gap-4",children:[i&&l.jsx("div",{className:"flex-shrink-0",children:i}),l.jsxs("div",{className:"flex w-full",children:[l.jsxs("div",{className:"flex flex-col w-full",children:[l.jsx(X,{variant:"body2",className:"text-accent-primary font-medium text-sm",children:e}),l.jsx("div",{className:"flex items-center justify-between w-full",children:l.jsx("div",{className:"flex-1 min-w-0",children:r?l.jsx(X,{className:"text-accent-secondary !text-xs truncate whitespace-nowrap",children:"Copied ✓"}):l.jsx(cs,{className:"text-accent-secondary !text-xs",value:t,symbols:6})})})]}),l.jsx("button",{onClick:n,className:"flex-shrink-0 ml-3 p-1 rounded hover:bg-surface-tertiary transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80 self-center",children:l.jsx(hn,{size:16})})]})]})})}),Uf=({trigger:e,btcAddress:t,bbnAddress:r,selectedWallets:n,ordinalsExcluded:s,linkedDelegationsVisibility:i,onIncludeOrdinals:a,onExcludeOrdinals:o,onDisplayLinkedDelegations:c,publicKeyNoCoord:f,onDisconnect:u,forceOpen:d=!1,onOpenChange:h,btcBalances:v,bbnBalances:x,btcCoinSymbol:g,bbnCoinSymbol:b,balancesLoading:C=!1,hasUnconfirmedTransactions:w=!1,formatBalance:E,className:S,mobileMode:A="dialog",copy:O})=>{var G,te,ue,re;const{copyToClipboard:k,isCopied:$}=is({timeout:O==null?void 0:O.timeout}),I=(O==null?void 0:O.isCopied)??$,W=(O==null?void 0:O.copyToClipboard)??k,[_,F]=p.useState(d),P=p.useCallback(fe=>{F(fe),h==null||h(fe)},[h]),H=p.useCallback(()=>{F(!1),u()},[u]),Y=fe=>{if(!(!E||!fe))return Le=>E(Le,fe)},J=g||"BTC",q=b||"BABY";return l.jsx(ls,{trigger:e,open:_,onOpenChange:P,mobileMode:A,className:N.twJoin("shadow-lg border border-[#38708533] bg-[#FFFFFF] dark:bg-[#252525] dark:border-[#404040] rounded-lg",S),children:l.jsxs("div",{className:"p-4 space-y-6 w-full text-primary-main",children:[l.jsxs("div",{className:"flex flex-row gap-2 w-full md:flex-col",children:[l.jsx($n,{walletType:"Bitcoin",walletName:(G=n.BTC)==null?void 0:G.name,walletIcon:(te=n.BTC)==null?void 0:te.icon,address:t,isCopied:I("btc"),onCopy:()=>W("btc",t),balances:v,coinSymbol:J,isBalanceLoading:C,hasUnconfirmedTransactions:w,formatBalance:Y(J)}),l.jsx($n,{walletType:"Babylon",walletName:(ue=n.BBN)==null?void 0:ue.name,walletIcon:(re=n.BBN)==null?void 0:re.icon,address:r,isCopied:I("bbn"),onCopy:()=>W("bbn",r),balances:x,coinSymbol:q,isBalanceLoading:C,formatBalance:Y(q)})]}),l.jsxs("div",{className:"flex flex-col w-full bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-lg md:bg-transparent md:dark:bg-transparent md:border-none md:gap-8",children:[l.jsx(Hn,{icon:l.jsx(Kr,{variant:"primary",background:!0,rounded:!0,children:l.jsx(Ki,{})}),title:"Using Inscriptions",status:s?"Off":"On",value:!s,onChange:fe=>fe?a():o()}),l.jsx(Hn,{icon:l.jsx(Kr,{variant:"primary",background:!0,rounded:!0,children:l.jsx(Yi,{})}),title:l.jsxs(l.Fragment,{children:["Linked Wallet",l.jsx("br",{className:"hidden md:block"}),l.jsx("span",{className:"md:hidden",children:" "}),"Stakes"]}),status:i?"On":"Off",value:i,onChange:c,tooltip:"Linked Wallet Stakes show all stakes created with the same Bitcoin wallet, even if different BABY wallets were used. It helps you track and manage them in one place.",infoIcon:l.jsx(ss,{size:14,variant:"secondary"})}),l.jsx(ga,{title:"Bitcoin Public Key",value:f,isCopied:I("publicKey"),onCopy:()=>W("publicKey",f),icon:l.jsx(Kr,{variant:"primary",background:!0,rounded:!0,children:l.jsx(Xi,{})}),className:"rounded-b-lg rounded-t-none md:rounded-none"})]}),l.jsx("div",{className:"pt-2",children:l.jsx(Jn,{onClick:H,fluid:!0,children:"Disconnect Wallets"})})]})})};function qf({className:e,...t}){const n=Yt(Cn)?Xt:Ir;return l.jsx(n,{...t,className:N.twMerge("w-[41.25rem] max-w-full",e)})}const Zf=({open:e,onClose:t,title:r="Unbonding",description:n,reward:s,amountUsd:i="",onChange:a=()=>{},onKeyDown:o=()=>{},disabled:c=!1,warningText:f,actionButtonText:u="Unbond",onActionClick:d})=>l.jsxs(qf,{open:e,onClose:t,children:[l.jsx(Br,{title:r,onClose:t,className:"text-accent-primary"}),l.jsxs(Pr,{style:{maxHeight:Yo},className:"no-scrollbar mt-4 flex flex-col gap-6 overflow-y-auto text-accent-primary",children:[n&&l.jsx("div",{children:l.jsx(X,{variant:"body2",className:"text-accent-secondary whitespace-pre-line",children:n})}),l.jsx(hr,{className:"flex w-full flex-col content-center justify-between gap-4",children:l.jsx(gn,{amount:s.amount,currencyIcon:s.currencyIcon,currencyName:s.currencyName,placeholder:s.placeholder??"Enter Amount",displayBalance:s.displayBalance,balanceDetails:s.balanceDetails,min:s.min??"0",step:s.step??"any",autoFocus:!1,onChange:a,onKeyDown:o,amountUsd:i,disabled:c,subtitle:`Staked: ${s.stakedAmount||0} ${s.stakedTokenName||s.currencyName}`})}),f&&l.jsx(wo,{children:f})]}),u&&l.jsx(vn,{className:"flex justify-end mt-[80px]",children:l.jsx(Me,{onClick:d,children:u})})]}),Xf={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Yf({className:e,orientation:t="vertical",children:r}){return l.jsx("div",{className:N.twMerge("bbn-list-legacy",`bbn-list-legacy-${t}`,e),children:p.Children.map(r,n=>p.isValidElement(n)?p.cloneElement(n,{orientation:Xf[t]}):n)})}function Kf({className:e,orientation:t="horizontal",title:r,value:n,suffix:s}){return l.jsxs("div",{className:N.twJoin("bbn-list-item-legacy",`bbn-list-item-legacy-${t}`,e),children:[l.jsx(X,{as:"div",className:N.twJoin("bbn-list-title-legacy",`bbn-list-title-legacy-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),l.jsxs(X,{as:"div",className:N.twJoin("bbn-list-value-legacy",`bbn-list-value-legacy-${t}`),variant:"body1",children:[n,s]})]})}exports.Accordion=ja;exports.AccordionDetails=Sa;exports.AccordionSummary=Ca;exports.ActivityCard=Bf;exports.ActivityCardActionSection=aa;exports.ActivityCardAmountSection=la;exports.ActivityCardDetailsSection=ua;exports.ActivityListItem=ca;exports.AmountItem=gn;exports.AmountSubsection=_f;exports.Avatar=or;exports.AvatarGroup=Ea;exports.BBNFeeAmount=ia;exports.BTCFeeAmount=sa;exports.BTCFeeRate=na;exports.Badge=Tc;exports.BitcoinPublicKeyIcon=Xi;exports.BugReportIcon=oc;exports.Button=Me;exports.Card=fo;exports.Cell=co;exports.Checkbox=ki;exports.CheckboxField=hf;exports.ChevronLeftIcon=ic;exports.Chip=lc;exports.CloseIcon=ns;exports.CollapseIcon=Qi;exports.Column=ao;exports.Copy=bo;exports.CopyIcon=hn;exports.CoreUIProvider=tc;exports.CounterButton=vo;exports.Dialog=Ir;exports.DialogBody=Pr;exports.DialogFooter=vn;exports.DialogHeader=Br;exports.DisplayHash=cs;exports.FeeItem=mr;exports.FeesSection=Mf;exports.FinalityProviderItem=Ns;exports.FinalityProviderLogo=Xo;exports.FinalityProviderSubsection=Tf;exports.Form=uf;exports.FormControl=Vr;exports.Heading=dn;exports.HiddenField=Zo;exports.Hint=In;exports.IconButton=zn;exports.InfoIcon=ss;exports.Input=Dr;exports.LinkWalletIcon=Yi;exports.List=Lc;exports.ListItem=po;exports.ListItemLegacy=Kf;exports.ListLegacy=Yf;exports.Loader=to;exports.Menu=ls;exports.MenuDrawer=as;exports.MenuItem=xo;exports.MobileDialog=Xt;exports.NumberField=mf;exports.OpenIcon=eo;exports.Popover=pn;exports.Portal=Mr;exports.PreviewModal=If;exports.Radio=Li;exports.RadioField=vf;exports.RewardsPreviewModal=$f;exports.RewardsSubsection=Hf;exports.ScrollLocker=sc;exports.Select=ts;exports.SelectField=gf;exports.SettingMenu=Rt;exports.SettingMenuCustomContent=ha;exports.SettingMenuDescription=pr;exports.SettingMenuGroup=ma;exports.SettingMenuItem=Os;exports.SettingMenuSubMenu=pa;exports.SettingMenuTitle=da;exports.StatItem=Fc;exports.SubMenu=yo;exports.SubMenuItem=Mc;exports.SubSection=hr;exports.Table=uo;exports.TableElement=yf;exports.Text=X;exports.TextField=pf;exports.ThemeIcon=ac;exports.ThemedIcon=Kr;exports.Toggle=mo;exports.Total=oa;exports.UnbondingModal=Zf;exports.UsingInscriptionIcon=Ki;exports.ValidatorAvatar=Aa;exports.ValidatorSelector=Cf;exports.WalletDisconnectButton=Jn;exports.WalletMenu=Uf;exports.WalletMenuCard=$n;exports.WalletMenuInfoItem=ga;exports.WalletMenuSettingItem=Hn;exports.WalletToggle=va;exports.Warning=wo;exports.WarningIcon=Gi;exports.iconColorVariants=ze;exports.useClickOutside=Ji;exports.useControlledState=zt;exports.useCopy=is;exports.useCoreUI=Wi;exports.useDrawerAnimation=ho;exports.useField=Gt;exports.useFieldState=ff;exports.useFormContext=Kt;exports.useFormState=bs;exports.useFrozenColumns=io;exports.useIsMobile=Yt;exports.useMemoizedArray=zi;exports.useMenuContext=os;exports.useModalManager=rs;exports.useResizeObserver=Ui;exports.useTableScroll=so;exports.useTableSort=lo;exports.useWatch=ws;
3
3
  //# sourceMappingURL=index.cjs.js.map