@babylonlabs-io/core-ui 1.9.1 → 1.9.2
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,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),m=require("react"),k=require("tailwind-merge"),bn=require("react-dom");function yn(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 Ae=yn(m),Ai=yn(bn);function ze({value:e,defaultValue:t,onStateChange:r}={}){const[n,i]=m.useState(t),{current:s}=m.useRef(e!=null),a=s?e:n,o=m.useCallback(l=>{s||i(l),r==null||r(l)},[s,r,i]);return[a,o]}const lr=m.createContext({disabled:!1,expanded:!1});function Vi({expanded:e,defaultExpanded:t,onChange:r,className:n,disabled:i=!1,children:s}){const[a=!1,o]=ze({value:e,defaultValue:t,onStateChange:r}),l=m.useCallback(()=>{o(!a)},[o,a]),f=m.useMemo(()=>({defaultExpanded:t,disabled:i,expanded:a&&!i,toggle:i?void 0:l}),[t,a,i,l]);return c.jsx(lr.Provider,{value:f,children:c.jsx("div",{className:k.twJoin("bbn-accordion",i&&"bbn-accordion-disabled",n),children:s})})}const Ze=m.forwardRef(({variant:e="contained",size:t="large",color:r="primary",fluid:n=!1,className:i,disabled:s,...a},o)=>c.jsx("button",{...a,disabled:s,ref:o,className:k.twJoin("bbn-btn",`bbn-btn-${e}`,`bbn-btn-${r}`,`bbn-btn-${t}`,n&&"bbn-btn-fluid",i)}));Ze.displayName="Button";const cr=({className:e,...t})=>c.jsx("button",{...t,className:k.twJoin("bbn-btn-icon",e)}),xn=m.forwardRef(({className:e,...t},r)=>c.jsx(Ze,{...t,ref:r,variant:"contained",className:k.twJoin("!bg-error-main text-white font-medium !text-sm hover:!bg-error-main/90 transition-colors",e)}));xn.displayName="WalletDisconnectButton";function Li({className:e,iconClassName:t,children:r,renderIcon:n=()=>null}){const{expanded:i,toggle:s}=m.useContext(lr),a=n(i);return c.jsxs("div",{className:k.twJoin("bbn-accordion-summary",e),onClick:s,children:[r,a&&c.jsx(cr,{className:k.twJoin("bbn-accordion-icon",t),children:a})]})}function ur(e,t){return typeof e!="number"?typeof t=="number"?ur(t):t:`${e}px`}function Di(e=!0){const[t,r]=m.useState("0px"),[n,i]=m.useState(),s=m.useRef(null);return m.useEffect(()=>{const a=new ResizeObserver(o=>{const[l]=o;r(ur(l.target.clientHeight)??"0px")});i(a)},[]),m.useEffect(function(){const{current:o}=s;if(!(!e||!o))return n==null||n.observe(o),()=>{n==null||n.unobserve(o)}},[e,n]),{height:t,ref:s}}function _i({unmountOnExit:e=!1,animationDuration:t=200,className:r,wrapperClassName:n,children:i}){const{expanded:s}=m.useContext(lr),[a,o]=m.useState(s),l=a||!e,{height:f,ref:u}=Di(l);return m.useEffect(function(){if(s===a)return;if(s){o(!0);return}const p=setTimeout(o,t,!1);return()=>{clearTimeout(p)}},[s,a,t]),c.jsx("div",{className:k.twJoin("bbn-accordion-details",n),style:{height:s?f:"0px",visibility:a?"visible":"hidden",transitionDuration:`${t}ms`},children:l?c.jsx("div",{ref:u,className:k.twJoin("bbn-accordion-content",r),children:i}):null})}const z=m.forwardRef(({variant:e="body1",as:t="p",children:r,className:n,...i},s)=>m.createElement(t,{...i,ref:s,className:k.twJoin(`bbn-text-${e}`,n)},r));z.displayName="Text";const zt=m.forwardRef(({variant:e,as:t=e,children:r,className:n,...i},s)=>m.createElement(t,{...i,ref:s,className:k.twJoin(`bbn-${e}`,n)},r));zt.displayName="Heading";function fr({className:e,style:t,size:r="large",variant:n="circular",alt:i,url:s,children:a}){return c.jsx("div",{style:t,className:k.twJoin("bbn-avatar",`bbn-avatar-${r}`,`bbn-avatar-${n}`,e),children:s?c.jsx("img",{className:"bbn-avatar-img",src:s,alt:i}):a})}const Mi=({max:e=1/0,className:t,children:r,avatarClassName:n,variant:i,...s})=>{const a=m.Children.count(r);return c.jsxs("div",{className:k.twJoin("bbn-avatar-group",t),children:[m.Children.map(r,(o,l)=>m.isValidElement(o)&&l+1<=e?m.cloneElement(o,{...s,className:k.twMerge(n,o.props.className),variant:i}):null),a>e&&c.jsxs(fr,{size:s.size,variant:i,className:n,children:["+",a-e]})]})},wn=m.forwardRef(function({label:t,checked:r,defaultChecked:n=!1,inputProps:i,orientation:s="left",disabled:a=!1,className:o,inputType:l,labelClassName:f,renderIcon:u,onChange:d,...p},g){const[C=!1,y]=ze({value:r,defaultValue:n,onStateChange:d});function x(w){var M;y(w.currentTarget.checked),(M=i==null?void 0:i.onChange)==null||M.call(i,w)}const D=c.jsxs("span",{className:k.twJoin("bbn-switcher",a&&"bbn-switcher-disabled",o),children:[u(C),c.jsx("input",{ref:g,type:l,disabled:a,className:"bbn-switcher-input",...p,...i,checked:C,onChange:x})]});return t?c.jsxs(z,{as:"label",variant:"body1",className:k.twJoin("bbn-switcher-label",s==="left"?"bbn-switcher-left":"bbn-switcher-right",f),children:[D,t]}):D}),Ti={false:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.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:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.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"})})},jn=m.forwardRef(function(t,r){return c.jsx(wn,{ref:r,...t,inputType:"checkbox",renderIcon:n=>Ti[n.toString()]})}),Ri={true:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.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:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.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"})})},Cn=m.forwardRef(function(t,r){return c.jsx(wn,{ref:r,...t,inputType:"radio",renderIcon:n=>Ri[n.toString()]})});var Nn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Hr=m.createContext&&m.createContext(Nn),Pi=["attr","size","title"];function Bi(e,t){if(e==null)return{};var r=Ii(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ii(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 Pt(){return Pt=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},Pt.apply(this,arguments)}function Ur(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ur(Object(r),!0).forEach(function(n){$i(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ur(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $i(e,t,r){return t=Hi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hi(e){var t=Ui(e,"string");return typeof t=="symbol"?t:t+""}function Ui(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 On(e){return e&&e.map((t,r)=>m.createElement(t.tag,Bt({key:r},t.attr),On(t.child)))}function yt(e){return t=>m.createElement(Wi,Pt({attr:Bt({},e.attr)},t),On(e.child))}function Wi(e){var t=r=>{var{attr:n,size:i,title:s}=e,a=Bi(e,Pi),o=i||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),m.createElement("svg",Pt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,a,{className:l,style:Bt(Bt({color:e.color||r.color},r.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&m.createElement("title",null,s),e.children)};return Hr!==void 0?m.createElement(Hr.Consumer,null,r=>t(r)):t(Nn)}function Ji(e){return yt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 16L6 10H18L12 16Z"},child:[]}]})(e)}function qi(e){return yt({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 zi(e){return yt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 8L18 14H6L12 8Z"},child:[]}]})(e)}var Wr=function(t){return t.reduce(function(r,n){var i=n[0],s=n[1];return r[i]=s,r},{})},Jr=typeof window<"u"&&window.document&&window.document.createElement?Ae.useLayoutEffect:Ae.useEffect,le="top",ve="bottom",me="right",ce="left",dr="auto",xt=[le,ve,me,ce],tt="start",mt="end",Zi="clippingParents",kn="viewport",ct="popper",Xi="reference",qr=xt.reduce(function(e,t){return e.concat([t+"-"+tt,t+"-"+mt])},[]),En=[].concat(xt,[dr]).reduce(function(e,t){return e.concat([t,t+"-"+tt,t+"-"+mt])},[]),Yi="beforeRead",Gi="read",Ki="afterRead",Qi="beforeMain",es="main",ts="afterMain",rs="beforeWrite",ns="write",is="afterWrite",ss=[Yi,Gi,Ki,Qi,es,ts,rs,ns,is];function ke(e){return e?(e.nodeName||"").toLowerCase():null}function de(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xe(e){var t=de(e).Element;return e instanceof t||e instanceof Element}function pe(e){var t=de(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function hr(e){if(typeof ShadowRoot>"u")return!1;var t=de(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function os(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},i=t.attributes[r]||{},s=t.elements[r];!pe(s)||!ke(s)||(Object.assign(s.style,n),Object.keys(i).forEach(function(a){var o=i[a];o===!1?s.removeAttribute(a):s.setAttribute(a,o===!0?"":o)}))})}function as(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 i=t.elements[n],s=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),o=a.reduce(function(l,f){return l[f]="",l},{});!pe(i)||!ke(i)||(Object.assign(i.style,o),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}}const ls={name:"applyStyles",enabled:!0,phase:"write",fn:os,effect:as,requires:["computeStyles"]};function Oe(e){return e.split("-")[0]}var Je=Math.max,It=Math.min,rt=Math.round;function sr(){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 Sn(){return!/^((?!chrome|android).)*safari/i.test(sr())}function nt(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),i=1,s=1;t&&pe(e)&&(i=e.offsetWidth>0&&rt(n.width)/e.offsetWidth||1,s=e.offsetHeight>0&&rt(n.height)/e.offsetHeight||1);var a=Xe(e)?de(e):window,o=a.visualViewport,l=!Sn()&&r,f=(n.left+(l&&o?o.offsetLeft:0))/i,u=(n.top+(l&&o?o.offsetTop:0))/s,d=n.width/i,p=n.height/s;return{width:d,height:p,top:u,right:f+d,bottom:u+p,left:f,x:f,y:u}}function pr(e){var t=nt(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 Fn(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&hr(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Le(e){return de(e).getComputedStyle(e)}function cs(e){return["table","td","th"].indexOf(ke(e))>=0}function Pe(e){return((Xe(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zt(e){return ke(e)==="html"?e:e.assignedSlot||e.parentNode||(hr(e)?e.host:null)||Pe(e)}function zr(e){return!pe(e)||Le(e).position==="fixed"?null:e.offsetParent}function us(e){var t=/firefox/i.test(sr()),r=/Trident/i.test(sr());if(r&&pe(e)){var n=Le(e);if(n.position==="fixed")return null}var i=Zt(e);for(hr(i)&&(i=i.host);pe(i)&&["html","body"].indexOf(ke(i))<0;){var s=Le(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function wt(e){for(var t=de(e),r=zr(e);r&&cs(r)&&Le(r).position==="static";)r=zr(r);return r&&(ke(r)==="html"||ke(r)==="body"&&Le(r).position==="static")?t:r||us(e)||t}function vr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function dt(e,t,r){return Je(e,It(t,r))}function fs(e,t,r){var n=dt(e,t,r);return n>r?r:n}function An(){return{top:0,right:0,bottom:0,left:0}}function Vn(e){return Object.assign({},An(),e)}function Ln(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var ds=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Vn(typeof t!="number"?t:Ln(t,xt))};function hs(e){var t,r=e.state,n=e.name,i=e.options,s=r.elements.arrow,a=r.modifiersData.popperOffsets,o=Oe(r.placement),l=vr(o),f=[ce,me].indexOf(o)>=0,u=f?"height":"width";if(!(!s||!a)){var d=ds(i.padding,r),p=pr(s),g=l==="y"?le:ce,C=l==="y"?ve:me,y=r.rects.reference[u]+r.rects.reference[l]-a[l]-r.rects.popper[u],x=a[l]-r.rects.reference[l],D=wt(s),w=D?l==="y"?D.clientHeight||0:D.clientWidth||0:0,M=y/2-x/2,S=d[g],A=w-p[u]-d[C],V=w/2-p[u]/2+M,N=dt(S,V,A),I=l;r.modifiersData[n]=(t={},t[I]=N,t.centerOffset=N-V,t)}}function ps(e){var t=e.state,r=e.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Fn(t.elements.popper,i)&&(t.elements.arrow=i))}const vs={name:"arrow",enabled:!0,phase:"main",fn:hs,effect:ps,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function it(e){return e.split("-")[1]}var ms={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gs(e,t){var r=e.x,n=e.y,i=t.devicePixelRatio||1;return{x:rt(r*i)/i||0,y:rt(n*i)/i||0}}function Zr(e){var t,r=e.popper,n=e.popperRect,i=e.placement,s=e.variation,a=e.offsets,o=e.position,l=e.gpuAcceleration,f=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=a.x,g=p===void 0?0:p,C=a.y,y=C===void 0?0:C,x=typeof u=="function"?u({x:g,y}):{x:g,y};g=x.x,y=x.y;var D=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),M=ce,S=le,A=window;if(f){var V=wt(r),N="clientHeight",I="clientWidth";if(V===de(r)&&(V=Pe(r),Le(V).position!=="static"&&o==="absolute"&&(N="scrollHeight",I="scrollWidth")),V=V,i===le||(i===ce||i===me)&&s===mt){S=ve;var B=d&&V===A&&A.visualViewport?A.visualViewport.height:V[N];y-=B-n.height,y*=l?1:-1}if(i===ce||(i===le||i===ve)&&s===mt){M=me;var $=d&&V===A&&A.visualViewport?A.visualViewport.width:V[I];g-=$-n.width,g*=l?1:-1}}var R=Object.assign({position:o},f&&ms),L=u===!0?gs({x:g,y},de(r)):{x:g,y};if(g=L.x,y=L.y,l){var P;return Object.assign({},R,(P={},P[S]=w?"0":"",P[M]=D?"0":"",P.transform=(A.devicePixelRatio||1)<=1?"translate("+g+"px, "+y+"px)":"translate3d("+g+"px, "+y+"px, 0)",P))}return Object.assign({},R,(t={},t[S]=w?y+"px":"",t[M]=D?g+"px":"",t.transform="",t))}function bs(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=n===void 0?!0:n,s=r.adaptive,a=s===void 0?!0:s,o=r.roundOffsets,l=o===void 0?!0:o,f={placement:Oe(t.placement),variation:it(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Zr(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Zr(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ys={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:bs,data:{}};var Dt={passive:!0};function xs(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,s=i===void 0?!0:i,a=n.resize,o=a===void 0?!0:a,l=de(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&f.forEach(function(u){u.addEventListener("scroll",r.update,Dt)}),o&&l.addEventListener("resize",r.update,Dt),function(){s&&f.forEach(function(u){u.removeEventListener("scroll",r.update,Dt)}),o&&l.removeEventListener("resize",r.update,Dt)}}const ws={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:xs,data:{}};var js={left:"right",right:"left",bottom:"top",top:"bottom"};function Mt(e){return e.replace(/left|right|bottom|top/g,function(t){return js[t]})}var Cs={start:"end",end:"start"};function Xr(e){return e.replace(/start|end/g,function(t){return Cs[t]})}function mr(e){var t=de(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function gr(e){return nt(Pe(e)).left+mr(e).scrollLeft}function Ns(e,t){var r=de(e),n=Pe(e),i=r.visualViewport,s=n.clientWidth,a=n.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;var f=Sn();(f||!f&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o+gr(e),y:l}}function Os(e){var t,r=Pe(e),n=mr(e),i=(t=e.ownerDocument)==null?void 0:t.body,s=Je(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Je(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-n.scrollLeft+gr(e),l=-n.scrollTop;return Le(i||r).direction==="rtl"&&(o+=Je(r.clientWidth,i?i.clientWidth:0)-s),{width:s,height:a,x:o,y:l}}function br(e){var t=Le(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function Dn(e){return["html","body","#document"].indexOf(ke(e))>=0?e.ownerDocument.body:pe(e)&&br(e)?e:Dn(Zt(e))}function ht(e,t){var r;t===void 0&&(t=[]);var n=Dn(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),s=de(n),a=i?[s].concat(s.visualViewport||[],br(n)?n:[]):n,o=t.concat(a);return i?o:o.concat(ht(Zt(a)))}function or(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ks(e,t){var r=nt(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 Yr(e,t,r){return t===kn?or(Ns(e,r)):Xe(t)?ks(t,r):or(Os(Pe(e)))}function Es(e){var t=ht(Zt(e)),r=["absolute","fixed"].indexOf(Le(e).position)>=0,n=r&&pe(e)?wt(e):e;return Xe(n)?t.filter(function(i){return Xe(i)&&Fn(i,n)&&ke(i)!=="body"}):[]}function Ss(e,t,r,n){var i=t==="clippingParents"?Es(e):[].concat(t),s=[].concat(i,[r]),a=s[0],o=s.reduce(function(l,f){var u=Yr(e,f,n);return l.top=Je(u.top,l.top),l.right=It(u.right,l.right),l.bottom=It(u.bottom,l.bottom),l.left=Je(u.left,l.left),l},Yr(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 _n(e){var t=e.reference,r=e.element,n=e.placement,i=n?Oe(n):null,s=n?it(n):null,a=t.x+t.width/2-r.width/2,o=t.y+t.height/2-r.height/2,l;switch(i){case le:l={x:a,y:t.y-r.height};break;case ve:l={x:a,y:t.y+t.height};break;case me:l={x:t.x+t.width,y:o};break;case ce:l={x:t.x-r.width,y:o};break;default:l={x:t.x,y:t.y}}var f=i?vr(i):null;if(f!=null){var u=f==="y"?"height":"width";switch(s){case tt:l[f]=l[f]-(t[u]/2-r[u]/2);break;case mt:l[f]=l[f]+(t[u]/2-r[u]/2);break}}return l}function gt(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=n===void 0?e.placement:n,s=r.strategy,a=s===void 0?e.strategy:s,o=r.boundary,l=o===void 0?Zi:o,f=r.rootBoundary,u=f===void 0?kn:f,d=r.elementContext,p=d===void 0?ct:d,g=r.altBoundary,C=g===void 0?!1:g,y=r.padding,x=y===void 0?0:y,D=Vn(typeof x!="number"?x:Ln(x,xt)),w=p===ct?Xi:ct,M=e.rects.popper,S=e.elements[C?w:p],A=Ss(Xe(S)?S:S.contextElement||Pe(e.elements.popper),l,u,a),V=nt(e.elements.reference),N=_n({reference:V,element:M,placement:i}),I=or(Object.assign({},M,N)),B=p===ct?I:V,$={top:A.top-B.top+D.top,bottom:B.bottom-A.bottom+D.bottom,left:A.left-B.left+D.left,right:B.right-A.right+D.right},R=e.modifiersData.offset;if(p===ct&&R){var L=R[i];Object.keys($).forEach(function(P){var U=[me,ve].indexOf(P)>=0?1:-1,G=[le,ve].indexOf(P)>=0?"y":"x";$[P]+=L[G]*U})}return $}function Fs(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=r.boundary,s=r.rootBoundary,a=r.padding,o=r.flipVariations,l=r.allowedAutoPlacements,f=l===void 0?En:l,u=it(n),d=u?o?qr:qr.filter(function(C){return it(C)===u}):xt,p=d.filter(function(C){return f.indexOf(C)>=0});p.length===0&&(p=d);var g=p.reduce(function(C,y){return C[y]=gt(e,{placement:y,boundary:i,rootBoundary:s,padding:a})[Oe(y)],C},{});return Object.keys(g).sort(function(C,y){return g[C]-g[y]})}function As(e){if(Oe(e)===dr)return[];var t=Mt(e);return[Xr(e),t,Xr(t)]}function Vs(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,s=i===void 0?!0:i,a=r.altAxis,o=a===void 0?!0:a,l=r.fallbackPlacements,f=r.padding,u=r.boundary,d=r.rootBoundary,p=r.altBoundary,g=r.flipVariations,C=g===void 0?!0:g,y=r.allowedAutoPlacements,x=t.options.placement,D=Oe(x),w=D===x,M=l||(w||!C?[Mt(x)]:As(x)),S=[x].concat(M).reduce(function(De,be){return De.concat(Oe(be)===dr?Fs(t,{placement:be,boundary:u,rootBoundary:d,padding:f,flipVariations:C,allowedAutoPlacements:y}):be)},[]),A=t.rects.reference,V=t.rects.popper,N=new Map,I=!0,B=S[0],$=0;$<S.length;$++){var R=S[$],L=Oe(R),P=it(R)===tt,U=[le,ve].indexOf(L)>=0,G=U?"width":"height",q=gt(t,{placement:R,boundary:u,rootBoundary:d,altBoundary:p,padding:f}),K=U?P?me:ce:P?ve:le;A[G]>V[G]&&(K=Mt(K));var we=Mt(K),oe=[];if(s&&oe.push(q[L]<=0),o&&oe.push(q[K]<=0,q[we]<=0),oe.every(function(De){return De})){B=R,I=!1;break}N.set(R,oe)}if(I)for(var Se=C?3:1,Qe=function(be){var $e=S.find(function(_e){var je=N.get(_e);if(je)return je.slice(0,be).every(function(He){return He})});if($e)return B=$e,"break"},Be=Se;Be>0;Be--){var Ie=Qe(Be);if(Ie==="break")break}t.placement!==B&&(t.modifiersData[n]._skip=!0,t.placement=B,t.reset=!0)}}const Ls={name:"flip",enabled:!0,phase:"main",fn:Vs,requiresIfExists:["offset"],data:{_skip:!1}};function Gr(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 Kr(e){return[le,me,ve,ce].some(function(t){return e[t]>=0})}function Ds(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,s=t.modifiersData.preventOverflow,a=gt(t,{elementContext:"reference"}),o=gt(t,{altBoundary:!0}),l=Gr(a,n),f=Gr(o,i,s),u=Kr(l),d=Kr(f);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const _s={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ds};function Ms(e,t,r){var n=Oe(e),i=[ce,le].indexOf(n)>=0?-1:1,s=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,a=s[0],o=s[1];return a=a||0,o=(o||0)*i,[ce,me].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}function Ts(e){var t=e.state,r=e.options,n=e.name,i=r.offset,s=i===void 0?[0,0]:i,a=En.reduce(function(u,d){return u[d]=Ms(d,t.rects,s),u},{}),o=a[t.placement],l=o.x,f=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=f),t.modifiersData[n]=a}const Rs={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ts};function Ps(e){var t=e.state,r=e.name;t.modifiersData[r]=_n({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Bs={name:"popperOffsets",enabled:!0,phase:"read",fn:Ps,data:{}};function Is(e){return e==="x"?"y":"x"}function $s(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,s=i===void 0?!0:i,a=r.altAxis,o=a===void 0?!1:a,l=r.boundary,f=r.rootBoundary,u=r.altBoundary,d=r.padding,p=r.tether,g=p===void 0?!0:p,C=r.tetherOffset,y=C===void 0?0:C,x=gt(t,{boundary:l,rootBoundary:f,padding:d,altBoundary:u}),D=Oe(t.placement),w=it(t.placement),M=!w,S=vr(D),A=Is(S),V=t.modifiersData.popperOffsets,N=t.rects.reference,I=t.rects.popper,B=typeof y=="function"?y(Object.assign({},t.rects,{placement:t.placement})):y,$=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(V){if(s){var P,U=S==="y"?le:ce,G=S==="y"?ve:me,q=S==="y"?"height":"width",K=V[S],we=K+x[U],oe=K-x[G],Se=g?-I[q]/2:0,Qe=w===tt?N[q]:I[q],Be=w===tt?-I[q]:-N[q],Ie=t.elements.arrow,De=g&&Ie?pr(Ie):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:An(),$e=be[U],_e=be[G],je=dt(0,N[q],De[q]),He=M?N[q]/2-Se-je-$e-$.mainAxis:Qe-je-$e-$.mainAxis,at=M?-N[q]/2+Se+je+_e+$.mainAxis:Be+je+_e+$.mainAxis,lt=t.elements.arrow&&wt(t.elements.arrow),Ot=lt?S==="y"?lt.clientTop||0:lt.clientLeft||0:0,kt=(P=R==null?void 0:R[S])!=null?P:0,Et=K+He-kt-Ot,St=K+at-kt,Ft=dt(g?It(we,Et):we,K,g?Je(oe,St):oe);V[S]=Ft,L[S]=Ft-K}if(o){var At,Br=S==="x"?le:ce,Vt=S==="x"?ve:me,h=V[A],v=A==="y"?"height":"width",b=h+x[Br],F=h-x[Vt],O=[le,ce].indexOf(D)!==-1,j=(At=R==null?void 0:R[A])!=null?At:0,T=O?b:h-N[v]-I[v]-j+$.altAxis,H=O?h+N[v]+I[v]-j-$.altAxis:F,W=g&&O?fs(T,h,H):dt(g?T:b,h,g?H:F);V[A]=W,L[A]=W-h}t.modifiersData[n]=L}}const Hs={name:"preventOverflow",enabled:!0,phase:"main",fn:$s,requiresIfExists:["offset"]};function Us(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ws(e){return e===de(e)||!pe(e)?mr(e):Us(e)}function Js(e){var t=e.getBoundingClientRect(),r=rt(t.width)/e.offsetWidth||1,n=rt(t.height)/e.offsetHeight||1;return r!==1||n!==1}function qs(e,t,r){r===void 0&&(r=!1);var n=pe(t),i=pe(t)&&Js(t),s=Pe(t),a=nt(e,i,r),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((ke(t)!=="body"||br(s))&&(o=Ws(t)),pe(t)?(l=nt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=gr(s))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function zs(e){var t=new Map,r=new Set,n=[];e.forEach(function(s){t.set(s.name,s)});function i(s){r.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(o){if(!r.has(o)){var l=t.get(o);l&&i(l)}}),n.push(s)}return e.forEach(function(s){r.has(s.name)||i(s)}),n}function Zs(e){var t=zs(e);return ss.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function Xs(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function Ys(e){var t=e.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var Qr={placement:"bottom",modifiers:[],strategy:"absolute"};function en(){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 Gs(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,i=t.defaultOptions,s=i===void 0?Qr:i;return function(o,l,f){f===void 0&&(f=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Qr,s),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],p=!1,g={state:u,setOptions:function(D){var w=typeof D=="function"?D(u.options):D;y(),u.options=Object.assign({},s,u.options,w),u.scrollParents={reference:Xe(o)?ht(o):o.contextElement?ht(o.contextElement):[],popper:ht(l)};var M=Zs(Ys([].concat(n,u.options.modifiers)));return u.orderedModifiers=M.filter(function(S){return S.enabled}),C(),g.update()},forceUpdate:function(){if(!p){var D=u.elements,w=D.reference,M=D.popper;if(en(w,M)){u.rects={reference:qs(w,wt(M),u.options.strategy==="fixed"),popper:pr(M)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function($){return u.modifiersData[$.name]=Object.assign({},$.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],V=A.fn,N=A.options,I=N===void 0?{}:N,B=A.name;typeof V=="function"&&(u=V({state:u,options:I,name:B,instance:g})||u)}}}},update:Xs(function(){return new Promise(function(x){g.forceUpdate(),x(u)})}),destroy:function(){y(),p=!0}};if(!en(o,l))return g;g.setOptions(f).then(function(x){!p&&f.onFirstUpdate&&f.onFirstUpdate(x)});function C(){u.orderedModifiers.forEach(function(x){var D=x.name,w=x.options,M=w===void 0?{}:w,S=x.effect;if(typeof S=="function"){var A=S({state:u,name:D,instance:g,options:M}),V=function(){};d.push(A||V)}})}function y(){d.forEach(function(x){return x()}),d=[]}return g}}var Ks=[ws,Bs,ys,ls,Rs,Ls,Hs,vs,_s],Qs=Gs({defaultModifiers:Ks}),_t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eo=typeof Element<"u",to=typeof Map=="function",ro=typeof Set=="function",no=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Tt(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,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Tt(e[n],t[n]))return!1;return!0}var s;if(to&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;for(s=e.entries();!(n=s.next()).done;)if(!Tt(n.value[1],t.get(n.value[0])))return!1;return!0}if(ro&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(no&&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(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;if(eo&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!Tt(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var io=function(t,r){try{return Tt(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 so=Mn(io);var oo=[],ao=function(t,r,n){n===void 0&&(n={});var i=Ae.useRef(null),s={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||oo},a=Ae.useState({styles:{popper:{position:s.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],l=a[1],f=Ae.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(g){var C=g.state,y=Object.keys(C.elements);Ai.flushSync(function(){l({styles:Wr(y.map(function(x){return[x,C.styles[x]||{}]})),attributes:Wr(y.map(function(x){return[x,C.attributes[x]]}))})})},requires:["computeStyles"]}},[]),u=Ae.useMemo(function(){var p={onFirstUpdate:s.onFirstUpdate,placement:s.placement,strategy:s.strategy,modifiers:[].concat(s.modifiers,[f,{name:"applyStyles",enabled:!1}])};return so(i.current,p)?i.current||p:(i.current=p,p)},[s.onFirstUpdate,s.placement,s.strategy,s.modifiers,f]),d=Ae.useRef();return Jr(function(){d.current&&d.current.setOptions(u)},[u]),Jr(function(){if(!(t==null||r==null)){var p=n.createPopper||Qs,g=p(t,r,u);return d.current=g,function(){g.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}};function jt({children:e,mounted:t=!1,rootClassName:r="portal-root"}){const[n,i]=m.useState(null);return m.useEffect(()=>{if(!t){i(null);return}const s=document.createElement("div");s.className=r,i(s),document.body.appendChild(s);const a=()=>{document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")||document.documentElement.getAttribute("data-mode")==="dark"||document.body.getAttribute("data-mode")==="dark"?(s.classList.add("dark"),s.setAttribute("data-mode","dark")):(s.classList.remove("dark"),s.setAttribute("data-mode","light"))};a();const o=new MutationObserver(a);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-mode"]}),o.observe(document.body,{attributes:!0,attributeFilter:["class","data-mode"]}),()=>{o.disconnect(),document.body.removeChild(s)}},[t]),n?bn.createPortal(e,n):null}function lo(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 Tn(e){const t=m.useRef(e);return lo(t.current,e)||(t.current=e),t.current}function Rn(e,t=()=>null,{enabled:r=!0}={}){const n=Array.isArray(e)?e:[e],i=Tn(n);m.useEffect(()=>{function s(a){r&&i.every(o=>!(o!=null&&o.contains(a.target)))&&t()}return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[i,r,t])}function yr({open:e=!1,className:t,anchorEl:r,placement:n="bottom-start",offset:i=[0,0],children:s,style:a,onClickOutside:o}){const[l,f]=m.useState(null),{styles:u}=ao(r,l,{placement:n,modifiers:[{name:"offset",options:{offset:i}}]});return Rn([l,r],o,{enabled:e}),c.jsx(jt,{mounted:e,children:c.jsx("div",{ref:f,style:{...u.popper,...a},className:k.twJoin("bbn-popover",t),children:s})})}function Pn(e){const[t,r]=m.useState({width:0,height:0});return m.useEffect(()=>{if(!e){r({width:0,height:0});return}const n=new ResizeObserver(([i])=>{r({width:i.target.clientWidth,height:i.target.clientHeight})});return n.observe(e),()=>{n.unobserve(e)}},[e]),t}const co=e=>e.label,xr=m.forwardRef(({disabled:e,className:t,value:r,defaultValue:n,placeholder:i="Select option",open:s,defaultOpen:a,options:o=[],optionClassName:l,popoverClassName:f,state:u="default",onOpen:d,onSelect:p,onClose:g,renderSelectedOption:C=co,...y},x)=>{const D=m.useRef(null);m.useImperativeHandle(x,()=>D.current,[]);const{width:w}=Pn(D.current),[M,S]=ze({value:s,defaultValue:a,onStateChange:R=>void(R?d==null?void 0:d():g==null?void 0:g())}),[A,V]=ze({value:r,defaultValue:n,onStateChange:p}),N=m.useMemo(()=>o.find(R=>R.value===A),[o,A]),I=m.useCallback(R=>{V(R.value),S(!1)},[V,S]),B=m.useCallback(()=>{S(!1)},[S]),$=m.useCallback(()=>{e||S(!M)},[M,e,S]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:D,className:k.twJoin("bbn-select",e&&"bbn-select-disabled",`bbn-select-${u}`,t),onClick:$,tabIndex:e?-1:0,...y,children:[c.jsx("span",{children:N?C(N):i}),c.jsx(qi,{className:k.twJoin("bbn-select-icon",M&&"bbn-select-icon-open"),size:20})]}),c.jsx(yr,{anchorEl:D.current,className:k.twJoin("bbn-select-menu custom-scrollbar",f),open:M&&!e,onClickOutside:B,offset:[0,4],placement:"bottom-start",style:{width:w},children:o.map(R=>c.jsx("div",{className:k.twJoin("bbn-select-option",(N==null?void 0:N.value)===R.value&&"bbn-select-option-selected",l),onClick:()=>I(R),children:R.label},R.value))})]})});xr.displayName="Select";const Xt=m.forwardRef(({className:e,prefix:t,suffix:r,disabled:n=!1,state:i="default",...s},a)=>c.jsxs("div",{className:k.twJoin("bbn-input",n&&"bbn-input-disabled",`bbn-input-${i}`),children:[t&&c.jsx("div",{className:"bbn-input-prefix",children:t}),c.jsx("input",{ref:a,className:k.twJoin("bbn-input-field",e),disabled:n,...s}),r&&c.jsx("div",{className:"bbn-input-suffix",children:r})]}));Xt.displayName="Input";function Ct({children:e,label:t,hint:r,state:n="default",className:i}){return c.jsxs("div",{className:k.twJoin("bbn-form-control",i),children:[t?c.jsxs("label",{className:"bbn-form-control-label",children:[c.jsx("div",{className:"bbn-form-control-title",children:t}),e]}):e,r&&c.jsx("div",{className:k.twJoin("bbn-form-control-hint",`bbn-form-control-hint-${n}`),children:r})]})}const Bn=m.createContext({removeDialog:()=>null,updateDialog:()=>null});function uo({children:e}){const[t,r]=m.useState({}),n=m.useMemo(()=>Object.values(t).some(o=>o),[t]);m.useEffect(function(){if(n){const l=document.body.offsetWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=document.body.offsetWidth-l>=1?ur(document.body.offsetWidth-l)??"":document.body.style.paddingRight}else document.body.style.overflow="",document.body.style.paddingRight=""},[n]);const i=m.useCallback(o=>{r(l=>Reflect.deleteProperty(l,o)?{...l}:l)},[]),s=m.useCallback((o,l)=>{r(f=>({...f,[o]:l}))},[]),a=m.useMemo(()=>({removeDialog:i,updateDialog:s}),[i,s]);return c.jsx(Bn.Provider,{value:a,children:e})}function wr({open:e=!1}={}){const t=m.useId(),[r,n]=m.useState(e),{updateDialog:i,removeDialog:s}=m.useContext(Bn),a=e||r;m.useEffect(()=>()=>{s(t)},[t]),m.useEffect(()=>{i(t,a)},[t,a,i]),m.useEffect(()=>{e&&n(!0)},[e]);const o=m.useCallback(()=>{e||n(!1)},[e]);return{mounted:r,unmount:o}}const In=({open:e=!1,...t})=>c.jsx("div",{...t,className:k.twJoin("bbn-backdrop",e?"animate-backdrop-in":"animate-backdrop-out",t.className)}),$n=({children:e,open:t=!1,className:r,onClose:n,hasBackdrop:i=!0,backdropClassName:s,dialogClassName:a,...o})=>{const{mounted:l,unmount:f}=wr({open:t});return c.jsxs(jt,{mounted:l,children:[c.jsx("div",{...o,className:k.twJoin("bbn-dialog-wrapper",r),children:c.jsx("div",{className:k.twJoin("bbn-dialog",t?"animate-modal-in":"animate-modal-out",a),onAnimationEnd:f,children:e})}),i&&c.jsx(In,{className:s,open:t,onClick:n})]})},Yt=({children:e,className:t="",size:r=40,variant:n="default",background:i=!1,rounded:s=!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 c.jsx("div",{className:k.twJoin("flex items-center justify-center",i&&o[n],s&&"rounded-full",i?"[&_svg]:w-4 [&_svg]:h-4":"[&_svg]:w-full [&_svg]:h-full","[&_svg_path]:fill-current",i&&"dark:[&_svg_path]:fill-white",a[n],t),style:{width:r,height:r},children:e})},fo=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Yt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsx("svg",{style:{width:t,height:t*.545},viewBox:"0 0 22 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.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"})})}),ho=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Yt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 20 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.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"})})}),po=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Yt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.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"}),c.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"})]})}),vo=({className:e="",size:t=16,variant:r="default",color:n})=>{const i=n||jr[r];return c.jsx("svg",{style:{width:t,height:t*1.143},viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:k.twJoin("transition-opacity duration-200",i,e),children:c.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"})})},Hn=({className:e="",size:t=14,variant:r="default",color:n})=>{const i=n||jr[r];return c.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:k.twJoin("transition-opacity duration-200",i,e),children:c.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"})})},jr={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"},Cr=({children:e,open:t=!1,className:r,onClose:n,...i})=>{const{mounted:s,unmount:a}=wr({open:t});return c.jsxs(jt,{mounted:s,children:[c.jsxs("div",{...i,className:k.twJoin("bbn-dialog-mobile relative",t?"animate-mobile-modal-in":"animate-mobile-modal-out",r),onAnimationEnd:a,children:[n&&c.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:c.jsx(Hn,{size:14,variant:"accent-primary"})}),e]}),c.jsx(In,{open:t,onClick:n})]})},Un=({className:e,children:t,title:r,onClose:n})=>c.jsxs("div",{className:k.twJoin("bbn-dialog-header",e),children:[c.jsxs("div",{className:"bbn-dialog-title",children:[c.jsx(zt,{variant:"h5",children:r}),!!n&&c.jsx(cr,{className:"shrink-0",onClick:n,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.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]}),Wn=e=>c.jsx("div",{...e,className:k.twJoin("bbn-dialog-body",e.className)}),Jn=e=>c.jsx("div",{...e,className:k.twJoin("bbn-dialog-footer",e.className)});function mo({className:e,...t}){return c.jsx("span",{...t,className:k.twJoin("bbn-chip",e)})}function go({size:e=40,className:t}){return c.jsx("span",{className:k.twMerge("bbn-loader text-current",t),style:{width:e,height:e},children:c.jsx("svg",{viewBox:"22 22 44 44",children:c.jsx("circle",{cx:"44",cy:"44",r:"20.2",fill:"none",stroke:"currentColor",strokeWidth:"3.6"})})})}var qn="Expected a function",tn=NaN,bo="[object Symbol]",yo=/^\s+|\s+$/g,xo=/^[-+]0x[0-9a-f]+$/i,wo=/^0b[01]+$/i,jo=/^0o[0-7]+$/i,Co=parseInt,No=typeof _t=="object"&&_t&&_t.Object===Object&&_t,Oo=typeof self=="object"&&self&&self.Object===Object&&self,ko=No||Oo||Function("return this")(),Eo=Object.prototype,So=Eo.toString,Fo=Math.max,Ao=Math.min,rr=function(){return ko.Date.now()};function Vo(e,t,r){var n,i,s,a,o,l,f=0,u=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(qn);t=rn(t)||0,$t(r)&&(u=!!r.leading,d="maxWait"in r,s=d?Fo(rn(r.maxWait)||0,t):s,p="trailing"in r?!!r.trailing:p);function g(V){var N=n,I=i;return n=i=void 0,f=V,a=e.apply(I,N),a}function C(V){return f=V,o=setTimeout(D,t),u?g(V):a}function y(V){var N=V-l,I=V-f,B=t-N;return d?Ao(B,s-I):B}function x(V){var N=V-l,I=V-f;return l===void 0||N>=t||N<0||d&&I>=s}function D(){var V=rr();if(x(V))return w(V);o=setTimeout(D,y(V))}function w(V){return o=void 0,p&&n?g(V):(n=i=void 0,a)}function M(){o!==void 0&&clearTimeout(o),f=0,n=l=i=o=void 0}function S(){return o===void 0?a:w(rr())}function A(){var V=rr(),N=x(V);if(n=arguments,i=this,l=V,N){if(o===void 0)return C(l);if(d)return o=setTimeout(D,t),g(l)}return o===void 0&&(o=setTimeout(D,t)),a}return A.cancel=M,A.flush=S,A}function Lo(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(qn);return $t(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Vo(e,t,{leading:n,maxWait:t,trailing:i})}function $t(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Do(e){return!!e&&typeof e=="object"}function _o(e){return typeof e=="symbol"||Do(e)&&So.call(e)==bo}function rn(e){if(typeof e=="number")return e;if(_o(e))return tn;if($t(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=$t(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(yo,"");var r=wo.test(e);return r||jo.test(e)?Co(e.slice(2),r?2:8):xo.test(e)?tn:+e}var Mo=Lo;const zn=Mn(Mo);function Zn(e,{onLoadMore:t,hasMore:r=!1,loading:n=!1}={}){const[i,s]=m.useState(!1);return m.useEffect(()=>{const a=zn(l=>{const f=l.target;s(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:i}}const Xn=m.createContext({data:[],columns:[],sortStates:{},onColumnSort:void 0,onRowSelect:void 0});function Yn({name:e,className:t,children:r,sorter:n,...i}){const{columns:s,sortStates:a,onColumnSort:o}=m.useContext(Xn),l=a[e??""],f=l==null?void 0:l.direction;return c.jsx(z,{variant:"caption",as:"th",className:k.twJoin("bbn-cell-left",n&&"bbn-table-sortable",t),onClick:()=>{if(n&&e){const u=s.find(d=>d.key===e);o==null||o(e,u==null?void 0:u.sorter)}},"data-column":e,...i,children:c.jsxs("div",{className:"flex items-center justify-between gap-1",children:[c.jsx("span",{children:r}),n&&c.jsxs("span",{className:"bbn-table-sort-icons",children:[c.jsx(zi,{className:k.twJoin("bbn-sort-icon bbn-sort-icon-up",f==="asc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")}),c.jsx(Ji,{className:k.twJoin("bbn-sort-icon bbn-sort-icon-down",f==="desc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")})]})]})})}function Gn(e,t){const[r,n]=m.useState({}),i=m.useCallback((a,o)=>{o&&n(l=>{var p;const f=((p=l[a])==null?void 0:p.direction)??null,u=f===null?"asc":f==="asc"?"desc":null;if(u===null)return Object.fromEntries(Object.entries(l).filter(([g])=>g!==a).map(([g,C])=>[g,{...C,priority:C.priority>l[a].priority?C.priority-1:C.priority}]));const d=Math.max(0,...Object.values(l).map(g=>g.priority));return{...l,[a]:{direction:u,priority:d+1}}})},[]),s=m.useMemo(()=>{const a=Object.entries(r).filter(([,o])=>o.direction!==null).toSorted((o,l)=>l[1].priority-o[1].priority).map(([o,l])=>({column:t.find(f=>f.key===o),direction:l.direction})).filter(({column:o})=>o==null?void 0:o.sorter);return a.length===0?e:e.toSorted((o,l)=>{for(const{column:f,direction:u}of a){const d=f.sorter(o,l);if(d!==0)return u==="asc"?d:-d}return 0})},[e,t,r]);return{sortStates:r,handleColumnSort:i,sortedData:s}}function Kn({className:e,render:t,value:r,columnName:n,...i}){return c.jsx(z,{variant:"body2",as:"td",className:k.twJoin("bbn-cell-left",e),"data-column":n,...i,children:t?t(r):r})}function To({row:e,columns:t,isSelected:r,isSelectable:n,onSelect:i}){return c.jsx("tr",{className:k.twJoin(r&&"selected",!!i&&n&&"cursor-pointer",!n&&"opacity-50"),onClick:()=>i(e),children:t.map(s=>c.jsx(Kn,{value:e[s.key],columnName:s.key,className:s.cellClassName,render:s.render?a=>s.render(a,e):void 0},s.key))})}function Ro({data:e,columns:t,className:r,wrapperClassName:n,hasMore:i=!1,loading:s=!1,onLoadMore:a,onRowSelect:o,isRowSelectable:l,selectedRow:f,defaultSelectedRow:u,onSelectedRowChange:d,...p},g){const C=m.useRef(null);m.useImperativeHandle(g,()=>C.current,[]);const{sortStates:y,handleColumnSort:x,sortedData:D}=Gn(e,t),{isScrolledTop:w}=Zn(C,{onLoadMore:a,hasMore:i,loading:s}),[M,S]=ze({value:f,defaultValue:u??null,onStateChange:d}),A=m.useCallback(N=>{if(!o||l&&!l(N))return;const I=M===N.id?null:N.id;S(I),o(I===null?null:N)},[o,l,M,S]),V=m.useMemo(()=>({data:D,columns:t,sortStates:y,onColumnSort:x,onRowSelect:A}),[D,t,y,x,A]);return c.jsx(Xn.Provider,{value:V,children:c.jsx("div",{ref:C,className:k.twJoin("bbn-table-wrapper",n),children:c.jsxs("table",{className:k.twJoin("bbn-table",r),...p,children:[c.jsx("thead",{className:k.twJoin("bbn-table-header",w&&"scrolled-top"),children:c.jsx("tr",{children:t.map(N=>c.jsx(Yn,{className:N.headerClassName,name:N.key,sorter:N.sorter,children:N.header},N.key))})}),c.jsx("tbody",{className:"bbn-table-body",children:D.map(N=>c.jsx(To,{row:N,columns:t,isSelected:M===N.id,isSelectable:l?l(N):!0,onSelect:A},N.id))})]})})})}const Po=m.forwardRef(Ro);function Qn({as:e="div",className:t,children:r}){return m.createElement(e,{className:k.twJoin("bbn-card",t)},r)}function Bo(e){const[t=!1,r]=ze({value:e.value,defaultValue:e.defaultValue,onStateChange:e.onChange});return c.jsxs("div",{className:"bbn-toggle",onClick:()=>void r(!t),children:[c.jsx("span",{className:"bbn-toggle-bg",children:e.activeIcon}),c.jsx("span",{className:k.twJoin("bbn-toggle-control",t&&"bbn-toggle-control-active")}),c.jsx("span",{className:"bbn-toggle-bg",children:e.inactiveIcon})]})}const Io={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function $o({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:k.twMerge("bbn-list",`bbn-list-${t}`,e),children:m.Children.map(r,n=>m.isValidElement(n)?m.cloneElement(n,{orientation:Io[t]}):n)})}function Ho({className:e,orientation:t="horizontal",title:r,value:n,suffix:i}){return c.jsxs("div",{className:k.twJoin("bbn-list-item",`bbn-list-item-${t}`,e),children:[c.jsx(z,{as:"div",className:k.twJoin("bbn-list-title",`bbn-list-title-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(z,{as:"div",className:k.twJoin("bbn-list-value",`bbn-list-value-${t}`),variant:"body1",children:[n,i]})]})}function Uo({children:e,count:t=0,max:r=99,position:n="bottom-right",color:i="error",className:s,badgeClassName:a,contentClassName:o}){const l=typeof t=="number"?t>0:t!=null,f=typeof t=="number"&&t>r?`${r}+`:t,u=`bbn-badge-${n}`,d=`bbn-badge-${i}`;return c.jsxs("div",{className:k.twJoin("bbn-badge",s),children:[e,l&&c.jsx("span",{className:k.twJoin("bbn-badge-indicator",u,d,a),children:c.jsx("span",{className:k.twJoin("bbn-badge-content",o),children:f})})]})}const Gt=({children:e,style:t,className:r})=>c.jsx("div",{className:k.twJoin("flex rounded bg-secondary-highlight p-4 text-accent-primary",r),style:t,children:e});function Wo(e){return yt({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 ei({counter:e,max:t,onAdd:r,alwaysShowCounter:n=!1}){const i=e<t,s=0<e&&1<t||n&&e===0;return c.jsxs("div",{className:k.twJoin("bg-primary-highlight flex overflow-hidden rounded-md border border-accent-primary",i&&"cursor-pointer",!s&&!i&&"hidden",!s&&"w-10"),onClick:i?r:void 0,children:[i&&c.jsx("div",{className:"flex h-10 w-10 items-center justify-center",children:c.jsx(Wo,{size:20})}),s&&c.jsxs("div",{className:"flex h-10 items-center border-l border-accent-primary px-2 text-sm sm:px-4 sm:text-base",children:[e,"/",t]})]})}const ti=m.createContext(void 0),Nr=()=>{const e=m.useContext(ti);return!e&&process.env.NODE_ENV==="development"&&console.warn("useMenuContext must be used within a Menu component"),e},Jo=({children:e,value:t})=>c.jsx(ti.Provider,{value:t,children:e});function ri(e={}){const{copiedText:t="Copied ✓",timeout:r=2e3}=e,[n,i]=m.useState({}),[s,a]=m.useState({}),o=m.useCallback((d,p)=>{!d||!p||(navigator.clipboard.writeText(p),i(g=>({...g,[d]:!0})),a(g=>({...g,[d]:t})))},[t]),l=m.useCallback(d=>{d&&(i(p=>({...p,[d]:!1})),a(p=>({...p,[d]:""})))},[]),f=m.useCallback(d=>d&&n[d]||!1,[n]),u=m.useCallback(d=>d&&s[d]||"",[s]);return m.useEffect(()=>{const d={};return Object.entries(n).forEach(([p,g])=>{g&&(d[p]=setTimeout(()=>{l(p)},r))}),()=>{Object.values(d).forEach(p=>clearTimeout(p))}},[n,r,l]),{isCopied:f,copiedText:u,copyToClipboard:o}}function Or(e=768,t=100){const[r,n]=m.useState(()=>typeof window<"u"?window.innerWidth<e:!1),i=m.useRef(),s=m.useCallback(()=>{n(window.innerWidth<e)},[e]);return m.useEffect(()=>(i.current=zn(s,t),s(),window.addEventListener("resize",i.current),()=>{i.current&&(window.removeEventListener("resize",i.current),i.current.cancel())}),[s,t]),r}const kr=({isOpen:e,onClose:t,title:r,children:n,className:i="",titleAlign:s="left",backIcon:a,fullHeight:o=!1,fullWidth:l=!1,showBackButton:f=!0,showDivider:u=!0,onBackdropClick:d})=>{const p=Or(),g={left:"text-left",center:"text-center",right:"text-right"},C=c.jsxs(c.Fragment,{children:[o&&e&&d&&c.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",onClick:d}),c.jsxs("div",{className:k.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]",o?k.twJoin("fixed inset-y-0 right-0 z-50",l?"w-full":"w-full max-w-sm"):"absolute inset-0 rounded-lg",e?"translate-x-0":"translate-x-full",i),children:[(f||r)&&c.jsxs("div",{className:k.twJoin("flex items-center p-4",u&&"border-b border-[#38708533] dark:border-[#404040]"),children:[f&&c.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||c.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:c.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),r&&c.jsx("h3",{className:k.twJoin("flex-1 text-sm font-medium text-accent-primary",f?"ml-3":"",g[s]),children:r})]}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:n})]})]});return p?c.jsx(jt,{mounted:!0,rootClassName:"portal-root-menu-drawer",children:C}):C},qo=({children:e,trigger:t,open:r,onOpenChange:n,placement:i="bottom-end",offset:s=[0,8],className:a,mobileMode:o="auto"})=>{const[l,f]=m.useState(!1),u=m.useRef(null),d=Or(),p=r!==void 0?r:l,g=D=>{r===void 0&&f(D),n==null||n(D)},C=()=>g(!1),y=c.jsx("div",{className:"relative w-full overflow-hidden",children:e}),x=t||c.jsx("button",{className:"rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-800",onClick:()=>g(!p),children:"Menu"});return c.jsxs(Jo,{value:{isOpen:p,setIsOpen:g,onClose:C,isMobile:d},children:[c.jsx("div",{ref:u,className:"inline-block",children:m.isValidElement(x)&&m.cloneElement(x,{onClick:()=>g(!p),"aria-haspopup":"true","aria-expanded":p})}),d?o==="dialog"?c.jsx(Cr,{open:p,onClose:C,className:k.twJoin("bg-[#FFFFFF] dark:bg-[#252525] text-primary-main",a),children:y}):c.jsx(kr,{isOpen:p,onClose:C,onBackdropClick:C,fullHeight:!0,fullWidth:!0,showBackButton:!0,showDivider:!1,children:y}):c.jsx(yr,{anchorEl:u.current,open:p,offset:s,placement:i,onClickOutside:C,className:k.twJoin("rounded-lg border border-[#38708533] bg-[#FFFFFF] shadow-lg dark:border-[#404040] dark:bg-[#252525]","min-w-[294px]",a),children:y})]})},zo=({icon:e,name:t,description:r,onClick:n,disabled:i=!1,className:s,children:a,suffix:o,selected:l=!1,role:f="menuitem"})=>{const u=Nr(),d=()=>{i||!n||(n(),u&&!o&&u.onClose())};return a?c.jsx("button",{onClick:d,disabled:i,className:k.twJoin("w-full text-left",i&&"cursor-not-allowed opacity-50",s),children:a}):c.jsxs("button",{onClick:d,disabled:i,className:k.twJoin("flex w-full items-center justify-between p-6","transition-colors hover:bg-accent-secondary/5","text-left","focus:outline-none",l&&"bg-accent-secondary/10",i&&"cursor-not-allowed opacity-50",s),role:f,"aria-selected":l,tabIndex:i?-1:0,children:[c.jsxs("div",{className:"flex items-center gap-3",children:[e&&c.jsx("div",{className:"flex-shrink-0",children:e}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("div",{className:"text-sm font-medium text-accent-primary",children:t}),r&&c.jsx("div",{className:"text-xs text-accent-secondary",children:r})]})]}),o]})},Zo=({children:e,name:t,description:r,icon:n,backIcon:i,suffix:s,className:a,contentClassName:o,titleAlign:l="left"})=>{const[f,u]=m.useState(!1),d=Nr(),p=c.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:c.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),g=c.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:c.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:()=>u(!0),className:k.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:[c.jsxs("div",{className:"flex items-center gap-3",children:[n&&c.jsx("div",{className:"flex-shrink-0",children:n}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-sm font-medium text-accent-primary",children:t}),r&&c.jsx("span",{className:"mt-0.5 text-xs text-accent-secondary",children:r})]})]}),s||g]}),c.jsx(kr,{isOpen:f,onClose:()=>u(!1),title:t||"",titleAlign:l,backIcon:i||p,fullHeight:d==null?void 0:d.isMobile,fullWidth:d==null?void 0:d.isMobile,onBackdropClick:d!=null&&d.isMobile?void 0:()=>u(!1),className:k.twJoin(d!=null&&d.isMobile?"z-60":"z-50",o),children:e})]})},Xo=({label:e,description:t,onClick:r,selected:n=!1,className:i,suffix:s,disabled:a=!1})=>{const o=c.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M16.6667 5L7.5 14.1667L3.33333 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return c.jsxs("button",{role:"menuitem",onClick:r,disabled:a,className:k.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",i),"aria-selected":n,tabIndex:a?-1:0,children:[c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("span",{className:"font-medium text-accent-primary",children:e}),t&&c.jsx("span",{className:"text-sm text-accent-secondary",children:t})]}),n&&(s||o)]})};function Yo(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 Go=({value:e,symbols:t=8,size:r="body2",className:n})=>e?c.jsx(z,{variant:r,className:k.twJoin("text-accent-primary",n),children:c.jsx("span",{children:Yo(e,t)??e})}):null,Ko=({children:e,value:t,className:r,onCopy:n,isCopied:i,copiedText:s,timeout:a=2e3})=>{const o=m.useId(),l={copiedText:s,timeout:a},{isCopied:f,copiedText:u,copyToClipboard:d}=ri(l),p=i!==void 0,g=p?i:f(o),C=p?s||"Copied ✓":u(o),y=x=>{x.stopPropagation(),p&&n?n(t):d(o,t)};return c.jsx("div",{className:k.twMerge("inline-flex items-center cursor-pointer hover:opacity-100 transition-opacity duration-200",r),onClick:y,children:c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:k.twMerge("transition-opacity duration-300 ease-in-out",g&&"opacity-0"),children:e}),g&&c.jsx("div",{className:k.twMerge("absolute inset-0 flex items-center transition-opacity duration-300 ease-in-out text-green-600","opacity-100"),children:C})]})})};var Nt=e=>e.type==="checkbox",We=e=>e instanceof Date,se=e=>e==null;const ni=e=>typeof e=="object";var ee=e=>!se(e)&&!Array.isArray(e)&&ni(e)&&!We(e),ii=e=>ee(e)&&e.target?Nt(e.target)?e.target.checked:e.target.value:e,Qo=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,si=(e,t)=>e.has(Qo(t)),ea=e=>{const t=e.constructor&&e.constructor.prototype;return ee(t)&&t.hasOwnProperty("isPrototypeOf")},Er=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ne(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(!(Er&&(e instanceof Blob||n))&&(r||ee(e)))if(t=r?[]:{},!r&&!ea(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=ne(e[i]));else return e;return t}var Kt=e=>/^\w*$/.test(e),Q=e=>e===void 0,Sr=e=>Array.isArray(e)?e.filter(Boolean):[],Fr=e=>Sr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),E=(e,t,r)=>{if(!t||!ee(e))return r;const n=(Kt(t)?[t]:Fr(t)).reduce((i,s)=>se(i)?i:i[s],e);return Q(n)||n===e?Q(e[t])?r:e[t]:n},ue=e=>typeof e=="boolean",J=(e,t,r)=>{let n=-1;const i=Kt(t)?[t]:Fr(t),s=i.length,a=s-1;for(;++n<s;){const o=i[n];let l=r;if(n!==a){const f=e[o];l=ee(f)||Array.isArray(f)?f:isNaN(+i[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;e[o]=l,e=e[o]}};const Ht={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ye={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Fe={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ar=m.createContext(null);Ar.displayName="HookFormContext";const Ge=()=>m.useContext(Ar),ta=e=>{const{children:t,...r}=e;return m.createElement(Ar.Provider,{value:r},t)};var oi=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const a=s;return t._proxyFormState[a]!==ye.all&&(t._proxyFormState[a]=!n||ye.all),r&&(r[a]=!0),e[a]}});return i};const Vr=typeof window<"u"?Ae.useLayoutEffect:Ae.useEffect;function Lr(e){const t=Ge(),{control:r=t.control,disabled:n,name:i,exact:s}=e||{},[a,o]=m.useState(r._formState),l=m.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Vr(()=>r._subscribe({name:i,formState:l.current,exact:s,callback:f=>{!n&&o({...r._formState,...f})}}),[i,n,s]),m.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),m.useMemo(()=>oi(a,r,l.current,!1),[a,r])}var Ce=e=>typeof e=="string",ai=(e,t,r,n,i)=>Ce(e)?(n&&t.watch.add(e),E(r,e,i)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),E(r,s))):(n&&(t.watchAll=!0),r);function Dr(e){const t=Ge(),{control:r=t.control,name:n,defaultValue:i,disabled:s,exact:a}=e||{},o=m.useRef(i),[l,f]=m.useState(r._getWatch(n,o.current));return Vr(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:u=>!s&&f(ai(n,r._names,u.values||r._formValues,!1,o.current))}),[n,r,s,a]),m.useEffect(()=>r._removeUnmounted()),l}function ra(e){const t=Ge(),{name:r,disabled:n,control:i=t.control,shouldUnregister:s}=e,a=si(i._names.array,r),o=Dr({control:i,name:r,defaultValue:E(i._formValues,r,E(i._defaultValues,r,e.defaultValue)),exact:!0}),l=Lr({control:i,name:r,exact:!0}),f=m.useRef(e),u=m.useRef(i.register(r,{...e.rules,value:o,...ue(e.disabled)?{disabled:e.disabled}:{}})),d=m.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!E(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!E(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!E(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!E(l.validatingFields,r)},error:{enumerable:!0,get:()=>E(l.errors,r)}}),[l,r]),p=m.useCallback(x=>u.current.onChange({target:{value:ii(x),name:r},type:Ht.CHANGE}),[r]),g=m.useCallback(()=>u.current.onBlur({target:{value:E(i._formValues,r),name:r},type:Ht.BLUR}),[r,i._formValues]),C=m.useCallback(x=>{const D=E(i._fields,r);D&&x&&(D._f.ref={focus:()=>x.focus&&x.focus(),select:()=>x.select&&x.select(),setCustomValidity:w=>x.setCustomValidity(w),reportValidity:()=>x.reportValidity()})},[i._fields,r]),y=m.useMemo(()=>({name:r,value:o,...ue(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:p,onBlur:g,ref:C}),[r,n,l.disabled,p,g,C,o]);return m.useEffect(()=>{const x=i._options.shouldUnregister||s;i.register(r,{...f.current.rules,...ue(f.current.disabled)?{disabled:f.current.disabled}:{}});const D=(w,M)=>{const S=E(i._fields,w);S&&S._f&&(S._f.mount=M)};if(D(r,!0),x){const w=ne(E(i._options.defaultValues,r));J(i._defaultValues,r,w),Q(E(i._formValues,r))&&J(i._formValues,r,w)}return!a&&i.register(r),()=>{(a?x&&!i._state.action:x)?i.unregister(r):D(r,!1)}},[r,i,a,s]),m.useEffect(()=>{i._setDisabledField({disabled:n,name:r})},[n,r,i]),m.useMemo(()=>({field:y,formState:l,fieldState:d}),[y,l,d])}var li=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},pt=e=>Array.isArray(e)?e:[e],nn=()=>{let e=[];return{get observers(){return e},next:i=>{for(const s of e)s.next&&s.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(s=>s!==i)}}),unsubscribe:()=>{e=[]}}},ar=e=>se(e)||!ni(e);function Re(e,t,r=new WeakSet){if(ar(e)||ar(t))return e===t;if(We(e)&&We(t))return e.getTime()===t.getTime();const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const s of n){const a=e[s];if(!i.includes(s))return!1;if(s!=="ref"){const o=t[s];if(We(a)&&We(o)||ee(a)&&ee(o)||Array.isArray(a)&&Array.isArray(o)?!Re(a,o,r):a!==o)return!1}}return!0}var ae=e=>ee(e)&&!Object.keys(e).length,_r=e=>e.type==="file",xe=e=>typeof e=="function",Ut=e=>{if(!Er)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ci=e=>e.type==="select-multiple",Mr=e=>e.type==="radio",na=e=>Mr(e)||Nt(e),nr=e=>Ut(e)&&e.isConnected;function ia(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Q(e)?n++:e[t[n++]];return e}function sa(e){for(const t in e)if(e.hasOwnProperty(t)&&!Q(e[t]))return!1;return!0}function te(e,t){const r=Array.isArray(t)?t:Kt(t)?[t]:Fr(t),n=r.length===1?e:ia(e,r),i=r.length-1,s=r[i];return n&&delete n[s],i!==0&&(ee(n)&&ae(n)||Array.isArray(n)&&sa(n))&&te(e,r.slice(0,-1)),e}var ui=e=>{for(const t in e)if(xe(e[t]))return!0;return!1};function Wt(e,t={}){const r=Array.isArray(e);if(ee(e)||r)for(const n in e)Array.isArray(e[n])||ee(e[n])&&!ui(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Wt(e[n],t[n])):se(e[n])||(t[n]=!0);return t}function fi(e,t,r){const n=Array.isArray(e);if(ee(e)||n)for(const i in e)Array.isArray(e[i])||ee(e[i])&&!ui(e[i])?Q(t)||ar(r[i])?r[i]=Array.isArray(e[i])?Wt(e[i],[]):{...Wt(e[i])}:fi(e[i],se(t)?{}:t[i],r[i]):r[i]=!Re(e[i],t[i]);return r}var ut=(e,t)=>fi(e,t,Wt(t));const sn={value:!1,isValid:!1},on={value:!0,isValid:!0};var di=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&&!Q(e[0].attributes.value)?Q(e[0].value)||e[0].value===""?on:{value:e[0].value,isValid:!0}:on:sn}return sn},hi=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Q(e)?e:t?e===""?NaN:e&&+e:r&&Ce(e)?new Date(e):n?n(e):e;const an={isValid:!1,value:null};var pi=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,an):an;function ln(e){const t=e.ref;return _r(t)?t.files:Mr(t)?pi(e.refs).value:ci(t)?[...t.selectedOptions].map(({value:r})=>r):Nt(t)?di(e.refs).value:hi(Q(t.value)?e.ref.value:t.value,e)}var oa=(e,t,r,n)=>{const i={};for(const s of e){const a=E(t,s);a&&J(i,s,a._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Jt=e=>e instanceof RegExp,ft=e=>Q(e)?e:Jt(e)?e.source:ee(e)?Jt(e.value)?e.value.source:e.value:e,cn=e=>({isOnSubmit:!e||e===ye.onSubmit,isOnBlur:e===ye.onBlur,isOnChange:e===ye.onChange,isOnAll:e===ye.all,isOnTouch:e===ye.onTouched});const un="AsyncFunction";var aa=e=>!!e&&!!e.validate&&!!(xe(e.validate)&&e.validate.constructor.name===un||ee(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===un)),la=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),fn=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const vt=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const s=E(e,i);if(s){const{_f:a,...o}=s;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(vt(o,t))break}else if(ee(o)&&vt(o,t))break}}};function dn(e,t,r){const n=E(e,r);if(n||Kt(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const s=i.join("."),a=E(t,s),o=E(e,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(o&&o.type)return{name:s,error:o};if(o&&o.root&&o.root.type)return{name:`${s}.root`,error:o.root};i.pop()}return{name:r}}var ca=(e,t,r,n)=>{r(e);const{name:i,...s}=e;return ae(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(a=>t[a]===(!n||ye.all))},ua=(e,t,r)=>!e||!t||e===t||pt(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),fa=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,da=(e,t)=>!Sr(E(e,t)).length&&te(e,t),ha=(e,t,r)=>{const n=pt(E(e,r));return J(n,"root",t[r]),J(e,r,n),e},Rt=e=>Ce(e);function hn(e,t,r="validate"){if(Rt(e)||Array.isArray(e)&&e.every(Rt)||ue(e)&&!e)return{type:r,message:Rt(e)?e:"",ref:t}}var et=e=>ee(e)&&!Jt(e)?e:{value:e,message:""},pn=async(e,t,r,n,i,s)=>{const{ref:a,refs:o,required:l,maxLength:f,minLength:u,min:d,max:p,pattern:g,validate:C,name:y,valueAsNumber:x,mount:D}=e._f,w=E(r,y);if(!D||t.has(y))return{};const M=o?o[0]:a,S=L=>{i&&M.reportValidity&&(M.setCustomValidity(ue(L)?"":L||""),M.reportValidity())},A={},V=Mr(a),N=Nt(a),I=V||N,B=(x||_r(a))&&Q(a.value)&&Q(w)||Ut(a)&&a.value===""||w===""||Array.isArray(w)&&!w.length,$=li.bind(null,y,n,A),R=(L,P,U,G=Fe.maxLength,q=Fe.minLength)=>{const K=L?P:U;A[y]={type:L?G:q,message:K,ref:a,...$(L?G:q,K)}};if(s?!Array.isArray(w)||!w.length:l&&(!I&&(B||se(w))||ue(w)&&!w||N&&!di(o).isValid||V&&!pi(o).isValid)){const{value:L,message:P}=Rt(l)?{value:!!l,message:l}:et(l);if(L&&(A[y]={type:Fe.required,message:P,ref:M,...$(Fe.required,P)},!n))return S(P),A}if(!B&&(!se(d)||!se(p))){let L,P;const U=et(p),G=et(d);if(!se(w)&&!isNaN(w)){const q=a.valueAsNumber||w&&+w;se(U.value)||(L=q>U.value),se(G.value)||(P=q<G.value)}else{const q=a.valueAsDate||new Date(w),K=Se=>new Date(new Date().toDateString()+" "+Se),we=a.type=="time",oe=a.type=="week";Ce(U.value)&&w&&(L=we?K(w)>K(U.value):oe?w>U.value:q>new Date(U.value)),Ce(G.value)&&w&&(P=we?K(w)<K(G.value):oe?w<G.value:q<new Date(G.value))}if((L||P)&&(R(!!L,U.message,G.message,Fe.max,Fe.min),!n))return S(A[y].message),A}if((f||u)&&!B&&(Ce(w)||s&&Array.isArray(w))){const L=et(f),P=et(u),U=!se(L.value)&&w.length>+L.value,G=!se(P.value)&&w.length<+P.value;if((U||G)&&(R(U,L.message,P.message),!n))return S(A[y].message),A}if(g&&!B&&Ce(w)){const{value:L,message:P}=et(g);if(Jt(L)&&!w.match(L)&&(A[y]={type:Fe.pattern,message:P,ref:a,...$(Fe.pattern,P)},!n))return S(P),A}if(C){if(xe(C)){const L=await C(w,r),P=hn(L,M);if(P&&(A[y]={...P,...$(Fe.validate,P.message)},!n))return S(P.message),A}else if(ee(C)){let L={};for(const P in C){if(!ae(L)&&!n)break;const U=hn(await C[P](w,r),M,P);U&&(L={...U,...$(P,U.message)},S(U.message),n&&(A[y]=L))}if(!ae(L)&&(A[y]={ref:M,...L},!n))return A}}return S(!0),A};const pa={mode:ye.onSubmit,reValidateMode:ye.onChange,shouldFocusError:!0};function va(e={}){let t={...pa,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:xe(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=ee(t.defaultValues)||ee(t.values)?ne(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:ne(i),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,f=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const p={array:nn(),state:nn()},g=t.criteriaMode===ye.all,C=h=>v=>{clearTimeout(f),f=setTimeout(h,v)},y=async h=>{if(!t.disabled&&(u.isValid||d.isValid||h)){const v=t.resolver?ae((await N()).errors):await B(n,!0);v!==r.isValid&&p.state.next({isValid:v})}},x=(h,v)=>{!t.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((h||Array.from(o.mount)).forEach(b=>{b&&(v?J(r.validatingFields,b,v):te(r.validatingFields,b))}),p.state.next({validatingFields:r.validatingFields,isValidating:!ae(r.validatingFields)}))},D=(h,v=[],b,F,O=!0,j=!0)=>{if(F&&b&&!t.disabled){if(a.action=!0,j&&Array.isArray(E(n,h))){const T=b(E(n,h),F.argA,F.argB);O&&J(n,h,T)}if(j&&Array.isArray(E(r.errors,h))){const T=b(E(r.errors,h),F.argA,F.argB);O&&J(r.errors,h,T),da(r.errors,h)}if((u.touchedFields||d.touchedFields)&&j&&Array.isArray(E(r.touchedFields,h))){const T=b(E(r.touchedFields,h),F.argA,F.argB);O&&J(r.touchedFields,h,T)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=ut(i,s)),p.state.next({name:h,isDirty:R(h,v),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else J(s,h,v)},w=(h,v)=>{J(r.errors,h,v),p.state.next({errors:r.errors})},M=h=>{r.errors=h,p.state.next({errors:r.errors,isValid:!1})},S=(h,v,b,F)=>{const O=E(n,h);if(O){const j=E(s,h,Q(b)?E(i,h):b);Q(j)||F&&F.defaultChecked||v?J(s,h,v?j:ln(O._f)):U(h,j),a.mount&&y()}},A=(h,v,b,F,O)=>{let j=!1,T=!1;const H={name:h};if(!t.disabled){if(!b||F){(u.isDirty||d.isDirty)&&(T=r.isDirty,r.isDirty=H.isDirty=R(),j=T!==H.isDirty);const W=Re(E(i,h),v);T=!!E(r.dirtyFields,h),W?te(r.dirtyFields,h):J(r.dirtyFields,h,!0),H.dirtyFields=r.dirtyFields,j=j||(u.dirtyFields||d.dirtyFields)&&T!==!W}if(b){const W=E(r.touchedFields,h);W||(J(r.touchedFields,h,b),H.touchedFields=r.touchedFields,j=j||(u.touchedFields||d.touchedFields)&&W!==b)}j&&O&&p.state.next(H)}return j?H:{}},V=(h,v,b,F)=>{const O=E(r.errors,h),j=(u.isValid||d.isValid)&&ue(v)&&r.isValid!==v;if(t.delayError&&b?(l=C(()=>w(h,b)),l(t.delayError)):(clearTimeout(f),l=null,b?J(r.errors,h,b):te(r.errors,h)),(b?!Re(O,b):O)||!ae(F)||j){const T={...F,...j&&ue(v)?{isValid:v}:{},errors:r.errors,name:h};r={...r,...T},p.state.next(T)}},N=async h=>{x(h,!0);const v=await t.resolver(s,t.context,oa(h||o.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return x(h),v},I=async h=>{const{errors:v}=await N(h);if(h)for(const b of h){const F=E(v,b);F?J(r.errors,b,F):te(r.errors,b)}else r.errors=v;return v},B=async(h,v,b={valid:!0})=>{for(const F in h){const O=h[F];if(O){const{_f:j,...T}=O;if(j){const H=o.array.has(j.name),W=O._f&&aa(O._f);W&&u.validatingFields&&x([F],!0);const he=await pn(O,o.disabled,s,g,t.shouldUseNativeValidation&&!v,H);if(W&&u.validatingFields&&x([F]),he[j.name]&&(b.valid=!1,v))break;!v&&(E(he,j.name)?H?ha(r.errors,he,j.name):J(r.errors,j.name,he[j.name]):te(r.errors,j.name))}!ae(T)&&await B(T,v,b)}}return b.valid},$=()=>{for(const h of o.unMount){const v=E(n,h);v&&(v._f.refs?v._f.refs.every(b=>!nr(b)):!nr(v._f.ref))&&_e(h)}o.unMount=new Set},R=(h,v)=>!t.disabled&&(h&&v&&J(s,h,v),!Re(Se(),i)),L=(h,v,b)=>ai(h,o,{...a.mount?s:Q(v)?i:Ce(h)?{[h]:v}:v},b,v),P=h=>Sr(E(a.mount?s:i,h,t.shouldUnregister?E(i,h,[]):[])),U=(h,v,b={})=>{const F=E(n,h);let O=v;if(F){const j=F._f;j&&(!j.disabled&&J(s,h,hi(v,j)),O=Ut(j.ref)&&se(v)?"":v,ci(j.ref)?[...j.ref.options].forEach(T=>T.selected=O.includes(T.value)):j.refs?Nt(j.ref)?j.refs.forEach(T=>{(!T.defaultChecked||!T.disabled)&&(Array.isArray(O)?T.checked=!!O.find(H=>H===T.value):T.checked=O===T.value||!!O)}):j.refs.forEach(T=>T.checked=T.value===O):_r(j.ref)?j.ref.value="":(j.ref.value=O,j.ref.type||p.state.next({name:h,values:ne(s)})))}(b.shouldDirty||b.shouldTouch)&&A(h,O,b.shouldTouch,b.shouldDirty,!0),b.shouldValidate&&oe(h)},G=(h,v,b)=>{for(const F in v){if(!v.hasOwnProperty(F))return;const O=v[F],j=h+"."+F,T=E(n,j);(o.array.has(h)||ee(O)||T&&!T._f)&&!We(O)?G(j,O,b):U(j,O,b)}},q=(h,v,b={})=>{const F=E(n,h),O=o.array.has(h),j=ne(v);J(s,h,j),O?(p.array.next({name:h,values:ne(s)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&b.shouldDirty&&p.state.next({name:h,dirtyFields:ut(i,s),isDirty:R(h,j)})):F&&!F._f&&!se(j)?G(h,j,b):U(h,j,b),fn(h,o)&&p.state.next({...r}),p.state.next({name:a.mount?h:void 0,values:ne(s)})},K=async h=>{a.mount=!0;const v=h.target;let b=v.name,F=!0;const O=E(n,b),j=W=>{F=Number.isNaN(W)||We(W)&&isNaN(W.getTime())||Re(W,E(s,b,W))},T=cn(t.mode),H=cn(t.reValidateMode);if(O){let W,he;const Lt=v.type?ln(O._f):ii(h),Me=h.type===Ht.BLUR||h.type===Ht.FOCUS_OUT,Ei=!la(O._f)&&!t.resolver&&!E(r.errors,b)&&!O._f.deps||fa(Me,E(r.touchedFields,b),r.isSubmitted,H,T),er=fn(b,o,Me);J(s,b,Lt),Me?(O._f.onBlur&&O._f.onBlur(h),l&&l(0)):O._f.onChange&&O._f.onChange(h);const tr=A(b,Lt,Me),Si=!ae(tr)||er;if(!Me&&p.state.next({name:b,type:h.type,values:ne(s)}),Ei)return(u.isValid||d.isValid)&&(t.mode==="onBlur"?Me&&y():Me||y()),Si&&p.state.next({name:b,...er?{}:tr});if(!Me&&er&&p.state.next({...r}),t.resolver){const{errors:Ir}=await N([b]);if(j(Lt),F){const Fi=dn(r.errors,n,b),$r=dn(Ir,n,Fi.name||b);W=$r.error,b=$r.name,he=ae(Ir)}}else x([b],!0),W=(await pn(O,o.disabled,s,g,t.shouldUseNativeValidation))[b],x([b]),j(Lt),F&&(W?he=!1:(u.isValid||d.isValid)&&(he=await B(n,!0)));F&&(O._f.deps&&oe(O._f.deps),V(b,he,W,tr))}},we=(h,v)=>{if(E(r.errors,v)&&h.focus)return h.focus(),1},oe=async(h,v={})=>{let b,F;const O=pt(h);if(t.resolver){const j=await I(Q(h)?h:O);b=ae(j),F=h?!O.some(T=>E(j,T)):b}else h?(F=(await Promise.all(O.map(async j=>{const T=E(n,j);return await B(T&&T._f?{[j]:T}:T)}))).every(Boolean),!(!F&&!r.isValid)&&y()):F=b=await B(n);return p.state.next({...!Ce(h)||(u.isValid||d.isValid)&&b!==r.isValid?{}:{name:h},...t.resolver||!h?{isValid:b}:{},errors:r.errors}),v.shouldFocus&&!F&&vt(n,we,h?O:o.mount),F},Se=h=>{const v={...a.mount?s:i};return Q(h)?v:Ce(h)?E(v,h):h.map(b=>E(v,b))},Qe=(h,v)=>({invalid:!!E((v||r).errors,h),isDirty:!!E((v||r).dirtyFields,h),error:E((v||r).errors,h),isValidating:!!E(r.validatingFields,h),isTouched:!!E((v||r).touchedFields,h)}),Be=h=>{h&&pt(h).forEach(v=>te(r.errors,v)),p.state.next({errors:h?r.errors:{}})},Ie=(h,v,b)=>{const F=(E(n,h,{_f:{}})._f||{}).ref,O=E(r.errors,h)||{},{ref:j,message:T,type:H,...W}=O;J(r.errors,h,{...W,...v,ref:F}),p.state.next({name:h,errors:r.errors,isValid:!1}),b&&b.shouldFocus&&F&&F.focus&&F.focus()},De=(h,v)=>xe(h)?p.state.subscribe({next:b=>h(L(void 0,v),b)}):L(h,v,!0),be=h=>p.state.subscribe({next:v=>{ua(h.name,v.name,h.exact)&&ca(v,h.formState||u,At,h.reRenderRoot)&&h.callback({values:{...s},...r,...v})}}).unsubscribe,$e=h=>(a.mount=!0,d={...d,...h.formState},be({...h,formState:d})),_e=(h,v={})=>{for(const b of h?pt(h):o.mount)o.mount.delete(b),o.array.delete(b),v.keepValue||(te(n,b),te(s,b)),!v.keepError&&te(r.errors,b),!v.keepDirty&&te(r.dirtyFields,b),!v.keepTouched&&te(r.touchedFields,b),!v.keepIsValidating&&te(r.validatingFields,b),!t.shouldUnregister&&!v.keepDefaultValue&&te(i,b);p.state.next({values:ne(s)}),p.state.next({...r,...v.keepDirty?{isDirty:R()}:{}}),!v.keepIsValid&&y()},je=({disabled:h,name:v})=>{(ue(h)&&a.mount||h||o.disabled.has(v))&&(h?o.disabled.add(v):o.disabled.delete(v))},He=(h,v={})=>{let b=E(n,h);const F=ue(v.disabled)||ue(t.disabled);return J(n,h,{...b||{},_f:{...b&&b._f?b._f:{ref:{name:h}},name:h,mount:!0,...v}}),o.mount.add(h),b?je({disabled:ue(v.disabled)?v.disabled:t.disabled,name:h}):S(h,!0,v.value),{...F?{disabled:v.disabled||t.disabled}:{},...t.progressive?{required:!!v.required,min:ft(v.min),max:ft(v.max),minLength:ft(v.minLength),maxLength:ft(v.maxLength),pattern:ft(v.pattern)}:{},name:h,onChange:K,onBlur:K,ref:O=>{if(O){He(h,v),b=E(n,h);const j=Q(O.value)&&O.querySelectorAll&&O.querySelectorAll("input,select,textarea")[0]||O,T=na(j),H=b._f.refs||[];if(T?H.find(W=>W===j):j===b._f.ref)return;J(n,h,{_f:{...b._f,...T?{refs:[...H.filter(nr),j,...Array.isArray(E(i,h))?[{}]:[]],ref:{type:j.type,name:h}}:{ref:j}}}),S(h,!1,void 0,j)}else b=E(n,h,{}),b._f&&(b._f.mount=!1),(t.shouldUnregister||v.shouldUnregister)&&!(si(o.array,h)&&a.action)&&o.unMount.add(h)}}},at=()=>t.shouldFocusError&&vt(n,we,o.mount),lt=h=>{ue(h)&&(p.state.next({disabled:h}),vt(n,(v,b)=>{const F=E(n,b);F&&(v.disabled=F._f.disabled||h,Array.isArray(F._f.refs)&&F._f.refs.forEach(O=>{O.disabled=F._f.disabled||h}))},0,!1))},Ot=(h,v)=>async b=>{let F;b&&(b.preventDefault&&b.preventDefault(),b.persist&&b.persist());let O=ne(s);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:j,values:T}=await N();r.errors=j,O=ne(T)}else await B(n);if(o.disabled.size)for(const j of o.disabled)te(O,j);if(te(r.errors,"root"),ae(r.errors)){p.state.next({errors:{}});try{await h(O,b)}catch(j){F=j}}else v&&await v({...r.errors},b),at(),setTimeout(at);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ae(r.errors)&&!F,submitCount:r.submitCount+1,errors:r.errors}),F)throw F},kt=(h,v={})=>{E(n,h)&&(Q(v.defaultValue)?q(h,ne(E(i,h))):(q(h,v.defaultValue),J(i,h,ne(v.defaultValue))),v.keepTouched||te(r.touchedFields,h),v.keepDirty||(te(r.dirtyFields,h),r.isDirty=v.defaultValue?R(h,ne(E(i,h))):R()),v.keepError||(te(r.errors,h),u.isValid&&y()),p.state.next({...r}))},Et=(h,v={})=>{const b=h?ne(h):i,F=ne(b),O=ae(h),j=O?i:F;if(v.keepDefaultValues||(i=b),!v.keepValues){if(v.keepDirtyValues){const T=new Set([...o.mount,...Object.keys(ut(i,s))]);for(const H of Array.from(T))E(r.dirtyFields,H)?J(j,H,E(s,H)):q(H,E(j,H))}else{if(Er&&Q(h))for(const T of o.mount){const H=E(n,T);if(H&&H._f){const W=Array.isArray(H._f.refs)?H._f.refs[0]:H._f.ref;if(Ut(W)){const he=W.closest("form");if(he){he.reset();break}}}}if(v.keepFieldsRef)for(const T of o.mount)q(T,E(j,T));else n={}}s=t.shouldUnregister?v.keepDefaultValues?ne(i):{}:ne(j),p.array.next({values:{...j}}),p.state.next({values:{...j}})}o={mount:v.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!v.keepIsValid||!!v.keepDirtyValues,a.watch=!!t.shouldUnregister,p.state.next({submitCount:v.keepSubmitCount?r.submitCount:0,isDirty:O?!1:v.keepDirty?r.isDirty:!!(v.keepDefaultValues&&!Re(h,i)),isSubmitted:v.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:O?{}:v.keepDirtyValues?v.keepDefaultValues&&s?ut(i,s):r.dirtyFields:v.keepDefaultValues&&h?ut(i,h):v.keepDirty?r.dirtyFields:{},touchedFields:v.keepTouched?r.touchedFields:{},errors:v.keepErrors?r.errors:{},isSubmitSuccessful:v.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},St=(h,v)=>Et(xe(h)?h(s):h,v),Ft=(h,v={})=>{const b=E(n,h),F=b&&b._f;if(F){const O=F.refs?F.refs[0]:F.ref;O.focus&&(O.focus(),v.shouldSelect&&xe(O.select)&&O.select())}},At=h=>{r={...r,...h}},Vt={control:{register:He,unregister:_e,getFieldState:Qe,handleSubmit:Ot,setError:Ie,_subscribe:be,_runSchema:N,_focusError:at,_getWatch:L,_getDirty:R,_setValid:y,_setFieldArray:D,_setDisabledField:je,_setErrors:M,_getFieldArray:P,_reset:Et,_resetDefaultValues:()=>xe(t.defaultValues)&&t.defaultValues().then(h=>{St(h,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:lt,_subjects:p,_proxyFormState:u,get _fields(){return n},get _formValues(){return s},get _state(){return a},set _state(h){a=h},get _defaultValues(){return i},get _names(){return o},set _names(h){o=h},get _formState(){return r},get _options(){return t},set _options(h){t={...t,...h}}},subscribe:$e,trigger:oe,register:He,handleSubmit:Ot,watch:De,setValue:q,getValues:Se,reset:St,resetField:kt,clearErrors:Be,unregister:_e,setError:Ie,setFocus:Ft,getFieldState:Qe};return{...Vt,formControl:Vt}}function ma(e={}){const t=m.useRef(void 0),r=m.useRef(void 0),[n,i]=m.useState({isDirty:!1,isValidating:!1,isLoading:xe(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:xe(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!xe(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...o}=va(e);t.current={...o,formState:n}}const s=t.current.control;return s._options=e,Vr(()=>{const a=s._subscribe({formState:s._proxyFormState,callback:()=>i({...s._formState}),reRenderRoot:!0});return i(o=>({...o,isReady:!0})),s._formState.isReady=!0,a},[s]),m.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),m.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),m.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),m.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),m.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==n.isDirty&&s._subjects.state.next({isDirty:a})}},[s,n.isDirty]),m.useEffect(()=>{e.values&&!Re(e.values,r.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),r.current=e.values,i(a=>({...a}))):s._resetDefaultValues()},[s,e.values]),m.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=oi(n,s),t.current}const vn=(e,t,r)=>{if(e&&"reportValidity"in e){const n=E(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},vi=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?vn(n.ref,r,e):n.refs&&n.refs.forEach(i=>vn(i,r,e))}},ga=(e,t)=>{t.shouldUseNativeValidation&&vi(e,t);const r={};for(const n in e){const i=E(t.fields,n),s=Object.assign(e[n]||{},{ref:i&&i.ref});if(ba(t.names||Object.keys(e),n)){const a=Object.assign({},E(r,n));J(a,"root",s),J(r,n,a)}else J(r,n,s)}return r},ba=(e,t)=>e.some(r=>r.startsWith(t+"."));function ya(e,t,r){return t===void 0&&(t={}),r===void 0&&(r={}),function(n,i,s){try{return Promise.resolve(function(a,o){try{var l=(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:i}))).then(function(f){return s.shouldUseNativeValidation&&vi({},s),{values:r.raw?n:f,errors:{}}}))}catch(f){return o(f)}return l&&l.then?l.then(void 0,o):l}(0,function(a){if(!a.inner)throw a;return{values:{},errors:ga((o=a,l=!s.shouldUseNativeValidation&&s.criteriaMode==="all",(o.inner||[]).reduce(function(f,u){if(f[u.path]||(f[u.path]={message:u.message,type:u.type}),l){var d=f[u.path].types,p=d&&d[u.type];f[u.path]=li(u.path,l,f,u.type,p?[].concat(p,u.message):u.message)}return f},{})),s)};var o,l}))}catch(a){return Promise.reject(a)}}}function xa({className:e,name:t,children:r,mode:n="onBlur",reValidateMode:i="onBlur",defaultValues:s,schema:a,formProps:o,onSubmit:l=()=>null,onChange:f}){const u=ma({mode:n,reValidateMode:i,defaultValues:s,resolver:a?ya(a):void 0});return m.useEffect(()=>{if(!f)return;const{unsubscribe:d}=u.watch(f);return d},[f,u.watch]),c.jsx(ta,{...u,children:c.jsx("form",{className:k.twJoin("bbn-form",e),name:t,onSubmit:u.handleSubmit(l),...o,children:r})})}function Ke({name:e,defaultValue:t,disabled:r=!1,autoFocus:n=!1,shouldUnregister:i=!1,validateOnMount:s=!0}){const{setFocus:a,trigger:o}=Ge(),{field:l,fieldState:f}=ra({name:e,defaultValue:t,disabled:r,shouldUnregister:i}),{invalid:u,isTouched:d,error:p}=f;return m.useEffect(()=>{s?o(e,{shouldFocus:n}):n&&a(e)},[e,s]),{...l,value:l.value,invalid:u&&d,error:(p==null?void 0:p.message)??""}}function wa(e){const{getFieldState:t}=Ge(),r=Lr({name:e});return Array.isArray(e)?e.map(i=>t(i,r)):t(e,r)}const ja=/^-?\d*\.?\d*$/;function Ca({name:e,id:t=e,label:r,hint:n,className:i,controlClassName:s,disabled:a,autoFocus:o,defaultValue:l,placeholder:f,type:u,suffix:d,prefix:p,shouldUnregister:g,state:C,validateOnMount:y}){const{ref:x,value:D="",error:w,invalid:M,onChange:S,onBlur:A}=Ke({name:e,defaultValue:l,autoFocus:o,shouldUnregister:g,validateOnMount:y}),V=M?"error":C,N=M?w:n,I=B=>{ja.test(B.target.value)&&S(B.target.value)};return c.jsx(Ct,{label:r,className:s,state:V,hint:N,children:c.jsx(Xt,{inputMode:"decimal",pattern:"^-?\\d*\\.?\\d*$",ref:x,value:D,id:t,name:e,type:u,className:i,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:p,state:V,onChange:I,onBlur:A})})}function Na({name:e,id:t=e,label:r,hint:n,className:i,controlClassName:s,disabled:a,autoFocus:o,defaultValue:l,placeholder:f,type:u,suffix:d,prefix:p,shouldUnregister:g,state:C,validateOnMount:y}){const{ref:x,value:D="",error:w,invalid:M,onChange:S,onBlur:A}=Ke({name:e,defaultValue:l,autoFocus:o,shouldUnregister:g,validateOnMount:y}),V=M?"error":C,N=M?w:n;return c.jsx(Ct,{label:r,className:s,state:V,hint:N,children:c.jsx(Xt,{ref:x,value:D,id:t,name:e,type:u,className:i,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:p,state:V,onChange:S,onBlur:A})})}function Oa({name:e,id:t=e,label:r,className:n,disabled:i,value:s,defaultChecked:a,labelClassName:o,orientation:l}){const{ref:f,value:u=!1,onChange:d,onBlur:p}=Ke({name:e});return c.jsx(jn,{ref:f,name:e,checked:u,id:t,label:r,className:n,disabled:i,value:s,defaultChecked:a,labelClassName:o,orientation:l,inputProps:{onChange:d,onBlur:p}})}function ka({name:e,id:t=e,label:r,className:n,disabled:i,value:s,defaultChecked:a,labelClassName:o,orientation:l}){const{ref:f,value:u,onChange:d,onBlur:p}=Ke({name:e,disabled:i,defaultValue:a?s:void 0});return c.jsx(Cn,{ref:f,name:e,id:t,label:r,className:n,disabled:i,checked:u===s,value:s,labelClassName:o,orientation:l,inputProps:{onChange:d,onBlur:p}})}function Ea({open:e,defaultOpen:t,options:r,optionClassName:n,popoverClassName:i,name:s,id:a=s,label:o,hint:l,className:f,controlClassName:u,disabled:d,autoFocus:p,defaultValue:g,placeholder:C,shouldUnregister:y,state:x,validateOnMount:D,onOpen:w,onClose:M,renderSelectedOption:S}){const{ref:A,value:V="",error:N,invalid:I,onChange:B,onBlur:$}=Ke({name:s,defaultValue:g,autoFocus:p,shouldUnregister:y,validateOnMount:D}),R=I?"error":x,L=I?N:l,P=()=>{$==null||$(),M==null||M()};return c.jsx(Ct,{label:o,className:u,state:R,hint:L,children:c.jsx(xr,{open:e,defaultOpen:t,options:r,ref:A,value:V,id:a,name:s,className:f,disabled:d,placeholder:C,state:R,optionClassName:n,popoverClassName:i,onSelect:B,onBlur:$,onOpen:w,onClose:P,renderSelectedOption:S})})}function mi({displayError:e=!1,...t}){const{error:r,value:n,onChange:i,onBlur:s,disabled:a,name:o,ref:l}=Ke(t),f=c.jsx("input",{ref:l,type:"hidden",name:o,disabled:a,value:n,onChange:i,onBlur:s});if(e){const u=e?"error":"default",d=e?r:"";return c.jsx(Ct,{hint:d,state:u,children:f})}return f}const Sa={lg:{logo:"size-10",subLogo:"text-[0.8rem]"},md:{logo:"size-6",subLogo:"text-[0.5rem]"},sm:{logo:"size-5",subLogo:"text-[0.4rem]"}},gi=({logoUrl:e,rank:t,moniker:r,size:n="md",className:i})=>{const[s,a]=m.useState(!1),o=Sa[n],l=(r==null?void 0:r.charAt(0).toUpperCase())??String(t);return c.jsx("span",{className:k.twMerge("relative inline-block",o.logo,i),children:e&&!s?c.jsx("img",{src:e,alt:r||`Finality Provider ${t}`,className:"h-full w-full rounded-full object-cover",onError:()=>a(!0)}):c.jsx(z,{as:"span",className:"inline-flex h-full w-full items-center justify-center rounded-full bg-secondary-main text-[1rem] text-accent-contrast",children:l})})};function Tr({bsnId:e,bsnName:t,bsnLogoUrl:r,address:n,provider:i,onRemove:s}){var f,u;if(!i)return null;const a=()=>r?c.jsx(fr,{url:r,alt:t,variant:"rounded",size:"tiny",className:"mr-1"}):null,o=d=>!d||d.length<=6*2?d:`${d.slice(0,6)}...${d.slice(-6)}`,l=()=>n?c.jsx("div",{className:"text-xs text-accent-secondary",children:o(n)}):c.jsxs("div",{className:"flex items-center text-xs text-accent-secondary",children:[a(),t]});return c.jsxs("div",{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{className:"flex h-10 flex-row gap-2",children:[c.jsx(gi,{logoUrl:i.logo_url,rank:i.rank,moniker:(f=i.description)==null?void 0:f.moniker,size:"lg"}),c.jsxs("div",{className:"flex flex-col justify-center text-accent-primary",children:[l(),c.jsx(z,{as:"div",className:"text-base font-medium text-accent-primary",children:(u=i.description)==null?void 0:u.moniker})]})]}),s?c.jsx("button",{onClick:()=>s(e),className:"cursor-pointer rounded bg-accent-secondary/20 px-2 py-0.5 text-xs tracking-[0.4px] text-accent-primary",children:"Remove"}):null]})}const Fa=({attributes:e,providerItemProps:t,isSelected:r=!1,isSelectable:n=!0,onSelect:i})=>c.jsxs("div",{className:"bg-secondary-highlight h-[316px] overflow-hidden p-4 flex flex-col rounded justify-between",children:[c.jsx(Tr,{...t}),c.jsx("div",{className:"w-full h-px bg-secondary-strokeLight"}),Object.entries(e).map(([s,a])=>c.jsxs("div",{className:"text-sm flex flex-row justify-between first:mt-0 mt-1",children:[c.jsx("div",{className:"text-accent-secondary",children:s}),c.jsx("div",{className:"text-accent-primary font-medium",children:a})]},s)),i&&c.jsx(Ze,{className:"mt-4",onClick:i,disabled:!n,variant:r?"contained":"outlined",children:r?"Selected":"Select"})]});var st=1e9,Aa={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Pr,Y=!0,ge="[DecimalError] ",qe=ge+"Invalid argument: ",Rr=ge+"Exponent out of range: ",ot=Math.floor,Ue=Math.pow,Va=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe,ie=1e7,X=7,bi=9007199254740991,qt=ot(bi/X),_={};_.absoluteValue=_.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};_.comparedTo=_.cmp=function(e){var t,r,n,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(n=s.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return n===i?0:n>i^s.s<0?1:-1};_.decimalPlaces=_.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*X;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};_.dividedBy=_.div=function(e){return Ve(this,new this.constructor(e))};_.dividedToIntegerBy=_.idiv=function(e){var t=this,r=t.constructor;return Z(Ve(t,new r(e),0,1),r.precision)};_.equals=_.eq=function(e){return!this.cmp(e)};_.exponent=function(){return re(this)};_.greaterThan=_.gt=function(e){return this.cmp(e)>0};_.greaterThanOrEqualTo=_.gte=function(e){return this.cmp(e)>=0};_.isInteger=_.isint=function(){return this.e>this.d.length-2};_.isNegative=_.isneg=function(){return this.s<0};_.isPositive=_.ispos=function(){return this.s>0};_.isZero=function(){return this.s===0};_.lessThan=_.lt=function(e){return this.cmp(e)<0};_.lessThanOrEqualTo=_.lte=function(e){return this.cmp(e)<1};_.logarithm=_.log=function(e){var t,r=this,n=r.constructor,i=n.precision,s=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(fe))throw Error(ge+"NaN");if(r.s<1)throw Error(ge+(r.s?"NaN":"-Infinity"));return r.eq(fe)?new n(0):(Y=!1,t=Ve(bt(r,s),bt(e,s),s),Y=!0,Z(t,i))};_.minus=_.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?wi(t,e):yi(t,(e.s=-e.s,e))};_.modulo=_.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(ge+"NaN");return r.s?(Y=!1,t=Ve(r,e,0,1).times(e),Y=!0,r.minus(t)):Z(new n(r),i)};_.naturalExponential=_.exp=function(){return xi(this)};_.naturalLogarithm=_.ln=function(){return bt(this)};_.negated=_.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};_.plus=_.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?yi(t,e):wi(t,(e.s=-e.s,e))};_.precision=_.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(qe+e);if(t=re(i)+1,n=i.d.length-1,r=n*X+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};_.squareRoot=_.sqrt=function(){var e,t,r,n,i,s,a,o=this,l=o.constructor;if(o.s<1){if(!o.s)return new l(0);throw Error(ge+"NaN")}for(e=re(o),Y=!1,i=Math.sqrt(+o),i==0||i==1/0?(t=Ne(o.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=ot((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=a=r+3;;)if(s=n,n=s.plus(Ve(o,s,a+2)).times(.5),Ne(s.d).slice(0,a)===(t=Ne(n.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(Z(s,r+1,0),s.times(s).eq(o)){n=s;break}}else if(t!="9999")break;a+=4}return Y=!0,Z(n,r)};_.times=_.mul=function(e){var t,r,n,i,s,a,o,l,f,u=this,d=u.constructor,p=u.d,g=(e=new d(e)).d;if(!u.s||!e.s)return new d(0);for(e.s*=u.s,r=u.e+e.e,l=p.length,f=g.length,l<f&&(s=p,p=g,g=s,a=l,l=f,f=a),s=[],a=l+f,n=a;n--;)s.push(0);for(n=f;--n>=0;){for(t=0,i=l+n;i>n;)o=s[i]+g[n]*p[i-n-1]+t,s[i--]=o%ie|0,t=o/ie|0;s[i]=(s[i]+t)%ie|0}for(;!s[--a];)s.pop();return t?++r:s.shift(),e.d=s,e.e=r,Y?Z(e,d.precision):e};_.toDecimalPlaces=_.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Ee(e,0,st),t===void 0?t=n.rounding:Ee(t,0,8),Z(r,e+re(r)+1,t))};_.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ye(n,!0):(Ee(e,0,st),t===void 0?t=i.rounding:Ee(t,0,8),n=Z(new i(n),e+1,t),r=Ye(n,!0,e+1)),r};_.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?Ye(i):(Ee(e,0,st),t===void 0?t=s.rounding:Ee(t,0,8),n=Z(new s(i),e+re(i)+1,t),r=Ye(n.abs(),!1,e+re(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};_.toInteger=_.toint=function(){var e=this,t=e.constructor;return Z(new t(e),re(e)+1,t.rounding)};_.toNumber=function(){return+this};_.toPower=_.pow=function(e){var t,r,n,i,s,a,o=this,l=o.constructor,f=12,u=+(e=new l(e));if(!e.s)return new l(fe);if(o=new l(o),!o.s){if(e.s<1)throw Error(ge+"Infinity");return o}if(o.eq(fe))return o;if(n=l.precision,e.eq(fe))return Z(o,n);if(t=e.e,r=e.d.length-1,a=t>=r,s=o.s,a){if((r=u<0?-u:u)<=bi){for(i=new l(fe),t=Math.ceil(n/X+4),Y=!1;r%2&&(i=i.times(o),gn(i.d,t)),r=ot(r/2),r!==0;)o=o.times(o),gn(o.d,t);return Y=!0,e.s<0?new l(fe).div(i):Z(i,n)}}else if(s<0)throw Error(ge+"NaN");return s=s<0&&e.d[Math.max(t,r)]&1?-1:1,o.s=1,Y=!1,i=e.times(bt(o,n+f)),Y=!0,i=xi(i),i.s=s,i};_.toPrecision=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?(r=re(i),n=Ye(i,r<=s.toExpNeg||r>=s.toExpPos)):(Ee(e,1,st),t===void 0?t=s.rounding:Ee(t,0,8),i=Z(new s(i),e,t),r=re(i),n=Ye(i,e<=r||r<=s.toExpNeg,e)),n};_.toSignificantDigits=_.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Ee(e,1,st),t===void 0?t=n.rounding:Ee(t,0,8)),Z(new n(r),e,t)};_.toString=_.valueOf=_.val=_.toJSON=_[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=re(e),r=e.constructor;return Ye(e,t<=r.toExpNeg||t>=r.toExpPos)};function yi(e,t){var r,n,i,s,a,o,l,f,u=e.constructor,d=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),Y?Z(t,d):t;if(l=e.d,f=t.d,a=e.e,i=t.e,l=l.slice(),s=a-i,s){for(s<0?(n=l,s=-s,o=f.length):(n=f,i=a,o=l.length),a=Math.ceil(d/X),o=a>o?a+1:o+1,s>o&&(s=o,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(o=l.length,s=f.length,o-s<0&&(s=o,n=f,f=l,l=n),r=0;s;)r=(l[--s]=l[s]+f[s]+r)/ie|0,l[s]%=ie;for(r&&(l.unshift(r),++i),o=l.length;l[--o]==0;)l.pop();return t.d=l,t.e=i,Y?Z(t,d):t}function Ee(e,t,r){if(e!==~~e||e<t||e>r)throw Error(qe+e)}function Ne(e){var t,r,n,i=e.length-1,s="",a=e[0];if(i>0){for(s+=a,t=1;t<i;t++)n=e[t]+"",r=X-n.length,r&&(s+=Te(r)),s+=n;a=e[t],n=a+"",r=X-n.length,r&&(s+=Te(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}var Ve=function(){function e(n,i){var s,a=0,o=n.length;for(n=n.slice();o--;)s=n[o]*i+a,n[o]=s%ie|0,a=s/ie|0;return a&&n.unshift(a),n}function t(n,i,s,a){var o,l;if(s!=a)l=s>a?1:-1;else for(o=l=0;o<s;o++)if(n[o]!=i[o]){l=n[o]>i[o]?1:-1;break}return l}function r(n,i,s){for(var a=0;s--;)n[s]-=a,a=n[s]<i[s]?1:0,n[s]=a*ie+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,a){var o,l,f,u,d,p,g,C,y,x,D,w,M,S,A,V,N,I,B=n.constructor,$=n.s==i.s?1:-1,R=n.d,L=i.d;if(!n.s)return new B(n);if(!i.s)throw Error(ge+"Division by zero");for(l=n.e-i.e,N=L.length,A=R.length,g=new B($),C=g.d=[],f=0;L[f]==(R[f]||0);)++f;if(L[f]>(R[f]||0)&&--l,s==null?w=s=B.precision:a?w=s+(re(n)-re(i))+1:w=s,w<0)return new B(0);if(w=w/X+2|0,f=0,N==1)for(u=0,L=L[0],w++;(f<A||u)&&w--;f++)M=u*ie+(R[f]||0),C[f]=M/L|0,u=M%L|0;else{for(u=ie/(L[0]+1)|0,u>1&&(L=e(L,u),R=e(R,u),N=L.length,A=R.length),S=N,y=R.slice(0,N),x=y.length;x<N;)y[x++]=0;I=L.slice(),I.unshift(0),V=L[0],L[1]>=ie/2&&++V;do u=0,o=t(L,y,N,x),o<0?(D=y[0],N!=x&&(D=D*ie+(y[1]||0)),u=D/V|0,u>1?(u>=ie&&(u=ie-1),d=e(L,u),p=d.length,x=y.length,o=t(d,y,p,x),o==1&&(u--,r(d,N<p?I:L,p))):(u==0&&(o=u=1),d=L.slice()),p=d.length,p<x&&d.unshift(0),r(y,d,x),o==-1&&(x=y.length,o=t(L,y,N,x),o<1&&(u++,r(y,N<x?I:L,x))),x=y.length):o===0&&(u++,y=[0]),C[f++]=u,o&&y[0]?y[x++]=R[S]||0:(y=[R[S]],x=1);while((S++<A||y[0]!==void 0)&&w--)}return C[0]||C.shift(),g.e=l,Z(g,a?s+re(g)+1:s)}}();function xi(e,t){var r,n,i,s,a,o,l=0,f=0,u=e.constructor,d=u.precision;if(re(e)>16)throw Error(Rr+re(e));if(!e.s)return new u(fe);for(Y=!1,o=d,a=new u(.03125);e.abs().gte(.1);)e=e.times(a),f+=5;for(n=Math.log(Ue(2,f))/Math.LN10*2+5|0,o+=n,r=i=s=new u(fe),u.precision=o;;){if(i=Z(i.times(e),o),r=r.times(++l),a=s.plus(Ve(i,r,o)),Ne(a.d).slice(0,o)===Ne(s.d).slice(0,o)){for(;f--;)s=Z(s.times(s),o);return u.precision=d,t==null?(Y=!0,Z(s,d)):s}s=a}}function re(e){for(var t=e.e*X,r=e.d[0];r>=10;r/=10)t++;return t}function ir(e,t,r){if(t>e.LN10.sd())throw Y=!0,r&&(e.precision=r),Error(ge+"LN10 precision limit exceeded");return Z(new e(e.LN10),t)}function Te(e){for(var t="";e--;)t+="0";return t}function bt(e,t){var r,n,i,s,a,o,l,f,u,d=1,p=10,g=e,C=g.d,y=g.constructor,x=y.precision;if(g.s<1)throw Error(ge+(g.s?"NaN":"-Infinity"));if(g.eq(fe))return new y(0);if(t==null?(Y=!1,f=x):f=t,g.eq(10))return t==null&&(Y=!0),ir(y,f);if(f+=p,y.precision=f,r=Ne(C),n=r.charAt(0),s=re(g),Math.abs(s)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=Ne(g.d),n=r.charAt(0),d++;s=re(g),n>1?(g=new y("0."+r),s++):g=new y(n+"."+r.slice(1))}else return l=ir(y,f+2,x).times(s+""),g=bt(new y(n+"."+r.slice(1)),f-p).plus(l),y.precision=x,t==null?(Y=!0,Z(g,x)):g;for(o=a=g=Ve(g.minus(fe),g.plus(fe),f),u=Z(g.times(g),f),i=3;;){if(a=Z(a.times(u),f),l=o.plus(Ve(a,new y(i),f)),Ne(l.d).slice(0,f)===Ne(o.d).slice(0,f))return o=o.times(2),s!==0&&(o=o.plus(ir(y,f+2,x).times(s+""))),o=Ve(o,new y(d),f),y.precision=x,t==null?(Y=!0,Z(o,x)):o;o=l,i+=2}}function mn(e,t){var r,n,i;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(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=ot(r/X),e.d=[],n=(r+1)%X,r<0&&(n+=X),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=X;n<i;)e.d.push(+t.slice(n,n+=X));t=t.slice(n),n=X-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),Y&&(e.e>qt||e.e<-qt))throw Error(Rr+r)}else e.s=0,e.e=0,e.d=[0];return e}function Z(e,t,r){var n,i,s,a,o,l,f,u,d=e.d;for(a=1,s=d[0];s>=10;s/=10)a++;if(n=t-a,n<0)n+=X,i=t,f=d[u=0];else{if(u=Math.ceil((n+1)/X),s=d.length,u>=s)return e;for(f=s=d[u],a=1;s>=10;s/=10)a++;n%=X,i=n-X+a}if(r!==void 0&&(s=Ue(10,a-i-1),o=f/s%10|0,l=t<0||d[u+1]!==void 0||f%s,l=r<4?(o||l)&&(r==0||r==(e.s<0?3:2)):o>5||o==5&&(r==4||l||r==6&&(n>0?i>0?f/Ue(10,a-i):0:d[u-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(s=re(e),d.length=1,t=t-s-1,d[0]=Ue(10,(X-t%X)%X),e.e=ot(-t/X)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=u,s=1,u--):(d.length=u+1,s=Ue(10,X-n),d[u]=i>0?(f/Ue(10,a-i)%Ue(10,i)|0)*s:0),l)for(;;)if(u==0){(d[0]+=s)==ie&&(d[0]=1,++e.e);break}else{if(d[u]+=s,d[u]!=ie)break;d[u--]=0,s=1}for(n=d.length;d[--n]===0;)d.pop();if(Y&&(e.e>qt||e.e<-qt))throw Error(Rr+re(e));return e}function wi(e,t){var r,n,i,s,a,o,l,f,u,d,p=e.constructor,g=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),Y?Z(t,g):t;if(l=e.d,d=t.d,n=t.e,f=e.e,l=l.slice(),a=f-n,a){for(u=a<0,u?(r=l,a=-a,o=d.length):(r=d,n=f,o=l.length),i=Math.max(Math.ceil(g/X),o)+2,a>i&&(a=i,r.length=1),r.reverse(),i=a;i--;)r.push(0);r.reverse()}else{for(i=l.length,o=d.length,u=i<o,u&&(o=i),i=0;i<o;i++)if(l[i]!=d[i]){u=l[i]<d[i];break}a=0}for(u&&(r=l,l=d,d=r,t.s=-t.s),o=l.length,i=d.length-o;i>0;--i)l[o++]=0;for(i=d.length;i>a;){if(l[--i]<d[i]){for(s=i;s&&l[--s]===0;)l[s]=ie-1;--l[s],l[i]+=ie}l[i]-=d[i]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(t.d=l,t.e=n,Y?Z(t,g):t):new p(0)}function Ye(e,t,r){var n,i=re(e),s=Ne(e.d),a=s.length;return t?(r&&(n=r-a)>0?s=s.charAt(0)+"."+s.slice(1)+Te(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Te(-i-1)+s,r&&(n=r-a)>0&&(s+=Te(n))):i>=a?(s+=Te(i+1-a),r&&(n=r-i-1)>0&&(s=s+"."+Te(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-a)>0&&(i+1===a&&(s+="."),s+=Te(n))),e.s<0?"-"+s:s}function gn(e,t){if(e.length>t)return e.length=t,!0}function ji(e){var t,r,n;function i(s){var a=this;if(!(a instanceof i))return new i(s);if(a.constructor=i,s instanceof i){a.s=s.s,a.e=s.e,a.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(qe+s);if(s>0)a.s=1;else if(s<0)s=-s,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(s===~~s&&s<1e7){a.e=0,a.d=[s];return}return mn(a,s.toString())}else if(typeof s!="string")throw Error(qe+s);if(s.charCodeAt(0)===45?(s=s.slice(1),a.s=-1):a.s=1,Va.test(s))mn(a,s);else throw Error(qe+s)}if(i.prototype=_,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=ji,i.config=i.set=La,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 i.config(e),i}function La(e){if(!e||typeof e!="object")throw Error(ge+"Object expected");var t,r,n,i=["precision",1,st,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(ot(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(qe+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(qe+r+": "+n);return this}var Pr=ji(Aa);fe=new Pr(1);const Da={prefix:"$",precision:2,zeroDisplay:"-",format:{minimumFractionDigits:2,maximumFractionDigits:2}};function _a(e,t={}){const{prefix:r,precision:n,zeroDisplay:i,format:s}={...Da,...t};if(e===0)return i;const a=e.toLocaleString("en",s??{maximumFractionDigits:n});return`${r}${a}`}function Ma(e,t,r){const n=e*t;return _a(n,r)}const Ta=(e,t,r)=>new Pr(e).toDecimalPlaces(t,r).toNumber(),Ra=({fieldName:e,currencyIcon:t,currencyName:r,displayBalance:n,placeholder:i="Enter Amount",balanceDetails:s,min:a="0",step:o="any",autoFocus:l=!0})=>{const f=Dr({name:e,defaultValue:""}),{setValue:u}=Ge(),d=parseFloat(f||"0"),p=Ma(d,(s==null?void 0:s.price)??0,{zeroDisplay:"$0.00"}),g=y=>{u(e,y.target.value,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},C=y=>{(y.key==="ArrowUp"||y.key==="ArrowDown")&&y.preventDefault()};return c.jsxs(Gt,{className:"flex w-full flex-col content-center justify-between gap-4",children:[c.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("img",{src:t,alt:r,className:"h-10 max-h-[2.5rem] w-10 max-w-[2.5rem]"}),c.jsx("div",{className:"text-lg",children:r})]}),c.jsx("input",{type:"number",value:f??"",min:a,step:o,onChange:g,onKeyDown:C,placeholder:i,autoFocus:l,className:"w-2/3 bg-transparent text-right text-lg outline-none"})]}),c.jsx(mi,{name:e,defaultValue:""}),s&&n?c.jsxs("div",{className:"flex w-full flex-row content-center justify-between text-sm",children:[c.jsxs("div",{children:["Stakable:"," ",c.jsx("span",{className:"cursor-default",children:Ta(Number(s.balance),s.decimals??8)})," ",s.symbol]}),s.displayUSD&&s.price!==void 0&&c.jsxs("div",{children:[p," USD"]})]}):null]})};function Pa({items:e,onRemove:t}){const r=m.useMemo(()=>e,[e]);return r.length===0?null:c.jsx("div",{className:"flex flex-col gap-8",children:r.map(({bsnId:n,bsnName:i,bsnLogoUrl:s,provider:a})=>c.jsx(Tr,{bsnId:n,bsnName:i,bsnLogoUrl:s,provider:a,onRemove:t},`${n}-${a.rank}`))})}function Ba({max:e,items:t=[],actionText:r,onAdd:n,onRemove:i}){const s=m.useMemo(()=>t.length,[t]);return c.jsx(Gt,{children:c.jsxs("div",{className:"flex w-full flex-col gap-4",children:[c.jsx("div",{className:"flex flex-row",children:c.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[c.jsx("span",{className:"text-sm sm:text-base",children:r}),c.jsx(ei,{counter:s,max:e,onAdd:n})]})}),s>0&&c.jsx(Pa,{items:t,onRemove:i})]})})}function Qt({title:e,children:t,className:r,hint:n}){return c.jsxs("div",{className:k.twMerge("flex flex-row items-center justify-between text-accent-primary",n&&"items-start",r),children:[c.jsx(z,{as:"div",variant:"body1",children:e}),n?c.jsxs("div",{className:"flex flex-col items-end",children:[c.jsx(z,{as:"div",className:"flex items-center gap-2",children:t}),c.jsx(z,{as:"div",variant:"body2",className:"text-accent-secondary",children:n})]}):c.jsx(z,{as:"div",className:"flex items-center gap-2",children:t})]})}function Ia(e){return yt({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 Ci({value:e,onEdit:t,title:r="Network Fee Rate",className:n}){return c.jsxs(Qt,{title:r,className:n,children:[c.jsxs("span",{children:[e," sats/vB"]}),t&&c.jsx(Ze,{size:"small",variant:"outlined",className:"h-6 w-6 pl-1 text-secondary-strokeDark",onClick:t,children:c.jsx(Ia,{size:16,className:"text-secondary-strokeDark"})})]})}function Ni({amount:e,coinSymbol:t,hint:r,title:n,className:i,decimals:s=8}){const a=typeof e=="number"?e===0?"0":e.toFixed(s).replace(/0+$/,"").replace(/\.$/,""):e;return c.jsxs(Qt,{title:n??`${t} Network Fee`,hint:r,className:i,children:[a," ",t]})}function Oi({amount:e,coinSymbol:t,hint:r,title:n,className:i,decimals:s=5}){const a=typeof e=="number"?e.toFixed(s):e;return c.jsxs(Qt,{title:n??`${t} Network Fee`,hint:r,className:i,children:[a," ",t]})}function ki({total:e,coinSymbol:t,hint:r,title:n="Total",className:i,decimals:s=8}){const a=typeof e=="number"?e===0?"0":e.toFixed(s).replace(/0+$/,"").replace(/\.$/,""):e;return c.jsxs("div",{className:k.twMerge("flex flex-row items-start justify-between text-accent-primary",i),children:[c.jsx(z,{variant:"body1",className:"font-bold",children:n}),c.jsxs("div",{className:"flex flex-col items-end justify-center",children:[c.jsxs(z,{variant:"body1",className:"font-bold",children:[a," ",t]}),r&&c.jsx(z,{variant:"body1",className:"text-sm text-accent-secondary",children:r})]})]})}function $a({className:e,feeRate:t,onFeeRateEdit:r,feeAmount:n,coinSymbol:i,feeAmountHint:s,total:a,totalHint:o,bbnFeeAmount:l,bbnCoinSymbol:f,bbnFeeAmountHint:u,bbnFeeDecimals:d}){return c.jsx(Gt,{className:k.twMerge("flex w-full flex-col content-center justify-between gap-4",e),children:c.jsxs("div",{className:"flex flex-col gap-6 p-4",children:[c.jsx(Ci,{value:t,onEdit:r}),c.jsx(Ni,{amount:n,coinSymbol:i,hint:s}),l!==void 0&&f?c.jsx(Oi,{amount:l,coinSymbol:f,hint:u,decimals:d}):null,c.jsx("div",{className:"divider my-4"}),c.jsx(ki,{total:a,coinSymbol:i,hint:o})]})})}function Ha(){const[e,t]=m.useState(!1);return m.useEffect(()=>{const r=()=>t(window.innerWidth<=640);return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e}function Ua({className:e,...t}){const n=Ha()?Cr:$n;return c.jsx(n,{...t,className:k.twMerge("w-[41.25rem] max-w-full",e)})}const Wa=({open:e,processing:t=!1,onClose:r,onProceed:n,bsns:i,finalityProviders:s,details:a})=>{const o=[{label:"Stake Amount",value:a.stakeAmount},{label:"Fee Rate",value:a.feeRate},{label:"Transaction Fees",value:a.transactionFees},{label:"Term",value:c.jsxs(c.Fragment,{children:[a.term.blocks,c.jsx("br",{}),c.jsx("span",{className:"text-md text-secondary",children:a.term.duration})]})},{label:"Unbonding",value:a.unbonding},{label:"Unbonding Fee",value:a.unbondingFee}];return c.jsxs(Ua,{open:e,onClose:r,children:[c.jsx(Un,{title:"Preview",onClose:r,className:"text-accent-primary"}),c.jsxs(Wn,{className:"no-scrollbar mb-8 mt-4 flex max-h-[calc(100vh-12rem)] flex-col gap-4 overflow-y-auto text-accent-primary",children:[c.jsx(Qn,{className:"p-6 pt-4",children:c.jsxs("div",{className:"flex flex-col",children:[i.length>1?c.jsxs("div",{className:"grid grid-cols-2 items-center gap-4 pb-4",children:[c.jsx(z,{variant:"caption",className:"text-secondary text-center",children:"BSNs"}),c.jsx(z,{variant:"caption",className:"text-secondary text-center",children:"Finality Provider"})]}):null,c.jsxs("div",{className:"grid grid-cols-2 items-center gap-4 rounded bg-primary-contrast p-4",children:[c.jsx("div",{className:"flex flex-col gap-3",children:i.map((l,f)=>c.jsxs("div",{className:"flex w-full items-center justify-center gap-2 py-1",children:[l.icon,c.jsx(z,{variant:"body2",className:"font-medium",children:l.name})]},`bsn-${f}`))}),c.jsx("div",{className:"flex flex-col gap-3",children:s.map((l,f)=>c.jsxs("div",{className:"flex w-full items-center justify-center gap-2 py-1",children:[l.icon,c.jsx(z,{variant:"body2",className:"font-medium",children:l.name})]},`fp-${f}`))})]})]})}),c.jsx("div",{className:"flex flex-col",children:o.map((l,f)=>c.jsxs("div",{className:"flex flex-row items-center justify-between py-3",children:[c.jsx(z,{variant:"body1",className:"text-secondary font-normal",children:l.label}),c.jsx(z,{variant:"body1",className:"text-right font-normal",children:l.value})]},f))}),c.jsx("div",{className:"border-divider w-full border-t"}),c.jsxs("div",{className:"pt-2",children:[c.jsx(zt,{variant:"h6",className:"text-primary mb-2",children:"Attention!"}),c.jsxs(z,{variant:"body2",className:"text-secondary",children:["1. No third party possesses your staked BTC. You are the only one who can unbond and withdraw your stake.",c.jsx("br",{})]}),c.jsx("br",{}),c.jsx(z,{variant:"body2",className:"text-secondary",children:"2. Your stake will first be sent to Babylon Genesis for verification (~20 seconds), then you will be prompted to submit it to the Bitcoin ledger. It will be marked as 'Pending' until it receives 10 Bitcoin confirmations."})]})]}),c.jsxs(Jn,{className:"flex gap-4 pb-8 pt-0",children:[c.jsx(Ze,{variant:"outlined",color:"primary",onClick:r,className:"flex-1",children:"Cancel"}),c.jsx(Ze,{variant:"contained",color:"primary",onClick:n,className:"flex-1",disabled:t,children:t?"Processing...":"Proceed to Signing"})]})]})},Ja={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function qa({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:k.twMerge("bbn-list-legacy",`bbn-list-legacy-${t}`,e),children:m.Children.map(r,n=>m.isValidElement(n)?m.cloneElement(n,{orientation:Ja[t]}):n)})}function za({className:e,orientation:t="horizontal",title:r,value:n,suffix:i}){return c.jsxs("div",{className:k.twJoin("bbn-list-item-legacy",`bbn-list-item-legacy-${t}`,e),children:[c.jsx(z,{as:"div",className:k.twJoin("bbn-list-title-legacy",`bbn-list-title-legacy-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(z,{as:"div",className:k.twJoin("bbn-list-value-legacy",`bbn-list-value-legacy-${t}`),variant:"body1",children:[n,i]})]})}exports.Accordion=Vi;exports.AccordionDetails=_i;exports.AccordionSummary=Li;exports.AmountSubsection=Ra;exports.Avatar=fr;exports.AvatarGroup=Mi;exports.BBNFeeAmount=Oi;exports.BTCFeeAmount=Ni;exports.BTCFeeRate=Ci;exports.Badge=Uo;exports.BitcoinPublicKeyIcon=fo;exports.Button=Ze;exports.Card=Qn;exports.Cell=Kn;exports.Checkbox=jn;exports.CheckboxField=Oa;exports.Chip=mo;exports.CloseIcon=Hn;exports.Column=Yn;exports.Copy=Ko;exports.CopyIcon=vo;exports.CounterButton=ei;exports.Dialog=$n;exports.DialogBody=Wn;exports.DialogFooter=Jn;exports.DialogHeader=Un;exports.DisplayHash=Go;exports.FeeItem=Qt;exports.FeesSection=$a;exports.FinalityProviderItem=Tr;exports.FinalityProviderLogo=gi;exports.FinalityProviderSubsection=Ba;exports.Form=xa;exports.FormControl=Ct;exports.Heading=zt;exports.HiddenField=mi;exports.IconButton=cr;exports.Input=Xt;exports.LinkWalletIcon=ho;exports.List=$o;exports.ListItem=Ho;exports.ListItemLegacy=za;exports.ListLegacy=qa;exports.Loader=go;exports.Menu=qo;exports.MenuDrawer=kr;exports.MenuItem=zo;exports.MobileDialog=Cr;exports.NumberField=Ca;exports.Popover=yr;exports.Portal=jt;exports.PreviewModal=Wa;exports.Radio=Cn;exports.RadioField=ka;exports.ScrollLocker=uo;exports.Select=xr;exports.SelectField=Ea;exports.SubMenu=Zo;exports.SubMenuItem=Xo;exports.SubSection=Gt;exports.Table=Po;exports.TableElement=Fa;exports.Text=z;exports.TextField=Na;exports.ThemedIcon=Yt;exports.Toggle=Bo;exports.Total=ki;exports.UsingInscriptionIcon=po;exports.WalletDisconnectButton=xn;exports.iconColorVariants=jr;exports.useClickOutside=Rn;exports.useControlledState=ze;exports.useCopy=ri;exports.useField=Ke;exports.useFieldState=wa;exports.useFormContext=Ge;exports.useFormState=Lr;exports.useIsMobile=Or;exports.useMemoizedArray=Tn;exports.useMenuContext=Nr;exports.useModalManager=wr;exports.useResizeObserver=Pn;exports.useTableScroll=Zn;exports.useTableSort=Gn;exports.useWatch=Dr;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),m=require("react"),N=require("tailwind-merge"),xn=require("react-dom");function wn(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 Ae=wn(m),Li=wn(xn);function ze({value:e,defaultValue:t,onStateChange:r}={}){const[n,i]=m.useState(t),{current:s}=m.useRef(e!=null),a=s?e:n,o=m.useCallback(l=>{s||i(l),r==null||r(l)},[s,r,i]);return[a,o]}const ur=m.createContext({disabled:!1,expanded:!1});function Di({expanded:e,defaultExpanded:t,onChange:r,className:n,disabled:i=!1,children:s}){const[a=!1,o]=ze({value:e,defaultValue:t,onStateChange:r}),l=m.useCallback(()=>{o(!a)},[o,a]),f=m.useMemo(()=>({defaultExpanded:t,disabled:i,expanded:a&&!i,toggle:i?void 0:l}),[t,a,i,l]);return c.jsx(ur.Provider,{value:f,children:c.jsx("div",{className:N.twJoin("bbn-accordion",i&&"bbn-accordion-disabled",n),children:s})})}const Ze=m.forwardRef(({variant:e="contained",size:t="large",color:r="primary",fluid:n=!1,className:i,disabled:s,...a},o)=>c.jsx("button",{...a,disabled:s,ref:o,className:N.twJoin("bbn-btn",`bbn-btn-${e}`,`bbn-btn-${r}`,`bbn-btn-${t}`,n&&"bbn-btn-fluid",i)}));Ze.displayName="Button";const fr=({className:e,...t})=>c.jsx("button",{...t,className:N.twJoin("bbn-btn-icon",e)}),jn=m.forwardRef(({className:e,...t},r)=>c.jsx(Ze,{...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 _i({className:e,iconClassName:t,children:r,renderIcon:n=()=>null}){const{expanded:i,toggle:s}=m.useContext(ur),a=n(i);return c.jsxs("div",{className:N.twJoin("bbn-accordion-summary",e),onClick:s,children:[r,a&&c.jsx(fr,{className:N.twJoin("bbn-accordion-icon",t),children:a})]})}function dr(e,t){return typeof e!="number"?typeof t=="number"?dr(t):t:`${e}px`}function Mi(e=!0){const[t,r]=m.useState("0px"),[n,i]=m.useState(),s=m.useRef(null);return m.useEffect(()=>{const a=new ResizeObserver(o=>{const[l]=o;r(dr(l.target.clientHeight)??"0px")});i(a)},[]),m.useEffect(function(){const{current:o}=s;if(!(!e||!o))return n==null||n.observe(o),()=>{n==null||n.unobserve(o)}},[e,n]),{height:t,ref:s}}function Ti({unmountOnExit:e=!1,animationDuration:t=200,className:r,wrapperClassName:n,children:i}){const{expanded:s}=m.useContext(ur),[a,o]=m.useState(s),l=a||!e,{height:f,ref:u}=Mi(l);return m.useEffect(function(){if(s===a)return;if(s){o(!0);return}const p=setTimeout(o,t,!1);return()=>{clearTimeout(p)}},[s,a,t]),c.jsx("div",{className:N.twJoin("bbn-accordion-details",n),style:{height:s?f:"0px",visibility:a?"visible":"hidden",transitionDuration:`${t}ms`},children:l?c.jsx("div",{ref:u,className:N.twJoin("bbn-accordion-content",r),children:i}):null})}const z=m.forwardRef(({variant:e="body1",as:t="p",children:r,className:n,...i},s)=>m.createElement(t,{...i,ref:s,className:N.twJoin(`bbn-text-${e}`,n)},r));z.displayName="Text";const Zt=m.forwardRef(({variant:e,as:t=e,children:r,className:n,...i},s)=>m.createElement(t,{...i,ref:s,className:N.twJoin(`bbn-${e}`,n)},r));Zt.displayName="Heading";function Pt({className:e,style:t,size:r="large",variant:n="circular",alt:i,url:s,children:a}){return c.jsx("div",{style:t,className:N.twJoin("bbn-avatar",`bbn-avatar-${r}`,`bbn-avatar-${n}`,e),children:s?c.jsx("img",{className:"bbn-avatar-img",src:s,alt:i}):a})}const Ri=({max:e=1/0,className:t,children:r,avatarClassName:n,variant:i,...s})=>{const a=m.Children.count(r);return c.jsxs("div",{className:N.twJoin("bbn-avatar-group",t),children:[m.Children.map(r,(o,l)=>m.isValidElement(o)&&l+1<=e?m.cloneElement(o,{...s,className:N.twMerge(n,o.props.className),variant:i}):null),a>e&&c.jsxs(Pt,{size:s.size,variant:i,className:n,children:["+",a-e]})]})},Cn=m.forwardRef(function({label:t,checked:r,defaultChecked:n=!1,inputProps:i,orientation:s="left",disabled:a=!1,className:o,inputType:l,labelClassName:f,renderIcon:u,onChange:d,...p},g){const[C=!1,y]=ze({value:r,defaultValue:n,onStateChange:d});function x(w){var M;y(w.currentTarget.checked),(M=i==null?void 0:i.onChange)==null||M.call(i,w)}const D=c.jsxs("span",{className:N.twJoin("bbn-switcher",a&&"bbn-switcher-disabled",o),children:[u(C),c.jsx("input",{ref:g,type:l,disabled:a,className:"bbn-switcher-input",...p,...i,checked:C,onChange:x})]});return t?c.jsxs(z,{as:"label",variant:"body1",className:N.twJoin("bbn-switcher-label",s==="left"?"bbn-switcher-left":"bbn-switcher-right",f),children:[D,t]}):D}),Pi={false:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.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:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.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"})})},Nn=m.forwardRef(function(t,r){return c.jsx(Cn,{ref:r,...t,inputType:"checkbox",renderIcon:n=>Pi[n.toString()]})}),Bi={true:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.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:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.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"})})},On=m.forwardRef(function(t,r){return c.jsx(Cn,{ref:r,...t,inputType:"radio",renderIcon:n=>Bi[n.toString()]})});var kn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ur=m.createContext&&m.createContext(kn),Ii=["attr","size","title"];function $i(e,t){if(e==null)return{};var r=Hi(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Hi(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 Bt(){return Bt=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},Bt.apply(this,arguments)}function Wr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function It(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wr(Object(r),!0).forEach(function(n){Ui(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ui(e,t,r){return t=Wi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wi(e){var t=Ji(e,"string");return typeof t=="symbol"?t:t+""}function Ji(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 En(e){return e&&e.map((t,r)=>m.createElement(t.tag,It({key:r},t.attr),En(t.child)))}function yt(e){return t=>m.createElement(qi,Bt({attr:It({},e.attr)},t),En(e.child))}function qi(e){var t=r=>{var{attr:n,size:i,title:s}=e,a=$i(e,Ii),o=i||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),m.createElement("svg",Bt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,a,{className:l,style:It(It({color:e.color||r.color},r.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&m.createElement("title",null,s),e.children)};return Ur!==void 0?m.createElement(Ur.Consumer,null,r=>t(r)):t(kn)}function zi(e){return yt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 16L6 10H18L12 16Z"},child:[]}]})(e)}function Zi(e){return yt({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 Xi(e){return yt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 8L18 14H6L12 8Z"},child:[]}]})(e)}var Jr=function(t){return t.reduce(function(r,n){var i=n[0],s=n[1];return r[i]=s,r},{})},qr=typeof window<"u"&&window.document&&window.document.createElement?Ae.useLayoutEffect:Ae.useEffect,le="top",ve="bottom",me="right",ce="left",hr="auto",xt=[le,ve,me,ce],tt="start",mt="end",Yi="clippingParents",Sn="viewport",ct="popper",Gi="reference",zr=xt.reduce(function(e,t){return e.concat([t+"-"+tt,t+"-"+mt])},[]),Fn=[].concat(xt,[hr]).reduce(function(e,t){return e.concat([t,t+"-"+tt,t+"-"+mt])},[]),Ki="beforeRead",Qi="read",es="afterRead",ts="beforeMain",rs="main",ns="afterMain",is="beforeWrite",ss="write",os="afterWrite",as=[Ki,Qi,es,ts,rs,ns,is,ss,os];function ke(e){return e?(e.nodeName||"").toLowerCase():null}function de(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xe(e){var t=de(e).Element;return e instanceof t||e instanceof Element}function pe(e){var t=de(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function pr(e){if(typeof ShadowRoot>"u")return!1;var t=de(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function ls(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},i=t.attributes[r]||{},s=t.elements[r];!pe(s)||!ke(s)||(Object.assign(s.style,n),Object.keys(i).forEach(function(a){var o=i[a];o===!1?s.removeAttribute(a):s.setAttribute(a,o===!0?"":o)}))})}function cs(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 i=t.elements[n],s=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),o=a.reduce(function(l,f){return l[f]="",l},{});!pe(i)||!ke(i)||(Object.assign(i.style,o),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}}const us={name:"applyStyles",enabled:!0,phase:"write",fn:ls,effect:cs,requires:["computeStyles"]};function Oe(e){return e.split("-")[0]}var Je=Math.max,$t=Math.min,rt=Math.round;function ar(){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 An(){return!/^((?!chrome|android).)*safari/i.test(ar())}function nt(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),i=1,s=1;t&&pe(e)&&(i=e.offsetWidth>0&&rt(n.width)/e.offsetWidth||1,s=e.offsetHeight>0&&rt(n.height)/e.offsetHeight||1);var a=Xe(e)?de(e):window,o=a.visualViewport,l=!An()&&r,f=(n.left+(l&&o?o.offsetLeft:0))/i,u=(n.top+(l&&o?o.offsetTop:0))/s,d=n.width/i,p=n.height/s;return{width:d,height:p,top:u,right:f+d,bottom:u+p,left:f,x:f,y:u}}function vr(e){var t=nt(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 Vn(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&pr(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Le(e){return de(e).getComputedStyle(e)}function fs(e){return["table","td","th"].indexOf(ke(e))>=0}function Pe(e){return((Xe(e)?e.ownerDocument:e.document)||window.document).documentElement}function Xt(e){return ke(e)==="html"?e:e.assignedSlot||e.parentNode||(pr(e)?e.host:null)||Pe(e)}function Zr(e){return!pe(e)||Le(e).position==="fixed"?null:e.offsetParent}function ds(e){var t=/firefox/i.test(ar()),r=/Trident/i.test(ar());if(r&&pe(e)){var n=Le(e);if(n.position==="fixed")return null}var i=Xt(e);for(pr(i)&&(i=i.host);pe(i)&&["html","body"].indexOf(ke(i))<0;){var s=Le(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function wt(e){for(var t=de(e),r=Zr(e);r&&fs(r)&&Le(r).position==="static";)r=Zr(r);return r&&(ke(r)==="html"||ke(r)==="body"&&Le(r).position==="static")?t:r||ds(e)||t}function mr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function dt(e,t,r){return Je(e,$t(t,r))}function hs(e,t,r){var n=dt(e,t,r);return n>r?r:n}function Ln(){return{top:0,right:0,bottom:0,left:0}}function Dn(e){return Object.assign({},Ln(),e)}function _n(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var ps=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Dn(typeof t!="number"?t:_n(t,xt))};function vs(e){var t,r=e.state,n=e.name,i=e.options,s=r.elements.arrow,a=r.modifiersData.popperOffsets,o=Oe(r.placement),l=mr(o),f=[ce,me].indexOf(o)>=0,u=f?"height":"width";if(!(!s||!a)){var d=ps(i.padding,r),p=vr(s),g=l==="y"?le:ce,C=l==="y"?ve:me,y=r.rects.reference[u]+r.rects.reference[l]-a[l]-r.rects.popper[u],x=a[l]-r.rects.reference[l],D=wt(s),w=D?l==="y"?D.clientHeight||0:D.clientWidth||0:0,M=y/2-x/2,S=d[g],A=w-p[u]-d[C],V=w/2-p[u]/2+M,O=dt(S,V,A),I=l;r.modifiersData[n]=(t={},t[I]=O,t.centerOffset=O-V,t)}}function ms(e){var t=e.state,r=e.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Vn(t.elements.popper,i)&&(t.elements.arrow=i))}const gs={name:"arrow",enabled:!0,phase:"main",fn:vs,effect:ms,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function it(e){return e.split("-")[1]}var bs={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ys(e,t){var r=e.x,n=e.y,i=t.devicePixelRatio||1;return{x:rt(r*i)/i||0,y:rt(n*i)/i||0}}function Xr(e){var t,r=e.popper,n=e.popperRect,i=e.placement,s=e.variation,a=e.offsets,o=e.position,l=e.gpuAcceleration,f=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=a.x,g=p===void 0?0:p,C=a.y,y=C===void 0?0:C,x=typeof u=="function"?u({x:g,y}):{x:g,y};g=x.x,y=x.y;var D=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),M=ce,S=le,A=window;if(f){var V=wt(r),O="clientHeight",I="clientWidth";if(V===de(r)&&(V=Pe(r),Le(V).position!=="static"&&o==="absolute"&&(O="scrollHeight",I="scrollWidth")),V=V,i===le||(i===ce||i===me)&&s===mt){S=ve;var B=d&&V===A&&A.visualViewport?A.visualViewport.height:V[O];y-=B-n.height,y*=l?1:-1}if(i===ce||(i===le||i===ve)&&s===mt){M=me;var $=d&&V===A&&A.visualViewport?A.visualViewport.width:V[I];g-=$-n.width,g*=l?1:-1}}var R=Object.assign({position:o},f&&bs),L=u===!0?ys({x:g,y},de(r)):{x:g,y};if(g=L.x,y=L.y,l){var P;return Object.assign({},R,(P={},P[S]=w?"0":"",P[M]=D?"0":"",P.transform=(A.devicePixelRatio||1)<=1?"translate("+g+"px, "+y+"px)":"translate3d("+g+"px, "+y+"px, 0)",P))}return Object.assign({},R,(t={},t[S]=w?y+"px":"",t[M]=D?g+"px":"",t.transform="",t))}function xs(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=n===void 0?!0:n,s=r.adaptive,a=s===void 0?!0:s,o=r.roundOffsets,l=o===void 0?!0:o,f={placement:Oe(t.placement),variation:it(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Xr(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Xr(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ws={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:xs,data:{}};var Dt={passive:!0};function js(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,s=i===void 0?!0:i,a=n.resize,o=a===void 0?!0:a,l=de(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&f.forEach(function(u){u.addEventListener("scroll",r.update,Dt)}),o&&l.addEventListener("resize",r.update,Dt),function(){s&&f.forEach(function(u){u.removeEventListener("scroll",r.update,Dt)}),o&&l.removeEventListener("resize",r.update,Dt)}}const Cs={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:js,data:{}};var Ns={left:"right",right:"left",bottom:"top",top:"bottom"};function Mt(e){return e.replace(/left|right|bottom|top/g,function(t){return Ns[t]})}var Os={start:"end",end:"start"};function Yr(e){return e.replace(/start|end/g,function(t){return Os[t]})}function gr(e){var t=de(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function br(e){return nt(Pe(e)).left+gr(e).scrollLeft}function ks(e,t){var r=de(e),n=Pe(e),i=r.visualViewport,s=n.clientWidth,a=n.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;var f=An();(f||!f&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o+br(e),y:l}}function Es(e){var t,r=Pe(e),n=gr(e),i=(t=e.ownerDocument)==null?void 0:t.body,s=Je(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Je(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-n.scrollLeft+br(e),l=-n.scrollTop;return Le(i||r).direction==="rtl"&&(o+=Je(r.clientWidth,i?i.clientWidth:0)-s),{width:s,height:a,x:o,y:l}}function yr(e){var t=Le(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function Mn(e){return["html","body","#document"].indexOf(ke(e))>=0?e.ownerDocument.body:pe(e)&&yr(e)?e:Mn(Xt(e))}function ht(e,t){var r;t===void 0&&(t=[]);var n=Mn(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),s=de(n),a=i?[s].concat(s.visualViewport||[],yr(n)?n:[]):n,o=t.concat(a);return i?o:o.concat(ht(Xt(a)))}function lr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ss(e,t){var r=nt(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 Gr(e,t,r){return t===Sn?lr(ks(e,r)):Xe(t)?Ss(t,r):lr(Es(Pe(e)))}function Fs(e){var t=ht(Xt(e)),r=["absolute","fixed"].indexOf(Le(e).position)>=0,n=r&&pe(e)?wt(e):e;return Xe(n)?t.filter(function(i){return Xe(i)&&Vn(i,n)&&ke(i)!=="body"}):[]}function As(e,t,r,n){var i=t==="clippingParents"?Fs(e):[].concat(t),s=[].concat(i,[r]),a=s[0],o=s.reduce(function(l,f){var u=Gr(e,f,n);return l.top=Je(u.top,l.top),l.right=$t(u.right,l.right),l.bottom=$t(u.bottom,l.bottom),l.left=Je(u.left,l.left),l},Gr(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 Tn(e){var t=e.reference,r=e.element,n=e.placement,i=n?Oe(n):null,s=n?it(n):null,a=t.x+t.width/2-r.width/2,o=t.y+t.height/2-r.height/2,l;switch(i){case le:l={x:a,y:t.y-r.height};break;case ve:l={x:a,y:t.y+t.height};break;case me:l={x:t.x+t.width,y:o};break;case ce:l={x:t.x-r.width,y:o};break;default:l={x:t.x,y:t.y}}var f=i?mr(i):null;if(f!=null){var u=f==="y"?"height":"width";switch(s){case tt:l[f]=l[f]-(t[u]/2-r[u]/2);break;case mt:l[f]=l[f]+(t[u]/2-r[u]/2);break}}return l}function gt(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=n===void 0?e.placement:n,s=r.strategy,a=s===void 0?e.strategy:s,o=r.boundary,l=o===void 0?Yi:o,f=r.rootBoundary,u=f===void 0?Sn:f,d=r.elementContext,p=d===void 0?ct:d,g=r.altBoundary,C=g===void 0?!1:g,y=r.padding,x=y===void 0?0:y,D=Dn(typeof x!="number"?x:_n(x,xt)),w=p===ct?Gi:ct,M=e.rects.popper,S=e.elements[C?w:p],A=As(Xe(S)?S:S.contextElement||Pe(e.elements.popper),l,u,a),V=nt(e.elements.reference),O=Tn({reference:V,element:M,placement:i}),I=lr(Object.assign({},M,O)),B=p===ct?I:V,$={top:A.top-B.top+D.top,bottom:B.bottom-A.bottom+D.bottom,left:A.left-B.left+D.left,right:B.right-A.right+D.right},R=e.modifiersData.offset;if(p===ct&&R){var L=R[i];Object.keys($).forEach(function(P){var U=[me,ve].indexOf(P)>=0?1:-1,G=[le,ve].indexOf(P)>=0?"y":"x";$[P]+=L[G]*U})}return $}function Vs(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=r.boundary,s=r.rootBoundary,a=r.padding,o=r.flipVariations,l=r.allowedAutoPlacements,f=l===void 0?Fn:l,u=it(n),d=u?o?zr:zr.filter(function(C){return it(C)===u}):xt,p=d.filter(function(C){return f.indexOf(C)>=0});p.length===0&&(p=d);var g=p.reduce(function(C,y){return C[y]=gt(e,{placement:y,boundary:i,rootBoundary:s,padding:a})[Oe(y)],C},{});return Object.keys(g).sort(function(C,y){return g[C]-g[y]})}function Ls(e){if(Oe(e)===hr)return[];var t=Mt(e);return[Yr(e),t,Yr(t)]}function Ds(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,s=i===void 0?!0:i,a=r.altAxis,o=a===void 0?!0:a,l=r.fallbackPlacements,f=r.padding,u=r.boundary,d=r.rootBoundary,p=r.altBoundary,g=r.flipVariations,C=g===void 0?!0:g,y=r.allowedAutoPlacements,x=t.options.placement,D=Oe(x),w=D===x,M=l||(w||!C?[Mt(x)]:Ls(x)),S=[x].concat(M).reduce(function(De,be){return De.concat(Oe(be)===hr?Vs(t,{placement:be,boundary:u,rootBoundary:d,padding:f,flipVariations:C,allowedAutoPlacements:y}):be)},[]),A=t.rects.reference,V=t.rects.popper,O=new Map,I=!0,B=S[0],$=0;$<S.length;$++){var R=S[$],L=Oe(R),P=it(R)===tt,U=[le,ve].indexOf(L)>=0,G=U?"width":"height",q=gt(t,{placement:R,boundary:u,rootBoundary:d,altBoundary:p,padding:f}),K=U?P?me:ce:P?ve:le;A[G]>V[G]&&(K=Mt(K));var we=Mt(K),oe=[];if(s&&oe.push(q[L]<=0),o&&oe.push(q[K]<=0,q[we]<=0),oe.every(function(De){return De})){B=R,I=!1;break}O.set(R,oe)}if(I)for(var Se=C?3:1,Qe=function(be){var $e=S.find(function(_e){var je=O.get(_e);if(je)return je.slice(0,be).every(function(He){return He})});if($e)return B=$e,"break"},Be=Se;Be>0;Be--){var Ie=Qe(Be);if(Ie==="break")break}t.placement!==B&&(t.modifiersData[n]._skip=!0,t.placement=B,t.reset=!0)}}const _s={name:"flip",enabled:!0,phase:"main",fn:Ds,requiresIfExists:["offset"],data:{_skip:!1}};function Kr(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 Qr(e){return[le,me,ve,ce].some(function(t){return e[t]>=0})}function Ms(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,s=t.modifiersData.preventOverflow,a=gt(t,{elementContext:"reference"}),o=gt(t,{altBoundary:!0}),l=Kr(a,n),f=Kr(o,i,s),u=Qr(l),d=Qr(f);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const Ts={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ms};function Rs(e,t,r){var n=Oe(e),i=[ce,le].indexOf(n)>=0?-1:1,s=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,a=s[0],o=s[1];return a=a||0,o=(o||0)*i,[ce,me].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}function Ps(e){var t=e.state,r=e.options,n=e.name,i=r.offset,s=i===void 0?[0,0]:i,a=Fn.reduce(function(u,d){return u[d]=Rs(d,t.rects,s),u},{}),o=a[t.placement],l=o.x,f=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=f),t.modifiersData[n]=a}const Bs={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ps};function Is(e){var t=e.state,r=e.name;t.modifiersData[r]=Tn({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const $s={name:"popperOffsets",enabled:!0,phase:"read",fn:Is,data:{}};function Hs(e){return e==="x"?"y":"x"}function Us(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,s=i===void 0?!0:i,a=r.altAxis,o=a===void 0?!1:a,l=r.boundary,f=r.rootBoundary,u=r.altBoundary,d=r.padding,p=r.tether,g=p===void 0?!0:p,C=r.tetherOffset,y=C===void 0?0:C,x=gt(t,{boundary:l,rootBoundary:f,padding:d,altBoundary:u}),D=Oe(t.placement),w=it(t.placement),M=!w,S=mr(D),A=Hs(S),V=t.modifiersData.popperOffsets,O=t.rects.reference,I=t.rects.popper,B=typeof y=="function"?y(Object.assign({},t.rects,{placement:t.placement})):y,$=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(V){if(s){var P,U=S==="y"?le:ce,G=S==="y"?ve:me,q=S==="y"?"height":"width",K=V[S],we=K+x[U],oe=K-x[G],Se=g?-I[q]/2:0,Qe=w===tt?O[q]:I[q],Be=w===tt?-I[q]:-O[q],Ie=t.elements.arrow,De=g&&Ie?vr(Ie):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ln(),$e=be[U],_e=be[G],je=dt(0,O[q],De[q]),He=M?O[q]/2-Se-je-$e-$.mainAxis:Qe-je-$e-$.mainAxis,at=M?-O[q]/2+Se+je+_e+$.mainAxis:Be+je+_e+$.mainAxis,lt=t.elements.arrow&&wt(t.elements.arrow),Ot=lt?S==="y"?lt.clientTop||0:lt.clientLeft||0:0,kt=(P=R==null?void 0:R[S])!=null?P:0,Et=K+He-kt-Ot,St=K+at-kt,Ft=dt(g?$t(we,Et):we,K,g?Je(oe,St):oe);V[S]=Ft,L[S]=Ft-K}if(o){var At,Ir=S==="x"?le:ce,Vt=S==="x"?ve:me,h=V[A],v=A==="y"?"height":"width",b=h+x[Ir],F=h-x[Vt],k=[le,ce].indexOf(D)!==-1,j=(At=R==null?void 0:R[A])!=null?At:0,T=k?b:h-O[v]-I[v]-j+$.altAxis,H=k?h+O[v]+I[v]-j-$.altAxis:F,W=g&&k?hs(T,h,H):dt(g?T:b,h,g?H:F);V[A]=W,L[A]=W-h}t.modifiersData[n]=L}}const Ws={name:"preventOverflow",enabled:!0,phase:"main",fn:Us,requiresIfExists:["offset"]};function Js(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function qs(e){return e===de(e)||!pe(e)?gr(e):Js(e)}function zs(e){var t=e.getBoundingClientRect(),r=rt(t.width)/e.offsetWidth||1,n=rt(t.height)/e.offsetHeight||1;return r!==1||n!==1}function Zs(e,t,r){r===void 0&&(r=!1);var n=pe(t),i=pe(t)&&zs(t),s=Pe(t),a=nt(e,i,r),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((ke(t)!=="body"||yr(s))&&(o=qs(t)),pe(t)?(l=nt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=br(s))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function Xs(e){var t=new Map,r=new Set,n=[];e.forEach(function(s){t.set(s.name,s)});function i(s){r.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(o){if(!r.has(o)){var l=t.get(o);l&&i(l)}}),n.push(s)}return e.forEach(function(s){r.has(s.name)||i(s)}),n}function Ys(e){var t=Xs(e);return as.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function Gs(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function Ks(e){var t=e.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var en={placement:"bottom",modifiers:[],strategy:"absolute"};function tn(){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 Qs(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,i=t.defaultOptions,s=i===void 0?en:i;return function(o,l,f){f===void 0&&(f=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},en,s),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],p=!1,g={state:u,setOptions:function(D){var w=typeof D=="function"?D(u.options):D;y(),u.options=Object.assign({},s,u.options,w),u.scrollParents={reference:Xe(o)?ht(o):o.contextElement?ht(o.contextElement):[],popper:ht(l)};var M=Ys(Ks([].concat(n,u.options.modifiers)));return u.orderedModifiers=M.filter(function(S){return S.enabled}),C(),g.update()},forceUpdate:function(){if(!p){var D=u.elements,w=D.reference,M=D.popper;if(tn(w,M)){u.rects={reference:Zs(w,wt(M),u.options.strategy==="fixed"),popper:vr(M)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function($){return u.modifiersData[$.name]=Object.assign({},$.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],V=A.fn,O=A.options,I=O===void 0?{}:O,B=A.name;typeof V=="function"&&(u=V({state:u,options:I,name:B,instance:g})||u)}}}},update:Gs(function(){return new Promise(function(x){g.forceUpdate(),x(u)})}),destroy:function(){y(),p=!0}};if(!tn(o,l))return g;g.setOptions(f).then(function(x){!p&&f.onFirstUpdate&&f.onFirstUpdate(x)});function C(){u.orderedModifiers.forEach(function(x){var D=x.name,w=x.options,M=w===void 0?{}:w,S=x.effect;if(typeof S=="function"){var A=S({state:u,name:D,instance:g,options:M}),V=function(){};d.push(A||V)}})}function y(){d.forEach(function(x){return x()}),d=[]}return g}}var eo=[Cs,$s,ws,us,Bs,_s,Ws,gs,Ts],to=Qs({defaultModifiers:eo}),_t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ro=typeof Element<"u",no=typeof Map=="function",io=typeof Set=="function",so=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Tt(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,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Tt(e[n],t[n]))return!1;return!0}var s;if(no&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;for(s=e.entries();!(n=s.next()).done;)if(!Tt(n.value[1],t.get(n.value[0])))return!1;return!0}if(io&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(so&&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(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;if(ro&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!Tt(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var oo=function(t,r){try{return Tt(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 ao=Rn(oo);var lo=[],co=function(t,r,n){n===void 0&&(n={});var i=Ae.useRef(null),s={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||lo},a=Ae.useState({styles:{popper:{position:s.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],l=a[1],f=Ae.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(g){var C=g.state,y=Object.keys(C.elements);Li.flushSync(function(){l({styles:Jr(y.map(function(x){return[x,C.styles[x]||{}]})),attributes:Jr(y.map(function(x){return[x,C.attributes[x]]}))})})},requires:["computeStyles"]}},[]),u=Ae.useMemo(function(){var p={onFirstUpdate:s.onFirstUpdate,placement:s.placement,strategy:s.strategy,modifiers:[].concat(s.modifiers,[f,{name:"applyStyles",enabled:!1}])};return ao(i.current,p)?i.current||p:(i.current=p,p)},[s.onFirstUpdate,s.placement,s.strategy,s.modifiers,f]),d=Ae.useRef();return qr(function(){d.current&&d.current.setOptions(u)},[u]),qr(function(){if(!(t==null||r==null)){var p=n.createPopper||to,g=p(t,r,u);return d.current=g,function(){g.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}};function jt({children:e,mounted:t=!1,rootClassName:r="portal-root"}){const[n,i]=m.useState(null);return m.useEffect(()=>{if(!t){i(null);return}const s=document.createElement("div");s.className=r,i(s),document.body.appendChild(s);const a=()=>{document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")||document.documentElement.getAttribute("data-mode")==="dark"||document.body.getAttribute("data-mode")==="dark"?(s.classList.add("dark"),s.setAttribute("data-mode","dark")):(s.classList.remove("dark"),s.setAttribute("data-mode","light"))};a();const o=new MutationObserver(a);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-mode"]}),o.observe(document.body,{attributes:!0,attributeFilter:["class","data-mode"]}),()=>{o.disconnect(),document.body.removeChild(s)}},[t]),n?xn.createPortal(e,n):null}function uo(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 Pn(e){const t=m.useRef(e);return uo(t.current,e)||(t.current=e),t.current}function Bn(e,t=()=>null,{enabled:r=!0}={}){const n=Array.isArray(e)?e:[e],i=Pn(n);m.useEffect(()=>{function s(a){r&&i.every(o=>!(o!=null&&o.contains(a.target)))&&t()}return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[i,r,t])}function xr({open:e=!1,className:t,anchorEl:r,placement:n="bottom-start",offset:i=[0,0],children:s,style:a,onClickOutside:o}){const[l,f]=m.useState(null),{styles:u}=co(r,l,{placement:n,modifiers:[{name:"offset",options:{offset:i}}]});return Bn([l,r],o,{enabled:e}),c.jsx(jt,{mounted:e,children:c.jsx("div",{ref:f,style:{...u.popper,...a},className:N.twJoin("bbn-popover",t),children:s})})}function In(e){const[t,r]=m.useState({width:0,height:0});return m.useEffect(()=>{if(!e){r({width:0,height:0});return}const n=new ResizeObserver(([i])=>{r({width:i.target.clientWidth,height:i.target.clientHeight})});return n.observe(e),()=>{n.unobserve(e)}},[e]),t}const fo=e=>e.label,wr=m.forwardRef(({disabled:e,className:t,value:r,defaultValue:n,placeholder:i="Select option",open:s,defaultOpen:a,options:o=[],optionClassName:l,popoverClassName:f,state:u="default",onOpen:d,onSelect:p,onClose:g,renderSelectedOption:C=fo,...y},x)=>{const D=m.useRef(null);m.useImperativeHandle(x,()=>D.current,[]);const{width:w}=In(D.current),[M,S]=ze({value:s,defaultValue:a,onStateChange:R=>void(R?d==null?void 0:d():g==null?void 0:g())}),[A,V]=ze({value:r,defaultValue:n,onStateChange:p}),O=m.useMemo(()=>o.find(R=>R.value===A),[o,A]),I=m.useCallback(R=>{V(R.value),S(!1)},[V,S]),B=m.useCallback(()=>{S(!1)},[S]),$=m.useCallback(()=>{e||S(!M)},[M,e,S]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:D,className:N.twJoin("bbn-select",e&&"bbn-select-disabled",`bbn-select-${u}`,t),onClick:$,tabIndex:e?-1:0,...y,children:[c.jsx("span",{children:O?C(O):i}),c.jsx(Zi,{className:N.twJoin("bbn-select-icon",M&&"bbn-select-icon-open"),size:20})]}),c.jsx(xr,{anchorEl:D.current,className:N.twJoin("bbn-select-menu custom-scrollbar",f),open:M&&!e,onClickOutside:B,offset:[0,4],placement:"bottom-start",style:{width:w},children:o.map(R=>c.jsx("div",{className:N.twJoin("bbn-select-option",(O==null?void 0:O.value)===R.value&&"bbn-select-option-selected",l),onClick:()=>I(R),children:R.label},R.value))})]})});wr.displayName="Select";const Yt=m.forwardRef(({className:e,prefix:t,suffix:r,disabled:n=!1,state:i="default",...s},a)=>c.jsxs("div",{className:N.twJoin("bbn-input",n&&"bbn-input-disabled",`bbn-input-${i}`),children:[t&&c.jsx("div",{className:"bbn-input-prefix",children:t}),c.jsx("input",{ref:a,className:N.twJoin("bbn-input-field",e),disabled:n,...s}),r&&c.jsx("div",{className:"bbn-input-suffix",children:r})]}));Yt.displayName="Input";function Ct({children:e,label:t,hint:r,state:n="default",className:i}){return c.jsxs("div",{className:N.twJoin("bbn-form-control",i),children:[t?c.jsxs("label",{className:"bbn-form-control-label",children:[c.jsx("div",{className:"bbn-form-control-title",children:t}),e]}):e,r&&c.jsx("div",{className:N.twJoin("bbn-form-control-hint",`bbn-form-control-hint-${n}`),children:r})]})}const $n=m.createContext({removeDialog:()=>null,updateDialog:()=>null});function ho({children:e}){const[t,r]=m.useState({}),n=m.useMemo(()=>Object.values(t).some(o=>o),[t]);m.useEffect(function(){if(n){const l=document.body.offsetWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=document.body.offsetWidth-l>=1?dr(document.body.offsetWidth-l)??"":document.body.style.paddingRight}else document.body.style.overflow="",document.body.style.paddingRight=""},[n]);const i=m.useCallback(o=>{r(l=>Reflect.deleteProperty(l,o)?{...l}:l)},[]),s=m.useCallback((o,l)=>{r(f=>({...f,[o]:l}))},[]),a=m.useMemo(()=>({removeDialog:i,updateDialog:s}),[i,s]);return c.jsx($n.Provider,{value:a,children:e})}function jr({open:e=!1}={}){const t=m.useId(),[r,n]=m.useState(e),{updateDialog:i,removeDialog:s}=m.useContext($n),a=e||r;m.useEffect(()=>()=>{s(t)},[t]),m.useEffect(()=>{i(t,a)},[t,a,i]),m.useEffect(()=>{e&&n(!0)},[e]);const o=m.useCallback(()=>{e||n(!1)},[e]);return{mounted:r,unmount:o}}const Hn=({open:e=!1,...t})=>c.jsx("div",{...t,className:N.twJoin("bbn-backdrop",e?"animate-backdrop-in":"animate-backdrop-out",t.className)}),Un=({children:e,open:t=!1,className:r,onClose:n,hasBackdrop:i=!0,backdropClassName:s,dialogClassName:a,...o})=>{const{mounted:l,unmount:f}=jr({open:t});return c.jsxs(jt,{mounted:l,children:[c.jsx("div",{...o,className:N.twJoin("bbn-dialog-wrapper",r),children:c.jsx("div",{className:N.twJoin("bbn-dialog",t?"animate-modal-in":"animate-modal-out",a),onAnimationEnd:f,children:e})}),i&&c.jsx(Hn,{className:s,open:t,onClick:n})]})},Gt=({children:e,className:t="",size:r=40,variant:n="default",background:i=!1,rounded:s=!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 c.jsx("div",{className:N.twJoin("flex items-center justify-center",i&&o[n],s&&"rounded-full",i?"[&_svg]:w-4 [&_svg]:h-4":"[&_svg]:w-full [&_svg]:h-full","[&_svg_path]:fill-current",i&&"dark:[&_svg_path]:fill-white",a[n],t),style:{width:r,height:r},children:e})},po=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Gt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsx("svg",{style:{width:t,height:t*.545},viewBox:"0 0 22 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.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"})})}),vo=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Gt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 20 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.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"})})}),mo=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Gt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.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"}),c.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"})]})}),go=({className:e="",size:t=16,variant:r="default",color:n})=>{const i=n||Cr[r];return c.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",i,e),children:c.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"})})},Wn=({className:e="",size:t=14,variant:r="default",color:n})=>{const i=n||Cr[r];return c.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",i,e),children:c.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"})})},Cr={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"},Nr=({children:e,open:t=!1,className:r,onClose:n,...i})=>{const{mounted:s,unmount:a}=jr({open:t});return c.jsxs(jt,{mounted:s,children:[c.jsxs("div",{...i,className:N.twJoin("bbn-dialog-mobile relative",t?"animate-mobile-modal-in":"animate-mobile-modal-out",r),onAnimationEnd:a,children:[n&&c.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:c.jsx(Wn,{size:14,variant:"accent-primary"})}),e]}),c.jsx(Hn,{open:t,onClick:n})]})},Jn=({className:e,children:t,title:r,onClose:n})=>c.jsxs("div",{className:N.twJoin("bbn-dialog-header",e),children:[c.jsxs("div",{className:"bbn-dialog-title",children:[c.jsx(Zt,{variant:"h5",children:r}),!!n&&c.jsx(fr,{className:"shrink-0",onClick:n,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.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]}),qn=e=>c.jsx("div",{...e,className:N.twJoin("bbn-dialog-body",e.className)}),zn=e=>c.jsx("div",{...e,className:N.twJoin("bbn-dialog-footer",e.className)});function bo({className:e,...t}){return c.jsx("span",{...t,className:N.twJoin("bbn-chip",e)})}function yo({size:e=40,className:t}){return c.jsx("span",{className:N.twMerge("bbn-loader text-current",t),style:{width:e,height:e},children:c.jsx("svg",{viewBox:"22 22 44 44",children:c.jsx("circle",{cx:"44",cy:"44",r:"20.2",fill:"none",stroke:"currentColor",strokeWidth:"3.6"})})})}var Zn="Expected a function",rn=NaN,xo="[object Symbol]",wo=/^\s+|\s+$/g,jo=/^[-+]0x[0-9a-f]+$/i,Co=/^0b[01]+$/i,No=/^0o[0-7]+$/i,Oo=parseInt,ko=typeof _t=="object"&&_t&&_t.Object===Object&&_t,Eo=typeof self=="object"&&self&&self.Object===Object&&self,So=ko||Eo||Function("return this")(),Fo=Object.prototype,Ao=Fo.toString,Vo=Math.max,Lo=Math.min,ir=function(){return So.Date.now()};function Do(e,t,r){var n,i,s,a,o,l,f=0,u=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(Zn);t=nn(t)||0,Ht(r)&&(u=!!r.leading,d="maxWait"in r,s=d?Vo(nn(r.maxWait)||0,t):s,p="trailing"in r?!!r.trailing:p);function g(V){var O=n,I=i;return n=i=void 0,f=V,a=e.apply(I,O),a}function C(V){return f=V,o=setTimeout(D,t),u?g(V):a}function y(V){var O=V-l,I=V-f,B=t-O;return d?Lo(B,s-I):B}function x(V){var O=V-l,I=V-f;return l===void 0||O>=t||O<0||d&&I>=s}function D(){var V=ir();if(x(V))return w(V);o=setTimeout(D,y(V))}function w(V){return o=void 0,p&&n?g(V):(n=i=void 0,a)}function M(){o!==void 0&&clearTimeout(o),f=0,n=l=i=o=void 0}function S(){return o===void 0?a:w(ir())}function A(){var V=ir(),O=x(V);if(n=arguments,i=this,l=V,O){if(o===void 0)return C(l);if(d)return o=setTimeout(D,t),g(l)}return o===void 0&&(o=setTimeout(D,t)),a}return A.cancel=M,A.flush=S,A}function _o(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(Zn);return Ht(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Do(e,t,{leading:n,maxWait:t,trailing:i})}function Ht(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Mo(e){return!!e&&typeof e=="object"}function To(e){return typeof e=="symbol"||Mo(e)&&Ao.call(e)==xo}function nn(e){if(typeof e=="number")return e;if(To(e))return rn;if(Ht(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ht(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(wo,"");var r=Co.test(e);return r||No.test(e)?Oo(e.slice(2),r?2:8):jo.test(e)?rn:+e}var Ro=_o;const Xn=Rn(Ro);function Yn(e,{onLoadMore:t,hasMore:r=!1,loading:n=!1}={}){const[i,s]=m.useState(!1);return m.useEffect(()=>{const a=Xn(l=>{const f=l.target;s(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:i}}const Gn=m.createContext({data:[],columns:[],sortStates:{},onColumnSort:void 0,onRowSelect:void 0});function Kn({name:e,className:t,children:r,sorter:n,...i}){const{columns:s,sortStates:a,onColumnSort:o}=m.useContext(Gn),l=a[e??""],f=l==null?void 0:l.direction;return c.jsx(z,{variant:"caption",as:"th",className:N.twJoin("bbn-cell-left",n&&"bbn-table-sortable",t),onClick:()=>{if(n&&e){const u=s.find(d=>d.key===e);o==null||o(e,u==null?void 0:u.sorter)}},"data-column":e,...i,children:c.jsxs("div",{className:"flex items-center justify-between gap-1",children:[c.jsx("span",{children:r}),n&&c.jsxs("span",{className:"bbn-table-sort-icons",children:[c.jsx(Xi,{className:N.twJoin("bbn-sort-icon bbn-sort-icon-up",f==="asc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")}),c.jsx(zi,{className:N.twJoin("bbn-sort-icon bbn-sort-icon-down",f==="desc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")})]})]})})}function Qn(e,t){const[r,n]=m.useState({}),i=m.useCallback((a,o)=>{o&&n(l=>{var p;const f=((p=l[a])==null?void 0:p.direction)??null,u=f===null?"asc":f==="asc"?"desc":null;if(u===null)return Object.fromEntries(Object.entries(l).filter(([g])=>g!==a).map(([g,C])=>[g,{...C,priority:C.priority>l[a].priority?C.priority-1:C.priority}]));const d=Math.max(0,...Object.values(l).map(g=>g.priority));return{...l,[a]:{direction:u,priority:d+1}}})},[]),s=m.useMemo(()=>{const a=Object.entries(r).filter(([,o])=>o.direction!==null).toSorted((o,l)=>l[1].priority-o[1].priority).map(([o,l])=>({column:t.find(f=>f.key===o),direction:l.direction})).filter(({column:o})=>o==null?void 0:o.sorter);return a.length===0?e:e.toSorted((o,l)=>{for(const{column:f,direction:u}of a){const d=f.sorter(o,l);if(d!==0)return u==="asc"?d:-d}return 0})},[e,t,r]);return{sortStates:r,handleColumnSort:i,sortedData:s}}function ei({className:e,render:t,value:r,columnName:n,...i}){return c.jsx(z,{variant:"body2",as:"td",className:N.twJoin("bbn-cell-left",e),"data-column":n,...i,children:t?t(r):r})}function Po({row:e,columns:t,isSelected:r,isSelectable:n,onSelect:i}){return c.jsx("tr",{className:N.twJoin(r&&"selected",!!i&&n&&"cursor-pointer",!n&&"opacity-50"),onClick:()=>i(e),children:t.map(s=>c.jsx(ei,{value:e[s.key],columnName:s.key,className:s.cellClassName,render:s.render?a=>s.render(a,e):void 0},s.key))})}function Bo({data:e,columns:t,className:r,wrapperClassName:n,hasMore:i=!1,loading:s=!1,onLoadMore:a,onRowSelect:o,isRowSelectable:l,selectedRow:f,defaultSelectedRow:u,onSelectedRowChange:d,...p},g){const C=m.useRef(null);m.useImperativeHandle(g,()=>C.current,[]);const{sortStates:y,handleColumnSort:x,sortedData:D}=Qn(e,t),{isScrolledTop:w}=Yn(C,{onLoadMore:a,hasMore:i,loading:s}),[M,S]=ze({value:f,defaultValue:u??null,onStateChange:d}),A=m.useCallback(O=>{if(!o||l&&!l(O))return;const I=M===O.id?null:O.id;S(I),o(I===null?null:O)},[o,l,M,S]),V=m.useMemo(()=>({data:D,columns:t,sortStates:y,onColumnSort:x,onRowSelect:A}),[D,t,y,x,A]);return c.jsx(Gn.Provider,{value:V,children:c.jsx("div",{ref:C,className:N.twJoin("bbn-table-wrapper",n),children:c.jsxs("table",{className:N.twJoin("bbn-table",r),...p,children:[c.jsx("thead",{className:N.twJoin("bbn-table-header",w&&"scrolled-top"),children:c.jsx("tr",{children:t.map(O=>c.jsx(Kn,{className:O.headerClassName,name:O.key,sorter:O.sorter,children:O.header},O.key))})}),c.jsx("tbody",{className:"bbn-table-body",children:D.map(O=>c.jsx(Po,{row:O,columns:t,isSelected:M===O.id,isSelectable:l?l(O):!0,onSelect:A},O.id))})]})})})}const Io=m.forwardRef(Bo);function ti({as:e="div",className:t,children:r}){return m.createElement(e,{className:N.twJoin("bbn-card",t)},r)}function $o(e){const[t=!1,r]=ze({value:e.value,defaultValue:e.defaultValue,onStateChange:e.onChange});return c.jsxs("div",{className:"bbn-toggle",onClick:()=>void r(!t),children:[c.jsx("span",{className:"bbn-toggle-bg",children:e.activeIcon}),c.jsx("span",{className:N.twJoin("bbn-toggle-control",t&&"bbn-toggle-control-active")}),c.jsx("span",{className:"bbn-toggle-bg",children:e.inactiveIcon})]})}const Ho={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Uo({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:N.twMerge("bbn-list",`bbn-list-${t}`,e),children:m.Children.map(r,n=>m.isValidElement(n)?m.cloneElement(n,{orientation:Ho[t]}):n)})}function Wo({className:e,orientation:t="horizontal",title:r,value:n,suffix:i}){return c.jsxs("div",{className:N.twJoin("bbn-list-item",`bbn-list-item-${t}`,e),children:[c.jsx(z,{as:"div",className:N.twJoin("bbn-list-title",`bbn-list-title-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(z,{as:"div",className:N.twJoin("bbn-list-value",`bbn-list-value-${t}`),variant:"body1",children:[n,i]})]})}function Jo({children:e,count:t=0,max:r=99,position:n="bottom-right",color:i="error",className:s,badgeClassName:a,contentClassName:o}){const l=typeof t=="number"?t>0:t!=null,f=typeof t=="number"&&t>r?`${r}+`:t,u=`bbn-badge-${n}`,d=`bbn-badge-${i}`;return c.jsxs("div",{className:N.twJoin("bbn-badge",s),children:[e,l&&c.jsx("span",{className:N.twJoin("bbn-badge-indicator",u,d,a),children:c.jsx("span",{className:N.twJoin("bbn-badge-content",o),children:f})})]})}const Kt=({children:e,style:t,className:r})=>c.jsx("div",{className:N.twJoin("flex rounded bg-secondary-highlight p-4 text-accent-primary",r),style:t,children:e});function qo(e){return yt({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 ri({counter:e,max:t,onAdd:r,alwaysShowCounter:n=!1}){const i=e<t,s=0<e||n&&e===0;return c.jsxs("div",{className:N.twJoin("bg-primary-highlight flex overflow-hidden rounded-md border border-accent-primary w-fit",i&&"cursor-pointer",!s&&!i&&"hidden",!s&&"w-10"),onClick:i?r:void 0,children:[i&&c.jsx("div",{className:"flex h-10 w-10 items-center justify-center",children:c.jsx(qo,{size:20})}),s&&c.jsxs("div",{className:N.twJoin("flex h-10 items-center px-2 text-sm sm:px-4 sm:text-base",i&&"border-l border-accent-primary"),children:[e,"/",t]})]})}const ni=m.createContext(void 0),Or=()=>{const e=m.useContext(ni);return!e&&process.env.NODE_ENV==="development"&&console.warn("useMenuContext must be used within a Menu component"),e},zo=({children:e,value:t})=>c.jsx(ni.Provider,{value:t,children:e});function ii(e={}){const{copiedText:t="Copied ✓",timeout:r=2e3}=e,[n,i]=m.useState({}),[s,a]=m.useState({}),o=m.useCallback((d,p)=>{!d||!p||(navigator.clipboard.writeText(p),i(g=>({...g,[d]:!0})),a(g=>({...g,[d]:t})))},[t]),l=m.useCallback(d=>{d&&(i(p=>({...p,[d]:!1})),a(p=>({...p,[d]:""})))},[]),f=m.useCallback(d=>d&&n[d]||!1,[n]),u=m.useCallback(d=>d&&s[d]||"",[s]);return m.useEffect(()=>{const d={};return Object.entries(n).forEach(([p,g])=>{g&&(d[p]=setTimeout(()=>{l(p)},r))}),()=>{Object.values(d).forEach(p=>clearTimeout(p))}},[n,r,l]),{isCopied:f,copiedText:u,copyToClipboard:o}}function Qt(e=768,t=100){const[r,n]=m.useState(()=>typeof window<"u"?window.innerWidth<e:!1),i=m.useRef(),s=m.useCallback(()=>{n(window.innerWidth<e)},[e]);return m.useEffect(()=>(i.current=Xn(s,t),s(),window.addEventListener("resize",i.current),()=>{i.current&&(window.removeEventListener("resize",i.current),i.current.cancel())}),[s,t]),r}const kr=({isOpen:e,onClose:t,title:r,children:n,className:i="",titleAlign:s="left",backIcon:a,fullHeight:o=!1,fullWidth:l=!1,showBackButton:f=!0,showDivider:u=!0,onBackdropClick:d})=>{const p=Qt(),g={left:"text-left",center:"text-center",right:"text-right"},C=c.jsxs(c.Fragment,{children:[o&&e&&d&&c.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",onClick:d}),c.jsxs("div",{className:N.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]",o?N.twJoin("fixed inset-y-0 right-0 z-50",l?"w-full":"w-full max-w-sm"):"absolute inset-0 rounded-lg",e?"translate-x-0":"translate-x-full",i),children:[(f||r)&&c.jsxs("div",{className:N.twJoin("flex items-center p-4",u&&"border-b border-[#38708533] dark:border-[#404040]"),children:[f&&c.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||c.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:c.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),r&&c.jsx("h3",{className:N.twJoin("flex-1 text-sm font-medium text-accent-primary",f?"ml-3":"",g[s]),children:r})]}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:n})]})]});return p?c.jsx(jt,{mounted:!0,rootClassName:"portal-root-menu-drawer",children:C}):C},Zo=({children:e,trigger:t,open:r,onOpenChange:n,placement:i="bottom-end",offset:s=[0,8],className:a,mobileMode:o="auto"})=>{const[l,f]=m.useState(!1),u=m.useRef(null),d=Qt(),p=r!==void 0?r:l,g=D=>{r===void 0&&f(D),n==null||n(D)},C=()=>g(!1),y=c.jsx("div",{className:"relative w-full overflow-hidden",children:e}),x=t||c.jsx("button",{className:"rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-800",onClick:()=>g(!p),children:"Menu"});return c.jsxs(zo,{value:{isOpen:p,setIsOpen:g,onClose:C,isMobile:d},children:[c.jsx("div",{ref:u,className:"inline-block",children:m.isValidElement(x)&&m.cloneElement(x,{onClick:()=>g(!p),"aria-haspopup":"true","aria-expanded":p})}),d?o==="dialog"?c.jsx(Nr,{open:p,onClose:C,className:N.twJoin("bg-[#FFFFFF] dark:bg-[#252525] text-primary-main",a),children:y}):c.jsx(kr,{isOpen:p,onClose:C,onBackdropClick:C,fullHeight:!0,fullWidth:!0,showBackButton:!0,showDivider:!1,children:y}):c.jsx(xr,{anchorEl:u.current,open:p,offset:s,placement:i,onClickOutside:C,className:N.twJoin("rounded-lg border border-[#38708533] bg-[#FFFFFF] shadow-lg dark:border-[#404040] dark:bg-[#252525]","min-w-[294px]",a),children:y})]})},Xo=({icon:e,name:t,description:r,onClick:n,disabled:i=!1,className:s,children:a,suffix:o,selected:l=!1,role:f="menuitem"})=>{const u=Or(),d=()=>{i||!n||(n(),u&&!o&&u.onClose())};return a?c.jsx("button",{onClick:d,disabled:i,className:N.twJoin("w-full text-left",i&&"cursor-not-allowed opacity-50",s),children:a}):c.jsxs("button",{onClick:d,disabled:i,className:N.twJoin("flex w-full items-center justify-between p-6","transition-colors hover:bg-accent-secondary/5","text-left","focus:outline-none",l&&"bg-accent-secondary/10",i&&"cursor-not-allowed opacity-50",s),role:f,"aria-selected":l,tabIndex:i?-1:0,children:[c.jsxs("div",{className:"flex items-center gap-3",children:[e&&c.jsx("div",{className:"flex-shrink-0",children:e}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("div",{className:"text-sm font-medium text-accent-primary",children:t}),r&&c.jsx("div",{className:"text-xs text-accent-secondary",children:r})]})]}),o]})},Yo=({children:e,name:t,description:r,icon:n,backIcon:i,suffix:s,className:a,contentClassName:o,titleAlign:l="left"})=>{const[f,u]=m.useState(!1),d=Or(),p=c.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:c.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),g=c.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:c.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return c.jsxs(c.Fragment,{children:[c.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:[c.jsxs("div",{className:"flex items-center gap-3",children:[n&&c.jsx("div",{className:"flex-shrink-0",children:n}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-sm font-medium text-accent-primary",children:t}),r&&c.jsx("span",{className:"mt-0.5 text-xs text-accent-secondary",children:r})]})]}),s||g]}),c.jsx(kr,{isOpen:f,onClose:()=>u(!1),title:t||"",titleAlign:l,backIcon:i||p,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})]})},Go=({label:e,description:t,onClick:r,selected:n=!1,className:i,suffix:s,disabled:a=!1})=>{const o=c.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M16.6667 5L7.5 14.1667L3.33333 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return c.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",i),"aria-selected":n,tabIndex:a?-1:0,children:[c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("span",{className:"font-medium text-accent-primary",children:e}),t&&c.jsx("span",{className:"text-sm text-accent-secondary",children:t})]}),n&&(s||o)]})};function Ko(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 Qo=({value:e,symbols:t=8,size:r="body2",className:n})=>e?c.jsx(z,{variant:r,className:N.twJoin("text-accent-primary",n),children:c.jsx("span",{children:Ko(e,t)??e})}):null,ea=({children:e,value:t,className:r,onCopy:n,isCopied:i,copiedText:s,timeout:a=2e3})=>{const o=m.useId(),l={copiedText:s,timeout:a},{isCopied:f,copiedText:u,copyToClipboard:d}=ii(l),p=i!==void 0,g=p?i:f(o),C=p?s||"Copied ✓":u(o),y=x=>{x.stopPropagation(),p&&n?n(t):d(o,t)};return c.jsx("div",{className:N.twMerge("inline-flex items-center cursor-pointer hover:opacity-100 transition-opacity duration-200",r),onClick:y,children:c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:N.twMerge("transition-opacity duration-300 ease-in-out",g&&"opacity-0"),children:e}),g&&c.jsx("div",{className:N.twMerge("absolute inset-0 flex items-center transition-opacity duration-300 ease-in-out text-green-600","opacity-100"),children:C})]})})};var Nt=e=>e.type==="checkbox",We=e=>e instanceof Date,se=e=>e==null;const si=e=>typeof e=="object";var ee=e=>!se(e)&&!Array.isArray(e)&&si(e)&&!We(e),oi=e=>ee(e)&&e.target?Nt(e.target)?e.target.checked:e.target.value:e,ta=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ai=(e,t)=>e.has(ta(t)),ra=e=>{const t=e.constructor&&e.constructor.prototype;return ee(t)&&t.hasOwnProperty("isPrototypeOf")},Er=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ne(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(!(Er&&(e instanceof Blob||n))&&(r||ee(e)))if(t=r?[]:{},!r&&!ra(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=ne(e[i]));else return e;return t}var er=e=>/^\w*$/.test(e),Q=e=>e===void 0,Sr=e=>Array.isArray(e)?e.filter(Boolean):[],Fr=e=>Sr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),E=(e,t,r)=>{if(!t||!ee(e))return r;const n=(er(t)?[t]:Fr(t)).reduce((i,s)=>se(i)?i:i[s],e);return Q(n)||n===e?Q(e[t])?r:e[t]:n},ue=e=>typeof e=="boolean",J=(e,t,r)=>{let n=-1;const i=er(t)?[t]:Fr(t),s=i.length,a=s-1;for(;++n<s;){const o=i[n];let l=r;if(n!==a){const f=e[o];l=ee(f)||Array.isArray(f)?f:isNaN(+i[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;e[o]=l,e=e[o]}};const Ut={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ye={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Fe={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ar=m.createContext(null);Ar.displayName="HookFormContext";const Ge=()=>m.useContext(Ar),na=e=>{const{children:t,...r}=e;return m.createElement(Ar.Provider,{value:r},t)};var li=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const a=s;return t._proxyFormState[a]!==ye.all&&(t._proxyFormState[a]=!n||ye.all),r&&(r[a]=!0),e[a]}});return i};const Vr=typeof window<"u"?Ae.useLayoutEffect:Ae.useEffect;function Lr(e){const t=Ge(),{control:r=t.control,disabled:n,name:i,exact:s}=e||{},[a,o]=m.useState(r._formState),l=m.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Vr(()=>r._subscribe({name:i,formState:l.current,exact:s,callback:f=>{!n&&o({...r._formState,...f})}}),[i,n,s]),m.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),m.useMemo(()=>li(a,r,l.current,!1),[a,r])}var Ce=e=>typeof e=="string",ci=(e,t,r,n,i)=>Ce(e)?(n&&t.watch.add(e),E(r,e,i)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),E(r,s))):(n&&(t.watchAll=!0),r);function Dr(e){const t=Ge(),{control:r=t.control,name:n,defaultValue:i,disabled:s,exact:a}=e||{},o=m.useRef(i),[l,f]=m.useState(r._getWatch(n,o.current));return Vr(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:u=>!s&&f(ci(n,r._names,u.values||r._formValues,!1,o.current))}),[n,r,s,a]),m.useEffect(()=>r._removeUnmounted()),l}function ia(e){const t=Ge(),{name:r,disabled:n,control:i=t.control,shouldUnregister:s}=e,a=ai(i._names.array,r),o=Dr({control:i,name:r,defaultValue:E(i._formValues,r,E(i._defaultValues,r,e.defaultValue)),exact:!0}),l=Lr({control:i,name:r,exact:!0}),f=m.useRef(e),u=m.useRef(i.register(r,{...e.rules,value:o,...ue(e.disabled)?{disabled:e.disabled}:{}})),d=m.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!E(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!E(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!E(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!E(l.validatingFields,r)},error:{enumerable:!0,get:()=>E(l.errors,r)}}),[l,r]),p=m.useCallback(x=>u.current.onChange({target:{value:oi(x),name:r},type:Ut.CHANGE}),[r]),g=m.useCallback(()=>u.current.onBlur({target:{value:E(i._formValues,r),name:r},type:Ut.BLUR}),[r,i._formValues]),C=m.useCallback(x=>{const D=E(i._fields,r);D&&x&&(D._f.ref={focus:()=>x.focus&&x.focus(),select:()=>x.select&&x.select(),setCustomValidity:w=>x.setCustomValidity(w),reportValidity:()=>x.reportValidity()})},[i._fields,r]),y=m.useMemo(()=>({name:r,value:o,...ue(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:p,onBlur:g,ref:C}),[r,n,l.disabled,p,g,C,o]);return m.useEffect(()=>{const x=i._options.shouldUnregister||s;i.register(r,{...f.current.rules,...ue(f.current.disabled)?{disabled:f.current.disabled}:{}});const D=(w,M)=>{const S=E(i._fields,w);S&&S._f&&(S._f.mount=M)};if(D(r,!0),x){const w=ne(E(i._options.defaultValues,r));J(i._defaultValues,r,w),Q(E(i._formValues,r))&&J(i._formValues,r,w)}return!a&&i.register(r),()=>{(a?x&&!i._state.action:x)?i.unregister(r):D(r,!1)}},[r,i,a,s]),m.useEffect(()=>{i._setDisabledField({disabled:n,name:r})},[n,r,i]),m.useMemo(()=>({field:y,formState:l,fieldState:d}),[y,l,d])}var ui=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},pt=e=>Array.isArray(e)?e:[e],sn=()=>{let e=[];return{get observers(){return e},next:i=>{for(const s of e)s.next&&s.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(s=>s!==i)}}),unsubscribe:()=>{e=[]}}},cr=e=>se(e)||!si(e);function Re(e,t,r=new WeakSet){if(cr(e)||cr(t))return e===t;if(We(e)&&We(t))return e.getTime()===t.getTime();const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const s of n){const a=e[s];if(!i.includes(s))return!1;if(s!=="ref"){const o=t[s];if(We(a)&&We(o)||ee(a)&&ee(o)||Array.isArray(a)&&Array.isArray(o)?!Re(a,o,r):a!==o)return!1}}return!0}var ae=e=>ee(e)&&!Object.keys(e).length,_r=e=>e.type==="file",xe=e=>typeof e=="function",Wt=e=>{if(!Er)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},fi=e=>e.type==="select-multiple",Mr=e=>e.type==="radio",sa=e=>Mr(e)||Nt(e),sr=e=>Wt(e)&&e.isConnected;function oa(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Q(e)?n++:e[t[n++]];return e}function aa(e){for(const t in e)if(e.hasOwnProperty(t)&&!Q(e[t]))return!1;return!0}function te(e,t){const r=Array.isArray(t)?t:er(t)?[t]:Fr(t),n=r.length===1?e:oa(e,r),i=r.length-1,s=r[i];return n&&delete n[s],i!==0&&(ee(n)&&ae(n)||Array.isArray(n)&&aa(n))&&te(e,r.slice(0,-1)),e}var di=e=>{for(const t in e)if(xe(e[t]))return!0;return!1};function Jt(e,t={}){const r=Array.isArray(e);if(ee(e)||r)for(const n in e)Array.isArray(e[n])||ee(e[n])&&!di(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Jt(e[n],t[n])):se(e[n])||(t[n]=!0);return t}function hi(e,t,r){const n=Array.isArray(e);if(ee(e)||n)for(const i in e)Array.isArray(e[i])||ee(e[i])&&!di(e[i])?Q(t)||cr(r[i])?r[i]=Array.isArray(e[i])?Jt(e[i],[]):{...Jt(e[i])}:hi(e[i],se(t)?{}:t[i],r[i]):r[i]=!Re(e[i],t[i]);return r}var ut=(e,t)=>hi(e,t,Jt(t));const on={value:!1,isValid:!1},an={value:!0,isValid:!0};var pi=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&&!Q(e[0].attributes.value)?Q(e[0].value)||e[0].value===""?an:{value:e[0].value,isValid:!0}:an:on}return on},vi=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Q(e)?e:t?e===""?NaN:e&&+e:r&&Ce(e)?new Date(e):n?n(e):e;const ln={isValid:!1,value:null};var mi=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,ln):ln;function cn(e){const t=e.ref;return _r(t)?t.files:Mr(t)?mi(e.refs).value:fi(t)?[...t.selectedOptions].map(({value:r})=>r):Nt(t)?pi(e.refs).value:vi(Q(t.value)?e.ref.value:t.value,e)}var la=(e,t,r,n)=>{const i={};for(const s of e){const a=E(t,s);a&&J(i,s,a._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},qt=e=>e instanceof RegExp,ft=e=>Q(e)?e:qt(e)?e.source:ee(e)?qt(e.value)?e.value.source:e.value:e,un=e=>({isOnSubmit:!e||e===ye.onSubmit,isOnBlur:e===ye.onBlur,isOnChange:e===ye.onChange,isOnAll:e===ye.all,isOnTouch:e===ye.onTouched});const fn="AsyncFunction";var ca=e=>!!e&&!!e.validate&&!!(xe(e.validate)&&e.validate.constructor.name===fn||ee(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===fn)),ua=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),dn=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const vt=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const s=E(e,i);if(s){const{_f:a,...o}=s;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(vt(o,t))break}else if(ee(o)&&vt(o,t))break}}};function hn(e,t,r){const n=E(e,r);if(n||er(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const s=i.join("."),a=E(t,s),o=E(e,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(o&&o.type)return{name:s,error:o};if(o&&o.root&&o.root.type)return{name:`${s}.root`,error:o.root};i.pop()}return{name:r}}var fa=(e,t,r,n)=>{r(e);const{name:i,...s}=e;return ae(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(a=>t[a]===(!n||ye.all))},da=(e,t,r)=>!e||!t||e===t||pt(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),ha=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,pa=(e,t)=>!Sr(E(e,t)).length&&te(e,t),va=(e,t,r)=>{const n=pt(E(e,r));return J(n,"root",t[r]),J(e,r,n),e},Rt=e=>Ce(e);function pn(e,t,r="validate"){if(Rt(e)||Array.isArray(e)&&e.every(Rt)||ue(e)&&!e)return{type:r,message:Rt(e)?e:"",ref:t}}var et=e=>ee(e)&&!qt(e)?e:{value:e,message:""},vn=async(e,t,r,n,i,s)=>{const{ref:a,refs:o,required:l,maxLength:f,minLength:u,min:d,max:p,pattern:g,validate:C,name:y,valueAsNumber:x,mount:D}=e._f,w=E(r,y);if(!D||t.has(y))return{};const M=o?o[0]:a,S=L=>{i&&M.reportValidity&&(M.setCustomValidity(ue(L)?"":L||""),M.reportValidity())},A={},V=Mr(a),O=Nt(a),I=V||O,B=(x||_r(a))&&Q(a.value)&&Q(w)||Wt(a)&&a.value===""||w===""||Array.isArray(w)&&!w.length,$=ui.bind(null,y,n,A),R=(L,P,U,G=Fe.maxLength,q=Fe.minLength)=>{const K=L?P:U;A[y]={type:L?G:q,message:K,ref:a,...$(L?G:q,K)}};if(s?!Array.isArray(w)||!w.length:l&&(!I&&(B||se(w))||ue(w)&&!w||O&&!pi(o).isValid||V&&!mi(o).isValid)){const{value:L,message:P}=Rt(l)?{value:!!l,message:l}:et(l);if(L&&(A[y]={type:Fe.required,message:P,ref:M,...$(Fe.required,P)},!n))return S(P),A}if(!B&&(!se(d)||!se(p))){let L,P;const U=et(p),G=et(d);if(!se(w)&&!isNaN(w)){const q=a.valueAsNumber||w&&+w;se(U.value)||(L=q>U.value),se(G.value)||(P=q<G.value)}else{const q=a.valueAsDate||new Date(w),K=Se=>new Date(new Date().toDateString()+" "+Se),we=a.type=="time",oe=a.type=="week";Ce(U.value)&&w&&(L=we?K(w)>K(U.value):oe?w>U.value:q>new Date(U.value)),Ce(G.value)&&w&&(P=we?K(w)<K(G.value):oe?w<G.value:q<new Date(G.value))}if((L||P)&&(R(!!L,U.message,G.message,Fe.max,Fe.min),!n))return S(A[y].message),A}if((f||u)&&!B&&(Ce(w)||s&&Array.isArray(w))){const L=et(f),P=et(u),U=!se(L.value)&&w.length>+L.value,G=!se(P.value)&&w.length<+P.value;if((U||G)&&(R(U,L.message,P.message),!n))return S(A[y].message),A}if(g&&!B&&Ce(w)){const{value:L,message:P}=et(g);if(qt(L)&&!w.match(L)&&(A[y]={type:Fe.pattern,message:P,ref:a,...$(Fe.pattern,P)},!n))return S(P),A}if(C){if(xe(C)){const L=await C(w,r),P=pn(L,M);if(P&&(A[y]={...P,...$(Fe.validate,P.message)},!n))return S(P.message),A}else if(ee(C)){let L={};for(const P in C){if(!ae(L)&&!n)break;const U=pn(await C[P](w,r),M,P);U&&(L={...U,...$(P,U.message)},S(U.message),n&&(A[y]=L))}if(!ae(L)&&(A[y]={ref:M,...L},!n))return A}}return S(!0),A};const ma={mode:ye.onSubmit,reValidateMode:ye.onChange,shouldFocusError:!0};function ga(e={}){let t={...ma,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:xe(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=ee(t.defaultValues)||ee(t.values)?ne(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:ne(i),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,f=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const p={array:sn(),state:sn()},g=t.criteriaMode===ye.all,C=h=>v=>{clearTimeout(f),f=setTimeout(h,v)},y=async h=>{if(!t.disabled&&(u.isValid||d.isValid||h)){const v=t.resolver?ae((await O()).errors):await B(n,!0);v!==r.isValid&&p.state.next({isValid:v})}},x=(h,v)=>{!t.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((h||Array.from(o.mount)).forEach(b=>{b&&(v?J(r.validatingFields,b,v):te(r.validatingFields,b))}),p.state.next({validatingFields:r.validatingFields,isValidating:!ae(r.validatingFields)}))},D=(h,v=[],b,F,k=!0,j=!0)=>{if(F&&b&&!t.disabled){if(a.action=!0,j&&Array.isArray(E(n,h))){const T=b(E(n,h),F.argA,F.argB);k&&J(n,h,T)}if(j&&Array.isArray(E(r.errors,h))){const T=b(E(r.errors,h),F.argA,F.argB);k&&J(r.errors,h,T),pa(r.errors,h)}if((u.touchedFields||d.touchedFields)&&j&&Array.isArray(E(r.touchedFields,h))){const T=b(E(r.touchedFields,h),F.argA,F.argB);k&&J(r.touchedFields,h,T)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=ut(i,s)),p.state.next({name:h,isDirty:R(h,v),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else J(s,h,v)},w=(h,v)=>{J(r.errors,h,v),p.state.next({errors:r.errors})},M=h=>{r.errors=h,p.state.next({errors:r.errors,isValid:!1})},S=(h,v,b,F)=>{const k=E(n,h);if(k){const j=E(s,h,Q(b)?E(i,h):b);Q(j)||F&&F.defaultChecked||v?J(s,h,v?j:cn(k._f)):U(h,j),a.mount&&y()}},A=(h,v,b,F,k)=>{let j=!1,T=!1;const H={name:h};if(!t.disabled){if(!b||F){(u.isDirty||d.isDirty)&&(T=r.isDirty,r.isDirty=H.isDirty=R(),j=T!==H.isDirty);const W=Re(E(i,h),v);T=!!E(r.dirtyFields,h),W?te(r.dirtyFields,h):J(r.dirtyFields,h,!0),H.dirtyFields=r.dirtyFields,j=j||(u.dirtyFields||d.dirtyFields)&&T!==!W}if(b){const W=E(r.touchedFields,h);W||(J(r.touchedFields,h,b),H.touchedFields=r.touchedFields,j=j||(u.touchedFields||d.touchedFields)&&W!==b)}j&&k&&p.state.next(H)}return j?H:{}},V=(h,v,b,F)=>{const k=E(r.errors,h),j=(u.isValid||d.isValid)&&ue(v)&&r.isValid!==v;if(t.delayError&&b?(l=C(()=>w(h,b)),l(t.delayError)):(clearTimeout(f),l=null,b?J(r.errors,h,b):te(r.errors,h)),(b?!Re(k,b):k)||!ae(F)||j){const T={...F,...j&&ue(v)?{isValid:v}:{},errors:r.errors,name:h};r={...r,...T},p.state.next(T)}},O=async h=>{x(h,!0);const v=await t.resolver(s,t.context,la(h||o.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return x(h),v},I=async h=>{const{errors:v}=await O(h);if(h)for(const b of h){const F=E(v,b);F?J(r.errors,b,F):te(r.errors,b)}else r.errors=v;return v},B=async(h,v,b={valid:!0})=>{for(const F in h){const k=h[F];if(k){const{_f:j,...T}=k;if(j){const H=o.array.has(j.name),W=k._f&&ca(k._f);W&&u.validatingFields&&x([F],!0);const he=await vn(k,o.disabled,s,g,t.shouldUseNativeValidation&&!v,H);if(W&&u.validatingFields&&x([F]),he[j.name]&&(b.valid=!1,v))break;!v&&(E(he,j.name)?H?va(r.errors,he,j.name):J(r.errors,j.name,he[j.name]):te(r.errors,j.name))}!ae(T)&&await B(T,v,b)}}return b.valid},$=()=>{for(const h of o.unMount){const v=E(n,h);v&&(v._f.refs?v._f.refs.every(b=>!sr(b)):!sr(v._f.ref))&&_e(h)}o.unMount=new Set},R=(h,v)=>!t.disabled&&(h&&v&&J(s,h,v),!Re(Se(),i)),L=(h,v,b)=>ci(h,o,{...a.mount?s:Q(v)?i:Ce(h)?{[h]:v}:v},b,v),P=h=>Sr(E(a.mount?s:i,h,t.shouldUnregister?E(i,h,[]):[])),U=(h,v,b={})=>{const F=E(n,h);let k=v;if(F){const j=F._f;j&&(!j.disabled&&J(s,h,vi(v,j)),k=Wt(j.ref)&&se(v)?"":v,fi(j.ref)?[...j.ref.options].forEach(T=>T.selected=k.includes(T.value)):j.refs?Nt(j.ref)?j.refs.forEach(T=>{(!T.defaultChecked||!T.disabled)&&(Array.isArray(k)?T.checked=!!k.find(H=>H===T.value):T.checked=k===T.value||!!k)}):j.refs.forEach(T=>T.checked=T.value===k):_r(j.ref)?j.ref.value="":(j.ref.value=k,j.ref.type||p.state.next({name:h,values:ne(s)})))}(b.shouldDirty||b.shouldTouch)&&A(h,k,b.shouldTouch,b.shouldDirty,!0),b.shouldValidate&&oe(h)},G=(h,v,b)=>{for(const F in v){if(!v.hasOwnProperty(F))return;const k=v[F],j=h+"."+F,T=E(n,j);(o.array.has(h)||ee(k)||T&&!T._f)&&!We(k)?G(j,k,b):U(j,k,b)}},q=(h,v,b={})=>{const F=E(n,h),k=o.array.has(h),j=ne(v);J(s,h,j),k?(p.array.next({name:h,values:ne(s)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&b.shouldDirty&&p.state.next({name:h,dirtyFields:ut(i,s),isDirty:R(h,j)})):F&&!F._f&&!se(j)?G(h,j,b):U(h,j,b),dn(h,o)&&p.state.next({...r}),p.state.next({name:a.mount?h:void 0,values:ne(s)})},K=async h=>{a.mount=!0;const v=h.target;let b=v.name,F=!0;const k=E(n,b),j=W=>{F=Number.isNaN(W)||We(W)&&isNaN(W.getTime())||Re(W,E(s,b,W))},T=un(t.mode),H=un(t.reValidateMode);if(k){let W,he;const Lt=v.type?cn(k._f):oi(h),Me=h.type===Ut.BLUR||h.type===Ut.FOCUS_OUT,Fi=!ua(k._f)&&!t.resolver&&!E(r.errors,b)&&!k._f.deps||ha(Me,E(r.touchedFields,b),r.isSubmitted,H,T),rr=dn(b,o,Me);J(s,b,Lt),Me?(k._f.onBlur&&k._f.onBlur(h),l&&l(0)):k._f.onChange&&k._f.onChange(h);const nr=A(b,Lt,Me),Ai=!ae(nr)||rr;if(!Me&&p.state.next({name:b,type:h.type,values:ne(s)}),Fi)return(u.isValid||d.isValid)&&(t.mode==="onBlur"?Me&&y():Me||y()),Ai&&p.state.next({name:b,...rr?{}:nr});if(!Me&&rr&&p.state.next({...r}),t.resolver){const{errors:$r}=await O([b]);if(j(Lt),F){const Vi=hn(r.errors,n,b),Hr=hn($r,n,Vi.name||b);W=Hr.error,b=Hr.name,he=ae($r)}}else x([b],!0),W=(await vn(k,o.disabled,s,g,t.shouldUseNativeValidation))[b],x([b]),j(Lt),F&&(W?he=!1:(u.isValid||d.isValid)&&(he=await B(n,!0)));F&&(k._f.deps&&oe(k._f.deps),V(b,he,W,nr))}},we=(h,v)=>{if(E(r.errors,v)&&h.focus)return h.focus(),1},oe=async(h,v={})=>{let b,F;const k=pt(h);if(t.resolver){const j=await I(Q(h)?h:k);b=ae(j),F=h?!k.some(T=>E(j,T)):b}else h?(F=(await Promise.all(k.map(async j=>{const T=E(n,j);return await B(T&&T._f?{[j]:T}:T)}))).every(Boolean),!(!F&&!r.isValid)&&y()):F=b=await B(n);return p.state.next({...!Ce(h)||(u.isValid||d.isValid)&&b!==r.isValid?{}:{name:h},...t.resolver||!h?{isValid:b}:{},errors:r.errors}),v.shouldFocus&&!F&&vt(n,we,h?k:o.mount),F},Se=h=>{const v={...a.mount?s:i};return Q(h)?v:Ce(h)?E(v,h):h.map(b=>E(v,b))},Qe=(h,v)=>({invalid:!!E((v||r).errors,h),isDirty:!!E((v||r).dirtyFields,h),error:E((v||r).errors,h),isValidating:!!E(r.validatingFields,h),isTouched:!!E((v||r).touchedFields,h)}),Be=h=>{h&&pt(h).forEach(v=>te(r.errors,v)),p.state.next({errors:h?r.errors:{}})},Ie=(h,v,b)=>{const F=(E(n,h,{_f:{}})._f||{}).ref,k=E(r.errors,h)||{},{ref:j,message:T,type:H,...W}=k;J(r.errors,h,{...W,...v,ref:F}),p.state.next({name:h,errors:r.errors,isValid:!1}),b&&b.shouldFocus&&F&&F.focus&&F.focus()},De=(h,v)=>xe(h)?p.state.subscribe({next:b=>h(L(void 0,v),b)}):L(h,v,!0),be=h=>p.state.subscribe({next:v=>{da(h.name,v.name,h.exact)&&fa(v,h.formState||u,At,h.reRenderRoot)&&h.callback({values:{...s},...r,...v})}}).unsubscribe,$e=h=>(a.mount=!0,d={...d,...h.formState},be({...h,formState:d})),_e=(h,v={})=>{for(const b of h?pt(h):o.mount)o.mount.delete(b),o.array.delete(b),v.keepValue||(te(n,b),te(s,b)),!v.keepError&&te(r.errors,b),!v.keepDirty&&te(r.dirtyFields,b),!v.keepTouched&&te(r.touchedFields,b),!v.keepIsValidating&&te(r.validatingFields,b),!t.shouldUnregister&&!v.keepDefaultValue&&te(i,b);p.state.next({values:ne(s)}),p.state.next({...r,...v.keepDirty?{isDirty:R()}:{}}),!v.keepIsValid&&y()},je=({disabled:h,name:v})=>{(ue(h)&&a.mount||h||o.disabled.has(v))&&(h?o.disabled.add(v):o.disabled.delete(v))},He=(h,v={})=>{let b=E(n,h);const F=ue(v.disabled)||ue(t.disabled);return J(n,h,{...b||{},_f:{...b&&b._f?b._f:{ref:{name:h}},name:h,mount:!0,...v}}),o.mount.add(h),b?je({disabled:ue(v.disabled)?v.disabled:t.disabled,name:h}):S(h,!0,v.value),{...F?{disabled:v.disabled||t.disabled}:{},...t.progressive?{required:!!v.required,min:ft(v.min),max:ft(v.max),minLength:ft(v.minLength),maxLength:ft(v.maxLength),pattern:ft(v.pattern)}:{},name:h,onChange:K,onBlur:K,ref:k=>{if(k){He(h,v),b=E(n,h);const j=Q(k.value)&&k.querySelectorAll&&k.querySelectorAll("input,select,textarea")[0]||k,T=sa(j),H=b._f.refs||[];if(T?H.find(W=>W===j):j===b._f.ref)return;J(n,h,{_f:{...b._f,...T?{refs:[...H.filter(sr),j,...Array.isArray(E(i,h))?[{}]:[]],ref:{type:j.type,name:h}}:{ref:j}}}),S(h,!1,void 0,j)}else b=E(n,h,{}),b._f&&(b._f.mount=!1),(t.shouldUnregister||v.shouldUnregister)&&!(ai(o.array,h)&&a.action)&&o.unMount.add(h)}}},at=()=>t.shouldFocusError&&vt(n,we,o.mount),lt=h=>{ue(h)&&(p.state.next({disabled:h}),vt(n,(v,b)=>{const F=E(n,b);F&&(v.disabled=F._f.disabled||h,Array.isArray(F._f.refs)&&F._f.refs.forEach(k=>{k.disabled=F._f.disabled||h}))},0,!1))},Ot=(h,v)=>async b=>{let F;b&&(b.preventDefault&&b.preventDefault(),b.persist&&b.persist());let k=ne(s);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:j,values:T}=await O();r.errors=j,k=ne(T)}else await B(n);if(o.disabled.size)for(const j of o.disabled)te(k,j);if(te(r.errors,"root"),ae(r.errors)){p.state.next({errors:{}});try{await h(k,b)}catch(j){F=j}}else v&&await v({...r.errors},b),at(),setTimeout(at);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ae(r.errors)&&!F,submitCount:r.submitCount+1,errors:r.errors}),F)throw F},kt=(h,v={})=>{E(n,h)&&(Q(v.defaultValue)?q(h,ne(E(i,h))):(q(h,v.defaultValue),J(i,h,ne(v.defaultValue))),v.keepTouched||te(r.touchedFields,h),v.keepDirty||(te(r.dirtyFields,h),r.isDirty=v.defaultValue?R(h,ne(E(i,h))):R()),v.keepError||(te(r.errors,h),u.isValid&&y()),p.state.next({...r}))},Et=(h,v={})=>{const b=h?ne(h):i,F=ne(b),k=ae(h),j=k?i:F;if(v.keepDefaultValues||(i=b),!v.keepValues){if(v.keepDirtyValues){const T=new Set([...o.mount,...Object.keys(ut(i,s))]);for(const H of Array.from(T))E(r.dirtyFields,H)?J(j,H,E(s,H)):q(H,E(j,H))}else{if(Er&&Q(h))for(const T of o.mount){const H=E(n,T);if(H&&H._f){const W=Array.isArray(H._f.refs)?H._f.refs[0]:H._f.ref;if(Wt(W)){const he=W.closest("form");if(he){he.reset();break}}}}if(v.keepFieldsRef)for(const T of o.mount)q(T,E(j,T));else n={}}s=t.shouldUnregister?v.keepDefaultValues?ne(i):{}:ne(j),p.array.next({values:{...j}}),p.state.next({values:{...j}})}o={mount:v.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!v.keepIsValid||!!v.keepDirtyValues,a.watch=!!t.shouldUnregister,p.state.next({submitCount:v.keepSubmitCount?r.submitCount:0,isDirty:k?!1:v.keepDirty?r.isDirty:!!(v.keepDefaultValues&&!Re(h,i)),isSubmitted:v.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:k?{}:v.keepDirtyValues?v.keepDefaultValues&&s?ut(i,s):r.dirtyFields:v.keepDefaultValues&&h?ut(i,h):v.keepDirty?r.dirtyFields:{},touchedFields:v.keepTouched?r.touchedFields:{},errors:v.keepErrors?r.errors:{},isSubmitSuccessful:v.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},St=(h,v)=>Et(xe(h)?h(s):h,v),Ft=(h,v={})=>{const b=E(n,h),F=b&&b._f;if(F){const k=F.refs?F.refs[0]:F.ref;k.focus&&(k.focus(),v.shouldSelect&&xe(k.select)&&k.select())}},At=h=>{r={...r,...h}},Vt={control:{register:He,unregister:_e,getFieldState:Qe,handleSubmit:Ot,setError:Ie,_subscribe:be,_runSchema:O,_focusError:at,_getWatch:L,_getDirty:R,_setValid:y,_setFieldArray:D,_setDisabledField:je,_setErrors:M,_getFieldArray:P,_reset:Et,_resetDefaultValues:()=>xe(t.defaultValues)&&t.defaultValues().then(h=>{St(h,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:lt,_subjects:p,_proxyFormState:u,get _fields(){return n},get _formValues(){return s},get _state(){return a},set _state(h){a=h},get _defaultValues(){return i},get _names(){return o},set _names(h){o=h},get _formState(){return r},get _options(){return t},set _options(h){t={...t,...h}}},subscribe:$e,trigger:oe,register:He,handleSubmit:Ot,watch:De,setValue:q,getValues:Se,reset:St,resetField:kt,clearErrors:Be,unregister:_e,setError:Ie,setFocus:Ft,getFieldState:Qe};return{...Vt,formControl:Vt}}function ba(e={}){const t=m.useRef(void 0),r=m.useRef(void 0),[n,i]=m.useState({isDirty:!1,isValidating:!1,isLoading:xe(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:xe(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!xe(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...o}=ga(e);t.current={...o,formState:n}}const s=t.current.control;return s._options=e,Vr(()=>{const a=s._subscribe({formState:s._proxyFormState,callback:()=>i({...s._formState}),reRenderRoot:!0});return i(o=>({...o,isReady:!0})),s._formState.isReady=!0,a},[s]),m.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),m.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),m.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),m.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),m.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==n.isDirty&&s._subjects.state.next({isDirty:a})}},[s,n.isDirty]),m.useEffect(()=>{e.values&&!Re(e.values,r.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),r.current=e.values,i(a=>({...a}))):s._resetDefaultValues()},[s,e.values]),m.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=li(n,s),t.current}const mn=(e,t,r)=>{if(e&&"reportValidity"in e){const n=E(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},gi=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?mn(n.ref,r,e):n.refs&&n.refs.forEach(i=>mn(i,r,e))}},ya=(e,t)=>{t.shouldUseNativeValidation&&gi(e,t);const r={};for(const n in e){const i=E(t.fields,n),s=Object.assign(e[n]||{},{ref:i&&i.ref});if(xa(t.names||Object.keys(e),n)){const a=Object.assign({},E(r,n));J(a,"root",s),J(r,n,a)}else J(r,n,s)}return r},xa=(e,t)=>e.some(r=>r.startsWith(t+"."));function wa(e,t,r){return t===void 0&&(t={}),r===void 0&&(r={}),function(n,i,s){try{return Promise.resolve(function(a,o){try{var l=(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:i}))).then(function(f){return s.shouldUseNativeValidation&&gi({},s),{values:r.raw?n:f,errors:{}}}))}catch(f){return o(f)}return l&&l.then?l.then(void 0,o):l}(0,function(a){if(!a.inner)throw a;return{values:{},errors:ya((o=a,l=!s.shouldUseNativeValidation&&s.criteriaMode==="all",(o.inner||[]).reduce(function(f,u){if(f[u.path]||(f[u.path]={message:u.message,type:u.type}),l){var d=f[u.path].types,p=d&&d[u.type];f[u.path]=ui(u.path,l,f,u.type,p?[].concat(p,u.message):u.message)}return f},{})),s)};var o,l}))}catch(a){return Promise.reject(a)}}}function ja({className:e,name:t,children:r,mode:n="onBlur",reValidateMode:i="onBlur",defaultValues:s,schema:a,formProps:o,onSubmit:l=()=>null,onChange:f}){const u=ba({mode:n,reValidateMode:i,defaultValues:s,resolver:a?wa(a):void 0});return m.useEffect(()=>{if(!f)return;const{unsubscribe:d}=u.watch(f);return d},[f,u.watch]),c.jsx(na,{...u,children:c.jsx("form",{className:N.twJoin("bbn-form",e),name:t,onSubmit:u.handleSubmit(l),...o,children:r})})}function Ke({name:e,defaultValue:t,disabled:r=!1,autoFocus:n=!1,shouldUnregister:i=!1,validateOnMount:s=!0}){const{setFocus:a,trigger:o}=Ge(),{field:l,fieldState:f}=ia({name:e,defaultValue:t,disabled:r,shouldUnregister:i}),{invalid:u,isTouched:d,error:p}=f;return m.useEffect(()=>{s?o(e,{shouldFocus:n}):n&&a(e)},[e,s]),{...l,value:l.value,invalid:u&&d,error:(p==null?void 0:p.message)??""}}function Ca(e){const{getFieldState:t}=Ge(),r=Lr({name:e});return Array.isArray(e)?e.map(i=>t(i,r)):t(e,r)}const Na=/^-?\d*\.?\d*$/;function Oa({name:e,id:t=e,label:r,hint:n,className:i,controlClassName:s,disabled:a,autoFocus:o,defaultValue:l,placeholder:f,type:u,suffix:d,prefix:p,shouldUnregister:g,state:C,validateOnMount:y}){const{ref:x,value:D="",error:w,invalid:M,onChange:S,onBlur:A}=Ke({name:e,defaultValue:l,autoFocus:o,shouldUnregister:g,validateOnMount:y}),V=M?"error":C,O=M?w:n,I=B=>{Na.test(B.target.value)&&S(B.target.value)};return c.jsx(Ct,{label:r,className:s,state:V,hint:O,children:c.jsx(Yt,{inputMode:"decimal",pattern:"^-?\\d*\\.?\\d*$",ref:x,value:D,id:t,name:e,type:u,className:i,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:p,state:V,onChange:I,onBlur:A})})}function ka({name:e,id:t=e,label:r,hint:n,className:i,controlClassName:s,disabled:a,autoFocus:o,defaultValue:l,placeholder:f,type:u,suffix:d,prefix:p,shouldUnregister:g,state:C,validateOnMount:y}){const{ref:x,value:D="",error:w,invalid:M,onChange:S,onBlur:A}=Ke({name:e,defaultValue:l,autoFocus:o,shouldUnregister:g,validateOnMount:y}),V=M?"error":C,O=M?w:n;return c.jsx(Ct,{label:r,className:s,state:V,hint:O,children:c.jsx(Yt,{ref:x,value:D,id:t,name:e,type:u,className:i,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:p,state:V,onChange:S,onBlur:A})})}function Ea({name:e,id:t=e,label:r,className:n,disabled:i,value:s,defaultChecked:a,labelClassName:o,orientation:l}){const{ref:f,value:u=!1,onChange:d,onBlur:p}=Ke({name:e});return c.jsx(Nn,{ref:f,name:e,checked:u,id:t,label:r,className:n,disabled:i,value:s,defaultChecked:a,labelClassName:o,orientation:l,inputProps:{onChange:d,onBlur:p}})}function Sa({name:e,id:t=e,label:r,className:n,disabled:i,value:s,defaultChecked:a,labelClassName:o,orientation:l}){const{ref:f,value:u,onChange:d,onBlur:p}=Ke({name:e,disabled:i,defaultValue:a?s:void 0});return c.jsx(On,{ref:f,name:e,id:t,label:r,className:n,disabled:i,checked:u===s,value:s,labelClassName:o,orientation:l,inputProps:{onChange:d,onBlur:p}})}function Fa({open:e,defaultOpen:t,options:r,optionClassName:n,popoverClassName:i,name:s,id:a=s,label:o,hint:l,className:f,controlClassName:u,disabled:d,autoFocus:p,defaultValue:g,placeholder:C,shouldUnregister:y,state:x,validateOnMount:D,onOpen:w,onClose:M,renderSelectedOption:S}){const{ref:A,value:V="",error:O,invalid:I,onChange:B,onBlur:$}=Ke({name:s,defaultValue:g,autoFocus:p,shouldUnregister:y,validateOnMount:D}),R=I?"error":x,L=I?O:l,P=()=>{$==null||$(),M==null||M()};return c.jsx(Ct,{label:o,className:u,state:R,hint:L,children:c.jsx(wr,{open:e,defaultOpen:t,options:r,ref:A,value:V,id:a,name:s,className:f,disabled:d,placeholder:C,state:R,optionClassName:n,popoverClassName:i,onSelect:B,onBlur:$,onOpen:w,onClose:P,renderSelectedOption:S})})}function bi({displayError:e=!1,...t}){const{error:r,value:n,onChange:i,onBlur:s,disabled:a,name:o,ref:l}=Ke(t),f=c.jsx("input",{ref:l,type:"hidden",name:o,disabled:a,value:n,onChange:i,onBlur:s});if(e){const u=e?"error":"default",d=e?r:"";return c.jsx(Ct,{hint:d,state:u,children:f})}return f}const Aa={lg:{logo:"size-10",subLogo:"text-[0.8rem]"},md:{logo:"size-6",subLogo:"text-[0.5rem]"},sm:{logo:"size-5",subLogo:"text-[0.4rem]"}},yi=({logoUrl:e,rank:t,moniker:r,size:n="md",className:i})=>{const[s,a]=m.useState(!1),o=Aa[n],l=(r==null?void 0:r.charAt(0).toUpperCase())??String(t);return c.jsx("span",{className:N.twMerge("relative inline-block",o.logo,i),children:e&&!s?c.jsx("img",{src:e,alt:r||`Finality Provider ${t}`,className:"h-full w-full rounded-full object-cover",onError:()=>a(!0)}):c.jsx(z,{as:"span",className:"inline-flex h-full w-full items-center justify-center rounded-full bg-secondary-main text-[1rem] text-accent-contrast",children:l})})};function Tr({bsnId:e,bsnName:t,bsnLogoUrl:r,address:n,provider:i,onRemove:s}){var f,u;if(!i)return null;const a=()=>{if(r)return c.jsx(Pt,{url:r,alt:t,variant:"rounded",size:"tiny",className:"mr-1"});const d=(t==null?void 0:t.charAt(0).toUpperCase())||"?";return c.jsx(Pt,{variant:"rounded",size:"tiny",className:"mr-1",children:c.jsx(z,{as:"span",className:"inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast",children:d})})},o=d=>!d||d.length<=6*2?d:`${d.slice(0,6)}...${d.slice(-6)}`,l=()=>n?c.jsx("div",{className:"text-xs text-accent-secondary",children:o(n)}):c.jsxs("div",{className:"flex items-center text-xs text-accent-secondary",children:[a(),t]});return c.jsxs("div",{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{className:"flex h-10 flex-row gap-2",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(yi,{logoUrl:i.logo_url,rank:i.rank,moniker:(f=i.description)==null?void 0:f.moniker,size:"lg"})}),c.jsxs("div",{className:"flex flex-col justify-center text-accent-primary",children:[l(),c.jsx(z,{as:"div",className:"text-base font-medium text-accent-primary",children:(u=i.description)==null?void 0:u.moniker})]})]}),s?c.jsx("button",{onClick:()=>s(e),className:"ml-[10px] cursor-pointer rounded bg-accent-secondary/20 px-2 py-0.5 text-xs tracking-[0.4px] text-accent-primary",children:"Remove"}):null]})}const Va=({attributes:e,providerItemProps:t,isSelected:r=!1,isSelectable:n=!0,onSelect:i})=>c.jsxs("div",{className:"bg-secondary-highlight h-[316px] overflow-hidden p-4 flex flex-col rounded justify-between",children:[c.jsx(Tr,{...t}),c.jsx("div",{className:"w-full h-px bg-secondary-strokeLight"}),Object.entries(e).map(([s,a])=>c.jsxs("div",{className:"text-sm flex flex-row justify-between first:mt-0 mt-1",children:[c.jsx("div",{className:"text-accent-secondary",children:s}),c.jsx("div",{className:"text-accent-primary font-medium",children:a})]},s)),i&&c.jsx(Ze,{className:"mt-4",onClick:i,disabled:!n,variant:r?"contained":"outlined",children:r?"Selected":"Select"})]});var st=1e9,La={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Pr,Y=!0,ge="[DecimalError] ",qe=ge+"Invalid argument: ",Rr=ge+"Exponent out of range: ",ot=Math.floor,Ue=Math.pow,Da=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe,ie=1e7,X=7,xi=9007199254740991,zt=ot(xi/X),_={};_.absoluteValue=_.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};_.comparedTo=_.cmp=function(e){var t,r,n,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(n=s.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return n===i?0:n>i^s.s<0?1:-1};_.decimalPlaces=_.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*X;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};_.dividedBy=_.div=function(e){return Ve(this,new this.constructor(e))};_.dividedToIntegerBy=_.idiv=function(e){var t=this,r=t.constructor;return Z(Ve(t,new r(e),0,1),r.precision)};_.equals=_.eq=function(e){return!this.cmp(e)};_.exponent=function(){return re(this)};_.greaterThan=_.gt=function(e){return this.cmp(e)>0};_.greaterThanOrEqualTo=_.gte=function(e){return this.cmp(e)>=0};_.isInteger=_.isint=function(){return this.e>this.d.length-2};_.isNegative=_.isneg=function(){return this.s<0};_.isPositive=_.ispos=function(){return this.s>0};_.isZero=function(){return this.s===0};_.lessThan=_.lt=function(e){return this.cmp(e)<0};_.lessThanOrEqualTo=_.lte=function(e){return this.cmp(e)<1};_.logarithm=_.log=function(e){var t,r=this,n=r.constructor,i=n.precision,s=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(fe))throw Error(ge+"NaN");if(r.s<1)throw Error(ge+(r.s?"NaN":"-Infinity"));return r.eq(fe)?new n(0):(Y=!1,t=Ve(bt(r,s),bt(e,s),s),Y=!0,Z(t,i))};_.minus=_.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Ci(t,e):wi(t,(e.s=-e.s,e))};_.modulo=_.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(ge+"NaN");return r.s?(Y=!1,t=Ve(r,e,0,1).times(e),Y=!0,r.minus(t)):Z(new n(r),i)};_.naturalExponential=_.exp=function(){return ji(this)};_.naturalLogarithm=_.ln=function(){return bt(this)};_.negated=_.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};_.plus=_.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?wi(t,e):Ci(t,(e.s=-e.s,e))};_.precision=_.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(qe+e);if(t=re(i)+1,n=i.d.length-1,r=n*X+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};_.squareRoot=_.sqrt=function(){var e,t,r,n,i,s,a,o=this,l=o.constructor;if(o.s<1){if(!o.s)return new l(0);throw Error(ge+"NaN")}for(e=re(o),Y=!1,i=Math.sqrt(+o),i==0||i==1/0?(t=Ne(o.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=ot((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=a=r+3;;)if(s=n,n=s.plus(Ve(o,s,a+2)).times(.5),Ne(s.d).slice(0,a)===(t=Ne(n.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(Z(s,r+1,0),s.times(s).eq(o)){n=s;break}}else if(t!="9999")break;a+=4}return Y=!0,Z(n,r)};_.times=_.mul=function(e){var t,r,n,i,s,a,o,l,f,u=this,d=u.constructor,p=u.d,g=(e=new d(e)).d;if(!u.s||!e.s)return new d(0);for(e.s*=u.s,r=u.e+e.e,l=p.length,f=g.length,l<f&&(s=p,p=g,g=s,a=l,l=f,f=a),s=[],a=l+f,n=a;n--;)s.push(0);for(n=f;--n>=0;){for(t=0,i=l+n;i>n;)o=s[i]+g[n]*p[i-n-1]+t,s[i--]=o%ie|0,t=o/ie|0;s[i]=(s[i]+t)%ie|0}for(;!s[--a];)s.pop();return t?++r:s.shift(),e.d=s,e.e=r,Y?Z(e,d.precision):e};_.toDecimalPlaces=_.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Ee(e,0,st),t===void 0?t=n.rounding:Ee(t,0,8),Z(r,e+re(r)+1,t))};_.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ye(n,!0):(Ee(e,0,st),t===void 0?t=i.rounding:Ee(t,0,8),n=Z(new i(n),e+1,t),r=Ye(n,!0,e+1)),r};_.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?Ye(i):(Ee(e,0,st),t===void 0?t=s.rounding:Ee(t,0,8),n=Z(new s(i),e+re(i)+1,t),r=Ye(n.abs(),!1,e+re(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};_.toInteger=_.toint=function(){var e=this,t=e.constructor;return Z(new t(e),re(e)+1,t.rounding)};_.toNumber=function(){return+this};_.toPower=_.pow=function(e){var t,r,n,i,s,a,o=this,l=o.constructor,f=12,u=+(e=new l(e));if(!e.s)return new l(fe);if(o=new l(o),!o.s){if(e.s<1)throw Error(ge+"Infinity");return o}if(o.eq(fe))return o;if(n=l.precision,e.eq(fe))return Z(o,n);if(t=e.e,r=e.d.length-1,a=t>=r,s=o.s,a){if((r=u<0?-u:u)<=xi){for(i=new l(fe),t=Math.ceil(n/X+4),Y=!1;r%2&&(i=i.times(o),bn(i.d,t)),r=ot(r/2),r!==0;)o=o.times(o),bn(o.d,t);return Y=!0,e.s<0?new l(fe).div(i):Z(i,n)}}else if(s<0)throw Error(ge+"NaN");return s=s<0&&e.d[Math.max(t,r)]&1?-1:1,o.s=1,Y=!1,i=e.times(bt(o,n+f)),Y=!0,i=ji(i),i.s=s,i};_.toPrecision=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?(r=re(i),n=Ye(i,r<=s.toExpNeg||r>=s.toExpPos)):(Ee(e,1,st),t===void 0?t=s.rounding:Ee(t,0,8),i=Z(new s(i),e,t),r=re(i),n=Ye(i,e<=r||r<=s.toExpNeg,e)),n};_.toSignificantDigits=_.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Ee(e,1,st),t===void 0?t=n.rounding:Ee(t,0,8)),Z(new n(r),e,t)};_.toString=_.valueOf=_.val=_.toJSON=_[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=re(e),r=e.constructor;return Ye(e,t<=r.toExpNeg||t>=r.toExpPos)};function wi(e,t){var r,n,i,s,a,o,l,f,u=e.constructor,d=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),Y?Z(t,d):t;if(l=e.d,f=t.d,a=e.e,i=t.e,l=l.slice(),s=a-i,s){for(s<0?(n=l,s=-s,o=f.length):(n=f,i=a,o=l.length),a=Math.ceil(d/X),o=a>o?a+1:o+1,s>o&&(s=o,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(o=l.length,s=f.length,o-s<0&&(s=o,n=f,f=l,l=n),r=0;s;)r=(l[--s]=l[s]+f[s]+r)/ie|0,l[s]%=ie;for(r&&(l.unshift(r),++i),o=l.length;l[--o]==0;)l.pop();return t.d=l,t.e=i,Y?Z(t,d):t}function Ee(e,t,r){if(e!==~~e||e<t||e>r)throw Error(qe+e)}function Ne(e){var t,r,n,i=e.length-1,s="",a=e[0];if(i>0){for(s+=a,t=1;t<i;t++)n=e[t]+"",r=X-n.length,r&&(s+=Te(r)),s+=n;a=e[t],n=a+"",r=X-n.length,r&&(s+=Te(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}var Ve=function(){function e(n,i){var s,a=0,o=n.length;for(n=n.slice();o--;)s=n[o]*i+a,n[o]=s%ie|0,a=s/ie|0;return a&&n.unshift(a),n}function t(n,i,s,a){var o,l;if(s!=a)l=s>a?1:-1;else for(o=l=0;o<s;o++)if(n[o]!=i[o]){l=n[o]>i[o]?1:-1;break}return l}function r(n,i,s){for(var a=0;s--;)n[s]-=a,a=n[s]<i[s]?1:0,n[s]=a*ie+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,a){var o,l,f,u,d,p,g,C,y,x,D,w,M,S,A,V,O,I,B=n.constructor,$=n.s==i.s?1:-1,R=n.d,L=i.d;if(!n.s)return new B(n);if(!i.s)throw Error(ge+"Division by zero");for(l=n.e-i.e,O=L.length,A=R.length,g=new B($),C=g.d=[],f=0;L[f]==(R[f]||0);)++f;if(L[f]>(R[f]||0)&&--l,s==null?w=s=B.precision:a?w=s+(re(n)-re(i))+1:w=s,w<0)return new B(0);if(w=w/X+2|0,f=0,O==1)for(u=0,L=L[0],w++;(f<A||u)&&w--;f++)M=u*ie+(R[f]||0),C[f]=M/L|0,u=M%L|0;else{for(u=ie/(L[0]+1)|0,u>1&&(L=e(L,u),R=e(R,u),O=L.length,A=R.length),S=O,y=R.slice(0,O),x=y.length;x<O;)y[x++]=0;I=L.slice(),I.unshift(0),V=L[0],L[1]>=ie/2&&++V;do u=0,o=t(L,y,O,x),o<0?(D=y[0],O!=x&&(D=D*ie+(y[1]||0)),u=D/V|0,u>1?(u>=ie&&(u=ie-1),d=e(L,u),p=d.length,x=y.length,o=t(d,y,p,x),o==1&&(u--,r(d,O<p?I:L,p))):(u==0&&(o=u=1),d=L.slice()),p=d.length,p<x&&d.unshift(0),r(y,d,x),o==-1&&(x=y.length,o=t(L,y,O,x),o<1&&(u++,r(y,O<x?I:L,x))),x=y.length):o===0&&(u++,y=[0]),C[f++]=u,o&&y[0]?y[x++]=R[S]||0:(y=[R[S]],x=1);while((S++<A||y[0]!==void 0)&&w--)}return C[0]||C.shift(),g.e=l,Z(g,a?s+re(g)+1:s)}}();function ji(e,t){var r,n,i,s,a,o,l=0,f=0,u=e.constructor,d=u.precision;if(re(e)>16)throw Error(Rr+re(e));if(!e.s)return new u(fe);for(Y=!1,o=d,a=new u(.03125);e.abs().gte(.1);)e=e.times(a),f+=5;for(n=Math.log(Ue(2,f))/Math.LN10*2+5|0,o+=n,r=i=s=new u(fe),u.precision=o;;){if(i=Z(i.times(e),o),r=r.times(++l),a=s.plus(Ve(i,r,o)),Ne(a.d).slice(0,o)===Ne(s.d).slice(0,o)){for(;f--;)s=Z(s.times(s),o);return u.precision=d,t==null?(Y=!0,Z(s,d)):s}s=a}}function re(e){for(var t=e.e*X,r=e.d[0];r>=10;r/=10)t++;return t}function or(e,t,r){if(t>e.LN10.sd())throw Y=!0,r&&(e.precision=r),Error(ge+"LN10 precision limit exceeded");return Z(new e(e.LN10),t)}function Te(e){for(var t="";e--;)t+="0";return t}function bt(e,t){var r,n,i,s,a,o,l,f,u,d=1,p=10,g=e,C=g.d,y=g.constructor,x=y.precision;if(g.s<1)throw Error(ge+(g.s?"NaN":"-Infinity"));if(g.eq(fe))return new y(0);if(t==null?(Y=!1,f=x):f=t,g.eq(10))return t==null&&(Y=!0),or(y,f);if(f+=p,y.precision=f,r=Ne(C),n=r.charAt(0),s=re(g),Math.abs(s)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=Ne(g.d),n=r.charAt(0),d++;s=re(g),n>1?(g=new y("0."+r),s++):g=new y(n+"."+r.slice(1))}else return l=or(y,f+2,x).times(s+""),g=bt(new y(n+"."+r.slice(1)),f-p).plus(l),y.precision=x,t==null?(Y=!0,Z(g,x)):g;for(o=a=g=Ve(g.minus(fe),g.plus(fe),f),u=Z(g.times(g),f),i=3;;){if(a=Z(a.times(u),f),l=o.plus(Ve(a,new y(i),f)),Ne(l.d).slice(0,f)===Ne(o.d).slice(0,f))return o=o.times(2),s!==0&&(o=o.plus(or(y,f+2,x).times(s+""))),o=Ve(o,new y(d),f),y.precision=x,t==null?(Y=!0,Z(o,x)):o;o=l,i+=2}}function gn(e,t){var r,n,i;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(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=ot(r/X),e.d=[],n=(r+1)%X,r<0&&(n+=X),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=X;n<i;)e.d.push(+t.slice(n,n+=X));t=t.slice(n),n=X-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),Y&&(e.e>zt||e.e<-zt))throw Error(Rr+r)}else e.s=0,e.e=0,e.d=[0];return e}function Z(e,t,r){var n,i,s,a,o,l,f,u,d=e.d;for(a=1,s=d[0];s>=10;s/=10)a++;if(n=t-a,n<0)n+=X,i=t,f=d[u=0];else{if(u=Math.ceil((n+1)/X),s=d.length,u>=s)return e;for(f=s=d[u],a=1;s>=10;s/=10)a++;n%=X,i=n-X+a}if(r!==void 0&&(s=Ue(10,a-i-1),o=f/s%10|0,l=t<0||d[u+1]!==void 0||f%s,l=r<4?(o||l)&&(r==0||r==(e.s<0?3:2)):o>5||o==5&&(r==4||l||r==6&&(n>0?i>0?f/Ue(10,a-i):0:d[u-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(s=re(e),d.length=1,t=t-s-1,d[0]=Ue(10,(X-t%X)%X),e.e=ot(-t/X)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=u,s=1,u--):(d.length=u+1,s=Ue(10,X-n),d[u]=i>0?(f/Ue(10,a-i)%Ue(10,i)|0)*s:0),l)for(;;)if(u==0){(d[0]+=s)==ie&&(d[0]=1,++e.e);break}else{if(d[u]+=s,d[u]!=ie)break;d[u--]=0,s=1}for(n=d.length;d[--n]===0;)d.pop();if(Y&&(e.e>zt||e.e<-zt))throw Error(Rr+re(e));return e}function Ci(e,t){var r,n,i,s,a,o,l,f,u,d,p=e.constructor,g=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),Y?Z(t,g):t;if(l=e.d,d=t.d,n=t.e,f=e.e,l=l.slice(),a=f-n,a){for(u=a<0,u?(r=l,a=-a,o=d.length):(r=d,n=f,o=l.length),i=Math.max(Math.ceil(g/X),o)+2,a>i&&(a=i,r.length=1),r.reverse(),i=a;i--;)r.push(0);r.reverse()}else{for(i=l.length,o=d.length,u=i<o,u&&(o=i),i=0;i<o;i++)if(l[i]!=d[i]){u=l[i]<d[i];break}a=0}for(u&&(r=l,l=d,d=r,t.s=-t.s),o=l.length,i=d.length-o;i>0;--i)l[o++]=0;for(i=d.length;i>a;){if(l[--i]<d[i]){for(s=i;s&&l[--s]===0;)l[s]=ie-1;--l[s],l[i]+=ie}l[i]-=d[i]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(t.d=l,t.e=n,Y?Z(t,g):t):new p(0)}function Ye(e,t,r){var n,i=re(e),s=Ne(e.d),a=s.length;return t?(r&&(n=r-a)>0?s=s.charAt(0)+"."+s.slice(1)+Te(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Te(-i-1)+s,r&&(n=r-a)>0&&(s+=Te(n))):i>=a?(s+=Te(i+1-a),r&&(n=r-i-1)>0&&(s=s+"."+Te(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-a)>0&&(i+1===a&&(s+="."),s+=Te(n))),e.s<0?"-"+s:s}function bn(e,t){if(e.length>t)return e.length=t,!0}function Ni(e){var t,r,n;function i(s){var a=this;if(!(a instanceof i))return new i(s);if(a.constructor=i,s instanceof i){a.s=s.s,a.e=s.e,a.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(qe+s);if(s>0)a.s=1;else if(s<0)s=-s,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(s===~~s&&s<1e7){a.e=0,a.d=[s];return}return gn(a,s.toString())}else if(typeof s!="string")throw Error(qe+s);if(s.charCodeAt(0)===45?(s=s.slice(1),a.s=-1):a.s=1,Da.test(s))gn(a,s);else throw Error(qe+s)}if(i.prototype=_,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Ni,i.config=i.set=_a,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 i.config(e),i}function _a(e){if(!e||typeof e!="object")throw Error(ge+"Object expected");var t,r,n,i=["precision",1,st,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(ot(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(qe+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(qe+r+": "+n);return this}var Pr=Ni(La);fe=new Pr(1);const Ma={prefix:"$",precision:2,zeroDisplay:"-",format:{minimumFractionDigits:2,maximumFractionDigits:2}};function Ta(e,t={}){const{prefix:r,precision:n,zeroDisplay:i,format:s}={...Ma,...t};if(e===0)return i;const a=e.toLocaleString("en",s??{maximumFractionDigits:n});return`${r}${a}`}function Ra(e,t,r){const n=e*t;return Ta(n,r)}const Pa=(e,t,r)=>new Pr(e).toDecimalPlaces(t,r).toNumber(),Br=8,Ba=5,Ia=({fieldName:e,currencyIcon:t,currencyName:r,displayBalance:n,placeholder:i="Enter Amount",balanceDetails:s,min:a="0",step:o="any",autoFocus:l=!0})=>{const f=Dr({name:e,defaultValue:""}),{setValue:u}=Ge(),d=parseFloat(f||"0"),p=Ra(d,(s==null?void 0:s.price)??0,{zeroDisplay:"$0.00"}),g=y=>{u(e,y.target.value,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},C=y=>{(y.key==="ArrowUp"||y.key==="ArrowDown")&&y.preventDefault()};return c.jsxs(Kt,{className:"flex w-full flex-col content-center justify-between gap-4",children:[c.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("img",{src:t,alt:r,className:"h-10 max-h-[2.5rem] w-10 max-w-[2.5rem]"}),c.jsx("div",{className:"text-lg",children:r})]}),c.jsx("input",{type:"number",value:f??"",min:a,step:o,onChange:g,onKeyDown:C,placeholder:i,autoFocus:l,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"})]}),c.jsx(bi,{name:e,defaultValue:""}),s&&n?c.jsxs("div",{className:"flex w-full flex-row content-center justify-between text-sm",children:[c.jsxs("div",{children:["Stakable:"," ",c.jsx("span",{className:"cursor-default",children:Pa(Number(s.balance),s.decimals??Br)})," ",s.symbol]}),s.displayUSD&&s.price!==void 0&&c.jsxs("div",{children:[p," USD"]})]}):null]})};function $a({items:e,onRemove:t}){const r=m.useMemo(()=>e,[e]);return r.length===0?null:c.jsx("div",{className:"flex flex-col gap-8",children:r.map(({bsnId:n,bsnName:i,bsnLogoUrl:s,provider:a})=>c.jsx(Tr,{bsnId:n,bsnName:i,bsnLogoUrl:s,provider:a,onRemove:t},`${n}-${a.rank}`))})}function Ha({max:e,items:t=[],actionText:r,onAdd:n,onRemove:i}){const s=m.useMemo(()=>t.length,[t]);return c.jsx(Kt,{children:c.jsxs("div",{className:"flex w-full flex-col gap-4",children:[c.jsx("div",{className:"flex flex-row",children:c.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[c.jsx("span",{className:"text-sm sm:text-base",children:r}),c.jsx(ri,{counter:s,max:e,onAdd:n})]})}),s>0&&c.jsx($a,{items:t,onRemove:i})]})})}function tr({title:e,children:t,className:r,hint:n}){return c.jsxs("div",{className:N.twMerge("flex flex-row items-center justify-between text-accent-primary",n&&"items-start",r),children:[c.jsx(z,{as:"div",variant:"body1",children:e}),n?c.jsxs("div",{className:"flex flex-col items-end",children:[c.jsx(z,{as:"div",className:"flex items-center gap-2",children:t}),c.jsx(z,{as:"div",variant:"body2",className:"text-accent-secondary",children:n})]}):c.jsx(z,{as:"div",className:"flex items-center gap-2",children:t})]})}function Ua(e){return yt({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 Oi({value:e,onEdit:t,title:r="Network Fee Rate",className:n}){return c.jsxs(tr,{title:r,className:n,children:[c.jsxs("span",{children:[e," sats/vB"]}),t&&c.jsx(Ze,{size:"small",variant:"outlined",className:"h-6 w-6 pl-1 text-secondary-strokeDark",onClick:t,children:c.jsx(Ua,{size:16,className:"text-secondary-strokeDark"})})]})}function ki({amount:e,coinSymbol:t,hint:r,title:n,className:i,decimals:s=Br}){let a;return typeof e=="number"?e===0?a="0":a=e.toFixed(s).replace(/0+$/,"").replace(/\.$/,""):a=e,c.jsxs(tr,{title:n??`${t} Network Fee`,hint:r,className:i,children:[a," ",t]})}function Ei({amount:e,coinSymbol:t,hint:r,title:n,className:i,decimals:s=Ba}){const a=typeof e=="number"?e.toFixed(s):e;return c.jsxs(tr,{title:n??`${t} Network Fee`,hint:r,className:i,children:[a," ",t]})}function Si({total:e,coinSymbol:t,hint:r,title:n="Total",className:i,decimals:s=Br}){let a;return typeof e=="number"?e===0?a="0":a=e.toFixed(s).replace(/0+$/,"").replace(/\.$/,""):a=e,c.jsxs("div",{className:N.twMerge("flex flex-row items-start justify-between text-accent-primary",i),children:[c.jsx(z,{variant:"body1",className:"font-bold",children:n}),c.jsxs("div",{className:"flex flex-col items-end justify-center",children:[c.jsxs(z,{variant:"body1",className:"font-bold",children:[a," ",t]}),r&&c.jsx(z,{variant:"body1",className:"text-sm text-accent-secondary",children:r})]})]})}function Wa({className:e,feeRate:t,onFeeRateEdit:r,feeAmount:n,coinSymbol:i,feeAmountHint:s,total:a,totalHint:o,bbnFeeAmount:l,bbnCoinSymbol:f,bbnFeeAmountHint:u,bbnFeeDecimals:d}){return c.jsx(Kt,{className:N.twMerge("flex w-full flex-col content-center justify-between gap-4",e),children:c.jsxs("div",{className:"flex flex-col gap-6 p-4",children:[c.jsx(Oi,{value:t,onEdit:r}),c.jsx(ki,{amount:n,coinSymbol:i,hint:s}),l!==void 0&&f?c.jsx(Ei,{amount:l,coinSymbol:f,hint:u,decimals:d}):null,c.jsx("div",{className:"divider my-4"}),c.jsx(Si,{total:a,coinSymbol:i,hint:o})]})})}const yn=e=>{let t="";for(let r=0;r<e.length;r++){const n=e[r].toLowerCase();n>="a"&&n<="z"||n>="0"&&n<="9"?t+=n:t.length>0&&t[t.length-1]!=="-"&&(t+="-")}return t.endsWith("-")&&(t=t.slice(0,-1)),t},Ja=640;function qa({className:e,...t}){const n=Qt(Ja)?Nr:Un;return c.jsx(n,{...t,className:N.twMerge("w-[41.25rem] max-w-full",e)})}const za=({open:e,processing:t=!1,onClose:r,onProceed:n,bsns:i,finalityProviders:s,details:a})=>{const o=[{label:"Stake Amount",value:a.stakeAmount},{label:"Fee Rate",value:a.feeRate},{label:"Transaction Fees",value:a.transactionFees},{label:"Term",value:c.jsxs(c.Fragment,{children:[a.term.blocks,c.jsx("br",{}),c.jsx("span",{className:"text-md text-secondary",children:a.term.duration})]})},{label:"Unbonding",value:a.unbonding},{label:"Unbonding Fee",value:a.unbondingFee}];return c.jsxs(qa,{open:e,onClose:r,children:[c.jsx(Jn,{title:"Preview",onClose:r,className:"text-accent-primary"}),c.jsxs(qn,{className:"no-scrollbar mb-8 mt-4 flex max-h-[calc(100vh-12rem)] flex-col gap-4 overflow-y-auto text-accent-primary",children:[c.jsx(ti,{className:"p-6 pt-4",children:c.jsxs("div",{className:"flex flex-col",children:[i.length>1?c.jsxs("div",{className:"grid grid-cols-2 items-center gap-4 pb-4",children:[c.jsx(z,{variant:"caption",className:"text-secondary text-center",children:"BSNs"}),c.jsx(z,{variant:"caption",className:"text-secondary text-center",children:"Finality Provider"})]}):null,c.jsxs("div",{className:"grid grid-cols-2 items-center gap-4 rounded bg-primary-contrast p-4",children:[c.jsx("div",{className:"flex flex-col gap-3",children:i.map((l,f)=>c.jsxs("div",{className:"flex w-full items-center justify-center gap-2 py-1",children:[l.icon,c.jsx(z,{variant:"body2",className:"font-medium",children:l.name})]},`bsn-${yn(l.name)}-${f}`))}),c.jsx("div",{className:"flex flex-col gap-3",children:s.map((l,f)=>c.jsxs("div",{className:"flex w-full items-center justify-center gap-2 py-1",children:[l.icon,c.jsx(z,{variant:"body2",className:"font-medium",children:l.name})]},`fp-${yn(l.name)}-${f}`))})]})]})}),c.jsx("div",{className:"flex flex-col",children:o.map((l,f)=>c.jsxs("div",{className:"flex flex-row items-center justify-between py-3",children:[c.jsx(z,{variant:"body1",className:"text-secondary font-normal",children:l.label}),c.jsx(z,{variant:"body1",className:"text-right font-normal",children:l.value})]},f))}),c.jsx("div",{className:"border-divider w-full border-t"}),c.jsxs("div",{className:"pt-2",children:[c.jsx(Zt,{variant:"h6",className:"text-primary mb-2",children:"Attention!"}),c.jsx(z,{variant:"body2",className:"text-secondary",children:"1. No third party possesses your staked BTC. You are the only one who can unbond and withdraw your stake."}),c.jsx(z,{variant:"body2",className:"text-secondary",children:"2. Your stake will first be sent to Babylon Genesis for verification (~20 seconds), then you will be prompted to submit it to the Bitcoin ledger. It will be marked as 'Pending' until it receives 10 Bitcoin confirmations."})]})]}),c.jsxs(zn,{className:"flex flex-col gap-4 pb-8 pt-0 sm:flex-row",children:[c.jsx(Ze,{variant:"contained",color:"primary",onClick:n,className:"w-full sm:flex-1 sm:order-2",disabled:t,children:t?"Processing...":"Proceed to Signing"}),c.jsx(Ze,{variant:"outlined",color:"primary",onClick:r,className:"w-full sm:flex-1 sm:order-1",children:"Cancel"})]})]})},Za={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Xa({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:N.twMerge("bbn-list-legacy",`bbn-list-legacy-${t}`,e),children:m.Children.map(r,n=>m.isValidElement(n)?m.cloneElement(n,{orientation:Za[t]}):n)})}function Ya({className:e,orientation:t="horizontal",title:r,value:n,suffix:i}){return c.jsxs("div",{className:N.twJoin("bbn-list-item-legacy",`bbn-list-item-legacy-${t}`,e),children:[c.jsx(z,{as:"div",className:N.twJoin("bbn-list-title-legacy",`bbn-list-title-legacy-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(z,{as:"div",className:N.twJoin("bbn-list-value-legacy",`bbn-list-value-legacy-${t}`),variant:"body1",children:[n,i]})]})}exports.Accordion=Di;exports.AccordionDetails=Ti;exports.AccordionSummary=_i;exports.AmountSubsection=Ia;exports.Avatar=Pt;exports.AvatarGroup=Ri;exports.BBNFeeAmount=Ei;exports.BTCFeeAmount=ki;exports.BTCFeeRate=Oi;exports.Badge=Jo;exports.BitcoinPublicKeyIcon=po;exports.Button=Ze;exports.Card=ti;exports.Cell=ei;exports.Checkbox=Nn;exports.CheckboxField=Ea;exports.Chip=bo;exports.CloseIcon=Wn;exports.Column=Kn;exports.Copy=ea;exports.CopyIcon=go;exports.CounterButton=ri;exports.Dialog=Un;exports.DialogBody=qn;exports.DialogFooter=zn;exports.DialogHeader=Jn;exports.DisplayHash=Qo;exports.FeeItem=tr;exports.FeesSection=Wa;exports.FinalityProviderItem=Tr;exports.FinalityProviderLogo=yi;exports.FinalityProviderSubsection=Ha;exports.Form=ja;exports.FormControl=Ct;exports.Heading=Zt;exports.HiddenField=bi;exports.IconButton=fr;exports.Input=Yt;exports.LinkWalletIcon=vo;exports.List=Uo;exports.ListItem=Wo;exports.ListItemLegacy=Ya;exports.ListLegacy=Xa;exports.Loader=yo;exports.Menu=Zo;exports.MenuDrawer=kr;exports.MenuItem=Xo;exports.MobileDialog=Nr;exports.NumberField=Oa;exports.Popover=xr;exports.Portal=jt;exports.PreviewModal=za;exports.Radio=On;exports.RadioField=Sa;exports.ScrollLocker=ho;exports.Select=wr;exports.SelectField=Fa;exports.SubMenu=Yo;exports.SubMenuItem=Go;exports.SubSection=Kt;exports.Table=Io;exports.TableElement=Va;exports.Text=z;exports.TextField=ka;exports.ThemedIcon=Gt;exports.Toggle=$o;exports.Total=Si;exports.UsingInscriptionIcon=mo;exports.WalletDisconnectButton=jn;exports.iconColorVariants=Cr;exports.useClickOutside=Bn;exports.useControlledState=ze;exports.useCopy=ii;exports.useField=Ke;exports.useFieldState=Ca;exports.useFormContext=Ge;exports.useFormState=Lr;exports.useIsMobile=Qt;exports.useMemoizedArray=Pn;exports.useMenuContext=Or;exports.useModalManager=jr;exports.useResizeObserver=In;exports.useTableScroll=Yn;exports.useTableSort=Qn;exports.useWatch=Dr;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|