@babylonlabs-io/core-ui 1.8.0 → 1.9.0
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/components/Button/WalletDisconnectButton.d.ts +5 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Copy/Copy.d.ts +12 -0
- package/dist/components/Copy/index.d.ts +1 -0
- package/dist/components/DisplayHash/DisplayHash.d.ts +10 -0
- package/dist/components/DisplayHash/index.d.ts +1 -0
- package/dist/components/Icons/ThemedIcon.d.ts +10 -0
- package/dist/components/Icons/common/CloseIcon.d.ts +2 -0
- package/dist/components/Icons/common/CopyIcon.d.ts +2 -0
- package/dist/components/Icons/index.d.ts +23 -0
- package/dist/components/Icons/wallet/BitcoinPublicKeyIcon.d.ts +2 -0
- package/dist/components/Icons/wallet/LinkWalletIcon.d.ts +2 -0
- package/dist/components/Icons/wallet/UsingInscriptionIcon.d.ts +2 -0
- package/dist/components/Menu/Menu.d.ts +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/useCopy.d.ts +10 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +1858 -1569
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/trim.d.ts +7 -0
- package/dist/widgets/WalletMenu/WalletMenu.d.ts +20 -0
- package/dist/widgets/WalletMenu/components/WalletInfoCard.d.ts +11 -0
- package/dist/widgets/WalletMenu/components/WalletInfoSection.d.ts +10 -0
- package/dist/widgets/WalletMenu/components/WalletSettingItem.d.ts +10 -0
- package/dist/widgets/WalletMenu/components/WalletToggle.d.ts +8 -0
- package/dist/widgets/WalletMenu/components/index.d.ts +8 -0
- package/dist/widgets/WalletMenu/index.d.ts +10 -0
- package/package.json +1 -1
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"),p=require("react"),F=require("tailwind-merge"),hn=require("react-dom");function vn(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=vn(p),yi=vn(hn);function Qe({value:e,defaultValue:t,onStateChange:r}={}){const[n,i]=p.useState(t),{current:s}=p.useRef(e!=null),a=s?e:n,o=p.useCallback(l=>{s||i(l),r==null||r(l)},[s,r,i]);return[a,o]}const ar=p.createContext({disabled:!1,expanded:!1});function xi({expanded:e,defaultExpanded:t,onChange:r,className:n,disabled:i=!1,children:s}){const[a=!1,o]=Qe({value:e,defaultValue:t,onStateChange:r}),l=p.useCallback(()=>{o(!a)},[o,a]),f=p.useMemo(()=>({defaultExpanded:t,disabled:i,expanded:a&&!i,toggle:i?void 0:l}),[t,a,i,l]);return c.jsx(ar.Provider,{value:f,children:c.jsx("div",{className:F.twJoin("bbn-accordion",i&&"bbn-accordion-disabled",n),children:s})})}const et=p.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:F.twJoin("bbn-btn",`bbn-btn-${e}`,`bbn-btn-${r}`,`bbn-btn-${t}`,n&&"bbn-btn-fluid",i)}));et.displayName="Button";const lr=({className:e,...t})=>c.jsx("button",{...t,className:F.twJoin("bbn-btn-icon",e)});function wi({className:e,iconClassName:t,children:r,renderIcon:n=()=>null}){const{expanded:i,toggle:s}=p.useContext(ar),a=n(i);return c.jsxs("div",{className:F.twJoin("bbn-accordion-summary",e),onClick:s,children:[r,a&&c.jsx(lr,{className:F.twJoin("bbn-accordion-icon",t),children:a})]})}function cr(e,t){return typeof e!="number"?typeof t=="number"?cr(t):t:`${e}px`}function ji(e=!0){const[t,r]=p.useState("0px"),[n,i]=p.useState(),s=p.useRef(null);return p.useEffect(()=>{const a=new ResizeObserver(o=>{const[l]=o;r(cr(l.target.clientHeight)??"0px")});i(a)},[]),p.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 Ni({unmountOnExit:e=!1,animationDuration:t=200,className:r,wrapperClassName:n,children:i}){const{expanded:s}=p.useContext(ar),[a,o]=p.useState(s),l=a||!e,{height:f,ref:u}=ji(l);return p.useEffect(function(){if(s===a)return;if(s){o(!0);return}const m=setTimeout(o,t,!1);return()=>{clearTimeout(m)}},[s,a,t]),c.jsx("div",{className:F.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:F.twJoin("bbn-accordion-content",r),children:i}):null})}const Z=p.forwardRef(({variant:e="body1",as:t="p",children:r,className:n,...i},s)=>p.createElement(t,{...i,ref:s,className:F.twJoin(`bbn-text-${e}`,n)},r));Z.displayName="Text";const qt=p.forwardRef(({variant:e,as:t=e,children:r,className:n,...i},s)=>p.createElement(t,{...i,ref:s,className:F.twJoin(`bbn-${e}`,n)},r));qt.displayName="Heading";function ur({className:e,style:t,size:r="large",variant:n="circular",alt:i,url:s,children:a}){return c.jsx("div",{style:t,className:F.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 Ci=({max:e=1/0,className:t,children:r,avatarClassName:n,variant:i,...s})=>{const a=p.Children.count(r);return c.jsxs("div",{className:F.twJoin("bbn-avatar-group",t),children:[p.Children.map(r,(o,l)=>p.isValidElement(o)&&l+1<=e?p.cloneElement(o,{...s,className:F.twMerge(n,o.props.className),variant:i}):null),a>e&&c.jsxs(ur,{size:s.size,variant:i,className:n,children:["+",a-e]})]})},mn=p.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:h,...m},g){const[E=!1,y]=Qe({value:r,defaultValue:n,onStateChange:h});function x(w){var M;y(w.currentTarget.checked),(M=i==null?void 0:i.onChange)==null||M.call(i,w)}const L=c.jsxs("span",{className:F.twJoin("bbn-switcher",a&&"bbn-switcher-disabled",o),children:[u(E),c.jsx("input",{ref:g,type:l,disabled:a,className:"bbn-switcher-input",...m,...i,checked:E,onChange:x})]});return t?c.jsxs(Z,{as:"label",variant:"body1",className:F.twJoin("bbn-switcher-label",s==="left"?"bbn-switcher-left":"bbn-switcher-right",f),children:[L,t]}):L}),Oi={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"})})},pn=p.forwardRef(function(t,r){return c.jsx(mn,{ref:r,...t,inputType:"checkbox",renderIcon:n=>Oi[n.toString()]})}),Ei={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"})})},gn=p.forwardRef(function(t,r){return c.jsx(mn,{ref:r,...t,inputType:"radio",renderIcon:n=>Ei[n.toString()]})});var bn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Tr=p.createContext&&p.createContext(bn),ki=["attr","size","title"];function Si(e,t){if(e==null)return{};var r=Fi(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 Fi(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 Tt(){return Tt=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},Tt.apply(this,arguments)}function Pr(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 Pt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pr(Object(r),!0).forEach(function(n){Ai(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ai(e,t,r){return t=Di(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Di(e){var t=Vi(e,"string");return typeof t=="symbol"?t:t+""}function Vi(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 yn(e){return e&&e.map((t,r)=>p.createElement(t.tag,Pt({key:r},t.attr),yn(t.child)))}function yt(e){return t=>p.createElement(_i,Tt({attr:Pt({},e.attr)},t),yn(e.child))}function _i(e){var t=r=>{var{attr:n,size:i,title:s}=e,a=Si(e,ki),o=i||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),p.createElement("svg",Tt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,a,{className:l,style:Pt(Pt({color:e.color||r.color},r.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&p.createElement("title",null,s),e.children)};return Tr!==void 0?p.createElement(Tr.Consumer,null,r=>t(r)):t(bn)}function Li(e){return yt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 16L6 10H18L12 16Z"},child:[]}]})(e)}function Mi(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 Ri(e){return yt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 8L18 14H6L12 8Z"},child:[]}]})(e)}var Br=function(t){return t.reduce(function(r,n){var i=n[0],s=n[1];return r[i]=s,r},{})},Ir=typeof window<"u"&&window.document&&window.document.createElement?Ae.useLayoutEffect:Ae.useEffect,le="top",me="bottom",pe="right",ce="left",fr="auto",xt=[le,me,pe,ce],tt="start",pt="end",Ti="clippingParents",xn="viewport",ct="popper",Pi="reference",$r=xt.reduce(function(e,t){return e.concat([t+"-"+tt,t+"-"+pt])},[]),wn=[].concat(xt,[fr]).reduce(function(e,t){return e.concat([t,t+"-"+tt,t+"-"+pt])},[]),Bi="beforeRead",Ii="read",$i="afterRead",Ui="beforeMain",Wi="main",Hi="afterMain",Ji="beforeWrite",qi="write",zi="afterWrite",Zi=[Bi,Ii,$i,Ui,Wi,Hi,Ji,qi,zi];function Ee(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 ze(e){var t=de(e).Element;return e instanceof t||e instanceof Element}function ve(e){var t=de(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function dr(e){if(typeof ShadowRoot>"u")return!1;var t=de(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Xi(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];!ve(s)||!Ee(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 Yi(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},{});!ve(i)||!Ee(i)||(Object.assign(i.style,o),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}}const Gi={name:"applyStyles",enabled:!0,phase:"write",fn:Xi,effect:Yi,requires:["computeStyles"]};function Oe(e){return e.split("-")[0]}var Je=Math.max,Bt=Math.min,rt=Math.round;function ir(){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 jn(){return!/^((?!chrome|android).)*safari/i.test(ir())}function nt(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),i=1,s=1;t&&ve(e)&&(i=e.offsetWidth>0&&rt(n.width)/e.offsetWidth||1,s=e.offsetHeight>0&&rt(n.height)/e.offsetHeight||1);var a=ze(e)?de(e):window,o=a.visualViewport,l=!jn()&&r,f=(n.left+(l&&o?o.offsetLeft:0))/i,u=(n.top+(l&&o?o.offsetTop:0))/s,h=n.width/i,m=n.height/s;return{width:h,height:m,top:u,right:f+h,bottom:u+m,left:f,x:f,y:u}}function hr(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 Nn(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&dr(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ve(e){return de(e).getComputedStyle(e)}function Ki(e){return["table","td","th"].indexOf(Ee(e))>=0}function Pe(e){return((ze(e)?e.ownerDocument:e.document)||window.document).documentElement}function zt(e){return Ee(e)==="html"?e:e.assignedSlot||e.parentNode||(dr(e)?e.host:null)||Pe(e)}function Ur(e){return!ve(e)||Ve(e).position==="fixed"?null:e.offsetParent}function Qi(e){var t=/firefox/i.test(ir()),r=/Trident/i.test(ir());if(r&&ve(e)){var n=Ve(e);if(n.position==="fixed")return null}var i=zt(e);for(dr(i)&&(i=i.host);ve(i)&&["html","body"].indexOf(Ee(i))<0;){var s=Ve(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=Ur(e);r&&Ki(r)&&Ve(r).position==="static";)r=Ur(r);return r&&(Ee(r)==="html"||Ee(r)==="body"&&Ve(r).position==="static")?t:r||Qi(e)||t}function vr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function dt(e,t,r){return Je(e,Bt(t,r))}function es(e,t,r){var n=dt(e,t,r);return n>r?r:n}function Cn(){return{top:0,right:0,bottom:0,left:0}}function On(e){return Object.assign({},Cn(),e)}function En(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var ts=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,On(typeof t!="number"?t:En(t,xt))};function rs(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,pe].indexOf(o)>=0,u=f?"height":"width";if(!(!s||!a)){var h=ts(i.padding,r),m=hr(s),g=l==="y"?le:ce,E=l==="y"?me:pe,y=r.rects.reference[u]+r.rects.reference[l]-a[l]-r.rects.popper[u],x=a[l]-r.rects.reference[l],L=wt(s),w=L?l==="y"?L.clientHeight||0:L.clientWidth||0:0,M=y/2-x/2,k=h[g],A=w-m[u]-h[E],D=w/2-m[u]/2+M,N=dt(k,D,A),I=l;r.modifiersData[n]=(t={},t[I]=N,t.centerOffset=N-D,t)}}function ns(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)||Nn(t.elements.popper,i)&&(t.elements.arrow=i))}const is={name:"arrow",enabled:!0,phase:"main",fn:rs,effect:ns,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function it(e){return e.split("-")[1]}var ss={top:"auto",right:"auto",bottom:"auto",left:"auto"};function os(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 Wr(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,h=e.isFixed,m=a.x,g=m===void 0?0:m,E=a.y,y=E===void 0?0:E,x=typeof u=="function"?u({x:g,y}):{x:g,y};g=x.x,y=x.y;var L=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),M=ce,k=le,A=window;if(f){var D=wt(r),N="clientHeight",I="clientWidth";if(D===de(r)&&(D=Pe(r),Ve(D).position!=="static"&&o==="absolute"&&(N="scrollHeight",I="scrollWidth")),D=D,i===le||(i===ce||i===pe)&&s===pt){k=me;var B=h&&D===A&&A.visualViewport?A.visualViewport.height:D[N];y-=B-n.height,y*=l?1:-1}if(i===ce||(i===le||i===me)&&s===pt){M=pe;var $=h&&D===A&&A.visualViewport?A.visualViewport.width:D[I];g-=$-n.width,g*=l?1:-1}}var T=Object.assign({position:o},f&&ss),V=u===!0?os({x:g,y},de(r)):{x:g,y};if(g=V.x,y=V.y,l){var P;return Object.assign({},T,(P={},P[k]=w?"0":"",P[M]=L?"0":"",P.transform=(A.devicePixelRatio||1)<=1?"translate("+g+"px, "+y+"px)":"translate3d("+g+"px, "+y+"px, 0)",P))}return Object.assign({},T,(t={},t[k]=w?y+"px":"",t[M]=L?g+"px":"",t.transform="",t))}function as(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,Wr(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,Wr(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 ls={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:as,data:{}};var Vt={passive:!0};function cs(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,Vt)}),o&&l.addEventListener("resize",r.update,Vt),function(){s&&f.forEach(function(u){u.removeEventListener("scroll",r.update,Vt)}),o&&l.removeEventListener("resize",r.update,Vt)}}const us={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:cs,data:{}};var fs={left:"right",right:"left",bottom:"top",top:"bottom"};function Lt(e){return e.replace(/left|right|bottom|top/g,function(t){return fs[t]})}var ds={start:"end",end:"start"};function Hr(e){return e.replace(/start|end/g,function(t){return ds[t]})}function mr(e){var t=de(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function pr(e){return nt(Pe(e)).left+mr(e).scrollLeft}function hs(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=jn();(f||!f&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o+pr(e),y:l}}function vs(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+pr(e),l=-n.scrollTop;return Ve(i||r).direction==="rtl"&&(o+=Je(r.clientWidth,i?i.clientWidth:0)-s),{width:s,height:a,x:o,y:l}}function gr(e){var t=Ve(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function kn(e){return["html","body","#document"].indexOf(Ee(e))>=0?e.ownerDocument.body:ve(e)&&gr(e)?e:kn(zt(e))}function ht(e,t){var r;t===void 0&&(t=[]);var n=kn(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),s=de(n),a=i?[s].concat(s.visualViewport||[],gr(n)?n:[]):n,o=t.concat(a);return i?o:o.concat(ht(zt(a)))}function sr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ms(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 Jr(e,t,r){return t===xn?sr(hs(e,r)):ze(t)?ms(t,r):sr(vs(Pe(e)))}function ps(e){var t=ht(zt(e)),r=["absolute","fixed"].indexOf(Ve(e).position)>=0,n=r&&ve(e)?wt(e):e;return ze(n)?t.filter(function(i){return ze(i)&&Nn(i,n)&&Ee(i)!=="body"}):[]}function gs(e,t,r,n){var i=t==="clippingParents"?ps(e):[].concat(t),s=[].concat(i,[r]),a=s[0],o=s.reduce(function(l,f){var u=Jr(e,f,n);return l.top=Je(u.top,l.top),l.right=Bt(u.right,l.right),l.bottom=Bt(u.bottom,l.bottom),l.left=Je(u.left,l.left),l},Jr(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 Sn(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 me:l={x:a,y:t.y+t.height};break;case pe: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 pt: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?Ti:o,f=r.rootBoundary,u=f===void 0?xn:f,h=r.elementContext,m=h===void 0?ct:h,g=r.altBoundary,E=g===void 0?!1:g,y=r.padding,x=y===void 0?0:y,L=On(typeof x!="number"?x:En(x,xt)),w=m===ct?Pi:ct,M=e.rects.popper,k=e.elements[E?w:m],A=gs(ze(k)?k:k.contextElement||Pe(e.elements.popper),l,u,a),D=nt(e.elements.reference),N=Sn({reference:D,element:M,placement:i}),I=sr(Object.assign({},M,N)),B=m===ct?I:D,$={top:A.top-B.top+L.top,bottom:B.bottom-A.bottom+L.bottom,left:A.left-B.left+L.left,right:B.right-A.right+L.right},T=e.modifiersData.offset;if(m===ct&&T){var V=T[i];Object.keys($).forEach(function(P){var W=[pe,me].indexOf(P)>=0?1:-1,G=[le,me].indexOf(P)>=0?"y":"x";$[P]+=V[G]*W})}return $}function bs(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?wn:l,u=it(n),h=u?o?$r:$r.filter(function(E){return it(E)===u}):xt,m=h.filter(function(E){return f.indexOf(E)>=0});m.length===0&&(m=h);var g=m.reduce(function(E,y){return E[y]=gt(e,{placement:y,boundary:i,rootBoundary:s,padding:a})[Oe(y)],E},{});return Object.keys(g).sort(function(E,y){return g[E]-g[y]})}function ys(e){if(Oe(e)===fr)return[];var t=Lt(e);return[Hr(e),t,Hr(t)]}function xs(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,h=r.rootBoundary,m=r.altBoundary,g=r.flipVariations,E=g===void 0?!0:g,y=r.allowedAutoPlacements,x=t.options.placement,L=Oe(x),w=L===x,M=l||(w||!E?[Lt(x)]:ys(x)),k=[x].concat(M).reduce(function(_e,be){return _e.concat(Oe(be)===fr?bs(t,{placement:be,boundary:u,rootBoundary:h,padding:f,flipVariations:E,allowedAutoPlacements:y}):be)},[]),A=t.rects.reference,D=t.rects.popper,N=new Map,I=!0,B=k[0],$=0;$<k.length;$++){var T=k[$],V=Oe(T),P=it(T)===tt,W=[le,me].indexOf(V)>=0,G=W?"width":"height",q=gt(t,{placement:T,boundary:u,rootBoundary:h,altBoundary:m,padding:f}),K=W?P?pe:ce:P?me:le;A[G]>D[G]&&(K=Lt(K));var we=Lt(K),oe=[];if(s&&oe.push(q[V]<=0),o&&oe.push(q[K]<=0,q[we]<=0),oe.every(function(_e){return _e})){B=T,I=!1;break}N.set(T,oe)}if(I)for(var Se=E?3:1,Ge=function(be){var $e=k.find(function(Le){var je=N.get(Le);if(je)return je.slice(0,be).every(function(Ue){return Ue})});if($e)return B=$e,"break"},Be=Se;Be>0;Be--){var Ie=Ge(Be);if(Ie==="break")break}t.placement!==B&&(t.modifiersData[n]._skip=!0,t.placement=B,t.reset=!0)}}const ws={name:"flip",enabled:!0,phase:"main",fn:xs,requiresIfExists:["offset"],data:{_skip:!1}};function qr(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 zr(e){return[le,pe,me,ce].some(function(t){return e[t]>=0})}function js(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=qr(a,n),f=qr(o,i,s),u=zr(l),h=zr(f);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}const Ns={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:js};function Cs(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,pe].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}function Os(e){var t=e.state,r=e.options,n=e.name,i=r.offset,s=i===void 0?[0,0]:i,a=wn.reduce(function(u,h){return u[h]=Cs(h,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 Es={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Os};function ks(e){var t=e.state,r=e.name;t.modifiersData[r]=Sn({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Ss={name:"popperOffsets",enabled:!0,phase:"read",fn:ks,data:{}};function Fs(e){return e==="x"?"y":"x"}function As(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,h=r.padding,m=r.tether,g=m===void 0?!0:m,E=r.tetherOffset,y=E===void 0?0:E,x=gt(t,{boundary:l,rootBoundary:f,padding:h,altBoundary:u}),L=Oe(t.placement),w=it(t.placement),M=!w,k=vr(L),A=Fs(k),D=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),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(D){if(s){var P,W=k==="y"?le:ce,G=k==="y"?me:pe,q=k==="y"?"height":"width",K=D[k],we=K+x[W],oe=K-x[G],Se=g?-I[q]/2:0,Ge=w===tt?N[q]:I[q],Be=w===tt?-I[q]:-N[q],Ie=t.elements.arrow,_e=g&&Ie?hr(Ie):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Cn(),$e=be[W],Le=be[G],je=dt(0,N[q],_e[q]),Ue=M?N[q]/2-Se-je-$e-$.mainAxis:Ge-je-$e-$.mainAxis,at=M?-N[q]/2+Se+je+Le+$.mainAxis:Be+je+Le+$.mainAxis,lt=t.elements.arrow&&wt(t.elements.arrow),Ct=lt?k==="y"?lt.clientTop||0:lt.clientLeft||0:0,Ot=(P=T==null?void 0:T[k])!=null?P:0,Et=K+Ue-Ot-Ct,kt=K+at-Ot,St=dt(g?Bt(we,Et):we,K,g?Je(oe,kt):oe);D[k]=St,V[k]=St-K}if(o){var Ft,Lr=k==="x"?le:ce,At=k==="x"?me:pe,d=D[A],v=A==="y"?"height":"width",b=d+x[Lr],S=d-x[At],C=[le,ce].indexOf(L)!==-1,j=(Ft=T==null?void 0:T[A])!=null?Ft:0,R=C?b:d-N[v]-I[v]-j+$.altAxis,U=C?d+N[v]+I[v]-j-$.altAxis:S,H=g&&C?es(R,d,U):dt(g?R:b,d,g?U:S);D[A]=H,V[A]=H-d}t.modifiersData[n]=V}}const Ds={name:"preventOverflow",enabled:!0,phase:"main",fn:As,requiresIfExists:["offset"]};function Vs(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function _s(e){return e===de(e)||!ve(e)?mr(e):Vs(e)}function Ls(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 Ms(e,t,r){r===void 0&&(r=!1);var n=ve(t),i=ve(t)&&Ls(t),s=Pe(t),a=nt(e,i,r),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((Ee(t)!=="body"||gr(s))&&(o=_s(t)),ve(t)?(l=nt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=pr(s))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function Rs(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 Ts(e){var t=Rs(e);return Zi.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function Ps(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function Bs(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 Zr={placement:"bottom",modifiers:[],strategy:"absolute"};function Xr(){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 Is(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,i=t.defaultOptions,s=i===void 0?Zr:i;return function(o,l,f){f===void 0&&(f=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Zr,s),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},h=[],m=!1,g={state:u,setOptions:function(L){var w=typeof L=="function"?L(u.options):L;y(),u.options=Object.assign({},s,u.options,w),u.scrollParents={reference:ze(o)?ht(o):o.contextElement?ht(o.contextElement):[],popper:ht(l)};var M=Ts(Bs([].concat(n,u.options.modifiers)));return u.orderedModifiers=M.filter(function(k){return k.enabled}),E(),g.update()},forceUpdate:function(){if(!m){var L=u.elements,w=L.reference,M=L.popper;if(Xr(w,M)){u.rects={reference:Ms(w,wt(M),u.options.strategy==="fixed"),popper:hr(M)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function($){return u.modifiersData[$.name]=Object.assign({},$.data)});for(var k=0;k<u.orderedModifiers.length;k++){if(u.reset===!0){u.reset=!1,k=-1;continue}var A=u.orderedModifiers[k],D=A.fn,N=A.options,I=N===void 0?{}:N,B=A.name;typeof D=="function"&&(u=D({state:u,options:I,name:B,instance:g})||u)}}}},update:Ps(function(){return new Promise(function(x){g.forceUpdate(),x(u)})}),destroy:function(){y(),m=!0}};if(!Xr(o,l))return g;g.setOptions(f).then(function(x){!m&&f.onFirstUpdate&&f.onFirstUpdate(x)});function E(){u.orderedModifiers.forEach(function(x){var L=x.name,w=x.options,M=w===void 0?{}:w,k=x.effect;if(typeof k=="function"){var A=k({state:u,name:L,instance:g,options:M}),D=function(){};h.push(A||D)}})}function y(){h.forEach(function(x){return x()}),h=[]}return g}}var $s=[us,Ss,ls,Gi,Es,ws,Ds,is,Ns],Us=Is({defaultModifiers:$s}),_t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ws=typeof Element<"u",Hs=typeof Map=="function",Js=typeof Set=="function",qs=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Mt(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(!Mt(e[n],t[n]))return!1;return!0}var s;if(Hs&&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(!Mt(n.value[1],t.get(n.value[0])))return!1;return!0}if(Js&&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(qs&&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(Ws&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!Mt(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var zs=function(t,r){try{return Mt(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 Zs=Fn(zs);var Xs=[],Ys=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||Xs},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 E=g.state,y=Object.keys(E.elements);yi.flushSync(function(){l({styles:Br(y.map(function(x){return[x,E.styles[x]||{}]})),attributes:Br(y.map(function(x){return[x,E.attributes[x]]}))})})},requires:["computeStyles"]}},[]),u=Ae.useMemo(function(){var m={onFirstUpdate:s.onFirstUpdate,placement:s.placement,strategy:s.strategy,modifiers:[].concat(s.modifiers,[f,{name:"applyStyles",enabled:!1}])};return Zs(i.current,m)?i.current||m:(i.current=m,m)},[s.onFirstUpdate,s.placement,s.strategy,s.modifiers,f]),h=Ae.useRef();return Ir(function(){h.current&&h.current.setOptions(u)},[u]),Ir(function(){if(!(t==null||r==null)){var m=n.createPopper||Us,g=m(t,r,u);return h.current=g,function(){g.destroy(),h.current=null}}},[t,r,n.createPopper]),{state:h.current?h.current.state:null,styles:o.styles,attributes:o.attributes,update:h.current?h.current.update:null,forceUpdate:h.current?h.current.forceUpdate:null}};function Zt({children:e,mounted:t=!1,rootClassName:r="portal-root"}){const[n,i]=p.useState(null);return p.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?hn.createPortal(e,n):null}function Gs(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 Ks(e){const t=p.useRef(e);return Gs(t.current,e)||(t.current=e),t.current}function Qs(e,t=()=>null,{enabled:r=!0}={}){const n=Array.isArray(e)?e:[e],i=Ks(n);p.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 br({open:e=!1,className:t,anchorEl:r,placement:n="bottom-start",offset:i=[0,0],children:s,style:a,onClickOutside:o}){const[l,f]=p.useState(null),{styles:u}=Ys(r,l,{placement:n,modifiers:[{name:"offset",options:{offset:i}}]});return Qs([l,r],o,{enabled:e}),c.jsx(Zt,{mounted:e,children:c.jsx("div",{ref:f,style:{...u.popper,...a},className:F.twJoin("bbn-popover",t),children:s})})}function eo(e){const[t,r]=p.useState({width:0,height:0});return p.useEffect(()=>{if(!e){r({width:0,height:0});return}const n=new ResizeObserver(([i])=>{r({width:i.target.clientWidth,height:i.target.clientHeight})});return n.observe(e),()=>{n.unobserve(e)}},[e]),t}const to=e=>e.label,yr=p.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:h,onSelect:m,onClose:g,renderSelectedOption:E=to,...y},x)=>{const L=p.useRef(null);p.useImperativeHandle(x,()=>L.current,[]);const{width:w}=eo(L.current),[M,k]=Qe({value:s,defaultValue:a,onStateChange:T=>void(T?h==null?void 0:h():g==null?void 0:g())}),[A,D]=Qe({value:r,defaultValue:n,onStateChange:m}),N=p.useMemo(()=>o.find(T=>T.value===A),[o,A]),I=p.useCallback(T=>{D(T.value),k(!1)},[D,k]),B=p.useCallback(()=>{k(!1)},[k]),$=p.useCallback(()=>{e||k(!M)},[M,e,k]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:L,className:F.twJoin("bbn-select",e&&"bbn-select-disabled",`bbn-select-${u}`,t),onClick:$,tabIndex:e?-1:0,...y,children:[c.jsx("span",{children:N?E(N):i}),c.jsx(Mi,{className:F.twJoin("bbn-select-icon",M&&"bbn-select-icon-open"),size:20})]}),c.jsx(br,{anchorEl:L.current,className:F.twJoin("bbn-select-menu custom-scrollbar",f),open:M&&!e,onClickOutside:B,offset:[0,4],placement:"bottom-start",style:{width:w},children:o.map(T=>c.jsx("div",{className:F.twJoin("bbn-select-option",(N==null?void 0:N.value)===T.value&&"bbn-select-option-selected",l),onClick:()=>I(T),children:T.label},T.value))})]})});yr.displayName="Select";const Xt=p.forwardRef(({className:e,prefix:t,suffix:r,disabled:n=!1,state:i="default",...s},a)=>c.jsxs("div",{className:F.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:F.twJoin("bbn-input-field",e),disabled:n,...s}),r&&c.jsx("div",{className:"bbn-input-suffix",children:r})]}));Xt.displayName="Input";function jt({children:e,label:t,hint:r,state:n="default",className:i}){return c.jsxs("div",{className:F.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:F.twJoin("bbn-form-control-hint",`bbn-form-control-hint-${n}`),children:r})]})}const An=p.createContext({removeDialog:()=>null,updateDialog:()=>null});function ro({children:e}){const[t,r]=p.useState({}),n=p.useMemo(()=>Object.values(t).some(o=>o),[t]);p.useEffect(function(){if(n){const l=document.body.offsetWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=document.body.offsetWidth-l>=1?cr(document.body.offsetWidth-l)??"":document.body.style.paddingRight}else document.body.style.overflow="",document.body.style.paddingRight=""},[n]);const i=p.useCallback(o=>{r(l=>Reflect.deleteProperty(l,o)?{...l}:l)},[]),s=p.useCallback((o,l)=>{r(f=>({...f,[o]:l}))},[]),a=p.useMemo(()=>({removeDialog:i,updateDialog:s}),[i,s]);return c.jsx(An.Provider,{value:a,children:e})}function Dn({open:e=!1}={}){const t=p.useId(),[r,n]=p.useState(e),{updateDialog:i,removeDialog:s}=p.useContext(An),a=e||r;p.useEffect(()=>()=>{s(t)},[t]),p.useEffect(()=>{i(t,a)},[t,a,i]),p.useEffect(()=>{e&&n(!0)},[e]);const o=p.useCallback(()=>{e||n(!1)},[e]);return{mounted:r,unmount:o}}const Vn=({open:e=!1,...t})=>c.jsx("div",{...t,className:F.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}=Dn({open:t});return c.jsxs(Zt,{mounted:l,children:[c.jsx("div",{...o,className:F.twJoin("bbn-dialog-wrapper",r),children:c.jsx("div",{className:F.twJoin("bbn-dialog",t?"animate-modal-in":"animate-modal-out",a),onAnimationEnd:f,children:e})}),i&&c.jsx(Vn,{className:s,open:t,onClick:n})]})},Ln=({children:e,open:t=!1,className:r,onClose:n,...i})=>{const{mounted:s,unmount:a}=Dn({open:t});return c.jsxs(Zt,{mounted:s,children:[c.jsx("div",{...i,className:F.twJoin("bbn-dialog-mobile",t?"animate-mobile-modal-in":"animate-mobile-modal-out",r),onAnimationEnd:a,children:e}),c.jsx(Vn,{open:t,onClick:n})]})},Mn=({className:e,children:t,title:r,onClose:n})=>c.jsxs("div",{className:F.twJoin("bbn-dialog-header",e),children:[c.jsxs("div",{className:"bbn-dialog-title",children:[c.jsx(qt,{variant:"h5",children:r}),!!n&&c.jsx(lr,{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]}),Rn=e=>c.jsx("div",{...e,className:F.twJoin("bbn-dialog-body",e.className)}),Tn=e=>c.jsx("div",{...e,className:F.twJoin("bbn-dialog-footer",e.className)});function no({className:e,...t}){return c.jsx("span",{...t,className:F.twJoin("bbn-chip",e)})}function io({size:e=40,className:t}){return c.jsx("span",{className:F.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 Pn="Expected a function",Yr=NaN,so="[object Symbol]",oo=/^\s+|\s+$/g,ao=/^[-+]0x[0-9a-f]+$/i,lo=/^0b[01]+$/i,co=/^0o[0-7]+$/i,uo=parseInt,fo=typeof _t=="object"&&_t&&_t.Object===Object&&_t,ho=typeof self=="object"&&self&&self.Object===Object&&self,vo=fo||ho||Function("return this")(),mo=Object.prototype,po=mo.toString,go=Math.max,bo=Math.min,tr=function(){return vo.Date.now()};function yo(e,t,r){var n,i,s,a,o,l,f=0,u=!1,h=!1,m=!0;if(typeof e!="function")throw new TypeError(Pn);t=Gr(t)||0,It(r)&&(u=!!r.leading,h="maxWait"in r,s=h?go(Gr(r.maxWait)||0,t):s,m="trailing"in r?!!r.trailing:m);function g(D){var N=n,I=i;return n=i=void 0,f=D,a=e.apply(I,N),a}function E(D){return f=D,o=setTimeout(L,t),u?g(D):a}function y(D){var N=D-l,I=D-f,B=t-N;return h?bo(B,s-I):B}function x(D){var N=D-l,I=D-f;return l===void 0||N>=t||N<0||h&&I>=s}function L(){var D=tr();if(x(D))return w(D);o=setTimeout(L,y(D))}function w(D){return o=void 0,m&&n?g(D):(n=i=void 0,a)}function M(){o!==void 0&&clearTimeout(o),f=0,n=l=i=o=void 0}function k(){return o===void 0?a:w(tr())}function A(){var D=tr(),N=x(D);if(n=arguments,i=this,l=D,N){if(o===void 0)return E(l);if(h)return o=setTimeout(L,t),g(l)}return o===void 0&&(o=setTimeout(L,t)),a}return A.cancel=M,A.flush=k,A}function xo(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(Pn);return It(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),yo(e,t,{leading:n,maxWait:t,trailing:i})}function It(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function wo(e){return!!e&&typeof e=="object"}function jo(e){return typeof e=="symbol"||wo(e)&&po.call(e)==so}function Gr(e){if(typeof e=="number")return e;if(jo(e))return Yr;if(It(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=It(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(oo,"");var r=lo.test(e);return r||co.test(e)?uo(e.slice(2),r?2:8):ao.test(e)?Yr:+e}var No=xo;const Bn=Fn(No);function Co(e,{onLoadMore:t,hasMore:r=!1,loading:n=!1}={}){const[i,s]=p.useState(!1);return p.useEffect(()=>{const a=Bn(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 In=p.createContext({data:[],columns:[],sortStates:{},onColumnSort:void 0,onRowSelect:void 0});function $n({name:e,className:t,children:r,sorter:n,...i}){const{columns:s,sortStates:a,onColumnSort:o}=p.useContext(In),l=a[e??""],f=l==null?void 0:l.direction;return c.jsx(Z,{variant:"caption",as:"th",className:F.twJoin("bbn-cell-left",n&&"bbn-table-sortable",t),onClick:()=>{if(n&&e){const u=s.find(h=>h.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(Ri,{className:F.twJoin("bbn-sort-icon bbn-sort-icon-up",f==="asc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")}),c.jsx(Li,{className:F.twJoin("bbn-sort-icon bbn-sort-icon-down",f==="desc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")})]})]})})}function Oo(e,t){const[r,n]=p.useState({}),i=p.useCallback((a,o)=>{o&&n(l=>{var m;const f=((m=l[a])==null?void 0:m.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,E])=>[g,{...E,priority:E.priority>l[a].priority?E.priority-1:E.priority}]));const h=Math.max(0,...Object.values(l).map(g=>g.priority));return{...l,[a]:{direction:u,priority:h+1}}})},[]),s=p.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 h=f.sorter(o,l);if(h!==0)return u==="asc"?h:-h}return 0})},[e,t,r]);return{sortStates:r,handleColumnSort:i,sortedData:s}}function Un({className:e,render:t,value:r,columnName:n,...i}){return c.jsx(Z,{variant:"body2",as:"td",className:F.twJoin("bbn-cell-left",e),"data-column":n,...i,children:t?t(r):r})}function Eo({row:e,columns:t,isSelected:r,isSelectable:n,onSelect:i}){return c.jsx("tr",{className:F.twJoin(r&&"selected",!!i&&n&&"cursor-pointer",!n&&"opacity-50"),onClick:()=>i(e),children:t.map(s=>c.jsx(Un,{value:e[s.key],columnName:s.key,className:s.cellClassName,render:s.render?a=>s.render(a,e):void 0},s.key))})}function ko({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:h,...m},g){const E=p.useRef(null);p.useImperativeHandle(g,()=>E.current,[]);const{sortStates:y,handleColumnSort:x,sortedData:L}=Oo(e,t),{isScrolledTop:w}=Co(E,{onLoadMore:a,hasMore:i,loading:s}),[M,k]=Qe({value:f,defaultValue:u??null,onStateChange:h}),A=p.useCallback(N=>{if(!o||l&&!l(N))return;const I=M===N.id?null:N.id;k(I),o(I===null?null:N)},[o,l,M,k]),D=p.useMemo(()=>({data:L,columns:t,sortStates:y,onColumnSort:x,onRowSelect:A}),[L,t,y,x,A]);return c.jsx(In.Provider,{value:D,children:c.jsx("div",{ref:E,className:F.twJoin("bbn-table-wrapper",n),children:c.jsxs("table",{className:F.twJoin("bbn-table",r),...m,children:[c.jsx("thead",{className:F.twJoin("bbn-table-header",w&&"scrolled-top"),children:c.jsx("tr",{children:t.map(N=>c.jsx($n,{className:N.headerClassName,name:N.key,sorter:N.sorter,children:N.header},N.key))})}),c.jsx("tbody",{className:"bbn-table-body",children:L.map(N=>c.jsx(Eo,{row:N,columns:t,isSelected:M===N.id,isSelectable:l?l(N):!0,onSelect:A},N.id))})]})})})}const So=p.forwardRef(ko);function Wn({as:e="div",className:t,children:r}){return p.createElement(e,{className:F.twJoin("bbn-card",t)},r)}function Fo(e){const[t=!1,r]=Qe({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:F.twJoin("bbn-toggle-control",t&&"bbn-toggle-control-active")}),c.jsx("span",{className:"bbn-toggle-bg",children:e.inactiveIcon})]})}const Ao={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Do({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:F.twMerge("bbn-list",`bbn-list-${t}`,e),children:p.Children.map(r,n=>p.isValidElement(n)?p.cloneElement(n,{orientation:Ao[t]}):n)})}function Vo({className:e,orientation:t="horizontal",title:r,value:n,suffix:i}){return c.jsxs("div",{className:F.twJoin("bbn-list-item",`bbn-list-item-${t}`,e),children:[c.jsx(Z,{as:"div",className:F.twJoin("bbn-list-title",`bbn-list-title-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(Z,{as:"div",className:F.twJoin("bbn-list-value",`bbn-list-value-${t}`),variant:"body1",children:[n,i]})]})}function _o({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}`,h=`bbn-badge-${i}`;return c.jsxs("div",{className:F.twJoin("bbn-badge",s),children:[e,l&&c.jsx("span",{className:F.twJoin("bbn-badge-indicator",u,h,a),children:c.jsx("span",{className:F.twJoin("bbn-badge-content",o),children:f})})]})}const Yt=({children:e,style:t,className:r})=>c.jsx("div",{className:F.twJoin("flex rounded bg-secondary-highlight p-4 text-accent-primary",r),style:t,children:e});function Lo(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 Hn({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:F.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(Lo,{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 Jn=p.createContext(void 0),xr=()=>{const e=p.useContext(Jn);return!e&&process.env.NODE_ENV==="development"&&console.warn("useMenuContext must be used within a Menu component"),e},Mo=({children:e,value:t})=>c.jsx(Jn.Provider,{value:t,children:e}),wr=({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:h})=>{const m={left:"text-left",center:"text-center",right:"text-right"};return c.jsxs(c.Fragment,{children:[o&&e&&h&&c.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",onClick:h}),c.jsxs("div",{className:F.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]",o?F.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:F.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:F.twJoin("flex-1 text-sm font-medium text-accent-primary",f?"ml-3":"",m[s]),children:r})]}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:n})]})]})};function Ro(e=768,t=100){const[r,n]=p.useState(()=>typeof window<"u"?window.innerWidth<e:!1),i=p.useRef(),s=p.useCallback(()=>{n(window.innerWidth<e)},[e]);return p.useEffect(()=>(i.current=Bn(s,t),s(),window.addEventListener("resize",i.current),()=>{i.current&&(window.removeEventListener("resize",i.current),i.current.cancel())}),[s,t]),r}const To=({children:e,trigger:t,open:r,onOpenChange:n,placement:i="bottom-end",offset:s=[0,8],className:a})=>{const[o,l]=p.useState(!1),f=p.useRef(null),u=Ro(),h=r!==void 0?r:o,m=x=>{r===void 0&&l(x),n==null||n(x)},g=()=>m(!1),E=c.jsx("div",{className:"relative w-full overflow-hidden",children:e}),y=t||c.jsx("button",{className:"rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-800",onClick:()=>m(!h),children:"Menu"});return c.jsxs(Mo,{value:{isOpen:h,setIsOpen:m,onClose:g,isMobile:u},children:[c.jsx("div",{ref:f,className:"inline-block",children:p.isValidElement(y)&&p.cloneElement(y,{onClick:()=>m(!h),"aria-haspopup":"true","aria-expanded":h})}),u?c.jsx(wr,{isOpen:h,onClose:g,onBackdropClick:g,fullHeight:!0,fullWidth:!0,showBackButton:!0,showDivider:!1,children:E}):c.jsx(br,{anchorEl:f.current,open:h,offset:s,placement:i,onClickOutside:g,className:F.twJoin("rounded-lg border border-[#38708533] bg-[#FFFFFF] shadow-lg dark:border-[#404040] dark:bg-[#252525]","min-w-[294px]",a),children:E})]})},Po=({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=xr(),h=()=>{i||!n||(n(),u&&!o&&u.onClose())};return a?c.jsx("button",{onClick:h,disabled:i,className:F.twJoin("w-full text-left",i&&"cursor-not-allowed opacity-50",s),children:a}):c.jsxs("button",{onClick:h,disabled:i,className:F.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]})},Bo=({children:e,name:t,description:r,icon:n,backIcon:i,suffix:s,className:a,contentClassName:o,titleAlign:l="left"})=>{const[f,u]=p.useState(!1),h=xr(),m=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:F.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(wr,{isOpen:f,onClose:()=>u(!1),title:t||"",titleAlign:l,backIcon:i||m,fullHeight:h==null?void 0:h.isMobile,fullWidth:h==null?void 0:h.isMobile,onBackdropClick:h!=null&&h.isMobile?void 0:()=>u(!1),className:F.twJoin(h!=null&&h.isMobile?"z-60":"z-50",o),children:e})]})},Io=({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:F.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)]})};var Nt=e=>e.type==="checkbox",He=e=>e instanceof Date,se=e=>e==null;const qn=e=>typeof e=="object";var ee=e=>!se(e)&&!Array.isArray(e)&&qn(e)&&!He(e),zn=e=>ee(e)&&e.target?Nt(e.target)?e.target.checked:e.target.value:e,$o=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Zn=(e,t)=>e.has($o(t)),Uo=e=>{const t=e.constructor&&e.constructor.prototype;return ee(t)&&t.hasOwnProperty("isPrototypeOf")},jr=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(!(jr&&(e instanceof Blob||n))&&(r||ee(e)))if(t=r?[]:{},!r&&!Uo(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=ne(e[i]));else return e;return t}var Gt=e=>/^\w*$/.test(e),Q=e=>e===void 0,Nr=e=>Array.isArray(e)?e.filter(Boolean):[],Cr=e=>Nr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),O=(e,t,r)=>{if(!t||!ee(e))return r;const n=(Gt(t)?[t]:Cr(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=Gt(t)?[t]:Cr(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 $t={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"},Or=p.createContext(null);Or.displayName="HookFormContext";const Xe=()=>p.useContext(Or),Wo=e=>{const{children:t,...r}=e;return p.createElement(Or.Provider,{value:r},t)};var Xn=(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 Er=typeof window<"u"?Ae.useLayoutEffect:Ae.useEffect;function kr(e){const t=Xe(),{control:r=t.control,disabled:n,name:i,exact:s}=e||{},[a,o]=p.useState(r._formState),l=p.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Er(()=>r._subscribe({name:i,formState:l.current,exact:s,callback:f=>{!n&&o({...r._formState,...f})}}),[i,n,s]),p.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),p.useMemo(()=>Xn(a,r,l.current,!1),[a,r])}var Ne=e=>typeof e=="string",Yn=(e,t,r,n,i)=>Ne(e)?(n&&t.watch.add(e),O(r,e,i)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),O(r,s))):(n&&(t.watchAll=!0),r);function Sr(e){const t=Xe(),{control:r=t.control,name:n,defaultValue:i,disabled:s,exact:a}=e||{},o=p.useRef(i),[l,f]=p.useState(r._getWatch(n,o.current));return Er(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:u=>!s&&f(Yn(n,r._names,u.values||r._formValues,!1,o.current))}),[n,r,s,a]),p.useEffect(()=>r._removeUnmounted()),l}function Ho(e){const t=Xe(),{name:r,disabled:n,control:i=t.control,shouldUnregister:s}=e,a=Zn(i._names.array,r),o=Sr({control:i,name:r,defaultValue:O(i._formValues,r,O(i._defaultValues,r,e.defaultValue)),exact:!0}),l=kr({control:i,name:r,exact:!0}),f=p.useRef(e),u=p.useRef(i.register(r,{...e.rules,value:o,...ue(e.disabled)?{disabled:e.disabled}:{}})),h=p.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!O(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!O(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!O(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!O(l.validatingFields,r)},error:{enumerable:!0,get:()=>O(l.errors,r)}}),[l,r]),m=p.useCallback(x=>u.current.onChange({target:{value:zn(x),name:r},type:$t.CHANGE}),[r]),g=p.useCallback(()=>u.current.onBlur({target:{value:O(i._formValues,r),name:r},type:$t.BLUR}),[r,i._formValues]),E=p.useCallback(x=>{const L=O(i._fields,r);L&&x&&(L._f.ref={focus:()=>x.focus&&x.focus(),select:()=>x.select&&x.select(),setCustomValidity:w=>x.setCustomValidity(w),reportValidity:()=>x.reportValidity()})},[i._fields,r]),y=p.useMemo(()=>({name:r,value:o,...ue(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:m,onBlur:g,ref:E}),[r,n,l.disabled,m,g,E,o]);return p.useEffect(()=>{const x=i._options.shouldUnregister||s;i.register(r,{...f.current.rules,...ue(f.current.disabled)?{disabled:f.current.disabled}:{}});const L=(w,M)=>{const k=O(i._fields,w);k&&k._f&&(k._f.mount=M)};if(L(r,!0),x){const w=ne(O(i._options.defaultValues,r));J(i._defaultValues,r,w),Q(O(i._formValues,r))&&J(i._formValues,r,w)}return!a&&i.register(r),()=>{(a?x&&!i._state.action:x)?i.unregister(r):L(r,!1)}},[r,i,a,s]),p.useEffect(()=>{i._setDisabledField({disabled:n,name:r})},[n,r,i]),p.useMemo(()=>({field:y,formState:l,fieldState:h}),[y,l,h])}var Gn=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},vt=e=>Array.isArray(e)?e:[e],Kr=()=>{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=[]}}},or=e=>se(e)||!qn(e);function Te(e,t,r=new WeakSet){if(or(e)||or(t))return e===t;if(He(e)&&He(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(He(a)&&He(o)||ee(a)&&ee(o)||Array.isArray(a)&&Array.isArray(o)?!Te(a,o,r):a!==o)return!1}}return!0}var ae=e=>ee(e)&&!Object.keys(e).length,Fr=e=>e.type==="file",xe=e=>typeof e=="function",Ut=e=>{if(!jr)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Kn=e=>e.type==="select-multiple",Ar=e=>e.type==="radio",Jo=e=>Ar(e)||Nt(e),rr=e=>Ut(e)&&e.isConnected;function qo(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 zo(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:Gt(t)?[t]:Cr(t),n=r.length===1?e:qo(e,r),i=r.length-1,s=r[i];return n&&delete n[s],i!==0&&(ee(n)&&ae(n)||Array.isArray(n)&&zo(n))&&te(e,r.slice(0,-1)),e}var Qn=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])&&!Qn(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Wt(e[n],t[n])):se(e[n])||(t[n]=!0);return t}function ei(e,t,r){const n=Array.isArray(e);if(ee(e)||n)for(const i in e)Array.isArray(e[i])||ee(e[i])&&!Qn(e[i])?Q(t)||or(r[i])?r[i]=Array.isArray(e[i])?Wt(e[i],[]):{...Wt(e[i])}:ei(e[i],se(t)?{}:t[i],r[i]):r[i]=!Te(e[i],t[i]);return r}var ut=(e,t)=>ei(e,t,Wt(t));const Qr={value:!1,isValid:!1},en={value:!0,isValid:!0};var ti=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===""?en:{value:e[0].value,isValid:!0}:en:Qr}return Qr},ri=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Q(e)?e:t?e===""?NaN:e&&+e:r&&Ne(e)?new Date(e):n?n(e):e;const tn={isValid:!1,value:null};var ni=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,tn):tn;function rn(e){const t=e.ref;return Fr(t)?t.files:Ar(t)?ni(e.refs).value:Kn(t)?[...t.selectedOptions].map(({value:r})=>r):Nt(t)?ti(e.refs).value:ri(Q(t.value)?e.ref.value:t.value,e)}var Zo=(e,t,r,n)=>{const i={};for(const s of e){const a=O(t,s);a&&J(i,s,a._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Ht=e=>e instanceof RegExp,ft=e=>Q(e)?e:Ht(e)?e.source:ee(e)?Ht(e.value)?e.value.source:e.value:e,nn=e=>({isOnSubmit:!e||e===ye.onSubmit,isOnBlur:e===ye.onBlur,isOnChange:e===ye.onChange,isOnAll:e===ye.all,isOnTouch:e===ye.onTouched});const sn="AsyncFunction";var Xo=e=>!!e&&!!e.validate&&!!(xe(e.validate)&&e.validate.constructor.name===sn||ee(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===sn)),Yo=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),on=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const mt=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const s=O(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(mt(o,t))break}else if(ee(o)&&mt(o,t))break}}};function an(e,t,r){const n=O(e,r);if(n||Gt(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const s=i.join("."),a=O(t,s),o=O(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 Go=(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))},Ko=(e,t,r)=>!e||!t||e===t||vt(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),Qo=(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,ea=(e,t)=>!Nr(O(e,t)).length&&te(e,t),ta=(e,t,r)=>{const n=vt(O(e,r));return J(n,"root",t[r]),J(e,r,n),e},Rt=e=>Ne(e);function ln(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 Ke=e=>ee(e)&&!Ht(e)?e:{value:e,message:""},cn=async(e,t,r,n,i,s)=>{const{ref:a,refs:o,required:l,maxLength:f,minLength:u,min:h,max:m,pattern:g,validate:E,name:y,valueAsNumber:x,mount:L}=e._f,w=O(r,y);if(!L||t.has(y))return{};const M=o?o[0]:a,k=V=>{i&&M.reportValidity&&(M.setCustomValidity(ue(V)?"":V||""),M.reportValidity())},A={},D=Ar(a),N=Nt(a),I=D||N,B=(x||Fr(a))&&Q(a.value)&&Q(w)||Ut(a)&&a.value===""||w===""||Array.isArray(w)&&!w.length,$=Gn.bind(null,y,n,A),T=(V,P,W,G=Fe.maxLength,q=Fe.minLength)=>{const K=V?P:W;A[y]={type:V?G:q,message:K,ref:a,...$(V?G:q,K)}};if(s?!Array.isArray(w)||!w.length:l&&(!I&&(B||se(w))||ue(w)&&!w||N&&!ti(o).isValid||D&&!ni(o).isValid)){const{value:V,message:P}=Rt(l)?{value:!!l,message:l}:Ke(l);if(V&&(A[y]={type:Fe.required,message:P,ref:M,...$(Fe.required,P)},!n))return k(P),A}if(!B&&(!se(h)||!se(m))){let V,P;const W=Ke(m),G=Ke(h);if(!se(w)&&!isNaN(w)){const q=a.valueAsNumber||w&&+w;se(W.value)||(V=q>W.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";Ne(W.value)&&w&&(V=we?K(w)>K(W.value):oe?w>W.value:q>new Date(W.value)),Ne(G.value)&&w&&(P=we?K(w)<K(G.value):oe?w<G.value:q<new Date(G.value))}if((V||P)&&(T(!!V,W.message,G.message,Fe.max,Fe.min),!n))return k(A[y].message),A}if((f||u)&&!B&&(Ne(w)||s&&Array.isArray(w))){const V=Ke(f),P=Ke(u),W=!se(V.value)&&w.length>+V.value,G=!se(P.value)&&w.length<+P.value;if((W||G)&&(T(W,V.message,P.message),!n))return k(A[y].message),A}if(g&&!B&&Ne(w)){const{value:V,message:P}=Ke(g);if(Ht(V)&&!w.match(V)&&(A[y]={type:Fe.pattern,message:P,ref:a,...$(Fe.pattern,P)},!n))return k(P),A}if(E){if(xe(E)){const V=await E(w,r),P=ln(V,M);if(P&&(A[y]={...P,...$(Fe.validate,P.message)},!n))return k(P.message),A}else if(ee(E)){let V={};for(const P in E){if(!ae(V)&&!n)break;const W=ln(await E[P](w,r),M,P);W&&(V={...W,...$(P,W.message)},k(W.message),n&&(A[y]=V))}if(!ae(V)&&(A[y]={ref:M,...V},!n))return A}}return k(!0),A};const ra={mode:ye.onSubmit,reValidateMode:ye.onChange,shouldFocusError:!0};function na(e={}){let t={...ra,...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 h={...u};const m={array:Kr(),state:Kr()},g=t.criteriaMode===ye.all,E=d=>v=>{clearTimeout(f),f=setTimeout(d,v)},y=async d=>{if(!t.disabled&&(u.isValid||h.isValid||d)){const v=t.resolver?ae((await N()).errors):await B(n,!0);v!==r.isValid&&m.state.next({isValid:v})}},x=(d,v)=>{!t.disabled&&(u.isValidating||u.validatingFields||h.isValidating||h.validatingFields)&&((d||Array.from(o.mount)).forEach(b=>{b&&(v?J(r.validatingFields,b,v):te(r.validatingFields,b))}),m.state.next({validatingFields:r.validatingFields,isValidating:!ae(r.validatingFields)}))},L=(d,v=[],b,S,C=!0,j=!0)=>{if(S&&b&&!t.disabled){if(a.action=!0,j&&Array.isArray(O(n,d))){const R=b(O(n,d),S.argA,S.argB);C&&J(n,d,R)}if(j&&Array.isArray(O(r.errors,d))){const R=b(O(r.errors,d),S.argA,S.argB);C&&J(r.errors,d,R),ea(r.errors,d)}if((u.touchedFields||h.touchedFields)&&j&&Array.isArray(O(r.touchedFields,d))){const R=b(O(r.touchedFields,d),S.argA,S.argB);C&&J(r.touchedFields,d,R)}(u.dirtyFields||h.dirtyFields)&&(r.dirtyFields=ut(i,s)),m.state.next({name:d,isDirty:T(d,v),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else J(s,d,v)},w=(d,v)=>{J(r.errors,d,v),m.state.next({errors:r.errors})},M=d=>{r.errors=d,m.state.next({errors:r.errors,isValid:!1})},k=(d,v,b,S)=>{const C=O(n,d);if(C){const j=O(s,d,Q(b)?O(i,d):b);Q(j)||S&&S.defaultChecked||v?J(s,d,v?j:rn(C._f)):W(d,j),a.mount&&y()}},A=(d,v,b,S,C)=>{let j=!1,R=!1;const U={name:d};if(!t.disabled){if(!b||S){(u.isDirty||h.isDirty)&&(R=r.isDirty,r.isDirty=U.isDirty=T(),j=R!==U.isDirty);const H=Te(O(i,d),v);R=!!O(r.dirtyFields,d),H?te(r.dirtyFields,d):J(r.dirtyFields,d,!0),U.dirtyFields=r.dirtyFields,j=j||(u.dirtyFields||h.dirtyFields)&&R!==!H}if(b){const H=O(r.touchedFields,d);H||(J(r.touchedFields,d,b),U.touchedFields=r.touchedFields,j=j||(u.touchedFields||h.touchedFields)&&H!==b)}j&&C&&m.state.next(U)}return j?U:{}},D=(d,v,b,S)=>{const C=O(r.errors,d),j=(u.isValid||h.isValid)&&ue(v)&&r.isValid!==v;if(t.delayError&&b?(l=E(()=>w(d,b)),l(t.delayError)):(clearTimeout(f),l=null,b?J(r.errors,d,b):te(r.errors,d)),(b?!Te(C,b):C)||!ae(S)||j){const R={...S,...j&&ue(v)?{isValid:v}:{},errors:r.errors,name:d};r={...r,...R},m.state.next(R)}},N=async d=>{x(d,!0);const v=await t.resolver(s,t.context,Zo(d||o.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return x(d),v},I=async d=>{const{errors:v}=await N(d);if(d)for(const b of d){const S=O(v,b);S?J(r.errors,b,S):te(r.errors,b)}else r.errors=v;return v},B=async(d,v,b={valid:!0})=>{for(const S in d){const C=d[S];if(C){const{_f:j,...R}=C;if(j){const U=o.array.has(j.name),H=C._f&&Xo(C._f);H&&u.validatingFields&&x([S],!0);const he=await cn(C,o.disabled,s,g,t.shouldUseNativeValidation&&!v,U);if(H&&u.validatingFields&&x([S]),he[j.name]&&(b.valid=!1,v))break;!v&&(O(he,j.name)?U?ta(r.errors,he,j.name):J(r.errors,j.name,he[j.name]):te(r.errors,j.name))}!ae(R)&&await B(R,v,b)}}return b.valid},$=()=>{for(const d of o.unMount){const v=O(n,d);v&&(v._f.refs?v._f.refs.every(b=>!rr(b)):!rr(v._f.ref))&&Le(d)}o.unMount=new Set},T=(d,v)=>!t.disabled&&(d&&v&&J(s,d,v),!Te(Se(),i)),V=(d,v,b)=>Yn(d,o,{...a.mount?s:Q(v)?i:Ne(d)?{[d]:v}:v},b,v),P=d=>Nr(O(a.mount?s:i,d,t.shouldUnregister?O(i,d,[]):[])),W=(d,v,b={})=>{const S=O(n,d);let C=v;if(S){const j=S._f;j&&(!j.disabled&&J(s,d,ri(v,j)),C=Ut(j.ref)&&se(v)?"":v,Kn(j.ref)?[...j.ref.options].forEach(R=>R.selected=C.includes(R.value)):j.refs?Nt(j.ref)?j.refs.forEach(R=>{(!R.defaultChecked||!R.disabled)&&(Array.isArray(C)?R.checked=!!C.find(U=>U===R.value):R.checked=C===R.value||!!C)}):j.refs.forEach(R=>R.checked=R.value===C):Fr(j.ref)?j.ref.value="":(j.ref.value=C,j.ref.type||m.state.next({name:d,values:ne(s)})))}(b.shouldDirty||b.shouldTouch)&&A(d,C,b.shouldTouch,b.shouldDirty,!0),b.shouldValidate&&oe(d)},G=(d,v,b)=>{for(const S in v){if(!v.hasOwnProperty(S))return;const C=v[S],j=d+"."+S,R=O(n,j);(o.array.has(d)||ee(C)||R&&!R._f)&&!He(C)?G(j,C,b):W(j,C,b)}},q=(d,v,b={})=>{const S=O(n,d),C=o.array.has(d),j=ne(v);J(s,d,j),C?(m.array.next({name:d,values:ne(s)}),(u.isDirty||u.dirtyFields||h.isDirty||h.dirtyFields)&&b.shouldDirty&&m.state.next({name:d,dirtyFields:ut(i,s),isDirty:T(d,j)})):S&&!S._f&&!se(j)?G(d,j,b):W(d,j,b),on(d,o)&&m.state.next({...r}),m.state.next({name:a.mount?d:void 0,values:ne(s)})},K=async d=>{a.mount=!0;const v=d.target;let b=v.name,S=!0;const C=O(n,b),j=H=>{S=Number.isNaN(H)||He(H)&&isNaN(H.getTime())||Te(H,O(s,b,H))},R=nn(t.mode),U=nn(t.reValidateMode);if(C){let H,he;const Dt=v.type?rn(C._f):zn(d),Me=d.type===$t.BLUR||d.type===$t.FOCUS_OUT,pi=!Yo(C._f)&&!t.resolver&&!O(r.errors,b)&&!C._f.deps||Qo(Me,O(r.touchedFields,b),r.isSubmitted,U,R),Qt=on(b,o,Me);J(s,b,Dt),Me?(C._f.onBlur&&C._f.onBlur(d),l&&l(0)):C._f.onChange&&C._f.onChange(d);const er=A(b,Dt,Me),gi=!ae(er)||Qt;if(!Me&&m.state.next({name:b,type:d.type,values:ne(s)}),pi)return(u.isValid||h.isValid)&&(t.mode==="onBlur"?Me&&y():Me||y()),gi&&m.state.next({name:b,...Qt?{}:er});if(!Me&&Qt&&m.state.next({...r}),t.resolver){const{errors:Mr}=await N([b]);if(j(Dt),S){const bi=an(r.errors,n,b),Rr=an(Mr,n,bi.name||b);H=Rr.error,b=Rr.name,he=ae(Mr)}}else x([b],!0),H=(await cn(C,o.disabled,s,g,t.shouldUseNativeValidation))[b],x([b]),j(Dt),S&&(H?he=!1:(u.isValid||h.isValid)&&(he=await B(n,!0)));S&&(C._f.deps&&oe(C._f.deps),D(b,he,H,er))}},we=(d,v)=>{if(O(r.errors,v)&&d.focus)return d.focus(),1},oe=async(d,v={})=>{let b,S;const C=vt(d);if(t.resolver){const j=await I(Q(d)?d:C);b=ae(j),S=d?!C.some(R=>O(j,R)):b}else d?(S=(await Promise.all(C.map(async j=>{const R=O(n,j);return await B(R&&R._f?{[j]:R}:R)}))).every(Boolean),!(!S&&!r.isValid)&&y()):S=b=await B(n);return m.state.next({...!Ne(d)||(u.isValid||h.isValid)&&b!==r.isValid?{}:{name:d},...t.resolver||!d?{isValid:b}:{},errors:r.errors}),v.shouldFocus&&!S&&mt(n,we,d?C:o.mount),S},Se=d=>{const v={...a.mount?s:i};return Q(d)?v:Ne(d)?O(v,d):d.map(b=>O(v,b))},Ge=(d,v)=>({invalid:!!O((v||r).errors,d),isDirty:!!O((v||r).dirtyFields,d),error:O((v||r).errors,d),isValidating:!!O(r.validatingFields,d),isTouched:!!O((v||r).touchedFields,d)}),Be=d=>{d&&vt(d).forEach(v=>te(r.errors,v)),m.state.next({errors:d?r.errors:{}})},Ie=(d,v,b)=>{const S=(O(n,d,{_f:{}})._f||{}).ref,C=O(r.errors,d)||{},{ref:j,message:R,type:U,...H}=C;J(r.errors,d,{...H,...v,ref:S}),m.state.next({name:d,errors:r.errors,isValid:!1}),b&&b.shouldFocus&&S&&S.focus&&S.focus()},_e=(d,v)=>xe(d)?m.state.subscribe({next:b=>d(V(void 0,v),b)}):V(d,v,!0),be=d=>m.state.subscribe({next:v=>{Ko(d.name,v.name,d.exact)&&Go(v,d.formState||u,Ft,d.reRenderRoot)&&d.callback({values:{...s},...r,...v})}}).unsubscribe,$e=d=>(a.mount=!0,h={...h,...d.formState},be({...d,formState:h})),Le=(d,v={})=>{for(const b of d?vt(d):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);m.state.next({values:ne(s)}),m.state.next({...r,...v.keepDirty?{isDirty:T()}:{}}),!v.keepIsValid&&y()},je=({disabled:d,name:v})=>{(ue(d)&&a.mount||d||o.disabled.has(v))&&(d?o.disabled.add(v):o.disabled.delete(v))},Ue=(d,v={})=>{let b=O(n,d);const S=ue(v.disabled)||ue(t.disabled);return J(n,d,{...b||{},_f:{...b&&b._f?b._f:{ref:{name:d}},name:d,mount:!0,...v}}),o.mount.add(d),b?je({disabled:ue(v.disabled)?v.disabled:t.disabled,name:d}):k(d,!0,v.value),{...S?{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:d,onChange:K,onBlur:K,ref:C=>{if(C){Ue(d,v),b=O(n,d);const j=Q(C.value)&&C.querySelectorAll&&C.querySelectorAll("input,select,textarea")[0]||C,R=Jo(j),U=b._f.refs||[];if(R?U.find(H=>H===j):j===b._f.ref)return;J(n,d,{_f:{...b._f,...R?{refs:[...U.filter(rr),j,...Array.isArray(O(i,d))?[{}]:[]],ref:{type:j.type,name:d}}:{ref:j}}}),k(d,!1,void 0,j)}else b=O(n,d,{}),b._f&&(b._f.mount=!1),(t.shouldUnregister||v.shouldUnregister)&&!(Zn(o.array,d)&&a.action)&&o.unMount.add(d)}}},at=()=>t.shouldFocusError&&mt(n,we,o.mount),lt=d=>{ue(d)&&(m.state.next({disabled:d}),mt(n,(v,b)=>{const S=O(n,b);S&&(v.disabled=S._f.disabled||d,Array.isArray(S._f.refs)&&S._f.refs.forEach(C=>{C.disabled=S._f.disabled||d}))},0,!1))},Ct=(d,v)=>async b=>{let S;b&&(b.preventDefault&&b.preventDefault(),b.persist&&b.persist());let C=ne(s);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:j,values:R}=await N();r.errors=j,C=ne(R)}else await B(n);if(o.disabled.size)for(const j of o.disabled)te(C,j);if(te(r.errors,"root"),ae(r.errors)){m.state.next({errors:{}});try{await d(C,b)}catch(j){S=j}}else v&&await v({...r.errors},b),at(),setTimeout(at);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ae(r.errors)&&!S,submitCount:r.submitCount+1,errors:r.errors}),S)throw S},Ot=(d,v={})=>{O(n,d)&&(Q(v.defaultValue)?q(d,ne(O(i,d))):(q(d,v.defaultValue),J(i,d,ne(v.defaultValue))),v.keepTouched||te(r.touchedFields,d),v.keepDirty||(te(r.dirtyFields,d),r.isDirty=v.defaultValue?T(d,ne(O(i,d))):T()),v.keepError||(te(r.errors,d),u.isValid&&y()),m.state.next({...r}))},Et=(d,v={})=>{const b=d?ne(d):i,S=ne(b),C=ae(d),j=C?i:S;if(v.keepDefaultValues||(i=b),!v.keepValues){if(v.keepDirtyValues){const R=new Set([...o.mount,...Object.keys(ut(i,s))]);for(const U of Array.from(R))O(r.dirtyFields,U)?J(j,U,O(s,U)):q(U,O(j,U))}else{if(jr&&Q(d))for(const R of o.mount){const U=O(n,R);if(U&&U._f){const H=Array.isArray(U._f.refs)?U._f.refs[0]:U._f.ref;if(Ut(H)){const he=H.closest("form");if(he){he.reset();break}}}}if(v.keepFieldsRef)for(const R of o.mount)q(R,O(j,R));else n={}}s=t.shouldUnregister?v.keepDefaultValues?ne(i):{}:ne(j),m.array.next({values:{...j}}),m.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,m.state.next({submitCount:v.keepSubmitCount?r.submitCount:0,isDirty:C?!1:v.keepDirty?r.isDirty:!!(v.keepDefaultValues&&!Te(d,i)),isSubmitted:v.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:C?{}:v.keepDirtyValues?v.keepDefaultValues&&s?ut(i,s):r.dirtyFields:v.keepDefaultValues&&d?ut(i,d):v.keepDirty?r.dirtyFields:{},touchedFields:v.keepTouched?r.touchedFields:{},errors:v.keepErrors?r.errors:{},isSubmitSuccessful:v.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},kt=(d,v)=>Et(xe(d)?d(s):d,v),St=(d,v={})=>{const b=O(n,d),S=b&&b._f;if(S){const C=S.refs?S.refs[0]:S.ref;C.focus&&(C.focus(),v.shouldSelect&&xe(C.select)&&C.select())}},Ft=d=>{r={...r,...d}},At={control:{register:Ue,unregister:Le,getFieldState:Ge,handleSubmit:Ct,setError:Ie,_subscribe:be,_runSchema:N,_focusError:at,_getWatch:V,_getDirty:T,_setValid:y,_setFieldArray:L,_setDisabledField:je,_setErrors:M,_getFieldArray:P,_reset:Et,_resetDefaultValues:()=>xe(t.defaultValues)&&t.defaultValues().then(d=>{kt(d,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:lt,_subjects:m,_proxyFormState:u,get _fields(){return n},get _formValues(){return s},get _state(){return a},set _state(d){a=d},get _defaultValues(){return i},get _names(){return o},set _names(d){o=d},get _formState(){return r},get _options(){return t},set _options(d){t={...t,...d}}},subscribe:$e,trigger:oe,register:Ue,handleSubmit:Ct,watch:_e,setValue:q,getValues:Se,reset:kt,resetField:Ot,clearErrors:Be,unregister:Le,setError:Ie,setFocus:St,getFieldState:Ge};return{...At,formControl:At}}function ia(e={}){const t=p.useRef(void 0),r=p.useRef(void 0),[n,i]=p.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}=na(e);t.current={...o,formState:n}}const s=t.current.control;return s._options=e,Er(()=>{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]),p.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),p.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),p.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),p.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),p.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==n.isDirty&&s._subjects.state.next({isDirty:a})}},[s,n.isDirty]),p.useEffect(()=>{e.values&&!Te(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]),p.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=Xn(n,s),t.current}const un=(e,t,r)=>{if(e&&"reportValidity"in e){const n=O(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},ii=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?un(n.ref,r,e):n.refs&&n.refs.forEach(i=>un(i,r,e))}},sa=(e,t)=>{t.shouldUseNativeValidation&&ii(e,t);const r={};for(const n in e){const i=O(t.fields,n),s=Object.assign(e[n]||{},{ref:i&&i.ref});if(oa(t.names||Object.keys(e),n)){const a=Object.assign({},O(r,n));J(a,"root",s),J(r,n,a)}else J(r,n,s)}return r},oa=(e,t)=>e.some(r=>r.startsWith(t+"."));function aa(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&&ii({},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:sa((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 h=f[u.path].types,m=h&&h[u.type];f[u.path]=Gn(u.path,l,f,u.type,m?[].concat(m,u.message):u.message)}return f},{})),s)};var o,l}))}catch(a){return Promise.reject(a)}}}function la({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=ia({mode:n,reValidateMode:i,defaultValues:s,resolver:a?aa(a):void 0});return p.useEffect(()=>{if(!f)return;const{unsubscribe:h}=u.watch(f);return h},[f,u.watch]),c.jsx(Wo,{...u,children:c.jsx("form",{className:F.twJoin("bbn-form",e),name:t,onSubmit:u.handleSubmit(l),...o,children:r})})}function Ye({name:e,defaultValue:t,disabled:r=!1,autoFocus:n=!1,shouldUnregister:i=!1,validateOnMount:s=!0}){const{setFocus:a,trigger:o}=Xe(),{field:l,fieldState:f}=Ho({name:e,defaultValue:t,disabled:r,shouldUnregister:i}),{invalid:u,isTouched:h,error:m}=f;return p.useEffect(()=>{s?o(e,{shouldFocus:n}):n&&a(e)},[e,s]),{...l,value:l.value,invalid:u&&h,error:(m==null?void 0:m.message)??""}}function ca(e){const{getFieldState:t}=Xe(),r=kr({name:e});return Array.isArray(e)?e.map(i=>t(i,r)):t(e,r)}const ua=/^-?\d*\.?\d*$/;function fa({name:e,id:t=e,label:r,hint:n,className:i,controlClassName:s,disabled:a,autoFocus:o,defaultValue:l,placeholder:f,type:u,suffix:h,prefix:m,shouldUnregister:g,state:E,validateOnMount:y}){const{ref:x,value:L="",error:w,invalid:M,onChange:k,onBlur:A}=Ye({name:e,defaultValue:l,autoFocus:o,shouldUnregister:g,validateOnMount:y}),D=M?"error":E,N=M?w:n,I=B=>{ua.test(B.target.value)&&k(B.target.value)};return c.jsx(jt,{label:r,className:s,state:D,hint:N,children:c.jsx(Xt,{inputMode:"decimal",pattern:"^-?\\d*\\.?\\d*$",ref:x,value:L,id:t,name:e,type:u,className:i,disabled:a,autoFocus:o,placeholder:f,suffix:h,prefix:m,state:D,onChange:I,onBlur:A})})}function da({name:e,id:t=e,label:r,hint:n,className:i,controlClassName:s,disabled:a,autoFocus:o,defaultValue:l,placeholder:f,type:u,suffix:h,prefix:m,shouldUnregister:g,state:E,validateOnMount:y}){const{ref:x,value:L="",error:w,invalid:M,onChange:k,onBlur:A}=Ye({name:e,defaultValue:l,autoFocus:o,shouldUnregister:g,validateOnMount:y}),D=M?"error":E,N=M?w:n;return c.jsx(jt,{label:r,className:s,state:D,hint:N,children:c.jsx(Xt,{ref:x,value:L,id:t,name:e,type:u,className:i,disabled:a,autoFocus:o,placeholder:f,suffix:h,prefix:m,state:D,onChange:k,onBlur:A})})}function ha({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:h,onBlur:m}=Ye({name:e});return c.jsx(pn,{ref:f,name:e,checked:u,id:t,label:r,className:n,disabled:i,value:s,defaultChecked:a,labelClassName:o,orientation:l,inputProps:{onChange:h,onBlur:m}})}function va({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:h,onBlur:m}=Ye({name:e,disabled:i,defaultValue:a?s:void 0});return c.jsx(gn,{ref:f,name:e,id:t,label:r,className:n,disabled:i,checked:u===s,value:s,labelClassName:o,orientation:l,inputProps:{onChange:h,onBlur:m}})}function ma({open:e,defaultOpen:t,options:r,optionClassName:n,popoverClassName:i,name:s,id:a=s,label:o,hint:l,className:f,controlClassName:u,disabled:h,autoFocus:m,defaultValue:g,placeholder:E,shouldUnregister:y,state:x,validateOnMount:L,onOpen:w,onClose:M,renderSelectedOption:k}){const{ref:A,value:D="",error:N,invalid:I,onChange:B,onBlur:$}=Ye({name:s,defaultValue:g,autoFocus:m,shouldUnregister:y,validateOnMount:L}),T=I?"error":x,V=I?N:l,P=()=>{$==null||$(),M==null||M()};return c.jsx(jt,{label:o,className:u,state:T,hint:V,children:c.jsx(yr,{open:e,defaultOpen:t,options:r,ref:A,value:D,id:a,name:s,className:f,disabled:h,placeholder:E,state:T,optionClassName:n,popoverClassName:i,onSelect:B,onBlur:$,onOpen:w,onClose:P,renderSelectedOption:k})})}function si({displayError:e=!1,...t}){const{error:r,value:n,onChange:i,onBlur:s,disabled:a,name:o,ref:l}=Ye(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",h=e?r:"";return c.jsx(jt,{hint:h,state:u,children:f})}return f}const pa={lg:{logo:"size-10",subLogo:"text-[0.8rem]"},md:{logo:"size-6",subLogo:"text-[0.5rem]"},sm:{logo:"size-5",subLogo:"text-[0.4rem]"}},oi=({logoUrl:e,rank:t,moniker:r,size:n="md",className:i})=>{const[s,a]=p.useState(!1),o=pa[n],l=(r==null?void 0:r.charAt(0).toUpperCase())??String(t);return c.jsx("span",{className:F.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 Dr({bsnId:e,bsnName:t,bsnLogoUrl:r,address:n,provider:i,onRemove:s}){var f,u;if(!i)return null;const a=()=>r?c.jsx(ur,{url:r,alt:t,variant:"rounded",size:"tiny",className:"mr-1"}):null,o=h=>!h||h.length<=6*2?h:`${h.slice(0,6)}...${h.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(oi,{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 ga=({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(Dr,{...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(et,{className:"mt-4",onClick:i,disabled:!n,variant:r?"contained":"outlined",children:r?"Selected":"Select"})]});var st=1e9,ba={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},_r,Y=!0,ge="[DecimalError] ",qe=ge+"Invalid argument: ",Vr=ge+"Exponent out of range: ",ot=Math.floor,We=Math.pow,ya=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe,ie=1e7,X=7,ai=9007199254740991,Jt=ot(ai/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 De(this,new this.constructor(e))};_.dividedToIntegerBy=_.idiv=function(e){var t=this,r=t.constructor;return z(De(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=De(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?ui(t,e):li(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=De(r,e,0,1).times(e),Y=!0,r.minus(t)):z(new n(r),i)};_.naturalExponential=_.exp=function(){return ci(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?li(t,e):ui(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=Ce(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(De(o,s,a+2)).times(.5),Ce(s.d).slice(0,a)===(t=Ce(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,h=u.constructor,m=u.d,g=(e=new h(e)).d;if(!u.s||!e.s)return new h(0);for(e.s*=u.s,r=u.e+e.e,l=m.length,f=g.length,l<f&&(s=m,m=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]*m[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,h.precision):e};_.toDecimalPlaces=_.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ke(e,0,st),t===void 0?t=n.rounding:ke(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=Ze(n,!0):(ke(e,0,st),t===void 0?t=i.rounding:ke(t,0,8),n=z(new i(n),e+1,t),r=Ze(n,!0,e+1)),r};_.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?Ze(i):(ke(e,0,st),t===void 0?t=s.rounding:ke(t,0,8),n=z(new s(i),e+re(i)+1,t),r=Ze(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)<=ai){for(i=new l(fe),t=Math.ceil(n/X+4),Y=!1;r%2&&(i=i.times(o),dn(i.d,t)),r=ot(r/2),r!==0;)o=o.times(o),dn(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=ci(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=Ze(i,r<=s.toExpNeg||r>=s.toExpPos)):(ke(e,1,st),t===void 0?t=s.rounding:ke(t,0,8),i=z(new s(i),e,t),r=re(i),n=Ze(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):(ke(e,1,st),t===void 0?t=n.rounding:ke(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 Ze(e,t<=r.toExpNeg||t>=r.toExpPos)};function li(e,t){var r,n,i,s,a,o,l,f,u=e.constructor,h=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),Y?z(t,h):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(h/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,h):t}function ke(e,t,r){if(e!==~~e||e<t||e>r)throw Error(qe+e)}function Ce(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+=Re(r)),s+=n;a=e[t],n=a+"",r=X-n.length,r&&(s+=Re(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}var De=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,h,m,g,E,y,x,L,w,M,k,A,D,N,I,B=n.constructor,$=n.s==i.s?1:-1,T=n.d,V=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=V.length,A=T.length,g=new B($),E=g.d=[],f=0;V[f]==(T[f]||0);)++f;if(V[f]>(T[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,V=V[0],w++;(f<A||u)&&w--;f++)M=u*ie+(T[f]||0),E[f]=M/V|0,u=M%V|0;else{for(u=ie/(V[0]+1)|0,u>1&&(V=e(V,u),T=e(T,u),N=V.length,A=T.length),k=N,y=T.slice(0,N),x=y.length;x<N;)y[x++]=0;I=V.slice(),I.unshift(0),D=V[0],V[1]>=ie/2&&++D;do u=0,o=t(V,y,N,x),o<0?(L=y[0],N!=x&&(L=L*ie+(y[1]||0)),u=L/D|0,u>1?(u>=ie&&(u=ie-1),h=e(V,u),m=h.length,x=y.length,o=t(h,y,m,x),o==1&&(u--,r(h,N<m?I:V,m))):(u==0&&(o=u=1),h=V.slice()),m=h.length,m<x&&h.unshift(0),r(y,h,x),o==-1&&(x=y.length,o=t(V,y,N,x),o<1&&(u++,r(y,N<x?I:V,x))),x=y.length):o===0&&(u++,y=[0]),E[f++]=u,o&&y[0]?y[x++]=T[k]||0:(y=[T[k]],x=1);while((k++<A||y[0]!==void 0)&&w--)}return E[0]||E.shift(),g.e=l,z(g,a?s+re(g)+1:s)}}();function ci(e,t){var r,n,i,s,a,o,l=0,f=0,u=e.constructor,h=u.precision;if(re(e)>16)throw Error(Vr+re(e));if(!e.s)return new u(fe);for(Y=!1,o=h,a=new u(.03125);e.abs().gte(.1);)e=e.times(a),f+=5;for(n=Math.log(We(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(De(i,r,o)),Ce(a.d).slice(0,o)===Ce(s.d).slice(0,o)){for(;f--;)s=z(s.times(s),o);return u.precision=h,t==null?(Y=!0,z(s,h)):s}s=a}}function re(e){for(var t=e.e*X,r=e.d[0];r>=10;r/=10)t++;return t}function nr(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 Re(e){for(var t="";e--;)t+="0";return t}function bt(e,t){var r,n,i,s,a,o,l,f,u,h=1,m=10,g=e,E=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),nr(y,f);if(f+=m,y.precision=f,r=Ce(E),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=Ce(g.d),n=r.charAt(0),h++;s=re(g),n>1?(g=new y("0."+r),s++):g=new y(n+"."+r.slice(1))}else return l=nr(y,f+2,x).times(s+""),g=bt(new y(n+"."+r.slice(1)),f-m).plus(l),y.precision=x,t==null?(Y=!0,z(g,x)):g;for(o=a=g=De(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(De(a,new y(i),f)),Ce(l.d).slice(0,f)===Ce(o.d).slice(0,f))return o=o.times(2),s!==0&&(o=o.plus(nr(y,f+2,x).times(s+""))),o=De(o,new y(h),f),y.precision=x,t==null?(Y=!0,z(o,x)):o;o=l,i+=2}}function fn(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>Jt||e.e<-Jt))throw Error(Vr+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,h=e.d;for(a=1,s=h[0];s>=10;s/=10)a++;if(n=t-a,n<0)n+=X,i=t,f=h[u=0];else{if(u=Math.ceil((n+1)/X),s=h.length,u>=s)return e;for(f=s=h[u],a=1;s>=10;s/=10)a++;n%=X,i=n-X+a}if(r!==void 0&&(s=We(10,a-i-1),o=f/s%10|0,l=t<0||h[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/We(10,a-i):0:h[u-1])%10&1||r==(e.s<0?8:7))),t<1||!h[0])return l?(s=re(e),h.length=1,t=t-s-1,h[0]=We(10,(X-t%X)%X),e.e=ot(-t/X)||0):(h.length=1,h[0]=e.e=e.s=0),e;if(n==0?(h.length=u,s=1,u--):(h.length=u+1,s=We(10,X-n),h[u]=i>0?(f/We(10,a-i)%We(10,i)|0)*s:0),l)for(;;)if(u==0){(h[0]+=s)==ie&&(h[0]=1,++e.e);break}else{if(h[u]+=s,h[u]!=ie)break;h[u--]=0,s=1}for(n=h.length;h[--n]===0;)h.pop();if(Y&&(e.e>Jt||e.e<-Jt))throw Error(Vr+re(e));return e}function ui(e,t){var r,n,i,s,a,o,l,f,u,h,m=e.constructor,g=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Y?z(t,g):t;if(l=e.d,h=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=h.length):(r=h,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=h.length,u=i<o,u&&(o=i),i=0;i<o;i++)if(l[i]!=h[i]){u=l[i]<h[i];break}a=0}for(u&&(r=l,l=h,h=r,t.s=-t.s),o=l.length,i=h.length-o;i>0;--i)l[o++]=0;for(i=h.length;i>a;){if(l[--i]<h[i]){for(s=i;s&&l[--s]===0;)l[s]=ie-1;--l[s],l[i]+=ie}l[i]-=h[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 m(0)}function Ze(e,t,r){var n,i=re(e),s=Ce(e.d),a=s.length;return t?(r&&(n=r-a)>0?s=s.charAt(0)+"."+s.slice(1)+Re(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Re(-i-1)+s,r&&(n=r-a)>0&&(s+=Re(n))):i>=a?(s+=Re(i+1-a),r&&(n=r-i-1)>0&&(s=s+"."+Re(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-a)>0&&(i+1===a&&(s+="."),s+=Re(n))),e.s<0?"-"+s:s}function dn(e,t){if(e.length>t)return e.length=t,!0}function fi(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 fn(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,ya.test(s))fn(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=fi,i.config=i.set=xa,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 xa(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 _r=fi(ba);fe=new _r(1);const wa={prefix:"$",precision:2,zeroDisplay:"-",format:{minimumFractionDigits:2,maximumFractionDigits:2}};function ja(e,t={}){const{prefix:r,precision:n,zeroDisplay:i,format:s}={...wa,...t};if(e===0)return i;const a=e.toLocaleString("en",s??{maximumFractionDigits:n});return`${r}${a}`}function Na(e,t,r){const n=e*t;return ja(n,r)}const Ca=(e,t,r)=>new _r(e).toDecimalPlaces(t,r).toNumber(),Oa=({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=Sr({name:e,defaultValue:""}),{setValue:u}=Xe(),h=parseFloat(f||"0"),m=Na(h,(s==null?void 0:s.price)??0,{zeroDisplay:"$0.00"}),g=y=>{u(e,y.target.value,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},E=y=>{(y.key==="ArrowUp"||y.key==="ArrowDown")&&y.preventDefault()};return c.jsxs(Yt,{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:E,placeholder:i,autoFocus:l,className:"w-2/3 bg-transparent text-right text-lg outline-none"})]}),c.jsx(si,{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:Ca(Number(s.balance),s.decimals??8)})," ",s.symbol]}),s.displayUSD&&s.price!==void 0&&c.jsxs("div",{children:[m," USD"]})]}):null]})};function Ea({items:e,onRemove:t}){const r=p.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(Dr,{bsnId:n,bsnName:i,bsnLogoUrl:s,provider:a,onRemove:t},`${n}-${a.rank}`))})}function ka({max:e,items:t=[],actionText:r,onAdd:n,onRemove:i}){const s=p.useMemo(()=>t.length,[t]);return c.jsx(Yt,{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(Hn,{counter:s,max:e,onAdd:n})]})}),s>0&&c.jsx(Ea,{items:t,onRemove:i})]})})}function Kt({title:e,children:t,className:r,hint:n}){return c.jsxs("div",{className:F.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 Sa(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 di({value:e,onEdit:t,title:r="Network Fee Rate",className:n}){return c.jsxs(Kt,{title:r,className:n,children:[c.jsxs("span",{children:[e," sats/vB"]}),t&&c.jsx(et,{size:"small",variant:"outlined",className:"h-6 w-6 pl-1 text-secondary-strokeDark",onClick:t,children:c.jsx(Sa,{size:16,className:"text-secondary-strokeDark"})})]})}function hi({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(Kt,{title:n??`${t} Network Fee`,hint:r,className:i,children:[a," ",t]})}function vi({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(Kt,{title:n??`${t} Network Fee`,hint:r,className:i,children:[a," ",t]})}function mi({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:F.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 Fa({className:e,feeRate:t,onFeeRateEdit:r,feeAmount:n,coinSymbol:i,feeAmountHint:s,total:a,totalHint:o,bbnFeeAmount:l,bbnCoinSymbol:f,bbnFeeAmountHint:u,bbnFeeDecimals:h}){return c.jsx(Yt,{className:F.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(di,{value:t,onEdit:r}),c.jsx(hi,{amount:n,coinSymbol:i,hint:s}),l!==void 0&&f?c.jsx(vi,{amount:l,coinSymbol:f,hint:u,decimals:h}):null,c.jsx("div",{className:"divider my-4"}),c.jsx(mi,{total:a,coinSymbol:i,hint:o})]})})}function Aa(){const[e,t]=p.useState(!1);return p.useEffect(()=>{const r=()=>t(window.innerWidth<=640);return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e}function Da({className:e,...t}){const n=Aa()?Ln:_n;return c.jsx(n,{...t,className:F.twMerge("w-[41.25rem] max-w-full",e)})}const Va=({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(Da,{open:e,onClose:r,children:[c.jsx(Mn,{title:"Preview",onClose:r,className:"text-accent-primary"}),c.jsxs(Rn,{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(Wn,{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(qt,{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(Tn,{className:"flex gap-4 pb-8 pt-0",children:[c.jsx(et,{variant:"outlined",color:"primary",onClick:r,className:"flex-1",children:"Cancel"}),c.jsx(et,{variant:"contained",color:"primary",onClick:n,className:"flex-1",disabled:t,children:t?"Processing...":"Proceed to Signing"})]})]})},_a={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function La({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:F.twMerge("bbn-list-legacy",`bbn-list-legacy-${t}`,e),children:p.Children.map(r,n=>p.isValidElement(n)?p.cloneElement(n,{orientation:_a[t]}):n)})}function Ma({className:e,orientation:t="horizontal",title:r,value:n,suffix:i}){return c.jsxs("div",{className:F.twJoin("bbn-list-item-legacy",`bbn-list-item-legacy-${t}`,e),children:[c.jsx(Z,{as:"div",className:F.twJoin("bbn-list-title-legacy",`bbn-list-title-legacy-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(Z,{as:"div",className:F.twJoin("bbn-list-value-legacy",`bbn-list-value-legacy-${t}`),variant:"body1",children:[n,i]})]})}exports.Accordion=xi;exports.AccordionDetails=Ni;exports.AccordionSummary=wi;exports.AmountSubsection=Oa;exports.Avatar=ur;exports.AvatarGroup=Ci;exports.BBNFeeAmount=vi;exports.BTCFeeAmount=hi;exports.BTCFeeRate=di;exports.Badge=_o;exports.Button=et;exports.Card=Wn;exports.Cell=Un;exports.Checkbox=pn;exports.CheckboxField=ha;exports.Chip=no;exports.Column=$n;exports.CounterButton=Hn;exports.Dialog=_n;exports.DialogBody=Rn;exports.DialogFooter=Tn;exports.DialogHeader=Mn;exports.FeeItem=Kt;exports.FeesSection=Fa;exports.FinalityProviderItem=Dr;exports.FinalityProviderLogo=oi;exports.FinalityProviderSubsection=ka;exports.Form=la;exports.FormControl=jt;exports.Heading=qt;exports.HiddenField=si;exports.IconButton=lr;exports.Input=Xt;exports.List=Do;exports.ListItem=Vo;exports.ListItemLegacy=Ma;exports.ListLegacy=La;exports.Loader=io;exports.Menu=To;exports.MenuDrawer=wr;exports.MenuItem=Po;exports.MobileDialog=Ln;exports.NumberField=fa;exports.Popover=br;exports.Portal=Zt;exports.PreviewModal=Va;exports.Radio=gn;exports.RadioField=va;exports.ScrollLocker=ro;exports.Select=yr;exports.SelectField=ma;exports.SubMenu=Bo;exports.SubMenuItem=Io;exports.SubSection=Yt;exports.Table=So;exports.TableElement=ga;exports.Text=Z;exports.TextField=da;exports.Toggle=Fo;exports.Total=mi;exports.useField=Ye;exports.useFieldState=ca;exports.useFormContext=Xe;exports.useFormState=kr;exports.useMenuContext=xr;exports.useWatch=Sr;
|
|
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;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|